diff --git a/Makefile.am b/Makefile.am index 055656a874..522df65b05 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,9 +4,7 @@ include $(top_srcdir)/Makefile.decl SRC_SUBDIRS = gdk-pixbuf gdk gtk modules demos tests perf contrib SUBDIRS = po po-properties $(SRC_SUBDIRS) docs m4macros build -# require automake 1.4 -AUTOMAKE_OPTIONS = 1.7 -ACLOCAL_AMFLAGS = -I m4 +ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} EXTRA_DIST += \ HACKING \ @@ -50,14 +48,10 @@ EXTRA_DIST += \ examples/buttons/info.xpm \ examples/calendar/Makefile \ examples/calendar/calendar.c \ - examples/clist/Makefile \ - examples/clist/clist.c \ examples/entry/Makefile \ examples/entry/entry.c \ examples/eventbox/Makefile \ examples/eventbox/eventbox.c \ - examples/filesel/Makefile \ - examples/filesel/filesel.c \ examples/gtkdial/Makefile \ examples/gtkdial/dial_test.c \ examples/gtkdial/gtkdial.c \ @@ -68,11 +62,8 @@ EXTRA_DIST += \ examples/helloworld2/helloworld2.c \ examples/label/Makefile \ examples/label/label.c \ - examples/list/Makefile \ - examples/list/list.c \ examples/menu/Makefile \ examples/menu/menu.c \ - examples/menu/itemfactory.c \ examples/notebook/Makefile \ examples/notebook/notebook.c \ examples/packbox/Makefile \ @@ -102,14 +93,10 @@ EXTRA_DIST += \ examples/statusbar/statusbar.c \ examples/table/Makefile \ examples/table/table.c \ - examples/text/Makefile \ - examples/text/text.c \ examples/tictactoe/Makefile \ examples/tictactoe/tictactoe.c \ examples/tictactoe/tictactoe.h \ examples/tictactoe/ttt_test.c \ - examples/tree/Makefile \ - examples/tree/tree.c \ examples/wheelbarrow/Makefile \ examples/wheelbarrow/wheelbarrow.c \ examples/fixed/fixed.c \ @@ -143,37 +130,37 @@ MAINTAINERCLEANFILES = \ GDKTARGET=@gdktarget@ ## Copy .pc files to target-specific names -gtk+-$(GDKTARGET)-2.0.pc: gtk+-2.0.pc - rm -f gtk+-$(GDKTARGET)-2.0.pc && \ - cp gtk+-2.0.pc gtk+-$(GDKTARGET)-2.0.pc +gtk+-$(GDKTARGET)-3.0.pc: gtk+-3.0.pc + rm -f gtk+-$(GDKTARGET)-3.0.pc && \ + cp gtk+-3.0.pc gtk+-$(GDKTARGET)-3.0.pc -gdk-$(GDKTARGET)-2.0.pc: gdk-2.0.pc - rm -f gdk-$(GDKTARGET)-2.0.pc && \ - cp gdk-2.0.pc gdk-$(GDKTARGET)-2.0.pc +gdk-$(GDKTARGET)-3.0.pc: gdk-3.0.pc + rm -f gdk-$(GDKTARGET)-3.0.pc && \ + cp gdk-3.0.pc gdk-$(GDKTARGET)-3.0.pc -gtk+-$(GDKTARGET)-2.0-uninstalled.pc: gtk+-2.0-uninstalled.pc - rm -f gtk+-$(GDKTARGET)-2.0-uninstalled.pc && \ - cp gtk+-2.0-uninstalled.pc gtk+-$(GDKTARGET)-2.0-uninstalled.pc +gtk+-$(GDKTARGET)-3.0-uninstalled.pc: gtk+-3.0-uninstalled.pc + rm -f gtk+-$(GDKTARGET)-3.0-uninstalled.pc && \ + cp gtk+-3.0-uninstalled.pc gtk+-$(GDKTARGET)-3.0-uninstalled.pc -gdk-$(GDKTARGET)-2.0-uninstalled.pc: gdk-2.0-uninstalled.pc - rm -f gdk-$(GDKTARGET)-2.0-uninstalled.pc && \ - cp gdk-2.0-uninstalled.pc gdk-$(GDKTARGET)-2.0-uninstalled.pc +gdk-$(GDKTARGET)-3.0-uninstalled.pc: gdk-3.0-uninstalled.pc + rm -f gdk-$(GDKTARGET)-3.0-uninstalled.pc && \ + cp gdk-3.0-uninstalled.pc gdk-$(GDKTARGET)-3.0-uninstalled.pc pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA= gdk-pixbuf-2.0.pc gdk-$(GDKTARGET)-2.0.pc gtk+-$(GDKTARGET)-2.0.pc gail.pc +pkgconfig_DATA = gdk-pixbuf-3.0.pc gdk-$(GDKTARGET)-3.0.pc gtk+-$(GDKTARGET)-3.0.pc gail-3.0.pc if OS_UNIX -pkgconfig_DATA += gtk+-unix-print-2.0.pc +pkgconfig_DATA += gtk+-unix-print-3.0.pc endif DISTCLEANFILES = \ - gtk+-unix-print-2.0.pc \ - gtk+-$(GDKTARGET)-2.0.pc \ - gdk-$(GDKTARGET)-2.0.pc \ - gail.pc \ - gtk+-$(GDKTARGET)-2.0-uninstalled.pc \ - gdk-$(GDKTARGET)-2.0-uninstalled.pc \ - gail-uninstalled.pc \ + gtk+-unix-print-3.0.pc \ + gtk+-$(GDKTARGET)-3.0.pc \ + gdk-$(GDKTARGET)-3.0.pc \ + gail-3.0.pc \ + gtk+-$(GDKTARGET)-3.0-uninstalled.pc \ + gdk-$(GDKTARGET)-3.0-uninstalled.pc \ + gail-3.0-uninstalled.pc \ config.lt distclean-local: @@ -195,21 +182,21 @@ ChangeLog: echo A git checkout and git-log is required to generate this file >> $@); \ fi -## copy the default target for this platform to gdk-2.0.pc and gtk+-2.0.pc +## copy the default target for this platform to gdk-3.0.pc and gtk+-3.0.pc DEFAULT_GDKTARGET=x11 install-data-hook: (cd $(DESTDIR)$(pkgconfigdir) && \ - test -f gdk-$(DEFAULT_GDKTARGET)-2.0.pc && \ - test -f gtk+-$(DEFAULT_GDKTARGET)-2.0.pc && \ - rm -f gdk-2.0.pc && cp -f gdk-$(DEFAULT_GDKTARGET)-2.0.pc gdk-2.0.pc && \ - rm -f gtk+-2.0.pc && cp -f gtk+-$(DEFAULT_GDKTARGET)-2.0.pc gtk+-2.0.pc) || \ + test -f gdk-$(DEFAULT_GDKTARGET)-3.0.pc && \ + test -f gtk+-$(DEFAULT_GDKTARGET)-3.0.pc && \ + rm -f gdk-3.0.pc && cp -f gdk-$(DEFAULT_GDKTARGET)-3.0.pc gdk-3.0.pc && \ + rm -f gtk+-3.0.pc && cp -f gtk+-$(DEFAULT_GDKTARGET)-3.0.pc gtk+-3.0.pc) || \ (cd $(DESTDIR)$(pkgconfigdir) && \ - rm -f gdk-2.0.pc && cp -f gdk-$(GDKTARGET)-2.0.pc gdk-2.0.pc && \ - rm -f gtk+-2.0.pc && cp -f gtk+-$(GDKTARGET)-2.0.pc gtk+-2.0.pc) + rm -f gdk-3.0.pc && cp -f gdk-$(GDKTARGET)-3.0.pc gdk-3.0.pc && \ + rm -f gtk+-3.0.pc && cp -f gtk+-$(GDKTARGET)-3.0.pc gtk+-3.0.pc) uninstall-local: - rm -f $(DESTDIR)$(pkgconfigdir)/gdk-2.0.pc - rm -f $(DESTDIR)$(pkgconfigdir)/gtk+-2.0.pc + rm -f $(DESTDIR)$(pkgconfigdir)/gdk-3.0.pc + rm -f $(DESTDIR)$(pkgconfigdir)/gtk+-3.0.pc dist-hook: if test -f $(srcdir)/INSTALL.in && test -f $(srcdir)/README.in ; then \ @@ -243,7 +230,11 @@ sanity: snapshot: $(MAKE) dist distdir=$(PACKAGE)-snap`date +"%Y%m%d"` -DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-man --disable-rebuilds --enable-introspection +DISTCHECK_CONFIGURE_FLAGS = \ + --enable-gtk-doc \ + --enable-man \ + --disable-rebuilds \ + --enable-introspection GITIGNOREFILES = \ po-properties/Makefile.in.in \ diff --git a/NEWS b/NEWS index 69b8b2489b..e1e9853f44 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,174 @@ +Overview of Changes from GTK+ 2.90.1 to 2.90.2 +============================================== + +* GtkApplication: an application class, based on GApplication. Currently, + this is fairly minimal, but it is good enough already to replace libunique. + Future work: + - Add a way to say "This is my application menubar", which gets + put into all toplevel windows on non-OS-X, and into the top + on OS X + - Support session management + - Maybe support application settings + +* Misc new api: + - gtk_window_has_group: determines if a window is part of a window group + - gtk_status_bar_remove_all: removes all messages from a statusbar + +* DND on offscreen windows works now + +* GtkIconView: + - arrow keynav can now be connected over adjacent icon views + +* GtkAssistant: + - gtk_assistant_commits: prevents going back beyond a certain + point in the page sequence, adjust shown buttons appropriately + - It is now officially supported to have a progress page at the + end of the page sequence + +* Introspection: + - Many annotation fixes + - gdkx.h api is exported in a separate typelib, GdkX11-3.0 + +* Cleanups: + - the draw_string function has been removed from GtkStyle + - gdk_get/set_use_xshm have been removed + - Deprecated gdk_color api has been removed + +* Documentation related to GTK+ 1.2, etc has been removed. Instead + there is an initial GTK+ 3 porting guide now. + +* Bugs fixed: + 620509 Progress bar rendering is broken + 607628 DnD operation doesn't work when using offscreen. + 619838 kill off references to gtk 1.2 in docs/comments + 608218 GtkOffscreenWindow causes bad window with GtkEntry + 619649 Remove deprecated code from GdkColor + 619080 text-inserted events should not be emitted unless text... + 620511 Use g_source_set_name for all custom GSources in GTK+ + 603637 gtk printer dialog does not show remote printer + 618271 Add gtk_window_has_group() + 617863 Actually expose the X11 funcs through introspection + 620244 misprint in the description of the function gtk_widget_list_... + 549127 Print error dialog not shown + 611709 gseal hides GtkStatusBar->messages but doesn't give anything... + 596428 GtkAssistant: Support ending with a progress page + +* Translation updates: +Esperanto +Hebrew +Irish + + +Overview of Changes from GTK+ 2.90.0 to 2.90.1 +============================================== + +* Printing: The list of locales using US Letter papersize has + been updated to match the CLDR 1.8.1 + +* The default location for the 'module cache' files (ie the files + produced by gdk-pixbuf-query-loaders and gtk-query-immodules) has + been changed to $libdir/gtk-3.0/3.0.0/{loaders,immodules}.cache. + This should avoid multilib problems with the previous location. + + Additionally, the query utilities accept an --update-cache argument + to update the cache file directly, instead of writing to stdout + +* gtk_radio_action_join_group: A binding-friendly way to manage + radio actions. + +* GtkAdjustment enforces values to the range [lower, upper - page_size] + +* GDK has been GSEALed, with the addition of suitable accessors + +* The XI2 branch with better support for multiple input devices has + been merged, together with backends for XInput, XInput2, win32 and + Quartz, and corresponding updates to input-device handling code + in GTK. + +* A number of orientable widgets are no longer abstract: GtkBox, + GtkButtonBox, GtkPaned, GtkRuler, GtkScale, GtkScrollbar, GtkSeparator. + All of these can now be instantiated and flipped between horizontal + and vertical orientation at runtime. Their H/V subclasses are still + available, as convenience API. + +* More deprecated API has been removed + +* Bugs fixes: + 613132 GtkBoxChild should probably be deprecated + 592580 GDK needs sealing + 618870 GTK+ uses wrong pkg-config to reveal the CAIRO_PREFIX + 616817 Remove code to support deprecated GtkToolbar api + 619114 undefined reference to `XkbBell' + 617863 Actually expose the X11 funcs through introspection + 613302 GtkWidget not emitting the unmap signal + 565559 Incorrect leave-notify signals for treeview + 533946 GtkHScale does not update correctly + 618000 Sync paper size fallbacks with CLDR 1.8.1 + 614581 Gtk print dialog freezes on start up + 551322 configure does not use -lm in jasper (JPEG2000) testing + 619474 Fixes for GtkAdjustment for GTK+ 3 + 555087 Shouldn't the return type of gtk_entry_completion_get_model... + 619385 Fix compilation warning: Do not break strict-aliasing rules + 596725 Add XInput2 support + +* Updated translations + Arabic + Estonian + Galician + Italian + Indonesian + Oriya + Shavian + + +Overview of Changes from GTK+ 2.20.x to 2.90.0 +============================================== + +* GtkExtendedLayout: Width-for-height geometry management. + This change is known to currently cause minor problems in + some applications, see + 617444 GNU emacs warnings with extended layout GTK+ + 617556 inkscape toolbars broken with extended layout + +* gtk_icon_theme_load_symbolic: Support for 'symbolic' icons + +* Applications can indicate their preference for a dark theme + variant by setting GtkSettings::gtk-application-prefer-dark-theme + +* GtkTreeModelFilter can be more usefully subclassed + +* Tooltip positioning has been changed to make it less likely + that the tooltip covers up the widget that it relates to + +* Deprecated functions have been removed (though some more work + remains to be done in GDK) + +* This release is parallel installable with GTK+ <= 2.22, by renaming + .pc files, libraries, include paths, module paths, gtkrc files, etc + to include a '3.0' in its name. + +* Updated translations: + Basque + Bengali + Bengali India + Catalan + Catalan (Valencian) + Crimean Tatar + Danish + Dutch + Galician + Greek + Indonesian + Kannada + Kazakh + Latvian + Marathi + Norwegian bokmål + Spanish + Thai + Ukrainian + + Overview of Changes from GTK+ 2.19.7 to 2.20.0 ============================================== diff --git a/README.in b/README.in index f7108acbe7..bcd8c4efba 100644 --- a/README.in +++ b/README.in @@ -111,15 +111,11 @@ Release notes for 2.14 to GTK_SENSITIVITY_ON, so that the button is always sensitive or GTK_SENSITIVITY_OFF to make it insensitive respectively. -* In the early 2.14.x releases, GtkAdjustment was changed to enforce - that values are restricted to the range [lower, upper - page_size]. - This has always been the documented behaviour, and the recommended - practice is to set page_size to 0 when using adjustments for simple - scalar values, like in a slider or spin button. - Due to the large number of applications that are affected by this - change, the behaviour has been reverted to the old behaviour in - 2.14.3, with an explicit warning that this change will be - reintroduced in 2.90. +* GtkAdjustment now enforces that values are restricted to the + range [lower, upper - page_size]. This has always been the documented + behaviour, and the recommended practice is to set page_size to 0 + when using adjustments for simple scalar values, like in a slider + or spin button. * gdk-pixbuf will use GIO for mime type detection if possible. For this to work, shared-mime-info needs to be installed and XDG_DATA_DIRS diff --git a/autogen.sh b/autogen.sh index ec767e5c6c..4bdce3bcaf 100755 --- a/autogen.sh +++ b/autogen.sh @@ -19,14 +19,14 @@ if libtoolize --version < /dev/null > /dev/null 2>&1 ; then sed -e 's/^\(.*\)([^)]*)\(.*\)$/\1\2/g' \ -e 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'` case $libtool_version in - 1.4*|1.5*|2.2*) + 2.2*) have_libtool=true ;; esac fi if $have_libtool ; then : ; else echo - echo "You must have libtool 1.4 installed to compile $PROJECT." + echo "You must have libtool 2.2 installed to compile $PROJECT." echo "Install the appropriate package for your distribution," echo "or get the source tarball at http://ftp.gnu.org/gnu/libtool/" DIE=1 @@ -54,18 +54,14 @@ if automake-1.11 --version < /dev/null > /dev/null 2>&1 ; then else if automake-1.10 --version < /dev/null > /dev/null 2>&1 ; then AUTOMAKE=automake-1.10 ACLOCAL=aclocal-1.10 -else if automake-1.7 --version < /dev/null > /dev/null 2>&1 ; then - AUTOMAKE=automake-1.7 - ACLOCAL=aclocal-1.7 else echo - echo "You must have automake 1.7.x, 1,10.x or 1.11.x installed to compile $PROJECT." + echo "You must have automake 1,10.x or 1.11.x installed to compile $PROJECT." echo "Install the appropriate package for your distribution," echo "or get the source tarball at http://ftp.gnu.org/gnu/automake/" DIE=1 fi fi -fi if test "$DIE" -eq 1; then exit 1 diff --git a/build/win32/vs9/Makefile.am b/build/win32/vs9/Makefile.am index 2a42a88edf..c92017fab2 100644 --- a/build/win32/vs9/Makefile.am +++ b/build/win32/vs9/Makefile.am @@ -1,6 +1,6 @@ include $(top_srcdir)/Makefile.decl -EXTRA_DIST = \ +EXTRA_DIST += \ README.txt \ gtk+.sln \ gtk+.vsprops \ diff --git a/build/win32/vs9/gtk+.vsprops b/build/win32/vs9/gtk+.vsprops index 0b9f7086b9..95971f0f62 100644 --- a/build/win32/vs9/gtk+.vsprops +++ b/build/win32/vs9/gtk+.vsprops @@ -31,7 +31,7 @@ copy ..\..\..\gdk\gdkconfig.h.win32 ..\..\..\gdk\gdkconfig.h /> = glib_required_version dnl @@ -416,7 +405,7 @@ dnl ****************************************************** dnl * See whether to include shared library dependencies * dnl ****************************************************** -AC_ARG_ENABLE(explicit-deps, +AC_ARG_ENABLE(explicit-deps, [AC_HELP_STRING([--enable-explicit-deps=@<:@yes/no/auto@:>@], [use explicit dependencies in .pc files [default=auto]])],, [enable_explicit_deps=auto]) @@ -427,12 +416,12 @@ case $enable_explicit_deps in export SED deplibs_check_method=`(./libtool --config; echo 'eval echo \"$deplibs_check_method\"') | sh` if test "x$deplibs_check_method" '!=' xpass_all || test "x$enable_static" = xyes ; then - enable_explicit_deps=yes + enable_explicit_deps=yes else - enable_explicit_deps=no + enable_explicit_deps=no fi ;; - yes|no) + yes|no) ;; *) AC_MSG_ERROR([Value given to --enable-explicit-deps must be one of yes, no or auto]) ;; @@ -507,7 +496,7 @@ if test "$gtk_ok" = "yes"; then AC_DEFINE([HAVE__NL_PAPER_WIDTH], [1], [Define if _NL_PAPER_WIDTH is available]) fi - + # sigsetjmp is a macro on some platforms, so AC_CHECK_FUNCS is not reliable AC_MSG_CHECKING(for sigsetjmp) AC_TRY_LINK([#include ], [ @@ -550,7 +539,7 @@ dnl (End of adapted AM_GLIB_GNU_GETTEXT snippet.) AM_GLIB_DEFINE_LOCALEDIR(GTK_LOCALEDIR) -dnl The DU4 header files don't provide library prototypes unless +dnl The DU4 header files don't provide library prototypes unless dnl -std1 is given to the native cc. AC_MSG_CHECKING([for extra flags to get ANSI library prototypes]) @@ -614,13 +603,13 @@ AC_TRY_COMPILE([#include ], [DIR *dir;], # # Run AM_PATH_GLIB_2_0 to make sure that GLib is installed and working -# +# GLIB_PACKAGES="gobject-2.0 gmodule-no-export-2.0" AM_PATH_GLIB_2_0(glib_required_version, :, AC_MSG_ERROR([ -*** GLIB glib_required_version or better is required. The latest version of +*** GLIB glib_required_version or better is required. The latest version of *** GLIB is always available from ftp://ftp.gtk.org/pub/gtk/.]), gobject gmodule-no-export gthread) @@ -795,7 +784,7 @@ if test x$enable_modules = xno; then else AC_MSG_RESULT(yes) AC_MSG_CHECKING(whether dynamic modules work) - ## for loop is to strip newline + ## for loop is to strip newline tmp=`$PKG_CONFIG --variable=gmodule_supported gmodule-no-export-2.0` for I in $tmp; do dynworks=$I @@ -867,7 +856,7 @@ if test x$os_win32 = xno || test x$enable_gdiplus = xno; then if test x$with_libtiff != xno && test -z "$LIBTIFF"; then AC_MSG_ERROR([ -*** Checks for TIFF loader failed. You can build without it by passing +*** Checks for TIFF loader failed. You can build without it by passing *** --without-libtiff to configure but some programs using GTK+ may *** not work properly]) fi @@ -893,7 +882,7 @@ if test x$os_win32 = xno || test x$enable_gdiplus = xno; then AC_MSG_RESULT($jpeg_ok) if test "$jpeg_ok" = yes; then LIBJPEG='-ljpeg' - AC_CHECK_LIB(jpeg, jpeg_simple_progression, + AC_CHECK_LIB(jpeg, jpeg_simple_progression, AC_DEFINE(HAVE_PROGRESSIVE_JPEG, 1, [Define to 1 is libjpeg supports progressive JPEG]), AC_MSG_WARN(JPEG library does not support progressive saving.)) @@ -905,7 +894,7 @@ if test x$os_win32 = xno || test x$enable_gdiplus = xno; then if test x$with_libjpeg != xno && test -z "$LIBJPEG"; then AC_MSG_ERROR([ -*** Checks for JPEG loader failed. You can build without it by passing +*** Checks for JPEG loader failed. You can build without it by passing *** --without-libjpeg to configure but some programs using GTK+ may *** not work properly]) fi @@ -946,7 +935,7 @@ dnl Test for libpng if test x$with_libpng != xno && test -z "$LIBPNG"; then AC_MSG_ERROR([ -*** Checks for PNG loader failed. You can build without it by passing +*** Checks for PNG loader failed. You can build without it by passing *** --without-libpng to configure but many programs using GTK+ will *** not work properly. The PNG loader is also needed if you are compiling *** from CVS.]) @@ -954,12 +943,12 @@ dnl Test for libpng dnl Test for libjasper if test x$with_libjasper = xyes && test -z "$LIBJASPER"; then - AC_CHECK_LIB(jasper, jas_init, LIBJASPER=-ljasper, [], -ljpeg) + AC_CHECK_LIB(jasper, jas_init, LIBJASPER=-ljasper, [], -ljpeg -lm) fi if test x$with_libjasper = xyes && test -z "$LIBJASPER"; then AC_MSG_ERROR([ -*** Checks for JPEG2000 loader failed. You can build without it by passing +*** Checks for JPEG2000 loader failed. You can build without it by passing *** --without-libjasper to configure]) fi @@ -983,7 +972,7 @@ AC_ARG_WITH(included_loaders, [ --with-included-loaders=LOADER1,LOADER2,... build the specified loaders into gdk-pixbuf]) -if $dynworks; then +if $dynworks; then : else ## if the option was specified, leave it; otherwise disable included loaders @@ -1081,21 +1070,21 @@ if test x$gio_can_sniff = x; then AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include static const gsize data_size = 159; - static const guint8 data[] = + static const guint8 data[] = { - 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, - 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, - 0x08, 0x02, 0x00, 0x00, 0x00, 0x90, 0x77, 0x53, 0xde, 0x00, 0x00, 0x00, - 0x01, 0x73, 0x52, 0x47, 0x42, 0x00, 0xae, 0xce, 0x1c, 0xe9, 0x00, 0x00, - 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0b, 0x13, 0x00, 0x00, - 0x0b, 0x13, 0x01, 0x00, 0x9a, 0x9c, 0x18, 0x00, 0x00, 0x00, 0x07, 0x74, - 0x49, 0x4d, 0x45, 0x07, 0xd8, 0x07, 0x0f, 0x10, 0x08, 0x15, 0x61, 0xd8, - 0x35, 0x37, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, - 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x00, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, - 0x81, 0x0e, 0x17, 0x00, 0x00, 0x00, 0x0c, 0x49, 0x44, 0x41, 0x54, 0x08, - 0xd7, 0x63, 0xf8, 0xff, 0xff, 0x3f, 0x00, 0x05, 0xfe, 0x02, 0xfe, 0xdc, - 0xcc, 0x59, 0xe7, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, + 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, + 0x08, 0x02, 0x00, 0x00, 0x00, 0x90, 0x77, 0x53, 0xde, 0x00, 0x00, 0x00, + 0x01, 0x73, 0x52, 0x47, 0x42, 0x00, 0xae, 0xce, 0x1c, 0xe9, 0x00, 0x00, + 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0b, 0x13, 0x00, 0x00, + 0x0b, 0x13, 0x01, 0x00, 0x9a, 0x9c, 0x18, 0x00, 0x00, 0x00, 0x07, 0x74, + 0x49, 0x4d, 0x45, 0x07, 0xd8, 0x07, 0x0f, 0x10, 0x08, 0x15, 0x61, 0xd8, + 0x35, 0x37, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, + 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x00, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, + 0x81, 0x0e, 0x17, 0x00, 0x00, 0x00, 0x0c, 0x49, 0x44, 0x41, 0x54, 0x08, + 0xd7, 0x63, 0xf8, 0xff, 0xff, 0x3f, 0x00, 0x05, 0xfe, 0x02, 0xfe, 0xdc, + 0xcc, 0x59, 0xe7, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 }; int @@ -1103,9 +1092,10 @@ if test x$gio_can_sniff = x; then { char *content_type; char *image_png; - content_type = g_content_type_guess (NULL, data, data_size, NULL); + g_type_init (); + content_type = g_content_type_guess (NULL, data, data_size, NULL); image_png = g_content_type_from_mime_type ("image/png"); - return !!strcmp (content_type, image_png); + return !!g_strcmp0 (content_type, image_png); }]])], [gio_can_sniff=yes AC_DEFINE(GDK_PIXBUF_USE_GIO_MIME, 1, [Define if gio can sniff image data])], @@ -1128,7 +1118,7 @@ AC_ARG_WITH(included_immodules, [ --with-included-immodules=MODULE1,MODULE2,... build the specified input methods into gtk]) -if $dynworks; then +if $dynworks; then : else ## if the option was specified, leave it; otherwise disable included immodules @@ -1221,7 +1211,7 @@ fi # support. # AC_CHECK_HEADER(sys/systeminfo.h, - AC_DEFINE(HAVE_SYS_SYSTEMINFO_H, 1, + AC_DEFINE(HAVE_SYS_SYSTEMINFO_H, 1, [Define to 1 if sys/systeminfo.h is available])) AC_CHECK_HEADER(sys/sysinfo.h, AC_DEFINE(HAVE_SYS_SYSINFO_H, 1, @@ -1258,10 +1248,10 @@ AM_CONDITIONAL(USE_MEDIALIB25, test $use_mlib25 = yes) AC_MSG_CHECKING(for x86 platform) case $host_cpu in i386|i486|i586|i686|i786|k6|k7) - use_x86_asm=yes + use_x86_asm=yes ;; *) - use_x86_asm=no + use_x86_asm=no esac AC_MSG_RESULT($use_x86_asm) @@ -1269,7 +1259,7 @@ use_mmx_asm=no if test $use_x86_asm = yes; then save_ac_ext=$ac_ext ac_ext=S - + AC_MSG_CHECKING(compiler support for MMX) cp $srcdir/gdk-pixbuf/pixops/scale_line_22_33_mmx.S conftest.S if AC_TRY_EVAL(ac_compile); then @@ -1307,11 +1297,11 @@ if test $cross_compiling = yes; then fi fi -if test ! -f $srcdir/gtk/gtkbuiltincache.h && +if test ! -f $srcdir/gtk/gtkbuiltincache.h && test "x$REBUILD_PNGS" = "x#" ; then AC_MSG_ERROR([ *** gtkbuiltincache.h is not in the tree, and cannot be built -*** because you don't have libpng, or (when cross-compiling) you +*** because you don't have libpng, or (when cross-compiling) you *** don't have a prebuilt gtk-update-icon-cache on the build system.]) fi @@ -1319,7 +1309,7 @@ AC_SUBST(REBUILD_PNGS) GDK_PIXBUF_PACKAGES="gmodule-no-export-2.0 gobject-2.0 gio-2.0" GDK_PIXBUF_EXTRA_LIBS="$STATIC_LIB_DEPS $MATH_LIB $MEDIA_LIB" -GDK_PIXBUF_EXTRA_CFLAGS= +GDK_PIXBUF_EXTRA_CFLAGS= GDK_PIXBUF_DEP_LIBS="`$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES` $GDK_PIXBUF_EXTRA_LIBS" GDK_PIXBUF_DEP_CFLAGS="`$PKG_CONFIG --cflags gthread-2.0 $GDK_PIXBUF_PACKAGES $PNG_DEP_CFLAGS_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS" @@ -1330,10 +1320,10 @@ GDK_PIXBUF_DEP_CFLAGS="`$PKG_CONFIG --cflags gthread-2.0 $GDK_PIXBUF_PACKAGES $ GDK_PIXBUF_XLIB_PACKAGES= GDK_PIXBUF_XLIB_EXTRA_CFLAGS= GDK_PIXBUF_XLIB_EXTRA_LIBS= - + GDK_EXTRA_LIBS="$GDK_WLIBS" GDK_EXTRA_CFLAGS= - + # GTK+ uses some X calls, so needs to link against X directly GTK_DEP_PACKAGES_FOR_X= GTK_DEP_LIBS_FOR_X= @@ -1358,17 +1348,17 @@ if test "x$gdktarget" = "xx11"; then X_PACKAGES="$X_PACKAGES x11 xext xrender" x_libs="`$PKG_CONFIG --libs x11 xext xrender`" X_CFLAGS="`$PKG_CONFIG --cflags x11 xext xrender`" - + # Strip out any .la files that pkg-config might give us (this happens # with -uninstalled.pc files) x_libs_for_checks= for I in $x_libs ; do - case $I in + case $I in *.la) ;; *) x_libs_for_checks="$x_libs_for_checks $I" ;; esac done - + GDK_PIXBUF_XLIB_PACKAGES="x11" GTK_PACKAGES_FOR_X="x11" else @@ -1377,7 +1367,7 @@ if test "x$gdktarget" = "xx11"; then if test x$no_x = xyes ; then AC_MSG_ERROR([X development libraries not found]) fi - + x_cflags="$X_CFLAGS" x_libs_for_checks="$X_LIBS -lXext -lXrender -lX11 $X_EXTRA_LIBS" @@ -1394,7 +1384,7 @@ if test "x$gdktarget" = "xx11"; then gtk_save_LIBS=$LIBS LIBS="$x_libs_for_checks $LIBS" - + # Sanity check for the X11 and Xext libraries. While everything we need from # Xext is optional, the chances a system has *none* of these things is so # small that we just unconditionally require it. @@ -1426,9 +1416,9 @@ if test "x$gdktarget" = "xx11"; then # Generic X11R6 check needed for XIM support; we could # probably use this to replace the above, but we'll - # leave the separate checks for XConvertCase and XInternAtoms + # leave the separate checks for XConvertCase and XInternAtoms # for clarity - + have_x11r6=false AC_CHECK_FUNC(XAddConnectionWatch, have_x11r6=true) @@ -1458,7 +1448,7 @@ if test "x$gdktarget" = "xx11"; then # X SYNC check gtk_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $x_cflags" - + AC_CHECK_FUNC(XSyncQueryExtension, [AC_CHECK_HEADER(X11/extensions/sync.h, AC_DEFINE(HAVE_XSYNC, 1, [Have the SYNC extension library]), @@ -1473,9 +1463,9 @@ if test "x$gdktarget" = "xx11"; then AC_CHECK_FUNC(XShmAttach, :, # On AIX, it is in XextSam instead - [AC_CHECK_LIB(XextSam, XShmAttach, + [AC_CHECK_LIB(XextSam, XShmAttach, [GTK_ADD_LIB(x_extra_libs,XextSam)])]) - fi + fi if test "x$enable_shm" = "xyes"; then # Check for shared memory @@ -1489,7 +1479,7 @@ if test "x$gdktarget" = "xx11"; then no_sys_shm=yes) # Check for the X shared memory extension header file - have_xshm=no + have_xshm=no AC_MSG_CHECKING(X11/extensions/XShm.h) if test "x$no_xext_lib" = "xyes"; then : @@ -1518,17 +1508,17 @@ if test "x$gdktarget" = "xx11"; then # Check for Xinerama extension (Solaris impl or Xfree impl) gtk_save_cppflags="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $x_cflags" - + # Check for XFree AC_MSG_CHECKING(for Xinerama support on XFree86) - + have_xfree_xinerama=false if $PKG_CONFIG --exists xinerama ; then have_xfree_xinerama=true X_PACKAGES="$X_PACKAGES xinerama" - else + else AC_CHECK_LIB(Xinerama, XineramaQueryExtension, - [AC_CHECK_HEADER(X11/extensions/Xinerama.h, + [AC_CHECK_HEADER(X11/extensions/Xinerama.h, [GTK_ADD_LIB(x_extra_libs,Xinerama) have_xfree_xinerama=true], :, [#include ])]) @@ -1547,13 +1537,13 @@ if test "x$gdktarget" = "xx11"; then *-*-solaris*) # Check for solaris AC_MSG_CHECKING(for Xinerama support on Solaris) - + have_solaris_xinerama=false AC_CHECK_FUNC(XineramaGetInfo, [AC_CHECK_HEADER(X11/extensions/xinerama.h, - [have_solaris_xinerama=true], :, + [have_solaris_xinerama=true], :, [#include ])]) - + if $have_solaris_xinerama ; then AC_DEFINE(HAVE_SOLARIS_XINERAMA, 1, [Define to 1 if solaris xinerama is available]) @@ -1569,24 +1559,24 @@ if test "x$gdktarget" = "xx11"; then esac fi fi - - # set up things for XInput - if test "x$with_xinput" = "xxfree" || test "x$with_xinput" = "xyes"; then + # set up things for XInput + if test "x$with_xinput" != "xno" && $PKG_CONFIG --exists "xi" ; then AC_DEFINE(XINPUT_XFREE, 1, [Define to 1 if XFree XInput should be used]) - - if $PKG_CONFIG --exists xi ; then - X_PACKAGES="$X_PACKAGES xi" - else - GTK_ADD_LIB(x_extra_libs, Xi) - fi + + X_PACKAGES="$X_PACKAGES xi" + + AC_CHECK_HEADER(X11/extensions/XInput2.h, + have_xinput2=yes; AC_DEFINE(XINPUT_2, 1, [Define to 1 if XInput 2.0 is available])) else AC_DEFINE(XINPUT_NONE, 1, [Define to 1 if no XInput should be used]) fi - AM_CONDITIONAL(XINPUT_XFREE, test x$with_xinput = xxfree || test x$with_xinput = xyes) + AM_CONDITIONAL(XINPUT_NONE, test "x$with_xinput" = "xno") + AM_CONDITIONAL(XINPUT_XFREE, test "x$with_xinput" != "xno") + AM_CONDITIONAL(XINPUT_2, test "x$have_xinput2" = "xyes") # Check for the RANDR extension if $PKG_CONFIG --exists "xrandr >= 1.2.99" ; then @@ -1594,20 +1584,20 @@ if test "x$gdktarget" = "xx11"; then X_PACKAGES="$X_PACKAGES xrandr" fi - + # Checks for Xcursor library - + if $PKG_CONFIG --exists xcursor ; then AC_DEFINE(HAVE_XCURSOR, 1, [Have the Xcursor library]) - + X_PACKAGES="$X_PACKAGES xcursor" fi # Checks for XFixes extension - + if $PKG_CONFIG --exists xfixes ; then AC_DEFINE(HAVE_XFIXES, 1, [Have the XFIXES X extension]) - + X_PACKAGES="$X_PACKAGES xfixes" GTK_PACKAGES_FOR_X="$GTK_PACKAGES_FOR_X xfixes" fi @@ -1644,6 +1634,7 @@ else XPACKAGES= AM_CONDITIONAL(XINPUT_XFREE, false) + AM_CONDITIONAL(XINPUT_2, false) AM_CONDITIONAL(USE_X11, false) AM_CONDITIONAL(HAVE_X11R6, false) fi @@ -1778,7 +1769,7 @@ if test "x$gdktarget" = "xx11"; then GTK_PACKAGES="$GTK_PACKAGES pangoft2" fi GTK_EXTRA_LIBS= -GTK_EXTRA_CFLAGS= +GTK_EXTRA_CFLAGS= GTK_DEP_LIBS="$GDK_EXTRA_LIBS $GTK_DEP_LIBS_FOR_X `$PKG_CONFIG --libs $GDK_PIXBUF_PACKAGES $PANGO_PACKAGES $GTK_PACKAGES_FOR_X $GTK_PACKAGES` $GTK_EXTRA_LIBS $GDK_PIXBUF_EXTRA_LIBS" GTK_DEP_CFLAGS="`$PKG_CONFIG --cflags gthread-2.0 $GDK_PIXBUF_PACKAGES $GDK_PACKAGES $GTK_PACKAGES` $GDK_PIXBUF_EXTRA_CFLAGS $GDK_EXTRA_CFLAGS $GTK_EXTRA_CFLAGS" @@ -1789,7 +1780,7 @@ fi GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`" ATK_PREFIX="`$PKG_CONFIG --variable=prefix atk`" PANGO_PREFIX="`$PKG_CONFIG --variable=prefix pango`" -CAIRO_PREFIX="`pkg-config --variable=prefix cairo`" +CAIRO_PREFIX="`$PKG_CONFIG --variable=prefix cairo`" if test $enable_explicit_deps != yes ; then GDK_PIXBUF_EXTRA_LIBS= @@ -1832,7 +1823,7 @@ AC_CHECK_MEMBER([struct sockaddr_un.sun_len], [#include #include ] ) -case $struct_sockaddr_un_sun_len in +case $struct_sockaddr_un_sun_len in true) AC_DEFINE_UNQUOTED(HAVE_SOCKADDR_UN_SUN_LEN, 1, [Have the sockaddr_un.sun_len member]) @@ -1877,7 +1868,7 @@ else 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, 1, + AC_DEFINE(HAVE_CUPS_API_1_2, 1, [Define to 1 if CUPS 1.2 API is available]) fi @@ -1942,17 +1933,17 @@ AC_CHECK_HEADER(cairo-pdf.h,,AC_MSG_ERROR([ if test "$os_win32" != "yes"; then AC_CHECK_HEADER(cairo-ps.h,,AC_MSG_ERROR([ -*** Can't find cairo-ps.h. You must build Cairo with the +*** Can't find cairo-ps.h. You must build Cairo with the *** postscript backend enabled.])) AC_CHECK_HEADER(cairo-svg.h,,AC_MSG_ERROR([ *** Can't find cairo-svg.h. You must build Cairo with the *** svg backend enabled.])) -fi +fi CPPFLAGS="$gtk_save_cppflags" - - + + AC_ARG_ENABLE(test-print-backend, [AC_HELP_STRING([--enable-test-print-backend], [build test print backend])],, @@ -1986,7 +1977,7 @@ fi # GObject introspection ################################################## -GOBJECT_INTROSPECTION_CHECK([0.6.7]) +GOBJECT_INTROSPECTION_CHECK([0.6.14]) ################################################## # Checks for gtk-doc and docbook-tools @@ -2030,7 +2021,7 @@ AC_CONFIG_COMMANDS([gdk/gdkconfig.h], [ cat > $outfile <<\_______EOF /* gdkconfig.h * - * This is a generated file. Please modify `configure.in' + * This is a generated file. Please modify `configure.ac' */ #ifndef GDKCONFIG_H @@ -2109,15 +2100,15 @@ AC_CONFIG_FILES([ config.h.win32 gtk-zip.sh Makefile -gdk-pixbuf-2.0.pc -gdk-2.0.pc -gtk+-2.0.pc -gtk+-unix-print-2.0.pc -gail.pc -gdk-pixbuf-2.0-uninstalled.pc -gdk-2.0-uninstalled.pc -gtk+-2.0-uninstalled.pc -gail-uninstalled.pc +gdk-pixbuf-3.0.pc +gdk-3.0.pc +gtk+-3.0.pc +gtk+-unix-print-3.0.pc +gail-3.0.pc +gdk-pixbuf-3.0-uninstalled.pc +gdk-3.0-uninstalled.pc +gtk+-3.0-uninstalled.pc +gail-3.0-uninstalled.pc m4macros/Makefile po/Makefile.in po-properties/Makefile.in @@ -2167,7 +2158,7 @@ modules/engines/Makefile modules/engines/pixbuf/Makefile modules/engines/ms-windows/Makefile modules/engines/ms-windows/Theme/Makefile -modules/engines/ms-windows/Theme/gtk-2.0/Makefile +modules/engines/ms-windows/Theme/gtk-3.0/Makefile modules/input/Makefile modules/printbackends/Makefile modules/printbackends/cups/Makefile @@ -2178,7 +2169,7 @@ modules/printbackends/test/Makefile perf/Makefile contrib/Makefile contrib/gdk-pixbuf-xlib/Makefile -contrib/gdk-pixbuf-xlib/gdk-pixbuf-xlib-2.0.pc +contrib/gdk-pixbuf-xlib/gdk-pixbuf-xlib-3.0.pc ]) AC_OUTPUT diff --git a/contrib/gdk-pixbuf-xlib/Makefile.am b/contrib/gdk-pixbuf-xlib/Makefile.am index 4b89e5172d..9ddcefa7df 100644 --- a/contrib/gdk-pixbuf-xlib/Makefile.am +++ b/contrib/gdk-pixbuf-xlib/Makefile.am @@ -4,7 +4,7 @@ if PLATFORM_WIN32 no_undefined = -no-undefined endif -lib_LTLIBRARIES=libgdk_pixbuf_xlib-2.0.la +lib_LTLIBRARIES=libgdk_pixbuf_xlib-3.0.la INCLUDES = \ -I$(top_srcdir) -I$(top_builddir) \ @@ -12,31 +12,31 @@ INCLUDES = \ -I$(top_srcdir)/contrib \ $(GDK_PIXBUF_XLIB_DEP_CFLAGS) -libgdk_pixbuf_xlib_2_0_la_LDFLAGS = \ +libgdk_pixbuf_xlib_3_0_la_LDFLAGS = \ -export-dynamic \ $(no_undefined) \ -version-info $(LT_VERSION_INFO) -libgdk_pixbuf_xlib_2_0_la_LIBADD = \ +libgdk_pixbuf_xlib_3_0_la_LIBADD = \ $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la \ $(GDK_PIXBUF_XLIB_DEP_LIBS) -libgdk_pixbuf_xlib_2_0_la_SOURCES = \ +libgdk_pixbuf_xlib_3_0_la_SOURCES = \ gdk-pixbuf-xlib-private.h \ gdk-pixbuf-xlib.c \ gdk-pixbuf-xlib-render.c \ gdk-pixbuf-xlib-drawable.c \ gdk-pixbuf-xlibrgb.c -libgdk_pixbuf_xlibincludedir=$(includedir)/gtk-2.0/gdk-pixbuf-xlib +libgdk_pixbuf_xlibincludedir=$(includedir)/gtk-3.0/gdk-pixbuf-xlib libgdk_pixbuf_xlibinclude_HEADERS = \ gdk-pixbuf-xlib.h \ gdk-pixbuf-xlibrgb.h pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = gdk-pixbuf-xlib-2.0.pc +pkgconfig_DATA = gdk-pixbuf-xlib-3.0.pc -EXTRA_DIST += gdk-pixbuf-xlib-2.0.pc.in +EXTRA_DIST += gdk-pixbuf-xlib-3.0.pc.in -include $(top_srcdir)/git.mk diff --git a/contrib/gdk-pixbuf-xlib/gdk-pixbuf-xlib-2.0.pc.in b/contrib/gdk-pixbuf-xlib/gdk-pixbuf-xlib-3.0.pc.in similarity index 80% rename from contrib/gdk-pixbuf-xlib/gdk-pixbuf-xlib-2.0.pc.in rename to contrib/gdk-pixbuf-xlib/gdk-pixbuf-xlib-3.0.pc.in index 5c7871d76e..b55d8562b5 100644 --- a/contrib/gdk-pixbuf-xlib/gdk-pixbuf-xlib-2.0.pc.in +++ b/contrib/gdk-pixbuf-xlib/gdk-pixbuf-xlib-3.0.pc.in @@ -6,6 +6,6 @@ includedir=@includedir@ Name: GdkPixbuf Xlib Description: GdkPixbuf rendering for Xlib Version: @VERSION@ -Requires: gobject-2.0,gmodule-no-export-2.0,gdk-pixbuf-2.0 +Requires: gobject-2.0,gmodule-no-export-2.0,gdk-pixbuf-3.0 Libs: -L${libdir} -lgdk_pixbuf_xlib-@GTK_API_VERSION@ Cflags: -I${includedir} diff --git a/demos/Makefile.am b/demos/Makefile.am index f87b3cd8b9..e51ed908e2 100644 --- a/demos/Makefile.am +++ b/demos/Makefile.am @@ -41,8 +41,8 @@ if CROSS_COMPILING pixbuf_csource=$(GDK_PIXBUF_CSOURCE) pixbuf_csource_deps= else -pixbuf_csource=GDK_PIXBUF_MODULE_FILE=$(top_builddir)/gdk-pixbuf/gdk-pixbuf.loaders $(top_builddir)/gdk-pixbuf/gdk-pixbuf-csource -pixbuf_csource_deps=$(top_builddir)/gdk-pixbuf/gdk-pixbuf-csource $(top_builddir)/gdk-pixbuf/gdk-pixbuf.loaders +pixbuf_csource=GDK_PIXBUF_MODULE_FILE=$(top_builddir)/gdk-pixbuf/loaders.cache $(top_builddir)/gdk-pixbuf/gdk-pixbuf-csource-3.0 +pixbuf_csource_deps=$(top_builddir)/gdk-pixbuf/gdk-pixbuf-csource-3.0 $(top_builddir)/gdk-pixbuf/loaders.cache endif test-inline-pixbufs.h: $(pixbuf_csource_deps) apple-red.png gnome-foot.png diff --git a/demos/gtk-demo/Makefile.am b/demos/gtk-demo/Makefile.am index 698c242c0d..ccd70f7033 100644 --- a/demos/gtk-demo/Makefile.am +++ b/demos/gtk-demo/Makefile.am @@ -1,7 +1,7 @@ ## Makefile.am for gtk+/demos include $(top_srcdir)/Makefile.decl -democodedir=$(datadir)/gtk-2.0/demo +democodedir=$(datadir)/gtk-$(GTK_API_VERSION)/demo ## These should be in the order you want them to appear in the ## demo app, which means alphabetized by demo title, not filename @@ -65,7 +65,7 @@ LDADDS = \ $(top_builddir)/gtk/$(gtktargetlib) \ $(GTK_DEP_LIBS) -bin_PROGRAMS = gtk-demo +bin_PROGRAMS = gtk3-demo BUILT_SOURCES = demos.h @@ -76,15 +76,15 @@ EXTRA_DIST += \ demos.h: @REBUILD@ $(demos) geninclude.pl (here=`pwd` ; cd $(srcdir) && $(PERL) $$here/geninclude.pl $(demos)) > demos.h -gtk_demo_SOURCES = \ +gtk3_demo_SOURCES = \ $(demos) \ demo-common.h \ main.c \ demos.h -gtk_demo_DEPENDENCIES = $(DEPS) -gtk_demo_LDADD = $(LDADDS) -gtk_demo_LDFLAGS = -export-dynamic +gtk3_demo_DEPENDENCIES = $(DEPS) +gtk3_demo_LDADD = $(LDADDS) +gtk3_demo_LDFLAGS = -export-dynamic IMAGEFILES= alphatest.png \ apple-red.png \ @@ -99,7 +99,7 @@ IMAGEFILES= alphatest.png \ gnome-gmush.png \ gnome-gsame.png \ gnu-keys.png \ - gtk-logo-rgb.gif + gtk-logo-rgb.gif democode_DATA = $(demos) $(IMAGEFILES) demo.ui diff --git a/demos/gtk-demo/appwindow.c b/demos/gtk-demo/appwindow.c index b934be8d2f..2f62d63df7 100644 --- a/demos/gtk-demo/appwindow.c +++ b/demos/gtk-demo/appwindow.c @@ -19,6 +19,16 @@ activate_action (GtkAction *action) GtkWidget *dialog; + if (g_str_equal (name, "DarkTheme")) + { + gboolean value = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)); + GtkSettings *settings = gtk_settings_get_default (); + + g_object_set (G_OBJECT (settings), + "gtk-application-prefer-dark-theme", value, + NULL); + return; + } dialog = gtk_message_dialog_new (GTK_WINDOW (window), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, @@ -212,6 +222,11 @@ static GtkToggleActionEntry toggle_entries[] = { "Bold", /* tooltip */ G_CALLBACK (activate_action), TRUE }, /* is_active */ + { "DarkTheme", NULL, /* name, stock id */ + "_Prefer Dark Theme", NULL, /* label, accelerator */ + "Prefer Dark Theme", /* tooltip */ + G_CALLBACK (activate_action), + FALSE }, /* is_active */ }; static guint n_toggle_entries = G_N_ELEMENTS (toggle_entries); @@ -265,6 +280,7 @@ static const gchar *ui_info = " " " " " " +" " " " " " " " diff --git a/demos/gtk-demo/assistant.c b/demos/gtk-demo/assistant.c index 6cb5399f6b..a00c595370 100644 --- a/demos/gtk-demo/assistant.c +++ b/demos/gtk-demo/assistant.c @@ -9,12 +9,35 @@ #include "demo-common.h" static GtkWidget *assistant = NULL; +static GtkWidget *progress_bar = NULL; + +static gboolean +apply_changes_gradually (gpointer data) +{ + gdouble fraction; + + /* Work, work, work... */ + fraction = gtk_progress_bar_get_fraction (GTK_PROGRESS_BAR (progress_bar)); + fraction += 0.05; + + if (fraction < 1.0) + { + gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (progress_bar), fraction); + return TRUE; + } + else + { + /* Close automatically once changes are fully applied. */ + gtk_widget_destroy (assistant); + return FALSE; + } +} static void on_assistant_apply (GtkWidget *widget, gpointer data) { - /* Apply here changes, this is a fictional - example, so we just do nothing here */ + /* Start a timer to simulate changes taking a few seconds to apply. */ + g_timeout_add (100, apply_changes_gradually, NULL); } static void @@ -38,6 +61,13 @@ on_assistant_prepare (GtkWidget *widget, GtkWidget *page, gpointer data) title = g_strdup_printf ("Sample assistant (%d of %d)", current_page + 1, n_pages); gtk_window_set_title (GTK_WINDOW (widget), title); g_free (title); + + /* The fourth page (counting from zero) is the progress page. The + * user clicked Apply to get here so we tell the assistant to commit, + * which means the changes up to this point are permanent and cannot + * be cancelled or revisited. */ + if (current_page == 3) + gtk_assistant_commit (GTK_ASSISTANT (widget)); } static void @@ -127,6 +157,26 @@ create_page3 (GtkWidget *assistant) g_object_unref (pixbuf); } +static void +create_page4 (GtkWidget *assistant) +{ + GtkWidget *page; + + page = gtk_alignment_new (0.5, 0.5, 0.5, 0.0); + + progress_bar = gtk_progress_bar_new (); + gtk_container_add (GTK_CONTAINER (page), progress_bar); + + gtk_widget_show_all (page); + gtk_assistant_append_page (GTK_ASSISTANT (assistant), page); + gtk_assistant_set_page_type (GTK_ASSISTANT (assistant), page, GTK_ASSISTANT_PAGE_PROGRESS); + gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), page, "Applying changes"); + + /* This prevents the assistant window from being + * closed while we're "busy" applying changes. */ + gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), page, FALSE); +} + GtkWidget* do_assistant (GtkWidget *do_widget) { @@ -142,6 +192,7 @@ do_assistant (GtkWidget *do_widget) create_page1 (assistant); create_page2 (assistant); create_page3 (assistant); + create_page4 (assistant); g_signal_connect (G_OBJECT (assistant), "cancel", G_CALLBACK (on_assistant_close_cancel), &assistant); diff --git a/demos/gtk-demo/images.c b/demos/gtk-demo/images.c index 9eaac39c0f..eb3f1d9484 100644 --- a/demos/gtk-demo/images.c +++ b/demos/gtk-demo/images.c @@ -317,6 +317,7 @@ do_images (GtkWidget *do_widget) GtkWidget *align; GtkWidget *button; GdkPixbuf *pixbuf; + GIcon *gicon; GError *error = NULL; char *filename; @@ -415,6 +416,26 @@ do_images (GtkWidget *do_widget) gtk_container_add (GTK_CONTAINER (frame), image); + /* Symbolic icon */ + + label = gtk_label_new (NULL); + gtk_label_set_markup (GTK_LABEL (label), + "Symbolic themed icon"); + gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); + + frame = gtk_frame_new (NULL); + gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); + /* The alignment keeps the frame from growing when users resize + * the window + */ + align = gtk_alignment_new (0.5, 0.5, 0, 0); + gtk_container_add (GTK_CONTAINER (align), frame); + gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 0); + + gicon = g_themed_icon_new_with_default_fallbacks ("battery-critical-charging-symbolic"); + image = gtk_image_new_from_gicon (gicon, GTK_ICON_SIZE_DIALOG); + + gtk_container_add (GTK_CONTAINER (frame), image); /* Progressive */ diff --git a/demos/gtk-demo/list_store.c b/demos/gtk-demo/list_store.c index 009cd97993..e5c72bab67 100644 --- a/demos/gtk-demo/list_store.c +++ b/demos/gtk-demo/list_store.c @@ -29,7 +29,9 @@ enum COLUMN_SEVERITY, COLUMN_DESCRIPTION, COLUMN_PULSE, + COLUMN_ICON, COLUMN_ACTIVE, + COLUMN_SENSITIVE, NUM_COLUMNS }; @@ -92,11 +94,24 @@ create_model (void) G_TYPE_STRING, G_TYPE_STRING, G_TYPE_UINT, + G_TYPE_STRING, + G_TYPE_BOOLEAN, G_TYPE_BOOLEAN); /* add data to the list store */ for (i = 0; i < G_N_ELEMENTS (data); i++) { + gchar *icon_name; + gboolean sensitive; + + if (i == 1 || i == 3) + icon_name = "battery-critical-charging-symbolic"; + else + icon_name = NULL; + if (i == 3) + sensitive = FALSE; + else + sensitive = TRUE; gtk_list_store_append (store, &iter); gtk_list_store_set (store, &iter, COLUMN_FIXED, data[i].fixed, @@ -104,7 +119,9 @@ create_model (void) COLUMN_SEVERITY, data[i].severity, COLUMN_DESCRIPTION, data[i].description, COLUMN_PULSE, 0, + COLUMN_ICON, icon_name, COLUMN_ACTIVE, FALSE, + COLUMN_SENSITIVE, sensitive, -1); } @@ -199,6 +216,19 @@ add_columns (GtkTreeView *treeview) NULL); gtk_tree_view_column_set_sort_column_id (column, COLUMN_PULSE); gtk_tree_view_append_column (treeview, column); + + /* column for symbolic icon */ + renderer = gtk_cell_renderer_pixbuf_new (); + g_object_set (G_OBJECT (renderer), "follow-state", TRUE, NULL); + column = gtk_tree_view_column_new_with_attributes ("Symbolic icon", + renderer, + "icon-name", + COLUMN_ICON, + "sensitive", + COLUMN_SENSITIVE, + NULL); + gtk_tree_view_column_set_sort_column_id (column, COLUMN_ICON); + gtk_tree_view_append_column (treeview, column); } static gboolean diff --git a/demos/gtk-demo/main.c b/demos/gtk-demo/main.c index c7492ef196..2f16a96be0 100644 --- a/demos/gtk-demo/main.c +++ b/demos/gtk-demo/main.c @@ -941,8 +941,8 @@ main (int argc, char **argv) if (g_file_test ("../../gdk-pixbuf/libpixbufloader-pnm.la", G_FILE_TEST_EXISTS)) { - g_setenv ("GDK_PIXBUF_MODULE_FILE", "../../gdk-pixbuf/gdk-pixbuf.loaders", TRUE); - g_setenv ("GTK_IM_MODULE_FILE", "../../modules/input/gtk.immodules", TRUE); + g_setenv ("GDK_PIXBUF_MODULE_FILE", "../../gdk-pixbuf/loaders.cache", TRUE); + g_setenv ("GTK_IM_MODULE_FILE", "../../modules/input/immodules.cache", TRUE); } /* -- End of hack -- */ diff --git a/demos/pixbuf-init.c b/demos/pixbuf-init.c index 898de45586..02ab7658ac 100644 --- a/demos/pixbuf-init.c +++ b/demos/pixbuf-init.c @@ -16,5 +16,5 @@ void pixbuf_init (void) { if (file_exists ("../gdk-pixbuf/libpixbufloader-pnm.la")) - g_setenv ("GDK_PIXBUF_MODULE_FILE", "../gdk-pixbuf/gdk-pixbuf.loaders", TRUE); + g_setenv ("GDK_PIXBUF_MODULE_FILE", "../gdk-pixbuf/loaders.cache", TRUE); } diff --git a/docs/RELEASE-HOWTO b/docs/RELEASE-HOWTO index f19e56828e..8aeb7b3ebd 100644 --- a/docs/RELEASE-HOWTO +++ b/docs/RELEASE-HOWTO @@ -29,9 +29,9 @@ Make sure that gtk-doc is the latest released version. 3) In particular, if this is a major, stable, release, verify that README.in contains the relevant release notes and that the required versions of dependencies in INSTALL.in are in sync - with configure.in. + with configure.ac. - 4) Verify that the version in configure.in has been bumped after the last + 4) Verify that the version in configure.ac has been bumped after the last release. (Note that this is critical, a slip-up here will cause the soname to change). @@ -78,7 +78,7 @@ Make sure that gtk-doc is the latest released version. git push origin refs/tags/2.12.10 -13) Bump the version number in configure.in and commit and push this change +13) Bump the version number in configure.ac and commit and push this change 14) Upload the tarball to master.gnome.org and run install-module to transfer it to download.gnome.org. If you don't have an account on master.gnome.org, diff --git a/docs/faq/gtk-faq.sgml b/docs/faq/gtk-faq.sgml index b03f904bb0..fddc74e858 100644 --- a/docs/faq/gtk-faq.sgml +++ b/docs/faq/gtk-faq.sgml @@ -996,11 +996,11 @@ relevant packages. These are: or on any GNU mirror. In order to use the powerful autoconf/automake scheme, -you must create a configure.in which may look like: +you must create a configure.ac which may look like: dnl Process this file with autoconf to produce a configure script. -dnl configure.in for a GTK+ based program +dnl configure.ac for a GTK+ based program AC_INIT(myprg.c) AM_INIT_AUTOMAKE(mypkgname, 0.0.1) @@ -1137,8 +1137,7 @@ myapp --display=:1 | | | +GtkCombo | | | `GtkStatusbar | | `GtkVBox - | | +GtkColorSelection - | | `GtkGammaCurve + | | `GtkColorSelection | +GtkButton | | +GtkOptionMenu | | `GtkToggleButton @@ -1160,7 +1159,6 @@ myapp --display=:1 | +GtkToolbar | `GtkTree +GtkDrawingArea - | `GtkCurve +GtkEditable | +GtkEntry | | `GtkSpinButton @@ -1629,11 +1627,7 @@ int main(int argc, char *argv[]) g_signal_connect(G_OBJECT (window), "destroy", G_CALLBACK(destroy), NULL); -#if (GTK_MAJOR_VERSION == 1) && (GTK_MINOR_VERSION == 0) - gtk_container_border_width(GTK_CONTAINER (window), 10); -#else gtk_container_set_border_width(GTK_CONTAINER (window), 10); -#endif /* add a button to do something useful */ button = gtk_button_new_with_label("Fork me!"); @@ -1898,7 +1892,7 @@ not applied you'll have to use the function. gtk_object_class_user_signal_new allows you to add a new signal to a predefined GTK+ widget without any modification of the GTK+ source code. The new signal can be -emited with gtk_signal_emit and can be +emited with g_signal_emit and can be handled in the same way as other signals. Tim Janik posted this code snippet: @@ -1920,7 +1914,7 @@ gtk_widget_user_action (GtkWidget *widget, { g_return_if_fail (GTK_IS_WIDGET (widget)); - gtk_signal_emit (GTK_OBJECT (widget), signal_user_action, act_data); + g_signal_emit (widget, signal_user_action, act_data); } @@ -2527,15 +2521,15 @@ using the following expression: If you don't want the user to be able to modify the content of this entry, you can use the -gtk_entry_set_editable() function: +gtk_editable_set_editable() function: - void gtk_entry_set_editable(GtkEntry *entry, - gboolean editable); +void gtk_editable_set_editable (GtkEditable *editable, + gboolean is_editable); -Set the editable parameter to FALSE to disable typing +Set the is_editable parameter to FALSE to disable typing into the entry. @@ -2559,10 +2553,10 @@ into the entry. signal handler with - gtk_signal_connect(GTK_COMBO(cb)->entry, - "changed", - GTK_SIGNAL_FUNC(my_cb_change_handler), - NULL); + g_signal_connect(GTK_COMBO(cb)->entry, + "changed", + G_CALLBACK(my_cb_change_handler), + NULL); @@ -2629,8 +2623,8 @@ underlined, and the relevant accelerators are created. gtk_box_pack_start (GTK_BOX (vbox1), menubar1, FALSE, FALSE, 0); file1 = gtk_menu_item_new_with_label (""); - tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (file1)->child), - _("_File")); + gtk_label_set_use_underline (GTK_LABEL (gtk_bin_get_child (GTK_BIN (file1))), + TRUE); gtk_widget_add_accelerator (file1, "activate_item", accel_group, tmp_key, GDK_MOD1_MASK, 0); gtk_object_set_data (GTK_OBJECT (window1), "file1", file1); @@ -2643,8 +2637,8 @@ underlined, and the relevant accelerators are created. gtk_menu_item_set_submenu (GTK_MENU_ITEM (file1), file1_menu); new1 = gtk_menu_item_new_with_label (""); - tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (new1)->child), - _("_New")); + gtk_label_set_use_underline (GTK_LABEL (gtk_bin_get_child (GTK_BIN (new1))), + TRUE); gtk_widget_add_accelerator (new1, "activate_item", file1_menu_accels, tmp_key, 0, 0); gtk_object_set_data (GTK_OBJECT (window1), "new1", new1); @@ -2670,9 +2664,9 @@ GtkMenuItem with: /* do stuff with child */ if (GTK_IS_LABEL (child)) { - gchar *text; + const gchar *text; - gtk_label_get (GTK_LABEL (child), &text); + text = gtk_label_get_text (GTK_LABEL (child)); g_print ("menu item text: %s\n", text); } } @@ -2864,9 +2858,9 @@ be: entry = gtk_entry_new(); - gtk_signal_connect (GTK_OBJECT(entry), "activate", - GTK_SIGNAL_FUNC(entry_callback), - NULL); + g_signal_connect (entry, "activate", + G_CALLBACK(entry_callback), + NULL); @@ -3044,8 +3038,8 @@ main (int argc, char *argv[]) gtk_container_add (GTK_CONTAINER (window), text); /* connect after everything else */ - gtk_signal_connect_after (GTK_OBJECT(text), "button_press_event", - GTK_SIGNAL_FUNC (insert_bar), NULL); + g_signal_connect_after (text, "button_press_event", + G_CALLBACK (insert_bar), NULL); gtk_widget_show_all(window); gtk_main(); @@ -3108,7 +3102,7 @@ like this: gc = gdk_gc_new(widget->window); /* find proper dimensions for rectangle */ - gdk_window_get_size(widget->window, &width, &height); + gdk_drawable_get_size(widget->window, &width, &height); /* the color we want to use */ color = (GdkColor *)malloc(sizeof(GdkColor)); @@ -3130,7 +3124,7 @@ like this: * displays. Therefore, this call is required so that GDK and X can * give us the closest color available in the colormap */ - gdk_color_alloc(gtk_widget_get_colormap(widget), color); + gdk_colormap_alloc_color(gtk_widget_get_colormap(widget), color, FALSE, TRUE); /* set the foreground to our color */ gdk_gc_set_foreground(gc, color); diff --git a/docs/gtk-config.txt b/docs/gtk-config.txt index f168ec715d..a6a0f9997f 100644 --- a/docs/gtk-config.txt +++ b/docs/gtk-config.txt @@ -152,10 +152,10 @@ and the AM_PATH_GTK macro. The program used here is the testinput.c You should first read the introductory portions of the automake Manual, if you are not already familiar with it. -Two files are needed, 'configure.in', which is used to build the +Two files are needed, 'configure.ac', which is used to build the configure script: -==configure.in=== +==configure.ac=== dnl Process this file with autoconf to produce a configure script. AC_INIT(testinput.c) diff --git a/docs/refcounting.txt b/docs/refcounting.txt index 5ebf818502..806940096f 100644 --- a/docs/refcounting.txt +++ b/docs/refcounting.txt @@ -197,7 +197,7 @@ GtkOptionMenu looks like this: /* menu_item->ref_count == 1 and it is flagged as `floating'. */ - gtk_menu_append (GTK_MENU (menu), menu_item); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item); /* menu_item->ref_count still == 1, but it is no longer `floating'. */ diff --git a/docs/reference/gdk-pixbuf/Makefile.am b/docs/reference/gdk-pixbuf/Makefile.am index 7734e72e8d..eb06b58fc6 100644 --- a/docs/reference/gdk-pixbuf/Makefile.am +++ b/docs/reference/gdk-pixbuf/Makefile.am @@ -4,7 +4,7 @@ include $(top_srcdir)/Makefile.decl AUTOMAKE_OPTIONS = 1.6 # The name of the module. -DOC_MODULE=gdk-pixbuf +DOC_MODULE=gdk-pixbuf3 # The top-level SGML file. DOC_MAIN_SGML_FILE=gdk-pixbuf.sgml @@ -56,8 +56,8 @@ content_files = \ gdk-pixbuf-rendering.sgml \ gdk-pixbuf.sgml \ porting-from-imlib.sgml \ - gdk-pixbuf-csource.xml \ - gdk-pixbuf-query-loaders.xml + gdk-pixbuf-csource-3.0.xml \ + gdk-pixbuf-query-loaders-3.0.xml # Images to copy into HTML directory HTML_IMAGES = composite.png @@ -79,21 +79,38 @@ EXTRA_DIST += version.xml.in \ ######################################################################## +man_MANS = \ + gdk-pixbuf-csource-3.0.1 \ + gdk-pixbuf-query-loaders-3.0.1 + if ENABLE_MAN -man_MANS = gdk-pixbuf-csource.1 gdk-pixbuf-query-loaders.1 - -%.1 : %.xml +.xml.1: @XSLTPROC@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< -BUILT_EXTRA_DIST = $(man_MANS) +dist-local-check-mans-enabled: + if grep "Man generation disabled" $(man_MANS) >/dev/null; then $(RM) $(man_MANS); fi + +else + +$(man_MANS): + echo Man generation disabled. Creating dummy $@. Configure with --enable-man to enable it. + echo Man generation disabled. Remove this file, configure with --enable-man, and rebuild > $@ + + +dist-local-check-mans-enabled: + echo "*** --enable-man must be used in order to make dist" + false endif -dist-hook-local: $(BUILT_EXTRA_DIST) - files='$(BUILT_EXTRA_DIST)'; \ - for f in $$files; do \ - if test -f $$f; then d=.; else d=$(srcdir); fi; \ - cp $$d/$$f $(distdir) || exit 1; done +MAINTAINERCLEANFILES = $(man_MANS) $(BUILT_SOURCES) + +EXTRA_DIST += $(man_MANS) + +dist-hook-local: dist-local-check-mans-enabled gtk-docs-clean all-local + +gtk-docs-clean: clean + cd $(srcdir) && rm -rf xml html -include $(top_srcdir)/git.mk diff --git a/docs/reference/gdk-pixbuf/gdk-pixbuf-csource.xml b/docs/reference/gdk-pixbuf/gdk-pixbuf-csource-3.0.xml similarity index 85% rename from docs/reference/gdk-pixbuf/gdk-pixbuf-csource.xml rename to docs/reference/gdk-pixbuf/gdk-pixbuf-csource-3.0.xml index 36a042385e..e353f3a0a1 100644 --- a/docs/reference/gdk-pixbuf/gdk-pixbuf-csource.xml +++ b/docs/reference/gdk-pixbuf/gdk-pixbuf-csource-3.0.xml @@ -5,23 +5,23 @@ -gdk-pixbuf-csource +gdk-pixbuf-csource-3.0 1 -gdk-pixbuf-csource +gdk-pixbuf-csource-3.0 C code generation utility for GdkPixbuf images -gdk-pixbuf-csource +gdk-pixbuf-csource-3.0 options image -gdk-pixbuf-csource +gdk-pixbuf-csource-3.0 options --build-list @@ -33,16 +33,16 @@ Description -gdk-pixbuf-csource is a small utility that generates C code -containing images, useful for compiling images directly into programs. +gdk-pixbuf-csource-3.0 is a small utility that generates +C code containing images, useful for compiling images directly into programs. Invocation -gdk-pixbuf-csource either takes as input one image file name -to generate code for, or, using the option, a -list of (name, image) +gdk-pixbuf-csource-3.0 either takes as input one image file +name to generate code for, or, using the option, +a list of (name, image) pairs to generate code for a list of images into named variables. Options @@ -151,7 +151,7 @@ Make warnings fatal (causes the program to abort). See also -The GdkPixbuf documentation, shipped with the +The GdkPixbuf documentation, shipped with the Gtk+ distribution, available from www.gtk.org. @@ -166,11 +166,11 @@ generates pixbufs with suboptimal rowstride in some cases. Author -gdk-pixbuf-csource was written by Tim Janik -timj@gtk.org. +gdk-pixbuf-csource-3.0 was written by Tim Janik +timj@gtk.org. -This manual page was provided by Tim Janik timj@gtk.org. +This manual page was provided by Tim Janik timj@gtk.org. diff --git a/docs/reference/gdk-pixbuf/gdk-pixbuf-query-loaders-3.0.xml b/docs/reference/gdk-pixbuf/gdk-pixbuf-query-loaders-3.0.xml new file mode 100644 index 0000000000..3aac8af294 --- /dev/null +++ b/docs/reference/gdk-pixbuf/gdk-pixbuf-query-loaders-3.0.xml @@ -0,0 +1,74 @@ + + + + + +gdk-pixbuf-query-loaders-3.0 +1 + + + +gdk-pixbuf-query-loaders-3.0 +GdkPixbuf loader registration utility + + + + +gdk-pixbuf-query-loaders-3.0 +--update-cache +module + + + +Description + +gdk-pixbuf-query-loaders-3.0 collects information about +loadable modules for gdk-pixbuf and writes it to +the default cache file location, or to stdout. + + +If called without arguments, it looks for modules in the +gdk-pixbuf loader directory. + + +If called with arguments, it looks for the specified modules. The arguments +may be absolute or relative paths. + + +Normally, the output of gdk-pixbuf-queryloaders-3.0 is written +to libdirgtk-3.0/3.0.0/loaders.cache, where gdk-pixbuf looks for it by default. If it is written to some other +location, the environment variable GDK_PIXBUF_MODULE_FILE +can be set to point gdk-pixbuf at the file. + + + +Options + + + --update-cache + Write the output to the default cache location instead of + stdout + + + + +Environment + +The environment variable GDK_PIXBUF_MODULEDIR can be used +to specify a different loader directory. The default +gdk-pixbuf loader +directory is libdir/gtk-3.0/version/loaders. + + + +Bugs + +None known yet. + + + + + + diff --git a/docs/reference/gdk-pixbuf/gdk-pixbuf-query-loaders.xml b/docs/reference/gdk-pixbuf/gdk-pixbuf-query-loaders.xml deleted file mode 100644 index 86fc866de5..0000000000 --- a/docs/reference/gdk-pixbuf/gdk-pixbuf-query-loaders.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - -gdk-pixbuf-query-loaders -1 - - - -gdk-pixbuf-query-loaders -GdkPixbuf loader registration utility - - - - -gdk-pixbuf-query-loaders -module - - - -Description - -gdk-pixbuf-query-loaders collects information about loadable -modules for gdk-pixbuf and writes it to stdout. - - -If called without arguments, it looks for modules in the -gdk-pixbuf loader directory. - - -If called with arguments, it looks for the specified modules. The arguments -may be absolute or relative paths. - - - -Environment - -The environment variable GDK_PIXBUF_MODULEDIR can be used -to specify a different loader directory. The default gdk-pixbuf loader -directory is libdir/gtk-2.0/version/loaders. - - - -Bugs - -None known yet. - - - - - - diff --git a/docs/reference/gdk-pixbuf/gdk-pixbuf.sgml b/docs/reference/gdk-pixbuf/gdk-pixbuf.sgml index 675ad09569..4b8fc9e47f 100644 --- a/docs/reference/gdk-pixbuf/gdk-pixbuf.sgml +++ b/docs/reference/gdk-pixbuf/gdk-pixbuf.sgml @@ -104,12 +104,12 @@ This part presents the tools which are shipped with the - &gdk-pixbuf; library. + &gdk-pixbuf; library. - - + + diff --git a/docs/reference/gdk-pixbuf/gdk-pixbuf-sections.txt b/docs/reference/gdk-pixbuf/gdk-pixbuf3-sections.txt similarity index 98% rename from docs/reference/gdk-pixbuf/gdk-pixbuf-sections.txt rename to docs/reference/gdk-pixbuf/gdk-pixbuf3-sections.txt index 6d84f8e326..61792baacb 100644 --- a/docs/reference/gdk-pixbuf/gdk-pixbuf-sections.txt +++ b/docs/reference/gdk-pixbuf/gdk-pixbuf3-sections.txt @@ -54,8 +54,6 @@ gdk_pixbuf_error_get_type
refcounting -gdk_pixbuf_ref -gdk_pixbuf_unref GdkPixbufDestroyNotify
@@ -120,8 +118,6 @@ gdk_pixbuf_fill GdkPixbufAnimation GdkPixbufAnimationIter gdk_pixbuf_animation_new_from_file -gdk_pixbuf_animation_ref -gdk_pixbuf_animation_unref gdk_pixbuf_animation_get_width gdk_pixbuf_animation_get_height gdk_pixbuf_animation_get_iter diff --git a/docs/reference/gdk-pixbuf/gdk-pixbuf.types b/docs/reference/gdk-pixbuf/gdk-pixbuf3.types similarity index 100% rename from docs/reference/gdk-pixbuf/gdk-pixbuf.types rename to docs/reference/gdk-pixbuf/gdk-pixbuf3.types diff --git a/docs/reference/gdk-pixbuf/tmpl/animation.sgml b/docs/reference/gdk-pixbuf/tmpl/animation.sgml index 776586d18c..d569f8af95 100644 --- a/docs/reference/gdk-pixbuf/tmpl/animation.sgml +++ b/docs/reference/gdk-pixbuf/tmpl/animation.sgml @@ -23,6 +23,9 @@ Animated images. + + + An opaque struct representing an animation. @@ -46,23 +49,6 @@ certain position in an animation. @Returns: - - - - - -@animation: -@Returns: - - - - - - - -@animation: - - diff --git a/docs/reference/gdk-pixbuf/tmpl/creating.sgml b/docs/reference/gdk-pixbuf/tmpl/creating.sgml index c4f38b1d02..ffd7bd12ac 100644 --- a/docs/reference/gdk-pixbuf/tmpl/creating.sgml +++ b/docs/reference/gdk-pixbuf/tmpl/creating.sgml @@ -46,6 +46,9 @@ Creating a pixbuf from image data that is already in memory. + + + diff --git a/docs/reference/gdk-pixbuf/tmpl/file-loading.sgml b/docs/reference/gdk-pixbuf/tmpl/file-loading.sgml index 8e51ce9c3c..84a461c8cb 100644 --- a/docs/reference/gdk-pixbuf/tmpl/file-loading.sgml +++ b/docs/reference/gdk-pixbuf/tmpl/file-loading.sgml @@ -28,6 +28,9 @@ Loading a pixbuf from a file. + + + diff --git a/docs/reference/gdk-pixbuf/tmpl/file-saving.sgml b/docs/reference/gdk-pixbuf/tmpl/file-saving.sgml index 13c5948cfd..d81557a9c4 100644 --- a/docs/reference/gdk-pixbuf/tmpl/file-saving.sgml +++ b/docs/reference/gdk-pixbuf/tmpl/file-saving.sgml @@ -21,6 +21,9 @@ to a socket or store it in a database. + + + diff --git a/docs/reference/gdk-pixbuf/tmpl/gdk-pixbuf-loader.sgml b/docs/reference/gdk-pixbuf/tmpl/gdk-pixbuf-loader.sgml index 129be6b4d0..3892e84ccb 100644 --- a/docs/reference/gdk-pixbuf/tmpl/gdk-pixbuf-loader.sgml +++ b/docs/reference/gdk-pixbuf/tmpl/gdk-pixbuf-loader.sgml @@ -72,6 +72,9 @@ Application-driven progressive image loading. + + + The GdkPixbufLoader struct contains only private @@ -114,6 +117,7 @@ fields. +@void: @Returns: diff --git a/docs/reference/gdk-pixbuf/tmpl/gdk-pixbuf-unused.sgml b/docs/reference/gdk-pixbuf/tmpl/gdk-pixbuf-unused.sgml index dbacc90779..89af1484c0 100644 --- a/docs/reference/gdk-pixbuf/tmpl/gdk-pixbuf-unused.sgml +++ b/docs/reference/gdk-pixbuf/tmpl/gdk-pixbuf-unused.sgml @@ -8,12 +8,6 @@ - - - gdk_image_get(). - - - Getting parts of a drawable's image data into a pixbuf. @@ -221,14 +215,6 @@ GnomeCanvasPixbuf and use that to draw the image onto a drawable. - - - Since these functions use GdkRGB for rendering, you must - initialize GdkRGB before using any of them. You can do this by - calling gdk_rgb_init() near the beginning of your program. - - - @@ -567,3 +553,33 @@ End: + + + + + +@animation: +@Returns: + + + + + + +@animation: + + + + + + +@pixbuf: +@Returns: + + + + + + +@pixbuf: + diff --git a/docs/reference/gdk-pixbuf/tmpl/gdk-pixbuf-xlib-from-drawables.sgml b/docs/reference/gdk-pixbuf/tmpl/gdk-pixbuf-xlib-from-drawables.sgml index e89a3adee2..aaedfecea8 100644 --- a/docs/reference/gdk-pixbuf/tmpl/gdk-pixbuf-xlib-from-drawables.sgml +++ b/docs/reference/gdk-pixbuf/tmpl/gdk-pixbuf-xlib-from-drawables.sgml @@ -26,6 +26,9 @@ Getting parts of an X drawable's image data into a pixbuf. + + + diff --git a/docs/reference/gdk-pixbuf/tmpl/gdk-pixbuf-xlib-init.sgml b/docs/reference/gdk-pixbuf/tmpl/gdk-pixbuf-xlib-init.sgml index 5fec563dc1..d9607801a4 100644 --- a/docs/reference/gdk-pixbuf/tmpl/gdk-pixbuf-xlib-init.sgml +++ b/docs/reference/gdk-pixbuf/tmpl/gdk-pixbuf-xlib-init.sgml @@ -23,6 +23,9 @@ Initializing the &gdk-pixbuf; Xlib library. + + + diff --git a/docs/reference/gdk-pixbuf/tmpl/gdk-pixbuf-xlib-rendering.sgml b/docs/reference/gdk-pixbuf/tmpl/gdk-pixbuf-xlib-rendering.sgml index a5558c2084..f16665c581 100644 --- a/docs/reference/gdk-pixbuf/tmpl/gdk-pixbuf-xlib-rendering.sgml +++ b/docs/reference/gdk-pixbuf/tmpl/gdk-pixbuf-xlib-rendering.sgml @@ -24,6 +24,9 @@ Rendering a pixbuf to an X drawable. + + + diff --git a/docs/reference/gdk-pixbuf/tmpl/gdk-pixbuf-xlib-rgb.sgml b/docs/reference/gdk-pixbuf/tmpl/gdk-pixbuf-xlib-rgb.sgml index 1e22040171..5763f89b89 100644 --- a/docs/reference/gdk-pixbuf/tmpl/gdk-pixbuf-xlib-rgb.sgml +++ b/docs/reference/gdk-pixbuf/tmpl/gdk-pixbuf-xlib-rgb.sgml @@ -20,6 +20,9 @@ Rendering RGB buffers to X drawables. + + + FIXME: Describe this. @@ -198,6 +201,7 @@ displays. +@void: @Returns: @@ -230,6 +234,7 @@ displays. +@void: @Returns: @@ -238,6 +243,7 @@ displays. +@void: @Returns: @@ -246,6 +252,7 @@ displays. +@void: @Returns: @@ -254,6 +261,7 @@ displays. +@void: @Returns: @@ -262,6 +270,7 @@ displays. +@void: @Returns: @@ -270,6 +279,7 @@ displays. +@void: @Returns: + + + An error code in the #GDK_PIXBUF_ERROR domain. Many &gdk-pixbuf; @@ -127,9 +130,7 @@ information on error domains and error codes. - These values can be passed to - gdk_pixbuf_render_to_drawable_alpha() to control how the alpha - channel of an image should be handled. This function can create a + This function can create a bilevel clipping mask (black and white) and use it while painting the image. In the future, when the X Window System gets an alpha channel extension, it will be possible to do full alpha diff --git a/docs/reference/gdk-pixbuf/tmpl/initialization_versions.sgml b/docs/reference/gdk-pixbuf/tmpl/initialization_versions.sgml index 7e7364b68f..b3cce4122b 100644 --- a/docs/reference/gdk-pixbuf/tmpl/initialization_versions.sgml +++ b/docs/reference/gdk-pixbuf/tmpl/initialization_versions.sgml @@ -19,6 +19,9 @@ you're linking against. + + + Contains the full version of the &gdk-pixbuf; library as a string. diff --git a/docs/reference/gdk-pixbuf/tmpl/inline.sgml b/docs/reference/gdk-pixbuf/tmpl/inline.sgml index f9dfe8d330..0b8da2cfc0 100644 --- a/docs/reference/gdk-pixbuf/tmpl/inline.sgml +++ b/docs/reference/gdk-pixbuf/tmpl/inline.sgml @@ -22,6 +22,9 @@ into #GdkPixbufs, use gdk_pixbuf_from_pixdata. + + + diff --git a/docs/reference/gdk-pixbuf/tmpl/module_interface.sgml b/docs/reference/gdk-pixbuf/tmpl/module_interface.sgml index 441f1237cd..61cfc9919e 100644 --- a/docs/reference/gdk-pixbuf/tmpl/module_interface.sgml +++ b/docs/reference/gdk-pixbuf/tmpl/module_interface.sgml @@ -16,12 +16,12 @@ a #GdkPixbufModuleFillVtableFunc function named In order to make format-checking work before actually loading the modules -(which may require dlopening image libraries), modules export their +(which may require dlopening image libraries), modules export their signatures (and other information) via the fill_info -function. An external utility, gdk-pixbuf-query-loaders, -uses this to create a text file containing a list of all available loaders and +function. An external utility, gdk-pixbuf-query-loaders-3.0, +uses this to create a text file containing a list of all available loaders and their signatures. This file is then read at runtime by &gdk-pixbuf; to obtain -the list of available loaders and their signatures. +the list of available loaders and their signatures. @@ -30,21 +30,21 @@ Modules may only implement a subset of the functionality available via fill_vtable function will simply not set the corresponding function pointers of the #GdkPixbufModule structure. If a module supports incremental loading (i.e. provides #begin_load, #stop_load and -#load_increment), it doesn't have to implement #load, since &gdk-pixbuf; can -supply a generic #load implementation wrapping the incremental loading. +#load_increment), it doesn't have to implement #load, since &gdk-pixbuf; can +supply a generic #load implementation wrapping the incremental loading. Installing a module is a two-step process: copy the module file(s) to the loader directory (normally -libdir/gtk-2.0/version/loaders, +libdir/gtk-3.0/version/loaders, unless overridden by the environment variable -GDK_PIXBUF_MODULEDIR) +GDK_PIXBUF_MODULEDIR) -call gdk-pixbuf-query-loaders to update the +call gdk-pixbuf-query-loaders-3.0 to update the module file (normally -sysconfdir/gtk-2.0/gdk-pixbuf.loaders, +libdir/gtk-3.0/version/loaders.cache, unless overridden by the environment variable GDK_PIXBUF_MODULE_FILE) @@ -52,11 +52,11 @@ unless overridden by the environment variable -The &gdk-pixbuf; interfaces needed for implementing modules are contained in +The &gdk-pixbuf; interfaces needed for implementing modules are contained in gdk-pixbuf-io.h (and gdk-pixbuf-animation.h if the module supports animations). -They are not covered by the same stability guarantees as the regular -&gdk-pixbuf; API. To underline this fact, they are protected by +They are not covered by the same stability guarantees as the regular +&gdk-pixbuf; API. To underline this fact, they are protected by #ifdef GDK_PIXBUF_ENABLE_BACKEND. @@ -68,6 +68,9 @@ They are not covered by the same stability guarantees as the regular + + + @@ -84,6 +87,7 @@ They are not covered by the same stability guarantees as the regular +@void: @Returns: @@ -184,7 +188,7 @@ use the gdk_pixbuf_format_* functions. image format. @flags: a combination of #GdkPixbufFormatFlags. @disabled: a boolean determining whether the loader is disabled. -@license: a string containing license information, typically set to +@license: a string containing license information, typically set to shorthands like "GPL", "LGPL", etc. @Since: 2.2 @@ -204,21 +208,21 @@ operations. The signature of a module is a set of prefixes. Prefixes are encoded as -pairs of ordinary strings, where the second string, called the mask, if -not %NULL, must be of the same length as the first one and may contain -' ', '!', 'x', 'z', and 'n' to indicate bytes that must be matched, -not matched, "don't-care"-bytes, zeros and non-zeros. -Each prefix has an associated integer that describes the relevance of +pairs of ordinary strings, where the second string, called the mask, if +not %NULL, must be of the same length as the first one and may contain +' ', '!', 'x', 'z', and 'n' to indicate bytes that must be matched, +not matched, "don't-care"-bytes, zeros and non-zeros. +Each prefix has an associated integer that describes the relevance of the prefix, with 0 meaning a mismatch and 100 a "perfect match". -Starting with &gdk-pixbuf; 2.8, the first byte of the mask may be '*', -indicating an unanchored pattern that matches not only at the beginning, +Starting with &gdk-pixbuf; 2.8, the first byte of the mask may be '*', +indicating an unanchored pattern that matches not only at the beginning, but also in the middle. Versions prior to 2.8 will interpret the '*' -like an 'x'. +like an 'x'. -The signature of a module is stored as an array of +The signature of a module is stored as an array of #GdkPixbufModulePatterns. The array is terminated by a pattern where the @prefix is %NULL. @@ -230,7 +234,7 @@ GdkPixbufModulePattern *signature[] = { { NULL, NULL, 0 } }; -The example matches e.g. "auud\0" with relevance 100, and "blau" with +The example matches e.g. "auud\0" with relevance 100, and "blau" with relevance 90. @prefix: the prefix for this pattern @@ -241,8 +245,8 @@ relevance 90. -Defines the type of the function used to set the vtable of a -#GdkPixbufModule when it is loaded. +Defines the type of the function used to set the vtable of a +#GdkPixbufModule when it is loaded. @module: a #GdkPixbufModule. @@ -251,7 +255,7 @@ Defines the type of the function used to set the vtable of a -Defines the type of the function used to fill a +Defines the type of the function used to fill a #GdkPixbufFormat structure with information about a module. @@ -261,19 +265,19 @@ Defines the type of the function used to fill a -Defines the type of the function that gets called once the size +Defines the type of the function that gets called once the size of the loaded image is known. The function is expected to set @width and @height to the desired -size to which the image should be scaled. If a module has no efficient +size to which the image should be scaled. If a module has no efficient way to achieve the desired scaling during the loading of the image, it may either ignore the size request, or only approximate it -- &gdk-pixbuf; will -then perform the required scaling on the completely loaded image. +then perform the required scaling on the completely loaded image. If the function sets @width or @height to zero, the module should interpret -this as a hint that it will be closed soon and shouldn't allocate further +this as a hint that it will be closed soon and shouldn't allocate further resources. This convention is used to implement gdk_pixbuf_get_file_info() efficiently. @@ -286,11 +290,11 @@ efficiently. -Defines the type of the function that gets called once the initial +Defines the type of the function that gets called once the initial setup of @pixbuf is done. -#GdkPixbufLoader uses a function of this type to emit the +#GdkPixbufLoader uses a function of this type to emit the "area_prepared" signal. @@ -307,7 +311,7 @@ Defines the type of the function that gets called every time a region of @pixbuf is updated. -#GdkPixbufLoader uses a function of this type to emit the +#GdkPixbufLoader uses a function of this type to emit the "area_updated" signal. @@ -323,14 +327,14 @@ signal. -A #GdkPixbufModule contains the necessary functions to load and save -images in a certain file format. +A #GdkPixbufModule contains the necessary functions to load and save +images in a certain file format. A #GdkPixbufModule can be loaded dynamically from a #GModule. -Each loadable module must contain a #GdkPixbufModuleFillVtableFunc function +Each loadable module must contain a #GdkPixbufModuleFillVtableFunc function named fill_vtable, which will get called when the module -is loaded and must set the function pointers of the #GdkPixbufModule. +is loaded and must set the function pointers of the #GdkPixbufModule. @module_name: the name of the module, usually the same as the @@ -349,8 +353,8 @@ is loaded and must set the function pointers of the #GdkPixbufModule. -Modules supporting animations must derive a type from -#GdkPixbufAnimation, providing suitable implementations of the +Modules supporting animations must derive a type from +#GdkPixbufAnimation, providing suitable implementations of the virtual functions. @@ -362,17 +366,17 @@ virtual functions. -Modules supporting animations must derive a type from -#GdkPixbufAnimationIter, providing suitable implementations of the +Modules supporting animations must derive a type from +#GdkPixbufAnimationIter, providing suitable implementations of the virtual functions. @parent_class: the parent class -@get_delay_time: returns the time in milliseconds that the current frame +@get_delay_time: returns the time in milliseconds that the current frame should be shown. @get_pixbuf: returns the current frame. -@on_currently_loading_frame: returns whether the current frame of @iter is +@on_currently_loading_frame: returns whether the current frame of @iter is being loaded. -@advance: advances the iterator to @current_time, possibly changing the +@advance: advances the iterator to @current_time, possibly changing the current frame. diff --git a/docs/reference/gdk-pixbuf/tmpl/refcounting.sgml b/docs/reference/gdk-pixbuf/tmpl/refcounting.sgml index b894022848..d4367150d9 100644 --- a/docs/reference/gdk-pixbuf/tmpl/refcounting.sgml +++ b/docs/reference/gdk-pixbuf/tmpl/refcounting.sgml @@ -48,21 +48,7 @@ Functions for reference counting and memory management on pixbufs. - - - - - -@pixbuf: -@Returns: - - - - - - - -@pixbuf: + diff --git a/docs/reference/gdk-pixbuf/tmpl/scaling.sgml b/docs/reference/gdk-pixbuf/tmpl/scaling.sgml index 5c26be2430..6550cd59a6 100644 --- a/docs/reference/gdk-pixbuf/tmpl/scaling.sgml +++ b/docs/reference/gdk-pixbuf/tmpl/scaling.sgml @@ -81,6 +81,9 @@ expose_cb (GtkWidget *widget, GdkEventExpose *event, gpointer data) + + + This enumeration describes the different interpolation modes that diff --git a/docs/reference/gdk-pixbuf/tmpl/util.sgml b/docs/reference/gdk-pixbuf/tmpl/util.sgml index 7770b77891..fd54648882 100644 --- a/docs/reference/gdk-pixbuf/tmpl/util.sgml +++ b/docs/reference/gdk-pixbuf/tmpl/util.sgml @@ -20,6 +20,9 @@ Utility and miscellaneous convenience functions. + + + diff --git a/docs/reference/gdk/Makefile.am b/docs/reference/gdk/Makefile.am index 7e21e35fdb..75ccec6172 100644 --- a/docs/reference/gdk/Makefile.am +++ b/docs/reference/gdk/Makefile.am @@ -4,7 +4,7 @@ include $(top_srcdir)/Makefile.decl AUTOMAKE_OPTIONS = 1.6 # The name of the module. -DOC_MODULE=gdk +DOC_MODULE=gdk3 # The top-level SGML file. DOC_MAIN_SGML_FILE=gdk-docs.sgml diff --git a/docs/reference/gdk/gdk-docs.sgml b/docs/reference/gdk/gdk-docs.sgml index 1e0c7b51bc..480cc173f8 100644 --- a/docs/reference/gdk/gdk-docs.sgml +++ b/docs/reference/gdk/gdk-docs.sgml @@ -53,7 +53,7 @@ - + @@ -72,45 +72,9 @@ Index of deprecated symbols
- - Index of new symbols in 2.2 - - - - Index of new symbols in 2.4 - - - - Index of new symbols in 2.6 - - - - Index of new symbols in 2.8 - - - - Index of new symbols in 2.10 - - - - Index of new symbols in 2.12 - - - - Index of new symbols in 2.14 - - - - Index of new symbols in 2.16 - - - - Index of new symbols in 2.18 - - - - Index of new symbols in 2.20 - + + Index of new symbols in 3.0 + diff --git a/docs/reference/gdk/gdk-overrides.txt b/docs/reference/gdk/gdk3-overrides.txt similarity index 100% rename from docs/reference/gdk/gdk-overrides.txt rename to docs/reference/gdk/gdk3-overrides.txt diff --git a/docs/reference/gdk/gdk-sections.txt b/docs/reference/gdk/gdk3-sections.txt similarity index 90% rename from docs/reference/gdk/gdk-sections.txt rename to docs/reference/gdk/gdk3-sections.txt index 5d05c993c8..da9208c9e9 100644 --- a/docs/reference/gdk/gdk-sections.txt +++ b/docs/reference/gdk/gdk3-sections.txt @@ -10,7 +10,6 @@ gdk_parse_args gdk_get_display_arg_name gdk_set_locale gdk_set_sm_client_id -gdk_exit gdk_notify_startup_complete gdk_notify_startup_complete_with_id @@ -45,10 +44,6 @@ gdk_keyboard_ungrab gdk_beep - -gdk_get_use_xshm -gdk_set_use_xshm - gdk_error_trap_push gdk_error_trap_pop @@ -56,6 +51,8 @@ gdk_error_trap_pop GDK_WINDOWING_X11 GDK_WINDOWING_WIN32 +GDK_WINDOWING_QUARTZ +GDK_WINDOWING_DIRECTFB GDK_TYPE_GRAB_STATUS @@ -80,6 +77,7 @@ gdk_filter_return_get_type gdk_font_type_get_type gdk_function_get_type gdk_gc_values_mask_get_type +gdk_grab_ownership_get_type gdk_grab_status_get_type gdk_gravity_get_type gdk_image_type_get_type @@ -109,8 +107,7 @@ gdk_window_type_get_type gdk_window_type_hint_get_type gdk_wm_decoration_get_type gdk_wm_function_get_type -gdk_pointer_grab_info_libgtk_only -gdk_keyboard_grab_info_libgtk_only +gdk_device_grab_info_libgtk_only gdk_add_option_entries_libgtk_only gdk_pre_parse_libgtk_only @@ -125,9 +122,11 @@ gdk_display_get_name gdk_display_get_n_screens gdk_display_get_screen gdk_display_get_default_screen +gdk_display_get_device_manager gdk_display_pointer_ungrab gdk_display_keyboard_ungrab gdk_display_pointer_is_grabbed +gdk_display_device_is_grabbed gdk_display_beep gdk_display_sync gdk_display_flush @@ -140,10 +139,15 @@ gdk_display_add_client_message_filter gdk_display_set_double_click_time gdk_display_set_double_click_distance gdk_display_get_pointer +gdk_display_get_device_state gdk_display_get_window_at_pointer +gdk_display_get_window_at_device_position GdkDisplayPointerHooks gdk_display_set_pointer_hooks +GdkDisplayDeviceHooks +gdk_display_set_device_hooks gdk_display_warp_pointer +gdk_display_warp_device gdk_display_supports_cursor_color gdk_display_supports_cursor_alpha gdk_display_get_default_cursor_size @@ -258,11 +262,7 @@ gdk_pixmap_create_from_xpm gdk_pixmap_colormap_create_from_xpm gdk_pixmap_create_from_xpm_d gdk_pixmap_colormap_create_from_xpm_d -gdk_pixmap_ref -gdk_pixmap_unref GdkBitmap -gdk_bitmap_ref -gdk_bitmap_unref GDK_PIXMAP @@ -285,13 +285,17 @@ GdkPixmapObjectClass GdkImage gdk_image_new GdkImageType -gdk_image_new_bitmap -gdk_image_get -gdk_image_ref -gdk_image_unref -gdk_image_destroy gdk_image_get_colormap gdk_image_set_colormap +gdk_image_get_bits_per_pixel +gdk_image_get_bytes_per_pixel +gdk_image_get_bytes_per_line +gdk_image_get_byte_order +gdk_image_get_depth +gdk_image_get_height +gdk_image_get_image_type +gdk_image_get_visual +gdk_image_get_width gdk_image_put_pixel @@ -314,7 +318,6 @@ gdk_image_get_type
GdkRGB rgb -gdk_rgb_init gdk_draw_rgb_image @@ -331,9 +334,6 @@ gdk_rgb_cmap_free GdkRgbCmap -gdk_rgb_gc_set_foreground -gdk_rgb_gc_set_background -gdk_rgb_xpixel_from_rgb gdk_rgb_find_color @@ -341,7 +341,6 @@ gdk_rgb_set_install gdk_rgb_set_min_colors gdk_rgb_get_visual gdk_rgb_get_colormap -gdk_rgb_get_cmap gdk_rgb_ditherable gdk_rgb_colormap_ditherable gdk_rgb_set_verbose @@ -354,8 +353,6 @@ GDK_TYPE_RGB_DITHER Pixbufs pixbufs gdk_pixbuf_render_threshold_alpha -gdk_pixbuf_render_to_drawable -gdk_pixbuf_render_to_drawable_alpha gdk_pixbuf_render_pixmap_and_mask gdk_pixbuf_render_pixmap_and_mask_for_colormap gdk_pixbuf_get_from_drawable @@ -368,27 +365,16 @@ gdk_pixbuf_get_from_image GdkColor GdkColormap gdk_colormap_new -gdk_colormap_ref -gdk_colormap_unref gdk_colormap_get_system -gdk_colormap_get_system_size -gdk_colormap_change gdk_colormap_alloc_colors gdk_colormap_alloc_color gdk_colormap_free_colors gdk_colormap_query_color gdk_colormap_get_visual gdk_colormap_get_screen -gdk_colors_store gdk_color_copy gdk_color_free -gdk_colors_alloc -gdk_colors_free -gdk_color_white -gdk_color_black gdk_color_parse -gdk_color_alloc -gdk_color_change gdk_color_equal gdk_color_hash gdk_color_to_string @@ -528,16 +514,12 @@ GdkFunction gdk_gc_new gdk_gc_new_with_values gdk_gc_get_screen -gdk_gc_ref -gdk_gc_unref -gdk_gc_destroy gdk_gc_set_values gdk_gc_get_values gdk_gc_set_foreground gdk_gc_set_background gdk_gc_set_rgb_fg_color gdk_gc_set_rgb_bg_color -gdk_gc_set_font gdk_gc_set_function gdk_gc_set_fill GdkFill @@ -592,7 +574,14 @@ GdkByteOrder gdk_query_depths gdk_query_visual_types gdk_list_visuals - +gdk_visual_get_bits_per_rgb +gdk_visual_get_blue_pixel_details +gdk_visual_get_byte_order +gdk_visual_get_colormap_size +gdk_visual_get_depth +gdk_visual_get_green_pixel_details +gdk_visual_get_red_pixel_details +gdk_visual_get_visual_type gdk_visual_get_best_depth gdk_visual_get_best_type gdk_visual_get_system @@ -600,8 +589,6 @@ gdk_visual_get_best gdk_visual_get_best_with_depth gdk_visual_get_best_with_type gdk_visual_get_best_with_both -gdk_visual_ref -gdk_visual_unref gdk_visual_get_screen @@ -634,8 +621,6 @@ GdkWindowAttr GdkWindowAttributesType gdk_window_new gdk_window_destroy -gdk_window_ref -gdk_window_unref gdk_window_get_window_type gdk_window_at_pointer gdk_window_show @@ -644,6 +629,8 @@ gdk_window_hide gdk_window_is_destroyed gdk_window_is_visible gdk_window_is_viewable +gdk_window_is_input_only +gdk_window_is_shaped gdk_window_get_state gdk_window_withdraw gdk_window_iconify @@ -658,6 +645,7 @@ gdk_window_set_keep_above gdk_window_set_keep_below gdk_window_set_opacity gdk_window_set_composited +gdk_window_get_composited gdk_window_move gdk_window_resize gdk_window_move_resize @@ -669,7 +657,6 @@ gdk_window_reparent gdk_window_clear gdk_window_clear_area gdk_window_clear_area_e -gdk_window_copy_area gdk_window_raise gdk_window_lower gdk_window_restack @@ -703,7 +690,9 @@ gdk_window_configure_finished gdk_window_set_user_data gdk_window_set_override_redirect gdk_window_set_accept_focus +gdk_window_get_accept_focus gdk_window_set_focus_on_map +gdk_window_get_focus_on_map gdk_window_add_filter gdk_window_remove_filter GdkFilterFunc @@ -718,19 +707,20 @@ gdk_window_input_shape_combine_region gdk_window_set_child_input_shapes gdk_window_merge_child_input_shapes gdk_window_set_static_gravities -gdk_window_set_hints gdk_window_set_title gdk_window_set_background +gdk_window_get_background gdk_window_set_back_pixmap +gdk_window_get_back_pixmap GDK_PARENT_RELATIVE gdk_window_set_cursor gdk_window_get_cursor -gdk_window_set_colormap gdk_window_get_user_data gdk_window_get_geometry gdk_window_set_geometry_hints gdk_window_set_icon_list gdk_window_set_modal_hint +gdk_window_get_modal_hint gdk_window_set_type_hint gdk_window_get_type_hint gdk_window_set_skip_taskbar_hint @@ -739,14 +729,11 @@ gdk_window_set_urgency_hint gdk_window_get_position gdk_window_get_root_origin gdk_window_get_frame_extents -gdk_window_get_size -gdk_window_get_visual -gdk_window_get_colormap -gdk_window_get_type gdk_window_get_origin gdk_window_get_deskrelative_origin gdk_window_get_root_coords gdk_window_get_pointer +gdk_window_get_device_position GdkModifierType gdk_window_get_parent gdk_window_get_toplevel @@ -766,9 +753,16 @@ gdk_window_get_decorations GdkWMDecoration gdk_window_set_functions GdkWMFunction -gdk_window_get_toplevels gdk_get_default_root_window + +gdk_window_get_support_multidevice +gdk_window_set_support_multidevice +gdk_window_get_device_cursor +gdk_window_set_device_cursor +gdk_window_get_device_events +gdk_window_set_device_events + GdkPointerHooks gdk_set_pointer_hooks @@ -780,6 +774,10 @@ gdk_offscreen_window_get_embedder gdk_window_geometry_changed gdk_window_redirect_to_drawable gdk_window_remove_redirection +gdk_window_coords_from_parent +gdk_window_coords_to_parent +gdk_window_get_effective_parent +gdk_window_get_effective_toplevel GDK_WINDOW @@ -806,6 +804,10 @@ gdk_window_object_get_type gdk_drawable_get_type GdkWindowObject GdkWindowObjectClass +GdkWindowImpl +GdkWindowImplIface +GdkWindowRedirect +gdk_window_impl_get_type gdk_window_freeze_toplevel_updates_libgtk_only gdk_window_thaw_toplevel_updates_libgtk_only
@@ -813,9 +815,6 @@ gdk_window_thaw_toplevel_updates_libgtk_only
Selections selections -GdkSelection -GdkSelectionType -GdkTarget GDK_SELECTION_PRIMARY GDK_SELECTION_SECONDARY GDK_SELECTION_CLIPBOARD @@ -885,7 +884,6 @@ gdk_pango_renderer_set_stipple gdk_pango_renderer_set_override_color gdk_pango_context_get gdk_pango_context_get_for_screen -gdk_pango_context_set_colormap GdkPangoAttrEmbossed GdkPangoAttrEmbossColor GdkPangoAttrStipple @@ -1038,20 +1036,40 @@ gdk_keymap_get_type
-Input Devices -input_devices +GdkDeviceManager +gdkdevicemanager +GdkDeviceManager GdkDevice +GdkDeviceType GdkInputSource GdkInputMode GdkDeviceKey GdkDeviceAxis GdkAxisUse -gdk_devices_list +GdkGrabOwnership +gdk_enable_multidevice +gdk_device_manager_get_display +gdk_device_manager_list_devices + + +gdk_device_get_name gdk_device_set_source +gdk_device_get_source gdk_device_set_mode +gdk_device_get_mode gdk_device_set_key +gdk_device_get_key gdk_device_set_axis_use -gdk_device_get_core_pointer +gdk_device_get_axis_use +gdk_device_get_associated_device +gdk_device_get_device_type +gdk_device_get_display +gdk_device_get_has_cursor +gdk_device_get_n_axes + + +gdk_device_grab +gdk_device_ungrab gdk_device_get_state @@ -1059,16 +1077,30 @@ gdk_device_get_history gdk_device_free_history GdkTimeCoord gdk_device_get_axis +gdk_device_list_axes +gdk_device_get_axis_value gdk_input_set_extension_events GdkExtensionMode + +gdk_devices_list +gdk_device_get_core_pointer + GDK_TYPE_AXIS_USE GDK_TYPE_EXTENSION_MODE GDK_TYPE_INPUT_MODE GDK_TYPE_INPUT_SOURCE +GDK_TYPE_DEVICE_TYPE +GDK_TYPE_GRAB_OWNERSHIP +GDK_DEVICE_MANAGER +GDK_DEVICE_MANAGER_CLASS +GDK_DEVICE_MANAGER_GET_CLASS +GDK_IS_DEVICE_MANAGER +GDK_IS_DEVICE_MANAGER_CLASS +GDK_TYPE_DEVICE_MANAGER GDK_DEVICE GDK_DEVICE_CLASS GDK_DEVICE_GET_CLASS @@ -1078,7 +1110,12 @@ GDK_TYPE_DEVICE GdkDeviceClass +GdkDevicePrivate +GdkDeviceManagerClass +GdkDeviceManagerPrivate gdk_device_get_type +gdk_device_manager_get_type +gdk_device_type_get_type GDK_MAX_TIMECOORD_AXES
@@ -1096,7 +1133,6 @@ GDK_PRIORITY_REDRAW gdk_events_pending gdk_event_peek gdk_event_get -gdk_event_get_graphics_expose gdk_event_put gdk_event_new gdk_event_copy @@ -1107,6 +1143,9 @@ gdk_event_get_axis gdk_event_get_coords gdk_event_get_root_coords gdk_event_request_motions +gdk_events_get_angle +gdk_events_get_center +gdk_events_get_distance gdk_event_handler_set @@ -1123,6 +1162,8 @@ gdk_get_show_events gdk_set_show_events gdk_event_set_screen gdk_event_get_screen +gdk_event_get_device +gdk_event_set_device gdk_setting_get @@ -1200,7 +1241,6 @@ gdk_cursor_get_display gdk_cursor_get_image gdk_cursor_ref gdk_cursor_unref -gdk_cursor_destroy GDK_TYPE_CURSOR_TYPE @@ -1216,7 +1256,6 @@ gdk_cursor_get_type gdk_input_add_full GdkInputCondition GdkInputFunction -GdkDestroyNotify gdk_input_add gdk_input_remove @@ -1234,18 +1273,22 @@ gdk_drag_context_new gdk_drag_drop gdk_drag_find_window gdk_drag_find_window_for_screen -gdk_drag_context_ref gdk_drag_begin gdk_drag_motion gdk_drop_finish gdk_drag_get_protocol gdk_drag_get_protocol_for_display GdkDragProtocol -gdk_drag_context_unref GdkDragContext GdkDragAction gdk_drag_status gdk_drag_drop_succeeded +gdk_drag_context_get_action +gdk_drag_context_get_actions +gdk_drag_context_get_suggested_action +gdk_drag_context_list_targets +gdk_drag_context_get_device +gdk_drag_context_set_device GDK_DRAG_CONTEXT @@ -1267,7 +1310,6 @@ gdk_drag_context_get_type X Window System Interaction x_interaction GDK_ROOT_WINDOW -GDK_ROOT_PARENT GDK_DISPLAY GDK_WINDOW_XDISPLAY GDK_WINDOW_XID @@ -1293,7 +1335,6 @@ GDK_GC_XGC GDK_GC_GET_XGC GDK_WINDOW_XWINDOW gdkx_visual_get -gdkx_colormap_get gdk_pixmap_foreign_new gdk_pixmap_foreign_new_for_display gdk_pixmap_foreign_new_for_screen @@ -1359,8 +1400,8 @@ gdk_x11_get_xatom_name_for_display gdk_display GDK_HAVE_WCHAR_H GDK_HAVE_WCTYPE_H -gdk_iswalnum -gdk_iswspace +gdk_x11_pixmap_get_drawable_impl +gdk_x11_window_get_drawable_impl
diff --git a/docs/reference/gdk/gdk.types b/docs/reference/gdk/gdk3.types similarity index 82% rename from docs/reference/gdk/gdk.types rename to docs/reference/gdk/gdk3.types index 12b0f8d356..8b200f566b 100644 --- a/docs/reference/gdk/gdk.types +++ b/docs/reference/gdk/gdk3.types @@ -9,3 +9,5 @@ gdk_pango_renderer_get_type gdk_pixmap_get_type gdk_gc_get_type gdk_keymap_get_type +gdk_device_get_type +gdk_device_manager_get_type diff --git a/docs/reference/gdk/tmpl/.gitignore b/docs/reference/gdk/tmpl/.gitignore new file mode 100644 index 0000000000..888b6a26b9 --- /dev/null +++ b/docs/reference/gdk/tmpl/.gitignore @@ -0,0 +1 @@ +windows.sgml diff --git a/docs/reference/gdk/tmpl/cairo_interaction.sgml b/docs/reference/gdk/tmpl/cairo_interaction.sgml index 7ada736cf6..fc7fbf56ad 100644 --- a/docs/reference/gdk/tmpl/cairo_interaction.sgml +++ b/docs/reference/gdk/tmpl/cairo_interaction.sgml @@ -27,6 +27,9 @@ Cairo paths and to use pixbufs as sources for drawing operations. + + + diff --git a/docs/reference/gdk/tmpl/colors.sgml b/docs/reference/gdk/tmpl/colors.sgml index 31a09f72ae..d313f5a3d5 100644 --- a/docs/reference/gdk/tmpl/colors.sgml +++ b/docs/reference/gdk/tmpl/colors.sgml @@ -32,10 +32,7 @@ directly. In previous revisions of this interface, a number of functions that take a #GdkColormap parameter were replaced with functions whose names began -with "gdk_colormap_". This process will probably -be extended somewhat in the future - -gdk_color_white(), gdk_color_black(), and -gdk_color_change() will probably become aliases. +with "gdk_colormap_". @@ -46,6 +43,9 @@ gdk_color_change() will probably become aliases. + + + The #GdkColor structure is used to describe an @@ -57,20 +57,14 @@ allocated or unallocated color. @red: The red component of the color. This is a value between 0 and 65535, with 65535 indicating full intensitiy. -@green: The blue component of the color. -@blue: The green component of the color. +@green: The green component of the color. +@blue: The blue component of the color. The colormap structure contains the following public fields. -@size: For pseudo-color colormaps, the number of colors - in the colormap. -@colors: An array containing the current values in the - colormap. This can be used to map from pixel values - back to RGB values. This is only meaningful for - pseudo-color colormaps. @@ -81,45 +75,14 @@ The colormap structure contains the following public fields. @Returns: - - - - - -@cmap: -@Returns: - - - - - - - -@cmap: - - +@void: @Returns: - - - - -@Returns: - - - - - - -@colormap: -@ncolors: - - @@ -180,15 +143,6 @@ The colormap structure contains the following public fields. @Returns: - - - - -@colormap: -@colors: -@ncolors: - - @@ -204,47 +158,6 @@ The colormap structure contains the following public fields. @color: - - - - -@colormap: -@contiguous: -@planes: -@nplanes: -@pixels: -@npixels: -@Returns: - - - - - - -@colormap: -@pixels: -@npixels: -@planes: - - - - - - -@colormap: -@color: -@Returns: - - - - - - -@colormap: -@color: -@Returns: - - @@ -254,24 +167,6 @@ The colormap structure contains the following public fields. @Returns: - - - - -@colormap: -@color: -@Returns: - - - - - - -@colormap: -@color: -@Returns: - - diff --git a/docs/reference/gdk/tmpl/cursors.sgml b/docs/reference/gdk/tmpl/cursors.sgml index 96ba512727..b38f689562 100644 --- a/docs/reference/gdk/tmpl/cursors.sgml +++ b/docs/reference/gdk/tmpl/cursors.sgml @@ -31,12 +31,14 @@ gdk_window_set_cursor() or by setting the cursor member of the + + + A GdkCursor structure represents a cursor. -@type: the #GdkCursorType of the cursor @@ -214,10 +216,3 @@ The standard cursors available. @cursor: - - -Destroys a cursor, freeing any resources allocated for it. - - - - diff --git a/docs/reference/gdk/tmpl/dnd.sgml b/docs/reference/gdk/tmpl/dnd.sgml index b3c360d6e6..7f6a8e34ca 100644 --- a/docs/reference/gdk/tmpl/dnd.sgml +++ b/docs/reference/gdk/tmpl/dnd.sgml @@ -25,6 +25,9 @@ the GTK+ documentation for more information. + + + @@ -54,6 +57,7 @@ the GTK+ documentation for more information. +@void: @Returns: @@ -91,13 +95,6 @@ the GTK+ documentation for more information. @protocol: - - - - -@context: - - @@ -166,13 +163,6 @@ which DND is done. @GDK_DRAG_PROTO_OLE2: The complex OLE2 DND protocol (not implemented). @GDK_DRAG_PROTO_LOCAL: Intra-application DND. - - - - -@context: - - A GdkDragContext holds information about a @@ -180,16 +170,6 @@ drag in progress. It is used on both source and destination sides. @parent_instance: the parent instance -@protocol: the DND protocol which governs this drag. -@is_source: %TRUE if the context is used on the source side. -@source_window: the source of this drag. -@dest_window: the destination window of this drag. -@targets: a list of targets offered by the source. -@actions: a bitmask of actions proposed by the source when - @suggested_action is %GDK_ACTION_ASK. -@suggested_action: the action suggested by the source. -@action: the action chosen by the destination. -@start_time: a timestamp recording the start time of this drag. @@ -225,3 +205,57 @@ should do with the dropped data. @Returns: + + + + + +@context: +@Returns: + + + + + + + +@context: +@Returns: + + + + + + + +@context: +@Returns: + + + + + + + +@context: +@Returns: + + + + + + + +@context: +@Returns: + + + + + + + +@context: +@device: + + diff --git a/docs/reference/gdk/tmpl/drawing.sgml b/docs/reference/gdk/tmpl/drawing.sgml index 73071405cf..9cd73f81f3 100644 --- a/docs/reference/gdk/tmpl/drawing.sgml +++ b/docs/reference/gdk/tmpl/drawing.sgml @@ -34,6 +34,9 @@ gtk_widget_create_pango_layout(). + + + An opaque structure representing an object that can be diff --git a/docs/reference/gdk/tmpl/event_structs.sgml b/docs/reference/gdk/tmpl/event_structs.sgml index cd94fdebc7..2ba31393a4 100644 --- a/docs/reference/gdk/tmpl/event_structs.sgml +++ b/docs/reference/gdk/tmpl/event_structs.sgml @@ -23,6 +23,9 @@ required events are received. See gtk_widget_set_events(). + + + The #GdkEvent struct contains a union of all of the event structs, @@ -380,7 +383,7 @@ union, 16-bit data uses the s array, and 32-bit data uses the l array. Generated when the area of a #GdkDrawable being copied, with gdk_draw_drawable() -or gdk_window_copy_area(), was completely available. +, was completely available. FIXME: add more here. diff --git a/docs/reference/gdk/tmpl/events.sgml b/docs/reference/gdk/tmpl/events.sgml index 9174b9db0d..b8c3370f97 100644 --- a/docs/reference/gdk/tmpl/events.sgml +++ b/docs/reference/gdk/tmpl/events.sgml @@ -30,6 +30,9 @@ The structs used for each type of event. + + + Specifies the type of the event. @@ -165,6 +168,7 @@ is given in the GLib Main Loop. +@void: @Returns: @@ -172,6 +176,7 @@ is given in the GLib Main Loop. +@void: @Returns: @@ -179,14 +184,7 @@ is given in the GLib Main Loop. -@Returns: - - - - - - -@window: +@void: @Returns: @@ -280,6 +278,40 @@ is given in the GLib Main Loop. @event: + + + + + +@event1: +@event2: +@angle: +@Returns: + + + + + + + +@event1: +@event2: +@x: +@y: +@Returns: + + + + + + + +@event1: +@event2: +@distance: +@Returns: + + @@ -340,6 +372,7 @@ gdk_event_handler_set(). +@void: @Returns: @@ -368,6 +401,24 @@ gdk_event_handler_set(). @Returns: + + + + + +@event: +@Returns: + + + + + + + +@event: +@device: + + diff --git a/docs/reference/gdk/tmpl/fonts.sgml b/docs/reference/gdk/tmpl/fonts.sgml index 25efd2dc48..1f68fb732d 100644 --- a/docs/reference/gdk/tmpl/fonts.sgml +++ b/docs/reference/gdk/tmpl/fonts.sgml @@ -264,6 +264,9 @@ here). + + + The GdkFont structure represents a font or fontset. It diff --git a/docs/reference/gdk/tmpl/gcs.sgml b/docs/reference/gdk/tmpl/gcs.sgml index f5a16d35c7..2897bcb35f 100644 --- a/docs/reference/gdk/tmpl/gcs.sgml +++ b/docs/reference/gdk/tmpl/gcs.sgml @@ -33,6 +33,9 @@ be set by the latter method. + + + The #GdkGC structure represents a graphics context. @@ -148,33 +151,6 @@ useful. For bitmaps, %GDK_AND and %GDK_OR are also useful. @Returns: - - - - - -@gc: -@Returns: - - - - - - - -@gc: - - - - -This function is obsolete and should not be used. - - -@Deprecated: Use g_object_unref() instead - -@gc: a #GdkGC. - - @@ -230,15 +206,6 @@ This function is obsolete and should not be used. @color: - - - - - -@gc: -@font: - - diff --git a/docs/reference/gdk/tmpl/gdk-unused.sgml b/docs/reference/gdk/tmpl/gdk-unused.sgml index adb7170f01..13b0c19c3e 100644 --- a/docs/reference/gdk/tmpl/gdk-unused.sgml +++ b/docs/reference/gdk/tmpl/gdk-unused.sgml @@ -923,6 +923,14 @@ they will be ignored. + + +Gets the colormap set by GdkRGB. This colormap and the corresponding +visual should be used when creating windows that will be drawn in by GdkRGB. + + +@Returns: The #GdkColormap set by GdkRGB. + diff --git a/docs/reference/gdk/tmpl/gdkapplaunchcontext.sgml b/docs/reference/gdk/tmpl/gdkapplaunchcontext.sgml index 2d1f8ff9ca..78928a4ebe 100644 --- a/docs/reference/gdk/tmpl/gdkapplaunchcontext.sgml +++ b/docs/reference/gdk/tmpl/gdkapplaunchcontext.sgml @@ -36,6 +36,9 @@ g_object_unref (context); + + + An opaque structure representing an application launch context. @@ -47,6 +50,7 @@ An opaque structure representing an application launch context. +@void: @Returns: diff --git a/docs/reference/gdk/tmpl/gdkdisplay.sgml b/docs/reference/gdk/tmpl/gdkdisplay.sgml index 36e3296be9..b265912a99 100644 --- a/docs/reference/gdk/tmpl/gdkdisplay.sgml +++ b/docs/reference/gdk/tmpl/gdkdisplay.sgml @@ -31,6 +31,9 @@ Controls the keyboard/mouse pointer grabs and a set of GdkScreens + + + The GdkDisplay struct is the GDK representation @@ -47,6 +50,13 @@ of an X display. All its fields are private and should not be accessed directly. @gdkdisplay: the object which received the signal. @arg1: + + + + + +@gdkdisplay: the object which received the signal. + @@ -61,6 +71,7 @@ of an X display. All its fields are private and should not be accessed directly. +@void: @Returns: @@ -101,6 +112,15 @@ of an X display. All its fields are private and should not be accessed directly. @Returns: + + + + + +@display: +@Returns: + + @@ -128,6 +148,16 @@ of an X display. All its fields are private and should not be accessed directly. @Returns: + + + + + +@display: +@device: +@Returns: + + @@ -237,6 +267,19 @@ of an X display. All its fields are private and should not be accessed directly. @mask: + + + + + +@display: +@device: +@screen: +@x: +@y: +@mask: + + @@ -248,6 +291,18 @@ of an X display. All its fields are private and should not be accessed directly. @Returns: + + + + + +@display: +@device: +@win_x: +@win_y: +@Returns: + + A table of pointers to functions for getting quantities related to @@ -281,6 +336,25 @@ Applications should never have any reason to use this facility @Returns: + + + + + +@get_device_state: +@window_get_device_position: +@window_at_device_position: + + + + + + +@display: +@new_hooks: +@Returns: + + @@ -292,6 +366,18 @@ Applications should never have any reason to use this facility @y: + + + + + +@display: +@device: +@screen: +@x: +@y: + + diff --git a/docs/reference/gdk/tmpl/gdkdisplaymanager.sgml b/docs/reference/gdk/tmpl/gdkdisplaymanager.sgml index a2b65dc3ff..253c5eda61 100644 --- a/docs/reference/gdk/tmpl/gdkdisplaymanager.sgml +++ b/docs/reference/gdk/tmpl/gdkdisplaymanager.sgml @@ -19,6 +19,9 @@ changes. + + + The GdkDisplayManager struct has no interesting @@ -45,6 +48,7 @@ fields. +@void: @Returns: diff --git a/docs/reference/gdk/tmpl/gdkscreen.sgml b/docs/reference/gdk/tmpl/gdkscreen.sgml index 64784c54d4..eeeed17c14 100644 --- a/docs/reference/gdk/tmpl/gdkscreen.sgml +++ b/docs/reference/gdk/tmpl/gdkscreen.sgml @@ -25,6 +25,9 @@ form a large screen area. + + + This is a currently just a placeholder typedef for the first argument of @@ -70,6 +73,7 @@ when GDK gets multihead support. +@void: @Returns: diff --git a/docs/reference/gdk/tmpl/gdktesting.sgml b/docs/reference/gdk/tmpl/gdktesting.sgml index c1ce047ab2..f8e787a4a5 100644 --- a/docs/reference/gdk/tmpl/gdktesting.sgml +++ b/docs/reference/gdk/tmpl/gdktesting.sgml @@ -18,6 +18,9 @@ They allow to simulate some user input. + + + diff --git a/docs/reference/gdk/tmpl/general.sgml b/docs/reference/gdk/tmpl/general.sgml index 41f0c72a03..a2aaf3d711 100644 --- a/docs/reference/gdk/tmpl/general.sgml +++ b/docs/reference/gdk/tmpl/general.sgml @@ -18,6 +18,9 @@ utility functions. + + + Initializes the GDK library and connects to the X server. @@ -70,6 +73,7 @@ by GTK+ applications. +@void: @Returns: @@ -94,6 +98,7 @@ If the locale is not supported by X then it is reset to the standard "C" locale. +@void: @Returns: the resulting locale. @@ -104,25 +109,12 @@ locale. @sm_client_id: - - -Exits the application using the exit() system call. - - -This routine is provided mainly for backwards compatibility, since it used to -perform tasks necessary to exit the application cleanly. Those tasks are now -performed in a function which is automatically called on exit (via the use -of g_atexit()). - - -@error_code: the error code to pass to the exit() call. - - +@void: @@ -141,6 +133,7 @@ commandline option, the default value is the program name (determined with g_get_prgname()) with the first character converted to uppercase. +@void: @Returns: the program class. @@ -160,6 +153,7 @@ Gets the name of the display, which usually comes from the DISPLAY--display command line option. +@void: @Returns: the name of the display. @@ -170,12 +164,14 @@ by the server. This is rarely needed by applications. It's main use is for trapping X errors with gdk_error_trap_push() and gdk_error_trap_pop(). +@void: +@void: @Returns: @@ -183,6 +179,7 @@ trapping X errors with gdk_error_trap_push() and gdk_error_trap_pop(). +@void: @Returns: @@ -190,6 +187,7 @@ trapping X errors with gdk_error_trap_push() and gdk_error_trap_pop(). +@void: @Returns: @@ -197,6 +195,7 @@ trapping X errors with gdk_error_trap_push() and gdk_error_trap_pop(). +@void: @Returns: @@ -279,6 +278,7 @@ success or the reason for the failure of the grab attempt. +@void: @Returns: @@ -324,32 +324,7 @@ available. - - - - -Returns %TRUE if GDK will attempt to use the MIT-SHM shared memory extension. - - -The shared memory extension is used for #GdkImage, and consequently for -GdkRGB. -It enables much faster drawing by communicating with the X server through -SYSV shared memory calls. However, it can only be used if the X client and -server are on the same machine and the server supports it. - - -@Returns: %TRUE if use of the MIT shared memory extension will be attempted. - - - - -Sets whether the use of the MIT shared memory extension should be attempted. -This function is mainly for internal use. It is only safe for an application -to set this to %FALSE, since if it is set to %TRUE and the server does not -support the extension it may cause warning messages to be output. - - -@use_xshm: %TRUE if use of the MIT shared memory extension should be attempted. +@void: @@ -375,6 +350,7 @@ avoid the X error in any other way. +@void: @@ -382,19 +358,20 @@ avoid the X error in any other way. Removes the X error trap installed with gdk_error_trap_push(). +@void: @Returns: the X error code, or 0 if no error occurred. -This macro is defined if GDK is configured to use the X backend. +This macro is defined if GDK is configured to use the X11 backend. -This macro is defined if GDK is configured to use the Win32 backend. +This macro is defined if GDK is configured to use the win32 backend. diff --git a/docs/reference/gdk/tmpl/images.sgml b/docs/reference/gdk/tmpl/images.sgml index 1c560af205..5dbb3e1800 100644 --- a/docs/reference/gdk/tmpl/images.sgml +++ b/docs/reference/gdk/tmpl/images.sgml @@ -12,7 +12,6 @@ It has now been superceded to a large extent by the much more flexible To create an empty #GdkImage use gdk_image_new(). -To create a #GdkImage from bitmap data use gdk_image_new_bitmap(). To create an image from part of a #GdkWindow use gdk_drawable_get_image(). @@ -25,7 +24,7 @@ the different formats that may be used. To draw a #GdkImage in a #GdkWindow or #GdkPixmap use gdk_draw_image(). -To destroy a #GdkImage use gdk_image_destroy(). +To destroy a #GdkImage use g_object_unref(). @@ -58,23 +57,15 @@ displays. + + + The #GdkImage struct contains information on the image and the pixel data. @parent_instance: the parent instance -@type: the type of the image. -@visual: the visual. -@byte_order: the byte order. -@width: the width of the image in pixels. -@height: the height of the image in pixels. -@depth: the depth of the image, i.e. the number of bits per pixel. -@bpp: the number of bytes per pixel. -@bpl: the number of bytes per line of the image. -@bits_per_pixel: the number of bits per pixel. -@mem: the pixel data. -@colormap: the #GdkColormap associated with the image @@ -105,55 +96,6 @@ is supported by the server. @GDK_IMAGE_FASTEST: Specifies that %GDK_IMAGE_SHARED should be tried first, and if that fails then %GDK_IMAGE_NORMAL will be used. - - - - -@visual: -@data: -@width: -@height: -@Returns: - - - - - - -@drawable: -@x: -@y: -@width: -@height: -@Returns: - - - - - - - -@image: -@Returns: - - - - - - - -@image: - - - - -Destroys a #GdkImage, freeing any resources allocated for it. - - - -@image: a #GdkImage. - - @@ -172,6 +114,87 @@ Destroys a #GdkImage, freeing any resources allocated for it. @colormap: + + + + + +@image: +@Returns: + + + + + + + +@image: +@Returns: + + + + + + + +@image: +@Returns: + + + + + + + +@image: +@Returns: + + + + + + + +@image: +@Returns: + + + + + + + +@image: +@Returns: + + + + + + + +@image: +@Returns: + + + + + + + +@image: +@Returns: + + + + + + + +@image: +@Returns: + + Sets a pixel in a #GdkImage to a given pixel value. diff --git a/docs/reference/gdk/tmpl/input.sgml b/docs/reference/gdk/tmpl/input.sgml index 82c7ff45e4..41377caaa6 100644 --- a/docs/reference/gdk/tmpl/input.sgml +++ b/docs/reference/gdk/tmpl/input.sgml @@ -34,6 +34,9 @@ callbacks. + + + @@ -72,16 +75,6 @@ occurs. @condition: the triggering condition. - - -A callback function called when a piece of user data is -no longer being stored by GDK. Will typically free the -structure or object that @data points to. - - -@data: the user data. - - diff --git a/docs/reference/gdk/tmpl/input_devices.sgml b/docs/reference/gdk/tmpl/input_devices.sgml deleted file mode 100644 index 4a163fe71a..0000000000 --- a/docs/reference/gdk/tmpl/input_devices.sgml +++ /dev/null @@ -1,304 +0,0 @@ - -Input Devices - - -Functions for handling extended input devices - - - -In addition to the normal keyboard and mouse input devices, GTK+ also -contains support for extended input devices. In -particular, this support is targeted at graphics tablets. Graphics -tablets typically return sub-pixel positioning information and possibly -information about the pressure and tilt of the stylus. Under -X, the support for extended devices is done through the -XInput extension. - - -Because handling extended input devices may involve considerable -overhead, they need to be turned on for each #GdkWindow -individually using gdk_input_set_extension_events(). -(Or, more typically, for GtkWidgets, using gtk_widget_set_extension_events()). -As an additional complication, depending on the support from -the windowing system, its possible that a normal mouse -cursor will not be displayed for a particular extension -device. If an application does not want to deal with displaying -a cursor itself, it can ask only to get extension events -from devices that will display a cursor, by passing the -%GDK_EXTENSION_EVENTS_CURSOR value to -gdk_input_set_extension_events(). Otherwise, the application -must retrieve the device information using gdk_devices_list(), -check the has_cursor field, and, -if it is %FALSE, draw a cursor itself when it receives -motion events. - - -Each pointing device is assigned a unique integer ID; events from a -particular device can be identified by the -deviceid field in the event structure. The -events generated by pointer devices have also been extended to contain -pressure, xtilt -and ytilt fields which contain the extended -information reported as additional valuators -from the device. The pressure field is a -a double value ranging from 0.0 to 1.0, while the tilt fields are -double values ranging from -1.0 to 1.0. (With -1.0 representing the -maximum tilt to the left or up, and 1.0 representing the maximum -tilt to the right or down.) - - -One additional field in each event is the -source field, which contains an -enumeration value describing the type of device; this currently -can be one of %GDK_SOURCE_MOUSE, %GDK_SOURCE_PEN, %GDK_SOURCE_ERASER, -or %GDK_SOURCE_CURSOR. This field is present to allow simple -applications to (for instance) delete when they detect eraser -devices without having to keep track of complicated per-device -settings. - - -Various aspects of each device may be configured. -The configuration of devices is queried using gdk_devices_list(). -Each device must be activated using gdk_device_set_mode(), which -also controls whether the device's range is mapped to the -entire screen or to a single window. The mapping of the valuators of -the device onto the predefined valuator types is set using -gdk_device_set_axis_use(). And the source type for each device -can be set with gdk_device_set_source(). - - -Devices may also have associated keys -or macro buttons. Such keys can be globally set to map -into normal X keyboard events. The mapping is set using -gdk_device_set_key(). - - -The interfaces in this section will most likely be considerably -modified in the future to accomodate devices that may have different -sets of additional valuators than the pressure xtilt -and ytilt. - - - - - - - - - - - - -A GdkDevice structure contains -a detailed description of an extended input device. All -fields are read-only; but you can use gdk_device_set_source(), -gdk_device_set_mode(), gdk_device_set_key() and gdk_device_set_axis_use() -to configure various aspects of the device. - - -@parent_instance: the parent instance -@name: the name of this device. -@source: the type of this device. -@mode: the mode of this device -@has_cursor: %TRUE if the pointer follows device motion. -@num_axes: the length of the @axes array. -@axes: an array of #GdkDeviceAxis, describing the axes of this device. -@num_keys: the length of the @keys array. -@keys: an array of #GdkDeviceKey, describing the mapped macro buttons - of this device. - - - -An enumeration describing the type of an input device -in general terms. - - -@GDK_SOURCE_MOUSE: the device is a mouse. (This will be reported for the core - pointer, even if it is something else, such as a trackball.) -@GDK_SOURCE_PEN: the device is a stylus of a graphics tablet or similar device. -@GDK_SOURCE_ERASER: the device is an eraser. Typically, this would be the other end - of a stylus on a graphics tablet. -@GDK_SOURCE_CURSOR: the device is a graphics tablet "puck" or similar device. - - - -An enumeration that describes the mode of an input device. - - -@GDK_MODE_DISABLED: the device is disabled and will not report any events. -@GDK_MODE_SCREEN: the device is enabled. The device's coordinate space - maps to the entire screen. -@GDK_MODE_WINDOW: the device is enabled. The device's coordinate space - is mapped to a single window. The manner in which this window - is chosen is undefined, but it will typically be the same - way in which the focus window for key events is determined. - - - -The GdkDeviceKey structure contains information -about the mapping of one device macro button onto a normal X key event. -It has the following fields: - - -@keyval: the keyval to generate when the macro button is pressed. - If this is 0, no keypress will be generated. -@modifiers: the modifiers set for the generated key event. - - - -The GdkDeviceAxis structure contains information -about the range and mapping of a device axis. - - -@use: specifies how the axis is used. -@min: the minimal value that will be reported by this axis. -@max: the maximal value that will be reported by this axis. - - - -An enumeration describing the way in which a device -axis (valuator) maps onto the predefined valuator -types that GTK+ understands. - - -@GDK_AXIS_IGNORE: the axis is ignored. -@GDK_AXIS_X: the axis is used as the x axis. -@GDK_AXIS_Y: the axis is used as the y axis. -@GDK_AXIS_PRESSURE: the axis is used for pressure information. -@GDK_AXIS_XTILT: the axis is used for x tilt information. -@GDK_AXIS_YTILT: the axis is used for x tilt information. -@GDK_AXIS_WHEEL: the axis is used for wheel information. -@GDK_AXIS_LAST: a constant equal to the numerically highest axis value. - - - - - -@Returns: - - - - -Sets the source type for an input device. - - -@device: a #GdkDevice. -@source: the source type. - - - - -Sets a the mode of an input device. The mode controls if the -device is active and whether the device's range is mapped to the -entire screen or to a single window. - - -@device: a #GdkDevice. -@mode: the input mode. -@Returns: %TRUE if the mode was successfully changed. - - - - -Specifies the X key event to generate when a macro button of a device -is pressed. - - -@device: a #GdkDevice. -@index_: the index of the macro button to set. -@keyval: the keyval to generate. -@modifiers: the modifiers to set. - - - - -Specifies how an axis of a device is used. - - -@device: a #GdkDevice. -@index_: the index of the axis. -@use: specifies how the axis is used. - - - - - - -@Returns: - - - - - -@device: -@window: -@axes: -@mask: - - - - - - - -@device: -@window: -@start: -@stop: -@events: -@n_events: -@Returns: - - - - -Frees an array of #GdkTimeCoord that was returned by gdk_device_get_history(). - - -@events: an array of #GdkTimeCoord. -@n_events: the length of the array. - - - - -The #GdkTimeCoord structure stores a single event in a -motion history. It contains the following fields: - - -@time: The timestamp for this event. -@axes: the values of the device's axes. - - - - - - -@device: -@axes: -@use: -@value: -@Returns: - - - - -Turns extension events on or off for a particular window, -and specifies the event mask for extension events. - - -@window: a #GdkWindow. -@mask: the event mask -@mode: the type of extension events that are desired. - - - - -An enumeration used to specify which extension events -are desired for a particular widget. - - -@GDK_EXTENSION_EVENTS_NONE: no extension events are desired. -@GDK_EXTENSION_EVENTS_ALL: all extension events are desired. -@GDK_EXTENSION_EVENTS_CURSOR: extension events are desired only if a cursor - will be displayed for the device. - diff --git a/docs/reference/gdk/tmpl/keys.sgml b/docs/reference/gdk/tmpl/keys.sgml index 9c67e094cc..dc0083407c 100644 --- a/docs/reference/gdk/tmpl/keys.sgml +++ b/docs/reference/gdk/tmpl/keys.sgml @@ -88,6 +88,9 @@ gdk_keymap_translate_keyboard_state() just to get the keyval. + + + A GdkKeymap defines the translation from keyboard state @@ -143,6 +146,7 @@ be mapped to a keyval. +@void: @Returns: @@ -234,6 +238,15 @@ Returns: %PANGO_DIRECTION_LTR or %PANGO_DIRECTION_RTL. @Returns: + + + + + +@keymap: +@state: + + diff --git a/docs/reference/gdk/tmpl/pango_interaction.sgml b/docs/reference/gdk/tmpl/pango_interaction.sgml index ac61ed9880..b9556a9b7f 100644 --- a/docs/reference/gdk/tmpl/pango_interaction.sgml +++ b/docs/reference/gdk/tmpl/pango_interaction.sgml @@ -132,6 +132,9 @@ g_object_unref (gc); + + + @@ -210,6 +213,7 @@ g_object_unref (gc); +@void: @Returns: @@ -222,15 +226,6 @@ g_object_unref (gc); @Returns: - - - - - -@context: -@colormap: - - A Pango text attribute containing a embossed bitmap to be used when diff --git a/docs/reference/gdk/tmpl/pixbufs.sgml b/docs/reference/gdk/tmpl/pixbufs.sgml index cf69413f90..9b1aacf72d 100644 --- a/docs/reference/gdk/tmpl/pixbufs.sgml +++ b/docs/reference/gdk/tmpl/pixbufs.sgml @@ -19,6 +19,9 @@ pixbufs, see the #GdkPixbuf API documentation. + + + @@ -35,44 +38,10 @@ pixbufs, see the #GdkPixbuf API documentation. @alpha_threshold: - -@pixbuf: -@drawable: -@gc: -@src_x: -@src_y: -@dest_x: -@dest_y: -@width: -@height: -@dither: -@x_dither: -@y_dither: - - - - - - - -@pixbuf: -@drawable: -@src_x: -@src_y: -@dest_x: -@dest_y: -@width: -@height: -@alpha_mode: -@alpha_threshold: -@dither: -@x_dither: -@y_dither: - diff --git a/docs/reference/gdk/tmpl/pixmaps.sgml b/docs/reference/gdk/tmpl/pixmaps.sgml index 6d210d39f3..333a2b348c 100644 --- a/docs/reference/gdk/tmpl/pixmaps.sgml +++ b/docs/reference/gdk/tmpl/pixmaps.sgml @@ -21,6 +21,9 @@ pixel can be either on or off). + + + An opaque structure representing an offscreen drawable. @@ -118,21 +121,6 @@ for the new pixmap. Can be %NULL, if the depth is given. @Returns: - - -Deprecated equivalent of g_object_ref(). - - -@Returns: @pixmap - - - - -Deprecated equivalent of g_object_unref(). - - - - An opaque structure representing an offscreen drawable of depth @@ -142,18 +130,3 @@ refers generically to any of these types. - - -Deprecated equivalent of g_object_ref(). - - -@Returns: @pixmap - - - - -Deprecated equivalent of g_object_unref(). - - - - diff --git a/docs/reference/gdk/tmpl/properties.sgml b/docs/reference/gdk/tmpl/properties.sgml index 5dc62e6da2..64a1b2d3f7 100644 --- a/docs/reference/gdk/tmpl/properties.sgml +++ b/docs/reference/gdk/tmpl/properties.sgml @@ -45,6 +45,9 @@ data commonly stored in X window properties. + + + An opaque type representing a string as an index into a table diff --git a/docs/reference/gdk/tmpl/regions.sgml b/docs/reference/gdk/tmpl/regions.sgml index c05c2641c3..dfb43a6dd4 100644 --- a/docs/reference/gdk/tmpl/regions.sgml +++ b/docs/reference/gdk/tmpl/regions.sgml @@ -36,6 +36,9 @@ It can be intersected to regions by using gdk_region_spans_intersect_foreach(). + + + Defines the x and y coordinates of a point. @@ -86,6 +89,7 @@ A GdkRegion represents a set of pixels on the screen. +@void: @Returns: diff --git a/docs/reference/gdk/tmpl/rgb.sgml b/docs/reference/gdk/tmpl/rgb.sgml index 000f2ce027..a60e73980c 100644 --- a/docs/reference/gdk/tmpl/rgb.sgml +++ b/docs/reference/gdk/tmpl/rgb.sgml @@ -125,12 +125,7 @@ colors. - - -This function no longer does anything at all. It's completely useless -(and harmless). - - + @@ -328,37 +323,6 @@ colors. This is used only for gdk_draw_indexed_image(). @colors: The colors, represented as 0xRRGGBB integer values. @n_colors: The number of colors in the cmap. - - -Sets the foreground color in @gc to the specified color (or the -closest approximation, in the case of limited visuals). - - -@gc: The #GdkGC to modify. -@rgb: The color, represented as a 0xRRGGBB integer value. - - - - -Sets the background color in @gc to the specified color (or the -closest approximation, in the case of limited visuals). - - -@gc: The #GdkGC to modify. -@rgb: The color, represented as a 0xRRGGBB integer value. - - - - -Finds the X pixel closest in color to the @rgb color specified. This -value may be used to set the pixel field of -a #GdkColor struct. - - -@rgb: The color, represented as a 0xRRGGBB integer value. -@Returns: The X pixel value. - - @@ -399,6 +363,7 @@ private colormap. +@void: @Returns: @@ -407,18 +372,10 @@ private colormap. +@void: @Returns: - - -Gets the colormap set by GdkRGB. This colormap and the corresponding -visual should be used when creating windows that will be drawn in by GdkRGB. - - -@Returns: The #GdkColormap set by GdkRGB. - - Determines whether the preferred visual is ditherable. This function may be @@ -427,6 +384,7 @@ dither mode is desired; if the display is not ditherable, it may make sense to gray out or hide the corresponding UI widget. +@void: @Returns: %TRUE if the preferred visual is ditherable. diff --git a/docs/reference/gdk/tmpl/selections.sgml b/docs/reference/gdk/tmpl/selections.sgml index 29fdd61c34..1ce9b894ab 100644 --- a/docs/reference/gdk/tmpl/selections.sgml +++ b/docs/reference/gdk/tmpl/selections.sgml @@ -50,34 +50,7 @@ to the X Inter-client Communication Conventions Manual - - -The #GdkSelection enumeration contains predefined -atom values for several common selections. - - - - - -The #GdkSelectionType enumeration contains predefined -atom values used to represent the types of data transferred -in response to a request for a target. See the -ICCCM for details about what data should be transferred -for each of these types. Other atoms can be used, -and the recommended practice for GTK+ is to to use mime -types for this purpose. However, supporting these types -may be useful for compatibility with older programs. - - - - - -The #GdkTarget enumeration contains predefined atom values which are -used to describe possible targets for a selection. Other atoms can be -used, and the recommended practice for GTK+ is to to use mime types -for this purpose. However, supporting these types may be useful for -compatibility with older programs. - + diff --git a/docs/reference/gdk/tmpl/threads.sgml b/docs/reference/gdk/tmpl/threads.sgml index 489b41f78e..75a61ee840 100644 --- a/docs/reference/gdk/tmpl/threads.sgml +++ b/docs/reference/gdk/tmpl/threads.sgml @@ -250,6 +250,9 @@ int main (int argc, char *argv[]) + + + This macro marks the beginning of a critical section in which GDK and @@ -275,6 +278,7 @@ begun with #GDK_THREADS_ENTER. +@void: @@ -285,6 +289,7 @@ conditions. Only one thread at a time can be in such a critial section. +@void: @@ -292,6 +297,7 @@ section. Leaves a critical region begun with gdk_threads_enter(). +@void: diff --git a/docs/reference/gdk/tmpl/visuals.sgml b/docs/reference/gdk/tmpl/visuals.sgml index cd740e95d3..76ae994ad3 100644 --- a/docs/reference/gdk/tmpl/visuals.sgml +++ b/docs/reference/gdk/tmpl/visuals.sgml @@ -54,6 +54,9 @@ then %GDK_VISUAL_STATIC_GRAY. + + + The GdkVisual structure contains information about @@ -75,42 +78,6 @@ pixel_from_rgb (GdkVisual *visual, @parent_instance: inherited portion from #GObject -@type: The type of this visual. -@depth: The number of bits per pixel. -@byte_order: The byte-order for this visual. -@colormap_size: The number of entries in the colormap, for - visuals of type %GDK_VISUAL_PSEUDO_COLOR or - %GDK_VISUAL_GRAY_SCALE. For other visual types, it - is the number of possible levels per color component. - If the visual has different numbers of levels for - different components, the value of this field is undefined. -@bits_per_rgb: The number of significant bits per red, green, or blue - when specifying colors for this visual. (For instance, for - gdk_colormap_alloc_color()) -@red_mask: A mask giving the bits in a pixel value that - correspond to the red field. Significant only for - %GDK_VISUAL_PSEUDOCOLOR and %GDK_VISUAL_DIRECTCOLOR. -@red_shift: The red_shift and - red_prec give an alternate presentation - of the information in red_mask. - red_mask is a contiguous sequence - of red_prec bits starting at bit - number red_shift. For example, - shows constructing a pixel value - out of three 16 bit color values. -@red_prec: See above. -@green_mask: A mask giving the bits in a pixel value that - correspond to the green field. -@green_shift: The green_shift and - green_prec give an alternate presentation - of the information in green_mask. -@green_prec: See above. -@blue_mask: A mask giving the bits in a pixel value that - correspond to the blue field. -@blue_shift: The blue_shift and - blue_prec give an alternate presentation - of the information in blue_mask. -@blue_prec: See above. @@ -171,6 +138,85 @@ in memory as 0x00, 0xcc, 0xee, 0xff. +@void: +@Returns: + + + + + + + +@visual: +@Returns: + + + + + + + +@visual: +@mask: +@shift: +@precision: + + + + + + + +@visual: +@Returns: + + + + + + + +@visual: +@Returns: + + + + + + + +@visual: +@Returns: + + + + + + + +@visual: +@mask: +@shift: +@precision: + + + + + + + +@visual: +@mask: +@shift: +@precision: + + + + + + + +@visual: @Returns: @@ -179,6 +225,7 @@ in memory as 0x00, 0xcc, 0xee, 0xff. +@void: @Returns: @@ -187,6 +234,7 @@ in memory as 0x00, 0xcc, 0xee, 0xff. +@void: @Returns: @@ -195,6 +243,7 @@ in memory as 0x00, 0xcc, 0xee, 0xff. +@void: @Returns: @@ -203,6 +252,7 @@ in memory as 0x00, 0xcc, 0xee, 0xff. +@void: @Returns: @@ -234,23 +284,6 @@ in memory as 0x00, 0xcc, 0xee, 0xff. @Returns: - - -Deprecated equivalent of g_object_ref(). - - -@v: a #GdkVisual -@Returns: the same visual - - - - -Deprecated equivalent of g_object_unref(). - - -@v: a #GdkVisual - - diff --git a/docs/reference/gdk/tmpl/windows.sgml b/docs/reference/gdk/tmpl/windows.sgml deleted file mode 100644 index 7c58ac39f6..0000000000 --- a/docs/reference/gdk/tmpl/windows.sgml +++ /dev/null @@ -1,1853 +0,0 @@ - -Windows - - -Onscreen display areas in the target window system - - - -A #GdkWindow is a rectangular region on the screen. It's a low-level object, -used to implement high-level objects such as #GtkWidget and #GtkWindow on the -GTK+ level. A #GtkWindow is a toplevel window, the thing a user might think of -as a "window" with a titlebar and so on; a #GtkWindow may contain many #GdkWindow. -For example, each #GtkButton has a #GdkWindow associated with it. - -Composited Windows - -Normally, the windowing system takes care of rendering the contents of a child -window onto its parent window. This mechanism can be intercepted by calling -gdk_window_set_composited() on the child window. For a -composited window it is the responsibility of the -application to render the window contents at the right spot. - -Composited windows - - -/* The expose event handler for the event box. - * - * This function simply draws a transparency onto a widget on the area - * for which it receives expose events. This is intended to give the - * event box a "transparent" background. - * - * In order for this to work properly, the widget must have an RGBA - * colourmap. The widget should also be set as app-paintable since it - * doesn't make sense for GTK+ to draw a background if we are drawing it - * (and because GTK+ might actually replace our transparency with its - * default background colour). - */ -static gboolean -transparent_expose (GtkWidget *widget, - GdkEventExpose *event) -{ - cairo_t *cr; - - cr = gdk_cairo_create (widget->window); - cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR); - gdk_cairo_region (cr, event->region); - cairo_fill (cr); - cairo_destroy (cr); - - return FALSE; -} - -/* The expose event handler for the window. - * - * This function performs the actual compositing of the event box onto - * the already-existing background of the window at 50% normal opacity. - * - * In this case we do not want app-paintable to be set on the widget - * since we want it to draw its own (red) background. Because of this, - * however, we must ensure that we use g_signal_connect_after so that - * this handler is called after the red has been drawn. If it was - * called before then GTK would just blindly paint over our work. - * - * Note: if the child window has children, then you need a cairo 1.6 - * feature to make this work correctly. - */ -static gboolean -window_expose_event (GtkWidget *widget, - GdkEventExpose *event) -{ - GdkRegion *region; - GtkWidget *child; - cairo_t *cr; - - /* get our child (in this case, the event box) */ - child = gtk_bin_get_child (GTK_BIN (widget)); - - /* create a cairo context to draw to the window */ - cr = gdk_cairo_create (widget->window); - - /* the source data is the (composited) event box */ - gdk_cairo_set_source_pixmap (cr, child->window, - child->allocation.x, - child->allocation.y); - - /* draw no more than our expose event intersects our child */ - region = gdk_region_rectangle (&child->allocation); - gdk_region_intersect (region, event->region); - gdk_cairo_region (cr, region); - cairo_clip (cr); - - /* composite, with a 50% opacity */ - cairo_set_operator (cr, CAIRO_OPERATOR_OVER); - cairo_paint_with_alpha (cr, 0.5); - - /* we're done */ - cairo_destroy (cr); - - return FALSE; -} - -int -main (int argc, char **argv) -{ - GtkWidget *window, *event, *button; - GdkScreen *screen; - GdkColormap *rgba; - GdkColor red; - - gtk_init (&argc, &argv); - - /* Make the widgets */ - button = gtk_button_new_with_label ("A Button"); - event = gtk_event_box_new (); - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - - /* Put a red background on the window */ - gdk_color_parse ("red", &red); - gtk_widget_modify_bg (window, GTK_STATE_NORMAL, &red); - - /* Set the colourmap for the event box. - * Must be done before the event box is realised. - */ - screen = gtk_widget_get_screen (event); - rgba = gdk_screen_get_rgba_colormap (screen); - gtk_widget_set_colormap (event, rgba); - - /* Set our event box to have a fully-transparent background - * drawn on it. Currently there is no way to simply tell GTK+ - * that "transparency" is the background colour for a widget. - */ - gtk_widget_set_app_paintable (GTK_WIDGET (event), TRUE); - g_signal_connect (event, "expose-event", - G_CALLBACK (transparent_expose), NULL); - - /* Put them inside one another */ - gtk_container_set_border_width (GTK_CONTAINER (window), 10); - gtk_container_add (GTK_CONTAINER (window), event); - gtk_container_add (GTK_CONTAINER (event), button); - - /* Realise and show everything */ - gtk_widget_show_all (window); - - /* Set the event box GdkWindow to be composited. - * Obviously must be performed after event box is realised. - */ - gdk_window_set_composited (event->window, TRUE); - - /* Set up the compositing handler. - * Note that we do _after_ so that the normal (red) background is drawn - * by gtk before our compositing occurs. - */ - g_signal_connect_after (window, "expose-event", - G_CALLBACK (window_expose_event), NULL); - - gtk_main (); - - return 0; -} -]]> - - -In the example , a button is -placed inside of an event box inside of a window. The event box is -set as composited and therefore is no longer automatically drawn to -the screen. - - -When the contents of the event box change, an expose event is -generated on its parent window (which, in this case, belongs to -the toplevel #GtkWindow). The expose handler for this widget is -responsible for merging the changes back on the screen in the way -that it wishes. - - -In our case, we merge the contents with a 50% transparency. We -also set the background colour of the window to red. The effect is -that the background shows through the button. - - -Offscreen Windows - -Offscreen windows are more general than composited windows, since they -allow not only to modify the rendering of the child window onto its parent, -but also to apply coordinate transformations. - - -To integrate an offscreen window into a window hierarchy, one has to call -gdk_window_set_embedder() and handle a number of signals. The -gdk_offscreen_window_set_embedder() and handle a number of signals. The -#GdkWindow::pick-embedded-child signal on the embedder window is used to -select an offscreen child at given coordinates, and the #GdkWindow::to-embedder -and #GdkWindow::from-embedder signals on the offscreen window are used to -translate coordinates between the embedder and the offscreen window. - - - -For rendering an offscreen window onto its embedder, the contents of the -offscreen window are available as a pixmap, via -gdk_offscreen_window_get_pixmap(). - - - - - - - - - - - - - -An opaque structure representing an onscreen drawable. -Pointers to structures of type #GdkPixmap, #GdkBitmap, -and #GdkWindow, can often be used interchangeably. -The type #GdkDrawable refers generically to any of -these types. - - - - - - - - -@gdkwindow: the object which received the signal. -@arg1: -@arg2: -@arg3: -@arg4: - - - - - - -@gdkwindow: the object which received the signal. -@arg1: -@arg2: -@Returns: - - - - - - -@gdkwindow: the object which received the signal. -@arg1: -@arg2: -@arg3: -@arg4: - - - - - - - - -Describes the kind of window. - - -@GDK_WINDOW_ROOT: root window; this window has no parent, covers the entire screen, and is created by the window system -@GDK_WINDOW_TOPLEVEL: toplevel window (used to implement #GtkWindow) -@GDK_WINDOW_CHILD: child window (used to implement e.g. #GtkEntry) -@GDK_WINDOW_DIALOG: useless/deprecated compatibility type -@GDK_WINDOW_TEMP: override redirect temporary window (used to implement #GtkMenu) -@GDK_WINDOW_FOREIGN: foreign window (see gdk_window_foreign_new()) -@GDK_WINDOW_OFFSCREEN: offscreen window (see ). Since 2.18 - - - -@GDK_INPUT_OUTPUT windows are the standard kind of window you might expect. -@GDK_INPUT_ONLY windows are invisible; they are used to trap events, but -you can't draw on them. - - -@GDK_INPUT_OUTPUT: window for graphics and events -@GDK_INPUT_ONLY: window for events only - - - -Used to indicate which fields of a #GdkGeometry struct should be paid attention -to. Also, the presence/absence of @GDK_HINT_POS, @GDK_HINT_USER_POS, and -@GDK_HINT_USER_SIZE is significant, though they don't directly refer to -#GdkGeometry fields. @GDK_HINT_USER_POS will be set automatically by #GtkWindow -if you call gtk_window_move(). @GDK_HINT_USER_POS and @GDK_HINT_USER_SIZE -should be set if the user specified a size/position using a --geometry -command-line argument; gtk_window_parse_geometry() automatically sets these -flags. - - -@GDK_HINT_POS: indicates that the program has positioned the window -@GDK_HINT_MIN_SIZE: min size fields are set -@GDK_HINT_MAX_SIZE: max size fields are set -@GDK_HINT_BASE_SIZE: base size fields are set -@GDK_HINT_ASPECT: aspect ratio fields are set -@GDK_HINT_RESIZE_INC: resize increment fields are set -@GDK_HINT_WIN_GRAVITY: window gravity field is set -@GDK_HINT_USER_POS: indicates that the window's position was explicitly set by the user -@GDK_HINT_USER_SIZE: indicates that the window's size was explicitly set by the user - - - -The #GdkGeometry struct gives the window manager information about -a window's geometry constraints. Normally you would set these on -the GTK+ level using gtk_window_set_geometry_hints(). #GtkWindow -then sets the hints on the #GdkWindow it creates. - - - -gdk_window_set_geometry_hints() expects the hints to be fully valid already and -simply passes them to the window manager; in contrast, -gtk_window_set_geometry_hints() performs some interpretation. For example, -#GtkWindow will apply the hints to the geometry widget instead of the toplevel -window, if you set a geometry widget. Also, the -@min_width/@min_height/@max_width/@max_height fields may be set to -1, and -#GtkWindow will substitute the size request of the window or geometry widget. If -the minimum size hint is not provided, #GtkWindow will use its requisition as -the minimum size. If the minimum size is provided and a geometry widget is set, -#GtkWindow will take the minimum size as the minimum size of the geometry widget -rather than the entire window. The base size is treated similarly. - - - -The canonical use-case for gtk_window_set_geometry_hints() is to get a terminal -widget to resize properly. Here, the terminal text area should be the geometry -widget; #GtkWindow will then automatically set the base size to the size of -other widgets in the terminal window, such as the menubar and scrollbar. Then, -the @width_inc and @height_inc fields should be set to the size of one character -in the terminal. Finally, the base size should be set to the size of one -character. The net effect is that the minimum size of the terminal -will have a 1x1 character terminal area, and only terminal sizes on -the "character grid" will be allowed. - - - -Here's an example of how the terminal example would be implemented, assuming -a terminal area widget called "terminal" and a toplevel window "toplevel": - - GdkGeometry hints; - - hints.base_width = terminal->char_width; - hints.base_height = terminal->char_height; - hints.min_width = terminal->char_width; - hints.min_height = terminal->char_height; - hints.width_inc = terminal->char_width; - hints.height_inc = terminal->char_height; - - gtk_window_set_geometry_hints (GTK_WINDOW (toplevel), - GTK_WIDGET (terminal), - &hints, - GDK_HINT_RESIZE_INC | - GDK_HINT_MIN_SIZE | - GDK_HINT_BASE_SIZE); - - - - -The other useful fields are the @min_aspect and @max_aspect fields; these -contain a width/height ratio as a floating point number. If a geometry widget is -set, the aspect applies to the geometry widget rather than the entire window. -The most common use of these hints is probably to set @min_aspect and -@max_aspect to the same value, thus forcing the window to keep a constant aspect -ratio. - - -@min_width: minimum width of window (or -1 to use requisition, with #GtkWindow only) -@min_height: minimum height of window (or -1 to use requisition, with #GtkWindow only) -@max_width: maximum width of window (or -1 to use requisition, with #GtkWindow only) -@max_height: maximum height of window (or -1 to use requisition, with #GtkWindow only) -@base_width: allowed window widths are @base_width + @width_inc * N where N is any integer (-1 allowed with #GtkWindow) -@base_height: allowed window widths are @base_height + @height_inc * N where N is any integer (-1 allowed with #GtkWindow) -@width_inc: width resize increment -@height_inc: height resize increment -@min_aspect: minimum width/height ratio -@max_aspect: maximum width/height ratio -@win_gravity: window gravity, see gtk_window_set_gravity() - - - -Defines the reference point of a window and the meaning of coordinates -passed to gtk_window_move(). See gtk_window_move() and the "implementation -notes" section of the -Extended -Window Manager Hints specification for more details. - - -@GDK_GRAVITY_NORTH_WEST: the reference point is at the top left corner. -@GDK_GRAVITY_NORTH: the reference point is in the middle of the top edge. -@GDK_GRAVITY_NORTH_EAST: the reference point is at the top right corner. -@GDK_GRAVITY_WEST: the reference point is at the middle of the left edge. -@GDK_GRAVITY_CENTER: the reference point is at the center of the window. -@GDK_GRAVITY_EAST: the reference point is at the middle of the right edge. -@GDK_GRAVITY_SOUTH_WEST: the reference point is at the lower left corner. -@GDK_GRAVITY_SOUTH: the reference point is at the middle of the lower edge. -@GDK_GRAVITY_SOUTH_EAST: the reference point is at the lower right corner. -@GDK_GRAVITY_STATIC: the reference point is at the top left corner of the - window itself, ignoring window manager decorations. - - - -Determines a window edge or corner. - - -@GDK_WINDOW_EDGE_NORTH_WEST: the top left corner. -@GDK_WINDOW_EDGE_NORTH: the top edge. -@GDK_WINDOW_EDGE_NORTH_EAST: the top right corner. -@GDK_WINDOW_EDGE_WEST: the left edge. -@GDK_WINDOW_EDGE_EAST: the right edge. -@GDK_WINDOW_EDGE_SOUTH_WEST: the lower left corner. -@GDK_WINDOW_EDGE_SOUTH: the lower edge. -@GDK_WINDOW_EDGE_SOUTH_EAST: the lower right corner. - - - -These are hints for the window manager that indicate what type of function -the window has. The window manager can use this when determining decoration -and behaviour of the window. The hint must be set before mapping the window. - - -See the -Extended -Window Manager Hints specification for more details about -window types. - - -@GDK_WINDOW_TYPE_HINT_NORMAL: Normal toplevel window. -@GDK_WINDOW_TYPE_HINT_DIALOG: Dialog window. -@GDK_WINDOW_TYPE_HINT_MENU: Window used to implement a menu; GTK+ uses - this hint only for torn-off menus, see #GtkTearoffMenuItem. -@GDK_WINDOW_TYPE_HINT_TOOLBAR: Window used to implement toolbars. -@GDK_WINDOW_TYPE_HINT_SPLASHSCREEN: Window used to display a splash - screen during application startup. -@GDK_WINDOW_TYPE_HINT_UTILITY: Utility windows which are not detached - toolbars or dialogs. -@GDK_WINDOW_TYPE_HINT_DOCK: Used for creating dock or panel windows. -@GDK_WINDOW_TYPE_HINT_DESKTOP: Used for creating the desktop background -window. -@GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU: A menu that belongs to a menubar. -@GDK_WINDOW_TYPE_HINT_POPUP_MENU: A menu that does not belong to a menubar, - e.g. a context menu. -@GDK_WINDOW_TYPE_HINT_TOOLTIP: A tooltip. -@GDK_WINDOW_TYPE_HINT_NOTIFICATION: A notification - typically a "bubble" - that belongs to a status icon. -@GDK_WINDOW_TYPE_HINT_COMBO: A popup from a combo box. -@GDK_WINDOW_TYPE_HINT_DND: A window that is used to implement a DND cursor. - - - -Attributes to use for a newly-created window. - - -@title: title of the window (for toplevel windows) -@event_mask: event mask (see gdk_window_set_events()) -@x: X coordinate relative to parent window (see gdk_window_move()) -@y: Y coordinate relative to parent window (see gdk_window_move()) -@width: width of window -@height: height of window -@wclass: #GDK_INPUT_OUTPUT (normal window) or #GDK_INPUT_ONLY (invisible window that receives events) -@visual: #GdkVisual for window -@colormap: #GdkColormap for window -@window_type: type of window -@cursor: cursor for the window (see gdk_window_set_cursor()) -@wmclass_name: don't use (see gtk_window_set_wmclass()) -@wmclass_class: don't use (see gtk_window_set_wmclass()) -@override_redirect: %TRUE to bypass the window manager -@type_hint: a hint of the function of the window - - - -Used to indicate which fields in the #GdkWindowAttr struct should be -honored. For example, if you filled in the "cursor" and "x" fields of -#GdkWindowAttr, pass "@GDK_WA_X | @GDK_WA_CURSOR" to gdk_window_new(). Fields -in #GdkWindowAttr not covered by a bit in this enum are required; for example, -the @width/@height, @wclass, and @window_type fields are required, they have no -corresponding flag in #GdkWindowAttributesType. - - -@GDK_WA_TITLE: Honor the title field -@GDK_WA_X: Honor the X coordinate field -@GDK_WA_Y: Honor the Y coordinate field -@GDK_WA_CURSOR: Honor the cursor field -@GDK_WA_COLORMAP: Honor the colormap field -@GDK_WA_VISUAL: Honor the visual field -@GDK_WA_WMCLASS: Honor the wmclass_class and wmclass_name fields -@GDK_WA_NOREDIR: Honor the override_redirect field -@GDK_WA_TYPE_HINT: Honor the type_hint field - - - - - - -@parent: -@attributes: -@attributes_mask: -@Returns: - - - - - - - -@window: - - - - -Deprecated equivalent of g_object_ref() - - -@Returns: the window - - - - -Deprecated equivalent of g_object_unref() - - - - - - - - - -@window: -@Returns: - - - - - - - -@win_x: -@win_y: -@Returns: - - - - - - - -@window: - - - - - - - -@window: - - - - - - - -@window: - - - - - - - -@window: -@Returns: - - - - - - - -@window: -@Returns: - - - - - - - -@window: -@Returns: - - - - - - - -@window: -@Returns: - - - - - - - -@window: - - - - - - - -@window: - - - - - - - -@window: - - - - - - - -@window: - - - - - - - -@window: - - - - - - - -@window: - - - - - - - -@window: - - - - - - - -@window: - - - - - - - -@window: - - - - - - - -@window: -@setting: - - - - - - - -@window: -@setting: - - - - - - - -@window: -@opacity: - - - - - - - -@window: -@composited: - - - - - - - -@window: -@x: -@y: - - - - - - - -@window: -@width: -@height: - - - - - - - -@window: -@x: -@y: -@width: -@height: - - - - - - - -@window: -@dx: -@dy: - - - - - - - -@window: -@region: -@dx: -@dy: - - - - - - - -@window: - - - - - - - -@window: -@Returns: - - - - - - - -@window: -@new_parent: -@x: -@y: - - - - - - - -@window: - - - - - - - -@window: -@x: -@y: -@width: -@height: - - - - - - - -@window: -@x: -@y: -@width: -@height: - - - - -Deprecated equivalent to gdk_draw_drawable(), see that function for docs - - -@drawable: a #GdkDrawable -@gc: a #GdkGC sharing the drawable's visual and colormap -@x: X position in @drawable where the rectangle should be drawn -@y: Y position in @drawable where the rectangle should be drawn -@source_drawable: the source #GdkDrawable, which may be the same as @drawable -@source_x: X position in @src of rectangle to draw -@source_y: Y position in @src of rectangle to draw -@width: width of rectangle to draw, or -1 for entire @src width -@height: height of rectangle to draw, or -1 for entire @src height - -@drawable: a #GdkDrawable -@xdest: X position in @drawable where the rectangle should be drawn -@ydest: Y position in @drawable where the rectangle should be drawn - - - - - - - -@window: - - - - - - - -@window: - - - - - - - -@window: -@sibling: -@above: - - - - - - - -@window: -@timestamp: - - - - -Registers a window as a potential drop destination. - - -@window: a #GdkWindow. - - - - - - - -@window: -@edge: -@button: -@root_x: -@root_y: -@timestamp: - - - - - - - -@window: -@button: -@root_x: -@root_y: -@timestamp: - - - - - - - -@geometry: -@flags: -@width: -@height: -@new_width: -@new_height: - - - - - - - -@window: - - - - - - - -@window: -@rectangle: - - - - - - - -@window: -@region: - - - - - - - -@window: - - - - - - - -@window: -@rect: -@invalidate_children: - - - - - - - -@window: -@region: -@invalidate_children: - - - - - - - -@window: -@region: -@child_func: -@user_data: - - - - - - - -@window: -@Returns: - - - - - - - -@window: - - - - - - - -@window: - - - - - - - - - - - - - - -@window: -@update_children: - - - - - - - -@setting: - - - - - - - -@window: -@real_drawable: -@x_offset: -@y_offset: - - - - - - - -@window: - - - - - - - -@window: - - - - - - - -@window: -@user_data: - - - - - - - -@window: -@override_redirect: - - - - - - - -@window: -@accept_focus: - - - - - - - -@window: -@focus_on_map: - - - - - - - -@window: -@function: -@data: - - - - - - - -@window: -@function: -@data: - - - - -Specifies the type of function used to filter native events before they are -converted to GDK events. - - - -When a filter is called, @event is unpopulated, except for -event->window. The filter may translate the native -event to a GDK event and store the result in @event, or handle it without -translation. If the filter translates the event and processing should -continue, it should return GDK_FILTER_TRANSLATE. - - -@xevent: the native event to filter. -@event: the GDK event to which the X event will be translated. -@data: user data set when the filter was installed. -@Returns: a #GdkFilterReturn value. - - - - -Specifies the result of applying a #GdkFilterFunc to a native event. - - -@GDK_FILTER_CONTINUE: event not handled, continue processing. -@GDK_FILTER_TRANSLATE: native event translated into a GDK event and stored - in the event structure that was passed in. -@GDK_FILTER_REMOVE: event handled, terminate processing. - - - -Used to represent native events (XEvents for the X11 -backend, MSGs for Win32). - - - - - - - - -@window: -@mask: -@x: -@y: - - - - - - - -@window: -@shape_region: -@offset_x: -@offset_y: - - - - - - - -@window: - - - - - - - -@window: - - - - - - - -@window: -@mask: -@x: -@y: - - - - - - - -@window: -@shape_region: -@offset_x: -@offset_y: - - - - - - - -@window: - - - - - - - -@window: - - - - - - - -@window: -@use_static: -@Returns: - - - - - - - -@window: -@x: -@y: -@min_width: -@min_height: -@max_width: -@max_height: -@flags: - - - - - - - -@window: -@title: - - - - - - - -@window: -@color: - - - - - - - -@window: -@pixmap: -@parent_relative: - - - - -A special value for GdkPixmap* variables, indicating -that the background pixmap for a window should be inherited from the parent -window. - - - - - - - - - -@window: -@cursor: - - - - - - - -@window: -@Returns: - - - - -Deprecated equivalent to gdk_drawable_set_colormap() - - - - - - - - - -@window: -@data: - - - - - - - -@window: -@x: -@y: -@width: -@height: -@depth: - - - - - - - -@window: -@geometry: -@geom_mask: - - - - - - - -@window: -@pixbufs: - - - - - - - -@window: -@modal: - - - - - - - -@window: -@hint: - - - - - - - -@window: -@Returns: - - - - - - - -@window: -@skips_taskbar: - - - - - - - -@window: -@skips_pager: - - - - - - - -@window: -@urgent: - - - - - - - -@window: -@x: -@y: - - - - - - - -@window: -@x: -@y: - - - - - - - -@window: -@rect: - - - - -Deprecated equivalent of gdk_drawable_get_size(). - - - - - - -Deprecated equivalent of gdk_drawable_get_visual(). - - -@Returns: the #GdkVisual of the window - - - - -Deprecated equivalent of gdk_drawable_get_colormap(). - - -@Returns: colormap for the window - - - - -Deprecated equivalent of gdk_drawable_get_type(). - - -@Returns: type of drawable - - - - - - - -@window: -@x: -@y: -@Returns: - - - - - - - -@window: -@x: -@y: -@Returns: - - - - - - - -@window: -@x: -@y: -@root_x: -@root_y: - - - - - - - -@window: -@x: -@y: -@mask: -@Returns: - - - - -A set of bit-flags to indicate the state of modifier keys and mouse buttons -in various event types. Typical modifier keys are Shift, Control, Meta, Super, -Hyper, Alt, Compose, Apple, CapsLock or ShiftLock. - - -Like the X Window System, GDK supports 8 modifier keys and 5 mouse buttons. - - -Since 2.10, GDK recognizes which of the Meta, Super or Hyper keys are mapped -to Mod2 - Mod5, and indicates this by setting %GDK_SUPER_MASK, %GDK_HYPER_MASK -or %GDK_META_MASK in the state field of key events. - - -@GDK_SHIFT_MASK: the Shift key. -@GDK_LOCK_MASK: a Lock key (depending on the modifier mapping of the - X server this may either be CapsLock or ShiftLock). -@GDK_CONTROL_MASK: the Control key. -@GDK_MOD1_MASK: the fourth modifier key (it depends on the modifier - mapping of the X server which key is interpreted as this modifier, but - normally it is the Alt key). -@GDK_MOD2_MASK: the fifth modifier key (it depends on the modifier - mapping of the X server which key is interpreted as this modifier). -@GDK_MOD3_MASK: the sixth modifier key (it depends on the modifier - mapping of the X server which key is interpreted as this modifier). -@GDK_MOD4_MASK: the seventh modifier key (it depends on the modifier - mapping of the X server which key is interpreted as this modifier). -@GDK_MOD5_MASK: the eighth modifier key (it depends on the modifier - mapping of the X server which key is interpreted as this modifier). -@GDK_BUTTON1_MASK: the first mouse button. -@GDK_BUTTON2_MASK: the second mouse button. -@GDK_BUTTON3_MASK: the third mouse button. -@GDK_BUTTON4_MASK: the fourth mouse button. -@GDK_BUTTON5_MASK: the fifth mouse button. -@GDK_SUPER_MASK: the Super modifier. Since 2.10 -@GDK_HYPER_MASK: the Hyper modifier. Since 2.10 -@GDK_META_MASK: the Meta modifier. Since 2.10 -@GDK_RELEASE_MASK: not used in GDK itself. GTK+ uses it to differentiate - between (keyval, modifiers) pairs from key press and release events. -@GDK_MODIFIER_MASK: a mask covering all modifier types. - - - - - - -@window: -@Returns: - - - - - - - -@window: -@Returns: - - - - - - - -@window: -@Returns: - - - - - - - -@window: -@Returns: - - - - - - - -@window: -@Returns: - - - - - - - -@window: -@event_mask: - - - - - - - -@window: -@icon_window: -@pixmap: -@mask: - - - - - - - -@window: -@name: - - - - - - - -@window: -@parent: - - - - - - - -@window: -@role: - - - - - - - -@window: -@startup_id: - - - - - - - -@window: -@leader: - - - - - - - -@window: -@Returns: - - - - - - - -@window: -@decorations: - - - - - - - -@window: The window to get the decorations from -@decorations: The window decorations will be written here -@Returns: %TRUE if the window has decorations set, %FALSE otherwise. - - - - -These are hints originally defined by the Motif toolkit. -The window manager can use them when determining how to decorate -the window. The hint must be set before mapping the window. - - -@GDK_DECOR_ALL: all decorations should be applied. -@GDK_DECOR_BORDER: a frame should be drawn around the window. -@GDK_DECOR_RESIZEH: the frame should have resize handles. -@GDK_DECOR_TITLE: a titlebar should be placed above the window. -@GDK_DECOR_MENU: a button for opening a menu should be included. -@GDK_DECOR_MINIMIZE: a minimize button should be included. -@GDK_DECOR_MAXIMIZE: a maximize button should be included. - - - - - - -@window: -@functions: - - - - -These are hints originally defined by the Motif toolkit. -The window manager can use them when determining the functions -to offer for the window. -The hint must be set before mapping the window. - - -@GDK_FUNC_ALL: all functions should be offered. -@GDK_FUNC_RESIZE: the window should be resizable. -@GDK_FUNC_MOVE: the window should be movable. -@GDK_FUNC_MINIMIZE: the window should be minimizable. -@GDK_FUNC_MAXIMIZE: the window should be maximizable. -@GDK_FUNC_CLOSE: the window should be closable. - - - - - - -@Returns: - - - - - - - -@Returns: - - - - -A table of pointers to functions for getting quantities related to -the current pointer position. GDK has one global table of this type, -which can be set using gdk_set_pointer_hooks(). - - -This is only useful for such low-level tools as an event recorder. -Applications should never have any reason to use this facility - - -@get_pointer: Obtains the current pointer position and modifier state. - The position is given in coordinates relative to the window containing - the pointer, which is returned in @window. -@window_at_pointer: Obtains the window underneath the mouse pointer, - returning the location of that window in @win_x, @win_y. Returns %NULL - if the window under the mouse pointer is not known to GDK (for example, - belongs to another application). - - - - - - -@new_hooks: -@Returns: - - - - - - - -@window: -@Returns: - - - - - - - -@window: -@embedder: - - - - - - - -@window: -@Returns: - - - - - - - -@window: - - - - - - - -@window: -@drawable: -@src_x: -@src_y: -@dest_x: -@dest_y: -@width: -@height: - - - - - - - -@window: - - - - - diff --git a/docs/reference/gdk/tmpl/x_interaction.sgml b/docs/reference/gdk/tmpl/x_interaction.sgml index 2af1f6845d..6d3620df74 100644 --- a/docs/reference/gdk/tmpl/x_interaction.sgml +++ b/docs/reference/gdk/tmpl/x_interaction.sgml @@ -17,6 +17,9 @@ X backend-specific functions + + + Obtains the Xlib window id of the root window of the current screen. @@ -24,13 +27,6 @@ Obtains the Xlib window id of the root window of the current screen. - - -Obtains the Xlib window id of the root window of the default screen. - - - - The current display. @@ -253,14 +249,6 @@ Another name for GDK_DRAWABLE_XID(). @Returns: - - - - -@xcolormap: -@Returns: - - @@ -657,6 +645,7 @@ Since: 2.2 +@void: @Returns: @@ -665,6 +654,7 @@ Since: 2.2 +@void: @Returns: @@ -673,6 +663,7 @@ Since: 2.2 +@void: @Returns: @@ -681,6 +672,7 @@ Since: 2.2 +@void: @@ -724,6 +716,7 @@ Since: 2.2 +@void: diff --git a/docs/reference/gtk/Makefile.am b/docs/reference/gtk/Makefile.am index 6ec19561cb..bab6e4c5e6 100644 --- a/docs/reference/gtk/Makefile.am +++ b/docs/reference/gtk/Makefile.am @@ -4,16 +4,13 @@ include $(top_srcdir)/Makefile.decl AUTOMAKE_OPTIONS = 1.6 # The name of the module. -DOC_MODULE=gtk +DOC_MODULE=gtk3 # The top-level SGML file. DOC_MAIN_SGML_FILE=gtk-docs.sgml # Extra options to supply to gtkdoc-scan -SCAN_OPTIONS=--deprecated-guards="GTK_ENABLE_BROKEN|GTK_DISABLE_DEPRECATED" - -# Extra options to pass to gtkdoc-scangobj -SCANGOBJ_OPTIONS=--type-init-func="gtk_type_init(0)" +SCAN_OPTIONS=--deprecated-guards="GTK_ENABLE_BROKEN|GTK_DISABLE_DEPRECATED" # The directory containing the source code. Relative to $(srcdir) DOC_SOURCE_DIR=../../../gtk @@ -123,27 +120,12 @@ content_files = \ version.xml \ running.sgml \ building.sgml \ - changes-1.2.sgml \ - changes-2.0.sgml \ compiling.sgml \ directfb.sgml \ drawing-model.xml \ glossary.xml \ + migrating-2to3.xml \ migrating-checklist.sgml \ - migrating-ClientSideWindows.sgml \ - migrating-GtkAboutDialog.sgml \ - migrating-GtkAction.sgml \ - migrating-GtkAssistant.sgml \ - migrating-GtkBuilder.sgml \ - migrating-GtkColorButton.sgml \ - migrating-GtkComboBox.sgml \ - migrating-GtkEntry-icons.sgml \ - migrating-GtkFileChooser.sgml \ - migrating-GtkIconView.sgml \ - migrating-GtkLabel-links.sgml \ - migrating-GtkLinkButton.sgml \ - migrating-GtkRecentChooser.sgml \ - migrating-GtkTooltip.sgml \ objects_grouped.sgml \ osx.sgml \ question_index.sgml \ @@ -152,14 +134,15 @@ content_files = \ tree_widget.sgml \ windows.sgml \ x11.sgml \ - gtk-query-immodules-2.0.xml \ - gtk-update-icon-cache.xml \ - gtk-builder-convert.xml \ + gtk-query-immodules-3.0.xml \ + gtk-update-icon-cache-3.0.xml \ + gtk-builder-convert-3.0.xml \ visual_index.xml expand_content_files = \ drawing-model.xml \ glossary.xml \ + migrating-2to3.xml \ migrating-checklist.sgml \ migrating-ClientSideWindows.sgml \ migrating-GtkAction.sgml \ @@ -368,21 +351,38 @@ EXTRA_DIST += version.xml.in ######################################################################## +man_MANS = \ + gtk-query-immodules-3.0.1 \ + gtk-update-icon-cache-3.0.1 \ + gtk-builder-convert-3.0.1 + if ENABLE_MAN -man_MANS = gtk-query-immodules-2.0.1 gtk-update-icon-cache.1 gtk-builder-convert.1 - -%.1 : %.xml +.xml.1: @XSLTPROC@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< -BUILT_EXTRA_DIST = $(man_MANS) +dist-local-check-mans-enabled: + if grep "Man generation disabled" $(man_MANS) >/dev/null; then $(RM) $(man_MANS); fi + +else + +$(man_MANS): + echo Man generation disabled. Creating dummy $@. Configure with --enable-man to enable it. + echo Man generation disabled. Remove this file, configure with --enable-man, and rebuild > $@ + +dist-local-check-mans-enabled: + echo "*** --enable-man must be used in order to make dist" + false endif -dist-hook-local: $(BUILT_EXTRA_DIST) - files='$(BUILT_EXTRA_DIST)'; \ - for f in $$files; do \ - if test -f $$f; then d=.; else d=$(srcdir); fi; \ - cp $$d/$$f $(distdir) || exit 1; done +MAINTAINERCLEANFILES = $(man_MANS) $(BUILT_SOURCES) + +EXTRA_DIST += $(man_MANS) + +dist-hook-local: dist-local-check-mans-enabled gtk-docs-clean all-local + +gtk-docs-clean: clean + cd $(srcdir) && rm -rf xml html -include $(top_srcdir)/git.mk diff --git a/docs/reference/gtk/building.sgml b/docs/reference/gtk/building.sgml index 3d3da46a67..87a182492f 100644 --- a/docs/reference/gtk/building.sgml +++ b/docs/reference/gtk/building.sgml @@ -49,12 +49,12 @@ How to compile GTK+ itself of the tools are already included in the source packages. But it's useful to know a bit about how packages that use these tools work. A source package is distributed as a - tar.gz or tar.bz2 file + tar.gz or tar.bz2 file which you unpack into a directory full of the source files as follows: - tar xvfz gtk+-2.0.0.tar.gz - tar xvfj gtk+-2.0.0.tar.bz2 + tar xvfz gtk+-3.0.0.tar.gz + tar xvfj gtk+-3.0.0.tar.bz2 In the toplevel of the directory that is created, there will be @@ -103,7 +103,7 @@ How to compile GTK+ itself a search path that pkg-config (see below) uses when looking for for file describing how to compile programs using different libraries. If you were installing GTK+ - and it's dependencies into /opt/gtk, you + and it's dependencies into /opt/gtk, you might want to set these variables as: @@ -137,30 +137,26 @@ How to compile GTK+ itself - - pkg-config - is a tool for tracking the compilation flags needed for - libraries that are used by the GTK+ libraries. (For each - library, a small .pc text file is installed - in a standard location that contains the compilation flags - needed for that library along with version number information.) - The version of pkg-config needed to build - GTK+ is mirrored in the dependencies directory - on the GTK+ FTP - site. - + + pkg-config + is a tool for tracking the compilation flags needed for + libraries that are used by the GTK+ libraries. (For each + library, a small .pc text file is installed + in a standard location that contains the compilation flags + needed for that library along with version number information.) + - - The GTK+ makefiles will mostly work with different versions - of make, however, there tends to be - a few incompatibilities, so the GTK+ team recommends - installing GNU - make if you don't already have it on your system - and using it. (It may be called gmake - rather than make.) - + + The GTK+ makefiles will mostly work with different versions + of make, however, there tends to be + a few incompatibilities, so the GTK+ team recommends + installing GNU + make if you don't already have it on your system + and using it. (It may be called gmake + rather than make.) + @@ -170,106 +166,105 @@ How to compile GTK+ itself - - The GLib library provides core non-graphical functionality - such as high level data types, Unicode manipulation, and - an object and type system to C programs. It is available - from the GTK+ - FTP site. - + + The GLib library provides core non-graphical functionality + such as high level data types, Unicode manipulation, and + an object and type system to C programs. It is available + from the GTK+ + FTP site. + - - Pango is a library - for internationalized text handling. It is available from - the GTK+ FTP - site.. - + + Pango is a library + for internationalized text handling. It is available from + the GTK+ FTP + site.. + - - ATK is the Accessibility Toolkit. It provides a set of generic - interfaces allowing accessibility technologies such as - screen readers to interact with a graphical user interface. - It is available from the GTK+ FTP site. - + + ATK is the Accessibility Toolkit. It provides a set of generic + interfaces allowing accessibility technologies such as + screen readers to interact with a graphical user interface. + It is available from the GTK+ FTP site. + - - The GNU - libiconv library is needed to build GLib if your - system doesn't have the iconv() - function for doing conversion between character - encodings. Most modern systems should have - iconv(). - + + The GNU + libiconv library is needed to build GLib if your + system doesn't have the iconv() + function for doing conversion between character + encodings. Most modern systems should have + iconv(). + - - The libintl library from the GNU gettext - package is needed if your system doesn't have the - gettext() functionality for handling - message translation databases. - + + The libintl library from the GNU gettext + package is needed if your system doesn't have the + gettext() functionality for handling + message translation databases. + - - The JPEG, - PNG, and - TIFF image - loading libraries are needed to compile GTK+. You probably - already have these libraries installed, but if not, the - versions you need are available in the + + The JPEG, + PNG, and + TIFF image + loading libraries are needed to compile GTK+. You probably + already have these libraries installed, but if not, the + versions you need are available in the dependencies directory on the the - GTK+ - FTP site.. (Before installing these libraries - from source, you should check if your operating system - vendor has prebuilt packages of these libraries that you - don't have installed.) - + GTK+ + FTP site.. (Before installing these libraries + from source, you should check if your operating system + vendor has prebuilt packages of these libraries that you + don't have installed.) + - - The libraries from the X window system are needed to build - Pango and GTK+. You should already have these installed on - your system, but it's possible that you'll need to install - the development environment for these libraries that your - operating system vendor provides. - + + The libraries from the X window system are needed to build + Pango and GTK+. You should already have these installed on + your system, but it's possible that you'll need to install + the development environment for these libraries that your + operating system vendor provides. + - - The fontconfig - library provides Pango with a standard way of locating - fonts and matching them against font names. - + + The fontconfig + library provides Pango with a standard way of locating + fonts and matching them against font names. + - - Cairo + + Cairo is a graphics library that supports vector graphics and image compositing. Both Pango and GTK+ use cairo for much of their drawing. - - gobject-introspection + + gobject-introspection is a framework for making introspection data available to language bindings. - The shared-mime-info - package is not a hard dependency of GTK+, but it contains definitions - for mime types that are used by GIO and, indirectly, by GTK+. - gdk-pixbuf will use GIO for mime type detection if possible. For this - to work, shared-mime-info needs to be installed and - XDG_DATA_DIRS set accordingly at configure time. + The shared-mime-info + package is not a hard dependency of GTK+, but it contains definitions + for mime types that are used by GIO and, indirectly, by GTK+. + gdk-pixbuf will use GIO for mime type detection if possible. For this + to work, shared-mime-info needs to be installed and + XDG_DATA_DIRS set accordingly at configure time. Otherwise, gdk-pixbuf falls back to its built-in mime type detection. @@ -281,7 +276,7 @@ How to compile GTK+ itself First make sure that you have the necessary external dependencies installed: pkg-config, GNU make, the JPEG, PNG, and TIFF libraries, FreeType, and, if necessary, - libiconv and libintl. To get detailed information about building + libiconv and libintl. To get detailed information about building these packages, see the documentation provided with the individual packages. On a Linux system, it's quite likely you'll have all of these @@ -294,7 +289,7 @@ How to compile GTK+ itself make install mentioned above. If you're lucky, this will all go smoothly, and you'll be ready to start compiling your own GTK+ - applications. You can test your GTK+ installation + applications. You can test your GTK+ installation by running the gtk-demo program that GTK+ installs. @@ -315,123 +310,127 @@ How to compile GTK+ itself Extra Configuration Options - In addition to the normal options, the - configure script for the GTK+ library - supports a number of additional arguments. (Command line - arguments for the other GTK+ libraries are described in - the documentation distributed with the those libraries.) + In addition to the normal options, the + configure script for the GTK+ library + supports a number of additional arguments. (Command line + arguments for the other GTK+ libraries are described in + the documentation distributed with the those libraries.) - - configure + + configure - - --disable-modules - --enable-modules - - - --with-included-loaders==LOADER1,LOADER2,... - - - --with-included-immodules=MODULE1,MODULE2,... - - - --enable-debug=[no|minimum|yes] - - --disable-visibility - --enable-visibility - + --disable-modules + --enable-modules + - --disable-shm - --enable-shm - + --with-included-loaders==LOADER1,LOADER2,... + - --disable-xim - --enable-xim - + --with-included-immodules=MODULE1,MODULE2,... + - --disable-xim-inst - --enable-xim-inst - + --enable-debug=[no|minimum|yes] + - --disable-xkb - --enable-xkb - + --disable-visibility + --enable-visibility + - --disable-xinerama - --enable-xinerama - - - --disable-gtk-doc - --enable-gtk-doc - - - --disable-cups - --enable-cups - + --disable-shm + --enable-shm + + + --disable-xim + --enable-xim + + + --disable-xim-inst + --enable-xim-inst + + + --disable-xkb + --enable-xkb + + + --disable-xinerama + --enable-xinerama + + + --disable-gtk-doc + --enable-gtk-doc + + + --disable-cups + --enable-cups + + + --disable-papi + --enable-papi + --with-xinput=[no|yes] - - --with-gdktarget=[x11|win32|quartz|directfb] - - --disable-introspection + --with-gdktarget=[x11|win32|quartz|directfb] - + + --disable-introspection + + - <systemitem>--disable-modules</systemitem> and - <systemitem>--enable-modules</systemitem> + <systemitem>--disable-modules</systemitem> and + <systemitem>--enable-modules</systemitem> - - Normally GTK+ will try to build the GdkPixbuf image file - format loaders as little shared libraries that are loaded on - demand. The --disable-modules - argument indicates that they should all be built statically - into the GTK+ library instead. This is useful for - people who need to produce statically-linked binaries. If - neither --disable-modules nor - --enable-modules is specified, then - the configure script will try to - auto-detect whether shared modules work on your system. - + + Normally GTK+ will try to build the GdkPixbuf image file + format loaders as little shared libraries that are loaded on + demand. The --disable-modules + argument indicates that they should all be built statically + into the GTK+ library instead. This is useful for + people who need to produce statically-linked binaries. If + neither --disable-modules nor + --enable-modules is specified, then + the configure script will try to + auto-detect whether shared modules work on your system. + - <systemitem>--with-included-loaders</systemitem> + <systemitem>--with-included-loaders</systemitem> - + This option allows you to specify which image loaders you want to include; for example, you might include only the PNG loader to create a smaller GdkPixbuf binary. - + - <systemitem>--with-included-immodules</systemitem> + <systemitem>--with-included-immodules</systemitem> - + This option allows you to specify which input method modules you - want to include. - + want to include. + <systemitem>--enable-debug</systemitem> - + - Turns on various amounts of debugging support. Setting this to 'no' - disables g_assert(), g_return_if_fail(), g_return_val_if_fail() and + Turns on various amounts of debugging support. Setting this to 'no' + disables g_assert(), g_return_if_fail(), g_return_val_if_fail() and all cast checks between different object types. Setting it to 'minimum' - disables only cast checks. Setting it to 'yes' enables - runtime debugging. + disables only cast checks. Setting it to 'yes' enables + runtime debugging. The default is 'minimum'. - Note that 'no' is fast, but dangerous as it tends to destabilize - even mostly bug-free software by changing the effect of many bugs - from simple warnings into fatal crashes. Thus - should not + Note that 'no' is fast, but dangerous as it tends to destabilize + even mostly bug-free software by changing the effect of many bugs + from simple warnings into fatal crashes. Thus + should not be used for stable releases of GTK+. @@ -443,7 +442,7 @@ How to compile GTK+ itself The option --disable-visibility turns off the use of ELF visibility attributes for linking optimizations. This makes sense while changing GTK+ itself, - since the way in which GTK+ uses visibility attributes + since the way in which GTK+ uses visibility attributes forces a full rebuild of all source files for any header modification. @@ -453,33 +452,33 @@ How to compile GTK+ itself <systemitem>--enable-explicit-deps</systemitem> and <systemitem>--disable-explicit-deps</systemitem> - If --enable-explicit-deps is - specified then GTK+ will write the full set of libraries - that GTK+ depends upon into its .pc files to be used when - programs depending on GTK+ are linked. Otherwise, GTK+ - only will include the GTK+ libraries themselves, and - will depend on system library dependency facilities to - bring in the other libraries. - By default GTK+ will disable explicit dependencies unless - it detects that they are needed on the system. (If you - specify --enable-static to force - building of static libraries, then explicit dependencies - will be written since library dependencies don't work - for static libraries.) Specifying - --enable-explicit-deps or - --enable-static can cause - compatibility - problems when libraries that GTK+ depends upon change - their versions, and should be avoided if possible. + If --enable-explicit-deps is + specified then GTK+ will write the full set of libraries + that GTK+ depends upon into its .pc files to be used when + programs depending on GTK+ are linked. Otherwise, GTK+ + only will include the GTK+ libraries themselves, and + will depend on system library dependency facilities to + bring in the other libraries. + By default GTK+ will disable explicit dependencies unless + it detects that they are needed on the system. (If you + specify --enable-static to force + building of static libraries, then explicit dependencies + will be written since library dependencies don't work + for static libraries.) Specifying + --enable-explicit-deps or + --enable-static can cause + compatibility + problems when libraries that GTK+ depends upon change + their versions, and should be avoided if possible. <systemitem>--disable-shm</systemitem> and <systemitem>--enable-shm</systemitem> - + - These options can be used to control whether GTK+ will use shared + These options can be used to control whether GTK+ will use shared memory to communicate with the X server when possible. The default is 'yes'. @@ -488,44 +487,44 @@ How to compile GTK+ itself <systemitem>--disable-xim</systemitem> and <systemitem>--enable-xim</systemitem> - + - These options can be used to control whether GTK+ will + These options can be used to control whether GTK+ will be compiled with support for XIM. (The X Input Method - extension, used for Japanese input.) The default is yes. + extension, used for Japanese input.) The default is yes. <systemitem>--disable-xim-inst</systemitem> and <systemitem>--enable-xim-inst</systemitem> - + - These options determine whether GTK+ will use the - XIM instantiate callback. + These options determine whether GTK+ will use the + XIM instantiate callback. The default is 'yes', unless the host system is Solaris, - where XRegisterIMInstantiateCallback() - seems to cause a segfault. + where XRegisterIMInstantiateCallback() + seems to cause a segfault. <systemitem>--disable-xkb</systemitem> and <systemitem>--enable-xkb</systemitem> - + - By default the configure script will try - to auto-detect whether the XKB extension is supported by + By default the configure script will try + to auto-detect whether the XKB extension is supported by the X libraries GTK+ is linked with. These options can be used to explicitly control whether - GTK+ will support the XKB extension. + GTK+ will support the XKB extension. <systemitem>--disable-xinerama</systemitem> and <systemitem>--enable-xinerama</systemitem> - + By default the configure script will try to link against the Xinerama libraries if they are found. @@ -535,29 +534,29 @@ How to compile GTK+ itself - <systemitem>--disable-gtk-doc</systemitem> and - <systemitem>--enable-gtk-doc</systemitem> + <systemitem>--disable-gtk-doc</systemitem> and + <systemitem>--enable-gtk-doc</systemitem> - - The gtk-doc package is - used to generate the reference documentation included - with GTK+. By default support for gtk-doc - is disabled because it requires various extra dependencies - to be installed. If you have - gtk-doc installed and - are modifying GTK+, you may want to enable - gtk-doc support by passing - in --enable-gtk-doc. If not - enabled, pre-generated HTML files distributed with GTK+ - will be installed. - + + The gtk-doc package is + used to generate the reference documentation included + with GTK+. By default support for gtk-doc + is disabled because it requires various extra dependencies + to be installed. If you have + gtk-doc installed and + are modifying GTK+, you may want to enable + gtk-doc support by passing + in --enable-gtk-doc. If not + enabled, pre-generated HTML files distributed with GTK+ + will be installed. + - <systemitem>--disable-cups</systemitem> and - <systemitem>--enable-cups</systemitem> + <systemitem>--disable-cups</systemitem> and + <systemitem>--enable-cups</systemitem> - + By default the configure script will try to build the cups print backend if the cups libraries are found. These options can be used to explicitly control whether @@ -565,30 +564,41 @@ How to compile GTK+ itself + + <systemitem>--disable-papi</systemitem> and + <systemitem>--enable-papi</systemitem> + + + By default the configure script will try + to build the papi print backend if the papi libraries are found. + These options can be used to explicitly control whether + the papi print backend should be built. + + + <systemitem>--with-xinput</systemitem> - Controls whether GTK+ is built with support for the XInput - extension. The XInput extension provides an interface - to extended input devices such as graphics tablets. - When this support is compiled in, specially written - GTK+ programs can get access to subpixel positions, - multiple simultaneous input devices, and extra "axes" - provided by the device such as pressure and tilt - information. This is only known to work well on XFree86 - systems, though other systems do have this extension. + Controls whether GTK+ is built with support for the XInput + or XInput2 extension. These extensions provide an extended + interface to input devices such as graphics tablets. + When this support is compiled in, specially written + GTK+ programs can get access to subpixel positions, + multiple simultaneous input devices, and extra "axes" + provided by the device such as pressure and tilt + information. - <systemitem>--with-gdktarget</systemitem> + <systemitem>--with-gdktarget</systemitem> - - Toggles between the supported backends for GDK. + + Toggles between the supported backends for GDK. The default is x11, unless the platform is Windows, in which - case the default is win32. Other supported backends are + case the default is win32. Other supported backends are the quartz backend for OS X, and the DirectFB backend for the Linux framebuffer. - + <systemitem>--disable-introspection</systemitem> diff --git a/docs/reference/gtk/changes-1.2.sgml b/docs/reference/gtk/changes-1.2.sgml deleted file mode 100644 index 1cd9470495..0000000000 --- a/docs/reference/gtk/changes-1.2.sgml +++ /dev/null @@ -1,464 +0,0 @@ - - - - -Changes from 1.0 to 1.2 -3 -Changes from 1.0 to 1.2 - - - -Changes from 1.0 to 1.2 - -Incompatible changes made between version 1.0 and version 1.2 - - - - - -Incompatible changes from 1.0 to 1.2 - - - - - -GtkAcceleratorTable has been replaced with -GtkAccelGroup. - - - - - -GtkMenuFactory has been replaced with -GtkItemFactory, although -a version of GtkMenuFactory is currently still -provided to ease the migration phase. - - - - - -The GtkTypeInfo structures used in the -gtk_*_type_init() functions have -changed a bit, the old format: - - GtkTypeInfo bin_info = - { - "GtkBin", - sizeof (GtkBin), - sizeof (GtkBinClass), - (GtkClassInitFunc) gtk_bin_class_init, - (GtkObjectInitFunc) gtk_bin_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL, - }; - - - needs to be converted to: - - - static const GtkTypeInfo bin_info = - { - "GtkBin", - sizeof (GtkBin), - sizeof (GtkBinClass), - (GtkClassInitFunc) gtk_bin_class_init, - (GtkObjectInitFunc) gtk_bin_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, - }; - - - the GtkArgSetFunc and GtkArgGetFunc - functions are not supported from the type system anymore, and you should make - sure that your code only fills in these fields with NULL - and doesn't use the deprecated function typedefs - (GtkArgSetFunc) and (GtkArgGetFunc) - anymore. - - - - - -A number of GTK+ functions were renamed. For compatibility, - gtkcompat.h #define's the old 1.0.x function names in - terms of the new names. To assure your GTK+ program doesn't rely on outdated - function variants, compile your program with - to disable - the compatibility aliases. - - Here is the list of the old names and replacements: - - - - -OldReplacement - - -gtk_accel_label_accelerator_widthgtk_accel_label_get_accel_width -gtk_check_menu_item_set_stategtk_check_menu_item_set_active -gtk_container_border_widthgtk_container_set_border_width -gtk_label_setgtk_label_set_text -gtk_notebook_current_pagegtk_notebook_get_current_page -gtk_packer_configuregtk_packer_set_child_packing -gtk_paned_gutter_sizegtk_paned_set_gutter_size -gtk_paned_handle_sizegtk_paned_set_handle_size -gtk_scale_value_widthgtk_scale_get_value_width -gtk_style_apply_default_pixmapgtk_style_apply_default_background -gtk_toggle_button_set_stategtk_toggle_button_set_active -gtk_window_positiongtk_window_set_position - - - -Note that gtk_style_apply_default_background() has an - additional argument, set_bg. This parameter should be - FALSE if the background is being set for a - NO_WINDOW widget, otherwise TRUE. - - - - - -During the development phase of the 1.1.x line of GTK+ certain functions - were deprecated and later removed. Functions affected are: - - - - -RemovedReplacement - - -gtk_clist_set_bordergtk_clist_set_shadow_type -gtk_container_block_resizegtk_container_set_resize_mode -gtk_container_unblock_resizegtk_container_set_resize_mode -gtk_container_need_resizegtk_container_check_resize -gtk_ctree_show_stubgtk_ctree_set_show_stub -gtk_ctree_set_reorderablegtk_clist_set_reorderable -gtk_ctree_set_use_drag_iconsgtk_clist_set_use_drag_icons -gtk_entry_adjust_scroll- -gtk_object_class_add_user_signalgtk_object_class_user_signal_new -gtk_preview_put_rowgtk_preview_put -gtk_progress_bar_constructgtk_progress_set_adjustment -gtk_scrolled_window_constructgtk_scrolled_window_set_{h|v}adjustment -gtk_spin_button_constructgtk_spin_button_configure -gtk_widget_thaw_acceleratorsgtk_widget_unlock_accelerators -gtk_widget_freeze_acceleratorsgtk_widget_lock_accelerators - - - - -Note that gtk_entry_adjust_scroll() is no longer needed - as GtkEntry should automatically keep the scroll - adjusted properly. - - - - - - -Additionally, all gtk_*_interp() functions were removed. - gtk_*_full() versions were provided as of GTK+ 1.0 and - should be used instead. - - - - - -GtkButton has been changed to derive from -GtkBin. - To access a button's child, use GTK_BIN (button)->child, - instead of the old GTK_BUTTON (button)->child. - - - - - -The selection API has been slightly modified: - - gtk_selection_add_handler() and - gtk_selection_add_handler_full() - have been removed. To supply the selection, one now registers - the targets one is interested in with: - - - void gtk_selection_add_target (GtkWidget *widget, - GdkAtom selection, - GdkAtom target, - guint info); - - - or: - - - void gtk_selection_add_targets (GtkWidget *widget, - GdkAtom selection, - GtkTargetEntry *targets, - guint ntargets); - - - When a request for a selection is received, the new "selection_get" - signal will be called: - - - void "selection_get" (GtkWidget *widget, - GtkSelectionData *selection_data, - guint info, - guint time); - - - A "time" parameter has also been added to the "selection_received" - signal. - - - void "selection_received" (GtkWidget *widget, - GtkSelectionData *selection_data, - guint time); - - - - - - -The old drag and drop API has been completely removed and replaced. - See the reference documentation for details on the new API. - - - - - -Support for Themes has been added. In general, this does - not affect application code, however, a few new rules should - be observed: - - - - To set a shape for a window, you must use - gtk_widget_shape_combine_mask() instead of - gdk_window_shape_combine_mask(), or the shape will be - reset when switching themes. - - - - - It is no longer permissable to draw directly on an arbitrary - widget, or to set an arbitrary widget's background pixmap. - If you need to do that, use a GtkDrawingArea or - (for a toplevel) a GtkWindow where - gtk_widget_set_app_paintable() - has been called. - - - - - - - - -The GtkScrolledWindow widget no longer creates a - GtkViewport automatically. Instead, it has been - generalized to accept any "self-scrolling" widget. - - - - The self-scrolling widgets in the GTK+ core are - GtkViewport, - GtkCList, GtkCTree, - GtkText, and GtkLayout. - All of these widgets can be added to a scrolled window as normal children with - gtk_container_add() and scrollbars will be set up - automatically. - - - - To add scrollbars to a non self-scrolling widget, (such as a - GtkList), - first add it to a viewport, then add the viewport to a scrolled window. - The scrolled window code provides a convenience function to do this: - - - void gtk_scrolled_window_add_with_viewport (GtkScrolledWindow *scrollwin, - GtkWidget *child); - - - This does exactly what it says - it creates a viewport, adds the child - widget to it, then adds the viewport to the scrolled window. - - - - The scrollbars have been removed from the GtkCList - and GtkCTree, because they are now scrolled by simply - adding them to a scrolled window. The scrollbar policy is set on the scrolled - window with gtk_scrolled_window_set_policy() and not on - the child widgets (e.g. GtkCList's - gtk_clist_set_policy() was removed). - - - - - -The "main loop" of GTK+ has been moved to GLib. This should not - affect existing programs, since compatibility functions have - been provided. However, you may want to consider migrating - your code to use the GLib main loop directly. - - - - - -the GTK_BASIC flag was removed, and with it the corresponding - macro and function GTK_WIDGET_BASIC() and - gtk_widget_basic(). - - - - - -All freeze/thaw methods are now recursive - that is, if you - freeze a widget n times, you must also thaw it n times. - - Therefore, if you have code like: - - - gboolean frozen; - frozen = GTK_CLIST_FROZEN (clist); - gtk_clist_freeze (clist); - [...] - if (!frozen) - gtk_clist_thaw (clist); - - - it will not work anymore. It must be, simply: - - - gtk_clist_freeze (clist); - [...] - gtk_clist_thaw (clist); - - - - - - -The thread safety in GTK+ 1.2 is slightly different than - that which appeared in early versions in the 1.1 - development track. The main difference is that it relies on - the thread primitives in GLib, and on the thread-safe - GLib main loop. - - - - This means: - - - - You must call g_thread_init() before - executing any other GTK+ or GDK functions in a threaded GTK+ program. - - - - - Idles, timeouts, and input functions are executed outside - of the main GTK+ lock. So, if you need to call GTK+ - inside of such a callback, you must surround the callback - with a gdk_threads_enter()/gdk_threads_leave() - pair. - - - However, signals are still executed within the main - GTK+ lock. - - - In particular, this means, if you are writing widgets - that might be used in threaded programs, you must - surround timeouts and idle functions in this matter. - - - As always, you must also surround any calls to GTK+ - not made within a signal handler with a - gdk_threads_enter()/gdk_threads_leave() - pair. - - - - - There is no longer a special - configure option for GTK+. To use threads in a GTK+ - program, you must: - - - - If you want to use the native thread implementation, - make sure GLib found this in configuration, otherwise, - call you must provide a thread implementation to - g_thread_init(). - - - - Link with the libraries returned by - gtk-config --libs gthread - and use the cflags from - gtk-config --cflags gthread. - You can get these CFLAGS and LIBS by - passing gthread as the fourth parameter to the - AM_PATH_GTK automake - macro. - - - - - - - - - - - -Prior to GTK+ 1.2, there were two conflicting interpretations - of widget->requisition. It was either taken to be - the size that the widget requested, or that size modified by calls to - gtk_widget_set_usize(). In GTK+ 1.2, - it is always interpreted the first way. - - - - Container widgets are affected in two ways by this: - - - - Container widgets should not pass - widget->requisition as the second parameter to - gtk_widget_size_request(). - Instead they should call it like: - - GtkRequisition child_requisition; - gtk_widget_size_request (widget, &child_requisition); - - - - - Container widgets should not access - child->requisition directly. Either they should use - the values returned by gtk_widget_size_request(), - or they should call the new function: - - void gtk_widget_get_child_requisition (GtkWidget *widget, - GtkRequisition *requisition); - - which returns the requisition of the given widget, modified - by calls to gtk_widget_set_usize(). - - - - - - - - - - - - - diff --git a/docs/reference/gtk/changes-2.0.sgml b/docs/reference/gtk/changes-2.0.sgml deleted file mode 100644 index 6fa82c3935..0000000000 --- a/docs/reference/gtk/changes-2.0.sgml +++ /dev/null @@ -1,1180 +0,0 @@ - - - - -Changes from 1.2 to 2.0 -3 -Changes from 1.2 to 2.0 - - - -Changes from 1.2 to 2.0 - -Incompatible changes made between version 1.2 and version 2.0 - - - - - -Incompatible changes from 1.2 to 2.0 - - -The GNOME 2.0 -porting guide on http://developer.gnome.org -has some more detailed discussion of porting from 1.2 to 2.0. -See the sections on GLib and GTK+. - - - -GTK+ changed fairly substantially from version 1.2 to 2.0, much more -so than from 1.0 to 1.2. Subsequent updates (possibilities are 2.0 to -2.2, 2.2 to 2.4, then to 3.0) will almost certainly be much, much -smaller. Nonetheless, most programs written for 1.2 compile against -2.0 with few changes. The bulk of changes listed below are to obscure -features or very specialized features, and compatibility interfaces -exist whenever possible. - - - - - - -gtk_container_get_toplevels() was removed and replaced - with gtk_window_list_toplevels(), which has different - memory management on the return value - (gtk_window_list_toplevels() copies the - GList and also references each widget in the list, - so you have to g_list_free() the list after first - unref'ing each list member). - - - - - -The gdk_time* functions have been removed. This - functionality has been unused since the main loop was moved into GLib - prior to 1.2. - - - - - -The signature for GtkPrintFunc (used for - gtk_item_factory_dump_items()) - has been changed to take a const gchar * instead of - gchar *, to match what we do for GLib, and other similar cases. - - - - - -The detail arguments in the GtkStyleClass structure -are now const gchar *. - - - - - -gtk_paned_set_gutter_size() has been removed, since the - small handle tab has been changed to include the entire area previously - occupied by the gutter. - - - - - -gtk_paned_set_handle_size() has been removed, in favor of - a style property, since this is an option that only makes sense for themes - to adjust. - - - - - -GDK no longer selects OwnerGrabButtonMask for button presses. This means - that the automatic grab that occurs when the user presses a button - will have owner_events = FALSE, so all events are - redirected to the grab window, even events that would normally go to - other windows of the window's owner. - - - - - -GtkColorSelectionDialog has now been moved into it's - own set of files, gtkcolorseldialog.c and - gtkcolorseldialog.h. - - - - - -gtk_widget_shape_combine_mask() now keeps a reference - count on the mask pixmap that is passed in. - - - - - -The GtkPatternSpec has been moved to GLib as - GPatternSpec, the pattern - arguments to gtk_item_factory_dump_items() and - gtk_item_factory_dump_rc() - have thusly been changed to take a GPatternSpec - instead of a GtkPatternSpec. - - - - - -Type system changes: - - - - GTK_TYPE_OBJECT is not a fundamental type anymore. Type checks of the - style (GTK_FUNDAMENTAL_TYPE (some_type) == GTK_TYPE_OBJECT) - will not work anymore. As a replacement, (GTK_TYPE_IS_OBJECT (some_type)) - can be used now. - - - - -The following types vanished: GTK_TYPE_ARGS, GTK_TYPE_CALLBACK, - GTK_TYPE_C_CALLBACK, GTK_TYPE_FOREIGN. The corresponding GtkArg - fields and field access macros are also gone. - - - - -The following type aliases vanished: GTK_TYPE_FLAT_FIRST, - GTK_TYPE_FLAT_LAST, GTK_TYPE_STRUCTURED_FIRST, - GTK_TYPE_STRUCTURED_LAST. - - - - -The type macros GTK_TYPE_MAKE() and GTK_TYPE_SEQNO() vanished, use of - GTK_FUNDAMENTAL_TYPE() is discouraged. Instead, the corresponding GType - API should be used: G_TYPE_FUNDAMENTAL(), G_TYPE_DERIVE_ID(), - G_TYPE_BRANCH_SEQNO(). Note that the GLib type system doesn't build new - type ids based on a global incremental sequential number anymore, but - numbers new type ids sequentially per fundamental type branch. - - - - -The following type functions vanished/were replaced: - - - -Old FunctionReplacement - - -gtk_type_query()being investigated -gtk_type_set_varargs_type()- -gtk_type_get_varargs_type()- -gtk_type_check_object_cast()g_type_check_instance_cast() -gtk_type_check_class_cast()g_type_check_class_cast() -gtk_type_describe_tree()- -gtk_type_describe_heritage()- -gtk_type_free()- -gtk_type_children_types()g_type_children() -gtk_type_set_chunk_alloc()GTypeInfo.n_preallocs -gtk_type_register_enum()g_enum_register_static() -gtk_type_register_flags()g_flags_register_static() -gtk_type_parent_class()g_type_parent()/g_type_class_peek_parent() - - - - Use of g_type_class_ref()/g_type_class_unref() and g_type_class_peek() - is recommended over usage of gtk_type_class(). - Use of g_type_register_static()/g_type_register_dynamic() is recommended - over usage of gtk_type_unique(). - - - - - - - - -Object system changes: - GtkObject derives from GObject, so is not the basic object type anymore. - This imposes the following source incompatible changes: - - - - -GtkObject has no klass field anymore, an object's class can be retrieved - with the object's coresponding GTK_<OBJECT>_GET_CLASS (object) - macro. - - - - -GtkObjectClass has no type field anymore, a class's type can be retrived - with the GTK_CLASS_TYPE (class) macro. - - - - -GtkObjectClass does not introduce the finalize() and shutdown() methods - anymore. While shutdown() is intended for GTK+ internal use only, finalize() - is required by a variety of object implementations. GObjectClass.finalize - should be overriden here, e.g.: - - static void gtk_label_finalize (GObject *gobject) - { - GtkLabel *label = GTK_LABEL (gobject); - - G_OBJECT_CLASS (parent_class)->finalize (object); - } - static void gtk_label_class_init (GtkLabelClass *class) - { - GObjectClass *gobject_class = G_OBJECT_CLASS (class); - - gobject_class->finalize = gtk_label_finalize; - } - - - - - - - - - - -The GtkObject::destroy signal can now be emitted multiple times on an object. - ::destroy implementations should check that make sure that they take this - into account, by checking to make sure that resources are there before - freeing them. For example: - - if (object->foo_data) - { - g_free (object->foo_data); - object->foo_data = NULL; - } - - - Also, ::destroy implementations have to release object references that - the object holds. Code in finalize implementations such as: - - if (object->adjustment) - { - gtk_object_unref (object->adjustment); - object->adjustment = NULL; - } - - have to be moved into the ::destroy implementations. The reason for doing - this is that all object reference cycles should be broken at destruction - time. - - Because the ::destroy signal can be emitted multiple times, it no longer - makes sense to check if a widget has been destroyed using the - GTK_OBJECT_DESTROYED() macro, and this macro has been - removed. If catching destruction is still needed, it can be done with a - signal connection to ::destroy. - - - - - -Signal system changes: - The GTK+ 2.0 signal system merely proxies the GSignal - system now. For future usage, direct use of the - GSignal API is recommended, - this avoids significant performance hits where GtkArg - structures have to be converted into GValues. For - language bindings, GSignal+GClosure - provide a much more flexible and convenient mechanism to hook into signal - emissions or install class default handlers, so the old - GtkSignal API for language bindings is not - supported anymore. - - - Functions that got removed in the GTK+ signal API: - gtk_signal_n_emissions(), - gtk_signal_n_emissions_by_name(), - gtk_signal_set_funcs(), - gtk_signal_handler_pending_by_id(), - gtk_signal_add_emission_hook(), - gtk_signal_add_emission_hook_full(), - gtk_signal_remove_emission_hook(), - gtk_signal_query(). - Also, the GtkCallbackMarshal argument to - gtk_signal_connect_full() is - not supported anymore. - For many of the removed functions, similar variants are available - in the g_signal_* namespace. - The GSignal system performs emissions in a - slightly different manner than the old GtkSignal - code. Signal handlers that are connected to signal "foo" - on object "bar" while "foo" is being emitted, will not be called anymore - during the emission they were connected within. - - - - - -Inserting and deleting text in GtkEntry though - functions such as gtk_entry_insert_text() now leave - the cursor at its original position in the text instead of moving it to - the location of the insertion/deletion. - - - - - -The label field of GtkFrame - widgets has been removed (as part of a change to allow arbitrary widgets - in the title position). The text can now be retrieved with the new function - gtk_frame_get_text(). - - - - - -The 'font' and 'font_set' declarations in RC files are now ignored. There - is a new 'font_name' field that holds the string form of a Pango font. - - - - - -A number of types in GDK have become subclasses of - GObject. For the most part, this should not break - anyone's code. However, it's now possible/encouraged to use - g_object_ref()/g_object_unref() and - other GObject features with these GDK types. The - converted types are: - GdkWindow, GdkDrawable, - GdkPixmap, GdkImage, - GdkGC, GdkDragContext, - GdkColormap. - - - - - -All drawables including pixmaps used to have a type tag, the - GdkWindowType enumeration, which included - GDK_WINDOW_PIXMAP. - GdkWindowType is now a property of - GdkWindow only, and there is - no GDK_WINDOW_PIXMAP. You can use the - GDK_IS_PIXMAP() macro to see if you have a pixmap, if - you need to know that. - - - - - -GtkStyle and GtkRcStyle are - now subclasses of GObject as well. This - requires fairly extensive changes to theme engines, but - shouldn't affect most other code. - - - - - -xthickness and ythickness have moved from - GtkStyleClass to GtkStyle - (from class to instance). This gives themes a bit more flexibility - and is generally more of the Right Thing. You can trivially fix - your code with s/style->klass->xthickness/style->xthickness/g and - same for ythickness. - - - - - -Some GtkStyle draw_* methods - have been removed (cross, oval, ramp) - and others have been added (expander, layout). This will require - changes to theme engines. - - - - - -If you were using private GDK types, they have been rearranged - significantly. You shouldn't use private types. ;-) - - - - - -The visual for a widget, and also the default visual is now derived - from the colormap for the widget and the default colormap. - gtk_widget_set_visual(), - gtk_widget_set_default_visual(), - gtk_widget_push_visual() and - gtk_widget_pop_visual() now do - nothing. Since the visual always had to match that of the colormap, - it is safe to simply delete all references to these functions. - - - - - - -A number of functions in GDK have been renamed for consistency and - clarity. #defines to provide backwards compatibility have been - included, but can be disabled by defining GDK_DISABLE_DEPRECATED. - - - - -Old functionDefined As - - -gdk_draw_pixmapgdk_draw_drawable - gdk_draw_bitmapgdk_draw_drawable -gdk_window_get_sizegdk_drawable_get_size -gdk_window_get_typegdk_window_get_window_type -gdk_window_get_colormapgdk_drawable_get_colormap -gdk_window_set_colormapgdk_drawable_set_colormap -gdk_window_get_visualgdk_drawable_get_visual -gdk_window_refgdk_drawable_ref -gdk_window_unrefgdk_drawable_unref -gdk_bitmap_refgdk_drawable_ref -gdk_bitmap_unrefgdk_drawable_unref -gdk_pixmap_refgdk_drawable_ref -gdk_pixmap_unrefgdk_drawable_unref -gdk_gc_destroygdk_gc_unref -gdk_image_destroygdk_image_unref -gdk_cursor_destroygdk_cursor_unref -gdk_window_copy_area(drawable,gc,x,y,source_drawable,source_x,source_y,width,height)gdk_draw_pixmap(drawable,gc,source_drawable,source_x,source_y,x,y,width,height) -gdk_rgb_get_cmapgdk_rgb_get_colormap - - - - (Note that g_object_ref() and - g_object_unref() may be used for all of the above ref - and unref functions.) - - gtk_widget_popup() was removed, it was only usable - for GtkWindows, and there the same effect can be - achieved by gtk_window_move() and - gtk_widget_show(). - - - - - -gdk_pixmap_foreign_new() no longer calls - XFreePixmap() on the pixmap when the - GdkPixmap is finalized. This change corresponds - to the behavior of gdk_window_foreign_new(), and fixes - a lot of problems with code where the pixmap wasn't supposed to be freed. - If XFreePixmap() is needed, it can be done using the - destroy-notification facilities of g_object_set_data(). - - - - - -GtkProgress/GtkProgressBar - had serious problems in GTK+ 1.2. - - - -Only 3 or 4 functions are really needed for 95% of progress interfaces; - GtkProgress/GtkProgressBar - had about 25 functions, and didn't even include these 3 or 4. - - - - - -In activity mode, the API involves setting the adjustment - to any random value, just to have the side effect of - calling the progress bar update function - the adjustment - is totally ignored in activity mode. - - - - - -You set the activity step as a pixel value, which means to - set the activity step you basically need to connect to - size_allocate. - - - - - -There are ctree_set_expander_style()-functions, to - randomly change look-and-feel for no good reason. - - - - - -The split between GtkProgress and -GtkProgressBar makes no sense to me whatsoever. - - - - - - This was a big wart on GTK+ and made people waste lots of time, - both learning and using the interface. - So, we have added what we feel is the correct API, and marked all the - rest deprecated. However, the changes are 100% backward-compatible and - should break no existing code. - The following 5 functions are the new programming interface and you - should consider changing your code to use them: - - void gtk_progress_bar_pulse (GtkProgressBar *pbar); - void gtk_progress_bar_set_text (GtkProgressBar *pbar, - const gchar *text); - void gtk_progress_bar_set_fraction (GtkProgressBar *pbar, - gfloat fraction); - - void gtk_progress_bar_set_pulse_step (GtkProgressBar *pbar, - gfloat fraction); - void gtk_progress_bar_set_orientation (GtkProgressBar *pbar, - GtkProgressBarOrientation orientation); - - - - - - -The GtkNotebookPage structure has been removed from - the public header files; - this was never meant to be a public structure, and all functionality that - could be done by accessing the struct fields of this structure should be - accessible otherwise. - - - - - -Negative values of the position parameter to - gtk_notebook_reorder_child() now cause the page to be appended, not - inserted at the beginning. (This gives consistency with - gtk_box_reorder_child(), gtk_menu_reorder_child().) - - - - - -GtkMenuPositionFunc has a new parameter - push_in which controls how menus placed outside the - screen is handled. If this is set to TRUE and - part of the menu is outside the screen then GTK+ pushes it into the visible - area. Otherwise the menu is cut of at the end of the visible screen area. - - - Regardless of what happens to the size of the menu, the result is always - that the items are placed in the same place as if the menu was placed - outside the screen, using menu scrolling if necessary. - - - - - -The "draw" signal and virtual method on GtkWidget - has been removed. - All drawing should now occur by invalidating a region of the widget - (call gdk_window_invalidate_rect() or - gtk_widget_queue_draw() for example to invalidate - a region). GTK+ merges all invalid regions, and sends expose events to - the widget in an idle handler for the invalid regions. - gtk_widget_draw() is deprecated but still works; it - adds the passed-in area to the invalid region and immediately sends - expose events for the current invalid region. - Most widgets will work fine if you just delete their "draw" - implementation, since they will already have working expose_event - implementations. The draw method was rarely called in practice - anyway. - - - - - -The GdkExposeEvent has a new region - field. This can be used instead of the area field if you - want a more exact representation of the area to update. - - - - - -Sending synthetic exposes using gtk_widget_event() is no - longer allowed. If you just need an expose call you should use - gdk_window_invalidate_rect() or - gdk_window_invalidate_region() instead. For the case - of container widgets that need to propagate expose events to - NO_WINDOW children you can either use - gtk_container_propagate_expose(), or chain to the - default container expose handler. - - - - - -The draw_default and draw_focus methods/signals on - GtkWidget are gone; simply draw things in your - expose handler. gtk_widget_draw_focus() and - gtk_widget_draw_default() wrapper - functions are also gone; just queue a draw on the widget, - or the part affected by the focus/default anyway. - Also, GtkWidget now has default implementations for - focus_in_event and focus_out_event. These set/unset - GTK_HAS_FOCUS, and queue a draw. So if your focus in/out - handler just does that, you can delete it. - - - - - -GtkText and GtkTree are - buggy and broken. We don't recommend using them, and changing old code to - avoid them is a good idea. The recommended alternatives are - GtkTextView and GtkTreeView. - The broken widgets are not declared in the headers by default; to use - them, define the symbol GTK_ENABLE_BROKEN during - compilation. In some future release, these widgets will be removed from GTK+. - - - - - -GdkColorContext is gone; you probably weren't using - it anyway. Use GdkColormap and the - gdk_rgb_* functions instead. - - - - - -GtkMenuBar now draws the GtkContainer::border_width - space outside the frame, not inside the frame. - - - - - - -In GTK+ 1.2, if an event handler returned TRUE it prevented - propagation of that event to parent widgets. That is, the - event signal would not be emitted on parent widgets. In - GTK+ 2.0, if an event handler returns TRUE, the current - signal emission on the current widget is immediately stopped. That is, - other callbacks connected to the signal will not be invoked. - - - - - -gtk_toolbar_new() no longer has arguments. This function - was broken because the default GtkToolbarStyle (icons, - text, both) is now a user preference, which is overridden when you call - gtk_toolbar_set_style(). The constructor forced everyone - to override the preference, which was undesirable. So to port - your app, decide if you want to force the toolbar style - or conform to the user's global defaults; if you want to force - it, call gtk_toolbar_set_style(). - - - - The orientation arg was removed from gtk_toolbar_new() - as well, just because it wasn't very useful and we were breaking the function - anyway so had an opportunity to lose it. Call - gtk_toolbar_set_orientation() to set toolbar orientation. - - - - - - -GtkRange/GtkScrollbar/GtkScale were rewritten; this means that most - theme engines won't draw them properly, and any custom subclasses of - these widgets will need a rewrite (though if you could figure out - how to subclass the old version of GtkRange, you - have our respect). Also, GtkTroughType is gone. - - - Here are some notable changes: - - - - stepper_size style property is the height for - vertical ranges, width for horizontal; the other dimension matches - the trough size. - - - - - Added the ability to do NeXT-style steppers (and several other styles - that don't make any sense). - - - - - Added min_slider_length, - fixed_slider_length properties to - GtkScrollbar. - - - - - Cleaned some private (or at least useless) functions out of - gtkscale.h, e.g. - gtk_scale_value_width. - - - - - Moved bindings from subclasses to GtkScale, - even arrow keys, since blind users don't know scale orientation. - - - - - Changed move_slider action signal to use new - GtkScrollType, remove - GtkTroughType argument. - - - - - Digits rounds the values a range will input to the given - number of decimals, but will not try to force adjustment - values set by other controllers. That is, we no longer - modify adjustment->value inside a - value_changed handler. - - - - - Added getters for GtkScale setters. - - - - - Middle-click begins a slider drag. - - - - - - - - -The GtkContainer::focus signal/virtual function and - gtk_container_focus() call were replaced by - GtkWidget::focus and gtk_widget_child_focus(). - The semantics are the same, so you should be able to just - replace container_class->focus = mywidget_focus with - widget_class->focus = mywidget_focus and replace - gtk_container_focus() calls with - gtk_widget_child_focus() calls. - - - The purpose of this change was to allow non-containers to have - focusable elements. - - - - - -gtk_rc_set_image_loader() and -gtk_rc_load_image() have been removed, now - that GTK+ includes decent image loading capabilities itself. - - - - - -An extra GtkSettings argument has been added to - gtk_rc_find_pixmap_in_path(). This function is only - actually useful from a theme engine during parsing, at which point the - GtkSettings is provided. - - - - - -The child argument facility in gtkcontainer.c has been - converted to a child property facility using - GParamSpec and other facilities - for GObject. - - - - - -The set_child_arg() and get_child_arg() - virtual methods have been replaced with set_child_property()/get_child_property(), which - work similar to GObject->set_property/get_property. - - - - - - -Other removed GtkContainer functions with the replacements: - - - - -Old functionReplacement - - -gtk_container_add_child_arg_typegtk_container_class_install_child_property -gtk_container_query_child_argsgtk_container_class_list_child_properties -gtk_container_child_getvgtk_container_child_set_property -gtk_container_child_setvgtk_container_child_get_property -gtk_container_add_with_argsgtk_container_add_with_properties -gtk_container_addvgtk_container_add/gtk_container_child_set_property - - - - - - - - - -gdk_image_get() (or rather its replacement, - gdk_drawable_get_image()) now handles errors properly - by returning NULL, previously it would crash. Also, a - window being offscreen is no longer considered an error; instead, the area - contains undefined contents for the offscreen areas. In most cases, code - using gdk_image_get() should really be ported to - gdk_pixbuf_get_from_drawable(). - - - - - -gtk_widget_set_usize() has been renamed to - gtk_widget_set_size_request(), however the old name - still exists unless you define GTK_DISABLE_DEPRECATED. - - - - - -gtk_widget_set_uposition() is deprecated; use - gtk_window_move(), - gtk_fixed_put(), or gtk_layout_put() - instead. - - - - - -gtk_window_set_policy() is deprecated. To get the effect of - "allow_shrink", call - gtk_widget_set_size_request (window, 0, 0). To get the - effect of "allow_grow", call - gtk_window_set_resizable (window, TRUE). You didn't want - the effect of "auto_shrink", it made no sense. But maybe if you were using - it you want to use gtk_window_resize (window, 1, 1) to - snap a window back to its minimum size (the 1, 1 will be rounded up to the - minimum window size). - - - - - -The core GTK+ now takes care of handling mapping, unmapping and - realizing the child widgets of containers in - gtk_widget_set_parent(). In most cases, this allows - container implementations to be simplified by removing the code in - add() methods to map and realize children. However, - there are a couple of things to watch out for here: - - - - - - -If the parent is realized before the add() happens, - gtk_widget_set_parent_window() must be called before - gtk_widget_set_parent(), since - gtk_widget_set_parent() will realize the child. - - - - - -If a container depended on its children not being mapped - unless it did so itself (for example, GtkNotebook - only mapped the current page), then the new function - gtk_widget_set_child_visible() must be called to keep - widgets that should not be mapped not mapped. - - - - As part of this change, most containers also will no longer need custom - implementations of the map() and - unmap() virtual functions. The only cases where this - is necessary are: - - - - -For !NO_WINDOW widgets, if you create children of - widget->window - and don't map them in realize() then you must map them - in map(). [ In almost all cases, you can simply map the - windows in realize(). ] - - - - - -For NO_WINDOW widgets, if you create windows in your - realize() method, you must map then in - map() and unmap them in unmap(). - - - - - - - - -gtk_widget_set_default_style(), - gtk_widget_push_style(), - and gtk_widget_pop_style() have been removed, since they - did not work properly with themes and there were better - alternatives for modifying the appearance of widgets. - - You should generally use gtk_widget_modify_*() - instead. - - - - - - -gtk_image_new() now takes no arguments and creates an - empty GtkImage widget. To create a - GtkImage widget from a - GdkImage (the least - common usage of GdkImage), use - gtk_image_new_from_image(). - - - - - -GTK_SELECTION_EXTENDED is now deprecated, and neither the - GtkList/GtkTree nor the - GtkCList/GtkCTree support - GTK_SELECTION_EXTENDED anymore. However, the old extended - behavior replaces MULTIPLE behavior. - - - - - -The following variables are no longer exported from GDK. (Other variables - are also no longer exported; the following are the ones found used - externally in a large sample of GTK+ code.) - - - - -VariableReplacement - - -gdk_null_window_warningsNone - did nothing in GTK+ 1.2 -gdk_leader_windowNone - private variable -gdk_screengdk_x11_get_default_screen () -gdk_root_windowgdk_x11_get_default_root_xwindow () -gdk_root_parentgdk_get_default_root_window () -gdk_error_codegdk_error_trap_push ()/pop () -gdk_error_warningsgdk_error_trap_push ()/pop () -gdk_display_namegdk_get_display () -gdk_wm_delete_windowgdk_atom_intern ("WM_DELETE_WINDOW", FALSE) -gdk_wm_take_focusgdk_atom_intern ("WM_TAKE_FOCUS", FALSE) -gdk_wm_protocolsgdk_atom_intern ("WM_PROTOCOLS", FALSE) - - - - - - - - - -The handling of colormaps and widgets has been changed: - - - - -The default colormap for widgets is now the GdkRGB - colormap, not the system default colormap. If you try to use resources - created for a widget (e.g., widget->style) with - a window using the system colormap, errors will result on some machines. - - - - - - -gtk_widget_push()/gtk_widget_pop_colormap() - only cause the colormap to be explicitly set on toplevel widgets, not on - all widgets. The colormap for other widgets (when not set using - gtk_widget_set_colormap()), is determined by finding - the nearest ancestor with a colormap set on it explicitly, or if that - fails, the default colormap. - - - - - - - - - - - -The default selected day for GtkCalendar is now the - current day in the month, not the first day in the month. The current month - and year were already used. - - - - - - -GDK is no longer put into threaded mode automatically when - g_thread_init() has been called. In order to use the - global GDK thread mutex with gdk_threads_enter() and - gdk_threads_leave(), you must call - gdk_threads_init() explicitly. - - If you aren't using GDK and GTK+ functions from multiple threads, - there is no reason to call gdk_threads_init(). - - - - - -The GtkPreviewInfo struct has had its visual and - colormap fields removed. Also, gtk_preview_get_cmap() - and gtk_preview_get_visual() are deprecated, as - GdkRGB works on any colormap and visual. You no - longer need to - gtk_widget_push_cmap (gtk_preview_get_cmap ()) in - your code. - - - - - - -The GtkBox, GtkTable, and - GtkAlignment widgets now call - gtk_widget_set_redraw_on_allocate (widget, FALSE); on - themselves. If you want to actually draw contents in a widget derived from - one of these widgets, you'll probably want to change this - in your init() function. - - - - - - -A number of widgets are now NO_WINDOW widgets (most - importantly GtkButton, but also - GtkRange and GtkNotebook) - - This has a couple of effects: - - - - -If you are deriving from one of these widgets, you need to - adapt your code appropriately -- for instance, drawing coordinates - start from widget->allocation.x, widget->allocation.y. - - - - - - -If you are embedding one of these widgets in a custom widget, - you must make sure you call gtk_container_propagate_expose() - correctly, as you must for any NO_WINDOW widgets. - - - - - - - GtkFixed is a little special; it is now created by - default as a NO_WINDOW widget, but if you do - - - gtk_fixed_set_has_window (fixed, TRUE); - - - after creating a fixed widget, it will create a window and - handle it properly. - - - - - -GtkLayout no longer has the xoffset, - yoffset fields, which used to store the difference between - world and window coordinates for layout->bin_window. - These coordinate systems are now always the same. - - - - - -gtk_paint_focus(), gtk_draw_focus() - and GtkStyle::draw_focus() - have been changed a bit: - - - - -A GtkStateType argument has been added to gtk_paint_focus(). - - - - - -The default implementation of the GtkStyle::draw_focus() - virtual function now draws a focus rectangle whose width is - determined by the GtkWidget::focus-width style property. - - - - - -The rectangle passed in is the bounding box, instead of - the rectangle used in the gdk_draw_rectangle() call, - so it is no longer necessary to subtract 1 from the width and height. - - - - - - - - - - - - - - diff --git a/docs/reference/gtk/compiling.sgml b/docs/reference/gtk/compiling.sgml index a9a3632a91..f40267fb1b 100644 --- a/docs/reference/gtk/compiling.sgml +++ b/docs/reference/gtk/compiling.sgml @@ -20,51 +20,58 @@ How to compile your GTK+ application Compiling GTK+ Applications on UNIX -To compile a GTK+ application, you need to tell the compiler where to +To compile a GTK+ application, you need to tell the compiler where to find the GTK+ header files and libraries. This is done with the pkg-config utility. The following interactive shell session demonstrates how -pkg-config is used (the actual output on +pkg-config is used (the actual output on your system may be different): -$ pkg-config --cflags gtk+-2.0 - -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pango-1.0 -I/usr/X11R6/include -I/usr/include/freetype2 -I/usr/include/atk-1.0 -$ pkg-config --libs gtk+-2.0 - -L/usr/lib -L/usr/X11R6/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -lXi -lgdk_pixbuf-2.0 -lm -lpangox -lpangoxft -lXft -lXrender -lXext -lX11 -lfreetype -lpango -latk -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 +$ pkg-config --cflags gtk+-3.0 + -pthread -I/usr/include/gtk-3.0 -I/usr/lib64/gtk-3.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 +$ pkg-config --libs gtk+-3.0 + -pthread -lgtk-x11-3.0 -lgdk-x11-3.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-3.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0 The simplest way to compile a program is to use the "backticks" feature of the shell. If you enclose a command in backticks (not single quotes), then its output will be -substituted into the command line before execution. So to compile +substituted into the command line before execution. So to compile a GTK+ Hello, World, you would type the following: -$ cc `pkg-config --cflags --libs gtk+-2.0` hello.c -o hello +$ cc `pkg-config --cflags --libs gtk+-3.0` hello.c -o hello -If you want to make sure that your program doesn't use any deprecated +If you want to make sure that your program doesn't use any deprecated functions, you can define the preprocessor symbol GTK_DISABLE_DEPRECATED by using the command line option -DGTK_DISABLE_DEPRECATED=1. -There are similar symbols GDK_DISABLE_DEPRECATED, +There are similar symbols GDK_DISABLE_DEPRECATED, GDK_PIXBUF_DISABLE_DEPRECATED and G_DISABLE_DEPRECATED for GDK, GdkPixbuf and -GLib. +GLib. -If you want to make sure that your program doesn't use any functions which +If you want to make sure that your program doesn't use any functions which may be problematic in a multihead setting, you can define the preprocessor -symbol GDK_MULTIHEAD_SAFE by using the command line option +symbol GDK_MULTIHEAD_SAFE by using the command line option -DGTK_MULTIHEAD_SAFE=1. + +Similarly, if you want to make sure that your program doesn't use any +functions which may be problematic in a multidevice setting, you can +define the preprocessor symbol GDK_MULTIDEVICE_SAFE by using the command +line option -DGTK_MULTIDEVICE_SAFE=1. + + The recommended way of using GTK+ has always been to only include the -toplevel headers gtk.h, gdk.h, +toplevel headers gtk.h, gdk.h, gdk-pixbuf.h. If you want to make sure that your program follows this recommended practise, you can define the preprocessor symbols GTK_DISABLE_SINGLE_INCLUDES diff --git a/docs/reference/gtk/glossary.xml b/docs/reference/gtk/glossary.xml index 375b34e903..9038c81c58 100644 --- a/docs/reference/gtk/glossary.xml +++ b/docs/reference/gtk/glossary.xml @@ -232,7 +232,7 @@ Widgets that don't own the GdkWindow on which they draw are called no-window widgets. - This can be tested with the GTK_WIDGET_NO_WINDOW() macro. Normally, + This can be tested with the gtk_widget_get_has_window() function. Normally, these widgets draw on their parent's GdkWindow. diff --git a/docs/reference/gtk/gtk-builder-convert.xml b/docs/reference/gtk/gtk-builder-convert-3.0.xml similarity index 86% rename from docs/reference/gtk/gtk-builder-convert.xml rename to docs/reference/gtk/gtk-builder-convert-3.0.xml index e0b6e1c30d..eccfe336f3 100644 --- a/docs/reference/gtk/gtk-builder-convert.xml +++ b/docs/reference/gtk/gtk-builder-convert-3.0.xml @@ -1,18 +1,18 @@ -gtk-builder-convert +gtk-builder-convert-3.0 1 -gtk-builder-convert +gtk-builder-convert-3.0 Glade file conversion utility -gtk-builder-convert +gtk-builder-convert-3.0 --skip-windows --root name input @@ -21,7 +21,7 @@ Description -gtk-builder-convert converts glade files +gtk-builder-convert-3.0 converts glade files into XML files which can be loaded with GtkBuilder. diff --git a/docs/reference/gtk/gtk-docs.sgml b/docs/reference/gtk/gtk-docs.sgml index 0c50347469..3ffb6c25d7 100644 --- a/docs/reference/gtk/gtk-docs.sgml +++ b/docs/reference/gtk/gtk-docs.sgml @@ -41,11 +41,33 @@ string utilities, file utilities, a main loop abstraction, and so on. + +GObject +A library that provides a type system, a collection of +fundamental types including an object type, a signal system. + + + + +GIO +A modern, easy-to-use VFS API including abstractions for +files, drives, volumes, stream IO, as well as network programming and +DBus communication. + + + + +cairo +Cairo is a 2D graphics library with support for multiple +output devices. + + + Pango Pango is a library for internationalized text handling. It centers -around the #PangoLayout object, representing a paragraph of text. +around the #PangoLayout object, representing a paragraph of text. Pango provides the engine for #GtkTextView, #GtkLabel, #GtkEntry, and other widgets that display text. @@ -67,7 +89,7 @@ framework. GdkPixbuf This is a small library which allows you to create #GdkPixbuf -("pixel buffer") objects from image data or image files. +("pixel buffer") objects from image data or image files. Use a #GdkPixbuf in combination with #GtkImage to display images. @@ -84,7 +106,7 @@ on X11, Windows, and the Linux framebuffer device. GTK+ -The GTK+ library itself contains widgets, +The GTK+ library itself contains widgets, that is, GUI components such as #GtkButton or #GtkTextView. @@ -122,7 +144,6 @@ that is, GUI components such as #GtkButton or #GtkTextView. - @@ -181,6 +202,7 @@ that is, GUI components such as #GtkButton or #GtkTextView. + @@ -275,18 +297,20 @@ that is, GUI components such as #GtkButton or #GtkTextView. - Layout Containers + + + @@ -294,17 +318,20 @@ that is, GUI components such as #GtkButton or #GtkTextView. + Ornaments + Scrolling + @@ -342,18 +369,12 @@ that is, GUI components such as #GtkButton or #GtkTextView. Abstract Base Classes - - - - - - @@ -366,8 +387,6 @@ that is, GUI components such as #GtkButton or #GtkTextView. Special-purpose features - - @@ -389,25 +408,9 @@ that is, GUI components such as #GtkButton or #GtkTextView. - - Deprecated - - - - - - - - - - - - - - - - - + + Application support + @@ -416,8 +419,8 @@ that is, GUI components such as #GtkButton or #GtkTextView. - This part describes what you need to change in programs use - older versions of GTK+ so that they can use the new features. + This part describes what you need to change in programs use + older versions of GTK+ so that they can use the new features. It also mentions how to convert applications using widgets found in the libgnomeui library to use their counterparts in GTK+. @@ -425,29 +428,14 @@ that is, GUI components such as #GtkButton or #GtkTextView. - - - - - - - - - - - - - - - - + GTK+ Tools - - - + + + @@ -460,45 +448,9 @@ that is, GUI components such as #GtkButton or #GtkTextView. Index of deprecated symbols - - Index of new symbols in 2.2 - - - - Index of new symbols in 2.4 - - - - Index of new symbols in 2.6 - - - - Index of new symbols in 2.8 - - - - Index of new symbols in 2.10 - - - - Index of new symbols in 2.12 - - - - Index of new symbols in 2.14 - - - - Index of new symbols in 2.16 - - - - Index of new symbols in 2.18 - - - - Index of new symbols in 2.20 - + + Index of new symbols in 3.0 + diff --git a/docs/reference/gtk/gtk-overrides.txt b/docs/reference/gtk/gtk-overrides.txt deleted file mode 100644 index e246ef5b03..0000000000 --- a/docs/reference/gtk/gtk-overrides.txt +++ /dev/null @@ -1,15 +0,0 @@ -# These are manually-edited to override or add declarations to those scanned -# from the GTK header files. - -# GtkAllocation is the same as GtkRectangle - - -GtkAllocation -struct GtkAllocation -{ - gint x; - gint y; - gint width; - gint height; -}; - diff --git a/docs/reference/gtk/gtk-query-immodules-2.0.xml b/docs/reference/gtk/gtk-query-immodules-2.0.xml deleted file mode 100644 index 1db0d7085a..0000000000 --- a/docs/reference/gtk/gtk-query-immodules-2.0.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - -gtk-query-immodules-2.0 -1 - - - -gtk-query-immodules-2.0 -Input method module registration utility - - - - -gtk-query-immodules-2.0 -module - - - -Description - -gtk-query-immodules-2.0 collects information about loadable -input method modules for GTK+ and writes it to stdout. - - -If called without arguments, it looks for modules in the GTK+ input method -module path. - - -If called with arguments, it looks for the specified modules. The arguments -may be absolute or relative paths. - - - -Environment - -The environment variable GTK_PATH can -be used to prepend directories to the input method module path. - - - -Bugs - -None known yet. - - - - - - diff --git a/docs/reference/gtk/gtk-query-immodules-3.0.xml b/docs/reference/gtk/gtk-query-immodules-3.0.xml new file mode 100644 index 0000000000..609323c7e2 --- /dev/null +++ b/docs/reference/gtk/gtk-query-immodules-3.0.xml @@ -0,0 +1,72 @@ + + + + + +gtk-query-immodules-3.0 +1 + + + +gtk-query-immodules-3.0 +Input method module registration utility + + + + +gtk-query-immodules-3.0 +--update-cache +module + + + +Description + +gtk-query-immodules-3.0 collects information about loadable +input method modules for GTK+ and writes it to the default cache file +location, or to stdout. + + +If called without arguments, it looks for modules in the GTK+ input method +module path. + + +If called with arguments, it looks for the specified modules. The arguments +may be absolute or relative paths. + + +Normally, the output of gtk-query-immodules-3.0 is written +to libdirgtk-3.0/3.0.0/immodules.cache, where GTK+ looks for it by default. If it is written to some other +location, the environment variable GTK_IM_MODULE_FILE +can be set to point GTK+ at the file. + + + +Options + + + --update-cache + Write the output to the default cache location instead of + stdout + + + + +Environment + +The environment variable GTK_PATH +can be used to prepend directories to the input method module path. + + + +Bugs + +None known yet. + + + + + + diff --git a/docs/reference/gtk/gtk-update-icon-cache.xml b/docs/reference/gtk/gtk-update-icon-cache-3.0.xml similarity index 60% rename from docs/reference/gtk/gtk-update-icon-cache.xml rename to docs/reference/gtk/gtk-update-icon-cache-3.0.xml index 4d3f4a8a83..477f37c381 100644 --- a/docs/reference/gtk/gtk-update-icon-cache.xml +++ b/docs/reference/gtk/gtk-update-icon-cache-3.0.xml @@ -5,18 +5,18 @@ -gtk-update-icon-cache +gtk-update-icon-cache-3.0 1 -gtk-update-icon-cache +gtk-update-icon-cache-3.0 Icon theme caching utility -gtk-update-icon-cache +gtk-update-icon-cache-3.0 --force --ignore-theme-index --index-only @@ -28,20 +28,22 @@ Description -gtk-update-icon-cache creates mmap()able cache files for -icon themes. + + gtk-update-icon-cache-3.0 creates mmap()able cache + files for icon themes. -It expects to be given the path to a icon theme directory containing an -index.theme, e.g. /usr/share/icons/hicolor, -and writes a icon-theme.cache containing cached information -about the icons in the directory tree below the given directory. + It expects to be given the path to a icon theme directory containing an + index.theme, e.g. /usr/share/icons/hicolor, + and writes a icon-theme.cache containing cached + information about the icons in the directory tree below the given directory. -GTK+ can use the cache files created by gtk-update-icon-cache -to avoid a lot of system call and disk seek overhead when the application starts. -Since the format of the cache files allows them to be mmap()ed shared between -multiple applications, the overall memory consumption is reduced as well. + GTK+ can use the cache files created by gtk-update-icon-cache-3.0 + to avoid a lot of system call and disk seek overhead when the application + starts. Since the format of the cache files allows them to be mmap()ed + shared between multiple applications, the overall memory consumption is + reduced as well. @@ -50,17 +52,17 @@ multiple applications, the overall memory consumption is reduced as well. --force -f - Overwrite an existing cache file even if it appears to be + Overwrite an existing cache file even if it appears to be uptodate. --ignore-theme-index -t - Don't check for the existence of 'index.theme' in the icon theme - directory. Without this option, gtk-update-icon-cache refuses - to create an icon cache in a directory which does not appear to be the toplevel - directory of an icon theme. + Don't check for the existence of 'index.theme' in the icon + theme directory. Without this option, gtk-update-icon-cache-3.0 + refuses to create an icon cache in a directory which does not appear to + be the toplevel directory of an icon theme. @@ -74,15 +76,15 @@ multiple applications, the overall memory consumption is reduced as well. --source -c - Output a C header file declaring a constant - name with the contents of the icon + Output a C header file declaring a constant + name with the contents of the icon cache. --quiet -q - Turn off verbose output. + Turn off verbose output. diff --git a/docs/reference/gtk/gtk-sections.txt b/docs/reference/gtk/gtk3-sections.txt similarity index 87% rename from docs/reference/gtk/gtk-sections.txt rename to docs/reference/gtk/gtk3-sections.txt index 780d04e67b..c7ef3c2f5a 100644 --- a/docs/reference/gtk/gtk-sections.txt +++ b/docs/reference/gtk/gtk3-sections.txt @@ -6,8 +6,6 @@ GtkAboutDialog GtkAboutDialog gtk_about_dialog_new -gtk_about_dialog_get_name -gtk_about_dialog_set_name gtk_about_dialog_get_program_name gtk_about_dialog_set_program_name gtk_about_dialog_get_version @@ -48,6 +46,7 @@ GTK_ABOUT_DIALOG_CLASS GTK_IS_ABOUT_DIALOG_CLASS GTK_ABOUT_DIALOG_GET_CLASS +GtkAboutDialogPrivate gtk_about_dialog_get_type
@@ -56,8 +55,6 @@ gtk_about_dialog_get_type Keyboard Accelerators GtkAccelGroup gtk_accel_group_new -gtk_accel_group_ref -gtk_accel_group_unref gtk_accel_group_connect gtk_accel_group_connect_by_path GtkAccelGroupActivate @@ -82,10 +79,6 @@ gtk_accelerator_get_label gtk_accelerator_set_default_mod_mask gtk_accelerator_get_default_mod_mask - -GtkAccelGroupEntry -gtk_accel_group_get_type - GtkAccelGroupClass GTK_TYPE_ACCEL_GROUP @@ -94,6 +87,11 @@ GTK_IS_ACCEL_GROUP GTK_ACCEL_GROUP_CLASS GTK_IS_ACCEL_GROUP_CLASS GTK_ACCEL_GROUP_GET_CLASS + + +GtkAccelGroupPrivate +GtkAccelGroupEntry +gtk_accel_group_get_type
@@ -145,8 +143,8 @@ GTK_ACCEL_LABEL_CLASS GTK_IS_ACCEL_LABEL_CLASS GTK_ACCEL_LABEL_GET_CLASS +GtkAccelLabelPrivate gtk_accel_label_get_type -gtk_accel_label_accelerator_width
@@ -154,6 +152,7 @@ gtk_accel_label_accelerator_width GtkAccessible GtkAccessible gtk_accessible_connect_widget_destroyed +gtk_accessible_get_widget GTK_ACCESSIBLE @@ -183,15 +182,11 @@ gtk_action_create_icon gtk_action_create_menu_item gtk_action_create_tool_item gtk_action_create_menu -gtk_action_connect_proxy -gtk_action_disconnect_proxy gtk_action_get_proxies gtk_action_connect_accelerator gtk_action_disconnect_accelerator gtk_action_block_activate gtk_action_unblock_activate -gtk_action_block_activate_from -gtk_action_unblock_activate_from gtk_action_get_always_show_image gtk_action_set_always_show_image gtk_action_get_accel_path @@ -268,13 +263,14 @@ gtk_action_group_add_action_with_accel gtk_action_group_remove_action GtkActionEntry gtk_action_group_add_actions -gtk_action_group_add_actions_full +gtk_action_group_add_actions_full GtkToggleActionEntry gtk_action_group_add_toggle_actions -gtk_action_group_add_toggle_actions_full +gtk_action_group_add_toggle_actions_full GtkRadioActionEntry gtk_action_group_add_radio_actions gtk_action_group_add_radio_actions_full +GtkTranslateFunc gtk_action_group_set_translate_func gtk_action_group_set_translation_domain gtk_action_group_translate_string @@ -371,6 +367,7 @@ gtk_assistant_get_page_complete gtk_assistant_add_action_widget gtk_assistant_remove_action_widget gtk_assistant_update_buttons_state +gtk_assistant_commit GtkAssistantClass @@ -424,15 +421,10 @@ gtk_aspect_frame_get_type GtkButtonBox GtkButtonBox GTK_BUTTONBOX_DEFAULT -gtk_button_box_get_spacing +gtk_button_box_new gtk_button_box_get_layout -gtk_button_box_get_child_size -gtk_button_box_get_child_ipadding gtk_button_box_get_child_secondary -gtk_button_box_set_spacing gtk_button_box_set_layout -gtk_button_box_set_child_size -gtk_button_box_set_child_ipadding gtk_button_box_set_child_secondary GTK_BUTTON_BOX @@ -466,10 +458,9 @@ gtk_bin_get_type GtkBox GtkBox GtkBoxChild +gtk_box_new gtk_box_pack_start gtk_box_pack_end -gtk_box_pack_start_defaults -gtk_box_pack_end_defaults gtk_box_get_homogeneous gtk_box_set_homogeneous gtk_box_get_spacing @@ -614,11 +605,6 @@ gtk_calendar_set_detail_width_chars gtk_calendar_get_detail_height_rows gtk_calendar_set_detail_height_rows - -gtk_calendar_display_options -gtk_calendar_freeze -gtk_calendar_thaw - GTK_CALENDAR GTK_IS_CALENDAR @@ -656,10 +642,8 @@ GtkCheckMenuItem gtk_check_menu_item_new gtk_check_menu_item_new_with_label gtk_check_menu_item_new_with_mnemonic -gtk_check_menu_item_set_state gtk_check_menu_item_get_active gtk_check_menu_item_set_active -gtk_check_menu_item_set_show_toggle gtk_check_menu_item_toggled gtk_check_menu_item_get_inconsistent gtk_check_menu_item_set_inconsistent @@ -677,125 +661,6 @@ GTK_CHECK_MENU_ITEM_GET_CLASS gtk_check_menu_item_get_type
-
-gtkclist -GtkCList -GtkCList -GtkCellType -GtkButtonAction -GTK_CLIST_FLAGS -GTK_CLIST_SET_FLAG -GTK_CLIST_UNSET_FLAG -GTK_CLIST_IN_DRAG -GTK_CLIST_ROW_HEIGHT_SET -GTK_CLIST_SHOW_TITLES -GTK_CLIST_ADD_MODE -GTK_CLIST_AUTO_SORT -GTK_CLIST_AUTO_RESIZE_BLOCKED -GTK_CLIST_REORDERABLE -GTK_CLIST_USE_DRAG_ICONS -GTK_CLIST_DRAW_DRAG_LINE -GTK_CLIST_DRAW_DRAG_RECT -GTK_CLIST_ROW -GTK_CELL_TEXT -GTK_CELL_PIXMAP -GTK_CELL_PIXTEXT -GTK_CELL_WIDGET -GtkCListCompareFunc -GtkCListColumn -GtkCListRow -GtkCellText -GtkCellPixmap -GtkCellPixText -GtkCellWidget -GtkCell -GtkCListCellInfo -GtkCListDestInfo -GtkCListDragPos -gtk_clist_new -gtk_clist_new_with_titles -gtk_clist_set_shadow_type -gtk_clist_set_selection_mode -gtk_clist_freeze -gtk_clist_thaw -gtk_clist_column_titles_show -gtk_clist_column_titles_hide -gtk_clist_column_title_active -gtk_clist_column_title_passive -gtk_clist_column_titles_active -gtk_clist_column_titles_passive -gtk_clist_set_column_title -gtk_clist_set_column_widget -gtk_clist_set_column_justification -gtk_clist_set_column_visibility -gtk_clist_set_column_resizeable -gtk_clist_set_column_auto_resize -gtk_clist_optimal_column_width -gtk_clist_set_column_width -gtk_clist_set_column_min_width -gtk_clist_set_column_max_width -gtk_clist_set_row_height -gtk_clist_moveto -gtk_clist_row_is_visible -gtk_clist_get_cell_type -gtk_clist_set_text -gtk_clist_get_text -gtk_clist_set_pixmap -gtk_clist_get_pixmap -gtk_clist_set_pixtext -gtk_clist_get_pixtext -gtk_clist_set_foreground -gtk_clist_set_background -gtk_clist_set_cell_style -gtk_clist_get_cell_style -gtk_clist_set_row_style -gtk_clist_get_row_style -gtk_clist_set_shift -gtk_clist_set_selectable -gtk_clist_get_selectable -gtk_clist_prepend -gtk_clist_append -gtk_clist_insert -gtk_clist_remove -gtk_clist_set_row_data -gtk_clist_set_row_data_full -gtk_clist_get_row_data -gtk_clist_find_row_from_data -gtk_clist_select_row -gtk_clist_unselect_row -gtk_clist_undo_selection -gtk_clist_clear -gtk_clist_get_selection_info -gtk_clist_select_all -gtk_clist_unselect_all -gtk_clist_swap_rows -gtk_clist_set_compare_func -gtk_clist_set_sort_column -gtk_clist_set_sort_type -gtk_clist_sort -gtk_clist_set_auto_sort -gtk_clist_columns_autosize -gtk_clist_get_column_title -gtk_clist_get_column_widget -gtk_clist_get_hadjustment -gtk_clist_get_vadjustment -gtk_clist_row_move -gtk_clist_set_button_actions -gtk_clist_set_hadjustment -gtk_clist_set_reorderable -gtk_clist_set_use_drag_icons -gtk_clist_set_vadjustment - -GTK_CLIST -GTK_IS_CLIST -GTK_TYPE_CLIST -GTK_CLIST_CLASS -GTK_IS_CLIST_CLASS -GTK_CLIST_GET_CLASS - -gtk_clist_get_type -
-
gtkcolorbutton GtkColorButton @@ -850,7 +715,6 @@ gtk_hsv_get_type GtkColorSelection GtkColorSelection gtk_color_selection_new -gtk_color_selection_set_update_policy gtk_color_selection_set_has_opacity_control gtk_color_selection_get_has_opacity_control gtk_color_selection_set_has_palette @@ -866,12 +730,9 @@ gtk_color_selection_set_previous_color gtk_color_selection_is_adjusting gtk_color_selection_palette_from_string gtk_color_selection_palette_to_string -gtk_color_selection_set_change_palette_hook GtkColorSelectionChangePaletteFunc gtk_color_selection_set_change_palette_with_screen_hook GtkColorSelectionChangePaletteWithScreenFunc -gtk_color_selection_set_color -gtk_color_selection_get_color GTK_COLOR_SELECTION GTK_IS_COLOR_SELECTION @@ -900,29 +761,6 @@ GTK_COLOR_SELECTION_DIALOG_GET_CLASS gtk_color_selection_dialog_get_type
-
-gtkcombo -GtkCombo -GtkCombo -gtk_combo_new -gtk_combo_set_popdown_strings -gtk_combo_set_value_in_list -gtk_combo_set_use_arrows -gtk_combo_set_use_arrows_always -gtk_combo_set_case_sensitive -gtk_combo_set_item_string -gtk_combo_disable_activate - -GTK_COMBO -GTK_IS_COMBO -GTK_TYPE_COMBO -GTK_COMBO_CLASS -GTK_IS_COMBO_CLASS -GTK_COMBO_GET_CLASS - -gtk_combo_get_type -
-
gtkcombobox GtkComboBox @@ -947,6 +785,7 @@ gtk_combo_box_insert_text gtk_combo_box_prepend_text gtk_combo_box_remove_text gtk_combo_box_get_active_text +gtk_combo_box_popup_for_device gtk_combo_box_popup gtk_combo_box_popdown gtk_combo_box_get_popup_accessible @@ -999,7 +838,6 @@ gtk_combo_box_entry_get_type GtkContainer GTK_IS_RESIZE_CONTAINER GTK_CONTAINER_WARN_INVALID_CHILD_PROPERTY_ID -gtk_container_border_width gtk_container_add gtk_container_remove gtk_container_add_with_properties @@ -1007,8 +845,6 @@ gtk_container_get_resize_mode gtk_container_set_resize_mode gtk_container_check_resize gtk_container_foreach -gtk_container_foreach_full -gtk_container_children gtk_container_get_children gtk_container_set_reallocate_redraws gtk_container_get_focus_child @@ -1046,126 +882,6 @@ GTK_CONTAINER_GET_CLASS gtk_container_get_type
-
-gtkctree -GtkCTree -GtkCTree -GTK_CTREE_ROW -GTK_CTREE_NODE -GTK_CTREE_NODE_NEXT -GTK_CTREE_NODE_PREV -GTK_CTREE_FUNC -GtkCTreePos -GtkCTreeLineStyle -GtkCTreeExpanderStyle -GtkCTreeExpansionType -GtkCTreeFunc -GtkCTreeGNodeFunc -GtkCTreeCompareDragFunc -GtkCTreeRow -GtkCTreeNode -GTK_TYPE_CTREE_NODE -gtk_ctree_new_with_titles -gtk_ctree_new -gtk_ctree_insert_node -gtk_ctree_remove_node -gtk_ctree_insert_gnode -gtk_ctree_export_to_gnode -gtk_ctree_post_recursive -gtk_ctree_post_recursive_to_depth -gtk_ctree_pre_recursive -gtk_ctree_pre_recursive_to_depth -gtk_ctree_is_viewable -gtk_ctree_last -gtk_ctree_find_node_ptr -gtk_ctree_find -gtk_ctree_is_ancestor -gtk_ctree_find_by_row_data -gtk_ctree_find_all_by_row_data -gtk_ctree_find_by_row_data_custom -gtk_ctree_find_all_by_row_data_custom -gtk_ctree_is_hot_spot -gtk_ctree_move -gtk_ctree_expand -gtk_ctree_expand_recursive -gtk_ctree_expand_to_depth -gtk_ctree_collapse -gtk_ctree_collapse_recursive -gtk_ctree_collapse_to_depth -gtk_ctree_toggle_expansion -gtk_ctree_toggle_expansion_recursive -gtk_ctree_select -gtk_ctree_select_recursive -gtk_ctree_unselect -gtk_ctree_unselect_recursive -gtk_ctree_real_select_recursive -gtk_ctree_node_set_text -gtk_ctree_node_set_pixmap -gtk_ctree_node_set_pixtext -gtk_ctree_set_node_info -gtk_ctree_node_set_shift -gtk_ctree_node_set_selectable -gtk_ctree_node_get_selectable -gtk_ctree_node_get_cell_type -gtk_ctree_node_get_text -gtk_ctree_node_get_pixmap -gtk_ctree_node_get_pixtext -gtk_ctree_get_node_info -gtk_ctree_node_set_row_style -gtk_ctree_node_get_row_style -gtk_ctree_node_set_cell_style -gtk_ctree_node_get_cell_style -gtk_ctree_node_set_foreground -gtk_ctree_node_set_background -gtk_ctree_node_set_row_data -gtk_ctree_node_set_row_data_full -gtk_ctree_node_get_row_data -gtk_ctree_node_moveto -gtk_ctree_node_is_visible -gtk_ctree_set_indent -gtk_ctree_set_spacing -gtk_ctree_set_reorderable -gtk_ctree_set_line_style -gtk_ctree_set_expander_style -gtk_ctree_set_drag_compare_func -gtk_ctree_sort_node -gtk_ctree_sort_recursive -gtk_ctree_node_nth -gtk_ctree_set_show_stub - -GTK_CTREE -GTK_IS_CTREE -GTK_TYPE_CTREE -GTK_CTREE_CLASS -GTK_IS_CTREE_CLASS -GTK_CTREE_GET_CLASS - -gtk_ctree_get_type -gtk_ctree_node_get_type -
- -
-gtkcurve -GtkCurve -GtkCurve -gtk_curve_new -gtk_curve_reset -gtk_curve_set_gamma -gtk_curve_set_range -gtk_curve_get_vector -gtk_curve_set_vector -gtk_curve_set_curve_type - -GTK_CURVE -GTK_IS_CURVE -GTK_TYPE_CURVE -GTK_CURVE_CLASS -GTK_IS_CURVE_CLASS -GTK_CURVE_GET_CLASS - -gtk_curve_get_type -
-
gtkdialog GtkDialog @@ -1208,7 +924,6 @@ gtk_dialog_get_type GtkDrawingArea GtkDrawingArea gtk_drawing_area_new -gtk_drawing_area_size GTK_DRAWING_AREA GTK_IS_DRAWING_AREA @@ -1248,44 +963,20 @@ GTK_EDITABLE_GET_CLASS gtk_editable_get_type
-
-gtkoldeditable -GtkOldEditable -GtkOldEditable -GtkTextFunction -gtk_old_editable_claim_selection -gtk_old_editable_changed - -GTK_OLD_EDITABLE -GTK_IS_OLD_EDITABLE -GTK_TYPE_OLD_EDITABLE -GTK_OLD_EDITABLE_CLASS -GTK_IS_OLD_EDITABLE_CLASS -GTK_OLD_EDITABLE_GET_CLASS - -gtk_old_editable_get_type -
-
gtkentry GtkEntry GtkEntry gtk_entry_new gtk_entry_new_with_buffer -gtk_entry_new_with_max_length gtk_entry_get_buffer gtk_entry_set_buffer gtk_entry_set_text -gtk_entry_append_text -gtk_entry_prepend_text -gtk_entry_set_position gtk_entry_get_text gtk_entry_get_text_length -gtk_entry_select_region gtk_entry_set_visibility gtk_entry_set_invisible_char gtk_entry_unset_invisible_char -gtk_entry_set_editable gtk_entry_set_max_length gtk_entry_get_activates_default gtk_entry_get_has_frame @@ -1315,6 +1006,8 @@ gtk_entry_get_progress_fraction gtk_entry_set_progress_pulse_step gtk_entry_get_progress_pulse_step gtk_entry_progress_pulse +gtk_entry_im_context_filter_keypress +gtk_entry_reset_im_context GtkEntryIconPosition gtk_entry_set_icon_from_pixbuf gtk_entry_set_icon_from_stock @@ -1374,7 +1067,9 @@ GTK_ENTRY_BUFFER_CLASS GTK_IS_ENTRY_BUFFER_CLASS GTK_ENTRY_BUFFER_GET_CLASS GTK_ENTRY_BUFFER_MAX_SIZE + +GtkEntryBufferPrivate gtk_entry_buffer_get_type
@@ -1550,7 +1245,6 @@ gtk_file_chooser_get_type GtkFileChooserDialog GtkFileChooserDialog gtk_file_chooser_dialog_new -gtk_file_chooser_dialog_new_with_backend GTK_FILE_CHOOSER_DIALOG GTK_IS_FILE_CHOOSER_DIALOG @@ -1568,7 +1262,6 @@ GtkFileChooserDialogPrivate GtkFileChooserWidget GtkFileChooserWidget gtk_file_chooser_widget_new -gtk_file_chooser_widget_new_with_backend GTK_FILE_CHOOSER_WIDGET GTK_IS_FILE_CHOOSER_WIDGET @@ -1586,7 +1279,6 @@ GtkFileChooserWidgetPrivate GtkFileChooserButton GtkFileChooserButton gtk_file_chooser_button_new -gtk_file_chooser_button_new_with_backend gtk_file_chooser_button_new_with_dialog gtk_file_chooser_button_get_title gtk_file_chooser_button_set_title @@ -1630,30 +1322,6 @@ GTK_TYPE_FILE_FILTER gtk_file_filter_get_type -
-gtkfilesel -GtkFileSelection -GtkFileSelection -gtk_file_selection_new -gtk_file_selection_set_filename -gtk_file_selection_get_filename -gtk_file_selection_complete -gtk_file_selection_show_fileop_buttons -gtk_file_selection_hide_fileop_buttons -gtk_file_selection_get_selections -gtk_file_selection_set_select_multiple -gtk_file_selection_get_select_multiple - -GTK_FILE_SELECTION -GTK_IS_FILE_SELECTION -GTK_TYPE_FILE_SELECTION -GTK_FILE_SELECTION_CLASS -GTK_IS_FILE_SELECTION_CLASS -GTK_FILE_SELECTION_GET_CLASS - -gtk_file_selection_get_type -
-
gtkfixed GtkFixed @@ -1661,8 +1329,6 @@ GtkFixed gtk_fixed_new gtk_fixed_put gtk_fixed_move -gtk_fixed_get_has_window -gtk_fixed_set_has_window GTK_FIXED GTK_IS_FIXED @@ -1710,7 +1376,6 @@ gtk_font_button_get_type GtkFontSelection GtkFontSelection gtk_font_selection_new -gtk_font_selection_get_font gtk_font_selection_get_font_name gtk_font_selection_set_font_name gtk_font_selection_get_preview_text @@ -1740,12 +1405,10 @@ gtk_font_selection_get_type GtkFontSelectionDialog GtkFontSelectionDialog gtk_font_selection_dialog_new -gtk_font_selection_dialog_get_font gtk_font_selection_dialog_get_font_name gtk_font_selection_dialog_set_font_name gtk_font_selection_dialog_get_preview_text gtk_font_selection_dialog_set_preview_text -gtk_font_selection_dialog_get_apply_button gtk_font_selection_dialog_get_cancel_button gtk_font_selection_dialog_get_ok_button @@ -1784,22 +1447,6 @@ GTK_FRAME_GET_CLASS gtk_frame_get_type
-
-gtkgamma -GtkGammaCurve -GtkGammaCurve -gtk_gamma_curve_new - -GTK_GAMMA_CURVE -GTK_IS_GAMMA_CURVE -GTK_TYPE_GAMMA_CURVE -GTK_GAMMA_CURVE_CLASS -GTK_IS_GAMMA_CURVE_CLASS -GTK_GAMMA_CURVE_GET_CLASS - -gtk_gamma_curve_get_type -
-
gtkhandlebox GtkHandleBox @@ -1828,10 +1475,6 @@ gtk_handle_box_get_type GtkHButtonBox GtkHButtonBox gtk_hbutton_box_new -gtk_hbutton_box_get_spacing_default -gtk_hbutton_box_get_layout_default -gtk_hbutton_box_set_spacing_default -gtk_hbutton_box_set_layout_default GTK_HBUTTON_BOX GTK_IS_HBUTTON_BOX @@ -1993,6 +1636,8 @@ gtk_icon_view_set_tooltip_cell gtk_icon_view_get_tooltip_context gtk_icon_view_set_tooltip_column gtk_icon_view_get_tooltip_column +gtk_icon_view_get_item_row +gtk_icon_view_get_item_column GtkIconViewDropPosition gtk_icon_view_enable_model_drag_source @@ -2052,8 +1697,6 @@ gtk_image_set_from_icon_name gtk_image_set_from_gicon gtk_image_clear gtk_image_new -gtk_image_set -gtk_image_get gtk_image_set_pixel_size gtk_image_get_pixel_size @@ -2168,22 +1811,6 @@ gtk_im_multicontext_get_type GtkIMMulticontextPrivate
-
-gtkinputdialog -GtkInputDialog -GtkInputDialog -gtk_input_dialog_new - -GTK_INPUT_DIALOG -GTK_IS_INPUT_DIALOG -GTK_TYPE_INPUT_DIALOG -GTK_INPUT_DIALOG_CLASS -GTK_IS_INPUT_DIALOG_CLASS -GTK_INPUT_DIALOG_GET_CLASS - -gtk_input_dialog_get_type -
-
gtkinvisible GtkInvisible @@ -2221,51 +1848,6 @@ GTK_ITEM_GET_CLASS gtk_item_get_type
-
-gtkitemfactory -GtkItemFactory -GtkItemFactory -GtkPrintFunc -GtkTranslateFunc -GtkItemFactoryCallback -GtkItemFactoryCallback1 -GtkItemFactoryCallback2 -GtkItemFactoryEntry -GtkItemFactoryItem -gtk_item_factory_new -gtk_item_factory_construct -gtk_item_factory_add_foreign -gtk_item_factory_from_widget -gtk_item_factory_path_from_widget -gtk_item_factory_get_item -gtk_item_factory_get_widget -gtk_item_factory_get_widget_by_action -gtk_item_factory_get_item_by_action -gtk_item_factory_create_item -gtk_item_factory_create_items -gtk_item_factory_create_items_ac -gtk_item_factory_delete_item -gtk_item_factory_delete_entry -gtk_item_factory_delete_entries -gtk_item_factory_popup -gtk_item_factory_popup_with_data -gtk_item_factory_popup_data -gtk_item_factory_popup_data_from_widget -gtk_item_factory_from_path -gtk_item_factory_create_menu_entries -gtk_item_factories_path_delete -gtk_item_factory_set_translate_func - -GTK_ITEM_FACTORY -GTK_IS_ITEM_FACTORY -GTK_TYPE_ITEM_FACTORY -GTK_ITEM_FACTORY_CLASS -GTK_IS_ITEM_FACTORY_CLASS -GTK_ITEM_FACTORY_GET_CLASS - -gtk_item_factory_get_type -
-
gtklabel GtkLabel @@ -2280,11 +1862,8 @@ gtk_label_set_justify gtk_label_set_ellipsize gtk_label_set_width_chars gtk_label_set_max_width_chars -gtk_label_get -gtk_label_parse_uline gtk_label_set_line_wrap gtk_label_set_line_wrap_mode -gtk_label_set gtk_label_get_layout_offsets gtk_label_get_mnemonic_keyval gtk_label_get_selectable @@ -2338,8 +1917,6 @@ gtk_layout_put gtk_layout_move gtk_layout_set_size gtk_layout_get_size -gtk_layout_freeze -gtk_layout_thaw gtk_layout_get_hadjustment gtk_layout_get_vadjustment gtk_layout_set_hadjustment @@ -2382,76 +1959,15 @@ GtkLinkButtonPrivate gtk_link_button_get_type
-
-gtklist -GtkList -GtkList -gtk_list_new -gtk_list_insert_items -gtk_list_append_items -gtk_list_prepend_items -gtk_list_remove_items -gtk_list_remove_items_no_unref -gtk_list_clear_items -gtk_list_select_item -gtk_list_unselect_item -gtk_list_select_child -gtk_list_unselect_child -gtk_list_child_position -gtk_list_set_selection_mode -gtk_list_extend_selection -gtk_list_start_selection -gtk_list_end_selection -gtk_list_select_all -gtk_list_unselect_all -gtk_list_scroll_horizontal -gtk_list_scroll_vertical -gtk_list_toggle_add_mode -gtk_list_toggle_focus_row -gtk_list_toggle_row -gtk_list_undo_selection -gtk_list_end_drag_selection - -GTK_LIST -GTK_IS_LIST -GTK_TYPE_LIST -GTK_LIST_CLASS -GTK_IS_LIST_CLASS -GTK_LIST_GET_CLASS - -gtk_list_get_type -
- -
-gtklistitem -GtkListItem -GtkListItem -gtk_list_item_new -gtk_list_item_new_with_label -gtk_list_item_select -gtk_list_item_deselect - -GTK_LIST_ITEM -GTK_IS_LIST_ITEM -GTK_TYPE_LIST_ITEM -GTK_LIST_ITEM_CLASS -GTK_IS_LIST_ITEM_CLASS -GTK_LIST_ITEM_GET_CLASS - -gtk_list_item_get_type -
-
gtkmenu GtkMenu GtkMenu gtk_menu_new gtk_menu_set_screen -gtk_menu_append -gtk_menu_prepend -gtk_menu_insert gtk_menu_reorder_child gtk_menu_attach +gtk_menu_popup_for_device gtk_menu_popup gtk_menu_set_accel_group gtk_menu_get_accel_group @@ -2492,9 +2008,6 @@ gtk_menu_get_type GtkMenuBar GtkMenuBar gtk_menu_bar_new -gtk_menu_bar_append -gtk_menu_bar_prepend -gtk_menu_bar_insert GtkPackDirection gtk_menu_bar_set_pack_direction gtk_menu_bar_get_pack_direction @@ -2526,15 +2039,13 @@ gtk_menu_item_get_use_underline gtk_menu_item_set_use_underline gtk_menu_item_set_submenu gtk_menu_item_get_submenu -gtk_menu_item_remove_submenu -gtk_menu_item_set_accel_path -gtk_menu_item_get_accel_path +gtk_menu_item_set_accel_path +gtk_menu_item_get_accel_path gtk_menu_item_select gtk_menu_item_deselect gtk_menu_item_activate gtk_menu_item_toggle_size_request gtk_menu_item_toggle_size_allocate -gtk_menu_item_right_justify GTK_MENU_ITEM GTK_IS_MENU_ITEM @@ -2658,8 +2169,8 @@ GTK_IS_INFO_BAR_CLASS GTK_INFO_BAR_GET_CLASS +GtkInfoBarPrivate gtk_info_bar_get_type -GtkMessageAreaPrivate
@@ -2694,9 +2205,7 @@ gtk_notebook_prepend_page_menu gtk_notebook_insert_page gtk_notebook_insert_page_menu gtk_notebook_remove_page -gtk_notebook_current_page gtk_notebook_page_num -gtk_notebook_set_page gtk_notebook_next_page gtk_notebook_prev_page gtk_notebook_reorder_child @@ -2704,7 +2213,6 @@ gtk_notebook_set_tab_pos gtk_notebook_set_show_tabs gtk_notebook_set_show_border gtk_notebook_set_scrollable -gtk_notebook_set_tab_border gtk_notebook_popup_enable gtk_notebook_popup_disable gtk_notebook_get_current_page @@ -2713,14 +2221,11 @@ gtk_notebook_get_nth_page gtk_notebook_get_n_pages gtk_notebook_get_tab_label gtk_notebook_query_tab_label_packing -gtk_notebook_set_homogeneous_tabs gtk_notebook_set_menu_label gtk_notebook_set_menu_label_text -gtk_notebook_set_tab_hborder gtk_notebook_set_tab_label gtk_notebook_set_tab_label_packing gtk_notebook_set_tab_label_text -gtk_notebook_set_tab_vborder gtk_notebook_set_tab_reorderable gtk_notebook_set_tab_detachable gtk_notebook_get_menu_label_text @@ -2732,8 +2237,6 @@ gtk_notebook_get_tab_pos gtk_notebook_get_tab_reorderable gtk_notebook_get_tab_detachable gtk_notebook_set_current_page -gtk_notebook_set_group_id -gtk_notebook_get_group_id gtk_notebook_set_group gtk_notebook_get_group gtk_notebook_set_action_widget @@ -2756,36 +2259,9 @@ GtkNotebookTab gtkobject GtkObject GtkObject -GTK_OBJECT_TYPE -GTK_OBJECT_TYPE_NAME GtkObjectFlags GTK_OBJECT_FLAGS -GTK_OBJECT_FLOATING -GtkArgFlags -gtk_object_new -gtk_object_sink -gtk_object_ref -gtk_object_unref -gtk_object_weakref -gtk_object_weakunref gtk_object_destroy -gtk_object_get -gtk_object_set -gtk_object_set_data -gtk_object_set_data_full -gtk_object_remove_data -gtk_object_get_data -gtk_object_remove_no_notify -gtk_object_set_user_data -gtk_object_get_user_data -gtk_object_add_arg_type -gtk_object_set_data_by_id -gtk_object_set_data_by_id_full -gtk_object_get_data_by_id -gtk_object_remove_data_by_id -gtk_object_remove_no_notify_by_id -gtk_object_data_try_key -gtk_object_data_force_id GTK_OBJECT GTK_IS_OBJECT @@ -2820,39 +2296,17 @@ GTK_OFFSCREEN_WINDOW_GET_CLASS gtk_offscreen_window_get_type
-
-gtkoptionmenu -GtkOptionMenu -GtkOptionMenu -gtk_option_menu_new -gtk_option_menu_get_menu -gtk_option_menu_set_menu -gtk_option_menu_remove_menu -gtk_option_menu_set_history -gtk_option_menu_get_history - -GTK_OPTION_MENU -GTK_IS_OPTION_MENU -GTK_TYPE_OPTION_MENU -GTK_OPTION_MENU_CLASS -GTK_IS_OPTION_MENU_CLASS -GTK_OPTION_MENU_GET_CLASS - -gtk_option_menu_get_type -
-
gtkpaned GtkPaned GtkPaned +gtk_paned_new gtk_paned_add1 gtk_paned_add2 -gtk_paned_gutter_size gtk_paned_pack1 gtk_paned_pack2 gtk_paned_get_child1 gtk_paned_get_child2 -gtk_paned_set_gutter_size gtk_paned_set_position gtk_paned_get_position gtk_paned_get_handle_window @@ -2866,26 +2320,6 @@ GTK_PANED_GET_CLASS gtk_paned_get_type -gtk_paned_compute_position -
- -
-gtkpixmap -GtkPixmap -GtkPixmap -gtk_pixmap_new -gtk_pixmap_set -gtk_pixmap_get -gtk_pixmap_set_build_insensitive - -GTK_PIXMAP -GTK_IS_PIXMAP -GTK_TYPE_PIXMAP -GTK_PIXMAP_CLASS -GTK_IS_PIXMAP_CLASS -GTK_PIXMAP_GET_CLASS - -gtk_pixmap_get_type
@@ -2910,38 +2344,6 @@ GTK_PLUG_GET_CLASS gtk_plug_get_type
-
-gtkpreview -GtkPreview -GtkPreview -GtkPreviewInfo -GtkDitherInfo -gtk_preview_uninit -gtk_preview_new -gtk_preview_size -gtk_preview_put -gtk_preview_draw_row -gtk_preview_set_expand -gtk_preview_set_gamma -gtk_preview_set_color_cube -gtk_preview_set_install_cmap -gtk_preview_set_reserved -gtk_preview_set_dither -gtk_preview_get_visual -gtk_preview_get_cmap -gtk_preview_get_info -gtk_preview_reset - -GTK_PREVIEW -GTK_IS_PREVIEW -GTK_TYPE_PREVIEW -GTK_PREVIEW_CLASS -GTK_IS_PREVIEW_CLASS -GTK_PREVIEW_GET_CLASS - -gtk_preview_get_type -
-
gtkprogress GtkProgress @@ -2987,13 +2389,7 @@ gtk_progress_bar_get_fraction gtk_progress_bar_get_pulse_step gtk_progress_bar_get_orientation gtk_progress_bar_get_ellipsize -gtk_progress_bar_new_with_adjustment -gtk_progress_bar_set_bar_style GtkProgressBarStyle -gtk_progress_bar_set_discrete_blocks -gtk_progress_bar_set_activity_step -gtk_progress_bar_set_activity_blocks -gtk_progress_bar_update GTK_PROGRESS_BAR GTK_IS_PROGRESS_BAR @@ -3012,6 +2408,7 @@ GtkRadioAction gtk_radio_action_new gtk_radio_action_get_group gtk_radio_action_set_group +gtk_radio_action_join_group gtk_radio_action_get_current_value gtk_radio_action_set_current_value @@ -3036,7 +2433,6 @@ gtk_radio_button_new_with_label gtk_radio_button_new_with_label_from_widget gtk_radio_button_new_with_mnemonic gtk_radio_button_new_with_mnemonic_from_widget -gtk_radio_button_group gtk_radio_button_set_group gtk_radio_button_get_group @@ -3060,7 +2456,6 @@ gtk_radio_menu_item_new_with_mnemonic gtk_radio_menu_item_new_from_widget gtk_radio_menu_item_new_with_label_from_widget gtk_radio_menu_item_new_with_mnemonic_from_widget -gtk_radio_menu_item_group gtk_radio_menu_item_set_group gtk_radio_menu_item_get_group @@ -3142,8 +2537,6 @@ gtk_recent_chooser_set_limit gtk_recent_chooser_get_limit gtk_recent_chooser_set_show_tips gtk_recent_chooser_get_show_tips -gtk_recent_chooser_set_show_numbers -gtk_recent_chooser_get_show_numbers GtkRecentSortType gtk_recent_chooser_set_sort_type gtk_recent_chooser_get_sort_type @@ -3270,8 +2663,6 @@ GTK_RECENT_MANAGER_ERROR GtkRecentManagerError gtk_recent_manager_new gtk_recent_manager_get_default -gtk_recent_manager_get_for_screen -gtk_recent_manager_set_screen gtk_recent_manager_add_item gtk_recent_manager_add_full gtk_recent_manager_remove_item @@ -3347,6 +2738,7 @@ gtk_recent_action_get_type GtkRuler GtkRuler GtkRulerMetric +gtk_ruler_new gtk_ruler_set_metric gtk_ruler_set_range gtk_ruler_get_metric @@ -3368,6 +2760,8 @@ gtk_ruler_draw_pos gtkscale GtkScale GtkScale +gtk_scale_new +gtk_scale_new_with_range gtk_scale_set_digits gtk_scale_set_draw_value gtk_scale_set_value_pos @@ -3402,8 +2796,6 @@ gtk_scale_button_get_value gtk_scale_button_get_popup gtk_scale_button_get_plus_button gtk_scale_button_get_minus_button -gtk_scale_button_set_orientation -gtk_scale_button_get_orientation GTK_SCALE_BUTTON GTK_IS_SCALE_BUTTON @@ -3420,6 +2812,7 @@ gtk_scale_button_get_type gtkscrollbar GtkScrollbar GtkScrollbar +gtk_scrollbar_new GTK_SCROLLBAR GTK_IS_SCROLLBAR @@ -3465,6 +2858,7 @@ gtk_scrolled_window_get_type gtkseparator GtkSeparator GtkSeparator +gtk_separator_new GTK_SEPARATOR GTK_IS_SEPARATOR @@ -3553,7 +2947,6 @@ gtk_size_group_get_type GtkSocket GtkSocket gtk_socket_new -gtk_socket_steal gtk_socket_add_id gtk_socket_get_id gtk_socket_get_plug_window @@ -3582,7 +2975,6 @@ gtk_spin_button_get_adjustment gtk_spin_button_set_digits gtk_spin_button_set_increments gtk_spin_button_set_range -gtk_spin_button_get_value_as_float gtk_spin_button_get_value_as_int gtk_spin_button_set_value gtk_spin_button_set_update_policy @@ -3618,6 +3010,7 @@ GtkSpinner gtk_spinner_new gtk_spinner_start gtk_spinner_stop + GTK_SPINNER GTK_IS_SPINNER @@ -3625,7 +3018,10 @@ GTK_TYPE_SPINNER GTK_SPINNER_CLASS GTK_IS_SPINER_CLASS GTK_SPINNER_GET_CLASS +GTK_IS_SPINNER_CLASS + +GtkSpinnerPrivate gtk_spinner_get_type
@@ -3638,6 +3034,7 @@ gtk_statusbar_get_context_id gtk_statusbar_push gtk_statusbar_pop gtk_statusbar_remove +gtk_statusbar_remove_all gtk_statusbar_set_has_resize_grip gtk_statusbar_get_has_resize_grip gtk_statusbar_get_message_area @@ -3675,7 +3072,6 @@ gtk_status_icon_get_gicon gtk_status_icon_get_size gtk_status_icon_set_screen gtk_status_icon_get_screen -gtk_status_icon_set_tooltip gtk_status_icon_set_tooltip_text gtk_status_icon_get_tooltip_text gtk_status_icon_set_tooltip_markup @@ -3753,37 +3149,6 @@ GTK_TEAROFF_MENU_ITEM_GET_CLASS gtk_tearoff_menu_item_get_type -
-gtktext -GtkText -GtkText -GtkTextFont -GtkPropertyMark -gtk_text_new -gtk_text_set_editable -gtk_text_set_word_wrap -gtk_text_set_line_wrap -gtk_text_set_adjustments -gtk_text_set_point -gtk_text_get_point -gtk_text_get_length -gtk_text_freeze -gtk_text_thaw -gtk_text_insert -gtk_text_backward_delete -gtk_text_forward_delete -GTK_TEXT_INDEX - -GTK_TEXT -GTK_IS_TEXT -GTK_TYPE_TEXT -GTK_TEXT_CLASS -GTK_IS_TEXT_CLASS -GTK_TEXT_GET_CLASS - -gtk_text_get_type -
-
gtktextbuffer GtkTextBuffer @@ -4063,6 +3428,8 @@ gtk_text_view_new gtk_text_view_new_with_buffer gtk_text_view_set_buffer gtk_text_view_get_buffer +gtk_text_view_get_hadjustment +gtk_text_view_get_vadjustment gtk_text_view_scroll_to_mark gtk_text_view_scroll_to_iter gtk_text_view_scroll_mark_onscreen @@ -4120,6 +3487,8 @@ gtk_text_view_get_tabs gtk_text_view_set_accepts_tab gtk_text_view_get_accepts_tab gtk_text_view_get_default_attributes +gtk_text_view_im_context_filter_keypress +gtk_text_view_reset_im_context GTK_TEXT_VIEW_PRIORITY_VALIDATE GTK_TEXT_VIEW @@ -4143,26 +3512,6 @@ GtkTextWindow GtkTextPendingScroll
-
-gtktipsquery -GtkTipsQuery -GtkTipsQuery -gtk_tips_query_new -gtk_tips_query_start_query -gtk_tips_query_stop_query -gtk_tips_query_set_caller -gtk_tips_query_set_labels - -GTK_TIPS_QUERY -GTK_IS_TIPS_QUERY -GTK_TYPE_TIPS_QUERY -GTK_TIPS_QUERY_CLASS -GTK_IS_TIPS_QUERY_CLASS -GTK_TIPS_QUERY_GET_CLASS - -gtk_tips_query_get_type -
-
gtktoggleaction GtkToggleAction @@ -4196,7 +3545,6 @@ gtk_toggle_button_new_with_label gtk_toggle_button_new_with_mnemonic gtk_toggle_button_set_mode gtk_toggle_button_get_mode -gtk_toggle_button_set_state gtk_toggle_button_toggled gtk_toggle_button_get_active gtk_toggle_button_set_active @@ -4243,9 +3591,7 @@ gtk_tool_shell_get_type gtktoolbar GtkToolbar GtkToolbar -GtkToolbarChildType GtkToolbarSpaceStyle -GtkToolbarChild gtk_toolbar_new gtk_toolbar_insert gtk_toolbar_get_item_index @@ -4254,32 +3600,14 @@ gtk_toolbar_get_nth_item gtk_toolbar_get_drop_index gtk_toolbar_set_drop_highlight_item gtk_toolbar_set_show_arrow -gtk_toolbar_set_orientation -gtk_toolbar_set_tooltips gtk_toolbar_unset_icon_size gtk_toolbar_get_show_arrow -gtk_toolbar_get_orientation gtk_toolbar_get_style gtk_toolbar_get_icon_size -gtk_toolbar_get_tooltips gtk_toolbar_get_relief_style -gtk_toolbar_append_item -gtk_toolbar_prepend_item -gtk_toolbar_insert_item -gtk_toolbar_append_space -gtk_toolbar_prepend_space -gtk_toolbar_insert_space -gtk_toolbar_append_element -gtk_toolbar_prepend_element -gtk_toolbar_insert_element -gtk_toolbar_append_widget -gtk_toolbar_prepend_widget -gtk_toolbar_insert_widget gtk_toolbar_set_style -gtk_toolbar_insert_stock gtk_toolbar_set_icon_size -gtk_toolbar_remove_space gtk_toolbar_unset_style @@ -4303,7 +3631,6 @@ gtk_tool_item_set_homogeneous gtk_tool_item_get_homogeneous gtk_tool_item_set_expand gtk_tool_item_get_expand -gtk_tool_item_set_tooltip gtk_tool_item_set_tooltip_text gtk_tool_item_set_tooltip_markup gtk_tool_item_set_use_drag_window @@ -4402,7 +3729,6 @@ gtk_menu_tool_button_new gtk_menu_tool_button_new_from_stock gtk_menu_tool_button_set_menu gtk_menu_tool_button_get_menu -gtk_menu_tool_button_set_arrow_tooltip gtk_menu_tool_button_set_arrow_tooltip_text gtk_menu_tool_button_set_arrow_tooltip_markup @@ -4466,31 +3792,6 @@ gtk_toggle_tool_button_get_type GtkToggleToolButtonPrivate
-
-gtktooltips -GtkTooltips -GtkTooltips -GtkTooltipsData -gtk_tooltips_new -gtk_tooltips_enable -gtk_tooltips_disable -gtk_tooltips_set_delay -gtk_tooltips_set_tip -gtk_tooltips_data_get -gtk_tooltips_force_window -gtk_tooltips_get_info_from_tip_window - - -GTK_TOOLTIPS -GTK_IS_TOOLTIPS -GTK_TYPE_TOOLTIPS -GTK_TOOLTIPS_CLASS -GTK_IS_TOOLTIPS_CLASS -GTK_TOOLTIPS_GET_CLASS - -gtk_tooltips_get_type -
-
gtktoolitemgroup GtkToolItemGroup @@ -4512,6 +3813,7 @@ gtk_tool_item_group_set_item_position gtk_tool_item_group_set_label gtk_tool_item_group_set_label_widget gtk_tool_item_group_set_header_relief + GtkToolItemGroupClass GTK_TOOL_ITEM_GROUP @@ -4520,7 +3822,9 @@ GTK_TYPE_TOOL_ITEM_GROUP GTK_TOOL_ITEM_GROUP_CLASS GTK_IS_TOOL_ITEM_GROUP_CLASS GTK_TOOL_ITEM_GROUP_GET_CLASS + +GtkToolItemGroupPrivate gtk_tool_item_group_get_type
@@ -4585,64 +3889,6 @@ GTK_TOOLTIP gtk_tooltip_get_type -
-gtktree -GtkTree -GtkTree -GTK_IS_ROOT_TREE -GTK_TREE_ROOT_TREE -GTK_TREE_SELECTION_OLD -GtkTreeViewMode -gtk_tree_new -gtk_tree_append -gtk_tree_prepend -gtk_tree_insert -gtk_tree_remove_items -gtk_tree_clear_items -gtk_tree_select_item -gtk_tree_unselect_item -gtk_tree_select_child -gtk_tree_unselect_child -gtk_tree_child_position -gtk_tree_set_selection_mode -gtk_tree_set_view_mode -gtk_tree_set_view_lines -gtk_tree_remove_item - -GTK_TREE -GTK_IS_TREE -GTK_TYPE_TREE -GTK_TREE_CLASS -GTK_IS_TREE_CLASS -GTK_TREE_GET_CLASS - -gtk_tree_get_type -
- -
-gtktreeitem -GtkTreeItem -GtkTreeItem -GTK_TREE_ITEM_SUBTREE -gtk_tree_item_new -gtk_tree_item_new_with_label -gtk_tree_item_set_subtree -gtk_tree_item_remove_subtree -gtk_tree_item_select -gtk_tree_item_deselect -gtk_tree_item_expand -gtk_tree_item_collapse - -GTK_TREE_ITEM -GTK_IS_TREE_ITEM -GTK_TYPE_TREE_ITEM -GTK_TREE_ITEM_CLASS -GTK_IS_TREE_ITEM_CLASS -GTK_TREE_ITEM_GET_CLASS - -gtk_tree_item_get_type -
-
gtktreemodel GtkTreeModel @@ -4658,11 +3904,11 @@ gtk_tree_path_new_from_string gtk_tree_path_new_from_indices gtk_tree_path_to_string gtk_tree_path_new_first -gtk_tree_path_new_root gtk_tree_path_append_index gtk_tree_path_prepend_index gtk_tree_path_get_depth gtk_tree_path_get_indices +gtk_tree_path_get_indices_with_depth gtk_tree_path_free gtk_tree_path_copy gtk_tree_path_compare @@ -4690,7 +3936,6 @@ gtk_tree_model_get_column_type gtk_tree_model_get_iter gtk_tree_model_get_iter_from_string gtk_tree_model_get_iter_first -gtk_tree_model_get_iter_root gtk_tree_model_get_path gtk_tree_model_get_value gtk_tree_model_iter_next @@ -4914,7 +4159,6 @@ gtk_tree_view_column_new_with_attributes gtk_tree_view_column_pack_start gtk_tree_view_column_pack_end gtk_tree_view_column_clear -gtk_tree_view_column_get_cell_renderers gtk_tree_view_column_add_attribute gtk_tree_view_column_set_attributes gtk_tree_view_column_set_cell_data_func @@ -5032,8 +4276,6 @@ gtk_tree_view_get_background_area gtk_tree_view_get_visible_rect gtk_tree_view_get_visible_range gtk_tree_view_get_bin_window -gtk_tree_view_widget_to_tree_coords -gtk_tree_view_tree_to_widget_coords gtk_tree_view_convert_bin_window_to_tree_coords gtk_tree_view_convert_bin_window_to_widget_coords gtk_tree_view_convert_tree_to_bin_window_coords @@ -5110,7 +4352,6 @@ gtk_cell_view_set_displayed_row gtk_cell_view_get_displayed_row gtk_cell_view_get_size_of_row gtk_cell_view_set_background_color -gtk_cell_view_get_cell_renderers GtkCellViewClass GTK_TYPE_CELL_VIEW @@ -5159,7 +4400,6 @@ gtk_cell_renderer_get_size gtk_cell_renderer_render gtk_cell_renderer_activate gtk_cell_renderer_start_editing -gtk_cell_renderer_editing_canceled gtk_cell_renderer_stop_editing gtk_cell_renderer_get_fixed_size gtk_cell_renderer_set_fixed_size @@ -5383,10 +4623,6 @@ gtk_list_store_get_type GtkVButtonBox GtkVButtonBox gtk_vbutton_box_new -gtk_vbutton_box_get_spacing_default -gtk_vbutton_box_set_spacing_default -gtk_vbutton_box_get_layout_default -gtk_vbutton_box_set_layout_default GTK_VBUTTON_BOX GTK_IS_VBUTTON_BOX @@ -5541,29 +4777,7 @@ gtk_vseparator_get_type GtkWidget GtkWidgetClass GtkWidgetFlags -GTK_WIDGET_TYPE -GTK_WIDGET_STATE -GTK_WIDGET_SAVED_STATE GTK_WIDGET_FLAGS -GTK_WIDGET_TOPLEVEL -GTK_WIDGET_NO_WINDOW -GTK_WIDGET_REALIZED -GTK_WIDGET_MAPPED -GTK_WIDGET_VISIBLE -GTK_WIDGET_DRAWABLE -GTK_WIDGET_SENSITIVE -GTK_WIDGET_PARENT_SENSITIVE -GTK_WIDGET_IS_SENSITIVE -GTK_WIDGET_CAN_FOCUS -GTK_WIDGET_HAS_FOCUS -GTK_WIDGET_CAN_DEFAULT -GTK_WIDGET_RECEIVES_DEFAULT -GTK_WIDGET_HAS_DEFAULT -GTK_WIDGET_HAS_GRAB -GTK_WIDGET_RC_STYLE -GTK_WIDGET_COMPOSITE_CHILD -GTK_WIDGET_APP_PAINTABLE -GTK_WIDGET_DOUBLE_BUFFERED GTK_WIDGET_SET_FLAGS GTK_WIDGET_UNSET_FLAGS GtkCallback @@ -5574,11 +4788,8 @@ GtkWidgetAuxInfo GtkWidgetShapeInfo GtkWidgetHelpType gtk_widget_new -gtk_widget_ref -gtk_widget_unref gtk_widget_destroy gtk_widget_destroyed -gtk_widget_set gtk_widget_unparent gtk_widget_show gtk_widget_show_now @@ -5592,7 +4803,6 @@ gtk_widget_unrealize gtk_widget_queue_draw gtk_widget_queue_resize gtk_widget_queue_resize_no_redraw -gtk_widget_draw gtk_widget_size_request gtk_widget_get_child_requisition gtk_widget_size_allocate @@ -5615,27 +4825,26 @@ gtk_widget_set_sensitive gtk_widget_set_parent gtk_widget_set_parent_window gtk_widget_get_parent_window -gtk_widget_set_uposition -gtk_widget_set_usize gtk_widget_set_events +gtk_widget_get_events gtk_widget_add_events gtk_widget_set_extension_events gtk_widget_get_extension_events +gtk_widget_set_device_events +gtk_widget_get_device_events +gtk_widget_add_device_events gtk_widget_get_toplevel gtk_widget_get_ancestor gtk_widget_get_colormap gtk_widget_set_colormap gtk_widget_get_visual -gtk_widget_get_events gtk_widget_get_pointer gtk_widget_is_ancestor gtk_widget_translate_coordinates gtk_widget_hide_on_delete gtk_widget_set_style -gtk_widget_set_rc_style gtk_widget_ensure_style gtk_widget_get_style -gtk_widget_restore_default_style gtk_widget_reset_rc_styles gtk_widget_push_colormap gtk_widget_pop_colormap @@ -5661,14 +4870,13 @@ gtk_widget_modify_text gtk_widget_modify_base gtk_widget_modify_font gtk_widget_modify_cursor +gtk_widget_modify_symbolic_color gtk_widget_create_pango_context gtk_widget_get_pango_context gtk_widget_create_pango_layout gtk_widget_render_icon gtk_widget_pop_composite_child gtk_widget_push_composite_child -gtk_widget_queue_clear -gtk_widget_queue_clear_area gtk_widget_queue_draw_area gtk_widget_reset_shapes gtk_widget_set_app_paintable @@ -5683,6 +4891,7 @@ gtk_widget_class_find_style_property gtk_widget_class_list_style_properties gtk_widget_region_intersect gtk_widget_send_expose +gtk_widget_send_focus_change gtk_widget_style_get gtk_widget_style_get_property gtk_widget_style_get_valist @@ -5700,19 +4909,14 @@ gtk_widget_get_root_window gtk_widget_get_screen gtk_widget_has_screen gtk_widget_get_size_request -gtk_widget_pop_visual -gtk_widget_push_visual gtk_widget_set_child_visible -gtk_widget_set_default_visual gtk_widget_set_size_request -gtk_widget_set_visual gtk_widget_thaw_child_notify gtk_widget_set_no_show_all gtk_widget_get_no_show_all gtk_widget_list_mnemonic_labels gtk_widget_add_mnemonic_label gtk_widget_remove_mnemonic_label -gtk_widget_get_action gtk_widget_is_composited gtk_widget_error_bell gtk_widget_keynav_failed @@ -5751,11 +4955,14 @@ gtk_widget_is_toplevel gtk_widget_set_window gtk_widget_set_receives_default gtk_widget_get_receives_default +gtk_widget_set_support_multidevice +gtk_widget_get_support_multidevice gtk_widget_set_realized gtk_widget_get_realized gtk_widget_set_mapped gtk_widget_get_mapped gtk_widget_get_requisition +gtk_widget_device_is_shadowed gtk_requisition_copy @@ -5781,12 +4988,10 @@ GtkWindow gtk_window_new gtk_window_set_title gtk_window_set_wmclass -gtk_window_set_policy gtk_window_set_resizable gtk_window_get_resizable gtk_window_add_accel_group gtk_window_remove_accel_group -gtk_window_position gtk_window_activate_focus gtk_window_activate_default gtk_window_set_modal @@ -5863,6 +5068,7 @@ gtk_window_get_urgency_hint gtk_window_get_accept_focus gtk_window_get_focus_on_map gtk_window_get_group +gtk_window_has_group gtk_window_get_window_type gtk_window_move gtk_window_parse_geometry @@ -5906,6 +5112,7 @@ gtk_window_group_new gtk_window_group_add_window gtk_window_group_remove_window gtk_window_group_list_windows +gtk_window_group_get_current_device_grab GTK_IS_WINDOW_GROUP GTK_IS_WINDOW_GROUP_CLASS @@ -5928,7 +5135,6 @@ gtk_init gtk_init_check gtk_init_with_args gtk_get_option_group -gtk_exit gtk_events_pending gtk_main gtk_main_level @@ -5948,6 +5154,8 @@ gtk_false gtk_grab_add gtk_grab_get_current gtk_grab_remove +gtk_device_grab_add +gtk_device_grab_remove gtk_init_add @@ -5958,28 +5166,7 @@ gtk_quit_remove gtk_quit_remove_by_data -gtk_timeout_add_full -gtk_timeout_add -gtk_timeout_remove - - -gtk_idle_add -gtk_idle_add_priority -gtk_idle_add_full -gtk_idle_remove -gtk_idle_remove_by_data - - -gtk_input_add_full -gtk_input_remove - - -GTK_PRIORITY_REDRAW GTK_PRIORITY_RESIZE -GTK_PRIORITY_HIGH -GTK_PRIORITY_INTERNAL -GTK_PRIORITY_DEFAULT -GTK_PRIORITY_LOW gtk_key_snooper_install @@ -5990,6 +5177,7 @@ gtk_key_snooper_remove gtk_get_current_event gtk_get_current_event_time gtk_get_current_event_state +gtk_get_current_event_device gtk_get_event_widget gtk_propagate_event @@ -6036,40 +5224,14 @@ gtk_style_new gtk_style_copy gtk_style_attach gtk_style_detach -gtk_style_ref -gtk_style_unref gtk_style_set_background gtk_style_apply_default_background -gtk_style_apply_default_pixmap gtk_style_lookup_color gtk_style_lookup_icon_set gtk_style_render_icon -gtk_style_get_font -gtk_style_set_font gtk_style_get_style_property gtk_style_get_valist gtk_style_get -gtk_draw_hline -gtk_draw_vline -gtk_draw_shadow -gtk_draw_polygon -gtk_draw_arrow -gtk_draw_diamond -gtk_draw_string -gtk_draw_box -gtk_draw_box_gap -gtk_draw_check -gtk_draw_extension -gtk_draw_flat_box -gtk_draw_focus -gtk_draw_handle -gtk_draw_option -gtk_draw_shadow_gap -gtk_draw_slider -gtk_draw_tab -gtk_draw_expander -gtk_draw_layout -gtk_draw_resize_grip gtk_paint_arrow gtk_paint_box gtk_paint_box_gap @@ -6086,7 +5248,6 @@ gtk_paint_shadow gtk_paint_shadow_gap gtk_paint_slider gtk_paint_spinner -gtk_paint_string gtk_paint_tab gtk_paint_vline gtk_paint_expander @@ -6128,9 +5289,6 @@ GtkRcTokenType gtk_rc_scanner_new gtk_rc_get_style gtk_rc_get_style_by_paths -gtk_rc_add_widget_name_style -gtk_rc_add_widget_class_style -gtk_rc_add_class_style gtk_rc_parse gtk_rc_parse_string gtk_rc_reparse_all @@ -6151,8 +5309,6 @@ gtk_rc_get_im_module_file gtk_rc_get_theme_dir gtk_rc_style_new gtk_rc_style_copy -gtk_rc_style_ref -gtk_rc_style_unref GtkRcStyleClass @@ -6216,7 +5372,6 @@ gtk_targets_include_text gtk_targets_include_uri gtk_targets_include_rich_text gtk_selection_remove_all -gtk_selection_clear gtk_selection_data_copy gtk_selection_data_free @@ -6305,7 +5460,6 @@ gtk_drag_set_icon_pixbuf gtk_drag_set_icon_stock gtk_drag_set_icon_name gtk_drag_set_icon_default -gtk_drag_set_default_icon gtk_drag_check_threshold gtk_drag_source_set gtk_drag_source_set_icon @@ -6320,138 +5474,14 @@ gtk_drag_source_add_image_targets gtk_drag_source_add_uri_targets
- -
-gtksignal -Signals -GTK_SIGNAL_OFFSET -GtkSignalRunType -gtk_signal_new -gtk_signal_newv -gtk_signal_lookup -gtk_signal_name -gtk_signal_emit -gtk_signal_emit_by_name -gtk_signal_emitv -gtk_signal_emitv_by_name -gtk_signal_emit_stop -gtk_signal_emit_stop_by_name -gtk_signal_connect -gtk_signal_connect_after -gtk_signal_connect_object -gtk_signal_connect_object_after -gtk_signal_connect_full -gtk_signal_connect_while_alive -gtk_signal_connect_object_while_alive -gtk_signal_disconnect -gtk_signal_disconnect_by_func -gtk_signal_disconnect_by_data -gtk_signal_handler_block -gtk_signal_handler_block_by_func -gtk_signal_handler_block_by_data -gtk_signal_handler_unblock -gtk_signal_handler_unblock_by_func -gtk_signal_handler_unblock_by_data -gtk_signal_handler_pending -gtk_signal_handler_pending_by_func -gtk_signal_default_marshaller - - -gtk_signal_compat_matched -
-
gtktypeutils Types -GtkType -GtkFundamentalType -GTK_CLASS_NAME -GTK_CLASS_TYPE -GTK_TYPE_IS_OBJECT -GTK_TYPE_FUNDAMENTAL_LAST -GTK_TYPE_FUNDAMENTAL_MAX -GTK_STRUCT_OFFSET -GTK_CHECK_CAST -GTK_CHECK_CLASS_CAST -GTK_CHECK_TYPE -GTK_CHECK_CLASS_TYPE -GTK_CHECK_GET_CLASS -GTK_FUNDAMENTAL_TYPE -GTK_SIGNAL_FUNC -GtkClassInitFunc -GtkObjectInitFunc -GtkSignalFunc GtkFunction -GtkDestroyNotify GtkCallbackMarshal -GtkSignalMarshaller -GtkTypeObject GtkArg -GTK_VALUE_CHAR -GTK_VALUE_UCHAR -GTK_VALUE_BOOL -GTK_VALUE_INT -GTK_VALUE_UINT -GTK_VALUE_LONG -GTK_VALUE_ULONG -GTK_VALUE_FLOAT -GTK_VALUE_DOUBLE -GTK_VALUE_STRING -GTK_VALUE_ENUM -GTK_VALUE_FLAGS -GTK_VALUE_BOXED -GTK_VALUE_POINTER -GTK_VALUE_OBJECT -GTK_VALUE_SIGNAL -GTK_RETLOC_CHAR -GTK_RETLOC_UCHAR -GTK_RETLOC_BOOL -GTK_RETLOC_INT -GTK_RETLOC_UINT -GTK_RETLOC_LONG -GTK_RETLOC_ULONG -GTK_RETLOC_FLOAT -GTK_RETLOC_DOUBLE -GTK_RETLOC_STRING -GTK_RETLOC_ENUM -GTK_RETLOC_FLAGS -GTK_RETLOC_BOXED -GTK_RETLOC_POINTER -GTK_RETLOC_OBJECT -GtkTypeInfo -GtkTypeClass -GtkEnumValue -GtkFlagValue -gtk_type_init -gtk_type_unique -gtk_type_name -gtk_type_from_name -gtk_type_parent -gtk_type_class -gtk_type_new -gtk_type_is_a -gtk_type_enum_get_values -gtk_type_flags_get_values -gtk_type_enum_find_value -gtk_type_flags_find_value GTK_TYPE_IDENTIFIER -GTK_TYPE_UINT -GTK_TYPE_ULONG -GTK_TYPE_LONG -GTK_TYPE_STRING -GTK_TYPE_INT -GTK_TYPE_NONE -GTK_TYPE_FLOAT -GTK_TYPE_FLAGS -GTK_TYPE_ENUM -GTK_TYPE_UCHAR -GTK_TYPE_POINTER -GTK_TYPE_BOOL -GTK_TYPE_CHAR -GTK_TYPE_BOXED -GTK_TYPE_DOUBLE -GTK_TYPE_INVALID gtk_identifier_get_type
@@ -6462,10 +5492,7 @@ GtkBindingSet GtkBindingEntry GtkBindingSignal GtkBindingArg -gtk_binding_entry_add gtk_binding_entry_add_signall -gtk_binding_entry_clear -gtk_binding_parse_binding gtk_binding_set_new gtk_binding_set_by_class gtk_binding_set_find @@ -6488,14 +5515,12 @@ GtkArrowType GtkAttachOptions GtkButtonBoxStyle GtkCornerType -GtkCurveType GtkDeleteType GtkDirectionType GtkExpanderStyle GtkIMPreeditStyle GtkIMStatusStyle GtkJustification -GtkMatchType GtkMetricType GtkMovementStep GtkOrientation @@ -6504,14 +5529,12 @@ GtkPathPriorityType GtkPathType GtkPolicyType GtkPositionType -GtkPreviewType GtkReliefStyle GtkResizeMode GtkScrollStep GtkScrollType GtkSelectionMode GtkShadowType -GtkSideType GtkStateType GtkSubmenuDirection GtkSubmenuPlacement @@ -6524,8 +5547,6 @@ GtkSortType GtkDragResult -GtkMenuCallback -GtkMenuEntry GTK_PATH_PRIO_MASK @@ -6683,6 +5704,7 @@ gtk_icon_info_get_base_size gtk_icon_info_get_filename gtk_icon_info_get_builtin_pixbuf gtk_icon_info_load_icon +gtk_icon_info_load_symbolic gtk_icon_info_set_raw_coordinates gtk_icon_info_get_embedded_rect gtk_icon_info_get_attach_points @@ -6828,6 +5850,8 @@ GTK_IS_PRINT_OPERATION_PREVIEW GTK_PRINT_OPERATION_PREVIEW GTK_PRINT_OPERATION_PREVIEW_GET_IFACE GTK_TYPE_PRINT_OPERATION_PREVIEW +GtkPrintOperationClass +GtkPrintOperationPreviewIface gtk_print_error_quark @@ -7088,10 +6112,20 @@ gtk_paper_size_to_key_file GTK_TYPE_PAPER_SIZE +GTK_CUSTOM_PAPER_UNIX_DIALOG +GTK_CUSTOM_PAPER_UNIX_DIALOG_CLASS +GTK_CUSTOM_PAPER_UNIX_DIALOG_GET_CLASS +GTK_IS_CUSTOM_PAPER_UNIX_DIALOG +GTK_IS_CUSTOM_PAPER_UNIX_DIALOG_CLASS +GTK_TYPE_CUSTOM_PAPER_UNIX_DIALOG +GtkCustomPaperUnixDialog +GtkCustomPaperUnixDialogClass + gtk_paper_size_get_type gtk_custom_paper_unix_dialog_get_type +GtkCustomPaperUnixDialogPrivate @@ -7259,6 +6293,7 @@ GTK_MOUNT_OPERATION_CLASS GTK_MOUNT_OPERATION_GET_CLASS GTK_TYPE_MOUNT_OPERATION +GtkMountOperationLookupContext gtk_mount_operation_get_type GtkMountOperationPrivate @@ -7282,3 +6317,51 @@ GTK_TYPE_ORIENTABLE gtk_orientable_get_type + +
+gtkextendedlayout +GtkExtendedLayout +GtkExtendedLayout +GtkExtendedLayoutIface +gtk_extended_layout_get_desired_height +gtk_extended_layout_get_desired_size +gtk_extended_layout_get_desired_width +gtk_extended_layout_get_height_for_width +gtk_extended_layout_get_width_for_height +gtk_extended_layout_is_height_for_width + + +GTK_EXTENDED_LAYOUT +GTK_EXTENDED_LAYOUT_CLASS +GTK_EXTENDED_LAYOUT_GET_IFACE +GTK_IS_EXTENDED_LAYOUT +GTK_TYPE_EXTENDED_LAYOUT + + +gtk_extended_layout_get_type +
+ +
+gtkapplication +GtkApplication +GtkApplication + +gtk_application_new +gtk_application_run +gtk_application_quit +gtk_application_set_action_group +gtk_application_get_window +gtk_application_add_window + + +GtkApplicationClass +GTK_TYPE_APPLICATION +GTK_APPLICATION +GTK_APPLICATION_CLASS +GTK_IS_APPLICATION +GTK_IS_APPLICATION_CLASS +GTK_APPLICATION_GET_CLASS + +gtk_application_get_type +GtkApplicationPrivate +
diff --git a/docs/reference/gtk/gtk.types b/docs/reference/gtk/gtk3.types similarity index 91% rename from docs/reference/gtk/gtk.types rename to docs/reference/gtk/gtk3.types index 1faa1f0d90..b03bb0ca95 100644 --- a/docs/reference/gtk/gtk.types +++ b/docs/reference/gtk/gtk3.types @@ -11,6 +11,7 @@ gtk_action_group_get_type gtk_activatable_get_type gtk_adjustment_get_type gtk_alignment_get_type +gtk_application_get_type gtk_arrow_get_type gtk_aspect_frame_get_type gtk_assistant_get_type @@ -36,16 +37,12 @@ gtk_cell_view_get_type gtk_check_button_get_type gtk_check_menu_item_get_type gtk_clipboard_get_type -gtk_clist_get_type gtk_color_button_get_type gtk_color_selection_dialog_get_type gtk_color_selection_get_type gtk_combo_box_entry_get_type gtk_combo_box_get_type -gtk_combo_get_type gtk_container_get_type -gtk_ctree_get_type -gtk_curve_get_type gtk_dialog_get_type gtk_drawing_area_get_type gtk_editable_get_type @@ -54,18 +51,17 @@ gtk_entry_completion_get_type gtk_entry_get_type gtk_event_box_get_type gtk_expander_get_type +gtk_extended_layout_get_type gtk_file_chooser_button_get_type gtk_file_chooser_dialog_get_type gtk_file_chooser_get_type gtk_file_chooser_widget_get_type gtk_file_filter_get_type -gtk_file_selection_get_type gtk_fixed_get_type gtk_font_button_get_type gtk_font_selection_dialog_get_type gtk_font_selection_get_type gtk_frame_get_type -gtk_gamma_curve_get_type gtk_handle_box_get_type gtk_hbox_get_type gtk_hbutton_box_get_type @@ -84,15 +80,11 @@ gtk_im_context_get_type gtk_im_context_simple_get_type gtk_im_multicontext_get_type gtk_info_bar_get_type -gtk_input_dialog_get_type gtk_invisible_get_type -gtk_item_factory_get_type gtk_item_get_type gtk_label_get_type gtk_layout_get_type gtk_link_button_get_type -gtk_list_get_type -gtk_list_item_get_type gtk_list_store_get_type gtk_menu_bar_get_type gtk_menu_get_type @@ -105,16 +97,12 @@ gtk_mount_operation_get_type gtk_notebook_get_type gtk_object_get_type gtk_offscreen_window_get_type -gtk_old_editable_get_type -gtk_option_menu_get_type gtk_orientable_get_type gtk_page_setup_get_type gtk_page_setup_unix_dialog_get_type gtk_paned_get_type gtk_paper_size_get_type -gtk_pixmap_get_type gtk_plug_get_type -gtk_preview_get_type gtk_printer_get_type gtk_print_context_get_type gtk_print_job_get_type @@ -156,13 +144,11 @@ gtk_table_get_type gtk_tearoff_menu_item_get_type gtk_text_buffer_get_type gtk_text_child_anchor_get_type -gtk_text_get_type gtk_text_iter_get_type gtk_text_mark_get_type gtk_text_tag_get_type gtk_text_tag_table_get_type gtk_text_view_get_type -gtk_tips_query_get_type gtk_toggle_action_get_type gtk_toggle_button_get_type gtk_toggle_tool_button_get_type @@ -171,11 +157,8 @@ gtk_tool_button_get_type gtk_tool_item_get_type gtk_tool_item_group_get_type gtk_tool_palette_get_type -gtk_tooltips_get_type gtk_tree_drag_dest_get_type gtk_tree_drag_source_get_type -gtk_tree_get_type -gtk_tree_item_get_type gtk_tree_model_filter_get_type gtk_tree_model_get_type gtk_tree_model_sort_get_type diff --git a/docs/reference/gtk/migrating-2to3.xml b/docs/reference/gtk/migrating-2to3.xml new file mode 100644 index 0000000000..99736eaf97 --- /dev/null +++ b/docs/reference/gtk/migrating-2to3.xml @@ -0,0 +1,80 @@ + + + + Migrating from GTK+ 2.x to GTK+ 3 + + + There are a number of steps that you can take to prepare your GTK+ 2.x + application for the switch to GTK+ 3. + + +
+ Only single includes + + Make sure your program only include the toplevel headers: + + make CFLAGS+="-DG_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES" + + +
+ +
+ Do not use deprecated symbols + + Make sure your program doesn't use any functions that have been + deprecated in GTK+ 2.x: + + make CFLAGS+="-DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED" + + +
+ +
+ Use accessor functions instead direct access + + GTK+ 3 removes many implementation details and struct members from + its public headers. To ensure that your application does not have problems + with this, you define the preprocessor symbol GSEAL_ENABLE. This will + make the compiler catch all uses of direct access to struct fields so that + you can go through them one by one and replace them with a call to an + accessor function instead. + + make CFLAGS+="-DGSEAL_ENABLE" + + +
+ +
+ GTK+ Modules + + Some software packages install loadable GTK+ modules such as theme engines, + gdk-pixbuf loaders or input methods. Since GTK+ 3 is parallel-installable + with GTK+ 2.x, the two GTK+ versions have separate locations for their + loadable modules. The location for GTK+ 2.x is + libdir/gtk-2.0 + (and its subdirectories), for GTK+ 3 the location is + libdir/gtk-3.0 + (and its subdirectories). + + + For some kinds of modules, namely input methods and pixbuf loaders, + GTK+ keeps a cache file with extra information about the modules. + For GTK+ 2.x, these cache files are located in + sysconfdir/gtk-2.0. + For GTK+ 3, they have been moved to + libdir/gtk-3.0/3.0.0/. + The commands that create these cache files have been renamed with a -3 + suffix to make them parallel-installable. + + + Note that GTK+ modules often link against libgtk, libgdk-pixbuf, etc. + If that is the case for your module, you have to be careful to link the + GTK+ 2.x version of your module against the 2.x version of the libraries, + and the GTK+ 3 version against hte 3.x versions. Loading a module linked + against libgtk 2.x into an application using GTK+ 3 will lead to + unhappiness and must be avoided. + +
+
diff --git a/docs/reference/gtk/migrating-checklist.sgml b/docs/reference/gtk/migrating-checklist.sgml index 1c2a3c88d0..8b5a58a6c9 100644 --- a/docs/reference/gtk/migrating-checklist.sgml +++ b/docs/reference/gtk/migrating-checklist.sgml @@ -19,15 +19,15 @@ Why - By handling this signal, you let widgets have - context-sensitive menus that can be invoked with the standard - key bindings. + By handling this signal, you let widgets have + context-sensitive menus that can be invoked with the standard + key bindings. - The #GtkWidget::popup-menu signal instructs the widget for which - it is emitted to create a context-sensitive popup menu. By default, + The #GtkWidget::popup-menu signal instructs the widget for which + it is emitted to create a context-sensitive popup menu. By default, the key binding mechanism is set to emit this signal when the ShiftF10 @@ -39,14 +39,14 @@ - - Write a function to create and show a popup menu. This - function needs to know the button number and the event's - time to pass them to gtk_menu_popup(). You can implement - such a function like this: - + + Write a function to create and show a popup menu. This + function needs to know the button number and the event's + time to pass them to gtk_menu_popup(). You can implement + such a function like this: + - + static void do_popup_menu (GtkWidget *my_widget, GdkEventButton *event) { @@ -54,7 +54,7 @@ do_popup_menu (GtkWidget *my_widget, GdkEventButton *event) int button, event_time; menu = gtk_menu_new (); - g_signal_connect (menu, "deactivate", + g_signal_connect (menu, "deactivate", G_CALLBACK (gtk_widget_destroy), NULL); /* ... add menu items ... */ @@ -71,19 +71,19 @@ do_popup_menu (GtkWidget *my_widget, GdkEventButton *event) } gtk_menu_attach_to_widget (GTK_MENU (menu), my_widget, NULL); - gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, + gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, button, event_time); } - + - - In your #GtkWidget::button-press-event handler, call this function + + In your #GtkWidget::button-press-event handler, call this function when you need to pop up a menu: - + - + static gboolean my_widget_button_press_event_handler (GtkWidget *widget, GdkEventButton *event) { @@ -96,52 +96,52 @@ my_widget_button_press_event_handler (GtkWidget *widget, GdkEventButton *event) return FALSE; } - + - - Implement a handler for the #GtkWidget::popup-menu signal: - + + Implement a handler for the #GtkWidget::popup-menu signal: + - + static gboolean my_widget_popup_menu_handler (GtkWidget *widget) { do_popup_menu (widget, NULL); return TRUE; } - + - If you do not pass a positioning function to gtk_menu_popup(), - it will show the menu at the mouse position by default. This - is what you usually want when the menu is shown as a result of - pressing a mouse button. However, if you press the - ShiftF10 - or Menu keys while the widget is focused, the - mouse cursor may not be near the widget at all. In the example above, you may want to - provide your own menu-positioning function - in the case where the event is - %NULL. This function should compute the desired position for - a menu when it is invoked through the keyboard. For example, - #GtkEntry aligns the top edge of its popup menu with the bottom + If you do not pass a positioning function to gtk_menu_popup(), + it will show the menu at the mouse position by default. This + is what you usually want when the menu is shown as a result of + pressing a mouse button. However, if you press the + ShiftF10 + or Menu keys while the widget is focused, the + mouse cursor may not be near the widget at all. In the example above, you may want to + provide your own menu-positioning function + in the case where the event is + %NULL. This function should compute the desired position for + a menu when it is invoked through the keyboard. For example, + #GtkEntry aligns the top edge of its popup menu with the bottom edge of the entry. - For the standard key bindings to work, your widget must be - able to take the keyboard focus. In general, widgets should - be fully usable through the keyboard and not just the mouse. - The very first step of this is to ensure that your widget - turns on the %GTK_CAN_FOCUS flag. + For the standard key bindings to work, your widget must be + able to take the keyboard focus. In general, widgets should + be fully usable through the keyboard and not just the mouse. + The very first step of this is to ensure that your widget + turns on the %GTK_CAN_FOCUS flag. @@ -152,23 +152,21 @@ my_widget_popup_menu_handler (GtkWidget *widget) Why - The region field of - GdkEventExpose allows you to redraw - less than the traditional - GdkEventRegion.area. + The region field of + GdkEventExpose allows you to redraw + less than the traditional GdkEventRegion.area. - In GTK+ 1.x, the GdkEventExpose + In early GTK+ versions, the GdkEventExpose structure only had an area field to - let you determine the region that you needed to redraw. In GTK+ - 2.x, this field exists for compatibility and as a simple - interface. However, there is also a - region field which contains a - fine-grained region. The area field - is simply the bounding rectangle of the - region. + let you determine the region that you needed to redraw. In current + GTK+, this field still exists for compatibility and as a simple + interface. However, there is also a region + field which contains a fine-grained region. The + area field is simply the bounding rectangle + of the region. @@ -183,7 +181,7 @@ my_widget_popup_menu_handler (GtkWidget *widget) Regions have an internal representation that is accessible as a - list of rectangles. To turn the + list of rectangles. To turn the GdkEventExpose.region field into such a list, use gdk_region_get_rectangles(): @@ -200,7 +198,7 @@ my_widget_expose_event_handler (GtkWidget *widget, GdkEventExpose *event) for (i = 0; i < n_rects; i++) { - /* Repaint rectangle: (rects[i].x, rects[i].y), + /* Repaint rectangle: (rects[i].x, rects[i].y), * (rects[i].width, rects[i].height) */ } @@ -218,9 +216,9 @@ my_widget_expose_event_handler (GtkWidget *widget, GdkEventExpose *event) Why - With gtk_accelerator_get_default_mod_mask() you can test for - modifier keys reliably; this way your key event handlers will - work correctly even if NumLock or + With gtk_accelerator_get_default_mod_mask() you can test for + modifier keys reliably; this way your key event handlers will + work correctly even if NumLock or CapsLock are activated. @@ -230,8 +228,8 @@ my_widget_expose_event_handler (GtkWidget *widget, GdkEventExpose *event) state field is a bit mask which indicates the modifier state at the time the key was pressed. Modifiers are keys like Control and - NumLock. When implementing a - #GtkWidget::key-press-event handler, you should use + NumLock. When implementing a + #GtkWidget::key-press-event handler, you should use gtk_accelerator_get_default_mod_mask() to test against modifier keys. This function returns a bit mask which encompasses all the modifiers which the user may be @@ -289,17 +287,16 @@ my_widget_key_press_event_handler (GtkWidget *widget, GdkEventKey *event) Why - Named icons automatically adapt to theme changes, giving your + Named icons automatically adapt to theme changes, giving your application a much more integrated appearance. - Since GTK+ 2.6, named icons can be used for window icons (see - gtk_window_set_icon_name()) and images (see gtk_image_set_icon_name()). - In GTK+ 2.8, you can also use named icons for drag-and-drop (see - gtk_drag_source_set_icon_name()) and in treeview cells (see the - #GtkCellRendererPixbuf:icon-name property). + Named icons can be used for window icons (see gtk_window_set_icon_name()) + and images (see gtk_image_set_icon_name()). You can also use named icons + for drag-and-drop (see gtk_drag_source_set_icon_name()) and in treeview + cells (see the #GtkCellRendererPixbuf:icon-name property). diff --git a/docs/reference/gtk/objects_grouped.sgml b/docs/reference/gtk/objects_grouped.sgml index fdbded0cd6..9b0c95bad8 100644 --- a/docs/reference/gtk/objects_grouped.sgml +++ b/docs/reference/gtk/objects_grouped.sgml @@ -84,8 +84,6 @@ GtkImage GtkPixmap GtkPreview - GtkCurve - GtkGammaCurve Misc. Widgets GtkArrow diff --git a/docs/reference/gtk/question_index.sgml b/docs/reference/gtk/question_index.sgml index 771e7c94cb..c8c26dafaa 100644 --- a/docs/reference/gtk/question_index.sgml +++ b/docs/reference/gtk/question_index.sgml @@ -2,7 +2,7 @@ - + Common Questions 3 @@ -63,19 +63,14 @@ See the documentation on this topic. -How do I port from one GTK+ +How do I port from one GTK+ version to another? -See the list of incompatible changes -from 1.2 to 2.0. Also, the GNOME 2.0 porting -guide on http://developer.gnome.org -has some more detailed discussion of porting from 1.2 to 2.0. -You may also find useful information in the documentation for +See . +You may also find useful information in the documentation for specific widgets and functions. diff --git a/docs/reference/gtk/running.sgml b/docs/reference/gtk/running.sgml index add364f173..82a3c2070b 100644 --- a/docs/reference/gtk/running.sgml +++ b/docs/reference/gtk/running.sgml @@ -2,7 +2,7 @@ - + Running GTK+ Applications 3 @@ -24,8 +24,8 @@ How to run and debug your GTK+ application All GTK+ applications support a number of standard commandline -options. These are removed from argv by gtk_init(). -Modules may parse and remove further options. The +options. These are removed from argv by gtk_init(). +Modules may parse and remove further options. The X11 and Windows GDK backends parse some additional commandline options. @@ -35,8 +35,8 @@ some additional commandline options. <systemitem>--gtk-module <replaceable>module</replaceable></systemitem> -A list of modules to load in addition to those specified in the -GTK_MODULES environment variable and the +A list of modules to load in addition to those specified in the +GTK_MODULES environment variable and the gtk-modules setting. @@ -56,11 +56,10 @@ warning that occurs. <systemitem>--gtk-debug <replaceable>options</replaceable></systemitem> -A list of debug options -to turn on in addition to those specified in the GTK_DEBUG -environment variable. -This option is only available if GTK+ has been configured with -. +A list of debug options +to turn on in addition to those specified in the GTK_DEBUG +environment variable. This option is only available if GTK+ has been +configured with . @@ -68,9 +67,8 @@ This option is only available if GTK+ has been configured with <systemitem>--gtk-no-debug <replaceable>options</replaceable></systemitem> -A list of debug options -to turn off. -This option is only available if GTK+ has been configured with +A list of debug options +to turn off. This option is only available if GTK+ has been configured with . @@ -84,7 +82,7 @@ list them here for completeness nevertheless. <systemitem>--class <replaceable>class</replaceable></systemitem> -Sets the program class; see gdk_set_program_class(). +Sets the program class; see gdk_set_program_class(). @@ -100,9 +98,9 @@ Sets the program name. <systemitem>--gdk-debug <replaceable>options</replaceable></systemitem> -A list of debug options -to turn on in addition to those specified in the GDK_DEBUG -environment variable. This option is only available if GTK+ has been +A list of debug options +to turn on in addition to those specified in the GDK_DEBUG +environment variable. This option is only available if GTK+ has been configured with . @@ -111,7 +109,7 @@ configured with . <systemitem>--gdk-no-debug <replaceable>options</replaceable></systemitem> -A list of debug options +A list of debug options to turn off. This option is only available if GTK+ has been configured with . @@ -122,12 +120,12 @@ to turn off. This option is only available if GTK+ has been configured with Environment variables - + GTK+ inspects a number of environment variables in addition to standard -variables like LANG, PATH, HOME -or DISPLAY; mostly to determine paths to look for certain -files. The X11, -Windows and +variables like LANG, PATH, HOME +or DISPLAY; mostly to determine paths to look for certain +files. The X11, +Windows and Framebuffer GDK backends use some additional environment variables. @@ -190,7 +188,7 @@ additional environment variables. - The special value all can be used to turn on all + The special value all can be used to turn on all debug options. @@ -210,14 +208,14 @@ additional environment variables. Specifies a list of directories to search when GTK+ is looking for dynamically loaded objects such as the modules specified by GTK_MODULES, theme engines, input method - modules, file system backends and print backends. If the path to - the dynamically loaded object is given as an absolute path name, - then GTK+ loads it directly. - Otherwise, GTK+ goes in turn through the directories in GTK_PATH, - followed by the directory .gtk-2.0 in the user's - home directory, followed by the system default directory, - which is libdir/gtk-2.0/modules. - (If GTK_EXE_PREFIX is defined, libdir is + modules, file system backends and print backends. If the path to + the dynamically loaded object is given as an absolute path name, + then GTK+ loads it directly. + Otherwise, GTK+ goes in turn through the directories in GTK_PATH, + followed by the directory .gtk-3.0 in the user's + home directory, followed by the system default directory, + which is libdir/gtk-3.0/modules. + (If GTK_EXE_PREFIX is defined, libdir is $GTK_EXE_PREFIX/lib. Otherwise it is the libdir specified when GTK+ was configured, usually /usr/lib, or @@ -227,14 +225,14 @@ additional environment variables. directory/version/host/type Where version is derived from the version of GTK+ (use pkg-config - --variable=gtk_binary_version gtk+-2.0 to determine this from a + --variable=gtk_binary_version gtk+-3.0 to determine this from a script), host is the architecture on which GTK+ was built. (use pkg-config - --variable=gtk_host gtk+-2.0 to determine this from a + --variable=gtk_host gtk+-3.0 to determine this from a script), and type is a directory specific to the type of modules; currently it can be - modules, engines, - immodules, filesystems or + modules, engines, + immodules, filesystems or printbackends, corresponding to the types of modules mentioned above. Either version, host, or both may be omitted. GTK+ looks @@ -262,17 +260,16 @@ additional environment variables. Specifies the file listing the IM modules to load. This environment - variable overrides the im_module_file specified in - the RC files, which in turn overrides the default value - sysconfdir/gtk-2.0/gtk.immodules - (sysconfdir is the sysconfdir specified when GTK+ was configured, - usually /usr/local/etc.) + variable overrides the im_module_file specified in + the RC files, which in turn overrides the default value + libdir/gtk-3.0/3.0.0/immodules.cache + (libdir has the same meaning here as explained for GTK_PATH). <envar>GTK2_RC_FILES</envar> - + Specifies a list of RC files to parse instead of the default ones; see Resource Files. @@ -283,7 +280,7 @@ additional environment variables. <envar>GTK_EXE_PREFIX</envar> - If set, GTK+ uses $GTK_EXE_PREFIX/lib instead of + If set, GTK+ uses $GTK_EXE_PREFIX/lib instead of the libdir configured when GTK+ was compiled. @@ -307,11 +304,11 @@ nevertheless. <envar>GDK_PIXBUF_MODULE_FILE</envar> - Specifies the file listing the GdkPixbuf loader modules to load. - This environment variable overrides the default value - sysconfdir/gtk-2.0/gdk-pixbuf.loaders - (sysconfdir is the sysconfdir specified when - GTK+ was configured, usually /usr/local/etc.) + Specifies the file listing the GdkPixbuf loader modules to load. + This environment variable overrides the default value + libdir/gtk-3.0/3.0.0/loaders.cache + (libdir is the sysconfdir specified when + GTK+ was configured, usually /usr/local/lib.) @@ -385,9 +382,9 @@ nevertheless. GTK+ uses these environment variables to locate icon themes - and MIME information. For more information, see + and MIME information. For more information, see Icon Theme Specification, - the Shared MIME-info Database + the Shared MIME-info Database and the Base Directory Specification. diff --git a/docs/reference/gtk/tmpl/.gitignore b/docs/reference/gtk/tmpl/.gitignore new file mode 100644 index 0000000000..0d0be57c29 --- /dev/null +++ b/docs/reference/gtk/tmpl/.gitignore @@ -0,0 +1,27 @@ +gtkbbox.sgml +gtkbox.sgml +gtkbuilder.sgml +gtkhbox.sgml +gtkmessagedialog.sgml +gtkobject.sgml +gtkorientable.sgml +gtkpagesetupunixdialog.sgml +gtkprinter.sgml +gtkradioaction.sgml +gtkradiobutton.sgml +gtkrange.sgml +gtkrecentaction.sgml +gtkrecentchooser.sgml +gtkrecentchooserdialog.sgml +gtkrecentchoosermenu.sgml +gtkrecentchooserwidget.sgml +gtkscalebutton.sgml +gtkseparator.sgml +gtkseparatormenuitem.sgml +gtkseparatortoolitem.sgml +gtkstyle.sgml +gtktesting.sgml +gtktextiter.sgml +gtktoggleaction.sgml +gtktoolitem.sgml +gtktreednd.sgml diff --git a/docs/reference/gtk/tmpl/gtk-unused.sgml b/docs/reference/gtk/tmpl/gtk-unused.sgml deleted file mode 100644 index 4a7c4e2b3b..0000000000 --- a/docs/reference/gtk/tmpl/gtk-unused.sgml +++ /dev/null @@ -1,4007 +0,0 @@ - - -All the functions in here are marked a Non-public. -We describe it anyway because it is occasionally useful -to understand how the work is done. - - -Arguments are a way of describing a named parameter to a function. -They have two important roles within gtk+: - - - -they describe object properties. -This means that they present an interface to get and set a named-type -for any type of object in a consistent way. -(All the relevant functions to do this start with gtk_object_set -or gtk_object_get). - - - - -they describe signal arguments. -This is a lot less often needed but still useful. -Usually if you are just emitting or creating a particular signal -it is more convenient to just use gtk_signal_emit() or gtk_signal_new(). -However if you are writing a function to emit or create an arbitrary -signal, you must use gtk_signal_emitv() or gtk_signal_newv(). - - - - - - - - -#GtkObject. - - - - -Utility function to manipulate lists of named, typed arguments. - - - -Implementation of Object Properties - - - - - - - - - - - - - - - - - - - -GtkCellRendererTextPixbuf - - - - -The #GtkData object is a very simple object intended to be used as a base -class for objects which contain data (i.e. the 'Model' in the object-oriented -Model/View/Controller framework). - - -Currently it is not very useful since all it provides is a "disconnect" signal. -This signal could be emitted by a #GtkData subclass to notify any 'Views' -that they should disconnect from the #GtkData (the 'Model'), possibly just -before the #GtkData is destroyed. - - - - - - - - - - -abstract base class for objects containing data. - - - -GtkData - - - -Debugging - - - -gtkenums.sgml - - - - -What are Signal Marshallers? - -Marshals are functions which all have the same prototype: -they take a #GtkObject, a #GtkSignalFunc, a #gpointer, -and an array of argument values. -The functions are names gtk_marshall_RETURNTYPE__PARAMTYPE1_PARAMTYPE2.... - - -They then call a native function: the GtkObject is the first -parameter passed in. The arguments are passed in the native -calling convention: chars, shorts, ints, longs may be packed -on the stack, or tucked in registers: it doesn't matter -because the same calling convention will be generated -inside the gtkmarshal code as is expected where you define -your handlers. - - -So the function named: - -gtk_marshal_BOOL__POINTER_INT_INT_UINT(GtkObject*, GtkSignalFunc, gpointer, GtkArg*); - -will call the #GtkSignalFunc assuming it was a function with signature: - -gboolean sigfunc(gpointer,gint,gint,guint); - - - - -Writing Custom Marshals - -Marshals are primarily used as arguments to gtk_signal_new(). -Sometimes, you may find that a marshaller you need isn't available -in the standard list. Then you have to write your own. - - -If you wish to define a signal with a new type of argument list. -Suppose you want 2 pointers and 2 integers. -You would write: - -typedef int (*GtkSignal_INT__POINTER_POINTER_INT_INT)( - gpointer, gpointer, gint, gint -); - -void marshal_INT__POINTER_POINTER_INT_INT(GtkObject* object, - GtkSignalFunc func, - gpointer func_data, - GtkArg* args) -{ - GtkSignal_NONE__POINTER_POINTER_INT_INT rfunc; - gint* return_val; - return_val = GTK_RETLOC_INT(args[4]); - rfunc = (GtkSignal_INT__POINTER_POINTER_INT_INT)func; - *return_val = (*rfunc)(object, - GTK_VALUE_POINTER(args[0]), - GTK_VALUE_POINTER(args[1]), - GTK_VALUE_INT(args[2]), - GTK_VALUE_INT(args[3]), - func_data); -} - - - - - - - - - - -#GtkSignal -The signal handling functions (of which marshallers are -really an implementation detail). - - - - - - - -Functions to adapt C structures to native calling convention. - - - -Signal Marshallers - - - - - - - - - - - - - - - - - - - -GtkPacker - - - -Private Information - - - - - - - - - - - - - - - - - - - - - - - -Themes - - - - - - - - - - - - - - - - - - - -GtkModelSimple - - - - -A macro to check whether a child widget of the CList -has the focus. - - -@clist: The #GtkCList widget to check. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -@obj: - - - - - - -@klass: - - - -Tests whether a #GtkObject has had a signal connected to it. - - -@obj: the object to examine. - - - -Test whether a GtkObject's arguments have been prepared. - - -@obj: the object to examine. - - - -Test whether a GtkObject has had gtk_object_destroy() invoked on it. - - -@obj: the object to examine. - - - -Get the number of signals defined by this object. - - -@obj: the object to query. - - - -Turns on certain object flags. (Private) - - -@obj: the object to affect. -@flag: the flags to set. - - - -Get the array of signals defined for this object. - - -@obj: the object to fetch the signals from. - - - -Turns off certain object flags. (Private) - - -@obj: the object to affect. -@flag: the flags to unset. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -@obj: - - - - - - -@klass: - - - - - - -@obj: - - - - - - -@obj: - - - -A macro that returns a GList that contains the selection of the root tree of @obj. - - -@obj: A pointer to the #GtkTree. @obj will accept any pointer, but it the pointer does not point to a #GtkTree, the results are undefined. - - - -The first "flat" (no struct) enumerated type value. - - - - - -The last "flat" (no struct) enumerated type value. - - - - - -Hide the name of gtk_identifier_get_type - - - - - -Combine a fundemantal type and a sequence number to create a gtk type. - - -@parent_t: -@seqno: - - - -No idea. - - - - - -Convert a gtk type into its sequence number - - -@type: - - - -The first structured enumerated type value. - - - - - -The last structured enumerated type value. - - - - - - - - - - - - - - - - - - - - - - - -Use to get the value of a GtkArg whose GtkType is GTK_TYPE_ARGS - - -@a: - - - -Use to get the value of a GtkArg whose GtkType is GTK_TYPE_CALLBACK - - -@a: - - - -Use to get the value of a GtkArg whose GtkType is GTK_TYPE_C_CALLBACK - - -@a: - - - -Use to get the value of a GtkArg whose GtkType is GTK_TYPE_C_FOREIGN - - -@a: - - - - - - -@a: -@b: -@Returns: - - - - - - - - - - - - - - - -This is a private struct used by GTK+ internally, don't worry about it. - - -@accel_group: -@accelerator_key: -@accelerator_mods: -@accel_flags: -@object: -@signal_id: - - - - - - - - - - - - - - - - - - -@data: -@accel_path_quark: -@accel_key: -@accel_mods: -@accel_group: -@old_accel_key: -@old_accel_mods: - - - - - - -@action: the object which received the signal. -@widget: - - - - - - -@action: the object which received the signal. -@widget: - - - -Define a function pointer. Deprecated. - - -@object: -@arg: -@arg_id: - - - -A structure containing information about the argument. -Returned by gtk_arg_get_info(). - - -@class_type: if the argument is an object, this is the object class type. -@name: the name of the argument. -@type: the type of the argument; it may be an object's type -or a fundamental type. -@arg_flags: flags applicable to the argument (i.e. readable, writable, -and whether it needs to be constructed). -@full_name: the object name and argument name separated by ::, -e.g. "GtkObject::user_data" or "GtkButton::label". -@arg_id: the unique argument identified. -@seq_id: ??? - - - -Define a function pointer. Deprecated. - - -@object: -@arg: -@arg_id: - - - - - - -@get_type_from_name: Looks up a type by name. The default - implementation applies heuristics to map type names to - _get_type function names, e.g. - GtkHBox to gtk_hbox_get_type(). This virtual function - is provided to allow language bindings to intercept the - type resolution process. - - - - - - -@parent: - - - - - - - - - - - - - - - - - - - - - - - - -@combobox: the object which received the signal. - - - - - - -@combobox: the object which received the signal. - - - - - - - - - - - - - - - - - - -@container: the object which received the signal. -@direction: -@Returns: - - - - - - - - - -The #GtkData-struct struct contains no public fields. - - - - - -Emitted to notify any views on the #GtkData object to disconnect from it, -possibly because the #GtkData object is about to be destroyed. - - -@data: the object which received the signal. - - - -Indicates that the user has activated the widget -in some fashion. Generally, this will be done -with a keystroke. (The default binding for this -action is Return for #GtkEntry and -Control-Return for #GtkText.) - - -@editable: the object which received the signal. - - - -An action signal. Causes the characters in the current selection to -be copied to the clipboard. - - -@editable: the object which received the signal. - - - -An action signal. Causes the characters in the current -selection to be copied to the clipboard and then deleted from -the widget. - - -@editable: the object which received the signal. - - - -An action signal. Delete a single character. - - -@editable: the object which received the signal. -@direction: the direction in which to delete. Positive - indicates forward deletion, negative, backwards deletion. - - - -An action signal. Delete a single line. - - -@editable: the object which received the signal. -@direction: the direction in which to delete. Positive - indicates forward deletion, negative, backwards deletion. - - - -An action signal. Delete a single word. - - -@editable: the object which received the signal. -@direction: the direction in which to delete. Positive - indicates forward deletion, negative, backwards deletion. - - - -An action signal. Move the cursor position. - - -@editable: the object which received the signal. -@x: horizontal distance to move the cursor. -@y: vertical distance to move the cursor. - - - -An action signal. Move the cursor by pages. - - -@editable: the object which received the signal. -@x: Number of pages to move the cursor horizontally. -@y: Number of pages to move the cursor vertically. - - - -An action signal. Move the cursor to the given column. - - -@editable: the object which received the signal. -@column: the column to move to. (A negative value indicates - the last column) - - - -An action signal. Move the cursor to the given row. - - -@editable: the object which received the signal. -@row: the row to move to. (A negative value indicates - the last row) - - - -An action signal. Move the cursor by words. - - -@editable: the object which received the signal. -@num_words: The number of words to move the -cursor. (Can be negative). - - - -An action signal. Causes the contents of the clipboard to -be pasted into the editable widget at the current cursor -position. - - -@editable: the object which received the signal. - - - -Determines if the user can edit the text in the editable -widget or not. This is meant to be overriden by -child classes and should not generally useful to -applications. - - -@editable: the object which received the signal. -@is_editable: %TRUE if the user is allowed to edit the text - in the widget. - - - -A boolean indicating whether the widget is editable by -the user. - - - - - -The position of the cursor. - - - - - -A simple function pointer to get invoked when the -signal is emitted. This allows you tie a hook to the signal type, -so that it will trap all emissions of that signal, from any object. - - -You may not attach these to signals created with the -#GTK_RUN_NO_HOOKS flag. - - -@object: -@signal_id: -@n_params: -@params: -@data: -@Returns: - - - - - - -@entry: the object which received the signal. - - - - - - -@entry: the object which received the signal. -@arg1: -@arg2: - - - - - - -@entry: the object which received the signal. -@arg1: -@event: - - - - - - -@entry: the object which received the signal. -@arg1: -@event: - - - - - - -@entry: the object which received the signal. -@arg1: -@arg2: -@arg3: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -@parent_class: -@inserted_text: -@deleted_text: -@get_text: -@get_length: -@insert_text: -@delete_text: -@_gtk_reserved0: -@_gtk_reserved1: -@_gtk_reserved2: -@_gtk_reserved3: -@_gtk_reserved4: -@_gtk_reserved5: - - - - - - - - - -The #GtkFixedChild-struct struct contains the following fields. -(These fields should be considered read-only. They should never be set by -an application.) - - - - - - -#GtkWidget *widget; -the child #GtkWidget. - - - -#gint x; -the horizontal position of the widget within the #GtkFixed -container. - - - -#gint y; -the vertical position of the widget within the #GtkFixed -container. - - - - - -@widget: -@x: -@y: - - - -A set of bit flags used to specify the filter being set -when calling gtk_font_selection_dialog_set_filter() or -gtk_font_selection_set_filter(). - - -@GTK_FONT_FILTER_BASE: the base filter, which can't be changed by the user. -@GTK_FONT_FILTER_USER: the user filter, which can be changed from within the -'Filter' page of the #GtkFontSelection widget. - - - -A set of bit flags used to specify the type of fonts shown -when calling gtk_font_selection_dialog_set_filter() or -gtk_font_selection_set_filter(). - - -@GTK_FONT_BITMAP: bitmap fonts. -@GTK_FONT_SCALABLE: scalable fonts. -@GTK_FONT_SCALABLE_BITMAP: scaled bitmap fonts. -@GTK_FONT_ALL: a bitwise combination of all of the above. - - - -the #GtkAdjustment which sets the range of the scale. - - - - - - - - - - - - - - - - - -A GtkImageLoader is used to load a filename found in -a RC file. - - -@window: the window for creating image -@colormap: the colormap for this image -@mask: a pointer to the location to store the mask -@transparent_color: the transparent color for the image -@filename: filename to load -@Returns: a #GtkPixmap representing @filename - - - - - - - - - - - - - - - - - - -@menubar: the object which received the signal. -@arg1: - - - - - - -@notebook: the object which received the signal. -@arg1: -@arg2: - - - - - - -@notebook: the object which received the signal. -@arg1: -@arg2: - - - - - - -@notebook: the object which received the signal. -@arg1: -@arg2: - - - -Setting this with a GtkType of GTK_TYPE_SIGNAL connects -the signal to the object, so that the user data and objects -and swapped when the signal handler is invoked. - - -This is useful for handlers that are primarily notifying -other objects and could just invoke an already existing function -if the parameters were swapped. -See gtk_signal_connect_object() for more details. - - - - - -Setting this with a GtkType of GTK_TYPE_SIGNAL connects -the signal to the object, so that the user data and objects -and swapped when the signal handler is invoked, -and so that the handler is invoked after all others. - - -See gtk_signal_connect_object_after() for more details. - - - - - -Setting this with a GtkType of GTK_TYPE_SIGNAL connects -the signal to the object. - - - - - -Setting this with a GtkType of GTK_TYPE_SIGNAL connects -the signal to the object, so that the signal is always run -after other user handlers and the default handler. - - - - - - - - -@oldeditable: the object which received the signal. - - - - - - -@oldeditable: the object which received the signal. -@arg1: -@arg2: - - - - - - -@oldeditable: the object which received the signal. -@arg1: -@arg2: -@arg3: - - - - - - -@parent: -@children: -@spacing: -@default_border_width: -@default_pad_x: -@default_pad_y: -@default_i_pad_x: -@default_i_pad_y: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -@widget: -@anchor: -@side: -@options: -@use_default: -@border_width: -@pad_x: -@pad_y: -@i_pad_x: -@i_pad_y: - - - - - - -@GTK_PACK_EXPAND: -@GTK_FILL_X: -@GTK_FILL_Y: - - - - - - -@match_type: -@pattern_length: -@pattern: -@pattern_reversed: -@user_data: -@seq_id: - - - - - - - - - - - - -@PRIVATE_GTK_USER_STYLE: -@PRIVATE_GTK_RESIZE_PENDING: -@PRIVATE_GTK_RESIZE_NEEDED: -@PRIVATE_GTK_LEAVE_PENDING: -@PRIVATE_GTK_HAS_SHAPE_MASK: -@PRIVATE_GTK_IN_REPARENT: -@PRIVATE_GTK_DIRECTION_SET: -@PRIVATE_GTK_DIRECTION_LTR: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -A function which you can use to clean up when the -signal handler is destroyed. - - -For example, if your handler requires a few variables -that you made into a struct and allocated (using g_new() -or something), then you will probably want to free -it as soon as the hook is destroyed. This will -allow you to do that. (For this in particular -it is convenient to pass g_free() as a #GtkSignalDestroy -function). - - -@data: The user data associated with the hook that is being -destroyed. - - - -This is currently a hack left in for a scheme wrapper library. -It may be removed. - - -Don't use it. - - -@object: The object which emits the signal. -@data: The user data associated with the hook. -@nparams: The number of parameters to the function. -@args: The actual values of the arguments. -@arg_types: The types of the arguments. -@return_type: The type of the return value from the function -or #GTK_TYPE_NONE for no return value. - - - -This structure contains all the information about a particular -signal: its name, the type it affects, the signature of the handlers, -and its unique identifying integer. - - -@object_type: -@signal_id: -@signal_name: -@is_user_signal: -@signal_flags: -@return_val: -@nparams: -@params: - - - -Holds the data for a statusbar message. text holds the actual text string. context_id is the context that this message is associated with, and message_id is this particular message's identifier. However, these fields should not be modified directly. - - -@text: -@context_id: -@message_id: - - - - - - -@parent_class: -@realize: -@unrealize: -@copy: -@clone: -@init_from_rc: -@set_background: -@render_icon: -@draw_hline: -@draw_vline: -@draw_shadow: -@draw_polygon: -@draw_arrow: -@draw_diamond: -@draw_string: -@draw_box: -@draw_flat_box: -@draw_check: -@draw_option: -@draw_tab: -@draw_shadow_gap: -@draw_box_gap: -@draw_extension: -@draw_focus: -@draw_slider: -@draw_handle: -@draw_expander: -@draw_layout: -@draw_resize_grip: -@_gtk_reserved1: -@_gtk_reserved2: -@_gtk_reserved3: -@_gtk_reserved4: -@_gtk_reserved5: -@_gtk_reserved6: -@_gtk_reserved7: -@_gtk_reserved8: -@_gtk_reserved9: -@_gtk_reserved10: -@_gtk_reserved11: -@_gtk_reserved12: - - - -The widget field is a pointer to the widget that -this %GtkTableChild structure is keeping track of. -The left_attach, -right_attach, -top_attach, and -bottom_attach fields specify the row and column -numbers which make up the invisible rectangle that the child widget is packed into. - - -xpadding and ypadding -specify the space between this widget and the surrounding table cells. - - -@widget: -@left_attach: -@right_attach: -@top_attach: -@bottom_attach: -@xpadding: -@ypadding: -@xexpand: -@yexpand: -@xshrink: -@yshrink: -@xfill: -@yfill: - - - -These fields should be considered read-only and not be modified directly. - - -@requisition: -@allocation: -@spacing: -@need_expand: -@need_shrink: -@expand: -@shrink: -@empty: - - - - - - - - - - - - - - - -A #GtkJustification for the text. This is only used when the tag is -applied to the first character in a paragraph. - - - - - -Pixel width of the left margin of the text for lines after the first -line in a wrapped paragraph. - - - - - - - - - - - -Pixels to offset the text horizontally or vertically, useful to -produce superscript and subscript. - - - - - - - - -@textview: the object which received the signal. -@arg1: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -@toolbar: the object which received the signal. -@arg1: -@Returns: - - - - - - - - - - - - - - - - - - - - - - - - -@GTK_TREE_SELECTION_SINGLE: -@GTK_TREE_SELECTION_MULTI: - - - - - - -@treeview: the object which received the signal. - - - - - - -@tree_view: -@context: -@path: -@user_data: -@Returns: - - - - - - -@tree_view: -@context: -@path: -@pos: -@user_data: -@Returns: - - - - - - -@uimanager: the object which received the signal. - - - -the #GtkAdjustment which sets the range of the scale. - - - - - - - - - - - - - - -@widget: the object which received the signal. -@arg1: -@Returns: - - - - - - -@widget: the object which received the signal. -@accel_signal_id: -@accel_group: -@accel_key: -@accel_mods: -@accel_flags: - - - - - - -@widget: the object which received the signal. -@message: - - - - - - -@widget: the object which received the signal. -@area: - - - - - - -@widget: the object which received the signal. - - - - - - -@widget: the object which received the signal. - - - - - - -@widget: the object which received the signal. -@accel_group: -@accel_key: -@accel_mods: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -@window: the object which received the signal. - - - - - - -@window: the object which received the signal. -@arg1: - - - -If the window shrinks automatically when widgets within it shrink. - - - - - - - - - - - - - - -@accel_group: -@path: -@accel_key: -@accel_mods: -@accel_flags: -@object: -@accel_signal: - - - - - - -@accel_group: -@object: - - - - - - -@class_type: -@signal_flags: -@handler_offset: -@Returns: - - - - - - -@class_type: -@signal_flags: -@handler_offset: -@Returns: - - - - - - -@accel_group: -@object: - - - - - - -@object: -@Returns: - - - - - - -@Returns: - - - - - - -@accel_group: -@accel_key: -@accel_mods: -@Returns: - - - - - - -@Returns: - - - - - - -@object: -@accel_signal_id: -@accel_group: -@accel_key: -@accel_mods: -@accel_flags: - - - - - - -@object: -@accel_group: -@accel_key: -@accel_mods: - - - - - - -@accel_group: -@accel_key: -@accel_mods: - - - - - - -@accel_group: -@accel_key: -@accel_mods: -@object: - - - - - - -@accel_group: -@accel_key: -@accel_mods: - - - - - - -@accel_label: -@Returns: - - - - - - -@accel_label: -@accel_object: - - - - - - -@accel_path: -@notify_data: -@notify_func: -@accel_group: - - - - - - -@accel_path: -@notify_data: -@notify_func: - - - -It will either copy data into an existing argument or allocate a new argument -and copy the data. Strings are duplicated. All other pointers and -values are copied (shallowly-- that is the pointers themselves are -copied, not the data they point to.) - - -You should call gtk_arg_reset() on dest_arg before calling this -if the argument may contain string data that you want freed. - - -@src_arg: the argument to duplicate. -@dest_arg: the argument to copy over (or NULL to create a new #GtkArg). -@Returns: the new #GtkArg (or dest_arg, if it was not NULL). - - - -Frees the argument, and optionally its contents. - - -@arg: the argument to free. -@free_contents: whether to free the string, if it is a string. - - - -Private: get information about an argument. - - -@object_type: the type of object. -@arg_info_hash_table: the hashtable of #GtkArgInfos. -@arg_name: the name of the argument to lookup. -@info_p: the argument info. -@Returns: an error message on failure, or NULL otherwise. - - - -A #GCompareFunc for hashing #GtkArgInfos. - - -@arg_info_1: a #GtkArgInfo. -@arg_info_2: a #GtkArgInfo. -@Returns: whether the arguments are the same. - - - -A #GHashFunc for hashing #GtkArgInfos. - - -@arg_info: a #GtkArgInfo. -@Returns: a hash value for that #GtkArgInfo. - - - -Given a fully qualified argument name (e.g. "GtkButton::label") -it returns just the argument name (e.g. "label") unless -the argument name was invalid, in which case it returns NULL. - - -@arg_name: the fully-qualified argument name. -@Returns: the base argument name. - - - -Creates a new argument of a certain type, set to 0 or NULL. - - -@arg_type: the type of the argument. -@Returns: the newly created #GtkArg. - - - - - - -@arg: - - - - - - -@arg: -@value_pointer: - - - -Create a new argument registered with a class. - - -@base_class_type: the basic type having the arguments, almost alway -GTK_TYPE_OBJECT, except if your defining a different type argument -that gets a different namespace. #GtkContainer does this to define -per-child arguments of the container. -@arg_name: name of the argument to create. (must be a static constant string) -@class_n_args_offset: offset into the base class structure that tells -the number of arguments. -@arg_info_hash_table: hashtable of #GtkArgInfos. -@arg_type: type of the argument. -@arg_flags: flags of the argument. -@arg_id: ??? -@Returns: the new #GtkArgInfo. - - - - - - -@arg1: -@arg2: -@Returns: - - - -Private: given a hashtable of argument information it takes a vararg -list and parses it into arguments (in the form of lists of #GtkArgs -and lists of #GtkArgInfos. - - -The list of arguments starts with first_arg_name then the first argument's -value. Followed by any number of additional name/argument pairs, -terminated with NULL. - - -@object_type: the type of object we are collecting arguments for. -@arg_info_hash_table: a hashtable mapping from names of arguments -to their #GtkArgInfos. -@arg_list_p: a returned list of arguments obtained from parsing the -varargs. -@info_list_p: a returned list of the #GtkArgInfos. -@first_arg_name: the name of the first argument. -@var_args: a va_list containing the value of the first argument, -followed by name/value pairs, followed by NULL. -@Returns: an error message on failure, or NULL otherwise. - - - -Private: erase lists of arguments returned from gtk_args_collect(). - - -@arg_list: arg_list_p returned from gtk_args_collect(). -@info_list: info_list_p returned from gtk_args_collect(). - - - -Private: from a class type and its arginfo hashtable, -get an array of #GtkArgs that this object accepts. - - -@class_type: the class type. -@arg_info_hash_table: the hashtable of #GtkArgInfos. -@arg_flags: returned array of argument flags. -@n_args_p: the number of arguments this object accepts. -@Returns: the array of arguments (or NULL on error). - - - -This is an internally used function and should never be called from an -application. - - -@widget: -@nvis_children: -@width: -@height: - - - -The internal padding of a button is the amount of space between the outside -of the button and the widget it contains. This function gets the default -amount of horizontal and vertical padding, placing the results in @ipad_x -and @ipad_y, respectively. - - -@ipad_x: the default horizontal internal button padding. -@ipad_y: the default vertical internal button padding. - - - -Retrieves the default minimum width and height for all button boxes, and -places the values in @min_width and @min_height, respectively. - - -@min_width: the default minimum width of a child widget. -@min_height: the default minimum height of a child widget. - - - -Sets the default number of pixels that pad each button in every button box. - - -@ipad_x: new default horizontal padding. -@ipad_y: new default vertical padding. - - - -Sets the default size of child buttons. - - -@min_width: minimum default width for child buttons. -@min_height: minimum default height for child buttons. - - - - - - -@uline_label: -@accel_group: -@Returns: - - - - - - -@stock_id: -@accel_group: -@Returns: - - - - - - -@cell: -@event: -@widget: -@path: -@background_area: -@cell_area: -@flags: -@Returns: - - - - - - -@Returns: - - - - - - -@cell_view: -@Returns: - - - - - - -@cell_view: -@cellview: - - - - - - -@cell_view: -@use_fg: - - - -Initializes a previously allocated #GtkCList widget for use. This should not -normally be used to create a #GtkCList widget. Use gtk_clist_new() instead. - - -@clist: A pointer to an uninitialized #GtkCList widget. -@columns: The number of columns the #GtkCList should have. -@titles: An array of strings that should be used as the titles i -of the columns. There should be enough strings in the array for -the number of columns specified. - - - - - - -@colorsel: -@color: - - - - - - -@colorsel: -@Returns: - - - - - - -@colorsel: -@Returns: - - - - - - -@colorsel: -@color: - - - -Controls whether opacity can be set with the #GtkColorSelection. -If this functionality is enabled, the necessary additional widgets -are added to the #GtkColorSelection and the opacity value can be -retrieved via the fourth value in the color array returned by -the gtk_color_selection_get_color() function. - - -@colorsel: a #GtkColorSelection. -@use_opacity: a boolean indicating whether the opacity selection -is enabled. - - - - - - -@colorsel: -@use_opacity: - - - - - - -@colorsel: -@use_palette: - - - - - - -@combo_box: -@Returns: - - - - - - -@combo_box: -@column: - - - - - - -@arg_name: -@arg_type: -@arg_flags: -@arg_id: - - - - - - -@container: -@widget: -@first_arg_name: -@Varargs: - - - - - - -@container: -@widget: -@n_args: -@args: - - - - - - -@container: -@child: -@arg: -@info: - - - - - - -@container: -@child: -@arg: -@info: - - - - - - -@object_type: -@arg_name: -@info_p: -@Returns: - - - - - - -@object_type: -@arg_list_p: -@info_list_p: -@first_arg_name: -@args: -@Returns: - - - - - - -@container: -@child: -@n_args: -@args: - - - - - - -@container: -@child: -@n_args: -@args: - - - - - - -@container: - - - - - - -@container: -@direction: -@Returns: - - - - - - -@class_type: -@arg_flags: -@nargs: -@Returns: - - - -This function is not usually used by users. - - -@ctree: -@columns: -@tree_column: -@titles: - - - - - - -@window: - - - - - - -@window: - - - - - - -@window: -@x: -@y: -@width: -@height: - - - - - - -@window: -@title: - - - -Internal function. - - -@toplevel: -@event: - - - -Internal function. - - -@widget: -@event: - - - -Causes the "changed" signal to be emitted. - - -@editable: a #GtkEditable widget. - - - -Claim or disclaim ownership of the PRIMARY X selection. - - -@editable: a #GtkEditable widget. -@claim: if %TRUE, claim the selection, otherwise, disclaim it. -@time: the timestamp for claiming the selection. - - - - - - -@entry: -@icon_pos: -@Returns: - - - - - - -@entry: -@icon_pos: -@Returns: - - - - - - -@entry: -@icon_pos: -@Returns: - - - - - - -@entry: -@icon_pos: -@Returns: - - - - - - -@Returns: - - - - - - -@chooser: -@Returns: - - - - - - -@chooser: -@folder_mode: - - - -Sets one of the two font filters, to limit the fonts shown. - - -@fsd: a #GtkFontSelectionDialog. -@filter_type: which of the two font filters to set, either -#GTK_FONT_FILTER_BASE or #GTK_FONT_FILTER_USER. The user filter -can be changed by the user, but the base filter is permanent. -@font_type: the types of font to be shown. This is a bitwise combination of -#GTK_FONT_BITMAP, #GTK_FONT_SCALABLE and #GTK_FONT_SCALABLE_BITMAP, -or #GTK_FONT_ALL to show all three font types. -@foundries: a NULL-terminated array of strings containing foundry names which -will be shown, or NULL to show all foundries. -@weights: a NULL-terminated array of strings containing weight names which -will be shown, or NULL to show all weights. -@slants: a NULL-terminated array of strings containing slant names which -will be shown, or NULL to show all slants. -@setwidths: a NULL-terminated array of strings containing setwidth names which -will be shown, or NULL to show all setwidths. -@spacings: a NULL-terminated array of strings containing spacings which -will be shown, or NULL to show all spacings. -@charsets: a NULL-terminated array of strings containing charset names which -will be shown, or NULL to show all charsets. - - - - - - -@fontsel: -@Returns: - - - - - - -@fontsel: -@Returns: - - - -Sets one of the two font filters, to limit the fonts shown. - - -@fontsel: a #GtkFontSelection. -@filter_type: which of the two font filters to set, either -#GTK_FONT_FILTER_BASE or #GTK_FONT_FILTER_USER. The user filter -can be changed by the user, but the base filter is permanent. -@font_type: the types of font to be shown. This is a bitwise combination of -#GTK_FONT_BITMAP, #GTK_FONT_SCALABLE and #GTK_FONT_SCALABLE_BITMAP, -or #GTK_FONT_ALL to show all three font types. -@foundries: a NULL-terminated array of strings containing foundry names which -will be shown, or NULL to show all foundries. -@weights: a NULL-terminated array of strings containing weight names which -will be shown, or NULL to show all weights. -@slants: a NULL-terminated array of strings containing slant names which -will be shown, or NULL to show all slants. -@setwidths: a NULL-terminated array of strings containing setwidth names which -will be shown, or NULL to show all setwidths. -@spacings: a NULL-terminated array of strings containing spacings which -will be shown, or NULL to show all spacings. -@charsets: a NULL-terminated array of strings containing charset names which -will be shown, or NULL to show all charsets. - - - - - - -@Returns: - - - -Get the type of GtkIdentifier. - - -@Returns: GtkType -- the enumerated type of something. - - - - - - -@image_menu_item: -@child: - - - - - - -@Returns: - - - - - - -@path_pspec: -@modified_only: -@print_func: -@func_data: - - - - - - -@file_name: -@path_pspec: -@modified_only: - - - - - - -@file_name: - - - - - - -@scanner: - - - - - - -@rc_string: - - - - - - -@FILE_pointer: -@string: - - - - - - -@label: -@str: -@Returns: - - - - - - -@store: -@iter: -@position: - - - - - - -@n_columns: -@Varargs: -@Returns: - - - - - - -@store: -@iter: -@column: -@value: - - - - - - -@store: -@column: -@type: - - - - - - -@store: -@n_columns: - - - - - - -@menu: -@Returns: - - - - - - -@menu: -@Returns: - - - -Sets whether the menu item should show a submenu indicator, which is a right -arrow. - - -@menu_item: the menu item -@show_toggle_indicator: unused -@show_submenu_indicator: whether to show the arrow or not - - - -Specifies the placement of the submenu around the menu item. The placement -is usually #GTK_LEFT_RIGHT for menu items in a popup menu and -#GTK_TOP_BOTTOM in menu bars. - - -This function is useless in usual applications. - - -@menu_item: the menu item -@placement: the submenu placement - - - -Private function to get an argument and argument info from an object. - - -@object: the object whose argument should be retrieved. -@arg: the argument, for the name on input, the rest is filled on output. -@info: a #GtkArgInfo structure to optionally fill in. - - - -Query information about an argument type. - - -@object_type: type of object to query about. -@arg_name: name of the argument. -@info_p: pointer to be filled in with a pointer to the GtkArgInfo. -@Returns: an error message, or NULL on success. -It is the caller's responsibility to call g_free() in the event of error. - - - -Private function to set an argument and argument info to an object. - - -@object: the object whose argument should be set. -@arg: the argument. -@info: infomation about this type of argument in general. - - - -Private: Gets an array of #GtkArgs from a va_list C structure. - - -@object_type: the type of object to collect arguments for. -@arg_list_p: pointer to be filled in with a list of parsed arguments. -@info_list_p: optional pointer for a returned list #GtkArgInfos. -@first_arg_name: name of first argument. -@var_args: value of first argument, followed by more key/value pairs, -terminated by NULL. -@Returns: an error message, or NULL on success. -It is the caller's responsibility to call g_free() in the event of error. - - - -Add an array of signals to a #GtkObjectClass. -Usually this is called when registering a new type of object. - - -@klass: the object class to append signals to. -@signals: the signals to append. -@nsignals: the number of signals being appended. - - - -Define a signal-handler for a new signal on an already defined -object. - - -See the signal documentation for more general information. - - -@klass: the object class to define the signal for. -@name: the name of the signal. -@signal_flags: the default emission behavior for the signal. -See gtk_signal_new(). -@marshaller: a function that will take an array of GtkArgs -and invoke the appropriate handler with the normal calling -conventions. -@return_val: specify the return-value type for the signal -(or GTK_TYPE_NONE for no return-value). -@nparams: specify the number of parameters the signal -receives from the caller of gtk_signal_emit(). -@Varargs: list of nparams #GtkTypes to pass to the signal handlers. -@Returns: the signal id. (See #GtkSignals) - - - -Define a signal-handler for a new signal on an already defined -object. - - -@klass: the object class to define the signal for. -@name: the name of the signal. -@signal_flags: the default emission behavior for the signal. -See gtk_signal_new(). -@marshaller: takes a GtkObject, a #GtkSignalFunc, and an array -of arguments, and invokes the function using the appropriate -calling conventions. Usually just select a function -out of gtkmarshal.h. -@return_val: specify the return-value type for the signal (possibly -#GTK_TYPE_NONE). -@nparams: specify the number of parameters the signal -receives from the caller of gtk_signal_emit(). -@params: array of #GtkTypes the signal handlers for this signal -should have in their prototype (of length nparams). -@Returns: the signal id. (See #GtkSignals) - - - -Mark an allocated object as constructed. -This is used for situations -that require precise control of the construction process. - - -This is done when gtk_object_default_construct() is inadequate. -In #GtkCList the need arises because #GtkCList does construction work that -must happen after its derivers. This work -cannot be done in an initializer function, so an alternate -constructor is mandatory. It calls gtk_object_constructed() to -indicate it has done its job, so that no other constructor will -be invoked. - - -Normally this function is just automatically run from -gtk_object_default_construct(). - - -@object: object which has been constructed. This is usually -done automatically by gtk_object_new() and gtk_object_newv(). - - - -This function is called to construct arguments that haven't been initialized -but have the #GTK_ARG_CONSTRUCT flag set. - - -All number arguments are set to 0. All pointers and strings -are set to NULL. - - -Normally invoked by gtk_object_new() automatically; gtk_type_new() can -be used to bypass it. - - -@object: the object to initialize. - - - -Gets an array of argument values from an object. - - -@object: the object to get arguments from. -@n_args: the number of arguments to query. -@args: the arguments to fill in. - - - -Construct an object with an array of arguments. - - -@object_type: the type of the object to create. -@n_args: the number of arguments to set. -@args: an array of n_args arguments (which are name and value pairs). -@Returns: the new GtkObject. - - - -Get all the arguments that may be used for a given type. - - -In Java, this type of mechanism is called -introspection. It is used by applications -like Glade, that have to determine what can be done to an object -at run-time. - - -@class_type: the GtkType of the ObjectClass -(returned from GTK_OBJECT_CLASS(class)->type for example). -@arg_flags: if non-NULL, obtains the #GtkArgFlags that apply to -each argument. You must g_free() this if you request it. -@n_args: the number of arguments is returned in this field. -@Returns: an array of arguments, that you must deallocate with g_free(). - - - -Set an array of arguments. - - -@object: the object whose arguments should be set. -@n_args: the number of arguments to set. -@args: the desired values, as an array of #GtkArgs (which contain -the names, types, and values of the arguments). - - - - - - -@packer: -@child: -@side: -@anchor: -@options: -@border_width: -@pad_x: -@pad_y: -@i_pad_x: -@i_pad_y: - - - - - - -@packer: -@child: -@side: -@anchor: -@options: - - - - - - - - - - - - -@Returns: - - - - - - -@packer: -@child: -@position: - - - - - - -@packer: -@child: -@side: -@anchor: -@options: -@border_width: -@pad_x: -@pad_y: -@i_pad_x: -@i_pad_y: - - - - - - -@packer: -@border: - - - - - - -@packer: -@i_pad_x: -@i_pad_y: - - - - - - -@packer: -@pad_x: -@pad_y: - - - - - - -@packer: -@spacing: - - - -Internal function used by #GtkHPaned and #GtkVPaned - - -@paned: -@allocation: -@child1_req: -@child2_req: - - - -Old name for gtk_paned_set_handle_size(). - - - - - -Set the the handle size to @size x @size pixels. - - -@paned: a paned widget -@size: the size in pixels - - - - - - -@pspec: -@string_length: -@string: -@string_reversed: -@Returns: - - - - - - -@pattern: -@string: -@Returns: - - - - - - -@pspec: -@string: -@Returns: - - - - - - -@pspec: - - - - - - -@pspec: -@pattern: - - - - - - -@context: -@Returns: - - - - - - -@context: -@Returns: - - - - - - -@context: -@Returns: - - - - - - -@context: -@Returns: - - - - - - -@op: -@n_pages: - - - - - - -@settings: -@Returns: - - - - - - -@settings: -@Returns: - - - - - - -@settings: -@num_copies: - - - - - - -@settings: -@print_to_file: - - - -Internal function. - - - - - -Internal function. Loads an image using the current -image loader. - - -@colormap: the colormap to use for the image -@transparent_color: the transparent color for the image -@filename: the filename of the image file -@Returns: a #GtkPixmap representing @filename - - - -Sets the function that GTK+ will use to load images - - -@loader: the #GtkImageLoader to use - - - - - - -@ruler: the gtkruler - - - - - - -@ruler: the gtkruler - - - -Internal function. - - -@window: -@event: -@Returns: - - - -Internal function. - - -@widget: -@event: -@Returns: - - - -Internal function. - - -@widget: -@event: -@Returns: - - - -Internal function. - - -@widget: -@event: -@Returns: - - - - - - -@Returns: - - - -Add an emission hook for a type of signal, for any object. - - -@signal_id: the type of signal to hook for. -@hook_func: the function to invoke to handle the emission hook. -@data: the user data passed in to hook_func. -@Returns: the id (that you may pass as a parameter -to gtk_signal_remove_emission_hook()). -@i: -@h: -@d: - - - -Add an emission hook for a type of signal, for any object. -(with control of what happens when the hook is -destroyed). - - -@signal_id: the type of signal add the hook for. -@hook_func: the function to invoke to handle the hook. -@data: the user data passed in to hook_func. -@destroy: a function to invoke when the hook is destroyed, -to clean up any allocation done just for this -signal handler. -@Returns: the id (that you may pass as a parameter -to gtk_signal_remove_emission_hook()). - - - -Returns whether a connection id is valid (and optionally not blocked). - - -@object: the object to search for the desired handler. -@handler_id: the connection id. -@may_be_blocked: whether it is acceptable to return a blocked -handler. -@Returns: TRUE if the signal exists and wasn't blocked, -unless #may_be_blocked was specified. FALSE otherwise. - - - -Destroy all the signal handlers connected to an object. -This is done automatically when the object is destroyed. - - -This function is labeled private. - - -@object: the object whose signal handlers should be destroyed. - - - - - - - - - -Find out the recursion depth of emissions for a particular type -of signal and object. (So it will -always return 0 or 1 if #GTK_RUN_NO_RECURSE is specified) -This is a way to avoid recursion: you can see if -you are currently running in that signal handler and emit it only -if you are. - -Another way to look at it is that this number increases -by one when #gtk_signal_emit(), et al, are called, -and decreases by one when #gtk_signal_emit() returns. - - -@object: the object with the signal handler. -@signal_id: the signal id. -@Returns: the recursion depth of emissions of this signal for this -object. - - - -Find out the recursion depth of emissions for a particular type -of signal and object. Just like gtk_signal_n_emissions() -except it will lookup the signal id for you. - - -@object: the object with the signal handler. -@name: the signal name. -@Returns: the recursion depth of emissions of this signal for this -object. - - - -Obtain information about a signal. - - -@signal_id: the signal type identifier. -@Returns: a pointer to a GtkSignalQuery structure -which contains all the information, or NULL. -The pointer is allocated just for you: you must g_free() it. - - - -Delete an emission hook. (see gtk_signal_add_emission_hook()) - - -@signal_id: the id of the signal type. -@hook_id: the id of the emission handler, returned by add_emission_hook(). -@i: -@h: - - - -These set default functions to call when the user didn't -supply a function when connecting. (These are rarely -used, and probably only for language bindings) - - -By default, there are no such functions. - - -@marshal_func: the function to invoke on every handlers for which there -isn't a function pointer. May be NULL. -@destroy_func: the function to invoke when each hook is destroyed. -May be NULL. - - - -Creates a border around the arrows of a #GtkSpinButton. The type of border is determined by @shadow_type. - - -@spin_button: a #GtkSpinButton -@shadow_type: the new border type. - - - - - - -@Returns: - - - - - - -@display: -@style: -@Returns: - - - - - - -@style: -@widget_type: -@property_name: -@value: - - - - - - -@buffer: -@override_location: -@default_editable: - - - - - - -@first: -@second: - - - - - - -@iter: -@desc: - - - - - - -@text_view: -@width: -@height: - - - - - - -@Returns: - - - - - - -@tool_item: -@Returns: - - - - - - -@tool_item: -@pack_end: - - - -Private: print debugging information while doing a gtk_object_ref() or -a gtk_object_unref(). - - -@object: object to reference or unreference. -@func: name of caller's function to print (used within macros). -@dummy: unused. -@line: line number (used within macros). -@do_ref: whether to reference or unreference. - - - - - - -@tree_model: -@iter: - - - - - - -@tree_model_sort: -@sort_iter: -@child_iter: - - - - - - -@tree_model_sort: -@child_path: -@Returns: -@path: - - - - - - -@Returns: - - - - - - -@tree_model_sort: -@func: - - - - - - -@tree_model_sort: -@child_model: -@model: - - - - - - -@tree_model_sort: -@sort_col: - - - - - - -@tree_model: -@iter: - - - - - - -@tree_store: -@iter: -@position: - - - - - - -@n_columns: -@Varargs: -@Returns: - - - - - - -@tree_store: -@iter: -@column: -@value: - - - - - - -@tree_store: -@column: -@type: -@store: - - - - - - -@tree_store: -@n_columns: - - - - - - -@tree_column: -@event: -@path_string: -@background_area: -@cell_area: -@flags: -@Returns: - - - - - - -@tree_column: -@tree_model: -@iter: - - - - - - -@tree_column: -@cell: - - - - - - -@tree_column: -@width: -@size: - - - - - - -@tree_view: -@targets: -@n_targets: -@actions: -@location_droppable_func: -@user_data: - - - - - - -@tree_view: -@start_button_mask: -@targets: -@n_targets: -@actions: -@row_draggable_func: -@user_data: - - - -Given a GtkTypeClass pointer @klass, and a GtkType @cast_type, make -sure that it's okay to cast something of that @klass into a @cast_type. - - -@klass: GtkTypeClass* -@cast_type: GtkType -@Returns: Always return @klass. - - - -Given a pointer to a GtkTypeObject @type_object, and a GtkType @cast_type, -make sure that it's okay to cast @type_object into a @cast_type. - - -@type_object: GtkTypeObject* -@cast_type: GtkType -@Returns: the same GtkTypeObject* as @type_object - - - -Return the pointer to the type's children's types. - - -@type: GtkType -@Returns: pointer to a GList - - - -Print the types @type inherits from. - - -@type: GtkType - - - -Given a @type, describe all of its children, and their children. Only -show the size if @show_size is true. - - -@type: GtkType -@show_size: gboolean - - - -Given the type of an object and a pointer to it, the object is freed. - - -@type: GtkType -@mem: gpointer to the object - - - -Get the varargs type associated with @foreign_type - - -@foreign_type: GtkType -@Returns: GtkType - - - -Return the class of the parent. Initialize the class if necessary. -Return NULL if anything goes wrong. - - -@type: GtkType -@Returns: gpointer to the klass. - - - -Given a type, return various interesting parameters of the type. - - -@type: GtkType -@Returns: GtkTypeQuery* - - - -Register a new set of enum @values and give them the name in -@type_name. - - -@type_name: must not be null. -@values: GtkEnumValue* -@Returns: - - - -Register a new set of flags @values and give them the name in -@type_name. - - -@type_name: must not be null. -@values: GtkFlagValue* -@Returns: - - - -Set the mem_chunk size so it will hold @n_chunks of the objects of that @type. - - -@type: There must be an unlocked TypeNode associated with this type otherwise nothing happens. -@n_chunks: - - - -Set the varargs type for a fundamental type @foreign_type. - - -@foreign_type: Must be a GtkType with a sequence number of zero. Must not be a -fundamental type. -@varargs_type: Must be a GtkType which is either structured or flag, or NONE. - - - - - - -@widget: -@accel_group: -@accel_key: -@accel_mods: -@Returns: - - - - - - -@widget: -@Returns: - - - - - - -@widget: -@group_cycling: -@Returns: - - - - - - -@widget: -@width: -@height: - - - - - - -@widget: - - - - - - - - - - - - -@widget: -@x: -@y: - - - - - - -@style: - - - - - - -@widget: -@accel_signal: -@visible_only: - - - - - - -@style: - - - - - - -@widget: - - - - - - -@window: -@keyval: -@modifier: -@Returns: - - - - - - -@window: -@Returns: - - - - - - -@window: -@Returns: - - - - - - -@window: -@Returns: - - - - - - -@window: -@decorations: - - - - - - -@window: -@functions: - - - - - - -@window: -@setting: -@resizeable: - diff --git a/docs/reference/gtk/tmpl/gtkaccelmap.sgml b/docs/reference/gtk/tmpl/gtkaccelmap.sgml index f83b75b283..c7fa69c60a 100644 --- a/docs/reference/gtk/tmpl/gtkaccelmap.sgml +++ b/docs/reference/gtk/tmpl/gtkaccelmap.sgml @@ -17,6 +17,9 @@ Loadable keyboard accelerator specifications + + + @@ -148,6 +151,7 @@ Loadable keyboard accelerator specifications +@void: @Returns: diff --git a/docs/reference/gtk/tmpl/gtkaction.sgml b/docs/reference/gtk/tmpl/gtkaction.sgml deleted file mode 100644 index f35a111f60..0000000000 --- a/docs/reference/gtk/tmpl/gtkaction.sgml +++ /dev/null @@ -1,560 +0,0 @@ - -GtkAction - - -An action which can be triggered by a menu or toolbar item - - - -Actions represent operations that the user can be perform, along with -some information how it should be presented in the interface. Each action -provides methods to create icons, menu items and toolbar items representing -itself. - - -As well as the callback that is called when the action gets activated, the -following also gets associated with the action: - - a name (not translated, for path lookup) - a label (translated, for display) - an accelerator - whether label indicates a stock id - a tooltip (optional, translated) - a toolbar label (optional, shorter than label) - -The action will also have some state information: - - visible (shown/hidden) - sensitive (enabled/disabled) - - - -Apart from regular actions, there are toggle -actions, which can be toggled between two states and radio actions, of which only one in a group -can be in the "active" state. Other actions can be implemented as #GtkAction -subclasses. - - -Each action can have one or more proxy menu item, toolbar button or -other proxy widgets. Proxies mirror the state of the action (text -label, tooltip, icon, visible, sensitive, etc), and should change when -the action's state changes. When the proxy is activated, it should -activate its action. - - - - -#GtkActionGroup, #GtkUIManager - - - - - - - -The GtkAction struct contains only private members -and should not be accessed directly. - - - - - - - - -@action: the object which received the signal. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -@name: -@label: -@tooltip: -@stock_id: -@Returns: - - - - - - - -@action: -@Returns: - - - - - - - -@action: -@Returns: - - - - - - - -@action: -@Returns: - - - - - - - -@action: -@sensitive: - - - - - - - -@action: -@Returns: - - - - - - - -@action: -@Returns: - - - - - - - -@action: -@visible: - - - - - - - -@action: - - - - - - - -@action: -@icon_size: -@Returns: - - - - - - - -@action: -@Returns: - - - - - - - -@action: -@Returns: - - - - - - - -@action: -@Returns: - - - - - - - -@action: -@proxy: - - - - - - - -@action: -@proxy: - - - - - - - -@action: -@Returns: - - - - - - - -@action: - - - - - - - -@action: - - - - - - - -@action: - - - - - - - -@action: - - - - - - - -@action: -@proxy: - - - - - - - -@action: -@proxy: - - - - - - - -@action: -@Returns: - - - - - - - -@action: -@always_show: - - - - - - - -@action: -@Returns: - - - - - - - -@action: -@accel_path: - - - - - - - -@action: -@Returns: - - - - - - - -@action: -@accel_group: - - - - - - - -@action: -@label: - - - - - - - -@action: -@Returns: - - - - - - - -@action: -@short_label: - - - - - - - -@action: -@Returns: - - - - - - - -@action: -@tooltip: - - - - - - - -@action: -@Returns: - - - - - - - -@action: -@stock_id: - - - - - - - -@action: -@Returns: - - - - - - - -@action: -@icon: - - - - - - - -@action: -@Returns: - - - - - - - -@action: -@icon_name: - - - - - - - -@action: -@Returns: - - - - - - - -@action: -@visible_horizontal: - - - - - - - -@action: -@Returns: - - - - - - - -@action: -@visible_vertical: - - - - - - - -@action: -@Returns: - - - - - - - -@action: -@is_important: - - - - - - - -@action: -@Returns: - - diff --git a/docs/reference/gtk/tmpl/gtkactiongroup.sgml b/docs/reference/gtk/tmpl/gtkactiongroup.sgml index 516210d427..27bb293dba 100644 --- a/docs/reference/gtk/tmpl/gtkactiongroup.sgml +++ b/docs/reference/gtk/tmpl/gtkactiongroup.sgml @@ -70,6 +70,9 @@ it doesn't allow you to specify a signal. + + + The GtkActionGroup struct contains only private @@ -353,6 +356,19 @@ gtk_action_group_add_radio_actions() to construct groups of radio actions. @destroy: + + +The function used to translate messages in e.g. #GtkIconFactory +and #GtkActionGroup. + + +@path: The id of the message. In #GtkItemFactory this will be a path + from a #GtkItemFactoryEntry, in #GtkActionGroup, it will be a label + or tooltip from a #GtkActionEntry. +@func_data: user data passed in when registering the function +@Returns: the translated message + + diff --git a/docs/reference/gtk/tmpl/gtkadjustment.sgml b/docs/reference/gtk/tmpl/gtkadjustment.sgml index ee85e79d61..d32aedd316 100644 --- a/docs/reference/gtk/tmpl/gtkadjustment.sgml +++ b/docs/reference/gtk/tmpl/gtkadjustment.sgml @@ -31,6 +31,9 @@ after changing the value and its bounds. This results in the emission of the + + + The #GtkAdjustment-struct struct contains the following fields. diff --git a/docs/reference/gtk/tmpl/gtkalignment.sgml b/docs/reference/gtk/tmpl/gtkalignment.sgml deleted file mode 100644 index 142c728964..0000000000 --- a/docs/reference/gtk/tmpl/gtkalignment.sgml +++ /dev/null @@ -1,141 +0,0 @@ - -GtkAlignment - - -A widget which controls the alignment and size of its child - - - -The #GtkAlignment widget controls the alignment and size of its child widget. -It has four settings: xscale, yscale, xalign, and yalign. - - -The scale settings are used to specify how much the child widget should -expand to fill the space allocated to the #GtkAlignment. -The values can range from 0 (meaning the child doesn't expand at all) to -1 (meaning the child expands to fill all of the available space). - - -The align settings are used to place the child widget within the available -area. The values range from 0 (top or left) to 1 (bottom or right). -Of course, if the scale settings are both set to 1, the alignment settings -have no effect. - - - - - - - - - - - - -The #GtkAlignment-struct struct contains private data only, and should -be accessed using the functions below. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Creates a new #GtkAlignment. - - -@xalign: the horizontal alignment of the child widget, from 0 (left) to 1 -(right). -@yalign: the vertical alignment of the child widget, from 0 (top) to 1 -(bottom). -@xscale: the amount that the child widget expands horizontally to fill up -unused space, from 0 to 1. -A value of 0 indicates that the child widget should never expand. -A value of 1 indicates that the child widget will expand to fill all of the -space allocated for the #GtkAlignment. -@yscale: the amount that the child widget expands vertically to fill up -unused space, from 0 to 1. The values are similar to @xscale. -@Returns: the new #GtkAlignment. - - - - -Sets the #GtkAlignment values. - - -@alignment: a #GtkAlignment. -@xalign: the horizontal alignment of the child widget, from 0 (left) to 1 -(right). -@yalign: the vertical alignment of the child widget, from 0 (top) to 1 -(bottom). -@xscale: the amount that the child widget expands horizontally to fill up -unused space, from 0 to 1. -A value of 0 indicates that the child widget should never expand. -A value of 1 indicates that the child widget will expand to fill all of the -space allocated for the #GtkAlignment. -@yscale: the amount that the child widget expands vertically to fill up -unused space, from 0 to 1. The values are similar to @xscale. - - - - - - - -@alignment: -@padding_top: -@padding_bottom: -@padding_left: -@padding_right: - - - - - - - -@alignment: -@padding_top: -@padding_bottom: -@padding_left: -@padding_right: - - diff --git a/docs/reference/gtk/tmpl/gtkarrow.sgml b/docs/reference/gtk/tmpl/gtkarrow.sgml deleted file mode 100644 index 8e3a146aab..0000000000 --- a/docs/reference/gtk/tmpl/gtkarrow.sgml +++ /dev/null @@ -1,82 +0,0 @@ - -GtkArrow - - -Displays an arrow - - - -GtkArrow should be used to draw simple arrows that need to point in -one of the four cardinal directions (up, down, left, or right). The -style of the arrow can be one of shadow in, shadow out, etched in, or -etched out. Note that these directions and style types may be -ammended in versions of Gtk to come. - - -GtkArrow will fill any space alloted to it, but since it is inherited -from #GtkMisc, it can be padded and/or aligned, to fill exactly the -space the programmer desires. - - -Arrows are created with a call to gtk_arrow_new(). The direction or -style of an arrow can be changed after creation by using gtk_arrow_set(). - - - - - - - -gtk_paint_arrow() -the function used internally to paint the arrow. - - - - - - - - - - -The #GtkArrow struct containes the following fields. -(These fields should be considered read-only. They should never be set by -an application.) - - - - - - - - - - - - - - - - - - - - -Creates a new arrow widget. - - -@arrow_type: a valid #GtkArrowType. -@shadow_type: a valid #GtkShadowType. -@Returns: the new #GtkArrow widget. - - - - -Sets the direction and style of the #GtkArrow, @arrow. - - -@arrow: a widget of type #GtkArrow. -@arrow_type: a valid #GtkArrowType. -@shadow_type: a valid #GtkShadowType. - - diff --git a/docs/reference/gtk/tmpl/gtkaspectframe.sgml b/docs/reference/gtk/tmpl/gtkaspectframe.sgml deleted file mode 100644 index 25d05e89fd..0000000000 --- a/docs/reference/gtk/tmpl/gtkaspectframe.sgml +++ /dev/null @@ -1,88 +0,0 @@ - -GtkAspectFrame - - -A frame that constrains its child to a particular aspect ratio - - - -The #GtkAspectFrame is useful when you want -pack a widget so that it can resize but always retains -the same aspect ratio. For instance, one might be -drawing a small preview of a larger image. #GtkAspectFrame -derives from #GtkFrame, so it can draw a label and -a frame around the child. The frame will be -"shrink-wrapped" to the size of the child. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Create a new #GtkAspectFrame. - - -@label: Label text. -@xalign: Horizontal alignment of the child within the allocation of -the #GtkAspectFrame. This ranges from 0.0 (left aligned) -to 1.0 (right aligned) -@yalign: Vertical alignment of the child within the allocation of -the #GtkAspectFrame. This ranges from 0.0 (left aligned) -to 1.0 (right aligned) -@ratio: The desired aspect ratio. -@obey_child: If %TRUE, @ratio is ignored, and the aspect - ratio is taken from the requistion of the child. -@Returns: the new #GtkAspectFrame. - -@ratio: The desired aspect ratio. - - - - -Set parameters for an existing #GtkAspectFrame. - - -@aspect_frame: a #GtkAspectFrame -@xalign: Horizontal alignment of the child within the allocation of -the #GtkAspectFrame. This ranges from 0.0 (left aligned) -to 1.0 (right aligned) -@yalign: Vertical alignment of the child within the allocation of -the #GtkAspectFrame. This ranges from 0.0 (left aligned) -to 1.0 (right aligned) -@ratio: The desired aspect ratio. -@obey_child: If %TRUE, @ratio is ignored, and the aspect - ratio is taken from the requistion of the child. - - diff --git a/docs/reference/gtk/tmpl/gtkassistant.sgml b/docs/reference/gtk/tmpl/gtkassistant.sgml deleted file mode 100644 index ab00eee54c..0000000000 --- a/docs/reference/gtk/tmpl/gtkassistant.sgml +++ /dev/null @@ -1,344 +0,0 @@ - -GtkAssistant - - -A widget used to guide users through multi-step operations - - - -A #GtkAssistant is a widget used to represent a generally complex -operation splitted in several steps, guiding the user through its pages -and controlling the page flow to collect the necessary data. - -GtkAssistant as GtkBuildable - -The GtkAssistant implementation of the GtkBuildable interface exposes the -@action_area as internal children with the name "action_area". - - -To add pages to an assistant in GtkBuilder, simply add it as a <child> -to the GtkAssistant object, and set its child properties as necessary. - - - - - - - - - - - - - - - - - - - - - - -@assistant: the object which received the signal. - - - - - - -@assistant: the object which received the signal. - - - - - - -@assistant: the object which received the signal. - - - - - - -@assistant: the object which received the signal. -@widget: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -@Returns: - - - - - - - -@assistant: -@Returns: - - - - - - - -@assistant: -@page_num: - - - - - - - -@assistant: -@Returns: - - - - - - - -@assistant: -@page_num: -@Returns: - - - - - - - -@assistant: -@page: -@Returns: - - - - - - - -@assistant: -@page: -@Returns: - - - - - - - -@assistant: -@page: -@position: -@Returns: - - - - -A function used by gtk_assistant_set_forward_page_func() to know which -is the next page given a current one. It's called both for computing the -next page when the user presses the "forward" button and for handling -the behavior of the "last" button. - - -@current_page: The page number used to calculate the next page. -@data: user data. -@Returns: The next page number. - - - - - - - -@assistant: -@page_func: -@data: -@destroy: - - - - -An enum for determining the page role inside the #GtkAssistant. It's used to -handle buttons sensitivity and visibility. - - - -Note that an assistant needs to end its page flow with a page of type GTK_ASSISTANT_PAGE_CONFIRM -or GTK_ASSISTANT_PAGE_SUMMARY to be correct. - - -@GTK_ASSISTANT_PAGE_CONTENT: The page has regular contents. -@GTK_ASSISTANT_PAGE_INTRO: The page contains an introduction to the assistant task. -@GTK_ASSISTANT_PAGE_CONFIRM: The page lets the user confirm or deny the changes. -@GTK_ASSISTANT_PAGE_SUMMARY: The page informs the user of the changes done. -@GTK_ASSISTANT_PAGE_PROGRESS: Used for tasks that take a long time to complete, blocks the assistant until the page is marked as complete. - - - - - - -@assistant: -@page: -@type: - - - - - - - -@assistant: -@page: -@Returns: - - - - - - - -@assistant: -@page: -@title: - - - - - - - -@assistant: -@page: -@Returns: - - - - - - - -@assistant: -@page: -@pixbuf: - - - - - - - -@assistant: -@page: -@Returns: - - - - - - - -@assistant: -@page: -@pixbuf: - - - - - - - -@assistant: -@page: -@Returns: - - - - - - - -@assistant: -@page: -@complete: - - - - - - - -@assistant: -@page: -@Returns: - - - - - - - -@assistant: -@child: - - - - - - - -@assistant: -@child: - - - - - - - -@assistant: - - diff --git a/docs/reference/gtk/tmpl/gtkbbox.sgml b/docs/reference/gtk/tmpl/gtkbbox.sgml deleted file mode 100644 index 74c3c6d7d4..0000000000 --- a/docs/reference/gtk/tmpl/gtkbbox.sgml +++ /dev/null @@ -1,210 +0,0 @@ - -GtkButtonBox - - -Base class for GtkHButtonBox and GtkVButtonBox - - - -The primary purpose of this class is to keep track of the various properties -of #GtkHButtonBox and #GtkVButtonBox widgets. - - -gtk_button_box_get_child_size() retrieves the minimum width and height -for widgets in a given button box. - - -The internal padding of buttons can be retrieved and changed per button box using -gtk_button_box_get_child_ipadding() and gtk_button_box_set_child_ipadding() -respectively. - - -gtk_button_box_get_spacing() and gtk_button_box_set_spacing() retrieve and -change default number of pixels between buttons, respectively. - - -gtk_button_box_get_layout() and gtk_button_box_set_layout() retrieve and alter the method -used to spread the buttons in a button box across the container, respectively. - - - -The main purpose of GtkButtonBox is to make sure the children have all the same size. -Therefore it ignores the homogeneous property which it inherited from GtkBox, and always -behaves as if homogeneous was %TRUE. - - - - - - -#GtkVButtonBox -Vertical sub-class of #GtkButtonBox. - - -#GtkHButtonBox -Horizontal sub-class of #GtkButtonBox. - - - - - - - - - -This is a read-only struct; no members should be modified directly. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Used internally only. - - - - - - -Retrieves how much space a button box is placing between each child button. - - -@b: a #GtkButtonBox -@Returns: the current spacing applied to the buttons in @widget -@Deprecated: Use gtk_box_get_spacing() instead. - - - - -Retrieves the method being used to arrange the buttons in a button box. - - -@widget: a #GtkButtonBox. -@Returns: the method used to layout buttons in @widget. - - - - -Retrieves the current width and height of all child widgets in a button box. -@min_width and @min_height are filled with those values, respectively. - - -@widget: a #GtkButtonBox. -@min_width: the width of the buttons contained by @widget. -@min_height: the height of the buttons contained by @widget. -@Deprecated: Use the style properties -"child-min-width/-height" instead. - - - - -Gets the default number of pixels that pad the buttons in a given button box. - - -@widget: a #GtkButtonBox. -@ipad_x: the horizontal padding used by buttons in @widget. -@ipad_y: the vertical padding used by buttons in @widget. -@Deprecated: Use the style properties - "child-internal-pad-x" - and - "child-internal-pad-y" - instead. - - - - - - - -@widget: -@child: -@Returns: - - - - -Sets the amount of spacing between buttons in a given button box. - - -@b: a #GtkButtonBox -@s: the number of pixels of spacing -@Deprecated: Use gtk_box_set_spacing() instead. - - - - -Changes the way buttons are arranged in their container. - - -@widget: a #GtkButtonBox. -@layout_style: the new layout style. - - - - -Sets a new default size for the children of a given button box. - - -@widget: a #GtkButtonBox -@min_width: a default width for buttons in @widget -@min_height: a default height for buttons in @widget -@Deprecated: This is not supported anymore and can only be set through the theme - changing the style properties: - "child-min-width" - and - "child-min-height" - instead. - - - - -Changes the amount of internal padding used by all buttons in a given button -box. - - -@widget: a #GtkButtonBox. -@ipad_x: the horizontal padding that should be used by each button in @widget. -@ipad_y: the vertical padding that should be used by each button in @widget. -@Deprecated: Use the style properties -"child-internal-pad-x/-y" instead. - - - - - - - -@widget: -@child: -@is_secondary: - - diff --git a/docs/reference/gtk/tmpl/gtkbin.sgml b/docs/reference/gtk/tmpl/gtkbin.sgml deleted file mode 100644 index d806d4701e..0000000000 --- a/docs/reference/gtk/tmpl/gtkbin.sgml +++ /dev/null @@ -1,54 +0,0 @@ - -GtkBin - - -A container with just one child - - - -The #GtkBin widget is a container with just one child. -It is not very useful itself, but it is useful for deriving subclasses, -since it provides common code needed for handling a single child widget. - - -Many GTK+ widgets are subclasses of #GtkBin, including #GtkWindow, #GtkButton, -#GtkFrame, #GtkHandleBox, and #GtkScrolledWindow. - - - - - - - - - - - - -The #GtkBin-struct struct contains the following fields. -(These fields should be considered read-only. They should never be set by -an application.) - - - - - - -#GtkWidget *child; -the child widget. - - - - - - - - - - - - -@bin: -@Returns: - - diff --git a/docs/reference/gtk/tmpl/gtkbindings.sgml b/docs/reference/gtk/tmpl/gtkbindings.sgml index fca01a21de..61961adab0 100644 --- a/docs/reference/gtk/tmpl/gtkbindings.sgml +++ b/docs/reference/gtk/tmpl/gtkbindings.sgml @@ -120,6 +120,9 @@ The "unbind" functionality has been introduced in GTK+ 2.12. + + + A binding set maintains a list of activatable key bindings. @@ -175,13 +178,6 @@ key binding signal emission as stored in #GtkBindingSignal. @arg_type: implementation detail - - - - - - - @@ -194,25 +190,6 @@ key binding signal emission as stored in #GtkBindingSignal. @binding_args: - - - - - -@binding_set: -@keyval: -@modifiers: - - - - - - - -@scanner: -@Returns: - - diff --git a/docs/reference/gtk/tmpl/gtkbox.sgml b/docs/reference/gtk/tmpl/gtkbox.sgml deleted file mode 100644 index eb42208d3a..0000000000 --- a/docs/reference/gtk/tmpl/gtkbox.sgml +++ /dev/null @@ -1,291 +0,0 @@ - -GtkBox - - -Base class for box containers - - - -GtkBox is an abstract widget which encapsulates functionality for a -particular kind of container, one that organizes a variable number of -widgets into a rectangular area. GtkBox has a number of derived -classes, e.g. #GtkHBox and #GtkVBox. - - -The rectangular area of a GtkBox is organized into either a single row -or a single column of child widgets depending upon whether the box is -of type #GtkHBox or #GtkVBox, respectively. Thus, all children of a -GtkBox are allocated one dimension in common, which is the height of a -row, or the width of a column. - - -GtkBox uses a notion of packing. Packing refers to -adding widgets with reference to a particular position in a -#GtkContainer. For a GtkBox, there are two reference positions: the -start and the end of the box. -For a #GtkVBox, the start is defined as the top of the box and the end is -defined as the bottom. For a #GtkHBox the start is defined as the -left side and the end is defined as the right side. - - -Use repeated calls to gtk_box_pack_start() to pack widgets into a -GtkBox from start to end. Use gtk_box_pack_end() to add widgets from -end to start. You may intersperse these calls and add widgets from -both ends of the same GtkBox. - - -Use gtk_box_pack_start_defaults() or gtk_box_pack_end_defaults() -to pack widgets into a GtkBox if you do not need to specify the -#GtkBox:expand, #GtkBox:fill, or #GtkBox:padding child properties -for the child to be added. - - -Because GtkBox is a #GtkContainer, you may also use -gtk_container_add() to insert widgets into the box, and they will be -packed as if with gtk_box_pack_start_defaults(). Use -gtk_container_remove() to remove widgets from the GtkBox. - - -Use gtk_box_set_homogeneous() to specify whether or not all children -of the GtkBox are forced to get the same amount of space. - - -Use gtk_box_set_spacing() to determine how much space will be -minimally placed between all children in the GtkBox. - - -Use gtk_box_reorder_child() to move a GtkBox child to a different -place in the box. - - -Use gtk_box_set_child_packing() to reset the #GtkBox:expand, -#GtkBox:fill and #GtkBox:padding child properties. -Use gtk_box_query_child_packing() to query these fields. - - - - - - - -#GtkHBox -a derived class that organizes widgets into a row. - - - -#GtkVBox -a derived class that organizes widgets into a column. - - - -#GtkFrame -a #GtkWidget useful for drawing a border around a GtkBox. - - - -#GtkTable -a #GtkContainer for organizing widgets into a grid, -rather than independent rows or columns. - - - -#GtkLayout -a #GtkContainer for organizing widgets into arbitrary -layouts. - - - - - - - - - - - -The #GtkBox-struct describes an instance of GtkBox and contains the -following fields. (These fields should be considered read-only. -They should never be set by an application.) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -The #GtkBoxChild-struct holds a child widget of GtkBox and describes -how the child is to be packed into the GtkBox. Use -gtk_box_query_child_packing() and gtk_box_set_child_packing() to query -and reset the padding, -expand, fill, -and pack fields. - - -#GtkBoxChild-struct contains the following fields. (These fields -should be considered read-only. They should never be directly set by an -application.) - - -@widget: the child widget, packed into the GtkBox. -@padding: the number of extra pixels to put between this child and its - neighbors, set when packed, zero by default. -@expand: flag indicates whether extra space should be given to this - child. Any extra space given to the parent GtkBox is divided up - among all children with this attribute set to %TRUE; set when packed, - %TRUE by default. -@fill: flag indicates whether any extra space given to this child due - to its @expand attribute being set is actually allocated to the child, - rather than being used as padding around the widget; set when packed, - %TRUE by default. -@pack: one of #GtkPackType indicating whether the child is packed with - reference to the start (top/left) or end (bottom/right) of the GtkBox. -@is_secondary: %TRUE if the child is secondary - - - - - - -@box: -@child: -@expand: -@box -@fill: -@padding: - - - - - - - -@box: -@child: -@expand: -@fill: -@padding: - - - - - - - -@box: -@widget: - - - - - - - -@box: -@widget: - - - - - - - -@box: -@Returns: - - - - - - - -@box: -@homogeneous: - - - - - - - -@box: -@Returns: - - - - - - - -@box: -@spacing: - - - - - - - -@box: -@child: -@position: - - - - - - - -@box: -@child: -@expand: -@fill: -@padding: -@pack_type: - - - - - - - -@box: -@child: -@expand: -@fill: -@padding: -@pack_type: - - diff --git a/docs/reference/gtk/tmpl/gtkbuildable.sgml b/docs/reference/gtk/tmpl/gtkbuildable.sgml deleted file mode 100644 index 935a2c77f6..0000000000 --- a/docs/reference/gtk/tmpl/gtkbuildable.sgml +++ /dev/null @@ -1,193 +0,0 @@ - -GtkBuildable - - -Interface for objects that can be built by GtkBuilder - - - -In order to allow construction from a GtkBuilder -UI description, an object class must implement the -GtkBuildable interface. The interface includes methods for setting -names and properties of objects, parsing custom tags, constructing -child objects. - - -The GtkBuildable interface is implemented by all widgets and -many of the non-widget objects that are provided by GTK+. The -main user of this interface is #GtkBuilder, there should be -very little need for applications to call any -gtk_buildable_... functions. - - - - - - - - - - - - - - - - -The GtkBuildableIface interface contains method that are -necessary to allow #GtkBuilder to construct an object from -a GtkBuilder UI definition. - - -@g_iface: the parent class -@set_name: Stores the name attribute given in the GtkBuilder UI definition. - #GtkWidget stores the name as object data. Implement this method if your - object has some notion of "name" and it makes sense to map the XML name - attribute to it. -@get_name: The getter corresponding to @set_name. Implement this - if you implement @set_name. -@add_child: Adds a child. The @type parameter can be used to - differentiate the kind of child. #GtkContainer implements this - to add add a child widget to the container, #GtkNotebook uses - the @type to distinguish between page labels (of type "page-label") - and normal children. -@set_buildable_property: Sets a property of a buildable object. - It is normally not necessary to implement this, g_object_set_property() - is used by default. #GtkWindow implements this to delay showing itself - (i.e. setting the #GtkWidget:visible property) until the whole interface - is created. -@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. 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. - #GtkWidget implements this to parse keyboard accelerators specified - in <accelerator> elements. #GtkContainer implements it to map - properties defined via <packing> elements to child properties. - Note that @user_data must be freed in @custom_tag_end or @custom_finished. -@custom_tag_end: Called for the end tag of each custom element that is - handled by the buildable (see @custom_tag_start). -@custom_finished: Called for each custom tag handled by the buildable - when the builder finishes parsing (see @custom_tag_start) -@parser_finished: Called when a builder finishes the parsing - of a UI definition. It is normally not necessary to implement this, - unless you need to perform special cleanup actions. #GtkWindow sets - the #GtkWidget:visible property here. -@get_internal_child: Returns an internal child of a buildable. - #GtkDialog implements this to give access to its @vbox, making - it possible to add children to the vbox in a UI definition. - Implement this if the buildable has internal children that may - need to be accessed from a UI definition. - - - - - - -@buildable: -@name: - - - - - - - -@buildable: -@Returns: - - - - - - - -@buildable: -@builder: -@child: -@type: - - - - - - - -@buildable: -@builder: -@name: -@value: - - - - - - - -@buildable: -@builder: -@name: -@Returns: - - - - - - - -@buildable: -@builder: -@child: -@tagname: -@parser: -@data: -@Returns: - - - - - - - -@buildable: -@builder: -@child: -@tagname: -@data: - - - - - - - -@buildable: -@builder: -@child: -@tagname: -@data: - - - - - - - -@buildable: -@builder: - - - - - - - -@buildable: -@builder: -@childname: -@Returns: - - diff --git a/docs/reference/gtk/tmpl/gtkbuilder.sgml b/docs/reference/gtk/tmpl/gtkbuilder.sgml deleted file mode 100644 index f5545eba57..0000000000 --- a/docs/reference/gtk/tmpl/gtkbuilder.sgml +++ /dev/null @@ -1,462 +0,0 @@ - -GtkBuilder - - -Build an interface from an XML UI definition - - - -A GtkBuilder is an auxiliary object that reads textual descriptions -of a user interface and instantiates the described objects. To pass a -description to a GtkBuilder, call gtk_builder_add_from_file() or -gtk_builder_add_from_string(). These functions can be called multiple -times; the builder merges the content of all descriptions. - - -A GtkBuilder holds a reference to all objects that it has constructed -and drops these references when it is finalized. This finalization can -cause the destruction of non-widget objects or widgets which are not -contained in a toplevel window. For toplevel windows constructed by a -builder, it is the responsibility of the user to call gtk_widget_destroy() -to get rid of them and all the widgets they contain. - - -The functions gtk_builder_get_object() and gtk_builder_get_objects() -can be used to access the widgets in the interface by the names assigned -to them inside the UI description. Toplevel windows returned by these -functions will stay around until the user explicitly destroys them -with gtk_widget_destroy(). Other widgets will either be part of a -larger hierarchy constructed by the builder (in which case you should -not have to worry about their lifecycle), or without a parent, in which -case they have to be added to some container to make use of them. -Non-widget objects need to be reffed with g_object_ref() to keep them -beyond the lifespan of the builder. - - -The function gtk_builder_connect_signals() and variants thereof can be -used to connect handlers to the named signals in the description. - - -GtkBuilder UI Definitions - -GtkBuilder parses textual descriptions of user interfaces which -are specified in an XML format which can be roughly described -by the DTD below. We refer to these descriptions as -GtkBuilder UI definitions or just -UI definitions if the context is clear. -Do not confuse GtkBuilder UI Definitions with -GtkUIManager UI Definitions, -which are more limited in scope. - - - - - - - - - - - - - - - -]]> - - -The toplevel element is <interface>. -It optionally takes a "domain" attribute, which will make -the builder look for translated strings using dgettext() in the -domain specified. This can also be done by calling -gtk_builder_set_translation_domain() on the builder. -Objects are described by <object> elements, which can -contain <property> elements to set properties, <signal> -elements which connect signals to handlers, and <child> -elements, which describe child objects (most often widgets -inside a container, but also e.g. actions in an action group, -or columns in a tree model). A <child> element contains -an <object> element which describes the child object. -The target toolkit version(s) are described by <requires> -elements, the "lib" attribute specifies the widget library in -question (currently the only supported value is "gtk+") and the "version" -attribute specifies the target version in the form "<major>.<minor>". -The builder will error out if the version requirements are not met. - - -Typically, the specific kind of object represented by an -<object> element is specified by the "class" attribute. -If the type has not been loaded yet, GTK+ tries to find the -_get_type() from the class name by applying -heuristics. This works in most cases, but if necessary, it is -possible to specify the name of the _get_type() -explictly with the "type-func" attribute. As a special case, -GtkBuilder allows to use an object that has been constructed -by a #GtkUIManager in another part of the UI definition by -specifying the id of the #GtkUIManager in the "constructor" -attribute and the name of the object in the "id" attribute. - - -Objects must be given a name with the "id" attribute, which -allows the application to retrieve them from the builder with -gtk_builder_get_object(). An id is also necessary to use the -object as property value in other parts of the UI definition. - -Prior to 2.20, GtkBuilder was setting the "name" -property of constructed widgets to the "id" attribute. In GTK+ -2.20 or newer, you have to use gtk_buildable_get_name() instead -of gtk_widget_get_name() to obtain the "id", or set the "name" -property in your UI definition. - - -Setting properties of objects is pretty straightforward with -the <property> element: the "name" attribute specifies -the name of the property, and the content of the element -specifies the value. If the "translatable" attribute is -set to a true value, GTK+ uses gettext() (or dgettext() if -the builder has a translation domain set) to find a translation -for the value. This happens before the value is parsed, so -it can be used for properties of any type, but it is probably -most useful for string properties. It is also possible to -specify a context to disambiguate short strings, and comments -which may help the translators. - - -GtkBuilder can parse textual representations for the most -common property types: characters, strings, integers, floating-point -numbers, booleans (strings like "TRUE", "t", "yes", "y", "1" are -interpreted as %TRUE, strings like "FALSE, "f", "no", "n", "0" are -interpreted as %FALSE), enumerations (can be specified by their -name, nick or integer value), flags (can be specified by their name, -nick, integer value, optionally combined with "|", e.g. -"GTK_VISIBLE|GTK_REALIZED") and colors (in a format understood by -gdk_color_parse()). Objects can be referred to by their name. -Pixbufs can be specified as a filename of an image file to load. -In general, GtkBuilder allows forward references to objects — -an object doesn't have to constructed before it can be referred to. -The exception to this rule is that an object has to be constructed -before it can be used as the value of a construct-only property. - - -Signal handlers are set up with the <signal> element. -The "name" attribute specifies the name of the signal, and the -"handler" attribute specifies the function to connect to the signal. -By default, GTK+ tries to find the handler using g_module_symbol(), -but this can be changed by passing a custom #GtkBuilderConnectFunc -to gtk_builder_connect_signals_full(). The remaining attributes, -"after", "swapped" and "object", have the same meaning as the -corresponding parameters of the g_signal_connect_object() or -g_signal_connect_data() functions. A "last_modification_time" attribute -is also allowed, but it does not have a meaning to the builder. - - -Sometimes it is necessary to refer to widgets which have implicitly -been constructed by GTK+ as part of a composite widget, to set -properties on them or to add further children (e.g. the @vbox -of a #GtkDialog). This can be achieved by setting the "internal-child" -propery of the <child> element to a true value. Note that -GtkBuilder still requires an <object> element for the internal -child, even if it has already been constructed. - - -A number of widgets have different places where a child can be -added (e.g. tabs vs. page content in notebooks). This can be reflected -in a UI definition by specifying the "type" attribute on a <child> -The possible values for the "type" attribute are described in -the sections describing the widget-specific portions of UI definitions. - - -A GtkBuilder UI Definition - - - - - 10 - - - 20 - - - gtk-ok - TRUE - - - - - - - - - -]]> - - -Beyond this general structure, several object classes define -their own XML DTD fragments for filling in the ANY placeholders -in the DTD above. Note that a custom element in a <child> -element gets parsed by the custom tag handler of the parent -object, while a custom element in an <object> element -gets parsed by the custom tag handler of the object. - - -These XML fragments are explained in the documentation of the -respective objects, see -GtkWidget, -GtkLabel, -GtkWindow, -GtkContainer, -GtkDialog, -GtkCellLayout, -GtkColorSelectionDialog, -GtkFontSelectionDialog, -GtkComboBoxEntry, -GtkExpander, -GtkFrame, -GtkListStore, -GtkTreeStore, -GtkNotebook, -GtkSizeGroup, -GtkTreeView, -GtkUIManager, -GtkActionGroup. -GtkMenuItem, -GtkAssistant, -GtkScale. - - - - - - - - - - - - - - - - - - - - - - - - - -@builder: -@object: -@signal_name: -@handler_name: -@connect_object: -@flags: -@user_data: - - - - -Error codes that identify various errors that can occur while -using #GtkBuilder. - - -@GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION: A type-func attribute didn't name - a function that returns a #GType. -@GTK_BUILDER_ERROR_UNHANDLED_TAG: The input contained a tag that #GtkBuilder - can't handle. -@GTK_BUILDER_ERROR_MISSING_ATTRIBUTE: An attribute that is required by - #GtkBuilder was missing. -@GTK_BUILDER_ERROR_INVALID_ATTRIBUTE: #GtkBuilder found an attribute that - it doesn't understand. -@GTK_BUILDER_ERROR_INVALID_TAG: #GtkBuilder found a tag that - it doesn't understand. -@GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE: A required property value was - missing. -@GTK_BUILDER_ERROR_INVALID_VALUE: #GtkBuilder couldn't parse - some attribute value. -@GTK_BUILDER_ERROR_VERSION_MISMATCH: The input file requires a newer version - of GTK+. -@GTK_BUILDER_ERROR_DUPLICATE_ID: An object id occurred twice. - - - - - - -@Returns: - - - - - - - -@builder: -@filename: -@error: -@Returns: - - - - - - - -@builder: -@buffer: -@length: -@error: -@Returns: - - - - - - - -@builder: -@filename: -@object_ids: -@error: -@Returns: - - - - - - - -@builder: -@buffer: -@length: -@object_ids: -@error: -@Returns: - - - - - - - -@builder: -@name: -@Returns: - - - - - - - -@builder: -@Returns: - - - - - - - -@builder: -@user_data: - - - - - - - -@builder: -@func: -@user_data: - - - - - - - -@builder: -@domain: - - - - - - - -@builder: -@Returns: - - - - - - - -@builder: -@type_name: -@Returns: - - - - - - - -@builder: -@pspec: -@string: -@value: -@error: -@Returns: - - - - - - - -@builder: -@type: -@string: -@value: -@error: -@Returns: - - - - -This macro should be used to emit a warning about and unexpected -@type value in a #GtkBuildable add_child implementation. - - -@object: the #GtkBuildable on which the warning ocurred -@type: the unexpected type value - - - - -The #GError quark for #GtkBuilder errors - - - - diff --git a/docs/reference/gtk/tmpl/gtkbutton.sgml b/docs/reference/gtk/tmpl/gtkbutton.sgml index e5a26bb792..13ca4a6e77 100644 --- a/docs/reference/gtk/tmpl/gtkbutton.sgml +++ b/docs/reference/gtk/tmpl/gtkbutton.sgml @@ -24,6 +24,9 @@ the #GtkLabel. + + + This should not be accessed directly. Use the accessor functions below. @@ -158,6 +161,7 @@ Creates a new #GtkButton widget. To add a child widget to the button, use gtk_container_add(). +@void: @Returns: The newly created #GtkButton widget. diff --git a/docs/reference/gtk/tmpl/gtkcalendar.sgml b/docs/reference/gtk/tmpl/gtkcalendar.sgml index 75ab42de80..c4dbd96638 100644 --- a/docs/reference/gtk/tmpl/gtkcalendar.sgml +++ b/docs/reference/gtk/tmpl/gtkcalendar.sgml @@ -36,6 +36,9 @@ gtk_calendar_get_date(). + + + num_marked_dates is an integer containing the @@ -191,6 +194,7 @@ calendar. +@void: @Returns: @@ -312,25 +316,3 @@ calendar. @rows: - - - - -@calendar: -@flags: - - - - - - -@calendar: - - - - - - -@calendar: - - diff --git a/docs/reference/gtk/tmpl/gtkcelleditable.sgml b/docs/reference/gtk/tmpl/gtkcelleditable.sgml index ebcea5faf4..b06721be98 100644 --- a/docs/reference/gtk/tmpl/gtkcelleditable.sgml +++ b/docs/reference/gtk/tmpl/gtkcelleditable.sgml @@ -18,6 +18,9 @@ to be usable when editing the contents of a #GtkTreeView cell. + + + diff --git a/docs/reference/gtk/tmpl/gtkcelllayout.sgml b/docs/reference/gtk/tmpl/gtkcelllayout.sgml index e9e8fe21be..166d2cb996 100644 --- a/docs/reference/gtk/tmpl/gtkcelllayout.sgml +++ b/docs/reference/gtk/tmpl/gtkcelllayout.sgml @@ -58,6 +58,9 @@ content of the element is the attribute value. + + + diff --git a/docs/reference/gtk/tmpl/gtkcellrenderer.sgml b/docs/reference/gtk/tmpl/gtkcellrenderer.sgml index 98adcd9687..4a0e088d41 100644 --- a/docs/reference/gtk/tmpl/gtkcellrenderer.sgml +++ b/docs/reference/gtk/tmpl/gtkcellrenderer.sgml @@ -51,6 +51,9 @@ respectively. + + + Tells how a cell is to be rendererd. @@ -245,14 +248,6 @@ it cannot be individually modified. @Returns: - - - - - -@cell: - - diff --git a/docs/reference/gtk/tmpl/gtkcellrendereraccel.sgml b/docs/reference/gtk/tmpl/gtkcellrendereraccel.sgml index 077dcaefae..6268e44ae6 100644 --- a/docs/reference/gtk/tmpl/gtkcellrendereraccel.sgml +++ b/docs/reference/gtk/tmpl/gtkcellrendereraccel.sgml @@ -23,6 +23,9 @@ The #GtkCellRendererAccel cell renderer was added in GTK+ 2.10. + + + @@ -81,6 +84,7 @@ The #GtkCellRendererAccel cell renderer was added in GTK+ 2.10. +@void: @Returns: diff --git a/docs/reference/gtk/tmpl/gtkcellrenderercombo.sgml b/docs/reference/gtk/tmpl/gtkcellrenderercombo.sgml index 83d7900698..1a989c9d28 100644 --- a/docs/reference/gtk/tmpl/gtkcellrenderercombo.sgml +++ b/docs/reference/gtk/tmpl/gtkcellrenderercombo.sgml @@ -34,6 +34,9 @@ The #GtkCellRendererCombo cell renderer was added in GTK+ 2.6. + + + @@ -69,6 +72,7 @@ The #GtkCellRendererCombo cell renderer was added in GTK+ 2.6. +@void: @Returns: diff --git a/docs/reference/gtk/tmpl/gtkcellrendererpixbuf.sgml b/docs/reference/gtk/tmpl/gtkcellrendererpixbuf.sgml index 51e23f8347..cad7a4419d 100644 --- a/docs/reference/gtk/tmpl/gtkcellrendererpixbuf.sgml +++ b/docs/reference/gtk/tmpl/gtkcellrendererpixbuf.sgml @@ -33,6 +33,9 @@ property is set to a pixbuf, it renders that one. + + + @@ -89,6 +92,7 @@ property is set to a pixbuf, it renders that one. +@void: @Returns: diff --git a/docs/reference/gtk/tmpl/gtkcellrendererprogress.sgml b/docs/reference/gtk/tmpl/gtkcellrendererprogress.sgml index ccca765136..0d186f20b3 100644 --- a/docs/reference/gtk/tmpl/gtkcellrendererprogress.sgml +++ b/docs/reference/gtk/tmpl/gtkcellrendererprogress.sgml @@ -22,6 +22,9 @@ The #GtkCellRendererProgress cell renderer was added in GTK+ 2.6. + + + @@ -63,6 +66,7 @@ The #GtkCellRendererProgress cell renderer was added in GTK+ 2.6. +@void: @Returns: diff --git a/docs/reference/gtk/tmpl/gtkcellrendererspin.sgml b/docs/reference/gtk/tmpl/gtkcellrendererspin.sgml index fe96170b3e..cd98ee7eca 100644 --- a/docs/reference/gtk/tmpl/gtkcellrendererspin.sgml +++ b/docs/reference/gtk/tmpl/gtkcellrendererspin.sgml @@ -33,6 +33,9 @@ The #GtkCellRendererSpin cell renderer was added in GTK+ 2.10. + + + @@ -59,6 +62,7 @@ The #GtkCellRendererSpin cell renderer was added in GTK+ 2.10. +@void: @Returns: diff --git a/docs/reference/gtk/tmpl/gtkcellrenderertext.sgml b/docs/reference/gtk/tmpl/gtkcellrenderertext.sgml index 42125e4e25..286929e823 100644 --- a/docs/reference/gtk/tmpl/gtkcellrenderertext.sgml +++ b/docs/reference/gtk/tmpl/gtkcellrenderertext.sgml @@ -25,6 +25,9 @@ the #GtkCellRendererText allows to edit its text using an entry. + + + @@ -265,6 +268,7 @@ the #GtkCellRendererText allows to edit its text using an entry. +@void: @Returns: diff --git a/docs/reference/gtk/tmpl/gtkcellrenderertoggle.sgml b/docs/reference/gtk/tmpl/gtkcellrenderertoggle.sgml index faacb516e2..02e266af5e 100644 --- a/docs/reference/gtk/tmpl/gtkcellrenderertoggle.sgml +++ b/docs/reference/gtk/tmpl/gtkcellrenderertoggle.sgml @@ -20,6 +20,9 @@ property. When activated, it emits the toggled signal. + + + @@ -64,6 +67,7 @@ property. When activated, it emits the toggled signal. +@void: @Returns: diff --git a/docs/reference/gtk/tmpl/gtkcellview.sgml b/docs/reference/gtk/tmpl/gtkcellview.sgml index 7143a54d0b..0cc0bc1ab1 100644 --- a/docs/reference/gtk/tmpl/gtkcellview.sgml +++ b/docs/reference/gtk/tmpl/gtkcellview.sgml @@ -20,6 +20,9 @@ and drag and drop. + + + @@ -51,6 +54,7 @@ and drag and drop. +@void: @Returns: @@ -137,12 +141,3 @@ and drag and drop. @color: - - - - - -@cell_view: -@Returns: - - diff --git a/docs/reference/gtk/tmpl/gtkcheckbutton.sgml b/docs/reference/gtk/tmpl/gtkcheckbutton.sgml index 25246b0525..0e6313debd 100644 --- a/docs/reference/gtk/tmpl/gtkcheckbutton.sgml +++ b/docs/reference/gtk/tmpl/gtkcheckbutton.sgml @@ -37,6 +37,9 @@ The important signal ('toggled') is also inherited from #GtkToggleButton. + + + toggle_button is a #GtkToggleButton representing the actual toggle button that composes the check button. @@ -58,6 +61,7 @@ The important signal ('toggled') is also inherited from #GtkToggleButton. Creates a new #GtkCheckButton. +@void: @Returns: a #GtkWidget. diff --git a/docs/reference/gtk/tmpl/gtkcheckmenuitem.sgml b/docs/reference/gtk/tmpl/gtkcheckmenuitem.sgml index 7ee3e06a04..51ddf14584 100644 --- a/docs/reference/gtk/tmpl/gtkcheckmenuitem.sgml +++ b/docs/reference/gtk/tmpl/gtkcheckmenuitem.sgml @@ -25,6 +25,9 @@ toggles the value. + + + The #GtkCheckMenuItem-struct struct contains the following fields. @@ -81,6 +84,7 @@ field of the #GtkCheckMenuItem-struct struct to discover the new state. Creates a new #GtkCheckMenuItem. +@void: @Returns: a new #GtkCheckMenuItem. @@ -102,14 +106,6 @@ Creates a new #GtkCheckMenuItem with a label. @Returns: - - -Sets the active state of the menu item's check box. - - -@Deprecated: Use gtk_check_menu_item_set_active() instead. - - @@ -128,17 +124,6 @@ Sets the active state of the menu item's check box. @is_active: boolean value indicating whether the check box is active. - - -Controls whether the check box is shown at all times. -Normally the check box is shown only when it is active or while the -menu item is selected. - - -@menu_item: a #GtkCheckMenuItem. -@always: boolean value indicating whether to always show the check box. - - Emits the GtkCheckMenuItem::toggled signal. diff --git a/docs/reference/gtk/tmpl/gtkclipboard.sgml b/docs/reference/gtk/tmpl/gtkclipboard.sgml index ddd4195c36..d39782f4e2 100644 --- a/docs/reference/gtk/tmpl/gtkclipboard.sgml +++ b/docs/reference/gtk/tmpl/gtkclipboard.sgml @@ -87,6 +87,9 @@ Storing data on clipboards + + + diff --git a/docs/reference/gtk/tmpl/gtkcolorbutton.sgml b/docs/reference/gtk/tmpl/gtkcolorbutton.sgml index 61e36900a3..f51aeca4b1 100644 --- a/docs/reference/gtk/tmpl/gtkcolorbutton.sgml +++ b/docs/reference/gtk/tmpl/gtkcolorbutton.sgml @@ -19,6 +19,9 @@ widget for selecting a color in a preference dialog. + + + The GtkColorButton struct has only private fields and @@ -58,6 +61,7 @@ should not be used directly. +@void: @Returns: diff --git a/docs/reference/gtk/tmpl/gtkcolorsel.sgml b/docs/reference/gtk/tmpl/gtkcolorsel.sgml index 53cd64c55d..368c79140c 100644 --- a/docs/reference/gtk/tmpl/gtkcolorsel.sgml +++ b/docs/reference/gtk/tmpl/gtkcolorsel.sgml @@ -21,6 +21,9 @@ color selection dialog box #GtkColorSelectionDialog. + + + The #GtkColorSelection-struct struct contains private data only, @@ -61,40 +64,10 @@ according to its update policy. +@void: @Returns: - - -Sets the policy controlling when the color_changed signals are emitted. -The available policies are: - - - -%GTK_UPDATE_CONTINUOUS - signals are sent continuously as the color -selection changes. - - - - -%GTK_UPDATE_DISCONTINUOUS - signals are sent only when the mouse -button is released. - - - - -%GTK_UPDATE_DELAYED - signals are sent when the mouse button is -released or when the mouse has been motionless for a period of -time. - - - - - -@colorsel: a #GtkColorSelection. -@policy: a #GtkUpdateType value indicating the desired policy. - - @@ -233,15 +206,6 @@ time. @Returns: - - - - - -@func: -@Returns: - - @@ -271,21 +235,3 @@ time. @Since: 2.2 - - - - - -@colorsel: -@color: - - - - - - - -@colorsel: -@color: - - diff --git a/docs/reference/gtk/tmpl/gtkcolorseldlg.sgml b/docs/reference/gtk/tmpl/gtkcolorseldlg.sgml index f5a1fe06c0..793cacbebb 100644 --- a/docs/reference/gtk/tmpl/gtkcolorseldlg.sgml +++ b/docs/reference/gtk/tmpl/gtkcolorseldlg.sgml @@ -29,6 +29,9 @@ name "color_selection". It also exposes the buttons with the names + + + The #GtkColorSelectionDialog-struct struct contains the following fields. diff --git a/docs/reference/gtk/tmpl/gtkcombobox.sgml b/docs/reference/gtk/tmpl/gtkcombobox.sgml index 37ee0620cc..b4e303f1b2 100644 --- a/docs/reference/gtk/tmpl/gtkcombobox.sgml +++ b/docs/reference/gtk/tmpl/gtkcombobox.sgml @@ -42,6 +42,9 @@ gtk_combo_box_get_active_text(). + + + @@ -153,6 +156,7 @@ gtk_combo_box_get_active_text(). +@void: @Returns: @@ -279,6 +283,7 @@ gtk_combo_box_get_active_text(). +@void: @Returns: @@ -328,6 +333,15 @@ gtk_combo_box_get_active_text(). @Returns: + + + + + +@combo_box: +@device: + + diff --git a/docs/reference/gtk/tmpl/gtkcomboboxentry.sgml b/docs/reference/gtk/tmpl/gtkcomboboxentry.sgml index 04d3a63797..b8eb4892af 100644 --- a/docs/reference/gtk/tmpl/gtkcomboboxentry.sgml +++ b/docs/reference/gtk/tmpl/gtkcomboboxentry.sgml @@ -61,6 +61,9 @@ child with name "entry". + + + @@ -77,6 +80,7 @@ child with name "entry". +@void: @Returns: @@ -95,6 +99,7 @@ child with name "entry". +@void: @Returns: diff --git a/docs/reference/gtk/tmpl/gtkcontainer.sgml b/docs/reference/gtk/tmpl/gtkcontainer.sgml index 7d28b5bc35..3218186cd4 100644 --- a/docs/reference/gtk/tmpl/gtkcontainer.sgml +++ b/docs/reference/gtk/tmpl/gtkcontainer.sgml @@ -6,100 +6,107 @@ Base class for widgets which contain other widgets -A GTK+ user interface is constructed by nesting widgets inside widgets. -Container widgets are the inner nodes in the resulting tree of widgets: -they contain other widgets. So, for example, you might have a #GtkWindow -containing a #GtkFrame containing a GtkLabel. If you wanted an image instead -of a textual label inside the frame, you might replace the #GtkLabel widget +A GTK+ user interface is constructed by nesting widgets inside widgets. +Container widgets are the inner nodes in the resulting tree of widgets: +they contain other widgets. So, for example, you might have a #GtkWindow +containing a #GtkFrame containing a GtkLabel. If you wanted an image instead +of a textual label inside the frame, you might replace the #GtkLabel widget with a #GtkImage widget. -There are two major kinds of container widgets in GTK+. Both are subclasses +There are two major kinds of container widgets in GTK+. Both are subclasses of the abstract #GtkContainer base class. -The first type of container widget has a single child widget and derives -from #GtkBin. These containers are decorators, which -add some kind of functionality to the child. For example, a #GtkButton makes -its child into a clickable button; a #GtkFrame draws a frame around its child +The first type of container widget has a single child widget and derives +from #GtkBin. These containers are decorators, which +add some kind of functionality to the child. For example, a #GtkButton makes +its child into a clickable button; a #GtkFrame draws a frame around its child and a #GtkWindow places its child widget inside a top-level window. -The second type of container can have more than one child; its purpose is to -manage layout. This means that these containers assign -sizes and positions to their children. For example, a #GtkHBox arranges its -children in a horizontal row, and a #GtkTable arranges the widgets it contains -in a two-dimensional grid. +The second type of container can have more than one child; its purpose is to +manage layout. This means that these containers assign +sizes and positions to their children. For example, a #GtkHBox arranges its +children in a horizontal row, and a #GtkTable arranges the widgets it contains +in a two-dimensional grid. -To fulfill its task, a layout container must negotiate the size requirements -with its parent and its children. This negotiation is carried out in two -phases, size requisition and size -allocation. +To fulfill its task, a layout container must negotiate the size requirements +with its parent and its children. The basic form of this negotiation is +carried out in two phases, size requisition and +size allocation, which are implemented by the +size_request() and size_allocate() virtual functions in #GtkWidget. + + +GTK+ also supports a more complicated form of size negotiation called +width-for-height (and its dual +height-for-width). See #GtkExtendedLayout +to learn more about width-for-height geometry management. Size Requisition -The size requisition of a widget is it's desired width and height. +The size requisition of a widget is it's desired width and height. This is represented by a #GtkRequisition. -How a widget determines its desired size depends on the widget. -A #GtkLabel, for example, requests enough space to display all its text. -Container widgets generally base their size request on the requisitions -of their children. +How a widget determines its desired size depends on the widget. +A #GtkLabel, for example, requests enough space to display all its text. +Container widgets generally base their size request on the requisitions +of their children. -The size requisition phase of the widget layout process operates top-down. -It starts at a top-level widget, typically a #GtkWindow. The top-level widget -asks its child for its size requisition by calling gtk_widget_size_request(). -To determine its requisition, the child asks its own children for their -requisitions and so on. Finally, the top-level widget will get a requisition -back from its child. +The size requisition phase of the widget layout process operates top-down. +It starts at a top-level widget, typically a #GtkWindow. The top-level widget +asks its child for its size requisition by calling gtk_widget_size_request(). +To determine its requisition, the child asks its own children for their +requisitions and so on. Finally, the top-level widget will get a requisition +back from its child. Size Allocation -When the top-level widget has determined how much space its child would like -to have, the second phase of the size negotiation, size allocation, begins. -Depending on its configuration (see gtk_window_set_resizable()), the top-level -widget may be able to expand in order to satisfy the size request or it may -have to ignore the size request and keep its fixed size. It then tells its -child widget how much space it gets by calling gtk_widget_size_allocate(). -The child widget divides the space among its children and tells each child -how much space it got, and so on. Under normal circumstances, a #GtkWindow +When the top-level widget has determined how much space its child would like +to have, the second phase of the size negotiation, size allocation, begins. +Depending on its configuration (see gtk_window_set_resizable()), the top-level +widget may be able to expand in order to satisfy the size request or it may +have to ignore the size request and keep its fixed size. It then tells its +child widget how much space it gets by calling gtk_widget_size_allocate(). +The child widget divides the space among its children and tells each child +how much space it got, and so on. Under normal circumstances, a #GtkWindow will always give its child the amount of space the child requested. -A child's size allocation is represented by a #GtkAllocation. This struct -contains not only a width and height, but also a position (i.e. X and Y +A child's size allocation is represented by a #GtkAllocation. This struct +contains not only a width and height, but also a position (i.e. X and Y coordinates), so that containers can tell their children not only how much -space they have gotten, but also where they are positioned inside the space -available to the container. +space they have gotten, but also where they are positioned inside the space +available to the container. -Widgets are required to honor the size allocation they receive; a size +Widgets are required to honor the size allocation they receive; a size request is only a request, and widgets must be able to cope with any size. Child properties -GtkContainer introduces child +GtkContainer introduces child properties - these are object properties that are not specific to either the container or the contained widget, but rather to their relation. Typical examples of child properties are the position or pack-type of a widget which is contained in a #GtkBox. -Use gtk_container_class_install_child_property() to install child properties +Use gtk_container_class_install_child_property() to install child properties for a container class and gtk_container_class_find_child_property() or gtk_container_class_list_child_properties() to get information about existing child properties. -To set the value of a child property, use gtk_container_child_set_property(), -gtk_container_child_set() or gtk_container_child_set_valist(). -To obtain the value of a child property, use +To set the value of a child property, use gtk_container_child_set_property(), +gtk_container_child_set() or gtk_container_child_set_valist(). +To obtain the value of a child property, use gtk_container_child_get_property(), gtk_container_child_get() or -gtk_container_child_get_valist(). To emit notification about child property +gtk_container_child_get_valist(). To emit notification about child property changes, use gtk_widget_child_notify(). @@ -107,7 +114,7 @@ changes, use gtk_widget_child_notify(). GtkContainer as GtkBuildable -The GtkContainer implementation of the GtkBuildable interface +The GtkContainer implementation of the GtkBuildable interface supports a <packing> element for children, which can contain multiple <property> elements that specify child properties for the child. @@ -140,6 +147,9 @@ for regular properties. + + + @@ -206,20 +216,12 @@ This macro should be used to emit a standard warning about unexpected properties in set_child_property() and get_child_property() implementations. -@object: the #GObject on which set_child_property() or get_child_property() +@object: the #GObject on which set_child_property() or get_child_property() was called @property_id: the numeric id of the property @pspec: the #GParamSpec of the property - - -Does the same as gtk_container_set_border_width(). - - -@Deprecated: Use gtk_container_set_border_width() instead. - - @@ -285,27 +287,6 @@ Does the same as gtk_container_set_border_width(). @callback_data: - - - - - -@container: -@callback: -@marshal: -@callback_data: -@notify: -@Deprecated: Use gtk_container_foreach() instead. - - - - -Does the same as gtk_container_get_children(). - - -@Deprecated: Use gtk_container_get_children() instead. - - diff --git a/docs/reference/gtk/tmpl/gtkctree.sgml b/docs/reference/gtk/tmpl/gtkctree.sgml deleted file mode 100644 index 370120efe2..0000000000 --- a/docs/reference/gtk/tmpl/gtkctree.sgml +++ /dev/null @@ -1,1260 +0,0 @@ - -GtkCTree - - -A widget displaying a hierarchical tree - - - -The #GtkCTree widget is used for showing a hierarchical tree -to the user, for example a directory tree. - - -The tree is internally represented as a set of #GtkCTreeNode structures. - - -The interface has much in common with the #GtkCList widget: rows (nodes) -can be selected by the user etc. - - -Positions in the tree are often indicated by two arguments, a -parent and a sibling, both #GtkCTreeNode pointers. If the parent -is %NULL, the position is at the root of the tree and if the sibling -is %NULL, it will be the last child of parent, otherwise it will be -inserted just before the sibling. - - -GtkCTree has been deprecated since GTK+ 2.0 and should not be used -in newly written code. Use #GtkTreeView instead. - - - - - - - - - - - - -The #GtkCTree-struct contains the following user-accessible fields. -These fields should be considered read-only; to set the values, -use the methods below. - - - - - - -#gint tree_indent; -The number of pixels each successive level of the tree is -indented in the display. - - - -#gint tree_spacing; -The space in pixels between the graphical tree and the text in the -node. - - - -#gint tree_column; -The index of the column for which the tree graphics is drawn. - - - -#GtkCTreeLineStyle line_style; -The style in which the lines in the tree graphics are drawn. - - - -#GtkCTreeExpanderStyle expander_style; -The style in which the expander buttons are drawn. - - - -#GtkCTreeExpanderStyle expander_style; -FIXME. - - - - - - - - -The row which has the focus is either collapsed or expanded -or toggled. - - -@ctree: the object which received the signal. -@expansion: What is being done. - - - -Emitted when a node is collapsed. - - -@ctree: the object which received the signal. -@node: - - - -Emitted when a node is expanded. - - -@ctree: the object which received the signal. -@node: - - - -Emitted when a node is moved. - - -@ctree: the object which received the signal. -@node: The node that is moved. -@new_parent: The new parent of the node. -@new_sibling: The new sibling of the node. - - - -Emitted when a row is selected. - - -@ctree: the object which received the signal. -@node: The node corresponding to the selected row. -@column: The column which was selected. - - - -Emitted when a node is unselected. - - -@ctree: the object which received the signal. -@node: The node corresponding to the selected row. -@column: - - - -The style of the expander buttons. - - - - -The number of pixels to indent the tree levels. - - - - -The style of the lines in the tree graphic. - - - - -The number of columns in the tree. - - - - -FIXME - - - - -The number of pixels between the tree and the columns. - - - - -The column in which the actual tree graphic appears. - - - - -Used to get the #GtkCTreeRow structure corresponding to the given #GtkCTreeNode. - - -@_node_: - - - - - - - -@_node_: - - - - -FIXME - - -@_nnode_: - - - - -FIXME - - -@_pnode_: - - - - - - - -@_func_: - - - - -A value specifying the position of a new node relative to an old one. - - - - - - -GTK_CTREE_POS_BEFORE -As a sibling, before the specified node. - - - -GTK_CTREE_POS_AS_CHILD -As a child of the specified node. - - - -GTK_CTREE_POS_AFTER -As a sibling, after the specified node. - - - - - - -@GTK_CTREE_POS_BEFORE: -@GTK_CTREE_POS_AS_CHILD: -@GTK_CTREE_POS_AFTER: - - - -The appearance of the lines in the tree graphics. - - - - - - -GTK_CTREE_LINES_NONE -No lines. - - - -GTK_CTREE_LINES_SOLID -Solid lines. - - - -GTK_CTREE_LINES_DOTTED -Dotted lines. - - - -GTK_CTREE_LINES_TABBED -FIXME. - - - - - - - -@GTK_CTREE_LINES_NONE: -@GTK_CTREE_LINES_SOLID: -@GTK_CTREE_LINES_DOTTED: -@GTK_CTREE_LINES_TABBED: - - - -The appearance of the expander buttons, i.e. the small buttons -which expand or contract parts of the tree when pressed. - - - - - - - -GTK_CTREE_EXPANDER_NONE -No expanders. - - - -GTK_CTREE_EXPANDER_SQUARE -Square expanders. - - - -GTK_CTREE_EXPANDER_TRIANGLE -Triangular expanders. - - - -GTK_CTREE_EXPANDER_CIRCULAR -Round expanders. - - - - - - - -@GTK_CTREE_EXPANDER_NONE: -@GTK_CTREE_EXPANDER_SQUARE: -@GTK_CTREE_EXPANDER_TRIANGLE: -@GTK_CTREE_EXPANDER_CIRCULAR: - - - -How to expand or collapse a part of a tree. - - - - - - -GTK_CTREE_EXPANSION_EXPAND -Expand this node. - - - -GTK_CTREE_EXPANSION_EXPAND_RECURSIVE -Expand this node and everything below it in the hierarchy. - - - -GTK_CTREE_EXPANSION_COLLAPSE -Collapse this node. - - - -GTK_CTREE_EXPANSION_COLLAPSE_RECURSIVE -Collapse this node and everything below it in the hierarchy. - - - -GTK_CTREE_EXPANSION_TOGGLE -Toggle this node (i.e. expand if collapsed and vice versa). - - - -GTK_CTREE_EXPANSION_TOGGLE_RECURSIVE -Toggle this node and everything below it in the hierarchy. - - - - - - - - -@GTK_CTREE_EXPANSION_EXPAND: -@GTK_CTREE_EXPANSION_EXPAND_RECURSIVE: -@GTK_CTREE_EXPANSION_COLLAPSE: -@GTK_CTREE_EXPANSION_COLLAPSE_RECURSIVE: -@GTK_CTREE_EXPANSION_TOGGLE: -@GTK_CTREE_EXPANSION_TOGGLE_RECURSIVE: - - - -A generic callback type to do something with a particular node. - - -@ctree: The #GtkCTree object. -@node: The #GtkCTreeNode in the tree. -@data: The user data associated with the node. - - - - -FIXME - - -@ctree: -@depth: -@gnode: -@cnode: -@data: -@Returns: - - - - -FIXME - - -@ctree: -@source_node: -@new_parent: -@new_sibling: -@Returns: - - - - -A structure representing a single row in the tree graph. -The values inside the structure should be considered read-only. -This structure is derived from the #GtkCListRow structure. - - - - - - -#GtkCTreeNode *parent; -The parent node of the node corresponding to this row. - - - - -#GtkCTreeNode *sibling; -The next sibling node of the node corresponding to this row. - - - - -#GtkCTreeNode *children; -The first child node corresponding to this row; to access -the other children, just use the siblings of that node. - - - - -#GdkPixmap *pixmap_closed; - The pixmap to be shown when the node is collapsed. - - - - -#GdkBitmap *mask_closed; - The mask for the above pixmap. - - - - -#GdkPixmap *pixmap_opened; - The pixmap to be shown when the node is expanded. - - - - -#GdkBitmap *mask_opened; - The mask for the above pixmap. - - - - -#guint16 level; -The level of this node in the tree. - - - - - -#guint is_leaf : 1; -Whether this row is a leaf. - - - - -#guint expanded : 1; -Whether the children of this row are visible. - - - - - - -@row: -@parent: -@sibling: -@children: -@pixmap_closed: -@mask_closed: -@pixmap_opened: -@mask_opened: -@level: -@is_leaf: -@expanded: - - - -This structure is opaque - you should use the -macros #GTK_CTREE_ROW, #GTK_CTREE_NODE_NEXT etc. as well -as the functions below to access it. - - -@list: - - - - - - - - - - -Create a new #GtkCTree widget with the given titles for the columns. - - -@columns: Number of columns. -@tree_column: Which column has the tree graphic; 0 = leftmost. -@titles: The titles for the columns. -@Returns: The #GtkCTree widget. - - - - -Create a new #GtkCTree widget. - - -@columns: Number of columns. -@tree_column: Which columns has the tree graphic. -@Returns: The new #GtkCTree widget. - - - - -Insert a new node to the tree. The position is specified through -the parent-sibling notation, as explained in the introduction above. - - -@ctree: The #GtkCTree widget. -@parent: The parent node to be. -@sibling: The sibling node to be. -@text: The texts to be shown in each column. -@spacing: The extra space between the pixmap and the text. -@pixmap_closed: The pixmap to be used when the node is collapsed. Can be %NULL. -@mask_closed: The mask for the above pixmap. Can be %NULL. -@pixmap_opened: The pixmap to be used when the children are visible. Can be %NULL. -@mask_opened: The mask for the above pixmap. Can be %NULL. -@is_leaf: Whether this node is going to be a leaf. -@expanded: Whether this node should start out expanded or not. -@Returns: - - - - -Remove the node and all nodes underneath it from the tree. - - -@ctree: The widget. -@node: The node to be removed. - - - - -FIXME - - -@ctree: -@parent: -@sibling: -@gnode: -@func: -@data: -@Returns: - - - - -FIXME - - -@ctree: -@parent: -@sibling: -@node: -@func: -@data: -@Returns: - - - - -Recursively apply a function to all nodes of the tree at or below a certain -node. -The function is called for each node after it has been called -for that node's children. - - -@ctree: -@node: The node where to start. %NULL means to start at the root. -@func: The function to apply to each node. -@data: A closure argument given to each invocation of the function. - - - - -Recursively apply a function to nodes up to a certain depth. -The function is called for each node after it has been called -for that node's children. - - -@ctree: -@node: The node where to start. -@depth: The maximum absolute depth for applying the function. If depth is negative, this function just calls #gtk_ctree_post_recursive. -@func: The function to apply to each node. -@data: A closure argument given to each invocation of the function. - - - - -Recursively apply a function to all nodes of the tree at or below a certain -node. -The function is called for each node after it has been called -for its parent. - - -@ctree: -@node: The node where to start. %NULL means to start at the root. -@func: The function to apply to each node. -@data: A closure argument given to each invocation of the function. - - - - -Recursively apply a function to nodes up to a certain depth. -The function is called for each node after it has been called -for that node's children. - - -@ctree: -@node: The node where to start. -@depth: The maximum absolute depth for applying the function. If depth is negative, this function just calls #gtk_ctree_post_recursive. -@func: The function to apply to each node. -@data: A closure argument given to each invocation of the function. - - - - -This function checks whether the given node is viewable i.e. so that -all of its parent nodes are expanded. This is different from being -actually visible: the node can be viewable but outside the scrolling -area of the window. - - -@ctree: -@node: -@Returns: Whether the node is viewable. - - - - -Returns the last child of the last child of the last child... -of the given node. - - -@ctree: -@node: -@Returns: - - - - -Finds the node pointer given a #GtkCTreeRow structure. - - -@ctree: -@ctree_row: -@Returns: The node pointer. - - - - - - - -@ctree: -@node: The node to start searching from. May be %NULL. -@child: -@Returns: True if @child is on some level a child (grandchild...) of the @node. - - - - - - - -@ctree: -@node: -@child: -@Returns: True is @node is an ancestor of @child. - - - - -Finds a node in the tree under @node that has the given user data pointer. - - -@ctree: -@node: -@data: -@Returns: The node, or %NULL if not found. - - - - -Finds all nodes in the tree under @node that have the given user data pointer. - - -@ctree: -@node: -@data: -@Returns: A list of nodes that have the given data pointer. - - - - -Find the first node under @node whose row data pointer fulfills -a custom criterion. - - -@ctree: -@node: The node where to start searching. -@data: User data for the criterion function. -@func: The criterion function. -@Returns: The first node found. - - - - -Find all nodes under @node whose row data pointer fulfills -a custom criterion. - - - -@ctree: -@node: The node where to start searching. -@data: User data for the criterion function. -@func: The criterion function. -@Returns: A list of all nodes found. - - - - - - -@ctree: -@x: -@y: -@Returns: True if the given coordinates lie on an expander button. - - - - -Move a node in the tree to another location. - - -@ctree: -@node: The node to be moved. -@new_parent: The new parent-to-be of the node. -@new_sibling: The new sibling-to-be of the node. - - - - -Expand one node. - - -@ctree: -@node: - - - - -Expand one node and all nodes underneath. - - -@ctree: -@node: - - - - -Expand a node and its children up to the depth given. - - -@ctree: -@node: -@depth: The (absolute) depth up to which to expand nodes. - - - - -Collapse one node. - - -@ctree: -@node: - - - - -Collapse one node and all its subnodes. - - -@ctree: -@node: - - - - -Collapse a node and its children up to the depth given. - - -@ctree: -@node: -@depth: The (absolute) depth up to which to collapse nodes. - - - - -Toggle a node, i.e. if it is collapsed, expand it and vice versa. - - -@ctree: -@node: - - - - -Toggle the expansion of a node and all its children. - - -@ctree: -@node: - - - - -Cause the given node to be selected and emit the appropriate signal. - - -@ctree: -@node: - - - - -Cause the given node and its subnodes to be selected and emit the appropriate signal(s). - - -@ctree: -@node: - - - - -Unselect the given node and emit the appropriate signal. - - -@ctree: -@node: - - - - -Unselect the given node and its subnodes and emit the appropriate signal(s). - - -@ctree: -@node: - - - - -The function that implements both #gtk_ctree_select_recursive and -#gtk_ctree_unselect_recursive. - - -@ctree: -@node: -@state: True for selecting, false for unselecting. - - - - -Set the text in a node. - - -@ctree: -@node: -@column: The column whose text to change. -@text: The new text. - - - - -FIXME - - -@ctree: -@node: -@column: -@pixmap: -@mask: - - - - -FIXME - - -@ctree: -@node: -@column: -@text: -@spacing: -@pixmap: -@mask: - - - - -Change the information. Most parameters correspond -to the parameters of #gtk_ctree_insert_node. - - -@ctree: -@node: -@text: The text to be in the tree column. -@spacing: -@pixmap_closed: -@mask_closed: -@pixmap_opened: -@mask_opened: -@is_leaf: -@expanded: - - - - -Shift the given cell the given amounts in pixels. - - -@ctree: -@node: -@column: -@vertical: -@horizontal: - - - - - - - -@ctree: -@node: -@selectable: Whether this node can be selected by the user. - - - - - - - -@ctree: -@node: -@Returns: Whether this node can be selected by the user. - - - - - - - -@ctree: -@node: -@column: -@Returns: The type of the given cell. - - - - - - - -@ctree: -@node: -@column: -@text: If nonnull, the pointer to the text string is assigned to *@text. -@Returns: True if the given cell has text in it. - - - - - - - -@ctree: -@node: -@column: -@pixmap: If nonnull, the pointer to the pixmap is returned through this. -@mask: If nonnull, the pointer to the mask is returned through this. -@Returns: True if the given cell contains a pixmap. - - - - -Get the parameters of a cell containing both a pixmap and text. - - -@ctree: -@node: -@column: -@text: -@spacing: -@pixmap: -@mask: -@Returns: - - - - -Get information corresponding to a node. -Any of the return parameters can be null. - - -@ctree: -@node: -@text: -@spacing: -@pixmap_closed: -@mask_closed: -@pixmap_opened: -@mask_opened: -@is_leaf: -@expanded: -@Returns: - - - - -Set the style of a row. - - -@ctree: -@node: -@style: - - - - -Get the style of a row. - - -@ctree: -@node: -@Returns: - - - - -Set the style of an individual cell. - - -@ctree: -@node: -@column: -@style: - - - - -Get the style of an individual cell. - - -@ctree: -@node: -@column: -@Returns: - - - - - - - -@ctree: -@node: -@color: - - - - - - - -@ctree: -@node: -@color: - - - - -Set the custom data associated with a node. - - -@ctree: -@node: -@data: - - - - -This is the full interface to setting row data, so that a destructor -can be given for the data. - - -@ctree: -@node: -@data: -@destroy: The routine to be called when @data is no longer needed. - - - - - - - -@ctree: -@node: -@Returns: - - - - -This function makes the given column of the given node visible by -scrolling. - - -@ctree: -@node: The node to be made visible. -@column: The column to be made visible. -@row_align: Where in the window the row should appear. -@col_align: Where in the window the column should appear. - - - - - - - -@ctree: -@node: -@Returns: True if the node is currently inside the bounds of the window. -Note that this function can return true even if the node is not -viewable, if the node's ancestor is visible. - - - - - - - -@ctree: -@indent: The number of pixels to shift the levels of the tree. - - - - -The spacing between the tree graphic and the actual node content. - - -@ctree: -@spacing: - - - - - - - -@t: -@r: - - - - - - - -@ctree: -@line_style: - - - - - - - -@ctree: -@expander_style: - - - - -FIXME - - -@ctree: -@cmp_func: - - - - -Sort the children of a node. See #GtkCList for how to set the sorting -criteria etc. - - -@ctree: -@node: - - - - -Sort the descendants of a node. See #GtkCList for how to set the sorting -criteria etc. - - -@ctree: -@node: - - - - - - - -@ctree: -@row: -@Returns: The node corresponding to the @row th row. - - - - - - - -@ctree: -@show_stub: - - diff --git a/docs/reference/gtk/tmpl/gtkcurve.sgml b/docs/reference/gtk/tmpl/gtkcurve.sgml deleted file mode 100644 index c2e2b407d1..0000000000 --- a/docs/reference/gtk/tmpl/gtkcurve.sgml +++ /dev/null @@ -1,163 +0,0 @@ - -GtkCurve - - -Allows direct editing of a curve - - - -The #GtkCurve widget allows the user to edit a curve covering a range of -values. It is typically used to fine-tune color balances in graphics -applications like the Gimp. - - -The #GtkCurve widget has 3 modes of operation - spline, linear and free. -In spline mode the user places points on the curve which are automatically -connected together into a smooth curve. In linear mode the user places points -on the curve which are connected by straight lines. In free mode the user can -draw the points of the curve freely, and they are not connected at all. - - -As of GTK+ 2.20, #GtkCurve has been deprecated since it is too specialized. - - - - - - -#GtkGammaCurve -a subclass for editing gamma curves. - - - - - - - - - - - -The #GtkCurve-struct struct contains private data only, and -should be accessed using the functions below. - - - - - -Emitted when the curve type has been changed. -The curve type can be changed explicitly with a call to -gtk_curve_set_curve_type(). It is also changed as a side-effect of -calling gtk_curve_reset() or gtk_curve_set_gamma(). - - -@curve: the object which received the signal. - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Creates a new #GtkCurve. - - -@Returns: a new #GtkCurve. -@Deprecated: 2.20: Don't use this widget anymore. - - - - -Resets the curve to a straight line from the minimum x and y values to the -maximum x and y values (i.e. from the bottom-left to the top-right corners). -The curve type is not changed. - - -@curve: a #GtkCurve. -@Deprecated: 2.20: Don't use this widget anymore. - - - - -Recomputes the entire curve using the given gamma value. -A gamma value of 1 results in a straight line. Values greater than 1 result -in a curve above the straight line. Values less than 1 result in a curve -below the straight line. The curve type is changed to %GTK_CURVE_TYPE_FREE. -FIXME: Needs a more precise definition of gamma. - - -@curve: a #GtkCurve. -@gamma_: the gamma value. -@Deprecated: 2.20: Don't use this widget anymore. - - - - -Sets the minimum and maximum x and y values of the curve. -The curve is also reset with a call to gtk_curve_reset(). - - -@curve: a #GtkCurve. -@min_x: the minimum x value. -@max_x: the maximum x value. -@min_y: the minimum y value. -@max_y: the maximum y value. -@Deprecated: 2.20: Don't use this widget anymore. - - - - -Returns a vector of points representing the curve. - - -@curve: a #GtkCurve. -@veclen: the number of points to calculate. -@vector: returns the points. -@Deprecated: 2.20: Don't use this widget anymore. - - - - -Sets the vector of points on the curve. -The curve type is set to %GTK_CURVE_TYPE_FREE. - - -@curve: a #GtkCurve. -@veclen: the number of points. -@vector: the points on the curve. -@Deprecated: 2.20: Don't use this widget anymore. - - - - -Sets the type of the curve. The curve will remain unchanged except when -changing from a free curve to a linear or spline curve, in which case the -curve will be changed as little as possible. - - -@curve: a #GtkCurve. -@type: the type of the curve. -@Deprecated: 2.20: Don't use this widget anymore. - - diff --git a/docs/reference/gtk/tmpl/gtkdialog.sgml b/docs/reference/gtk/tmpl/gtkdialog.sgml index ecf4d83f62..32e4878e05 100644 --- a/docs/reference/gtk/tmpl/gtkdialog.sgml +++ b/docs/reference/gtk/tmpl/gtkdialog.sgml @@ -165,6 +165,9 @@ response from the user. + + + vbox is a #GtkVBox - the main part of the @@ -256,6 +259,7 @@ Creates a new dialog box. Widgets should not be packed into this #GtkWindow directly, but into the @vbox and @action_area, as described above. +@void: @Returns: a new #GtkDialog. diff --git a/docs/reference/gtk/tmpl/gtkdnd.sgml b/docs/reference/gtk/tmpl/gtkdnd.sgml index 7d127408d2..5477bff72e 100644 --- a/docs/reference/gtk/tmpl/gtkdnd.sgml +++ b/docs/reference/gtk/tmpl/gtkdnd.sgml @@ -27,6 +27,9 @@ in the #GtkWidget class. + + + The #GtkDestDefaults enumeration specifies the various @@ -321,18 +324,6 @@ a widget. @context: - - - - - -@colormap: -@pixmap: -@mask: -@hot_x: -@hot_y: - - @@ -351,11 +342,11 @@ a widget. -@widget: -@start_button_mask: -@targets: -@n_targets: -@actions: +@widget: +@start_button_mask: +@targets: +@n_targets: +@actions: diff --git a/docs/reference/gtk/tmpl/gtkdrawingarea.sgml b/docs/reference/gtk/tmpl/gtkdrawingarea.sgml index dee937a5d4..1edf19d427 100644 --- a/docs/reference/gtk/tmpl/gtkdrawingarea.sgml +++ b/docs/reference/gtk/tmpl/gtkdrawingarea.sgml @@ -107,6 +107,9 @@ refresh to the screen. + + + The #GtkDrawingArea struct contains private data only, and @@ -119,21 +122,7 @@ should be accessed using the functions below. Creates a new drawing area. +@void: @Returns: a new #GtkDrawingArea - - -Sets the size that the drawing area will request -in response to a "size_request" signal. The -drawing area may actually be allocated a size -larger than this depending on how it is packed -within the enclosing containers. - - -@darea: a #GtkDrawingArea -@width: the width to request -@height: the height to request -@Deprecated: Use gtk_widget_set_size_request() instead. - - diff --git a/docs/reference/gtk/tmpl/gtkeditable.sgml b/docs/reference/gtk/tmpl/gtkeditable.sgml index 6c503aa5cf..18c8490b1c 100644 --- a/docs/reference/gtk/tmpl/gtkeditable.sgml +++ b/docs/reference/gtk/tmpl/gtkeditable.sgml @@ -55,6 +55,9 @@ insert_text_handler (GtkEditable *editable, + + + The #GtkEditable structure is an opaque structure whose members diff --git a/docs/reference/gtk/tmpl/gtkentry.sgml b/docs/reference/gtk/tmpl/gtkentry.sgml index be938a1adc..bac2315995 100644 --- a/docs/reference/gtk/tmpl/gtkentry.sgml +++ b/docs/reference/gtk/tmpl/gtkentry.sgml @@ -67,6 +67,9 @@ via the context menu of the entry. + + + The #GtkEntry-struct struct contains only private data. @@ -411,6 +414,7 @@ The #GtkEntry-struct struct contains only private data. +@void: @Returns: @@ -423,14 +427,6 @@ The #GtkEntry-struct struct contains only private data. @Returns: - - - - -@max: -@Returns: - - @@ -458,33 +454,6 @@ The #GtkEntry-struct struct contains only private data. @text: - - - - - -@entry: -@text: - - - - - - - -@entry: -@text: - - - - - - - -@entry: -@position: - - @@ -503,16 +472,6 @@ The #GtkEntry-struct struct contains only private data. @Returns: - - - - - -@entry: -@start: -@end: - - @@ -539,15 +498,6 @@ The #GtkEntry-struct struct contains only private data. @entry: - - - - - -@entry: -@editable: - - @@ -810,6 +760,24 @@ The #GtkEntry-struct struct contains only private data. @entry: + + + + + +@entry: +@event: +@Returns: + + + + + + + +@entry: + + Specifies the side of the entry at which an icon is placed. diff --git a/docs/reference/gtk/tmpl/gtkentrybuffer.sgml b/docs/reference/gtk/tmpl/gtkentrybuffer.sgml index 712f013153..083da46d07 100644 --- a/docs/reference/gtk/tmpl/gtkentrybuffer.sgml +++ b/docs/reference/gtk/tmpl/gtkentrybuffer.sgml @@ -17,6 +17,9 @@ GtkEntryBuffer + + + diff --git a/docs/reference/gtk/tmpl/gtkentrycompletion.sgml b/docs/reference/gtk/tmpl/gtkentrycompletion.sgml index 611b96f3cd..b0422c1311 100644 --- a/docs/reference/gtk/tmpl/gtkentrycompletion.sgml +++ b/docs/reference/gtk/tmpl/gtkentrycompletion.sgml @@ -46,6 +46,9 @@ selected, the ::action-activated signal is emitted. + + + The GtkEntryCompletion struct contains only private data. @@ -150,6 +153,7 @@ to the unmodified key via gtk_entry_get_text (GTK_ENTRY (gtk_entry_comp +@void: @Returns: diff --git a/docs/reference/gtk/tmpl/gtkenums.sgml b/docs/reference/gtk/tmpl/gtkenums.sgml index 3b72290bd4..579e1c0274 100644 --- a/docs/reference/gtk/tmpl/gtkenums.sgml +++ b/docs/reference/gtk/tmpl/gtkenums.sgml @@ -17,6 +17,9 @@ Public enumerated types used throughout GTK+ + + + @@ -111,15 +114,6 @@ widget. @GTK_CORNER_BOTTOM_RIGHT: Place the scrollbars on the top and left of the widget. - - - - - -@GTK_CURVE_TYPE_LINEAR: -@GTK_CURVE_TYPE_SPLINE: -@GTK_CURVE_TYPE_FREE: - @@ -185,18 +179,6 @@ Used for justifying the text inside a #GtkLabel widget. (See also @GTK_JUSTIFY_CENTER: The text is placed in the center of the label. @GTK_JUSTIFY_FILL: The text is placed is distributed across the label. - - - - - -@GTK_MATCH_ALL: -@GTK_MATCH_ALL_TAIL: -@GTK_MATCH_HEAD: -@GTK_MATCH_TAIL: -@GTK_MATCH_EXACT: -@GTK_MATCH_LAST: - Used to indicate which metric is used by a #GtkRuler. @@ -283,15 +265,6 @@ tabs of a #GtkNotebook, the handle of a #GtkHandleBox or the label of a @GTK_POS_TOP: The feature is at the top edge. @GTK_POS_BOTTOM: The feature is at the bottom edge. - - -An enumeration which describes whether a preview -contains grayscale or red-green-blue data. - - -@GTK_PREVIEW_COLOR: the preview contains red-green-blue data. -@GTK_PREVIEW_GRAYSCALE: The preview contains grayscale data. - Indicated the relief to be drawn around a #GtkButton. @@ -374,16 +347,6 @@ Used to change the appearance of an outline typically provided by a #GtkFrame. @GTK_SHADOW_ETCHED_IN: The outline has a sunken 3d appearance. @GTK_SHADOW_ETCHED_OUT: The outline has a raised 3d appearance - - - - - -@GTK_SIDE_TOP: -@GTK_SIDE_BOTTOM: -@GTK_SIDE_LEFT: -@GTK_SIDE_RIGHT: - This type indicates the current state of a widget; the state determines how diff --git a/docs/reference/gtk/tmpl/gtkeventbox.sgml b/docs/reference/gtk/tmpl/gtkeventbox.sgml index fdcec8f94d..66bbeea422 100644 --- a/docs/reference/gtk/tmpl/gtkeventbox.sgml +++ b/docs/reference/gtk/tmpl/gtkeventbox.sgml @@ -19,6 +19,9 @@ have their own window. + + + The #GtkEventBox-struct struct contains private data only, and @@ -41,6 +44,7 @@ should be accessed using the functions below. Creates a new #GtkEventBox. +@void: @Returns: a new #GtkEventBox. diff --git a/docs/reference/gtk/tmpl/gtkexpander.sgml b/docs/reference/gtk/tmpl/gtkexpander.sgml index 4a62060257..402ef58184 100644 --- a/docs/reference/gtk/tmpl/gtkexpander.sgml +++ b/docs/reference/gtk/tmpl/gtkexpander.sgml @@ -89,6 +89,9 @@ a <child> type attribute. + + + diff --git a/docs/reference/gtk/tmpl/gtkfeatures.sgml b/docs/reference/gtk/tmpl/gtkfeatures.sgml index d40fa257f0..16e0adddc5 100644 --- a/docs/reference/gtk/tmpl/gtkfeatures.sgml +++ b/docs/reference/gtk/tmpl/gtkfeatures.sgml @@ -19,6 +19,9 @@ typically use the features described here. + + + The major version number of the GTK+ library. (e.g. in GTK+ version diff --git a/docs/reference/gtk/tmpl/gtkfilechooserbutton.sgml b/docs/reference/gtk/tmpl/gtkfilechooserbutton.sgml index e8ab8c92e2..6042343797 100644 --- a/docs/reference/gtk/tmpl/gtkfilechooserbutton.sgml +++ b/docs/reference/gtk/tmpl/gtkfilechooserbutton.sgml @@ -51,6 +51,9 @@ such a way that other interface elements give space to the widget. + + + This should not be accessed directly. Use the accessor functions below. @@ -94,17 +97,6 @@ This should not be accessed directly. Use the accessor functions below. @Returns: - - - - - -@title: -@action: -@backend: -@Returns: - - diff --git a/docs/reference/gtk/tmpl/gtkfilechooserdialog.sgml b/docs/reference/gtk/tmpl/gtkfilechooserdialog.sgml index 4ed335f234..cc798bcb5f 100644 --- a/docs/reference/gtk/tmpl/gtkfilechooserdialog.sgml +++ b/docs/reference/gtk/tmpl/gtkfilechooserdialog.sgml @@ -150,6 +150,9 @@ dialog = gtk_file_chooser_dialog_new ("Open File", + + + @@ -169,25 +172,3 @@ dialog = gtk_file_chooser_dialog_new ("Open File", @Returns: - - - - - -@title: -@parent: -@action: -@backend: -@first_button_text: -@Varargs: -@Returns: - - - - - diff --git a/docs/reference/gtk/tmpl/gtkfilechooserwidget.sgml b/docs/reference/gtk/tmpl/gtkfilechooserwidget.sgml index 082bf46efa..434d70967d 100644 --- a/docs/reference/gtk/tmpl/gtkfilechooserwidget.sgml +++ b/docs/reference/gtk/tmpl/gtkfilechooserwidget.sgml @@ -27,6 +27,9 @@ File chooser widget that can be embedded in other widgets + + + @@ -52,13 +55,3 @@ End: --> - - - - - -@action: -@backend: -@Returns: - - diff --git a/docs/reference/gtk/tmpl/gtkfilefilter.sgml b/docs/reference/gtk/tmpl/gtkfilefilter.sgml index 6bc5e54c7e..4f22a3cca7 100644 --- a/docs/reference/gtk/tmpl/gtkfilefilter.sgml +++ b/docs/reference/gtk/tmpl/gtkfilefilter.sgml @@ -35,6 +35,9 @@ to manually use a filter on a file with gtk_file_filter_filter(). + + + The GtkFileFilter struct contains @@ -86,6 +89,7 @@ see gtk_file_filter_add_custom(). +@void: @Returns: diff --git a/docs/reference/gtk/tmpl/gtkfixed.sgml b/docs/reference/gtk/tmpl/gtkfixed.sgml index add592d9d1..b2366aa2fd 100644 --- a/docs/reference/gtk/tmpl/gtkfixed.sgml +++ b/docs/reference/gtk/tmpl/gtkfixed.sgml @@ -67,6 +67,9 @@ widget. But you should be aware of the tradeoffs. + + + The #GtkFixed-struct struct contains the following fields. @@ -102,6 +105,7 @@ their positions. Creates a new #GtkFixed. +@void: @Returns: a new #GtkFixed. @@ -127,21 +131,3 @@ Moves a child of a #GtkFixed container to the given position. @y: the vertical position to move the widget to. - - - - - -@fixed: -@Returns: - - - - - - - -@fixed: -@has_window: - - diff --git a/docs/reference/gtk/tmpl/gtkfontbutton.sgml b/docs/reference/gtk/tmpl/gtkfontbutton.sgml index 1eda98ee41..ca8253d7cf 100644 --- a/docs/reference/gtk/tmpl/gtkfontbutton.sgml +++ b/docs/reference/gtk/tmpl/gtkfontbutton.sgml @@ -18,6 +18,9 @@ dialog to change the font. It is suitable widget for selecting a font in a prefe + + + The GtkFontButton struct has only private members and should not be used @@ -67,6 +70,7 @@ directly. +@void: @Returns: diff --git a/docs/reference/gtk/tmpl/gtkfontsel.sgml b/docs/reference/gtk/tmpl/gtkfontsel.sgml index d182606e45..ce3ebf3005 100644 --- a/docs/reference/gtk/tmpl/gtkfontsel.sgml +++ b/docs/reference/gtk/tmpl/gtkfontsel.sgml @@ -38,6 +38,9 @@ gtk_font_selection_set_preview_text(). + + + The #GtkFontSelection struct contains private data only, and should @@ -65,15 +68,7 @@ only be accessed using the functions below. -@Returns: - - - - - - - -@fontsel: +@void: @Returns: diff --git a/docs/reference/gtk/tmpl/gtkfontseldlg.sgml b/docs/reference/gtk/tmpl/gtkfontseldlg.sgml index c8c5ad2aaf..6e98aa7992 100644 --- a/docs/reference/gtk/tmpl/gtkfontseldlg.sgml +++ b/docs/reference/gtk/tmpl/gtkfontseldlg.sgml @@ -48,6 +48,9 @@ fonts. + + + @@ -61,15 +64,6 @@ fonts. @Returns: - - - - - -@fsd: -@Returns: - - @@ -106,15 +100,6 @@ fonts. @text: - - - - - -@fsd: -@Returns: - - diff --git a/docs/reference/gtk/tmpl/gtkframe.sgml b/docs/reference/gtk/tmpl/gtkframe.sgml index 1f1d9b0204..92eab9b941 100644 --- a/docs/reference/gtk/tmpl/gtkframe.sgml +++ b/docs/reference/gtk/tmpl/gtkframe.sgml @@ -45,6 +45,9 @@ a <child> type attribute. + + + diff --git a/docs/reference/gtk/tmpl/gtkgamma.sgml b/docs/reference/gtk/tmpl/gtkgamma.sgml deleted file mode 100644 index 29d0900e2b..0000000000 --- a/docs/reference/gtk/tmpl/gtkgamma.sgml +++ /dev/null @@ -1,47 +0,0 @@ - -GtkGammaCurve - - -A subclass of GtkCurve for editing gamma curves - - - -The #GtkGammaCurve widget is a variant of #GtkCurve specifically for -editing gamma curves, which are used in graphics applications such as the -Gimp. - - -The #GtkGammaCurve widget shows a curve which the user can edit with the -mouse just like a #GtkCurve widget. On the right of the curve it also displays -5 buttons, 3 of which change between the 3 curve modes (spline, linear and -free), and the other 2 set the curve to a particular gamma value, or reset it -to a straight line. - - -As of GTK+ 2.20, #GtkGammaCurve has been deprecated since it is too specialized. - - - - - - - - - - - - -The #GtkGammaCurve struct contains private data only, and -should be accessed using the functions below. - - - - - -Creates a new #GtkGammaCurve. - - -@Returns: a new #GtkGammaCurve. -@Deprecated: 2.20: Don't use this widget anymore. - - diff --git a/docs/reference/gtk/tmpl/gtkgc.sgml b/docs/reference/gtk/tmpl/gtkgc.sgml index 57d738b576..d5f5ee0aa7 100644 --- a/docs/reference/gtk/tmpl/gtkgc.sgml +++ b/docs/reference/gtk/tmpl/gtkgc.sgml @@ -21,6 +21,9 @@ When the #GdkGC is no longer needed, gtk_gc_release() should be called. + + + Gets a #GdkGC with the given depth, colormap and #GdkGCValues. diff --git a/docs/reference/gtk/tmpl/gtkhandlebox.sgml b/docs/reference/gtk/tmpl/gtkhandlebox.sgml index 8b3cae2938..dea4867a1c 100644 --- a/docs/reference/gtk/tmpl/gtkhandlebox.sgml +++ b/docs/reference/gtk/tmpl/gtkhandlebox.sgml @@ -39,6 +39,9 @@ so the snap edge should be set to %GTK_POS_BOTTOM. + + + The #GtkHandleBox-struct struct contains the following fields. @@ -137,6 +140,7 @@ handlebox are detached from the main window. Create a new handle box. +@void: @Returns: a new #GtkHandleBox. diff --git a/docs/reference/gtk/tmpl/gtkhbbox.sgml b/docs/reference/gtk/tmpl/gtkhbbox.sgml index af611bd2a4..1fd2dcc9f7 100644 --- a/docs/reference/gtk/tmpl/gtkhbbox.sgml +++ b/docs/reference/gtk/tmpl/gtkhbbox.sgml @@ -48,6 +48,9 @@ gtk_button_box_set_layout(). + + + GtkHButtonBox does not contain any public fields. @@ -59,40 +62,7 @@ GtkHButtonBox does not contain any public fields. Creates a new horizontal button box. +@void: @Returns: a new button box #GtkWidget. - - -Retrieves the current default spacing for horizontal button boxes. This is the number of pixels -to be placed between the buttons when they are arranged. - - -@Returns: the default number of pixels between buttons. - - - - -Retrieves the current layout used to arrange buttons in button box widgets. - - -@Returns: the current #GtkButtonBoxStyle. - - - - -Changes the default spacing that is placed between widgets in an -horizontal button box. - - -@spacing: an integer value. - - - - -Sets a new layout mode that will be used by all button boxes. - - -@layout: a new #GtkButtonBoxStyle. - - diff --git a/docs/reference/gtk/tmpl/gtkhbox.sgml b/docs/reference/gtk/tmpl/gtkhbox.sgml deleted file mode 100644 index 8af4c505d6..0000000000 --- a/docs/reference/gtk/tmpl/gtkhbox.sgml +++ /dev/null @@ -1,49 +0,0 @@ - -GtkHBox - - -A horizontal container box - - - -GtkHBox is a container that organizes child widgets into a single row. - - - -Use the #GtkBox packing interface to determine the arrangement, -spacing, width, and alignment of GtkHBox children. - - - -All children are allocated the same height. - - - - - - - -#GtkVBox -a sister class that organizes widgets into a column. - - - - - - - - - - - - - - -Creates a new GtkHBox. - - -@homogeneous: %TRUE if all children are to be given equal space allotments. -@spacing: the number of pixels to place by default between children. -@Returns: a new GtkHBox. - - diff --git a/docs/reference/gtk/tmpl/gtkhpaned.sgml b/docs/reference/gtk/tmpl/gtkhpaned.sgml index df98d308fb..25fd0333b5 100644 --- a/docs/reference/gtk/tmpl/gtkhpaned.sgml +++ b/docs/reference/gtk/tmpl/gtkhpaned.sgml @@ -20,6 +20,9 @@ a handle. See #GtkPaned for details. + + + @@ -30,6 +33,7 @@ a handle. See #GtkPaned for details. Create a new #GtkHPaned +@void: @Returns: the new #GtkHPaned diff --git a/docs/reference/gtk/tmpl/gtkhruler.sgml b/docs/reference/gtk/tmpl/gtkhruler.sgml index ea2cd508fd..433dd1637c 100644 --- a/docs/reference/gtk/tmpl/gtkhruler.sgml +++ b/docs/reference/gtk/tmpl/gtkhruler.sgml @@ -33,6 +33,9 @@ rulers. + + + The #GtkHRuler struct contains private data and should be accessed @@ -45,6 +48,7 @@ with the functions below. Creates a new horizontal ruler. +@void: @Returns: a new #GtkHRuler. diff --git a/docs/reference/gtk/tmpl/gtkhscale.sgml b/docs/reference/gtk/tmpl/gtkhscale.sgml index edd4611d66..8616ef83c7 100644 --- a/docs/reference/gtk/tmpl/gtkhscale.sgml +++ b/docs/reference/gtk/tmpl/gtkhscale.sgml @@ -22,6 +22,9 @@ shown can be set using the parent #GtkScale class's functions. + + + The #GtkHScale-struct struct contains private data only, and diff --git a/docs/reference/gtk/tmpl/gtkhscrollbar.sgml b/docs/reference/gtk/tmpl/gtkhscrollbar.sgml index 574e851fa2..6412e07dba 100644 --- a/docs/reference/gtk/tmpl/gtkhscrollbar.sgml +++ b/docs/reference/gtk/tmpl/gtkhscrollbar.sgml @@ -23,6 +23,9 @@ fields in an adjustment represent for a scrollbar. + + + The #GtkHScrollbar struct contains private data and should be accessed diff --git a/docs/reference/gtk/tmpl/gtkhseparator.sgml b/docs/reference/gtk/tmpl/gtkhseparator.sgml index 9a4ebd8c0c..9e295cb858 100644 --- a/docs/reference/gtk/tmpl/gtkhseparator.sgml +++ b/docs/reference/gtk/tmpl/gtkhseparator.sgml @@ -32,6 +32,9 @@ gtk_menu_shell_append(). + + + The #GtkHSeparator-struct struct contains private data only, and @@ -44,6 +47,7 @@ should be accessed using the functions below. Creates a new #GtkHSeparator. +@void: @Returns: a new #GtkHSeparator. diff --git a/docs/reference/gtk/tmpl/gtkhsv.sgml b/docs/reference/gtk/tmpl/gtkhsv.sgml index 999a74347b..ee952c966d 100644 --- a/docs/reference/gtk/tmpl/gtkhsv.sgml +++ b/docs/reference/gtk/tmpl/gtkhsv.sgml @@ -30,6 +30,9 @@ saturation. + + + @@ -56,6 +59,7 @@ saturation. +@void: @Returns: diff --git a/docs/reference/gtk/tmpl/gtkiconfactory.sgml b/docs/reference/gtk/tmpl/gtkiconfactory.sgml index 6c716e0a3b..614b50edbd 100644 --- a/docs/reference/gtk/tmpl/gtkiconfactory.sgml +++ b/docs/reference/gtk/tmpl/gtkiconfactory.sgml @@ -114,6 +114,9 @@ This attribute is optional. + + + @@ -204,6 +207,7 @@ This attribute is optional. +@void: @Returns: @@ -238,6 +242,7 @@ This attribute is optional. +@void: @Returns: @@ -439,6 +444,7 @@ This attribute is optional. +@void: @Returns: diff --git a/docs/reference/gtk/tmpl/gtkicontheme.sgml b/docs/reference/gtk/tmpl/gtkicontheme.sgml index 9e2d6bb53a..922329952c 100644 --- a/docs/reference/gtk/tmpl/gtkicontheme.sgml +++ b/docs/reference/gtk/tmpl/gtkicontheme.sgml @@ -103,6 +103,9 @@ else + + + Contains information found when looking up an icon in @@ -160,6 +163,7 @@ The #GQuark used for #GtkIconThemeError errors. +@void: @Returns: @@ -168,6 +172,7 @@ The #GQuark used for #GtkIconThemeError errors. +@void: @Returns: @@ -416,6 +421,21 @@ The #GQuark used for #GtkIconThemeError errors. @Returns: + + + + + +@icon_info: +@fg: +@success_color: +@warning_color: +@error_color: +@was_symbolic: +@error: +@Returns: + + diff --git a/docs/reference/gtk/tmpl/gtkiconview.sgml b/docs/reference/gtk/tmpl/gtkiconview.sgml index 1fc99d1233..2dad9dacdd 100644 --- a/docs/reference/gtk/tmpl/gtkiconview.sgml +++ b/docs/reference/gtk/tmpl/gtkiconview.sgml @@ -22,6 +22,9 @@ rubberband selection, which is controlled by dragging the pointer. + + + The GtkIconView struct contains only @@ -200,6 +203,7 @@ selected rows. It will be called on every selected row in the view. +@void: @Returns: diff --git a/docs/reference/gtk/tmpl/gtkimagemenuitem.sgml b/docs/reference/gtk/tmpl/gtkimagemenuitem.sgml index b970e496b2..0ab41337aa 100644 --- a/docs/reference/gtk/tmpl/gtkimagemenuitem.sgml +++ b/docs/reference/gtk/tmpl/gtkimagemenuitem.sgml @@ -21,6 +21,9 @@ fill in the text label. + + + @@ -70,6 +73,7 @@ fill in the text label. +@void: @Returns: diff --git a/docs/reference/gtk/tmpl/gtkimcontext.sgml b/docs/reference/gtk/tmpl/gtkimcontext.sgml index ecb3ad9825..1484fdaaf3 100644 --- a/docs/reference/gtk/tmpl/gtkimcontext.sgml +++ b/docs/reference/gtk/tmpl/gtkimcontext.sgml @@ -17,6 +17,9 @@ GtkIMContext + + + diff --git a/docs/reference/gtk/tmpl/gtkimcontextsimple.sgml b/docs/reference/gtk/tmpl/gtkimcontextsimple.sgml index cdbb50b5be..59d9315c9b 100644 --- a/docs/reference/gtk/tmpl/gtkimcontextsimple.sgml +++ b/docs/reference/gtk/tmpl/gtkimcontextsimple.sgml @@ -17,6 +17,9 @@ An input method context supporting table-based input methods + + + @@ -28,6 +31,7 @@ An input method context supporting table-based input methods +@void: @Returns: diff --git a/docs/reference/gtk/tmpl/gtkimmulticontext.sgml b/docs/reference/gtk/tmpl/gtkimmulticontext.sgml index d216507e62..f75374535f 100644 --- a/docs/reference/gtk/tmpl/gtkimmulticontext.sgml +++ b/docs/reference/gtk/tmpl/gtkimmulticontext.sgml @@ -17,6 +17,9 @@ An input method context supporting multiple, loadable input methods + + + @@ -28,6 +31,7 @@ An input method context supporting multiple, loadable input methods +@void: @Returns: diff --git a/docs/reference/gtk/tmpl/gtkinputdialog.sgml b/docs/reference/gtk/tmpl/gtkinputdialog.sgml deleted file mode 100644 index 47abfdcb50..0000000000 --- a/docs/reference/gtk/tmpl/gtkinputdialog.sgml +++ /dev/null @@ -1,75 +0,0 @@ - -GtkInputDialog - - -Configure devices for the XInput extension - - - - -#GtkInputDialog displays a dialog which allows the user -to configure XInput extension devices. For each -device, they can control the mode of the device -(disabled, screen-relative, or window-relative), -the mapping of axes to coordinates, and the -mapping of the devices macro keys to key press -events. - - -#GtkInputDialog contains two buttons to which -the application can connect; one for closing -the dialog, and one for saving the changes. -No actions are bound to these by default. -The changes that the user makes take effect -immediately. - - -As of GTK+ 2.20, #GtkInputDialog has been deprecated since it is too specialized. - - - - - - - - - - - - - - - - - -This signal is emitted when the user changes the -mode of a device from a #GDK_MODE_SCREEN or #GDK_MODE_WINDOW -to #GDK_MODE_ENABLED. - - -@inputdialog: the object which received the signal. -@deviceid: The ID of the newly disabled device. - -@Deprecated: 2.20: Don't use this widget anymore. - - - -This signal is emitted when the user changes the -mode of a device from #GDK_MODE_DISABLED to a -#GDK_MODE_SCREEN or #GDK_MODE_WINDOW. - - -@inputdialog: the object which received the signal. -@deviceid: The ID of the newly enabled device. - -@Deprecated: 2.20: Don't use this widget anymore. - - - -Creates a new #GtkInputDialog. - - -@Returns: the new #GtkInputDialog. -@Deprecated: 2.20: Don't use this widget anymore. - - diff --git a/docs/reference/gtk/tmpl/gtkinvisible.sgml b/docs/reference/gtk/tmpl/gtkinvisible.sgml index 9315fe8d97..0f4ead0372 100644 --- a/docs/reference/gtk/tmpl/gtkinvisible.sgml +++ b/docs/reference/gtk/tmpl/gtkinvisible.sgml @@ -22,6 +22,9 @@ for drag-and-drop. + + + The #GtkInvisible-struct struct contains no public fields. @@ -37,6 +40,7 @@ The #GtkInvisible-struct struct contains no public fields. +@void: @Returns: diff --git a/docs/reference/gtk/tmpl/gtkitem.sgml b/docs/reference/gtk/tmpl/gtkitem.sgml index effa9a3c6e..626cf5a987 100644 --- a/docs/reference/gtk/tmpl/gtkitem.sgml +++ b/docs/reference/gtk/tmpl/gtkitem.sgml @@ -18,6 +18,9 @@ and #GtkTreeItem. + + + The #GtkItem-struct struct contains private data only, and diff --git a/docs/reference/gtk/tmpl/gtklabel.sgml b/docs/reference/gtk/tmpl/gtklabel.sgml index 96168bf36b..0740e5f4af 100644 --- a/docs/reference/gtk/tmpl/gtklabel.sgml +++ b/docs/reference/gtk/tmpl/gtklabel.sgml @@ -141,7 +141,7 @@ the clipboard. Only labels that contain useful-to-copy information - + Text layout @@ -155,11 +155,23 @@ Labels can automatically wrap text if you call gtk_label_set_line_wrap(). -gtk_label_set_justify() sets how the lines in a label align -with one another. If you want to set how the label as a whole +gtk_label_set_justify() sets how the lines in a label align +with one another. If you want to set how the label as a whole aligns in its available space, see gtk_misc_set_alignment(). - + +The #GtkLabel:width-chars and #GtkLabel:max-width-chars properties +can be used to control the size allocation of ellipsized or wrapped +labels. For ellipsizing labels, if either is specified (and less +than the actual text size), it is used as the minimum width, and the actual +text size is used as the natural width of the label. For wrapping labels, +width-chars is used as the minimum width, if specified, and max-width-chars +is used as the natural width. Even if max-width-chars specified, wrapping +labels will be rewrapped to use all of the available width. + +Note that the interpretation of #GtkLabel:width-chars and +#GtkLabel:max-width-chars has changed a bit with the introduction of +width-for-height geometry management and #GtkExtendedLayout. @@ -188,6 +200,9 @@ the #GtkLabel::activate-link signal and the gtk_label_get_current_uri() function + + + This should not be accessed directly. Use the accessor functions as @@ -424,33 +439,6 @@ The pattern of underlines you want under the existing text within the @n_chars: - - -Gets the current string of text within the #GtkLabel and writes it to -the given @str argument. It does not make a copy of this string so you -must not write to it. - - -@label: The #GtkLabel widget you want to get the text from. -@str: The reference to the pointer you want to point to the text. -@Deprecated: Use gtk_label_get_text() instead. - - - - -Parses the given string for underscores and converts the next -character to an underlined character. The last character that -was underlined will have its lower-cased accelerator keyval returned (i.e. -"_File" would return the keyval for "f". This is -probably only used within the GTK+ library itself for menu items and such. - - -@label: The #GtkLabel you want to affect. -@string: The string you want to parse for underlines. -@Returns: The lowercase keyval of the last character underlined. -@Deprecated: Use gtk_label_set_use_underline() instead. - - @@ -469,14 +457,6 @@ probably only used within the GTK+ library itself for menu items and such. @wrap_mode: - - -Sets the text within the GtkLabel widget. - - -@Deprecated: Use gtk_label_set_text() instead. - - diff --git a/docs/reference/gtk/tmpl/gtklayout.sgml b/docs/reference/gtk/tmpl/gtklayout.sgml index d3845bbc70..1b32027d0c 100644 --- a/docs/reference/gtk/tmpl/gtklayout.sgml +++ b/docs/reference/gtk/tmpl/gtklayout.sgml @@ -30,6 +30,9 @@ area. + + + @@ -127,22 +130,6 @@ area. @height: - - - - - -@layout: - - - - - - - -@layout: - - diff --git a/docs/reference/gtk/tmpl/gtklinkbutton.sgml b/docs/reference/gtk/tmpl/gtklinkbutton.sgml index f7ed37881d..084efabff7 100644 --- a/docs/reference/gtk/tmpl/gtklinkbutton.sgml +++ b/docs/reference/gtk/tmpl/gtklinkbutton.sgml @@ -39,6 +39,9 @@ on it: see gtk_link_button_set_uri_hook(). + + + The #GtkLinkButton struct contains private data only, and should be diff --git a/docs/reference/gtk/tmpl/gtkliststore.sgml b/docs/reference/gtk/tmpl/gtkliststore.sgml index 3577740d47..24f3a1c8b5 100644 --- a/docs/reference/gtk/tmpl/gtkliststore.sgml +++ b/docs/reference/gtk/tmpl/gtkliststore.sgml @@ -166,6 +166,9 @@ and common wisdom is to separate the two, as far as possible. + + + diff --git a/docs/reference/gtk/tmpl/gtkmain.sgml b/docs/reference/gtk/tmpl/gtkmain.sgml index a0b461f3d0..aadd1285a0 100644 --- a/docs/reference/gtk/tmpl/gtkmain.sgml +++ b/docs/reference/gtk/tmpl/gtkmain.sgml @@ -84,11 +84,15 @@ functions such as g_signal_connect(). + + + +@void: @Returns: @@ -97,6 +101,7 @@ functions such as g_signal_connect(). +@void: @@ -104,6 +109,7 @@ functions such as g_signal_connect(). +@void: @Returns: @@ -162,18 +168,6 @@ functions such as g_signal_connect(). @Returns: - - -Terminates the program and returns the given exit code to the caller. -This function will shut down the GUI and free all resources allocated -for GTK+. - - -@error_code: Return value to pass to the caller. This is dependent on the -target system but at least on Unix systems %0 means success. -@Deprecated: Use the standard exit() function instead. - - Checks if any events are pending. This can be used to update the GUI @@ -192,6 +186,7 @@ and invoke timeouts etc. while doing some time intensive computation. +@void: @Returns: %TRUE if any events are pending, %FALSE otherwise. @@ -202,6 +197,7 @@ gtk_main(). In that case gtk_main_quit() will make the innermost invocation of the main loop return. +@void: @@ -210,6 +206,7 @@ Asks for the current nesting level of the main loop. This can be useful when calling gtk_quit_add(). +@void: @Returns: the nesting level of the current invocation of the main loop. @@ -219,6 +216,7 @@ Makes the innermost invocation of the main loop return when it regains control. +@void: @@ -229,6 +227,7 @@ want to block look at gtk_main_iteration_do() or check if any events are pending with gtk_events_pending() first. +@void: @Returns: %TRUE if gtk_main_quit() has been called for the innermost mainloop. @@ -363,6 +362,7 @@ main (int argc, char **argv) +@void: @Returns: %TRUE @@ -372,6 +372,7 @@ Analogical to gtk_true() this function does nothing but always returns %FALSE. +@void: @Returns: %FALSE @@ -394,6 +395,7 @@ widget and this function does nothing. Queries the current grab of the default window group. +@void: @Returns: The widget which currently has the grab or %NULL if no grab is active. @@ -409,6 +411,25 @@ If @widget does not have the grab, this function does nothing. @widget: The widget which gives up the grab. + + + + + +@widget: +@device: +@block_others: + + + + + + + +@widget: +@device: + + Registers a function to be called when the mainloop is started. @@ -485,191 +506,15 @@ Removes a quit handler identified by its @data field. @data: The pointer passed as @data to gtk_quit_add() or gtk_quit_add_full(). - - -Registers a function to be called periodically. The function will be called -repeatedly after @interval milliseconds until it returns %FALSE at which -point the timeout is destroyed and will not be called again. - - -@interval: The time between calls to the function, in milliseconds - (1/1000ths of a second.) -@function: The function to call periodically. -@marshal: The marshaller to use instead of the function (if non-%NULL). -@data: The data to pass to the function. -@destroy: Function to call when the timeout is destroyed or %NULL. -@Returns: A unique id for the event source. -@Deprecated: 2.4: Use g_timeout_add_full() instead. - - - - -Registers a function to be called periodically. The function will be called -repeatedly after @interval milliseconds until it returns %FALSE at which -point the timeout is destroyed and will not be called again. - - -@interval: The time between calls to the function, in milliseconds - (1/1000ths of a second.) -@function: The function to call periodically. -@data: The data to pass to the function. -@Returns: A unique id for the event source. -@Deprecated: 2.4: Use g_timeout_add() instead. - - - - -Removes the given timeout destroying all information about it. - - -@timeout_handler_id: The identifier returned when installing the timeout. -@Deprecated: 2.4: Use g_source_remove() instead. - - - - -Causes the mainloop to call the given function whenever no events with -higher priority are to be processed. The default priority is -%GTK_PRIORITY_DEFAULT, which is rather low. - - -@function: The function to call. -@data: The information to pass to the function. -@Returns: a unique handle for this registration. -@Deprecated: 2.4: Use g_idle_add() instead. - - - - -Like gtk_idle_add() this function allows you to have a function called -when the event loop is idle. The difference is that you can give a -priority different from %GTK_PRIORITY_DEFAULT to the idle function. - - -@priority: The priority which should not be above %G_PRIORITY_HIGH_IDLE. -Note that you will interfere with GTK+ if you use a priority above -%GTK_PRIORITY_RESIZE. -@function: The function to call. -@data: Data to pass to that function. -@Returns: A unique id for the event source. -@Deprecated: 2.4: Use g_idle_add_full() instead. - - - - -Like gtk_idle_add() this function allows you to have a function called -when the event loop is idle. The difference is that you can give a -priority different from %GTK_PRIORITY_DEFAULT to the idle function. - - -@priority: The priority which should not be above %G_PRIORITY_HIGH_IDLE. -Note that you will interfere with GTK+ if you use a priority above -%GTK_PRIORITY_RESIZE. -@function: The function to call. -@marshal: The marshaller to use instead of the function (if non-%NULL). -@data: Data to pass to that function. -@destroy: Function to call when the timeout is destroyed or %NULL. -@Returns: A unique id for the event source. -@Deprecated: 2.4: Use g_idle_add_full() instead. - - - - -Removes the idle function with the given id. - - -@idle_handler_id: Identifies the idle function to remove. -@Deprecated: 2.4: Use g_source_remove() instead. - - - - -Removes the idle function identified by the user data. - - -@data: remove the idle function which was registered with this user data. -@Deprecated: 2.4: Use g_idle_remove_by_data() instead. - - - - -Registers a function to be called when a condition becomes true -on a file descriptor. - - -@source: a file descriptor. -@condition: the condition. -@function: The function to call. -@marshal: The marshaller to use instead of the function (if non-%NULL). -@data: callback data passed to @function. -@destroy: callback function to call with @data when the input - handler is removed, or %NULL. -@Returns: A unique id for the event source; to be used with gtk_input_remove(). -@Deprecated: 2.4: Use g_io_add_watch_full() instead. - - - - -Removes the function with the given id. - - -@input_handler_id: Identifies the function to remove. -@Deprecated: 2.4: Use g_source_remove() instead. - - - - -Use this priority for redrawing related stuff. It is used internally by -GTK+ to do pending redraws. This priority is lower than %GTK_PRIORITY_RESIZE -to avoid redrawing a widget just before resizing (and therefore redrawing -it again). - - -@Deprecated: 2.4: This macro is deprecated. You should use %GDK_PRIORITY_REDRAW instead. - - Use this priority for resizing related stuff. It is used internally by GTK+ to compute the sizes of widgets. This priority is higher than -%GTK_PRIORITY_REDRAW to avoid resizing a widget which was just redrawn. +%GDK_PRIORITY_REDRAW to avoid resizing a widget which was just redrawn. - - -Use this for high priority timeouts. This priority is never used inside -GTK+ so everything running at this priority will be running before anything -inside the toolkit. - - -@Deprecated: 2.4: This macro is deprecated. You should use %G_PRIORITY_HIGH instead. - - - - -This priority is for GTK+ internal stuff. Don't use it in your applications. - - - - - - -Default priority for idle functions. - - -@Deprecated: 2.4: This macro is deprecated. You should use %G_PRIORITY_DEFAULT_IDLE instead. - - - - -Priority for very unimportant background tasks. - - -@Deprecated: 2.4: This macro is deprecated. You should use %G_PRIORITY_LOW instead. - - Installs a key snooper function, which will get called on all key events @@ -706,6 +551,7 @@ Removes the key snooper function with the given id. +@void: @Returns: @@ -714,6 +560,7 @@ Removes the key snooper function with the given id. +@void: @Returns: @@ -726,6 +573,15 @@ Removes the key snooper function with the given id. @Returns: + + + + + +@void: +@Returns: + + diff --git a/docs/reference/gtk/tmpl/gtkmenu.sgml b/docs/reference/gtk/tmpl/gtkmenu.sgml index c8d837692b..965f12bece 100644 --- a/docs/reference/gtk/tmpl/gtkmenu.sgml +++ b/docs/reference/gtk/tmpl/gtkmenu.sgml @@ -79,6 +79,9 @@ my_popup_handler (GtkWidget *widget, GdkEvent *event) + + + The #GtkMenu struct contains private data only, and @@ -194,6 +197,7 @@ should be accessed using the functions below. Creates a new #GtkMenu. +@void: @Returns: a new #GtkMenu. @@ -206,39 +210,6 @@ Creates a new #GtkMenu. @screen: - - -Adds a new #GtkMenuItem to the end of the menu's item list. - - -@menu: a #GtkMenu. -@child: The #GtkMenuItem to add. -@Deprecated: Use gtk_menu_shell_append() instead. - - - - -Adds a new #GtkMenuItem to the beginning of the menu's item list. - - -@menu: a #GtkMenu. -@child: The #GtkMenuItem to add. -@Deprecated: Use gtk_menu_shell_prepend() instead. - - - - -Adds a new #GtkMenuItem to the menu's item list at the position -indicated by @position. - - -@menu: a #GtkMenu. -@child: The #GtkMenuItem to add. -@pos: The position in the item list where @child is added. - Positions are numbered from 0 to n-1. -@Deprecated: Use gtk_menu_shell_insert() instead. - - Moves a #GtkMenuItem to a new position within the #GtkMenu. @@ -263,6 +234,21 @@ Moves a #GtkMenuItem to a new position within the #GtkMenu. @bottom_attach: + + + + + +@menu: +@device: +@parent_menu_shell: +@parent_menu_item: +@func: +@data: +@button: +@activate_time: + + diff --git a/docs/reference/gtk/tmpl/gtkmenubar.sgml b/docs/reference/gtk/tmpl/gtkmenubar.sgml index 9a6b11cd53..89504630b8 100644 --- a/docs/reference/gtk/tmpl/gtkmenubar.sgml +++ b/docs/reference/gtk/tmpl/gtkmenubar.sgml @@ -17,6 +17,9 @@ The #GtkMenuBar is a subclass of #GtkMenuShell which contains one to many #GtkMe + + + The #GtkMenuBar struct contains the following fields. (These fields should be considered read-only. They should never be set by an application.) @@ -48,40 +51,10 @@ The #GtkMenuBar struct contains the following fields. (These fields should be co Creates the new #GtkMenuBar +@void: @Returns: the #GtkMenuBar - - -Adds a new #GtkMenuItem to the end of the GtkMenuBar - - -@menu: a #GtkMenuBar -@child: the #GtkMenuItem to add -@Deprecated: Use gtk_menu_shell_append() instead. - - - - -Adds a new #GtkMenuItem to the beginning of the GtkMenuBar - - -@menu: a #GtkMenuBar -@child: the #GtkMenuItem to add -@Deprecated: Use gtk_menu_shell_prepend() instead. - - - - -Adds a new #GtkMenuItem to the GtkMenuBar at the position defined by @position - - -@menu: a #GtkMenuBar -@child: the #GtkMenuItem to add -@pos: the position in the item list where the @child is added. -@Deprecated: Use gtk_menu_shell_insert() instead. - - Determines how widgets should be packed insided menubars and diff --git a/docs/reference/gtk/tmpl/gtkmenuitem.sgml b/docs/reference/gtk/tmpl/gtkmenuitem.sgml index 011430d38c..6f293ab2ab 100644 --- a/docs/reference/gtk/tmpl/gtkmenuitem.sgml +++ b/docs/reference/gtk/tmpl/gtkmenuitem.sgml @@ -54,6 +54,9 @@ attribute of a <child> element. + + + @@ -151,6 +154,7 @@ submenu. For normal applications, the relevant signal is "activate". Creates a new #GtkMenuItem. +@void: @Returns: the newly created #GtkMenuItem @@ -244,14 +248,6 @@ Creates a new #GtkMenuItem whose child is a #GtkLabel. @Returns: - - - - - -@menu_item: - - @@ -314,11 +310,3 @@ Emits the "toggle_size_allocate" signal on the given item. @allocation: the allocation to use as signal data. - - -Sets the menu item to be right-justified. Only useful for menu bars. - - -@menu_item: the menu item - - diff --git a/docs/reference/gtk/tmpl/gtkmenushell.sgml b/docs/reference/gtk/tmpl/gtkmenushell.sgml index 90dece5e27..2153098b23 100644 --- a/docs/reference/gtk/tmpl/gtkmenushell.sgml +++ b/docs/reference/gtk/tmpl/gtkmenushell.sgml @@ -25,6 +25,9 @@ allowing for nested hierarchical menus. + + + The #GtkMenuShell-struct struct contains the following fields. diff --git a/docs/reference/gtk/tmpl/gtkmenutoolbutton.sgml b/docs/reference/gtk/tmpl/gtkmenutoolbutton.sgml index f55163fe01..c56eab0d76 100644 --- a/docs/reference/gtk/tmpl/gtkmenutoolbutton.sgml +++ b/docs/reference/gtk/tmpl/gtkmenutoolbutton.sgml @@ -39,6 +39,9 @@ A GtkToolItem containing a button with an additional dropdown menu + + + The #GtkMenuToolButton struct contains only private data and @@ -95,17 +98,6 @@ A GtkToolItem containing a button with an additional dropdown menu @Returns: - - - - - -@button: -@tooltips: -@tip_text: -@tip_private: - - diff --git a/docs/reference/gtk/tmpl/gtkmessagedialog.sgml b/docs/reference/gtk/tmpl/gtkmessagedialog.sgml deleted file mode 100644 index f2122cbd09..0000000000 --- a/docs/reference/gtk/tmpl/gtkmessagedialog.sgml +++ /dev/null @@ -1,213 +0,0 @@ - -GtkMessageDialog - - -A convenient message window - - - -#GtkMessageDialog presents a dialog with an image representing the type of -message (Error, Question, etc.) alongside some message text. It's simply a -convenience widget; you could construct the equivalent of #GtkMessageDialog -from #GtkDialog without too much effort, but #GtkMessageDialog saves typing. - - - -The easiest way to do a modal message dialog is to use gtk_dialog_run(), though -you can also pass in the %GTK_DIALOG_MODAL flag, gtk_dialog_run() automatically -makes the dialog modal and waits for the user to respond to it. gtk_dialog_run() -returns when any dialog button is clicked. - -A modal dialog. - - dialog = gtk_message_dialog_new (main_application_window, - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_CLOSE, - "Error loading file '%s': %s", - filename, g_strerror (errno)); - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - - - - - -You might do a non-modal #GtkMessageDialog as follows: - -A non-modal dialog. - - dialog = gtk_message_dialog_new (main_application_window, - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_CLOSE, - "Error loading file '%s': %s", - filename, g_strerror (errno)); - - /* Destroy the dialog when the user responds to it (e.g. clicks a button) */ - g_signal_connect_swapped (dialog, "response", - G_CALLBACK (gtk_widget_destroy), - dialog); - - - - - - -#GtkDialog - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -The type of message being displayed in the dialog. - - -@GTK_MESSAGE_INFO: Informational message -@GTK_MESSAGE_WARNING: Nonfatal warning message -@GTK_MESSAGE_QUESTION: Question requiring a choice -@GTK_MESSAGE_ERROR: Fatal error message -@GTK_MESSAGE_OTHER: None of the above, doesn't get an icon - - - -Prebuilt sets of buttons for the dialog. If -none of these choices are appropriate, simply use %GTK_BUTTONS_NONE -then call gtk_dialog_add_buttons(). - - -@GTK_BUTTONS_NONE: no buttons at all -@GTK_BUTTONS_OK: an OK button -@GTK_BUTTONS_CLOSE: a Close button -@GTK_BUTTONS_CANCEL: a Cancel button -@GTK_BUTTONS_YES_NO: Yes and No buttons -@GTK_BUTTONS_OK_CANCEL: OK and Cancel buttons - - - - - - -@parent: -@flags: -@type: -@buttons: -@message_format: -@Varargs: -@Returns: - - - - - - - -@parent: -@flags: -@type: -@buttons: -@message_format: -@Varargs: -@Returns: - - - - - - - -@message_dialog: -@str: - - - - - - - -@dialog: -@image: - - - - - - - -@dialog: -@Returns: - - - - - - - -@message_dialog: -@message_format: -@Varargs: - - - - - - - -@message_dialog: -@message_format: -@Varargs: - - diff --git a/docs/reference/gtk/tmpl/gtkmisc.sgml b/docs/reference/gtk/tmpl/gtkmisc.sgml index e930403247..c3466bb6fd 100644 --- a/docs/reference/gtk/tmpl/gtkmisc.sgml +++ b/docs/reference/gtk/tmpl/gtkmisc.sgml @@ -28,6 +28,9 @@ allocated area, the alignment settings will not alter the widgets position. + + + The #GtkMisc-struct struct contains the following fields. diff --git a/docs/reference/gtk/tmpl/gtknotebook.sgml b/docs/reference/gtk/tmpl/gtknotebook.sgml index b4a4827a04..154a6424cf 100644 --- a/docs/reference/gtk/tmpl/gtknotebook.sgml +++ b/docs/reference/gtk/tmpl/gtknotebook.sgml @@ -66,6 +66,9 @@ element. + + + @@ -174,16 +177,6 @@ Emitted when the user or a function changes the current page. - - - - - - - - - - @@ -204,26 +197,11 @@ Emitted when the user or a function changes the current page. - - - - - - - - - - - - - - - @@ -310,6 +288,7 @@ The #GtkNotebookPage is an opaque implementation detail of #GtkNotebook. +@void: @Returns: @@ -386,14 +365,6 @@ The #GtkNotebookPage is an opaque implementation detail of #GtkNotebook. @page_num: - - -Deprecated compatibility macro. - - -@Deprecated: Use gtk_notebook_get_current_page() instead. - - @@ -403,14 +374,6 @@ Deprecated compatibility macro. @Returns: - - -Deprecated compatibility macro. - - -@Deprecated: Use gtk_notebook_set_current_page() instead. - - @@ -466,14 +429,6 @@ Deprecated compatibility macro. @scrollable: - - - - -@notebook: -@border_width: - - @@ -543,14 +498,6 @@ Deprecated compatibility macro. @pack_type: - - - - -@notebook: -@homogeneous: - - @@ -569,14 +516,6 @@ Deprecated compatibility macro. @menu_text: - - - - -@notebook: -@tab_hborder: - - @@ -606,14 +545,6 @@ Deprecated compatibility macro. @tab_text: - - - - -@notebook: -@tab_vborder: - - @@ -719,24 +650,6 @@ Deprecated compatibility macro. @page_num: - - - - - -@notebook: -@group_id: - - - - - - - -@notebook: -@Returns: - - diff --git a/docs/reference/gtk/tmpl/gtkobject.sgml b/docs/reference/gtk/tmpl/gtkobject.sgml deleted file mode 100644 index d4ab2e7c46..0000000000 --- a/docs/reference/gtk/tmpl/gtkobject.sgml +++ /dev/null @@ -1,504 +0,0 @@ - -GtkObject - - -The base class of the GTK+ type hierarchy - - - -Description - -#GtkObject is the base class for all widgets, and for a few -non-widget objects such as #GtkAdjustment. #GtkObject predates -#GObject; non-widgets that derive from #GtkObject rather than -#GObject do so for backward compatibility reasons. - - -#GtkObjects are created with a "floating" reference count. -This means that the initial reference is not owned by anyone. Calling -g_object_unref() on a newly-created #GtkObject is incorrect, the floating -reference has to be removed first. This can be done by anyone at any time, -by calling g_object_ref_sink() to convert the floating reference into a -regular reference. g_object_ref_sink() returns a new reference if an object -is already sunk (has no floating reference). - - -When you add a widget to its parent container, the parent container -will do this: - - g_object_ref_sink (G_OBJECT (child_widget)); - -This means that the container now owns a reference to the child widget -and the child widget has no floating reference. - - -The purpose of the floating reference is to keep the child widget alive -until you add it to a parent container: - - button = gtk_button_new (); - /* button has one floating reference to keep it alive */ - gtk_container_add (GTK_CONTAINER (container), button); - /* button has one non-floating reference owned by the container */ - - - -#GtkWindow is a special case, because GTK+ itself will ref/sink it on creation. -That is, after calling gtk_window_new(), the #GtkWindow will have one -reference which is owned by GTK+, and no floating references. - - - -One more factor comes into play: the "destroy" signal, emitted by the -gtk_object_destroy() method. The "destroy" signal asks all code owning a -reference to an object to release said reference. So, for example, if you call -gtk_object_destroy() on a #GtkWindow, GTK+ will release the reference count that -it owns; if you call gtk_object_destroy() on a #GtkButton, then the button will -be removed from its parent container and the parent container will release its -reference to the button. Because these references are released, calling -gtk_object_destroy() should result in freeing all memory associated with an -object, unless some buggy code fails to release its references in response to -the "destroy" signal. Freeing memory (referred to as -finalization only happens if the reference count reaches -zero. - - - -Some simple rules for handling #GtkObject: - - -Never call g_object_unref() unless you have previously called g_object_ref(), -even if you created the #GtkObject. (Note: this is not -true for #GObject; for #GObject, the creator of the object owns a reference.) - - -Call gtk_object_destroy() to get rid of most objects in most cases. -In particular, widgets are almost always destroyed in this way. - - Because of the floating reference count, you don't need to -worry about reference counting for widgets and toplevel windows, unless you -explicitly call g_object_ref() yourself. - - - - - - - -#GObject - - - - - - - -The object itself. You should never use these members directly - - use the accessing macros instead. - - - - - -Signals that all holders of a reference to the #GtkObject should release -the reference that they hold. May result in finalization of the object -if all references are released. - - -@object: the object which received the signal. - - - - - - - - - - - - - - - - - - - - - - -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 - - - -Gets the #GtkObjectFlags for an object without directly -accessing its members. - - -@obj: the object whose flags are returned. - - - - -Evaluates to %TRUE if the object still has its floating reference count. -See the overview documentation for #GtkObject. - - -@obj: the object to examine. - - - - -Possible flags indicating how an argument should be treated. - - -@GTK_ARG_READABLE: the argument is readable. (i.e. can be queried) -@GTK_ARG_WRITABLE: the argument is writable. (i.e. settable) -@GTK_ARG_CONSTRUCT: the argument needs construction. -@GTK_ARG_CONSTRUCT_ONLY: the argument needs construction (and will -be set once during object creation), but is otherwise cannot be -set. Hence this flag is not allowed with #GTK_ARG_WRITABLE, -and is redundant with #GTK_ARG_CONSTRUCT. -@GTK_ARG_CHILD_ARG: an argument type that applies to (and may be different for) -each child. Used by #GtkContainer. -@Deprecated: Use corresponding #GParamSpec features instead - - - -Constructs an object given its arguments, enumerated in the call to the -function. - - -@type: the type identifying this object. Returned by gtk_type_unique() -(although for a properly-written object it should be accessible through -a #GTK_TYPE_FOO macro.) -@first_property_name: name of the first property to set when constructing - the object. -@Varargs: the first argument's value, followed by any number of -name/argument-value pairs, terminated with %NULL. -@Returns: the new #GtkObject. -@Deprecated: Use g_object_new() instead. - - - - -Removes the floating reference from a #GtkObject, if it exists; -otherwise does nothing. See the #GtkObject overview documentation at -the top of the page. - - -@object: the object to sink. -@Deprecated: 2.10: Use g_object_ref_sink() instead - - - - -Increases the reference count of the object. - - -@object: the object to reference. -@Returns: @object. -@Deprecated: Use g_object_ref() instead. - - - - -Decreases the reference count of an object. When its reference count drops -to 0, the object is finalized (i.e. its memory is freed). - - -@object: the object to dereference. -@Deprecated: Use g_object_unref() instead. - - - - -Adds a weak reference callback to an object. Weak references are used for notification when an object is -finalized. They are called "weak references" because they allow you to safely -hold a pointer to an object without calling g_object_ref() (g_object_ref() adds -a strong reference, that is, forces the object to stay alive). - - -@object: object to weakly reference. -@notify: callback to invoke before the object is freed. -@data: extra data to pass to #notify. -@Deprecated: Use g_object_weak_ref() instead. - - - - -Removes a weak reference callback to an object. - - -@object: object stop weakly referencing. -@notify: callback to search for. -@data: data to search for. -@Deprecated: Use g_object_weak_unref() instead. - - - - -Emits the "destroy" signal notifying all reference holders that they should -release the #GtkObject. See the overview documentation at the top of the -page for more details. - - -The memory for the object itself won't be deleted until -its reference count actually drops to 0; gtk_object_destroy() merely asks -reference holders to release their references, it does not free the object. - - -@object: the object to destroy. - - - - -Gets properties of an object. - - -@object: a #GtkObject. -@first_property_name: name of first property to get the value for. -@Varargs: %NULL-terminated list of name-return location pairs. -@Deprecated: Use g_object_get() instead. - - - - -Sets properties on an object. - - - - -void set_box_properties (GtkBox* box) -{ - gtk_object_set (GTK_OBJECT (box), "homogeneous", TRUE, - "spacing", 8, - NULL); -} - - - - -@object: a #GtkObject. -@first_property_name: name of the first property to set -@Varargs: the value of the first argument, followed optionally -by more name/value pairs, followed by %NULL. -@Deprecated: Use g_object_set() instead. - - - - -Each object carries around a table of associations from -strings to pointers. This function lets you set an association. - - -If the object already had an association with that name, -the old association will be destroyed. - - -@object: object containing the associations. -@key: name of the key. -@data: data to associate with that key. -@Deprecated: Use g_object_set_data() instead. - - - - -Like gtk_object_set_data() except it adds notification -for when the association is destroyed, either by -gtk_object_remove_data() or when the object is destroyed. - - -@object: object containing the associations. -@key: name of the key. -@data: data to associate with that key. -@destroy: function to call when the association is destroyed. -@Deprecated: Use g_object_set_data_full() instead. - - - - -Removes a specified datum from the object's data associations (the object_data). -Subsequent calls to gtk_object_get_data() will return %NULL. - - -If you specified a destroy handler with gtk_object_set_data_full(), -it will be invoked. - - -@object: the object maintaining the association. -@key: name of the key for that association. -@Deprecated: Use g_object_set_data() to set the object data to %NULL instead. - - - - -Get a named field from the object's table of associations (the object_data). - - -@object: the object maintaining the associations. -@key: name of the key for that association. -@Returns: the data if found, or %NULL if no such data exists. -@Deprecated: Use g_object_get_data() instead. - - - - -Remove a specified datum from the object's data associations (the object_data), -without invoking the association's destroy handler. - - -Just like gtk_object_remove_data() except that any destroy handler -will be ignored. -Therefore this only affects data set using gtk_object_set_data_full(). - - -@object: the object maintaining the association. -@key: name of the key for that association. -@Deprecated: Use g_object_steal_data() instead. - - - - -For convenience, every object offers a generic user data -pointer. This function sets it. - - -@object: the object whose user data should be set. -@data: the new value for the user data. -@Deprecated: Use g_object_set_data() instead. - - - - -Get the object's user data pointer. - - -This is intended to be a pointer for your convenience in -writing applications. - - -@object: the object. -@Returns: the user data field for object. -@Deprecated: Use g_object_get_data() instead. - - - - -Deprecated in favor of the #GObject property system including #GParamSpec. -Add a new type of argument to an object class. -Usually this is called when registering a new type of object. - - -@arg_name: fully qualify object name, for example GtkObject::user_data. -@arg_type: type of the argument. -@arg_flags: bitwise-OR of the #GtkArgFlags enum. (Whether the argument is -settable or gettable, whether it is set when the object is constructed.) -@arg_id: an internal number, passed in from here to the "set_arg" and -"get_arg" handlers of the object. - - - - -Just like gtk_object_set_data() except that it takes -a #GQuark instead of a string, so it is slightly faster. - - -Use gtk_object_data_try_key() and gtk_object_data_force_id() -to get an id from a string. - - -@object: object containing the associations. -@data_id: quark of the key. -@data: data to associate with that key. -@Deprecated: Use g_object_set_qdata() instead. - - - - -Just like gtk_object_set_data_full() except that it takes -a #GQuark instead of a string, so it is slightly faster. - - -Use gtk_object_data_try_key() and gtk_object_data_force_id() -to get an id from a string. - - -@object: object containing the associations. -@data_id: quark of the key. -@data: data to associate with that key. -@destroy: function to call when the association is destroyed. -@Deprecated: Use g_object_set_qdata_full() instead. - - - - -Just like gtk_object_get_data() except that it takes -a #GQuark instead of a string, so it is slightly faster. - - -Use gtk_object_data_try_key() and gtk_object_data_force_id() -to get an id from a string. - - -@object: object containing the associations. -@data_id: quark of the key. -@Returns: the data if found, or %NULL if no such data exists. -@Deprecated: Use g_object_get_qdata() instead. - - - - -Just like gtk_object_remove_data() except that it takes -a #GQuark instead of a string, so it is slightly faster. - - -Remove a specified datum from the object's data associations. -Subsequent calls to gtk_object_get_data() will return %NULL. - - -Use gtk_object_data_try_key() and gtk_object_data_force_id() -to get an id from a string. - - -@object: object containing the associations. -@data_id: quark of the key. -@Deprecated: Use g_object_set_qdata() with data of %NULL instead. - - - - -Just like gtk_object_remove_no_notify() except that it takes -a #GQuark instead of a string, so it is slightly faster. - - -Use gtk_object_data_try_key() and gtk_object_data_force_id() -to get an id from a string. - - -@object: object containing the associations. -@key_id: quark of the key. -@Deprecated: Use g_object_steal_qdata() instead. - - - - -Useless deprecated macro. Ignore it. - - - - - - -Useless deprecated macro. Ignore it. - - - - diff --git a/docs/reference/gtk/tmpl/gtkoldeditable.sgml b/docs/reference/gtk/tmpl/gtkoldeditable.sgml deleted file mode 100644 index e51a5e9b39..0000000000 --- a/docs/reference/gtk/tmpl/gtkoldeditable.sgml +++ /dev/null @@ -1,169 +0,0 @@ - -GtkOldEditable - - -Base class for text-editing widgets - - - -GtkOldEditable has been deprecated since GTK+ 2.0 and should not be used -in newly written code. Use the #GtkEditable interface instead. - - - - - - - - - - - - - - - -@current_pos: -@selection_start_pos: -@selection_end_pos: -@has_selection: - - - - - - -@oldeditable: the object which received the signal. - - - - - - -@oldeditable: the object which received the signal. - - - - - - -@oldeditable: the object which received the signal. - - - - - - -@oldeditable: the object which received the signal. -@arg1: - - - - - - -@oldeditable: the object which received the signal. -@arg1: - - - - - - -@oldeditable: the object which received the signal. -@arg1: - - - - - - -@oldeditable: the object which received the signal. -@arg1: -@arg2: - - - - - - -@oldeditable: the object which received the signal. -@arg1: -@arg2: - - - - - - -@oldeditable: the object which received the signal. -@arg1: - - - - - - -@oldeditable: the object which received the signal. -@arg1: - - - - - - -@oldeditable: the object which received the signal. -@arg1: - - - - - - -@oldeditable: the object which received the signal. - - - - - - -@oldeditable: the object which received the signal. -@arg1: - - - - - - - - - - - - - - - - -@editable: -@time_: - - - - - - - -@old_editable: -@claim: -@time_: - - - - - - - -@old_editable: - - diff --git a/docs/reference/gtk/tmpl/gtkoptionmenu.sgml b/docs/reference/gtk/tmpl/gtkoptionmenu.sgml deleted file mode 100644 index 3b58a49ca6..0000000000 --- a/docs/reference/gtk/tmpl/gtkoptionmenu.sgml +++ /dev/null @@ -1,124 +0,0 @@ - -GtkOptionMenu - - -A widget used to choose from a list of valid choices - - - -A #GtkOptionMenu is a widget that allows the user to choose from a -list of valid choices. The #GtkOptionMenu displays the selected -choice. When activated the #GtkOptionMenu displays a popup #GtkMenu -which allows the user to make a new choice. - - - -Using a #GtkOptionMenu is simple; build a #GtkMenu, by calling -gtk_menu_new(), then appending menu items to it with -gtk_menu_shell_append(). Set that menu on the option menu -with gtk_option_menu_set_menu(). Set the selected menu item with -gtk_option_menu_set_history(); connect to the "changed" signal on -the option menu; in the "changed" signal, check the new selected -menu item with gtk_option_menu_get_history(). - - - -As of GTK+ 2.4, #GtkOptionMenu has been deprecated in favor of #GtkComboBox. - - - - - - - - - - -The #GtkOptionMenu-struct struct contains private data only, and -should be accessed using the functions below. - - -@Deprecated: 2.4: Use #GtkComboBox instead. - - - - - - -@optionmenu: the object which received the signal. - - - - - - - - - - - - - - - - - - -Creates a new #GtkOptionMenu. - - -@Returns: a new #GtkOptionMenu. -@Deprecated: 2.4: Use #GtkComboBox instead. - - - - -Returns the #GtkMenu associated with the #GtkOptionMenu. - - -@option_menu: a #GtkOptionMenu. -@Returns: the #GtkMenu associated with the #GtkOptionMenu. -@Deprecated: 2.4: Use #GtkComboBox instead. - - - - -Provides the #GtkMenu that is popped up to allow the user to choose -a new value. You should provide a simple menu avoiding the -use of tearoff menu items, submenus, and accelerators. - - -@option_menu: a #GtkOptionMenu. -@menu: the #GtkMenu to associate with the #GtkOptionMenu. -@Deprecated: 2.4: Use #GtkComboBox instead. - - - - -Removes the menu from the option menu. - - -@option_menu: a #GtkOptionMenu. -@Deprecated: 2.4: Use #GtkComboBox instead. - - - - -Selects the menu item specified by @index_ making it the newly -selected value for the option menu. - - -@option_menu: a #GtkOptionMenu. -@index_: the index of the menu item to select. Index values are from 0 to n-1. -@Deprecated: 2.4: Use #GtkComboBox instead. - - - - - - - -@option_menu: -@Returns: - - diff --git a/docs/reference/gtk/tmpl/gtkorientable.sgml b/docs/reference/gtk/tmpl/gtkorientable.sgml deleted file mode 100644 index 1debb51b7b..0000000000 --- a/docs/reference/gtk/tmpl/gtkorientable.sgml +++ /dev/null @@ -1,56 +0,0 @@ - -GtkOrientable - - -An interface for flippable widgets - - - -The #GtkOrientable interface is implemented by all widgets that can be -oriented horizontally or vertically. Historically, such widgets have been -realized as subclasses of a common base class (e.g #GtkBox/#GtkHBox/#GtkVBox -and #GtkScale/#GtkHScale/#GtkVScale). GtkOrientable is more flexible in that -it allows the orientation to be changed at runtime, allowing the widgets -to 'flip'. - - -GtkOrientable was introduced in GTK+ 2.16. - - - - - - - - - - - - - - - - - - - - - - - - - - -@orientable: -@Returns: - - - - - - - -@orientable: -@orientation: - - diff --git a/docs/reference/gtk/tmpl/gtkpagesetup.sgml b/docs/reference/gtk/tmpl/gtkpagesetup.sgml index 7739b35866..cac99e1421 100644 --- a/docs/reference/gtk/tmpl/gtkpagesetup.sgml +++ b/docs/reference/gtk/tmpl/gtkpagesetup.sgml @@ -61,6 +61,9 @@ Printing support was added in GTK+ 2.10. + + + @@ -72,6 +75,7 @@ Printing support was added in GTK+ 2.10. +@void: @Returns: diff --git a/docs/reference/gtk/tmpl/gtkpagesetupunixdialog.sgml b/docs/reference/gtk/tmpl/gtkpagesetupunixdialog.sgml deleted file mode 100644 index e61fefca08..0000000000 --- a/docs/reference/gtk/tmpl/gtkpagesetupunixdialog.sgml +++ /dev/null @@ -1,79 +0,0 @@ - -GtkPageSetupUnixDialog - - -A page setup dialog - - - -GtkPageSetupUnixDialog implements a page setup dialog for platforms -which don't provide a native page setup dialog, like Unix. It can -be used very much like any other GTK+ dialog, at the cost of -the portability offered by the high-level printing API - - - -Printing support was added in GTK+ 2.10. - - - - - - - - - - - - - - - - - - - - - -@title: -@parent: -@Returns: - - - - - - - -@dialog: -@page_setup: - - - - - - - -@dialog: -@Returns: - - - - - - - -@dialog: -@print_settings: - - - - - - - -@dialog: -@Returns: - - diff --git a/docs/reference/gtk/tmpl/gtkpaned.sgml b/docs/reference/gtk/tmpl/gtkpaned.sgml index c7976a2b0d..e25f3fadbc 100644 --- a/docs/reference/gtk/tmpl/gtkpaned.sgml +++ b/docs/reference/gtk/tmpl/gtkpaned.sgml @@ -72,6 +72,9 @@ gtk_widget_set_size_request (frame2, 50, -1); + + + @@ -169,6 +172,15 @@ gtk_widget_set_size_request (frame2, 50, -1); + + + + + +@orientation: +@Returns: + + Adds a child to the top or left pane with @@ -191,15 +203,6 @@ parameters. This is equivalent to @child: the child to add - - -Old name for gtk_paned_set_gutter_size(). - - -@p: a paned widget -@s: the width of the gutter in pixels - - Adds a child to the top or left pane. @@ -240,16 +243,6 @@ Adds a child to the bottom or right pane. @Returns: - - -In older versions of GTK+, this function used to set the width of the -gutter (the area between the two panes). It does nothing now. - - -@p: a paned widget -@s: the width of the gutter in pixels - - @@ -268,3 +261,12 @@ gutter (the area between the two panes). It does nothing now. @Returns: + + + + + +@paned: +@Returns: + + diff --git a/docs/reference/gtk/tmpl/gtkpapersize.sgml b/docs/reference/gtk/tmpl/gtkpapersize.sgml index 7dea34e400..abc19fd132 100644 --- a/docs/reference/gtk/tmpl/gtkpapersize.sgml +++ b/docs/reference/gtk/tmpl/gtkpapersize.sgml @@ -31,6 +31,9 @@ Printing support has been added in GTK+ 2.10. + + + @@ -278,6 +281,7 @@ Name for the Legal paper size. +@void: @Returns: diff --git a/docs/reference/gtk/tmpl/gtkpixmap.sgml b/docs/reference/gtk/tmpl/gtkpixmap.sgml deleted file mode 100644 index 48cb86238d..0000000000 --- a/docs/reference/gtk/tmpl/gtkpixmap.sgml +++ /dev/null @@ -1,83 +0,0 @@ - -GtkPixmap - - -A widget displaying a graphical image or icon - - - -The #GtkPixmap widget displays a graphical image or icon. -The icon is typically created using gdk_pixmap_colormap_create_from_xpm() -or gdk_pixmap_colormap_create_from_xpm_d(). - - -The pixels in a #GtkPixmap cannot be manipulated by the application after -creation, since under the X Window system the pixel data is stored on the -X server and so is not available to the client application. -If you want to create graphical images which can be manipulated by the -application, look at #GtkImage and #GdkRGB. - - -GtkPixmap has been deprecated since GTK+ 2.0 and should not be used -in newly written code. Use #GtkImage instead. - - - - - - - - - - - - -The #GtkPixmap-struct struct contains private data only, and -should be accessed using the functions below. - - - - - -Creates a new #GtkPixmap, using the given GDK pixmap and mask. - - -@pixmap: a #GDKPixmap. -@mask: a #GDKBitmap which indicates which parts of the @pixmap should be -transparent. -@Returns: a new #GtkPixmap. - - - - -Sets the #GdkPixmap and #GdkBitmap mask. - - -@pixmap: a #GtkPixmap. -@val: a #GdkPixmap. -@mask: a #GdkBitmap, which indicates which parts of the @pixmap should be -transparent. This can be NULL, in which case none of the @pixmap is -transparent. - - - - -Gets the current #GdkPixmap and #GdkBitmap mask. - - -@pixmap: a #GtkPixmap. -@val: returns the current #GdkPixmap. -@mask: returns the current #GdkBitmap mask. - - - - -Sets wether an extra pixmap should be automatically created and used -when the pixmap is insensitive. The default value is %TRUE. - - -@pixmap: a #GtkPixmap. -@build: set to %TRUE if an extra pixmap should be automatically created to use -when the pixmap is insensitive. - - diff --git a/docs/reference/gtk/tmpl/gtkprintcontext.sgml b/docs/reference/gtk/tmpl/gtkprintcontext.sgml index 2c4549508e..651cbce8c7 100644 --- a/docs/reference/gtk/tmpl/gtkprintcontext.sgml +++ b/docs/reference/gtk/tmpl/gtkprintcontext.sgml @@ -86,6 +86,9 @@ Printing support was added in GTK+ 2.10. + + + diff --git a/docs/reference/gtk/tmpl/gtkprinter.sgml b/docs/reference/gtk/tmpl/gtkprinter.sgml deleted file mode 100644 index d15d3ca506..0000000000 --- a/docs/reference/gtk/tmpl/gtkprinter.sgml +++ /dev/null @@ -1,333 +0,0 @@ - -GtkPrinter - - -Represents a printer - - - -A #GtkPrinter object represents a printer. You only need to -deal directly with printers if you use the non-portable -#GtkPrintUnixDialog API. - - -A #GtkPrinter allows to get status information about the printer, -such as its description, its location, the number of queued jobs, -etc. Most importantly, a #GtkPrinter object can be used to create -a #GtkPrintJob object, which lets you print to the printer. - - - -Printing support was added in GTK+ 2.10. - - - - - - - - - - - - - - - - - - - - - -@printer: the object which received the signal. -@arg1: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -@name: -@backend: -@virtual_: -@Returns: - - - - - - - -@printer: -@Returns: - - - - - - - -@printer: -@Returns: - - - - - - - -@printer: -@Returns: - - - - - - - -@printer: -@Returns: - - - - - - - -@printer: -@Returns: - - - - - - - -@printer: -@Returns: - - - - - - - -@printer: -@Returns: - - - - - - - -@printer: -@Returns: - - - - - - - -@printer: -@Returns: - - - - - - - -@printer: -@Returns: - - - - - - - -@printer: -@Returns: - - - - - - - -@printer: -@Returns: - - - - - - - -@printer: -@Returns: - - - - - - - -@printer: -@Returns: - - - - - - - -@printer: -@Returns: - - - - - - - -@a: -@b: -@Returns: - - - - - - - -@printer: -@Returns: - - - - - - - -@printer: - - - - - - - -@printer: -@Returns: - - - - - - - -@printer: -@Returns: - - - - - - - -@printer: -@top: -@bottom: -@left: -@right: -@Returns: - - - - -The type of function passed to gtk_enumerate_printers(). -Note that you need to ref @printer, if you want to keep -a reference to it after the function has returned. - - -@printer: a #GtkPrinter -@data: user data passed to gtk_enumerate_printers() -@Returns: %TRUE to stop the enumeration, %FALSE to continue - - - - - - - -@func: -@data: -@destroy: -@wait: - - diff --git a/docs/reference/gtk/tmpl/gtkprintjob.sgml b/docs/reference/gtk/tmpl/gtkprintjob.sgml index 11d3ff9982..09d2681327 100644 --- a/docs/reference/gtk/tmpl/gtkprintjob.sgml +++ b/docs/reference/gtk/tmpl/gtkprintjob.sgml @@ -32,6 +32,9 @@ Printing support was added in GTK+ 2.10. + + + The GtkPrintJob struct contains only private members diff --git a/docs/reference/gtk/tmpl/gtkprintoperation.sgml b/docs/reference/gtk/tmpl/gtkprintoperation.sgml index 9228734d48..00cc328b35 100644 --- a/docs/reference/gtk/tmpl/gtkprintoperation.sgml +++ b/docs/reference/gtk/tmpl/gtkprintoperation.sgml @@ -86,6 +86,9 @@ Printing support was added in GTK+ 2.10. + + + @@ -349,6 +352,7 @@ The #GQuark used for #GtkPrintError errors. +@void: @Returns: diff --git a/docs/reference/gtk/tmpl/gtkprintsettings.sgml b/docs/reference/gtk/tmpl/gtkprintsettings.sgml index 13d545f460..4a1ee3bf16 100644 --- a/docs/reference/gtk/tmpl/gtkprintsettings.sgml +++ b/docs/reference/gtk/tmpl/gtkprintsettings.sgml @@ -33,6 +33,9 @@ Printing support was added in GTK+ 2.10. + + + @@ -54,6 +57,7 @@ Printing support was added in GTK+ 2.10. +@void: @Returns: diff --git a/docs/reference/gtk/tmpl/gtkprintunixdialog.sgml b/docs/reference/gtk/tmpl/gtkprintunixdialog.sgml index 4a732b3bec..d5155ad70b 100644 --- a/docs/reference/gtk/tmpl/gtkprintunixdialog.sgml +++ b/docs/reference/gtk/tmpl/gtkprintunixdialog.sgml @@ -79,6 +79,9 @@ The GtkPrintUnixDialog implementation of the GtkBuildable interface exposes its + + + diff --git a/docs/reference/gtk/tmpl/gtkprogress.sgml b/docs/reference/gtk/tmpl/gtkprogress.sgml index a83d5b1280..3b63a76c83 100644 --- a/docs/reference/gtk/tmpl/gtkprogress.sgml +++ b/docs/reference/gtk/tmpl/gtkprogress.sgml @@ -19,6 +19,9 @@ the progress of a long running operation. + + + The #GtkProgress-struct struct contains private data only. diff --git a/docs/reference/gtk/tmpl/gtkprogressbar.sgml b/docs/reference/gtk/tmpl/gtkprogressbar.sgml index 6d6d64a1a9..3d4b816134 100644 --- a/docs/reference/gtk/tmpl/gtkprogressbar.sgml +++ b/docs/reference/gtk/tmpl/gtkprogressbar.sgml @@ -59,6 +59,9 @@ a large chunk of deprecated 1.2 compatibility functions. + + + The #GtkProgressBar-struct struct contains private data only, @@ -66,31 +69,6 @@ and should be accessed using the functions below. - - - - - - - - - - - - - - - - - - - - - - - - - @@ -151,6 +129,7 @@ and should be accessed using the functions below. Creates a new #GtkProgressBar. +@void: @Returns: a #GtkProgressBar. @@ -263,23 +242,6 @@ directions for the visible progress bar. @Returns: - - - -@adjustment: -@Returns: - - - - -Sets the style of the #GtkProgressBar. The default style is -%GTK_PROGRESS_CONTINUOUS. - - -@pbar: a #GtkProgressBar. -@style: a #GtkProgressBarStyle value indicating the desired style. - - An enumeration representing the styles for drawing the progress bar. @@ -288,45 +250,3 @@ An enumeration representing the styles for drawing the progress bar. @GTK_PROGRESS_CONTINUOUS: The progress bar grows in a smooth, continuous manner. @GTK_PROGRESS_DISCRETE: The progress bar grows in discrete, visible blocks. - - -Sets the number of blocks that the progress bar is divided into -when the style is %GTK_PROGRESS_DISCRETE. - - -@pbar: a #GtkProgressBar. -@blocks: number of individual blocks making up the bar. - - - - -Sets the step value used when the progress bar is in activity -mode. The step is the amount by which the progress is incremented -each iteration. - - -@pbar: a #GtkProgressBar. -@step: the amount which the progress is incremented in activity -mode. - - - - -Sets the number of blocks used when the progress bar is in activity -mode. Larger numbers make the visible block smaller. - - -@pbar: a #GtkProgressBar. -@blocks: number of blocks which can fit within the progress bar area. - - - - -This function is deprecated. Please use gtk_progress_set_value() or -gtk_progress_set_percentage() instead. - - -@pbar: a #GtkProgressBar. -@percentage: the new percent complete value. - - diff --git a/docs/reference/gtk/tmpl/gtkradioaction.sgml b/docs/reference/gtk/tmpl/gtkradioaction.sgml deleted file mode 100644 index 55992c45ae..0000000000 --- a/docs/reference/gtk/tmpl/gtkradioaction.sgml +++ /dev/null @@ -1,100 +0,0 @@ - -GtkRadioAction - - -An action of which only one in a group can be active - - - -A #GtkRadioAction is similar to #GtkRadioMenuItem. A number of radio -actions can be linked together so that only one may be active at any -one time. - - - - - - - - - - - - -The GtkRadioAction struct contains -only private members and should not be accessed directly. - - - - - - - - -@radioaction: the object which received the signal. -@arg1: - - - - - - - - - - - - - - - - - - - - - -@name: -@label: -@tooltip: -@stock_id: -@value: -@Returns: - - - - - - - -@action: -@Returns: - - - - - - - -@action: -@group: - - - - - - - -@action: -@Returns: - - - - - - - -@action: -@current_value: - - diff --git a/docs/reference/gtk/tmpl/gtkradiobutton.sgml b/docs/reference/gtk/tmpl/gtkradiobutton.sgml deleted file mode 100644 index 3d6812deef..0000000000 --- a/docs/reference/gtk/tmpl/gtkradiobutton.sgml +++ /dev/null @@ -1,205 +0,0 @@ - -GtkRadioButton - - -A choice from multiple check buttons - - - -A single radio button performs the same basic function as a #GtkCheckButton, -as its position in the object hierarchy reflects. It is only when multiple -radio buttons are grouped together that they become a different user -interface component in their own right. - -Every radio button is a member of some group of radio buttons. When one is selected, all other -radio buttons in the same group are deselected. A #GtkRadioButton is one way -of giving the user a choice from many options. - - -Radio button widgets are created with gtk_radio_button_new(), passing NULL -as the argument if this is the first radio button in a group. In subsequent -calls, the group you wish to add this button to should be passed as an -argument. Optionally, gtk_radio_button_new_with_label() can be used if you -want a text label on the radio button. - - -Alternatively, when adding widgets to an existing group of radio buttons, -use gtk_radio_button_new_from_widget() with a #GtkRadioButton that already -has a group assigned to it. The convenience function -gtk_radio_button_new_with_label_from_widget() is also provided. - - -To retrieve the group a #GtkRadioButton is assigned to, use -gtk_radio_button_get_group(). - - -To remove a #GtkRadioButton from one group and make it part of a new one, use gtk_radio_button_set_group(). - - -The group list does not need to be freed, as each #GtkRadioButton will remove -itself and its list item when it is destroyed. - - - -How to create a group of two radio buttons. - - -void create_radio_buttons (void) { - - GtkWidget *window, *radio1, *radio2, *box, *entry; - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - box = gtk_vbox_new (TRUE, 2); - - /* Create a radio button with a GtkEntry widget */ - radio1 = gtk_radio_button_new (NULL); - entry = gtk_entry_new (); - gtk_container_add (GTK_CONTAINER (radio1), entry); - - - /* Create a radio button with a label */ - radio2 = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (radio1), - "I'm the second radio button."); - - /* Pack them into a box, then show all the widgets */ - gtk_box_pack_start (GTK_BOX (box), radio1, TRUE, TRUE, 2); - gtk_box_pack_start (GTK_BOX (box), radio2, TRUE, TRUE, 2); - gtk_container_add (GTK_CONTAINER (window), box); - gtk_widget_show_all (window); - return; -} - - - - - -When an unselected button in the group is clicked the clicked button -receives the "toggled" signal, as does the previously selected button. -Inside the "toggled" handler, gtk_toggle_button_get_active() can be used -to determine if the button has been selected or deselected. - - - - - - -#GtkOptionMenu -Another way of offering the user a single choice from -many. - - - - - - - - - - -Contains only private data that should be read and manipulated using the -functions below. - - - - - - - - -@radiobutton: the object which received the signal. - - - -Sets a new group for a radio button. - - - - -Creates a new #GtkRadioButton. To be of any practical value, a widget should -then be packed into the radio button. - - -@group: an existing radio button group, or %NULL if you are creating a new group. -@Returns: a new radio button. - - - - -Creates a new #GtkRadioButton, adding it to the same group as @radio_group_member. -As with gtk_radio_button_new(), a widget should be packed into the radio button. - - -@radio_group_member: an existing #GtkRadioButton. -@Returns: a new radio button. - - - - -Creates a new #GtkRadioButton with a text label. - - -@group: an existing radio button group, or %NULL if you are creating a new -group. -@label: the text label to display next to the radio button. -@Returns: a new radio button. - - - - -Creates a new #GtkRadioButton with a text label, adding it to the same group -as @radio_group_member. - - -@radio_group_member: widget to get radio group from or NULL -@label: a text string to display next to the radio button. -@Returns: a new radio button. - -@group: an existing #GtkRadioButton. - - - - - - - -@group: -@label: -@Returns: - - - - - - - -@radio_group_member: -@label: -@Returns: - - - - -Deprecated compatibility macro. Use gtk_radio_button_get_group() instead. - - - - - - -Sets a #GtkRadioButton's group. It should be noted that this does not change -the layout of your interface in any way, so if you are changing the group, -it is likely you will need to re-arrange the user interface to reflect these -changes. - - -@radio_button: a #GtkRadioButton. -@group: an existing radio button group, such as one returned from -gtk_radio_button_get_group(). - - - - - -@radio_button: -@Returns: - - diff --git a/docs/reference/gtk/tmpl/gtkradiomenuitem.sgml b/docs/reference/gtk/tmpl/gtkradiomenuitem.sgml index 897c5f64d1..3b739c667f 100644 --- a/docs/reference/gtk/tmpl/gtkradiomenuitem.sgml +++ b/docs/reference/gtk/tmpl/gtkradiomenuitem.sgml @@ -51,6 +51,9 @@ for (i = 0; i < 5; i++) + + + The structure contains only private data that must be accessed through @@ -126,13 +129,6 @@ Creates a new #GtkRadioMenuItem. @Returns: - - -Deprecated compatibility macro. Use gtk_radio_menu_item_get_group() instead. - - - - Sets the group of a radio menu item, or changes it. diff --git a/docs/reference/gtk/tmpl/gtkradiotoolbutton.sgml b/docs/reference/gtk/tmpl/gtkradiotoolbutton.sgml index 0f6f8b3f07..61876786e7 100644 --- a/docs/reference/gtk/tmpl/gtkradiotoolbutton.sgml +++ b/docs/reference/gtk/tmpl/gtkradiotoolbutton.sgml @@ -58,6 +58,9 @@ gtk_radio_tool_button_new_from_widget_with_stock() to create a new + + + The #GtkRadioToolButton contains only private data and should only diff --git a/docs/reference/gtk/tmpl/gtkrange.sgml b/docs/reference/gtk/tmpl/gtkrange.sgml deleted file mode 100644 index faa8310ee7..0000000000 --- a/docs/reference/gtk/tmpl/gtkrange.sgml +++ /dev/null @@ -1,421 +0,0 @@ - -GtkRange - - -Base class for widgets which visualize an adjustment - - - -#GtkRange is the common base class for widgets which visualize an -adjustment, e.g scales or scrollbars. - - -Apart from signals for monitoring the parameters of the adjustment, -GtkRange provides properties and methods for influencing the sensitivity -of the "steppers". It also provides properties and methods for setting a -"fill level" on range widgets. See gtk_range_set_fill_level(). - - - - - - - - - - - - - - - - - - - - - -@range: the object which received the signal. -@arg1: - - - - - - -@range: the object which received the signal. -@arg1: -@arg2: -@Returns: - - - - - - -@range: -@step: - - - - - - -@range: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -@range: -@Returns: - - - - - - - -@range: -@Returns: - - - - - - - -@range: -@Returns: - - - - - - - -@range: -@fill_level: - - - - - - - -@range: -@restrict_to_fill_level: - - - - - - - -@range: -@show_fill_level: - - - - - - - -@range: -@Returns: - - - - - - - -@range: -@policy: - - - - - - - -@range: -@adjustment: - - - - - - - -@range: -@Returns: - - - - - - - -@range: -@setting: - - - - - - - -@range: -@Returns: - - - - - - - -@range: -@Returns: - - - - - - - -@range: -@step: -@page: - - - - - - - -@range: -@min: -@max: - - - - - - - -@range: -@value: - - - - -Determines how GTK+ handles the sensitivity of stepper arrows -at the end of range widgets. - - -@GTK_SENSITIVITY_AUTO: The arrow is made insensitive if the - thumb is at the end -@GTK_SENSITIVITY_ON: The arrow is always sensitive -@GTK_SENSITIVITY_OFF: The arrow is always insensitive - - - - - - -@range: -@sensitivity: - - - - - - - -@range: -@Returns: - - - - - - - -@range: -@sensitivity: - - - - - - - -@range: -@Returns: - - - - - - - -@range: -@Returns: - - - - - - - -@range: -@flippable: - - - - - - - -@range: -@Returns: - - - - - - - -@range: -@range_rect: - - - - - - - -@range: -@slider_start: -@slider_end: - - - - - - - -@range: -@Returns: - - - - - - - -@range: -@min_size: - - - - - - - -@range: -@size_fixed: - - diff --git a/docs/reference/gtk/tmpl/gtkrc.sgml b/docs/reference/gtk/tmpl/gtkrc.sgml index 3fd1be5417..0dce9d20a5 100644 --- a/docs/reference/gtk/tmpl/gtkrc.sgml +++ b/docs/reference/gtk/tmpl/gtkrc.sgml @@ -16,14 +16,13 @@ at runtime. An application can cause GTK+ to parse a specific RC file by calling gtk_rc_parse(). In addition to this, certain files will be read at the end of gtk_init(). -Unless modified, the files looked for will be -<SYSCONFDIR>/gtk-2.0/gtkrc -and .gtkrc-2.0 in the users home directory. -(<SYSCONFDIR> defaults to +Unless modified, the files looked for will be +<SYSCONFDIR>/gtk-2.0/gtkrc +and .gtkrc-3.0 in the users home directory. +(<SYSCONFDIR> defaults to /usr/local/etc. It can be changed with the - or options when -configuring GTK+.) Note that although the filenames contain the version -number 2.0, all 2.x versions of GTK+ look for these files. + or options when +configuring GTK+.) The set of these default files @@ -35,11 +34,11 @@ can be set to a #G_SEARCHPATH_SEPARATOR_S-separated list of files in order to overwrite the set of default files at runtime. -For each RC file, in addition to the file itself, GTK+ will look for -a locale-specific file that will be parsed after the main file. +For each RC file, in addition to the file itself, GTK+ will look for +a locale-specific file that will be parsed after the main file. For instance, if LANG is set to ja_JP.ujis, -when loading the default file ~/.gtkrc then GTK+ looks -for ~/.gtkrc.ja_JP and ~/.gtkrc.ja, +when loading the default file ~/.gtkrc then GTK+ looks +for ~/.gtkrc.ja_JP and ~/.gtkrc.ja, and parses the first of those that exists. @@ -57,29 +56,29 @@ of such a statement: widget "mywindow.*.GtkEntry" style "my-entry-class" -attaches the style "my-entry-class" to all -widgets whose widget path matches the -pattern "mywindow.*.GtkEntry". -That is, all #GtkEntry widgets which are part of a #GtkWindow named +attaches the style "my-entry-class" to all +widgets whose widget path matches the +pattern "mywindow.*.GtkEntry". +That is, all #GtkEntry widgets which are part of a #GtkWindow named "mywindow". -The patterns here are given in the standard shell glob syntax. -The "?" wildcard matches any character, while -"*" matches zero or more of any character. +The patterns here are given in the standard shell glob syntax. +The "?" wildcard matches any character, while +"*" matches zero or more of any character. The three types of matching are against the widget path, the -class path and the class hierarchy. Both the -widget path and the class path consist of a "." -separated list of all the parents of the widget and the widget itself -from outermost to innermost. The difference is that in the widget path, -the name assigned by gtk_widget_set_name() is used if present, otherwise -the class name of the widget, while for the class path, the class name is +class path and the class hierarchy. Both the +widget path and the class path consist of a "." +separated list of all the parents of the widget and the widget itself +from outermost to innermost. The difference is that in the widget path, +the name assigned by gtk_widget_set_name() is used if present, otherwise +the class name of the widget, while for the class path, the class name is always used. Since GTK+ 2.10,widget_class paths can also contain -<classname> substrings, which are matching +<classname> substrings, which are matching the class with the given name and any derived classes. For instance, widget_class "*<GtkMenuItem>.GtkLabel" style "my-style" @@ -87,14 +86,14 @@ widget_class "*<GtkMenuItem>.GtkLabel" style "my-style" will match #GtkLabel widgets which are contained in any kind of menu item. -So, if you have a #GtkEntry named "myentry", inside of a +So, if you have a #GtkEntry named "myentry", inside of a horizontal box in a window named "mywindow", then the widget path is: "mywindow.GtkHBox.myentry" while the class path is: "GtkWindow.GtkHBox.GtkEntry". Matching against class is a little different. The pattern match is done -against all class names in the widgets class hierarchy (not the layout +against all class names in the widgets class hierarchy (not the layout hierarchy) in sequence, so the pattern: class "GtkButton" style "my-style" @@ -126,6 +125,21 @@ that GTK+ creates internally. +Theme gtkrc files + + +Theme RC files are loaded first from under the ~/.themes/, +then from the directory from gtk_rc_get_theme_dir(). The files looked at will +be gtk-3.0/gtkrc. + + +When the application prefers dark themes +(see the #GtkSettings:gtk-application-prefer-dark-theme property for details), +gtk-3.0/gtkrc-dark will be loaded first, and if not present +gtk-3.0/gtkrc will be loaded. + + + Optimizing RC Style Matches @@ -737,6 +751,9 @@ same as for styles. + + + The #GtkRcStyle structure is used to represent a set @@ -822,6 +839,7 @@ specific portions of a RC file. +@void: @Returns: @@ -845,45 +863,6 @@ specific portions of a RC file. @Returns: - - -Adds a #GtkRcStyle that will be looked up by a match against -the widget's pathname. This is equivalent to a: - widget PATTERN style STYLE -statement in a RC file. - - -@rc_style: the #GtkRcStyle to use for widgets matching @pattern -@pattern: the pattern -@Deprecated: Use gtk_rc_parse_string() with a suitable string instead. - - - - -Adds a #GtkRcStyle that will be looked up by a match against -the widget's class pathname. This is equivalent to a: -widget_class PATTERN style STYLE -statement in a RC file. - - -@rc_style: the #GtkRcStyle to use for widgets matching @pattern -@pattern: the pattern -@Deprecated: Use gtk_rc_parse_string() with a suitable string instead. - - - - -Adds a #GtkRcStyle that will be looked up by a matching against -the class hierarchy of the widget. This is equivalent to a: -class PATTERN style STYLE -statement in a RC file. - - -@rc_style: the #GtkRcStyle to use for widgets deriving from @pattern -@pattern: the pattern -@Deprecated: Use gtk_rc_parse_string() with a suitable string instead. - - Parses a given resource file. @@ -905,6 +884,7 @@ Parses resource information directly from a string. +@void: @Returns: @@ -937,6 +917,7 @@ Parses resource information directly from a string. +@void: @Returns: @@ -1018,6 +999,7 @@ otherwise %NULL. +@void: @Returns: @@ -1026,6 +1008,7 @@ otherwise %NULL. +@void: @Returns: @@ -1034,6 +1017,7 @@ otherwise %NULL. +@void: @Returns: @@ -1044,6 +1028,7 @@ be installed. (GTK+ does not actually use this directory itself.) +@void: @Returns: The directory (must be freed with g_free()). @@ -1053,6 +1038,7 @@ Creates a new #GtkRcStyle with no fields set and a reference count of 1. +@void: @Returns: the newly-created #GtkRcStyle @@ -1065,22 +1051,3 @@ a reference count of 1. @Returns: - - -Increments the reference count of a #GtkRcStyle. - - -@rc_style: a #GtkRcStyle -@Deprecated: Use g_object_ref() instead - - - - -Decrements the reference count of a #GtkRcStyle and -frees if the result is 0. - - -@rc_style: a #GtkRcStyle -@Deprecated: Use g_object_unref() instead - - diff --git a/docs/reference/gtk/tmpl/gtkrecentaction.sgml b/docs/reference/gtk/tmpl/gtkrecentaction.sgml deleted file mode 100644 index 5fb7802f0a..0000000000 --- a/docs/reference/gtk/tmpl/gtkrecentaction.sgml +++ /dev/null @@ -1,81 +0,0 @@ - -GtkRecentAction - - -An action of which represents a list of recently used files - - - -A GtkRecentAction represents a list of recently used files, which -can be shown by widgets such as #GtkRecentChooserDialog or -#GtkRecentChooserMenu. - - -To construct a submenu showing recently used files, use a GtkRecentAction -as the action for a <menuitem>. To construct a menu toolbutton showing -the recently used files in the popup menu, use a GtkRecentAction as the -action for a <toolitem> element. - - - - - - - - - - - - - - - - - - - - - - - - - - -@name: -@label: -@tooltip: -@stock_id: -@Returns: - - - - - - - -@name: -@label: -@tooltip: -@stock_id: -@manager: -@Returns: - - - - - - - -@action: -@Returns: - - - - - - - -@action: -@show_numbers: - - diff --git a/docs/reference/gtk/tmpl/gtkrecentchooser.sgml b/docs/reference/gtk/tmpl/gtkrecentchooser.sgml deleted file mode 100644 index 85013ba6f8..0000000000 --- a/docs/reference/gtk/tmpl/gtkrecentchooser.sgml +++ /dev/null @@ -1,457 +0,0 @@ - -GtkRecentChooser - - -Interface implemented by widgets displaying recently used files - - - -#GtkRecentChooser is an interface that can be implemented by widgets -displaying the list of recently used files. In GTK+, the main objects -that implement this interface are #GtkRecentChooserWidget, -#GtkRecentChooserDialog and #GtkRecentChooserMenu. - - - -Recently used files are supported since GTK+ 2.10. - - - - -#GtkRecentManager, #GtkRecentChooserDialog, #GtkRecentChooserWidget, -#GtkRecentChooserMenu - - - - - - - - - - - - - - - - -@recentchooser: the object which received the signal. - - - - - - -@recentchooser: the object which received the signal. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -@base_iface: -@set_current_uri: -@get_current_uri: -@select_uri: -@unselect_uri: -@select_all: -@unselect_all: -@get_items: -@get_recent_manager: -@add_filter: -@remove_filter: -@list_filters: -@set_sort_func: -@item_activated: -@selection_changed: - - - -Used to get the #GError quark for #GtkRecentChooser errors. - - - - - - -These identify the various errors that can occur while calling -#GtkRecentChooser functions. - - -@GTK_RECENT_CHOOSER_ERROR_NOT_FOUND: Indicates that a file does not exist -@GTK_RECENT_CHOOSER_ERROR_INVALID_URI: Indicates a malformed URI - - - - - - -@chooser: -@show_private: - - - - - - - -@chooser: -@Returns: - - - - - - - -@chooser: -@show_not_found: - - - - - - - -@chooser: -@Returns: - - - - - - - -@chooser: -@show_icons: - - - - - - - -@chooser: -@Returns: - - - - - - - -@chooser: -@select_multiple: - - - - - - - -@chooser: -@Returns: - - - - - - - -@chooser: -@local_only: - - - - - - - -@chooser: -@Returns: - - - - - - - -@chooser: -@limit: - - - - - - - -@chooser: -@Returns: - - - - - - - -@chooser: -@show_tips: - - - - - - - -@chooser: -@Returns: - - - - - - - -@chooser: -@show_numbers: - - - - - - - -@chooser: -@Returns: - - - - - - - -@GTK_RECENT_SORT_NONE: -@GTK_RECENT_SORT_MRU: -@GTK_RECENT_SORT_LRU: -@GTK_RECENT_SORT_CUSTOM: - - - - - - -@chooser: -@sort_type: - - - - - - - -@chooser: -@Returns: - - - - - - - -@a: -@b: -@user_data: -@Returns: - - - - - - - -@chooser: -@sort_func: -@sort_data: -@data_destroy: - - - - - - - -@chooser: -@uri: -@error: -@Returns: - - - - - - - -@chooser: -@Returns: - - - - - - - -@chooser: -@Returns: - - - - - - - -@chooser: -@uri: -@error: -@Returns: - - - - - - - -@chooser: -@uri: - - - - - - - -@chooser: - - - - - - - -@chooser: - - - - - - - -@chooser: -@Returns: - - - - - - - -@chooser: -@length: -@Returns: - - - - - - - -@chooser: -@filter: - - - - - - - -@chooser: -@filter: - - - - - - - -@chooser: -@Returns: - - - - - - - -@chooser: -@filter: - - - - - - - -@chooser: -@Returns: - - diff --git a/docs/reference/gtk/tmpl/gtkrecentchooserdialog.sgml b/docs/reference/gtk/tmpl/gtkrecentchooserdialog.sgml deleted file mode 100644 index d328db3af6..0000000000 --- a/docs/reference/gtk/tmpl/gtkrecentchooserdialog.sgml +++ /dev/null @@ -1,93 +0,0 @@ - -GtkRecentChooserDialog - - -Displays recently used files in a dialog - - - -#GtkRecentChooserDialog is a dialog box suitable for displaying the recently -used documents. This widgets works by putting a #GtkRecentChooserWidget inside -a #GtkDialog. It exposes the #GtkRecentChooserIface interface, so you can use -all the #GtkRecentChooser functions on the recent chooser dialog as well as -those for #GtkDialog. - - - -Note that #GtkRecentChooserDialog does not have any methods of its own. -Instead, you should use the functions that work on a #GtkRecentChooser. - - - - Typical usage - - - In the simplest of cases, you can use the following code to use - a #GtkRecentChooserDialog to select a recently used file: - - - -GtkWidget *dialog; - -dialog = gtk_recent_chooser_dialog_new ("Recent Documents", - parent_window, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, - NULL); - -if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) - { - GtkRecentInfo *info; - - info = gtk_recent_chooser_get_current_item (GTK_RECENT_CHOOSER (dialog)); - open_file (gtk_recent_info_get_uri (info)); - gtk_recent_info_unref (info); - } - -gtk_widget_destroy (dialog); - - - - -Recently used files are supported since GTK+ 2.10. - - - - -#GtkRecentChooser, #GtkDialog - - - - - - - - - - - - - - - - -@title: -@parent: -@first_button_text: -@Varargs: -@Returns: - - - - - - - -@title: -@parent: -@manager: -@first_button_text: -@Varargs: -@Returns: - - diff --git a/docs/reference/gtk/tmpl/gtkrecentchoosermenu.sgml b/docs/reference/gtk/tmpl/gtkrecentchoosermenu.sgml deleted file mode 100644 index 79d515b18c..0000000000 --- a/docs/reference/gtk/tmpl/gtkrecentchoosermenu.sgml +++ /dev/null @@ -1,88 +0,0 @@ - -GtkRecentChooserMenu - - -Displays recently used files in a menu - - - -#GtkRecentChooserMenu is a widget suitable for displaying recently used files -inside a menu. It can be used to set a sub-menu of a #GtkMenuItem using -gtk_menu_item_set_submenu(), or as the menu of a #GtkMenuToolButton. - - - -Note that #GtkRecentChooserMenu does not have any methods of its own. Instead, -you should use the functions that work on a #GtkRecentChooser. - - - -Note also that #GtkRecentChooserMenu does not support multiple filters, as it -has no way to let the user choose between them as the #GtkRecentChooserWidget -and #GtkRecentChooserDialog widgets do. Thus using gtk_recent_chooser_add_filter() -on a #GtkRecentChooserMenu widget will yield the same effects as using -gtk_recent_chooser_set_filter(), replacing any currently set filter -with the supplied filter; gtk_recent_chooser_remove_filter() will remove -any currently set #GtkRecentFilter object and will unset the current filter; -gtk_recent_chooser_list_filters() will return a list containing a single -#GtkRecentFilter object. - - - -Recently used files are supported since GTK+ 2.10. - - - - -#GtkRecentChooser - - - - - - - - - - - - - - - - - - - - - -@Returns: - - - - - - - -@manager: -@Returns: - - - - - - - -@menu: -@Returns: - - - - - - - -@menu: -@show_numbers: - - diff --git a/docs/reference/gtk/tmpl/gtkrecentchooserwidget.sgml b/docs/reference/gtk/tmpl/gtkrecentchooserwidget.sgml deleted file mode 100644 index 97a663bf33..0000000000 --- a/docs/reference/gtk/tmpl/gtkrecentchooserwidget.sgml +++ /dev/null @@ -1,54 +0,0 @@ - -GtkRecentChooserWidget - - -Displays recently used files - - - -#GtkRecentChooserWidget is a widget suitable for selecting recently used -files. It is the main building block of a #GtkRecentChooserDialog. Most -applications will only need to use the latter; you can use -#GtkRecentChooserWidget as part of a larger window if you have special needs. - - - -Note that #GtkRecentChooserWidget does not have any methods of its own. -Instead, you should use the functions that work on a #GtkRecentChooser. - - - -Recently used files are supported since GTK+ 2.10. - - - - -#GtkRecentChooser, #GtkRecentChooserDialog - - - - - - - - - - - - - - - - -@Returns: - - - - - - - -@manager: -@Returns: - - diff --git a/docs/reference/gtk/tmpl/gtkrecentfilter.sgml b/docs/reference/gtk/tmpl/gtkrecentfilter.sgml index c6d601d1aa..d2b1b78970 100644 --- a/docs/reference/gtk/tmpl/gtkrecentfilter.sgml +++ b/docs/reference/gtk/tmpl/gtkrecentfilter.sgml @@ -40,6 +40,9 @@ Recently used files are supported since GTK+ 2.10. + + + The GtkRecentFilter struct contains @@ -96,6 +99,7 @@ see gtk_recent_filter_add_custom(). +@void: @Returns: diff --git a/docs/reference/gtk/tmpl/gtkrecentmanager.sgml b/docs/reference/gtk/tmpl/gtkrecentmanager.sgml index 56a8fa0cfd..c888b6e9fe 100644 --- a/docs/reference/gtk/tmpl/gtkrecentmanager.sgml +++ b/docs/reference/gtk/tmpl/gtkrecentmanager.sgml @@ -70,6 +70,9 @@ Recently used files are supported since GTK+ 2.10. + + + Acts as a database of information about the list of recently @@ -146,6 +149,7 @@ The #GQuark used for #GtkRecentManagerError errors. +@void: @Returns: @@ -154,27 +158,10 @@ The #GQuark used for #GtkRecentManagerError errors. +@void: @Returns: - - - - - -@screen: -@Returns: - - - - - - - -@manager: -@screen: - - diff --git a/docs/reference/gtk/tmpl/gtkruler.sgml b/docs/reference/gtk/tmpl/gtkruler.sgml index c114ea57f0..747fc7b7d9 100644 --- a/docs/reference/gtk/tmpl/gtkruler.sgml +++ b/docs/reference/gtk/tmpl/gtkruler.sgml @@ -33,6 +33,9 @@ ruler. See #GtkHRuler to learn how to create a new horizontal ruler. See + + + All distances are in 1/72nd's of an inch. (According to Adobe thats a point, but @@ -76,6 +79,15 @@ This should be points_per_unit. This is the size of the unit in 1/72nd's of an i @ruler_scale: @subdivide: + + + + + +@orientation: +@Returns: + + This calls the #GTKMetricType to set the ruler to units defined. Available units diff --git a/docs/reference/gtk/tmpl/gtkscale.sgml b/docs/reference/gtk/tmpl/gtkscale.sgml index b3f5bf5b82..e4e6d512da 100644 --- a/docs/reference/gtk/tmpl/gtkscale.sgml +++ b/docs/reference/gtk/tmpl/gtkscale.sgml @@ -13,11 +13,6 @@ To set the value of a scale, you would normally use gtk_range_set_value(). To detect changes to the value, you would normally use the "value_changed" signal. - -The #GtkScale widget is an abstract class, used only for deriving the -subclasses #GtkHScale and #GtkVScale. To create a scale widget, -call gtk_hscale_new_with_range() or gtk_vscale_new_with_range(). - GtkScale as GtkBuildable @@ -38,6 +33,9 @@ to show at the mark. It can be translated with the usual "translatable and + + + The fields of the #GtkScale-struct struct should only be accessed via @@ -79,6 +77,28 @@ the accessor functions. + + + + + +@orientation: +@adjustment: +@Returns: + + + + + + + +@orientation: +@min: +@max: +@step: +@Returns: + + diff --git a/docs/reference/gtk/tmpl/gtkscalebutton.sgml b/docs/reference/gtk/tmpl/gtkscalebutton.sgml deleted file mode 100644 index a08c418092..0000000000 --- a/docs/reference/gtk/tmpl/gtkscalebutton.sgml +++ /dev/null @@ -1,173 +0,0 @@ - -GtkScaleButton - - -A button which pops up a scale - - - -#GtkScaleButton provides a button which pops up a scale widget. -This kind of widget is commonly used for volume controls in multimedia -applications, and GTK+ provides a #GtkVolumeButton subclass that -is tailored for this use case. - - - - - - - - - - - - - - - - - - - - - -@scalebutton: the object which received the signal. - - - - - - -@scalebutton: the object which received the signal. - - - - - - -@scalebutton: the object which received the signal. -@arg1: - - - - - - - - - - - - - - - - - - - - - - - - - - -@size: -@min: -@max: -@step: -@icons: -@Returns: - - - - - - - -@button: -@adjustment: - - - - - - - -@button: -@icons: - - - - - - - -@button: -@value: - - - - - - - -@button: -@Returns: - - - - - - - -@button: -@Returns: - - - - - - - -@button: -@Returns: - - - - - - - -@button: -@Returns: - - - - - - - -@button: -@Returns: - - - - - - - -@button: -@orientation: - - - - - - - -@button: -@Returns: - - diff --git a/docs/reference/gtk/tmpl/gtkscrollbar.sgml b/docs/reference/gtk/tmpl/gtkscrollbar.sgml index 68705f67a9..9df668348f 100644 --- a/docs/reference/gtk/tmpl/gtkscrollbar.sgml +++ b/docs/reference/gtk/tmpl/gtkscrollbar.sgml @@ -6,8 +6,9 @@ Base class for GtkHScrollbar and GtkVScrollbar -The #GtkScrollbar widget is an abstract base class for #GtkHScrollbar and -#GtkVScrollbar. It is not very useful in itself. +The #GtkScrollbar widget is the base class for #GtkHScrollbar and +#GtkVScrollbar. It can be used in the same way as these, by setting +the "orientation" property appropriately. @@ -51,6 +52,9 @@ or page down (using for example the PageDown key). + + + The #GtkScrollbar struct does not contain any public data. @@ -87,3 +91,13 @@ The #GtkScrollbar struct does not contain any public data. + + + + + +@orientation: +@adjustment: +@Returns: + + diff --git a/docs/reference/gtk/tmpl/gtkscrolledwindow.sgml b/docs/reference/gtk/tmpl/gtkscrolledwindow.sgml index ef870a64c9..a35292772b 100644 --- a/docs/reference/gtk/tmpl/gtkscrolledwindow.sgml +++ b/docs/reference/gtk/tmpl/gtkscrolledwindow.sgml @@ -70,6 +70,9 @@ your own scrolling with #GtkScrollbar and for example a #GtkTable. + + + There are no public fields in the #GtkScrolledWindow struct; it should diff --git a/docs/reference/gtk/tmpl/gtkselection.sgml b/docs/reference/gtk/tmpl/gtkselection.sgml index ce156b7caf..6954d5fc6b 100644 --- a/docs/reference/gtk/tmpl/gtkselection.sgml +++ b/docs/reference/gtk/tmpl/gtkselection.sgml @@ -44,6 +44,9 @@ associated information. + + + A #GtkTargetEntry structure represents a single type of @@ -494,15 +497,6 @@ selection handling code. @widget: - - - - -@widget: -@event: -@Returns: - - diff --git a/docs/reference/gtk/tmpl/gtkseparator.sgml b/docs/reference/gtk/tmpl/gtkseparator.sgml deleted file mode 100644 index 2bff699cd8..0000000000 --- a/docs/reference/gtk/tmpl/gtkseparator.sgml +++ /dev/null @@ -1,26 +0,0 @@ - -GtkSeparator - - -Base class for GtkHSeparator and GtkVSeparator - - - -The #GtkSeparator widget is an abstract class, used only for deriving the -subclasses #GtkHSeparator and #GtkVSeparator. - - - - - - - - - - - - -The #GtkSeparator-struct struct contains private data only. - - - diff --git a/docs/reference/gtk/tmpl/gtkseparatormenuitem.sgml b/docs/reference/gtk/tmpl/gtkseparatormenuitem.sgml deleted file mode 100644 index 3f0d2f9058..0000000000 --- a/docs/reference/gtk/tmpl/gtkseparatormenuitem.sgml +++ /dev/null @@ -1,36 +0,0 @@ - -GtkSeparatorMenuItem - - -A separator used in menus - - - -The #GtkSeparatorMenuItem is a separator used to group -items within a menu. It displays a horizontal line with a shadow to -make it appear sunken into the interface. - - - - - - - - - - - - -The #GtkSeparatorMenuItem-struct struct contains private data only, and -should be accessed using the functions below. - - - - - -Creates a new #GtkSeparatorMenuItem. - - -@Returns: a new #GtkSeparatorMenuItem. - - diff --git a/docs/reference/gtk/tmpl/gtkseparatortoolitem.sgml b/docs/reference/gtk/tmpl/gtkseparatortoolitem.sgml deleted file mode 100644 index 6136bdb62b..0000000000 --- a/docs/reference/gtk/tmpl/gtkseparatortoolitem.sgml +++ /dev/null @@ -1,77 +0,0 @@ - -GtkSeparatorToolItem - - -A toolbar item that separates groups of other toolbar items - - - - A #GtkSeparatorItem is a #GtkToolItem that separates groups of other - #GtkToolItems. Depending on the theme, a #GtkSeparatorToolItem will - often look like a vertical line on horizontally docked toolbars. - - -If the property "expand" is #TRUE and the property "draw" is #FALSE, a -#GtkSeparatorToolItem will act as a "spring" that forces other items -to the ends of the toolbar. - - - Use gtk_separator_tool_item_new() to create a new #GtkSeparatorToolItem. - - - - - - - #GtkToolbar - The toolbar widget - - - #GtkRadioToolButton - A toolbar item containing a radio - button - - - - - - - - - -The #GtkSeparatorToolItem struct contains only private data and -should only be accessed through the functions described below. - - - - - - - - - - - - - -@Returns: - - - - - - - -@item: -@draw: - - - - - - - -@item: -@Returns: - - diff --git a/docs/reference/gtk/tmpl/gtksettings.sgml b/docs/reference/gtk/tmpl/gtksettings.sgml index c90c2395a0..bcabd319d5 100644 --- a/docs/reference/gtk/tmpl/gtksettings.sgml +++ b/docs/reference/gtk/tmpl/gtksettings.sgml @@ -45,6 +45,9 @@ GtkSettings instance for the default screen. + + + @@ -66,6 +69,11 @@ GtkSettings instance for the default screen. + + + + + @@ -394,6 +402,7 @@ GtkSettings instance for the default screen. +@void: @Returns: diff --git a/docs/reference/gtk/tmpl/gtksignal.sgml b/docs/reference/gtk/tmpl/gtksignal.sgml deleted file mode 100644 index 4eb1e5957b..0000000000 --- a/docs/reference/gtk/tmpl/gtksignal.sgml +++ /dev/null @@ -1,759 +0,0 @@ - -Signals - - -Object methods and callbacks - - - -The GTK+ signal system merely proxies the GLib signal system now. For future -usage, direct use of the GSignal API is recommended, this avoids significant -performance hits where #GtkArg structures have to be converted into #GValues. - - - -What are signals? - -Signals are a way to get notification when something happens -and to customize object behavior according to the -user's needs. -Every signal is uniquely identified by a name, -"class_name::signal_name", where signal_name might be something like -"clicked" and class_name might be "GtkButton". Note that some other class -may also define a "clicked" callback, so long as it doesn't derive from -#GtkButton. - - -When they are created, they are also assigned a unique positive integer, -the signal id (1 is the first signal id- 0 is used to flag an error). -Each is also tied to an array of types that describes -the prototype of the function pointer(s) (handlers) you may -connect to the signal. Finally, every signal has -a default handler that is given by a function pointer -in its class structure: it is run by default whenever the -signal is emitted. (It is possible that a signal will -be emitted and a user-defined handler will prevent the default handler -from being run.) - - -Signals are used by everyone, but they are only -created on a per class basis -- so you should not call -call gtk_signal_new() unless you are writing -a new #GtkObject type. However, if you want to make a new signal -for an existing type, you may use gtk_object_class_user_signal_new() -to create a signal that doesn't correspond to a class's builtin -methods. - - - -How are signals used? - -There are two basic actions in the signal handling game. -If you want notification of an event, you must connect -a function pointer and a data pointer to that signal; the data pointer -will be passed as the last argument to the function (so long as you -are using the default marshalling functions). -You will receive a connection id, a unique positive integer -corresponding to that attachment. - - -Functions that want to notify the user of certain actions, -emit signals. - - - -Basic Terminology - - - -signal -A class method, e.g. GtkButton::clicked. -More precisely it is a unique class-branch/signal-name pair. -This means you may not define a signal handler for a class which -derives from #GtkButton that is called clicked, -but it is okay to share signals names if they are separate in -the class tree. - - - - -default handler -The object's internal method which is invoked -when the signal is emitted. - - - - -user-defined handler -A function pointer and data connected -to a signal (for a particular object). -There are really two types: those which are connected -normally, and those which are connected by one -of the connect_after functions. The connect_after handlers -are always run after the default handler. -Many toolkits refer to these as callbacks. - - - - -emission -the whole process of emitting a signal, -including the invocation of all -the different handler types mentioned above. - - - - -signal id -The unique positive (nonzero) integer -used to identify a signal. It can be used instead of -a name to many functions for a slight performance -improvement. - - - - -connection id -The unique positive (nonzero) integer -used to identify the connection of a user-defined handler -to a signal. Notice that it is allowed to connect the -same function-pointer/user-data pair twice, so -there is no guarantee that a function-pointer/user-data -maps to a unique connection id. - - - - - - - -A brief note on how they work. - -The functions responsible for translating an array of #GtkArgs -to your C compiler's normal semantics are called Marshallers. -They are identified by -gtk_marshal_return_value__parameter_list() -for example a C function returning a gboolean and taking a gint -can be invoked by using gtk_marshal_BOOL__INT(). -Not all possibly combinations of return/params are available, -of course, so if you are writing a #GtkObject with parameters -you might have to write a marshaller. - - - - - - - - -#GtkObject -The base class for things which emit signals. - - - -GSignal -The GLib signal system. - - - - - - - - - -Use in place of offsetof(), which is used if it exists. - - - - - - -These configure the signal's emission. They control -whether the signal can be emitted recursively on an object -and -whether to run the default method before or after the user-defined handlers. - - - - - -GTK_RUN_FIRST -Run the default handler before the connected user-defined -handlers. - - - - -GTK_RUN_LAST -Run the default handler after the connected -user-defined handlers. -(Handlers registered as "after" always run after the default handler though) - - - - -GTK_RUN_BOTH -Run the default handler twice, -once before the user-defined handlers, -and -once after. - - - - -GTK_RUN_NO_RECURSE -Whether to prevent a handler or hook -from reemitting the signal from within itself. -Attempts to -emit the signal while it is running will result in the signal -emission being restarted once it is done with the current processing. - -You must be -careful to avoid having two handlers endlessly reemitting signals, -gtk_signal_n_emissions() can be helpful. - - - - -GTK_RUN_ACTION -The signal is an action you can -invoke without any particular setup or cleanup. -The signal is treated no differently, but some -other code can determine if the signal is appropriate to -delegate to user control. For example, key binding sets -only allow bindings of ACTION signals to keystrokes. - - - - -GTK_RUN_NO_HOOKS -This prevents the connection of emission hooks -to the signal. - - - - - -@GTK_RUN_FIRST: -@GTK_RUN_LAST: -@GTK_RUN_BOTH: -@GTK_RUN_NO_RECURSE: -@GTK_RUN_ACTION: -@GTK_RUN_NO_HOOKS: - - - -Creates a new signal type. (This is usually done in the -class initializer.) - - -@name: the event name for the signal, e.g. "clicked". -@signal_flags: a combination of #GTK_RUN flags -specifying detail of when the default handler is to be invoked. -You should at least specify #GTK_RUN_FIRST -or #GTK_RUN_LAST. -@object_type: the type of object this signal pertains to. -It will also pertain to derivers of this type automatically. -@function_offset: How many bytes the function pointer is in -the class structure for this type. Used to invoke a class -method generically. -@marshaller: the function to translate between an array -of GtkArgs and the native calling convention. Usually they -are identified just by the type of arguments they take: -for example, gtk_marshal_BOOL__STRING() describes a marshaller -which takes a string and returns a boolean value. -@return_val: the type of return value, or #GTK_TYPE_NONE for a signal -without a return value. -@n_args: the number of parameter the handlers may take. -@Varargs: a list of #GTK_TYPE_*, one for each parameter. -@Returns: the signal id. -@Deprecated: Use g_signal_new() instead. - - - - -Creates a new signal type. (This is usually done in a -class initializer.) - - -This function take the types as an array, instead of a list -following the arguments. Otherwise the same as gtk_signal_new(). - - -@name: the name of the signal to create. -@signal_flags: see gtk_signal_new(). -@object_type: the type of #GtkObject to associate the signal with. -@function_offset: how many bytes the function pointer is in -the class structure for this type. -@marshaller: -@return_val: the type of the return value, or #GTK_TYPE_NONE if -you don't want a return value. -@n_args: the number of parameters to the user-defined handlers. -@args: an array of #GtkTypes, describing the prototype to -the callbacks. -@Returns: the signal id. -@Deprecated: Use g_signal_newv() instead. - - - - -Given the name of the signal and the type of object it connects -to, get the signal's identifying integer. Emitting the signal -by number is somewhat faster than using the name each time. - - -It also tries the ancestors of the given type. - - -@name: the signal's name, e.g. clicked. -@object_type: the type that the signal operates on, e.g. #GTK_TYPE_BUTTON. -@Returns: the signal's identifying number, or 0 if no signal was found. -@Deprecated: Use g_signal_lookup() instead. - - - - -Given the signal's identifier, finds its name. - - -Two different signals may have the same name, if they have differing types. - - -@signal_id: the signal's identifying number. -@Returns: the signal name, or %NULL if the signal number was invalid. -@Deprecated: Use g_signal_name() instead. - - - - -Emits a signal. This causes the default handler and user-defined -handlers to be run. - - -Here is what gtk_signal_emit() does: - - -1. Calls the default handler and the user-connected handlers. -The default handler will be called first if -#GTK_RUN_FIRST is set, and last if #GTK_RUN_LAST is set. - - -2. Calls all handlers connected with the "after" flag set. - - -@object: the object that emits the signal. -@signal_id: the signal identifier. -@Varargs: the parameters to the function, followed -by a pointer to the return type, if any. -@Deprecated: Use g_signal_emit() instead. - - - - -Emits a signal. This causes the default handler and user-connected -handlers to be run. - - -@object: the object that emits the signal. -@name: the name of the signal. -@Varargs: the parameters to the function, followed -by a pointer to the return type, if any. -@Deprecated: Use g_signal_emit_by_name() instead. - - - - -Emits a signal. This causes the default handler and user-connected -handlers to be run. This differs from gtk_signal_emit() by taking -an array of GtkArgs instead of using C's varargs mechanism. - - -@object: the object to emit the signal to. -@signal_id: the signal identifier. -@args: an array of GtkArgs, one for each parameter, -followed by one which is a pointer to the return type. -@Deprecated: Use g_signal_emitv() instead. - - - - -Emits a signal by name. This causes the default handler and user-connected -handlers to be run. This differs from gtk_signal_emit() by taking -an array of GtkArgs instead of using C's varargs mechanism. - - -@object: the object to emit the signal to. -@name: the name of the signal. -@args: an array of GtkArgs, one for each parameter, -followed by one which is a pointer to the return type. -@Deprecated: Use g_signal_emitv() and g_signal_lookup() instead. - - - - -This function aborts a signal's current emission. - - -It will prevent the default method from running, -if the signal was #GTK_RUN_LAST and you connected -normally (i.e. without the "after" flag). - - -It will print a warning if used on a signal which -isn't being emitted. - - -@object: the object whose signal handlers you wish to stop. -@signal_id: the signal identifier, as returned by g_signal_lookup(). -@Deprecated: Use g_signal_stop_emission() instead. - - - - -This function aborts a signal's current emission. - - -It is just like gtk_signal_emit_stop() -except it will lookup the signal id for you. - - -@object: the object whose signal handlers you wish to stop. -@name: the name of the signal you wish to stop. -@Deprecated: Use g_signal_stop_emission_by_name() instead. - - - - -Attaches a function pointer and user data to a signal for -a particular object. - - -The #GtkSignalFunction takes a #GtkObject as its first parameter. -It will be the same object as the one you're connecting -the hook to. The @func_data will be passed as the last parameter -to the hook. - - -All else being equal, signal handlers are invoked in the order -connected (see gtk_signal_emit() for the other details of -which order things are called in). - - -Here is how one passes an integer as user data, -for when you just want to specify a constant int -as parameter to your function: - - - -static void button_clicked_int (GtkButton* button, gpointer func_data) -{ - g_print ("button pressed: %d\n", GPOINTER_TO_INT (func_data)); -} - -/* By calling this function, you will make the g_print above - * execute, printing the number passed as `to_print'. */ -static void attach_print_signal (GtkButton* button, gint to_print) -{ - gtk_signal_connect (GTK_OBJECT (button), "clicked", - GTK_SIGNAL_FUNC (button_clicked_int), - GINT_TO_POINTER (to_print)); -} - - - -@object: the object associated with the signal, e.g. if a button -is getting pressed, this is that button. -@name: name of the signal. -@func: function pointer to attach to the signal. -@func_data: value to pass as to your function (through the marshaller). -@Returns: the connection id. -@Deprecated: Use g_signal_connect() instead. - - - - -Attaches a function pointer and user data to a signal -so that this handler will be called after the other handlers. - - -@object: the object associated with the signal. -@name: name of the signal. -@func: function pointer to attach to the signal. -@func_data: value to pass as to your function (through the marshaller). -@Returns: the unique identifier for this attachment: the connection id. -@Deprecated: Use g_signal_connect_after() instead. - - - - -This function is for registering a callback that will -call another object's callback. That is, -instead of passing the object which is responsible -for the event as the first parameter of the callback, -it is switched with the user data (so the object which emits -the signal will be the last parameter, which is where the -user data usually is). - - -This is useful for passing a standard function in as a callback. -For example, if you wanted a button's press to gtk_widget_show() -some widget, you could write: - - - -gtk_signal_connect_object (button, "clicked", gtk_widget_show, window); - - - -@object: the object which emits the signal. -@name: the name of the signal. -@func: the function to callback. -@slot_object: the object to pass as the first parameter to func. -(Though it pretends to take an object, you can -really pass any gpointer as the #slot_object .) -@Returns: the connection id. -@Deprecated: Use g_signal_connect_swapped() instead. - - - - -Attaches a signal hook to a signal, passing in an alternate -object as the first parameter, and guaranteeing -that the default handler and all normal -handlers are called first. - - -@object: the object associated with the signal. -@name: name of the signal. -@func: function pointer to attach to the signal. -@slot_object: the object to pass as the first parameter to #func. -@Returns: the connection id. -@Deprecated: Use g_signal_connect_data() instead, passing -G_CONNECT_AFTER|G_CONNECT_SWAPPED as @connect_flags. - - - - -Attaches a function pointer and user data to a signal with -more control. - - -@object: the object which emits the signal. For example, a button -in the button press signal. -@name: the name of the signal. -@func: function pointer to attach to the signal. -@unsupported: -@data: the user data associated with the function. -@destroy_func: function to call when this particular hook is -disconnected. -@object_signal: whether this is an object signal-- basically an "object -signal" is one that wants its user_data and object fields switched, -which is useful for calling functions which operate on another -object primarily. -@after: whether to invoke the user-defined handler after the signal, or to let -the signal's default behavior preside (i.e. depending on #GTK_RUN_FIRST -and #GTK_RUN_LAST). -@Returns: the connection id. -@Deprecated: Use g_signal_connect_data() instead. - - - - -Attaches a function pointer and another #GtkObject to a signal. - - -This function takes an object whose "destroy" signal -should be trapped. -That way, you don't have to clean up the -signal handler when you destroy the object. -It is a little less efficient though. - - -(Instead you may call gtk_signal_disconnect_by_data(), if you want -to explicitly delete all attachments to this object. This -is perhaps not recommended since it could be confused -with an integer masquerading as a pointer (through GINT_TO_POINTER()).) - - -@object: the object that emits the signal. -@name: name of the signal. -@func: function pointer to attach to the signal. -@func_data: pointer to pass to func. -@alive_object: object whose death should cause the handler connection -to be destroyed. -@Deprecated: Use g_signal_connect_object() instead. - - - - -These signal connectors are for signals which refer to objects, -so they must not be called after the object is deleted. - - -Unlike gtk_signal_connect_while_alive(), -this swaps the object and user data, making it suitable for -use with functions which primarily operate on the user data. - - -This function acts just like gtk_signal_connect_object() except -it traps the "destroy" signal to prevent you from having to -clean up the handler. - - -@object: the object associated with the signal. -@name: name of the signal. -@func: function pointer to attach to the signal. -@alive_object: the user data, which must be an object, whose destruction -should signal the removal of this signal. -@Deprecated: Use g_signal_connect_object() instead, passing -G_CONNECT_SWAPPED as @connect_flags. - - - - -Destroys a user-defined handler connection. - - -@object: the object which the handler pertains to. -@handler_id: the connection id. -@Deprecated: Use g_signal_handler_disconnect() instead. - - - - -Destroys all connections for a particular object, with -the given function-pointer and user-data. - - -@object: the object which emits the signal. -@func: the function pointer to search for. -@data: the user data to search for. -@Deprecated: Use g_signal_handlers_disconnect_by_func() instead. - - - - -Destroys all connections for a particular object, with -the given user-data. - - -@object: the object which emits the signal. -@data: the user data to search for. -@Deprecated: Use g_signal_handlers_disconnect_matched() instead. - - - - -Prevents a user-defined handler from being invoked. All other -signal processing will go on as normal, but this particular -handler will ignore it. - - -@object: the object which emits the signal to block. -@handler_id: the connection id. -@Deprecated: Use g_signal_handler_block() instead. - - - - -Prevents a user-defined handler from being invoked, by reference to -the user-defined handler's function pointer and user data. (It may result in -multiple hooks being blocked, if you've called connect multiple times.) - - -@object: the object which emits the signal to block. -@func: the function pointer of the handler to block. -@data: the user data of the handler to block. -@Deprecated: Use g_signal_handlers_block_by_func() instead. - - - - -Prevents all user-defined handlers with a certain user data from being invoked. - - -@object: the object which emits the signal we want to block. -@data: the user data of the handlers to block. -@Deprecated: Use g_signal_handlers_block_matched() instead. - - - - -Undoes a block, by connection id. Note that undoing a block doesn't -necessarily make the hook callable, because if you block a -hook twice, you must unblock it twice. - - -@object: the object which emits the signal we want to unblock. -@handler_id: the emission handler identifier, as returned by -gtk_signal_connect(), etc. -@Deprecated: Use g_signal_handler_unblock() instead. - - - - -Undoes a block, by function pointer and data. -Note that undoing a block doesn't -necessarily make the hook callable, because if you block a -hook twice, you must unblock it twice. - - -@object: the object which emits the signal we want to unblock. -@func: the function pointer to search for. -@data: the user data to search for. -@Deprecated: Use g_signal_handlers_unblock_by_func() instead. - - - - -Undoes block(s), to all signals for a particular object -with a particular user-data pointer - - -@object: the object which emits the signal we want to unblock. -@data: the user data to search for. -@Deprecated: Use g_signal_handlers_unblock_matched() instead. - - - - -Returns a connection id corresponding to a given signal id and object. - - -One example of when you might use this is when the arguments -to the signal are difficult to compute. A class implementor -may opt to not emit the signal if no one is attached anyway, -thus saving the cost of building the arguments. - - -@object: the object to search for the desired user-defined handler. -@signal_id: the number of the signal to search for. -@may_be_blocked: whether it is acceptable to return a blocked -handler. -@Returns: the connection id, if a connection was found. 0 otherwise. -@Deprecated: Use g_signal_has_handler_pending() instead. - - - - -Returns a connection id corresponding to a given signal id, object, function -pointer and user data. - - -@object: the object to search for the desired handler. -@signal_id: the number of the signal to search for. -@may_be_blocked: whether it is acceptable to return a blocked -handler. -@func: the function pointer to search for. -@data: the user data to search for. -@Returns: the connection id, if a handler was found. 0 otherwise. - - - - -A marshaller that returns void and takes no extra parameters. - - - - diff --git a/docs/reference/gtk/tmpl/gtksizegroup.sgml b/docs/reference/gtk/tmpl/gtksizegroup.sgml index 7784e3a1a5..4bf90cec62 100644 --- a/docs/reference/gtk/tmpl/gtksizegroup.sgml +++ b/docs/reference/gtk/tmpl/gtksizegroup.sgml @@ -76,6 +76,9 @@ of the size group. The name attribute gives the id of the widget. + + + diff --git a/docs/reference/gtk/tmpl/gtksocket.sgml b/docs/reference/gtk/tmpl/gtksocket.sgml deleted file mode 100644 index f76569311e..0000000000 --- a/docs/reference/gtk/tmpl/gtksocket.sgml +++ /dev/null @@ -1,170 +0,0 @@ - -GtkSocket - - -Container for widgets from other processes - - - -Together with #GtkPlug, #GtkSocket provides the ability -to embed widgets from one process into another process -in a fashion that is transparent to the user. One -process creates a #GtkSocket widget and, passes the -that widget's window ID to the other process, -which then creates a #GtkPlug with that window ID. -Any widgets contained in the #GtkPlug then will appear -inside the first applications window. - - - -The socket's window ID is obtained by using -gtk_socket_get_id(). Before using this function, -the socket must have been realized, and for hence, -have been added to its parent. - - -Obtaining the window ID of a socket. - -GtkWidget *socket = gtk_socket_new (); -gtk_widget_show (socket); -gtk_container_add (GTK_CONTAINER (parent), socket); - -/* The following call is only necessary if one of - * the ancestors of the socket is not yet visible. - */ -gtk_widget_realize (socket); -g_print ("The ID of the sockets window is %#x\n", - gtk_socket_get_id (socket)); - - - - - -Note that if you pass the window ID of the socket to another -process that will create a plug in the socket, you -must make sure that the socket widget is not destroyed -until that plug is created. Violating this rule will -cause unpredictable consequences, the most likely -consequence being that the plug will appear as a -separate toplevel window. You can check if the plug -has been created by examining the -plug_window field of the -#GtkSocket structure. If this field is non-%NULL, -then the plug has been successfully created inside -of the socket. - - - -When GTK+ is notified that the embedded window has been -destroyed, then it will destroy the socket as well. You -should always, therefore, be prepared for your sockets -to be destroyed at any time when the main event loop -is running. To prevent this from happening, you can -connect to the #GtkSocket::plug-removed signal. - - - -The communication between a #GtkSocket and a #GtkPlug follows the -XEmbed -protocol. This protocol has also been implemented in other toolkits, e.g. -Qt, allowing the same level of integration -when embedding a Qt widget in GTK or vice versa. - - -A socket can also be used to swallow arbitrary -pre-existing top-level windows using gtk_socket_steal(), -though the integration when this is done will not be as close -as between a #GtkPlug and a #GtkSocket. - - - -The #GtkPlug and #GtkSocket widgets are currently not available -on all platforms supported by GTK+. - - - - - - - - -#GtkPlug -the widget that plugs into a #GtkSocket. - - - -XEmbed -the XEmbed Protocol Specification. - - - - - - - - - - -The #GtkSocket structure contains the plug_window -field. (This field should be considered read-only. It should -never be set by an application.) - - - - - - - - -@socket_: - - - - - - -@socket_: -@Returns: - - - - - -@Returns: - - - - - - -@socket_: a #GtkSocket. -@wid: - - - - - - - -@socket_: -@window_id: - - - - - - - -@socket_: -@Returns: - - - - - - - -@socket_: -@Returns: - - diff --git a/docs/reference/gtk/tmpl/gtkspinbutton.sgml b/docs/reference/gtk/tmpl/gtkspinbutton.sgml index f9f24d10b3..0ed732daf3 100644 --- a/docs/reference/gtk/tmpl/gtkspinbutton.sgml +++ b/docs/reference/gtk/tmpl/gtkspinbutton.sgml @@ -99,6 +99,9 @@ void create_floating_spin_button (void) { + + + entry is the #GtkEntry part of the #GtkSpinButton @@ -324,17 +327,6 @@ Creates a new #GtkSpinButton. @max: - - -Gets the value in the @spin_button. - - -@Returns: the value of @spin_button -@Deprecated: Use gtk_spin_button_get_value() instead. - -@spin_button: a #GtkSpinButton - - diff --git a/docs/reference/gtk/tmpl/gtkstatusbar.sgml b/docs/reference/gtk/tmpl/gtkstatusbar.sgml index a012d508ba..2d860995e3 100644 --- a/docs/reference/gtk/tmpl/gtkstatusbar.sgml +++ b/docs/reference/gtk/tmpl/gtkstatusbar.sgml @@ -49,6 +49,9 @@ recorded at the time it was added. This is done using gtk_statusbar_remove(). + + + Contains private data that should be modified with the functions described @@ -89,6 +92,7 @@ below. +@void: @Returns: diff --git a/docs/reference/gtk/tmpl/gtkstatusicon.sgml b/docs/reference/gtk/tmpl/gtkstatusicon.sgml index b834c81fa5..b399ea8b5a 100644 --- a/docs/reference/gtk/tmpl/gtkstatusicon.sgml +++ b/docs/reference/gtk/tmpl/gtkstatusicon.sgml @@ -42,6 +42,9 @@ on Win32 doesn't allow to embed arbitrary widgets. + + + @@ -197,6 +200,7 @@ on Win32 doesn't allow to embed arbitrary widgets. +@void: @Returns: @@ -362,15 +366,6 @@ on Win32 doesn't allow to embed arbitrary widgets. @Returns: - - - - - -@status_icon: -@tooltip_text: - - diff --git a/docs/reference/gtk/tmpl/gtkstyle.sgml b/docs/reference/gtk/tmpl/gtkstyle.sgml deleted file mode 100644 index 22cad1176b..0000000000 --- a/docs/reference/gtk/tmpl/gtkstyle.sgml +++ /dev/null @@ -1,1033 +0,0 @@ - -Styles - - -Functions for drawing widget parts - - - - - - - - - - - - - - - - -Returns whether the style is attached to a window. - - -@style: a #GtkStyle. - - - - - - - -@fg: -@bg: -@light: -@dark: -@mid: -@text: -@base: -@text_aa: -@black: -@white: -@font_desc: -@xthickness: -@ythickness: -@fg_gc: -@bg_gc: -@light_gc: -@dark_gc: -@mid_gc: -@text_gc: -@base_gc: -@text_aa_gc: -@black_gc: -@white_gc: -@bg_pixmap: - - - - - - -@style: the object which received the signal. - - - - - - -@style: the object which received the signal. - - - - - - -@Returns: - - - - - - - -@style: -@Returns: - - - - - - - -@style: -@window: -@Returns: - - - - - - - -@style: - - - - - - - -@style: -@Returns: - - - - - - - -@style: - - - - - - - -@style: -@window: -@state_type: - - - - - - - -@style: -@window: -@set_bg: -@state_type: -@area: -@x: -@y: -@width: -@height: - - - - -Does the same as gtk_style_apply_default_background(). - - -@s: -@gw: -@st: -@a: -@x: -@y: -@w: -@h: -@Deprecated: Use gtk_style_apply_default_background() instead. - - - - - - - -@style: -@color_name: -@color: -@Returns: - - - - - - - -@style: -@stock_id: -@Returns: - - - - - - - -@style: -@source: -@direction: -@state: -@size: -@widget: -@detail: -@Returns: - - - - - - - -@style: -@Returns: - - - - - - - -@style: -@font: - - - - - - - -@style: -@widget_type: -@property_name: -@value: - - - - - - - -@style: -@widget_type: -@first_property_name: -@var_args: - - - - - - - -@style: -@widget_type: -@first_property_name: -@Varargs: - - - - - - - -@style: -@window: -@state_type: -@x1: -@x2: -@y: - - - - - - - -@style: -@window: -@state_type: -@y1_: -@y2_: -@x: - - - - - - - -@style: -@window: -@state_type: -@shadow_type: -@x: -@y: -@width: -@height: - - - - - - - -@style: -@window: -@state_type: -@shadow_type: -@points: -@npoints: -@fill: - - - - - - - -@style: -@window: -@state_type: -@shadow_type: -@arrow_type: -@fill: -@x: -@y: -@width: -@height: - - - - - - - -@style: -@window: -@state_type: -@shadow_type: -@x: -@y: -@width: -@height: - - - - - - - -@style: -@window: -@state_type: -@x: -@y: -@string: - - - - - - - -@style: -@window: -@state_type: -@shadow_type: -@x: -@y: -@width: -@height: - - - - - - - -@style: -@window: -@state_type: -@shadow_type: -@x: -@y: -@width: -@height: -@gap_side: -@gap_x: -@gap_width: - - - - - - - -@style: -@window: -@state_type: -@shadow_type: -@x: -@y: -@width: -@height: - - - - - - - -@style: -@window: -@state_type: -@shadow_type: -@x: -@y: -@width: -@height: -@gap_side: - - - - - - - -@style: -@window: -@state_type: -@shadow_type: -@x: -@y: -@width: -@height: - - - - - - - -@style: -@window: -@x: -@y: -@width: -@height: - - - - - - - -@style: -@window: -@state_type: -@shadow_type: -@x: -@y: -@width: -@height: -@orientation: - - - - - - - -@style: -@window: -@state_type: -@shadow_type: -@x: -@y: -@width: -@height: - - - - - - - -@style: -@window: -@state_type: -@shadow_type: -@x: -@y: -@width: -@height: -@gap_side: -@gap_x: -@gap_width: - - - - - - - -@style: -@window: -@state_type: -@shadow_type: -@x: -@y: -@width: -@height: -@orientation: - - - - - - - -@style: -@window: -@state_type: -@shadow_type: -@x: -@y: -@width: -@height: - - - - - - - -@style: -@window: -@state_type: -@x: -@y: -@expander_style: - - - - - - - -@style: -@window: -@state_type: -@use_text: -@x: -@y: -@layout: - - - - - - - -@style: -@window: -@state_type: -@edge: -@x: -@y: -@width: -@height: - - - - - - - -@style: -@window: -@state_type: -@shadow_type: -@area: -@widget: -@detail: -@arrow_type: -@fill: -@x: -@y: -@width: -@height: - - - - - - - -@style: -@window: -@state_type: -@shadow_type: -@area: -@widget: -@detail: -@x: -@y: -@width: -@height: - - - - - - - -@style: -@window: -@state_type: -@shadow_type: -@area: -@widget: -@detail: -@x: -@y: -@width: -@height: -@gap_side: -@gap_x: -@gap_width: - - - - - - - -@style: -@window: -@state_type: -@shadow_type: -@area: -@widget: -@detail: -@x: -@y: -@width: -@height: - - - - - - - -@style: -@window: -@state_type: -@shadow_type: -@area: -@widget: -@detail: -@x: -@y: -@width: -@height: - - - - - - - -@style: -@window: -@state_type: -@shadow_type: -@area: -@widget: -@detail: -@x: -@y: -@width: -@height: -@gap_side: - - - - - - - -@style: -@window: -@state_type: -@shadow_type: -@area: -@widget: -@detail: -@x: -@y: -@width: -@height: - - - - - - - -@style: -@window: -@state_type: -@area: -@widget: -@detail: -@x: -@y: -@width: -@height: - - - - - - - -@style: -@window: -@state_type: -@shadow_type: -@area: -@widget: -@detail: -@x: -@y: -@width: -@height: -@orientation: - - - - - - - -@style: -@window: -@state_type: -@area: -@widget: -@detail: -@x1: -@x2: -@y: - - - - - - - -@style: -@window: -@state_type: -@shadow_type: -@area: -@widget: -@detail: -@x: -@y: -@width: -@height: - - - - - - - -@style: -@window: -@state_type: -@shadow_type: -@area: -@widget: -@detail: -@points: -@n_points: -@fill: - - - - - - - -@style: -@window: -@state_type: -@shadow_type: -@area: -@widget: -@detail: -@x: -@y: -@width: -@height: - - - - - - - -@style: -@window: -@state_type: -@shadow_type: -@area: -@widget: -@detail: -@x: -@y: -@width: -@height: -@gap_side: -@gap_x: -@gap_width: - - - - - - - -@style: -@window: -@state_type: -@shadow_type: -@area: -@widget: -@detail: -@x: -@y: -@width: -@height: -@orientation: - - - - - - - -@style: -@window: -@state_type: -@area: -@widget: -@detail: -@step: -@x: -@y: -@width: -@height: - - - - - - - -@style: -@window: -@state_type: -@area: -@widget: -@detail: -@x: -@y: -@string: - - - - - - - -@style: -@window: -@state_type: -@shadow_type: -@area: -@widget: -@detail: -@x: -@y: -@width: -@height: - - - - - - - -@style: -@window: -@state_type: -@area: -@widget: -@detail: -@y1_: -@y2_: -@x: - - - - - - - -@style: -@window: -@state_type: -@area: -@widget: -@detail: -@x: -@y: -@expander_style: - - - - - - - -@style: -@window: -@state_type: -@use_text: -@area: -@widget: -@detail: -@x: -@y: -@layout: - - - - - - - -@style: -@window: -@state_type: -@area: -@widget: -@detail: -@edge: -@x: -@y: -@width: -@height: - - - - - - - -@widget: -@drawable: -@area: -@location: -@is_primary: -@direction: -@draw_arrow: - - - - -A struct that specifies a border around a rectangular area that can -be of different width on each side. - - -@left: The width of the left border. -@right: The width of the right border. -@top: The width of the top border. -@bottom: The width of the bottom border. - - - - - - -@Returns: - - - - - - - -@border_: -@Returns: - - - - - - - -@border_: - - - - - - - -@type_name: -@property_name: -@origin: -@value: - - - - - - -@pspec: -@rc_string: -@property_value: -@Returns: - - diff --git a/docs/reference/gtk/tmpl/gtktable.sgml b/docs/reference/gtk/tmpl/gtktable.sgml index 25e36e7844..4a0d7cae74 100644 --- a/docs/reference/gtk/tmpl/gtktable.sgml +++ b/docs/reference/gtk/tmpl/gtktable.sgml @@ -47,6 +47,9 @@ table will resize themselves to the size of the largest widget in the table. + + + The GtkTable structure holds the data for the actual table itself. diff --git a/docs/reference/gtk/tmpl/gtktearoffmenuitem.sgml b/docs/reference/gtk/tmpl/gtktearoffmenuitem.sgml index 2f2560bb0d..450c4aa09a 100644 --- a/docs/reference/gtk/tmpl/gtktearoffmenuitem.sgml +++ b/docs/reference/gtk/tmpl/gtktearoffmenuitem.sgml @@ -39,6 +39,9 @@ menu window. + + + The #GtkTearoffMenuItem-struct struct contains private data only, and @@ -51,6 +54,7 @@ should be accessed using the functions below. Creates a new #GtkTearoffMenuItem. +@void: @Returns: a new #GtkTearoffMenuItem. diff --git a/docs/reference/gtk/tmpl/gtktesting.sgml b/docs/reference/gtk/tmpl/gtktesting.sgml deleted file mode 100644 index bcbc3d72b1..0000000000 --- a/docs/reference/gtk/tmpl/gtktesting.sgml +++ /dev/null @@ -1,177 +0,0 @@ - -Testing - - -Utilities for testing GTK+ applications - - - - - - - - - - - - - - - - - - - -@window_title: -@dialog_text: -@Returns: - - - - - - - -@widget_type: -@first_property_name: -@Varargs: -@Returns: - - - - - - - -@window_title: -@dialog_text: -@Varargs: -@Returns: - - - - - - - -@widget: -@label_pattern: -@Returns: - - - - - - - -@base_widget: -@widget_type: -@Returns: - - - - - - - -@widget: -@label_pattern: -@widget_type: -@Returns: - - - - - - - -@argcp: -@argvp: -@Varargs: - - - - - - - -@n_types: -@Returns: - - - - - - - - - - - - - - -@widget: -@Returns: - - - - - - - -@widget: -@percentage: - - - - - - - -@spinner: -@button: -@upwards: -@Returns: - - - - - - - -@widget: -@Returns: - - - - - - - -@widget: -@string: - - - - - - - -@widget: -@button: -@modifiers: -@Returns: - - - - - - - -@widget: -@keyval: -@modifiers: -@Returns: - - diff --git a/docs/reference/gtk/tmpl/gtktext.sgml b/docs/reference/gtk/tmpl/gtktext.sgml deleted file mode 100644 index d4eb68eaf4..0000000000 --- a/docs/reference/gtk/tmpl/gtktext.sgml +++ /dev/null @@ -1,238 +0,0 @@ - -GtkText - - -A text widget - - - - - -#GtkText is deprecated and unsupported. It is known to be -buggy. To use it, you must define the symbol %GTK_ENABLE_BROKEN -prior to including the GTK+ header files. Use #GtkTextView instead. - - -A #GtkText widget allows one to display any given text and manipulate it -by deleting from one point to another, selecting a region, and various -other functions as outlined below. It is inherited from #GtkEditable. - - - - - - - - - - - - -Most of the #GtkText-struct struct members should not be accessed directly. -Listed below are a few exceptions and how to use them. - - - - - - - - -@text: the object which received the signal. -@arg1: -@arg2: - - - -Used by the #GtkText widget to keep track of the size of its horizontal -text. - - - - -Boolean value indicating whether line wrap is enabled or not. - - - - -Used by the #GtkText widget to keep track of the size of its vertical -text. - - - - -Boolean value indicated whether word wrap is enabled or not. - - - - -Internal #GtkText data type. - - - - - - -Internal #GtkText data type. Should not be accessed directly. - - - -@property: -@offset: -@index: - - - -Creates a new #GtkText widget, initialized with the given pointers to -#GtkAdjustments. These pointers can be used to track the viewing position -of the #GtkText widget. Passing %NULL to either or both of them will make -the #GtkText create its own. You can set these later with the function -gtk_text_set_adjustment(). - - -@hadj: horizontal adjustment. -@vadj: vertical adjustment. -@Returns: the new #GtkText widget. - - - - -Sets whether the #GtkText widget can be edited by the user or not. This -still allows you the programmer to make changes with the various #GtkText -functions. - - -@text: the #GtkText widget -@editable: %TRUE makes it editable, %FALSE makes it immutable by the user - - - - -Sets whether the #GtkText widget wraps words down to the next line if it -can't be completed on the current line. - - -@text: the #GtkText widget -@word_wrap: %TRUE makes it word wrap, %FALSE disables word wrapping - - - - -Controls how #GtkText handles long lines of continuous text. If line wrap -is on, the line is broken when it reaches the extent of the #GtkText widget -viewing area and the rest is displayed on the next line. If it is not set, -the line continues regardless size of current viewing area. Similar to word -wrap but it disregards word boundaries. - - -@text: the #GtkText widget -@line_wrap: %TRUE turns line wrap on, %FALSE turns it off - - - - -Allows you to set #GtkAdjustment pointers which in turn allows you to -keep track of the viewing position of the #GtkText widget. - - -@text: the #GtkText widget -@hadj: the horizontal adjustment -@vadj: the vertical adjustment - - - - -Sets the cursor at the given point. In this case a point constitutes -the number of characters from the extreme upper left corner of the #GtkText -widget. - - -@text: the #GtkText widget -@index: the number of characters from the upper left corner - - - - -Gets the current position of the cursor as the number of characters from -the upper left corner of the #GtkText widget. - - -@text: the #GtkText widget -@Returns: the number of characters from the upper left corner - - - - -Returns the length of the all the text contained within the #GtkText widget; -disregards current point position. - - -@text: the #GtkText widget -@Returns: the length of the text - - - - -Freezes the #GtkText widget which disallows redrawing of the widget until -it is thawed. This is useful if a large number of changes are going to -made to the text within the widget, reducing the amount of flicker seen -by the user. - - -@text: the #GtkText widget - - - - -Allows the #GtkText widget to be redrawn again by GTK. - - -@text: the #GtkText widget - - - - -Inserts given text into the #GtkText widget with the given properties as -outlined below. - - -@text: the #GtkText widget -@font: the #GdkFont to use -@fore: the foreground color to insert with -@back: the background color to insert with -@chars: the actual text to be inserted -@length: the length of the text to be inserted, passing -1 makes it insert -all the text. - - - - -Deletes from the current point position backward the given number of -characters. - - -@text: the #GtkText widget -@nchars: the number of characters to delete -@Returns: %TRUE if the operation was successful, otherwise returns %FALSE - - - - -Deletes from the current point position forward the given number of -characters. - - -@text: the #GtkText widget -@nchars: the number of characters to delete -@Returns: %TRUE if the operation was successful, otherwise returns %FALSE - - - - -Returns the character at the given index within the #GtkText widget. - - -@t: the #GtkText widget -@index: the number of characters from the upper left corner - - diff --git a/docs/reference/gtk/tmpl/gtktextbuffer.sgml b/docs/reference/gtk/tmpl/gtktextbuffer.sgml index 802d74bf3b..f7cfdef356 100644 --- a/docs/reference/gtk/tmpl/gtktextbuffer.sgml +++ b/docs/reference/gtk/tmpl/gtktextbuffer.sgml @@ -24,6 +24,9 @@ types related to the text widget and how they work together. + + + diff --git a/docs/reference/gtk/tmpl/gtktextiter.sgml b/docs/reference/gtk/tmpl/gtktextiter.sgml deleted file mode 100644 index c7cf653623..0000000000 --- a/docs/reference/gtk/tmpl/gtktextiter.sgml +++ /dev/null @@ -1,907 +0,0 @@ - -GtkTextIter - - -Text buffer iterator - - - -You may wish to begin by reading the text widget -conceptual overview which gives an overview of all the objects and data -types related to the text widget and how they work together. - - - - - - - - - - - - - - - - - - - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@start: -@end: -@Returns: - - - - - - - -@start: -@end: -@Returns: - - - - - - - -@start: -@end: -@Returns: - - - - - - - -@start: -@end: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@toggled_on: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@tag: -@Returns: - - - - - - - -@iter: -@tag: -@Returns: - - - - - - - -@iter: -@tag: -@Returns: - - - - - - - -@iter: -@tag: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@default_setting: -@Returns: - - - - - - - -@iter: -@default_editability: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@values: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@count: -@Returns: - - - - - - - -@iter: -@count: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@count: -@Returns: - - - - - - - -@iter: -@count: -@Returns: - - - - - - - -@iter: -@count: -@Returns: - - - - - - - -@iter: -@count: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@count: -@Returns: - - - - - - - -@iter: -@count: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@count: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@count: -@Returns: - - - - - - - -@iter: -@count: -@Returns: - - - - - - - -@iter: -@count: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@count: -@Returns: - - - - - - - -@iter: -@count: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@count: -@Returns: - - - - - - - -@iter: -@count: -@Returns: - - - - - - - -@iter: -@char_offset: - - - - - - - -@iter: -@line_number: - - - - - - - -@iter: -@char_on_line: - - - - - - - -@iter: -@byte_on_line: - - - - - - - -@iter: -@byte_on_line: - - - - - - - -@iter: -@char_on_line: - - - - - - - -@iter: - - - - - - - -@iter: -@Returns: - - - - - - - -@iter: -@tag: -@Returns: - - - - - - - -@iter: -@tag: -@Returns: - - - - - - - -@ch: -@user_data: -@Returns: - - - - - - - -@iter: -@pred: -@user_data: -@limit: -@Returns: - - - - - - - -@iter: -@pred: -@user_data: -@limit: -@Returns: - - - - - - - -@GTK_TEXT_SEARCH_VISIBLE_ONLY: -@GTK_TEXT_SEARCH_TEXT_ONLY: - - - - - - -@iter: -@str: -@flags: -@match_start: -@match_end: -@limit: -@Returns: - - - - - - - -@iter: -@str: -@flags: -@match_start: -@match_end: -@limit: -@Returns: - - - - - - - -@lhs: -@rhs: -@Returns: - - - - - - - -@lhs: -@rhs: -@Returns: - - - - - - - -@iter: -@start: -@end: -@Returns: - - - - - - - -@first: -@second: - - diff --git a/docs/reference/gtk/tmpl/gtktextmark.sgml b/docs/reference/gtk/tmpl/gtktextmark.sgml index 0db80bf7a0..a15b76271f 100644 --- a/docs/reference/gtk/tmpl/gtktextmark.sgml +++ b/docs/reference/gtk/tmpl/gtktextmark.sgml @@ -56,6 +56,9 @@ Marks are typically created using the gtk_text_buffer_create_mark() function. + + + diff --git a/docs/reference/gtk/tmpl/gtktexttag.sgml b/docs/reference/gtk/tmpl/gtktexttag.sgml index c52ee0f974..3126342702 100644 --- a/docs/reference/gtk/tmpl/gtktexttag.sgml +++ b/docs/reference/gtk/tmpl/gtktexttag.sgml @@ -34,6 +34,9 @@ It is working (with minor issues) since 2.8. + + + @@ -477,6 +480,7 @@ modified directly. +@void: @Returns: diff --git a/docs/reference/gtk/tmpl/gtktexttagtable.sgml b/docs/reference/gtk/tmpl/gtktexttagtable.sgml index ab1341f37e..748682f2d5 100644 --- a/docs/reference/gtk/tmpl/gtktexttagtable.sgml +++ b/docs/reference/gtk/tmpl/gtktexttagtable.sgml @@ -24,6 +24,9 @@ types related to the text widget and how they work together. + + + @@ -69,6 +72,7 @@ types related to the text widget and how they work together. +@void: @Returns: diff --git a/docs/reference/gtk/tmpl/gtktextview.sgml b/docs/reference/gtk/tmpl/gtktextview.sgml index 2da1a2aac9..bd8168d015 100644 --- a/docs/reference/gtk/tmpl/gtktextview.sgml +++ b/docs/reference/gtk/tmpl/gtktextview.sgml @@ -23,6 +23,9 @@ types related to the text widget and how they work together. + + + @@ -254,6 +257,7 @@ types related to the text widget and how they work together. +@void: @Returns: @@ -284,6 +288,24 @@ types related to the text widget and how they work together. @Returns: + + + + + +@text_view: +@Returns: + + + + + + + +@text_view: +@Returns: + + @@ -554,6 +576,7 @@ multiple views. +@void: @Returns: @@ -841,6 +864,24 @@ multiple views. @Returns: + + + + + +@text_view: +@event: +@Returns: + + + + + + + +@text_view: + + The priority at which the text view validates onscreen lines diff --git a/docs/reference/gtk/tmpl/gtktoggleaction.sgml b/docs/reference/gtk/tmpl/gtktoggleaction.sgml deleted file mode 100644 index c6ceec7b55..0000000000 --- a/docs/reference/gtk/tmpl/gtktoggleaction.sgml +++ /dev/null @@ -1,100 +0,0 @@ - -GtkToggleAction - - -An action which can be toggled between two states - - - -A #GtkToggleAction corresponds roughly to a #GtkCheckMenuItem. It has an -"active" state specifying whether the action has been checked or not. - - - - - - - - - - - - -The GtkToggleAction struct contains only -private members and should not be accessed directly. - - - - - - - - -@toggleaction: the object which received the signal. - - - - - - - - - - - - - - - - -@name: -@label: -@tooltip: -@stock_id: -@Returns: - - - - - - - -@action: - - - - - - - -@action: -@is_active: - - - - - - - -@action: -@Returns: - - - - - - - -@action: -@draw_as_radio: - - - - - - - -@action: -@Returns: - - diff --git a/docs/reference/gtk/tmpl/gtktogglebutton.sgml b/docs/reference/gtk/tmpl/gtktogglebutton.sgml index 36204d047f..815d6a480b 100644 --- a/docs/reference/gtk/tmpl/gtktogglebutton.sgml +++ b/docs/reference/gtk/tmpl/gtktogglebutton.sgml @@ -80,6 +80,9 @@ void make_toggles (void) { + + + The #GtkToggleButton struct contains private data only, and should be manipulated using the functions below. @@ -114,6 +117,7 @@ Should be connected if you wish to perform an action whenever the Creates a new toggle button. A widget should be packed into the button, as in gtk_button_new(). +@void: @Returns: a new toggle button. @@ -152,14 +156,6 @@ Creates a new toggle button with a text label. @Returns: - - -This is a deprecated macro, and is only maintained for compatibility reasons. - - -@Deprecated: Use gtk_toggle_button_set_active() instead. - - Emits the toggled diff --git a/docs/reference/gtk/tmpl/gtktoggletoolbutton.sgml b/docs/reference/gtk/tmpl/gtktoggletoolbutton.sgml index 21a12e9dec..738e4b9291 100644 --- a/docs/reference/gtk/tmpl/gtktoggletoolbutton.sgml +++ b/docs/reference/gtk/tmpl/gtktoggletoolbutton.sgml @@ -45,6 +45,9 @@ A GtkToolItem containing a toggle button + + + The #GtkToggleToolButton struct contains only private data and @@ -69,6 +72,7 @@ A GtkToolItem containing a toggle button +@void: @Returns: diff --git a/docs/reference/gtk/tmpl/gtktoolbar.sgml b/docs/reference/gtk/tmpl/gtktoolbar.sgml index 86c59d672c..ce04c4ebf4 100644 --- a/docs/reference/gtk/tmpl/gtktoolbar.sgml +++ b/docs/reference/gtk/tmpl/gtktoolbar.sgml @@ -41,6 +41,9 @@ the #GtkToolbar::popup-context-menu signal. + + + The #GtkToolbar struct only contains private data and should only be @@ -104,11 +107,6 @@ accessed through the function described below. - - - - - @@ -149,18 +147,6 @@ accessed through the function described below. - - -#GtkToolbarChildType is used to set the type of new elements that are added -to a #GtkToolbar. - - -@GTK_TOOLBAR_CHILD_SPACE: a space in the style of the toolbar's #GtkToolbarSpaceStyle. -@GTK_TOOLBAR_CHILD_BUTTON: a #GtkButton. -@GTK_TOOLBAR_CHILD_TOGGLEBUTTON: a #GtkToggleButton. -@GTK_TOOLBAR_CHILD_RADIOBUTTON: a #GtkRadioButton. -@GTK_TOOLBAR_CHILD_WIDGET: a standard #GtkWidget. - @@ -169,21 +155,12 @@ to a #GtkToolbar. @GTK_TOOLBAR_SPACE_EMPTY: @GTK_TOOLBAR_SPACE_LINE: - - - - - -@type: -@widget: -@icon: -@label: - +@void: @Returns: the newly-created toolbar. @@ -256,24 +233,6 @@ to a #GtkToolbar. @show_arrow: - - - - - -@toolbar: -@orientation: - - - - - - - -@toolbar: -@enable: - - @@ -291,15 +250,6 @@ to a #GtkToolbar. @Returns: - - - - - -@toolbar: -@Returns: - - @@ -318,15 +268,6 @@ to a #GtkToolbar. @Returns: - - - - - -@toolbar: -@Returns: - - @@ -336,166 +277,6 @@ to a #GtkToolbar. @Returns: - - - - - -@toolbar: -@text: -@tooltip_text: -@tooltip_private_text: -@icon: -@callback: -@user_data: -@Returns: - - - - - - - -@toolbar: -@text: -@tooltip_text: -@tooltip_private_text: -@icon: -@callback: -@user_data: -@Returns: - - - - - - - -@toolbar: -@text: -@tooltip_text: -@tooltip_private_text: -@icon: -@callback: -@user_data: -@position: -@Returns: - - - - - - - -@toolbar: - - - - - - - -@toolbar: - - - - - - - -@toolbar: -@position: - - - - - - - - - - -@toolbar: -@type: -@widget: -@text: -@tooltip_text: -@tooltip_private_text: -@icon: -@callback: -@user_data: -@Returns: - - - - - - - -@toolbar: -@type: -@widget: -@text: -@tooltip_text: -@tooltip_private_text: -@icon: -@callback: -@user_data: -@Returns: - - - - - - - -@toolbar: -@type: -@widget: -@text: -@tooltip_text: -@tooltip_private_text: -@icon: -@callback: -@user_data: -@position: -@Returns: - - - - - - - -@toolbar: -@widget: -@tooltip_text: -@tooltip_private_text: - - - - - - - -@toolbar: -@widget: -@tooltip_text: -@tooltip_private_text: - - - - - - - -@toolbar: -@widget: -@tooltip_text: -@tooltip_private_text: -@position: - - @@ -505,21 +286,6 @@ to a #GtkToolbar. @style: - - - - - -@toolbar: -@stock_id: -@tooltip_text: -@tooltip_private_text: -@callback: -@user_data: -@position: -@Returns: - - @@ -529,15 +295,6 @@ to a #GtkToolbar. @icon_size: - - - - - -@toolbar: -@position: - - diff --git a/docs/reference/gtk/tmpl/gtktoolbutton.sgml b/docs/reference/gtk/tmpl/gtktoolbutton.sgml index 95561b6091..10d9e1d9fc 100644 --- a/docs/reference/gtk/tmpl/gtktoolbutton.sgml +++ b/docs/reference/gtk/tmpl/gtktoolbutton.sgml @@ -72,6 +72,9 @@ the button does not have a icon. + + + The #GtkToolButton struct contains only private. It should only be diff --git a/docs/reference/gtk/tmpl/gtktoolitem.sgml b/docs/reference/gtk/tmpl/gtktoolitem.sgml deleted file mode 100644 index 53a5799ac2..0000000000 --- a/docs/reference/gtk/tmpl/gtktoolitem.sgml +++ /dev/null @@ -1,328 +0,0 @@ - -GtkToolItem - - - - - - - - - - - - - - - - - - - - - - - - - - - - -@toolitem: the object which received the signal. -@Returns: - - - - - - -@toolitem: the object which received the signal. -@arg1: -@arg2: -@arg3: -@Returns: - - - - - - -@toolitem: the object which received the signal. - - - - - - - - - - - - - - - - - - - - - -@Returns: - - - - - - - -@tool_item: -@homogeneous: - - - - - - - -@tool_item: -@Returns: - - - - - - - -@tool_item: -@expand: - - - - - - - -@tool_item: -@Returns: - - - - - - - -@tool_item: -@tooltips: -@tip_text: -@tip_private: - - - - - - - -@tool_item: -@text: - - - - - - - -@tool_item: -@markup: - - - - - - - -@tool_item: -@use_drag_window: - - - - - - - -@tool_item: -@Returns: - - - - - - - -@tool_item: -@visible_horizontal: - - - - - - - -@tool_item: -@Returns: - - - - - - - -@tool_item: -@visible_vertical: - - - - - - - -@tool_item: -@Returns: - - - - - - - -@tool_item: -@is_important: - - - - - - - -@tool_item: -@Returns: - - - - - - - -@tool_item: -@Returns: - - - - - - - -@tool_item: -@Returns: - - - - - - - -@tool_item: -@Returns: - - - - - - - -@tool_item: -@Returns: - - - - - - - -@tool_item: -@Returns: - - - - - - - -@tool_item: -@Returns: - - - - - - - -@tool_item: -@Returns: - - - - - - - -@tool_item: -@Returns: - - - - - - - -@tool_item: -@menu_item_id: -@Returns: - - - - - - - -@tool_item: -@menu_item_id: -@menu_item: - - - - - - - -@tool_item: - - - - - - - -@tool_item: - - - - - - - -@tool_item: -@Returns: - - diff --git a/docs/reference/gtk/tmpl/gtktooltip.sgml b/docs/reference/gtk/tmpl/gtktooltip.sgml index 71edd3584e..15a8f4374b 100644 --- a/docs/reference/gtk/tmpl/gtktooltip.sgml +++ b/docs/reference/gtk/tmpl/gtktooltip.sgml @@ -79,6 +79,9 @@ return %TRUE to show the window, %FALSE to not show it. + + + diff --git a/docs/reference/gtk/tmpl/gtktooltips.sgml b/docs/reference/gtk/tmpl/gtktooltips.sgml deleted file mode 100644 index 928950adfd..0000000000 --- a/docs/reference/gtk/tmpl/gtktooltips.sgml +++ /dev/null @@ -1,191 +0,0 @@ - -GtkTooltips - - -Add tips to your widgets - - - -#GtkTooltips has been deprecated in GTK+ 2.12, in favor of the new -#GtkTooltip API. - - -Tooltips are the messages that appear next to a widget when the mouse pointer is held over it for a short amount of time. They are especially helpful for adding more verbose descriptions of things such as buttons in a toolbar. - - -An individual tooltip belongs to a group of tooltips. A group is created with a call to gtk_tooltips_new(). Every tooltip in the group can then be turned off with a call to gtk_tooltips_disable() and enabled with gtk_tooltips_enable(). - - -The length of time the user must keep the mouse over a widget before the tip is shown, can be altered with gtk_tooltips_set_delay(). This is set on a 'per group of tooltips' basis. - - -To assign a tip to a particular #GtkWidget, gtk_tooltips_set_tip() is used. - - - -Tooltips can only be set on widgets which have their own X window and -receive enter and leave events. -To check if a widget has its own window use GTK_WIDGET_NO_WINDOW(). -To add a tooltip to a widget that doesn't have its own window, place the -widget inside a #GtkEventBox and add a tooltip to that instead. - - - -The default appearance of all tooltips in a program is determined by the current GTK+ theme that the user has selected. - - -Information about the tooltip (if any) associated with an arbitrary widget can be retrieved using gtk_tooltips_data_get(). - - - -Adding tooltips to buttons. - - GtkWidget *load_button, *save_button, *hbox; - GtkTooltips *button_bar_tips; - - button_bar_tips = gtk_tooltips_new (); - - /* Create the buttons and pack them into a GtkHBox */ - hbox = gtk_hbox_new (TRUE, 2); - - load_button = gtk_button_new_with_label ("Load a file"); - gtk_box_pack_start (GTK_BOX (hbox), load_button, TRUE, TRUE, 2); - gtk_widget_show (load_button); - - save_button = gtk_button_new_with_label ("Save a file"); - gtk_box_pack_start (GTK_BOX (hbox), save_button, TRUE, TRUE, 2); - gtk_widget_show (save_button); - gtk_widget_show (hbox); - - /* Add the tips */ - gtk_tooltips_set_tip (GTK_TOOLTIPS (button_bar_tips), load_button, - "Load a new document into this window", - "Requests the filename of a document. - This will then be loaded into the current - window, replacing the contents of whatever - is already loaded."); - gtk_tooltips_set_tip (GTK_TOOLTIPS (button_bar_tips), save_button, - "Saves the current document to a file", - "If you have saved the document previously, - then the new version will be saved over the - old one. Otherwise, you will be prompted for - a filename."); - - - - - - - -#GtkToolbar -Create groups of widgets with their own tooltips. - - -#GtkTipsQuery -Query tooltips to create context-sensitive help. - - - - - - - - -Holds information about a group of tooltips. Fields should be changed using the functions provided, rather than directly accessing the struct's members. - - - - - -tooltips is the #GtkTooltips group that this tooltip belongs to. widget is the #GtkWidget that this tooltip data is associated with. tip_text is a string containing the tooltip message itself. - -tip_private is a string that is not shown as the default tooltip. Instead, this message may be more informative and go towards forming a context-sensitive help system for your application. (FIXME: how to actually "switch on" private tips?) - - -@tooltips: -@widget: -@tip_text: -@tip_private: -@Deprecated: 2.12: - - - -Creates an empty group of tooltips. This function initialises a #GtkTooltips structure. Without at least one such structure, you can not add tips to your application. - - -@Returns: a new #GtkTooltips group for you to use. -@Deprecated: 2.12: - - - - -Allows the user to see your tooltips as they navigate your application. - - -@tooltips: a #GtkTooltips. -@Deprecated: 2.12: - - - - -Causes all tooltips in @tooltips to become inactive. Any widgets that have tips associated with that group will no longer display their tips until they are enabled again with gtk_tooltips_enable(). - - -@tooltips: a #GtkTooltips. -@Deprecated: 2.12: - - - - -Sets the time between the user moving the mouse over a widget and the widget's tooltip appearing. - - -@tooltips: a #GtkTooltips. -@delay: an integer value representing milliseconds. -@Deprecated: 2.12: - - - - - -@tooltips: -@widget: -@tip_text: -@tip_private: - - - - -Retrieves any #GtkTooltipsData previously associated with the given widget. - - -@widget: a #GtkWidget. -@Returns: a #GtkTooltipsData struct, or %NULL if the widget has no tooltip. -@Deprecated: 2.12: - - - - -Ensures that the window used for displaying the given @tooltips is created. - - -Applications should never have to call this function, since GTK+ takes -care of this. - - -@tooltips: a #GtkToolTips -@Deprecated: 2.12: - - - - - - - -@tip_window: -@tooltips: -@current_widget: -@Returns: -@Deprecated: 2.12: - - diff --git a/docs/reference/gtk/tmpl/gtktree.sgml b/docs/reference/gtk/tmpl/gtktree.sgml deleted file mode 100644 index 2cd276135d..0000000000 --- a/docs/reference/gtk/tmpl/gtktree.sgml +++ /dev/null @@ -1,306 +0,0 @@ - -GtkTree - - -A tree widget - - - - - -#GtkTree is deprecated and unsupported. It is known to be -buggy. To use it, you must define the symbol %GTK_ENABLE_BROKEN -prior to including the GTK+ header files. Use #GtkTreeView instead. - - -The #GtkTree widget is a container that shows users a list of items, in a tree format complete with branches and leafnodes. Branches can be expanded to show their child items, or collapsed to hide them. - - - - -#GtkTreeList for the items to put into a #GtkTree. - - -#GtkScrolledWindow for details on how to scroll around a #GtkTree. - - - - - - - - -struct _GtkTree -{ - GtkContainer container; - GList *children; - GtkTree* root_tree; /* owner of selection list */ - GtkWidget* tree_owner; - GList *selection; - guint level; - guint indent_value; - guint current_indent; - guint selection_mode : 2; - guint view_mode : 1; - guint view_line : 1; -}; - - - - - - -This signal is emitted by @tree whenever @widget is about to be selected. - - -@tree: the object which received the signal. -@widget: The child that is about to be selected. - - - -This signal is emitted by the root tree whenever the selection changes. - - -@tree: the object which received the signal. - - - -This signal is emitted by @tree whenever @widget is about to be unselected. - - -@tree: the object which received the signal. -@widget: The child that is about to be unselected. - - - -A macro that returns a boolean value which indicates if @obj is a root tree or not. - - -@obj: A pointer to the #GtkTree. @obj will accept any pointer, but if the pointer does not point to a #GtkTree, the results are undefined. - - - - -A macro that returns the root tree of @obj. - - -If @obj is already a root tree, @obj is cast to #GtkTree and returned. - - -@obj: A pointer to the #GtkTree. @obj will accept any pointer, but if the pointer does not point to a #GtkTree, the results are undefined. - - - - - - - -@obj: - - - - - - - -@GTK_TREE_VIEW_LINE: -@GTK_TREE_VIEW_ITEM: - - - -Creates a new #GtkTree. - - -@Returns: A pointer to the newly allocated widget. - - - - -Adds the #GtkTreeItem in @tree_item to the end of the items in @tree. - - -@tree: A pointer to a #GtkTree. -@tree_item: A pointer to the #GtkWidget that is to be appended to the tree. - - - - -Adds the #GtkTreeItem in @tree_item to the start of the items in @tree. - - -@tree: A pointer to a #GtkTree. -@tree_item: A pointer to the #GtkWidget that is to be prepended to the tree. - - - - -Adds the #GtkTreeItem in @tree_item to the list of items in @tree at the position indicated by @position. - - -@tree: A pointer to a #GtkTree. -@tree_item: A pointer to the #GtkWidget that is to be added to the tree. -@position: A #gint that indicates the position in the tree, that the @tree_item is to be added at. - - - - -Removes a list of items from the #GtkTree in @tree. - - -If only one item is to be removed from the #GtkTree, gtk_container_remove() can be used instead. - - -Removing an item from a #GtkTree dereferences the item, and thus usually destroys the item and any subtrees it may contain. If the item is not to be destroyed, use g_object_ref() before removing it. - - -@tree: A pointer to a #GtkTree. -@items: A pointer to a #GList that contains the items to be removed. - - - - -Removes the items at positions between @start and @end from the #GtkTree @tree. - - -Removing an item from a #GtkTree dereferences the item, and thus usually destroys the item and any subtrees it may contain. If the item is not to be destroyed, use g_object_ref() before removing it. - - -@tree: A pointer to a #GtkTree. -@start: A #gint. -@end: A #gint. - - - - -Emits the #select_item signal for the child at position @item, and thus selects it (unless it is unselected in a signal handler). - - -@tree: A pointer to a #GtkTree. -@item: A #gint. - - - - -Emits the #unselect_item for the child at position @item, and thus unselects it. - - -@tree: A pointer to a #GtkTree. -@item: A #gint. - - - - -Emits the #select_item signal for the child @tree_item, and thus selects it (unless it is unselected in a signal handler). - - -@tree: A pointer to a #GtkTree. -@tree_item: A pointer to the #GtkWidget that is to be selected. - - - - -Emits the #unselect_item signal for the child @tree_item, and thus unselects it. - - -@tree: A pointer to a #GtkTree. -@tree_item: A pointer to the #GtkWidget that is to be selected. - - - - -Returns the position of @child in the #GtkTree @tree. - - -If @child is not a child of @tree, then -1 is returned. - - -@tree: A pointer to a #GtkTree. -@child: A pointer to a #GtkWidget. -@Returns: A #gint. - - - - -Sets the selection mode for the #GtkTree @tree. - - -@mode can be one of - - - - -%GTK_SELECTION_SINGLE for when only one item can be selected at a time. - - - - -%GTK_SELECTION_BROWSE for when one item must be selected. - - - - -%GTK_SELECTION_MULTIPLE for when many items can be selected at once. - - - - -%GTK_SELECTION_EXTENDED Reserved for later use. - - - - -The selection mode is only defined for a root tree, as the root tree "owns" the selection. - - -The default mode is %GTK_SELECTION_SINGLE. - - -@tree: A pointer to a #GtkTree. -@mode: A #GtkSelectionMode. - - - - -Sets the 'viewmode' for the #GtkTree in @tree. The 'viewmode' defines how the tree looks when an item is selected. - - -@mode can be one of: - - - - -%GTK_TREE_VIEW_LINE : When an item is selected the entire #GtkTreeItem is highlighted. - - - - -%GTK_TREE_VIEW_ITEM : When an item is selected only the selected item's child widget is highlighted. - - - - -The default mode is %GTK_TREE_VIEW_LINE. - - -@tree: A pointer to a #GtkTree. -@mode: A #GtkTreeViewMode. - - - - -Sets whether or not the connecting lines between branches and children are drawn. - - -@tree: A pointer to a #GtkTree. -@flag: A #guint, indicating %TRUE, or %FALSE. - - - - -Removes the item @child from the #GtkTree @tree. - - -@tree: A pointer to a #GtkTree. -@child: A pointer to the #GtkWidget that is to be removed from the tree. - - diff --git a/docs/reference/gtk/tmpl/gtktreednd.sgml b/docs/reference/gtk/tmpl/gtktreednd.sgml deleted file mode 100644 index 9d9273fc2d..0000000000 --- a/docs/reference/gtk/tmpl/gtktreednd.sgml +++ /dev/null @@ -1,141 +0,0 @@ - -GtkTreeView drag-and-drop - - -Interfaces for drag-and-drop support in GtkTreeView - - - -GTK+ supports Drag-and-Drop in tree views with a high-level and a low-level -API. - - -The low-level API consists of the GTK+ DND API, augmented by some treeview -utility functions: gtk_tree_view_set_drag_dest_row(), -gtk_tree_view_get_drag_dest_row(), gtk_tree_view_get_dest_row_at_pos(), -gtk_tree_view_create_row_drag_icon(), gtk_tree_set_row_drag_data() and -gtk_tree_get_row_drag_data(). This API leaves a lot of flexibility, but -nothing is done automatically, and implementing advanced features like -hover-to-open-rows or autoscrolling on top of this API is a lot of work. - - -On the other hand, if you write to the high-level API, then all the -bookkeeping of rows is done for you, as well as things like hover-to-open -and auto-scroll, but your models have to implement the -#GtkTreeDragSource and #GtkTreeDragDest interfaces. - - - - - - - - - - - - - - - - - - - - - -@g_iface: -@row_draggable: -@drag_data_get: -@drag_data_delete: - - - - - - -@drag_source: -@path: -@Returns: - - - - - - - -@drag_source: -@path: -@selection_data: -@Returns: - - - - - - - -@drag_source: -@path: -@Returns: - - - - - - - - - - - - - -@g_iface: -@drag_data_received: -@row_drop_possible: - - - - - - -@drag_dest: -@dest: -@selection_data: -@Returns: - - - - - - - -@drag_dest: -@dest_path: -@selection_data: -@Returns: - - - - - - - -@selection_data: -@tree_model: -@path: -@Returns: - - - - - - - -@selection_data: -@tree_model: -@path: -@Returns: - - diff --git a/docs/reference/gtk/tmpl/gtktreeitem.sgml b/docs/reference/gtk/tmpl/gtktreeitem.sgml deleted file mode 100644 index 2815e81009..0000000000 --- a/docs/reference/gtk/tmpl/gtktreeitem.sgml +++ /dev/null @@ -1,119 +0,0 @@ - -GtkTreeItem - - -The widget used for items in a GtkTree - - - - - -#GtkTree is deprecated and unsupported. It is known to be -buggy. To use it, you must define the symbol %GTK_ENABLE_BROKEN -prior to including the GTK+ header files. Use #GtkTreeView instead. - - - - - - - - - - - - - - - - - - - - - - - -@treeitem: the object which received the signal. - - - - - - -@treeitem: the object which received the signal. - - - - - - -@obj: - - - - - - - -@Returns: - - - - - - - -@label: -@Returns: - - - - - - - -@tree_item: -@subtree: - - - - - - - -@tree_item: - - - - - - - -@tree_item: - - - - - - - -@tree_item: - - - - - - - -@tree_item: - - - - - - - -@tree_item: - - diff --git a/docs/reference/gtk/tmpl/gtktreemodel.sgml b/docs/reference/gtk/tmpl/gtktreemodel.sgml index e16a9fdb79..07dcd45d0e 100644 --- a/docs/reference/gtk/tmpl/gtktreemodel.sgml +++ b/docs/reference/gtk/tmpl/gtktreemodel.sgml @@ -196,6 +196,9 @@ enum + + + @@ -327,6 +330,7 @@ section. +@void: @Returns: @@ -363,19 +367,10 @@ section. +@void: @Returns: - - -An alternate name for gtk_tree_path_new_first() provided for -compatibility reasons. - - -@Returns: A new #GtkTreePath. -@Deprecated: Use gtk_tree_path_new_first() instead. - - @@ -412,6 +407,16 @@ compatibility reasons. @Returns: + + + + + +@path: +@depth: +@Returns: + + @@ -664,18 +669,6 @@ compatibility reasons. @Returns: - - -A alternate name for gtk_tree_model_get_iter_first() provided for -compatibility reasons; this macro will be deprecated in future -versions of GTK+. - - -@tree_model: A #GtkTreeModel. -@iter: uninitialized #GtkTreeIter. -@Returns: %TRUE, if @iter was set. - - diff --git a/docs/reference/gtk/tmpl/gtktreemodelfilter.sgml b/docs/reference/gtk/tmpl/gtktreemodelfilter.sgml index bd6d1e31b0..cda44ec325 100644 --- a/docs/reference/gtk/tmpl/gtktreemodelfilter.sgml +++ b/docs/reference/gtk/tmpl/gtktreemodelfilter.sgml @@ -37,6 +37,9 @@ a #GtkTreePath indicating the root node for the filter at construction time. + + + The GtkTreeModelFilter struct contains only private fields. diff --git a/docs/reference/gtk/tmpl/gtktreemodelsort.sgml b/docs/reference/gtk/tmpl/gtktreemodelsort.sgml index b023f1af05..1582216b25 100644 --- a/docs/reference/gtk/tmpl/gtktreemodelsort.sgml +++ b/docs/reference/gtk/tmpl/gtktreemodelsort.sgml @@ -121,6 +121,9 @@ selection_changed (GtkTreeSelection *selection, gpointer data) + + + This should not be accessed directly. Use the accessor functions below. diff --git a/docs/reference/gtk/tmpl/gtktreeselection.sgml b/docs/reference/gtk/tmpl/gtktreeselection.sgml index e5a9b92ec7..9407aaa11e 100644 --- a/docs/reference/gtk/tmpl/gtktreeselection.sgml +++ b/docs/reference/gtk/tmpl/gtktreeselection.sgml @@ -43,6 +43,9 @@ selected row). + + + diff --git a/docs/reference/gtk/tmpl/gtktreesortable.sgml b/docs/reference/gtk/tmpl/gtktreesortable.sgml index 967add62e2..f5ebb8f6d8 100644 --- a/docs/reference/gtk/tmpl/gtktreesortable.sgml +++ b/docs/reference/gtk/tmpl/gtktreesortable.sgml @@ -19,6 +19,9 @@ to sort the model. + + + diff --git a/docs/reference/gtk/tmpl/gtktreestore.sgml b/docs/reference/gtk/tmpl/gtktreestore.sgml index f3c5c97ad8..efa84558c0 100644 --- a/docs/reference/gtk/tmpl/gtktreestore.sgml +++ b/docs/reference/gtk/tmpl/gtktreestore.sgml @@ -44,6 +44,9 @@ column. The "type" attribute specifies the data type for the column. + + + diff --git a/docs/reference/gtk/tmpl/gtktreeview.sgml b/docs/reference/gtk/tmpl/gtktreeview.sgml index 7422057efe..549b2e6212 100644 --- a/docs/reference/gtk/tmpl/gtktreeview.sgml +++ b/docs/reference/gtk/tmpl/gtktreeview.sgml @@ -77,6 +77,9 @@ GtkTreeViewColumn objects as <child> elements in UI definitions. + + + @@ -447,6 +450,7 @@ has some similarity to strcmp() returning 0 for equal strings. +@void: @Returns: @@ -953,30 +957,6 @@ has some similarity to strcmp() returning 0 for equal strings. @Returns: - - - - - -@tree_view: -@wx: -@wy: -@tx: -@ty: - - - - - - - -@tree_view: -@tx: -@ty: -@wx: -@wy: - - diff --git a/docs/reference/gtk/tmpl/gtktreeviewcolumn.sgml b/docs/reference/gtk/tmpl/gtktreeviewcolumn.sgml index 96cb94b98e..5340150e27 100644 --- a/docs/reference/gtk/tmpl/gtktreeviewcolumn.sgml +++ b/docs/reference/gtk/tmpl/gtktreeviewcolumn.sgml @@ -26,6 +26,9 @@ they work together. + + + The sizing method the column uses to determine its width. Please note @@ -157,6 +160,7 @@ calling gtk_tree_view_column_set_cell_data_func() +@void: @Returns: @@ -199,15 +203,6 @@ calling gtk_tree_view_column_set_cell_data_func() @tree_column: - - - - - -@tree_column: -@Returns: - - diff --git a/docs/reference/gtk/tmpl/gtktypeutils.sgml b/docs/reference/gtk/tmpl/gtktypeutils.sgml index 861c9943b5..69a4a26520 100644 --- a/docs/reference/gtk/tmpl/gtktypeutils.sgml +++ b/docs/reference/gtk/tmpl/gtktypeutils.sgml @@ -18,154 +18,7 @@ managed at runtime. - - -#GtkType is unique integer identifying the type. The guts of the -information about the type is held in a private struct named -#GtkTypeNode. - - - - - -#GtkFundamentalType is an enumerated type which lists all the possible -fundamental types (e.g. char, uchar, int, -long, float, etc). - - - - - -Returns the type name of @class. - - -@class: a #GtkTypeClass. -@Deprecated: Use g_type_name() and G_TYPE_FROM_CLASS() instead. - - - - -Returns the type of @class. - - -@class: a #GtkTypeClass. -@Deprecated: Use G_TYPE_FROM_CLASS() instead. - - - - -Returns %TRUE if @type is a %GTK_TYPE_OBJECT. - - -@type: a #GtkType. -@Deprecated: Use G_TYPE_IS_OBJECT() instead. - - - - -The highest-numbered structured or flat enumerated type value. - - -@Deprecated: Use #G_TYPE_LAST_RESERVED_FUNDAMENTAL - 1 instead. - - - - -The maximum fundamental enumerated type value. - - -@Deprecated: Use #G_TYPE_FUNDAMENTAL_MAX instead. - - - - -Use in place of offsetof(), which is used if it exists. - - -@Deprecated: Use G_STRUCT_OFFSET() instead. - - - - -Casts the object in @tobj into @cast. If %G_DISABLE_CAST_CHECKS is -defined, just cast it. Otherwise, check to see if we can cast @tobj -into a @cast. - - - - - - -Casts the object in @tobj into @cast. If %G_DISABLE_CAST_CHECKS is -defined, just cast it. Otherwise, check to see if we can cast @tobj -into a @cast. - - - -@tclass: a #GtkClassInitFunc -@cast_type: a GTK+ type. -@cast: a C type - - - - -Determines whether @type_object is a type of @otype. - - - -@type_object: a #GtkTypeObject object - - - - -Determines whether @type_class is a type of @otype. - - - -@type_class: a #GtkTypeClass class. - - - - -Gets the class of @tobj. - - - -@tobj: a #GtkObject. - - - - -Converts a GTK+ type into a fundamental type. - - - - - - -Just a macroized cast into a #GtkSignalFunc. - - -@f: - - - - -Defines a function pointer. - - - - - -Defines a function pointer. - - - - - -Defines a function pointer. - - + @@ -177,14 +30,6 @@ Defines a function pointer. @Returns: #gint - - -Defines a function pointer. - - -@data: #gpointer - - Defines a function pointer. @@ -196,21 +41,6 @@ Defines a function pointer. @args: #GtkArg* - - -Defines a function pointer. - - - - - -A #GtkTypeObject defines the minimum structure requirements -for type instances. Type instances returned from gtk_type_new () -and initialized through a #GtkObjectInitFunc need to directly inherit -from this structure or at least copy its fields one by one. - - - This is a structure that we use to pass in typed values (and names). @@ -219,407 +49,3 @@ This is a structure that we use to pass in typed values (and names). @type: @name: - - -Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_CHAR. - - -@a: a #GtkArg. - - - - -Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_UCHAR. - - -@a: a #GtkArg. - - - - -Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_BOOL. - - -@a: a #GtkArg. - - - - -Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_INT. - - -@a: a #GtkArg. - - - - -Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_UINT. - - -@a: a #GtkArg. - - - - -Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_LONG. - - -@a: a #GtkArg. - - - - -Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_ULONG. - - -@a: a #GtkArg. - - - - -Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_FLOAT. - - -@a: a #GtkArg. - - - - -Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_DOUBLE. - - -@a: a #GtkArg. - - - - -Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_STRING. - - -@a: a #GtkArg. - - - - -Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_ENUM. - - -@a: a #GtkArg. - - - - -Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_FLAGS. - - -@a: a #GtkArg. - - - - -Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_BOXED. - - -@a: a #GtkArg. - - - - -Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_POINTER. - - -@a: a #GtkArg. - - - - -Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_OBJECT. - - -@a: a #GtkArg. - - - - -Gets the value of a #GtkArg whose #GtkType is %GTK_TYPE_SIGNAL. - - -@a: a #GtkArg. - - - - -If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_CHAR. - - -@a: a #GtkArg. - - - - -If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_UCHAR. - - -@a: a #GtkArg. - - - - -If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_BOOL. - - -@a: a #GtkArg. - - - - -If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_INT. - - -@a: a #GtkArg. - - - - -If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_UINT. - - -@a: a #GtkArg. - - - - -If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_LONG. - - -@a: a #GtkArg. - - - - -If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_ULONG. - - -@a: a #GtkArg. - - - - -If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_FLOAT. - - -@a: a #GtkArg. - - - - -If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_DOUBLE. - - -@a: a #GtkArg. - - - - -If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_STRING. - - -@a: a #GtkArg. - - - - -If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_ENUM. - - -@a: a #GtkArg. - - - - -If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_FLAGS. - - -@a: a #GtkArg. - - - - -If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_BOXED. - - -@a: a #GtkArg. - - - - -If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_POINTER. - - -@a: a #GtkArg. - - - - -If the #GtkArg contains a pointer to the value, this macro will be a pointer to a %GTK_TYPE_OBJECT. - - -@a: a #GtkArg. - - - - -Holds information about the type. gtk_type_name() returns the name. -@object_size is somehow set to the number of bytes that an instance of -the object will occupy. @class_init_func holds the type's -initialization function. @object_init_func holds the initialization -function for an instance of the object. @reserved_1 is used for -#GtkEnumValue to hold the enumerated values. - - -@type_name: -@object_size: -@class_size: -@class_init_func: -@object_init_func: -@reserved_1: -@reserved_2: -@base_class_init_func: - - - -The base structure for a GTK+ type. Every type inherits this as a base structure. - - - - - -A structure which contains a single enum value, and its name, and its -nickname. - - - - - - - - - - - -Initializes the data structures associated with GTK+ types. - - -@debug_flags: debug flags - - - - -Creates a new, unique type. - - -@parent_type: if zero, a fundamental type is created -@gtkinfo: must not be %NULL, and @type_info->type_name must also not be %NULL -@Returns: the new #GtkType - - - - -Returns a pointer to the name of a type, or %NULL if it has none. - - -@type: a #GtkType. -@Returns: a pointer to the name of a type, or %NULL if it has none. - - - - -Gets the internal representation of a type, given its name. - - -@name: the name of a GTK+ type -@Returns: a #GtkType. - - - - -Returns the parent type of a #GtkType. - - -@type: a #GtkType. -@Returns: the #GtkType of the parent. - - - - -Returns a pointer pointing to the class of @type or %NULL if there was -any trouble identifying @type. Initializes the class if necessary. - - -@type: a #GtkType. -@Returns: pointer to the class. - - - - -Creates a new object of a given type, and return a pointer to it. -Returns %NULL if you give it an invalid type. It allocates the object -out of the type's memory chunk if there is a memory chunk. The object -has all the proper initializers called. - - -@type: a #GtkType. -@Returns: pointer to a #GtkTypeObject. - - - - -Looks in the type hierarchy to see if @type has @is_a_type among its -ancestors. Do so with a simple lookup, not a loop. - - -@type: a #GtkType. -@is_a_type: another #GtkType. -@Returns: %TRUE if @type is a @is_a_type. - - - - -If @enum_type has values, then return a pointer to all of them. - - -@enum_type: a #GtkType. -@Returns: #GtkEnumValue* - - - - -If @flags_type has values, then return a pointer to all of them. - - -@flags_type: a #GtkType. -@Returns: #GtkFlagValue* - - - - -Returns a pointer to one of @enum_type's #GtkEnumValues's whose name (or nickname) matches @value_name. - - -@enum_type: a #GtkType. -@value_name: the name to look for. -@Returns: #GtkEnumValue* - - - - -Returns a pointer to one of @flag_type's #GtkFlagValue's whose name (or nickname) matches @value_name. - - -@flags_type: a #GtkType. -@value_name: the name to look for. -@Returns: #GtkFlagValue* - -@flag_type: GtkType - - diff --git a/docs/reference/gtk/tmpl/gtkuimanager.sgml b/docs/reference/gtk/tmpl/gtkuimanager.sgml index 22f5d8b848..68b8700df5 100644 --- a/docs/reference/gtk/tmpl/gtkuimanager.sgml +++ b/docs/reference/gtk/tmpl/gtkuimanager.sgml @@ -253,6 +253,9 @@ other parts of the constructed user interface with the help of the + + + The GtkUIManager struct contains only private @@ -324,6 +327,7 @@ members and should not be accessed directly. +@void: @Returns: diff --git a/docs/reference/gtk/tmpl/gtkvbbox.sgml b/docs/reference/gtk/tmpl/gtkvbbox.sgml deleted file mode 100644 index d1d60ad0cb..0000000000 --- a/docs/reference/gtk/tmpl/gtkvbbox.sgml +++ /dev/null @@ -1,98 +0,0 @@ - -GtkVButtonBox - - -A container for arranging buttons vertically - - - -A button box should be used to provide a consistent layout of buttons -throughout your application. The layout/spacing can be altered by the -programmer, or if desired, by the user to alter the 'feel' of a -program to a small degree. - - -A #GtkVButtonBox is created with gtk_vbutton_box_new(). Buttons are -packed into a button box the same way widgets are added to any other -container, using gtk_container_add(). You can also use -gtk_box_pack_start() or gtk_box_pack_end(), but for button boxes both -these functions work just like gtk_container_add(), ie., they pack the -button in a way that depends on the current layout style and on -whether the button has had gtk_button_box_set_child_secondary() called -on it. - - - -The spacing between buttons can be set with gtk_box_set_spacing(). The -arrangement and layout of the buttons can be changed with -gtk_button_box_set_layout(). - - - - - - -#GtkBox -Used to pack widgets into button boxes. - -#GtkButtonBox -Provides functions for controlling button boxes. - - -#GtkHButtonBox -Pack buttons horizontally - - - - - - - - - -GtkVButtonBox does not contain any public fields. - - - - - -Creates a new vertical button box. - - -@Returns: a new button box #GtkWidget. - - - - -Retrieves the current default spacing for vertical button boxes. This is the number of pixels -to be placed between the buttons when they are arranged. - - -@Returns: the default number of pixels between buttons. - - - - -Changes the default spacing that is placed between widgets in an -vertical button box. - - -@spacing: an integer value. - - - - -Retrieves the current layout used to arrange buttons in button box widgets. - - -@Returns: the current #GtkButtonBoxStyle. - - - - -Sets a new layout mode that will be used by all button boxes. - - -@layout: a new #GtkButtonBoxStyle. - - diff --git a/docs/reference/gtk/tmpl/gtkviewport.sgml b/docs/reference/gtk/tmpl/gtkviewport.sgml deleted file mode 100644 index 610563b21d..0000000000 --- a/docs/reference/gtk/tmpl/gtkviewport.sgml +++ /dev/null @@ -1,134 +0,0 @@ - -GtkViewport - - -An adapter which makes widgets scrollable - - - -The #GtkViewport widget acts as an adaptor class, implementing -scrollability for child widgets that lack their own scrolling -capabilities. Use #GtkViewport to scroll child widgets such as -#GtkTable, #GtkBox, and so on. - - - -If a widget has native scrolling abilities, such as #GtkTextView, -#GtkTreeView or #GtkIconview, it can be added to a #GtkScrolledWindow -with gtk_container_add(). If a widget does not, you must first add the -widget to a #GtkViewport, then add the viewport to the scrolled window. -The convenience function gtk_scrolled_window_add_with_viewport() does -exactly this, so you can ignore the presence of the viewport. - - - - -#GtkScrolledWindow, #GtkAdjustment - - - - - - - - - - - - - - - - -@viewport: the object which received the signal. -@arg1: -@arg2: - - - - - - - - - - - - - - - - - - - - - -@hadjustment: -@vadjustment: -@Returns: - - - - - - - -@viewport: -@Returns: - - - - - - - -@viewport: -@Returns: - - - - - - - -@viewport: -@adjustment: - - - - - - - -@viewport: -@adjustment: - - - - - - - -@viewport: -@type: - - - - - - - -@viewport: -@Returns: - - - - - - - -@viewport: -@Returns: - - diff --git a/docs/reference/gtk/tmpl/gtkvolumebutton.sgml b/docs/reference/gtk/tmpl/gtkvolumebutton.sgml deleted file mode 100644 index 91c8c0caa9..0000000000 --- a/docs/reference/gtk/tmpl/gtkvolumebutton.sgml +++ /dev/null @@ -1,35 +0,0 @@ - -GtkVolumeButton - - -A button which pops up a volume control - - - -#GtkVolumeButton is a subclass of #GtkScaleButton that has -been tailored for use as a volume control widget with suitable -icons, tooltips and accessible labels. - - - - - - - - - - - - - - - - - - - - - -@Returns: - - diff --git a/docs/reference/gtk/tmpl/gtkvpaned.sgml b/docs/reference/gtk/tmpl/gtkvpaned.sgml deleted file mode 100644 index b894b6dfe9..0000000000 --- a/docs/reference/gtk/tmpl/gtkvpaned.sgml +++ /dev/null @@ -1,35 +0,0 @@ - -GtkVPaned - - -A container with two panes arranged vertically - - - -The VPaned widget is a container widget with two -children arranged vertically. The division between -the two panes is adjustable by the user by dragging -a handle. See #GtkPaned for details. - - - - - - - - - - - - - - - - - -Create a new #GtkVPaned - - -@Returns: the new #GtkVPaned - - diff --git a/docs/reference/gtk/tmpl/gtkvruler.sgml b/docs/reference/gtk/tmpl/gtkvruler.sgml deleted file mode 100644 index 89b8af90f7..0000000000 --- a/docs/reference/gtk/tmpl/gtkvruler.sgml +++ /dev/null @@ -1,50 +0,0 @@ - -GtkVRuler - - -A vertical ruler - - - - - This widget is considered too specialized/little-used for - GTK+, and will in the future be moved to some other package. If - your application needs this widget, feel free to use it, as the - widget does work and is useful in some applications; it's just not - of general interest. However, we are not accepting new features for - the widget, and it will eventually move out of the GTK+ - distribution. - - - -The VRuler widget is a widget arranged vertically creating a ruler that is -utilized around other widgets such as a text widget. The ruler is used to show -the location of the mouse on the window and to show the size of the window in -specified units. The available units of measurement are GTK_PIXELS, GTK_INCHES -and GTK_CENTIMETERS. GTK_PIXELS is the default. -rulers. - - - - - - - - - - - - -The #GtkVRuler struct contains private data and should be accessed -using the functions below. - - - - - -Creates a new vertical ruler - - -@Returns: a new #GtkVRuler. - - diff --git a/docs/reference/gtk/tmpl/gtkwindow.sgml b/docs/reference/gtk/tmpl/gtkwindow.sgml index 0fa830aa90..07c39b05b8 100644 --- a/docs/reference/gtk/tmpl/gtkwindow.sgml +++ b/docs/reference/gtk/tmpl/gtkwindow.sgml @@ -40,6 +40,9 @@ window (synonymous with gtk_window_add_accel_group(). + + + @@ -257,86 +260,6 @@ window (synonymous with gtk_window_add_accel_group(). @wmclass_class: - - -Changes how a toplevel window deals with its size request and user resize -attempts. There are really only two reasonable ways to call this function: - - - -gtk_window_set_policy (GTK_WINDOW (window), FALSE, TRUE, FALSE) -means that the window is user-resizable. - - - - -gtk_window_set_policy (GTK_WINDOW (window), FALSE, FALSE, TRUE) -means that the window's size is program-controlled, and should simply match -the current size request of the window's children. - - - -The first policy is the default, that is, by default windows are designed to -be resized by users. - - - -The basic ugly truth of this function is that it should be simply: - - void gtk_window_set_resizable (GtkWindow* window, gboolean setting); - -...which is why GTK+ 2.0 introduces gtk_window_set_resizable(), which you -should use instead of gtk_window_set_policy(). - - - -If set to %TRUE, the @allow_grow parameter allows the user to expand the window -beyond the size request of its child widgets. If @allow_grow is %TRUE, be sure to -check that your child widgets work properly as the window is resized. - - - -A toplevel window will always change size to ensure its child widgets receive -their requested size. This means that if you add child widgets, the toplevel -window will expand to contain them. However, normally the toplevel will not -shrink to fit the size request of its children if it's too large; the -@auto_shrink parameter causes the window to shrink when child widgets have too -much space. @auto_shrink is normally used with the second of the two window -policies mentioned above. That is, set @auto_shrink to %TRUE if you want the -window to have a fixed, always-optimal size determined by your program. - - - -Note that @auto_shrink doesn't do anything if @allow_shrink and @allow_grow are -both set to %FALSE. - - - -Neither of the two suggested window policies set the @allow_shrink parameter to -%TRUE. If @allow_shrink is %TRUE, the user can shrink the window so that its -children do not receive their full size request; this is basically a bad thing, -because most widgets will look wrong if this happens. Furthermore GTK+ has a -tendency to re-expand the window if size is recalculated for any reason. The -upshot is that @allow_shrink should always be set to %FALSE. - - - -Sometimes when you think you want to use @allow_shrink, the real problem is that -some specific child widget is requesting too much space, so the user can't -shrink the window sufficiently. Perhaps you are calling gtk_widget_set_size_request() -on a child widget, and forcing its size request to be too large. Instead of -setting the child's usize, consider using gtk_window_set_default_size() so that -the child gets a larger allocation than it requests. - - -@window: the window -@allow_shrink: whether the user can shrink the window below its size request -@allow_grow: whether the user can grow the window larger than its size request -@auto_shrink: whether the window automatically snaps back to its size request - if it's larger -@Deprecated: Use gtk_window_set_resizable() instead. - - @@ -373,14 +296,6 @@ the child gets a larger allocation than it requests. @accel_group: - - -Deprecated alias for gtk_window_set_position(). - - -@Deprecated: Use gtk_window_set_position() instead. - - @@ -515,6 +430,7 @@ Deprecated alias for gtk_window_set_position(). +@void: @Returns: @@ -872,6 +788,7 @@ Deprecated alias for gtk_window_set_position(). +@void: @Returns: @@ -880,6 +797,7 @@ Deprecated alias for gtk_window_set_position(). +@void: @Returns: diff --git a/docs/reference/gtk/tmpl/gtkwindowgroup.sgml b/docs/reference/gtk/tmpl/gtkwindowgroup.sgml index 622de268e4..00e8aa08db 100644 --- a/docs/reference/gtk/tmpl/gtkwindowgroup.sgml +++ b/docs/reference/gtk/tmpl/gtkwindowgroup.sgml @@ -17,6 +17,9 @@ Limit the effect of grabs + + + @@ -28,6 +31,7 @@ Limit the effect of grabs +@void: @Returns: @@ -58,3 +62,13 @@ Limit the effect of grabs @Returns: + + + + + +@window_group: +@device: +@Returns: + + diff --git a/docs/reference/gtk/x11.sgml b/docs/reference/gtk/x11.sgml index 7fa2e20006..dab177cbcf 100644 --- a/docs/reference/gtk/x11.sgml +++ b/docs/reference/gtk/x11.sgml @@ -75,60 +75,6 @@ debugging, but it will slow down the performance considerably. - -<systemitem>--gxid-host <replaceable>host</replaceable></systemitem> - - -The host to contact the gxid daemon on; overrides -the GXID_HOST environment variable. - - - - -<systemitem>--gxid-port <replaceable>port</replaceable></systemitem> - - -The port for the connection to gxid; overrides -the GXID_PORT environment variable. -This option is only available if GTK+ has been configured with -. - - - - - - -X11-specific environment variables - - -The X backend can be influenced with some -additional environment variables. - - - - <envar>GXID_HOST</envar>, <envar>GXID_PORT</envar> - - - The host and port to contact the gxid daemon - on. gxid is only necessary on X servers which - don't support using the pointer and extension devices at once, and is - only built if GTK+ is configured with . - The XFree86 and Xorg - X servers don't have this - restriction. - - - - - <envar>GDK_USE_XFT</envar> - - - If this variable is set to 1, GTK+ will use the Pango Xft backend instead - of the X backend when possible (i.e. when the X server supports the XRender - extension and Pango has been built with Xft support). - - - diff --git a/docs/reference/libgail-util/Makefile.am b/docs/reference/libgail-util/Makefile.am index e6b4bb96bb..cfd0f688d0 100644 --- a/docs/reference/libgail-util/Makefile.am +++ b/docs/reference/libgail-util/Makefile.am @@ -4,7 +4,7 @@ include $(top_srcdir)/Makefile.decl AUTOMAKE_OPTIONS = 1.7 # The name of the module. -DOC_MODULE=gail-libgail-util +DOC_MODULE=gail-libgail-util3 # The top-level SGML file. DOC_MAIN_SGML_FILE=gail-libgail-util-docs.sgml diff --git a/docs/reference/libgail-util/gail-libgail-util-overrides.txt b/docs/reference/libgail-util/gail-libgail-util-overrides.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/docs/reference/libgail-util/gail-libgail-util.types b/docs/reference/libgail-util/gail-libgail-util.types deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/docs/reference/libgail-util/gail-libgail-util-sections.txt b/docs/reference/libgail-util/gail-libgail-util3-sections.txt similarity index 100% rename from docs/reference/libgail-util/gail-libgail-util-sections.txt rename to docs/reference/libgail-util/gail-libgail-util3-sections.txt diff --git a/docs/reference/gdk-pixbuf/gdk-pixbuf-overrides.txt b/docs/reference/libgail-util/gail-libgail-util3.types similarity index 100% rename from docs/reference/gdk-pixbuf/gdk-pixbuf-overrides.txt rename to docs/reference/libgail-util/gail-libgail-util3.types diff --git a/docs/reference/libgail-util/tmpl/gail-libgail-util-unused.sgml b/docs/reference/libgail-util/tmpl/gail-libgail-util-unused.sgml deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/docs/reference/libgail-util/tmpl/gailmisc.sgml b/docs/reference/libgail-util/tmpl/gailmisc.sgml deleted file mode 100644 index 6cb5571f6e..0000000000 --- a/docs/reference/libgail-util/tmpl/gailmisc.sgml +++ /dev/null @@ -1,125 +0,0 @@ - -GailMisc - - -GailMisc is a set of utility functions which may be useful to implementors of -Atk interfaces for custom widgets. - - - -GailMisc is a set of utility function which are used in the implemementation -of Atk interfaces for Gtk widgets. They may be useful to implementors of -Atk interfaces for custom widgets. - - - - - - - - - - - - - - - - -@attrib_set: -@attr: -@value: -@Returns: - - - - - - - -@attrib_set: -@layout: -@text: -@offset: -@start_offset: -@end_offset: -@Returns: - - - - - - - -@attrib_set: -@layout: -@widget: -@Returns: - - - - - - - -@widget: -@char_rect: -@x_layout: -@y_layout: -@x: -@y: -@width: -@height: -@coords: - - - - - - - -@widget: -@layout: -@x_layout: -@y_layout: -@x: -@y: -@coords: -@Returns: - - - - - - - -@widget: -@x_window: -@y_window: -@x_toplevel: -@y_toplevel: - - - - - - - -@attrib_set: -@attrs: -@attr: -@Returns: - - - - - - - -@buffer: -@offset: -@start_offset: -@end_offset: -@Returns: - - diff --git a/docs/reference/libgail-util/tmpl/gailtextutil.sgml b/docs/reference/libgail-util/tmpl/gailtextutil.sgml deleted file mode 100644 index 8fb464fa92..0000000000 --- a/docs/reference/libgail-util/tmpl/gailtextutil.sgml +++ /dev/null @@ -1,95 +0,0 @@ - -GailTextUtil - - -GailTextUtil is a utility class which can be used to implement some of -the AtkText functions for accessible objects which implement AtkText. - - - -GailTextUtil is a utility class which can be used to implement the -AtkText functions which get text for accessible objects which implement -AtkText. - -In GAIL it is used by the accsesible objects for GnomeCanvasText, GtkEntry, -GtkLabel, GtkCellRendererText and GtkTextview. - - - - - - - - - - - - -The GailTextCell structure should not be accessed directly. - - - -@parent: -@buffer: - - - - - - -@GAIL_BEFORE_OFFSET: -@GAIL_AT_OFFSET: -@GAIL_AFTER_OFFSET: - - - - - - -@Returns: - - - - - - - -@textutil: -@text: - - - - - - - -@textutil: -@buffer: - - - - - - - -@textutil: -@layout: -@function: -@boundary_type: -@offset: -@start_offset: -@end_offset: -@Returns: - - - - - - - -@textutil: -@start_pos: -@end_pos: -@Returns: - - diff --git a/docs/styles.txt b/docs/styles.txt index a081d3cdf4..cd5dc91107 100644 --- a/docs/styles.txt +++ b/docs/styles.txt @@ -19,21 +19,10 @@ gtk_widget_set_style () This will override a previously set user style or previously set rc styles. -gtk_widget_set_rc_style () - Set GTK_RC_STYLE to indicate that an rc lookup has been performed. - If there is an rc style for a widget, set it and save the default style, - restore the default style otherwise. - This will override a previously set user style or rc style. - gtk_widget_reset_rc_styles () Descends through a widget hierarchy and sets the rc style on all widgets that don't have a user style set. -gtk_widget_restore_default_style () - Reset the widget's style to the default style, this is only useful if - the widgets default style had been saved by previous calls to - gtk_widget_set_style() or gtk_widget_set_rc_style(). - gtk_widget_ensure_style () Ensure that the widget either has a user style set, or an rc lookup has been performed. diff --git a/docs/tools/shooter.c b/docs/tools/shooter.c index 95555ecd10..eef624215f 100644 --- a/docs/tools/shooter.c +++ b/docs/tools/shooter.c @@ -205,7 +205,10 @@ int main (int argc, char **argv) window = info->window->window; gtk_widget_show_now (info->window); - gtk_widget_draw (info->window, &(info->window->allocation)); + gtk_widget_queue_draw_area (info->window, + info->window->allocation.x, info->window->allocation.y, + info->window->allocation.width, info->window->allocation.height); + gdk_window_process_updates (info->window->window, TRUE); while (gtk_events_pending ()) { diff --git a/docs/tutorial/gtk-tut.sgml b/docs/tutorial/gtk-tut.sgml index d140cd0d92..e93851f418 100755 --- a/docs/tutorial/gtk-tut.sgml +++ b/docs/tutorial/gtk-tut.sgml @@ -2001,8 +2001,7 @@ GObject | | | | `GtkVButtonBox | | | +GtkVBox | | | | +GtkColorSelection - | | | | +GtkFontSelection - | | | | `GtkGammaCurve + | | | | `GtkFontSelection | | | `GtkHBox | | | +GtkCombo | | | `GtkStatusbar @@ -2022,7 +2021,6 @@ GObject | | `GtkTreeView | +GtkCalendar | +GtkDrawingArea - | | `GtkCurve | +GtkEditable | | +GtkEntry | | `GtkSpinButton @@ -5744,7 +5742,7 @@ static void calendar_select_font( GtkWidget *button, calendar->font_dialog); } window = calendar->font_dialog; - if (!GTK_WIDGET_VISIBLE (window)) + if (!gtk_widget_get_visible (window)) gtk_widget_show (window); else gtk_widget_destroy (window); @@ -6134,7 +6132,7 @@ gint main( gint argc, window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window), "Color selection test"); - gtk_window_set_policy (GTK_WINDOW (window), TRUE, TRUE, TRUE); + gtk_window_set_resizable ((GTK_WINDOW (window), TRUE); /* Attach to the "delete" and "destroy" events so we can exit */ @@ -6473,15 +6471,15 @@ the position specified by x and y. position. -void gtk_fixed_set_has_window( GtkFixed *fixed, - gboolean has_window ); +void gtk_widget_set_has_window( GtkWidget *widget, + gboolean has_window ); -gboolean gtk_fixed_get_has_window( GtkFixed *fixed ); +gboolean gtk_widget_get_has_window( GtkWidget *widget ); Normally, Fixed widgets don't have their own X window. Since this is different from the behaviour of Fixed widgets in earlier releases of GTK, -the function gtk_fixed_set_has_window() allows the creation of Fixed widgets +the function gtk_widget_set_has_window() allows the creation of Fixed widgets with their own window. It has to be called before realizing the widget. @@ -7328,7 +7326,6 @@ static GtkWidget *create_bbox( gint horizontal, /* Set the appearance of the Button Box */ gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), layout); gtk_box_set_spacing (GTK_BOX (bbox), spacing); - /*gtk_button_box_set_child_size (GTK_BUTTON_BOX (bbox), child_w, child_h);*/ button = gtk_button_new_from_stock (GTK_STOCK_OK); gtk_container_add (GTK_CONTAINER (bbox), button); @@ -9375,20 +9372,20 @@ What if you have a function which you want to be called when nothing else is happening ? -gint gtk_idle_add( GtkFunction function, - gpointer data ); +guint g_idle_add( GSourceFunc function, + gpointer data ); This causes GTK to call the specified function whenever nothing else is happening. -void gtk_idle_remove( gint tag ); +void g_source_remove( guint tag ); I won't explain the meaning of the arguments as they follow very much like the ones above. The function pointed to by the first argument to -gtk_idle_add will be called whenever the opportunity arises. As with +g_idle_add will be called whenever the opportunity arises. As with the others, returning FALSE will stop the idle function from being called. @@ -9945,7 +9942,7 @@ protocols. An application capable of GTK+ drag-and-drop first defines and sets up the GTK+ widget(s) for drag-and-drop. Each widget can be a source and/or destination for drag-and-drop. Note that these GTK+ widgets must have -an associated X Window, check using GTK_WIDGET_NO_WINDOW(widget)). +an associated X Window, check using gtk_widget_get_has_window (widget). Source widgets can send out drag data, thus allowing the user to drag things off of them, while destination widgets can receive drag data. @@ -13965,17 +13962,6 @@ void GtkStatusbar::text-popped (GtkStatusbar *, - - -GtkCurve - - -void GtkCurve::curve-type-changed (GtkCurve *, - gpointer); - - - - GtkAdjustment @@ -16024,7 +16010,6 @@ create_input_dialog () } } -void int main (int argc, char *argv[]) { diff --git a/examples/Makefile b/examples/Makefile index e19ffea8f4..f68d6ce703 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -5,17 +5,14 @@ SUBDIRS = arrow \ buttonbox \ buttons \ calendar \ - clist \ entry \ eventbox \ - filesel \ fixed \ frame \ gtkdial \ helloworld \ helloworld2 \ label \ - list \ menu \ notebook \ packbox \ @@ -32,9 +29,7 @@ SUBDIRS = arrow \ spinbutton \ statusbar \ table \ - text \ tictactoe \ - tree \ wheelbarrow all: diff --git a/examples/buttonbox/buttonbox.c b/examples/buttonbox/buttonbox.c index d48bbfa5dc..1809154d8d 100644 --- a/examples/buttonbox/buttonbox.c +++ b/examples/buttonbox/buttonbox.c @@ -26,7 +26,6 @@ static GtkWidget *create_bbox( gint horizontal, /* Set the appearance of the Button Box */ gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), layout); gtk_box_set_spacing (GTK_BOX (bbox), spacing); - /*gtk_button_box_set_child_size (GTK_BUTTON_BOX (bbox), child_w, child_h);*/ button = gtk_button_new_from_stock (GTK_STOCK_OK); gtk_container_add (GTK_CONTAINER (bbox), button); diff --git a/examples/calendar/calendar.c b/examples/calendar/calendar.c index 1f9a3a5bbd..f6808aa147 100644 --- a/examples/calendar/calendar.c +++ b/examples/calendar/calendar.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1998 Cesar Miquel, Shawn T. Amundson, Mattias Grnlund + * Copyright (C) 1998 Cesar Miquel, Shawn T. Amundson, Mattias Grönlund * Copyright (C) 2000 Tony Gale * * This program is free software; you can redistribute it and/or modify diff --git a/examples/clist/Makefile b/examples/clist/Makefile deleted file mode 100644 index 1e45050dfd..0000000000 --- a/examples/clist/Makefile +++ /dev/null @@ -1,14 +0,0 @@ - -CC = gcc - -CFLAGS = -Wall \ - -DG_DISABLE_DEPRECATED \ - -DGDK_DISABLE_DEPRECATED \ - -DGDK_PIXBUF_DISABLE_DEPRECATED \ - -DGTK_DISABLE_DEPRECATED - -clist: clist.c - $(CC) clist.c -o clist `pkg-config gtk+-2.0 --cflags --libs` - -clean: - rm -f *.o clist diff --git a/examples/clist/clist.c b/examples/clist/clist.c deleted file mode 100644 index 64903b4a12..0000000000 --- a/examples/clist/clist.c +++ /dev/null @@ -1,173 +0,0 @@ - -#include "config.h" -#include - -/* User clicked the "Add List" button. */ -void button_add_clicked( gpointer data ) -{ - int indx; - - /* Something silly to add to the list. 4 rows of 2 columns each */ - gchar *drink[4][2] = { { "Milk", "3 Oz" }, - { "Water", "6 l" }, - { "Carrots", "2" }, - { "Snakes", "55" } }; - - /* Here we do the actual adding of the text. It's done once for - * each row. - */ - for (indx = 0; indx < 4; indx++) - gtk_clist_append ((GtkCList *)data, drink[indx]); - - return; -} - -/* User clicked the "Clear List" button. */ -void button_clear_clicked( gpointer data ) -{ - /* Clear the list using gtk_clist_clear. This is much faster than - * calling gtk_clist_remove once for each row. - */ - gtk_clist_clear ((GtkCList *)data); - - return; -} - -/* The user clicked the "Hide/Show titles" button. */ -void button_hide_show_clicked( gpointer data ) -{ - /* Just a flag to remember the status. 0 = currently visible */ - static short int flag = 0; - - if (flag == 0) - { - /* Hide the titles and set the flag to 1 */ - gtk_clist_column_titles_hide ((GtkCList *)data); - flag++; - } - else - { - /* Show the titles and reset flag to 0 */ - gtk_clist_column_titles_show ((GtkCList *)data); - flag--; - } - - return; -} - -/* If we come here, then the user has selected a row in the list. */ -void selection_made( GtkWidget *clist, - gint row, - gint column, - GdkEventButton *event, - gpointer data ) -{ - gchar *text; - - /* Get the text that is stored in the selected row and column - * which was clicked in. We will receive it as a pointer in the - * argument text. - */ - gtk_clist_get_text (GTK_CLIST (clist), row, column, &text); - - /* Just prints some information about the selected row */ - g_print ("You selected row %d. More specifically you clicked in " - "column %d, and the text in this cell is %s\n\n", - row, column, text); - - return; -} - -int main( int argc, - gchar *argv[] ) -{ - GtkWidget *window; - GtkWidget *vbox, *hbox; - GtkWidget *scrolled_window, *clist; - GtkWidget *button_add, *button_clear, *button_hide_show; - gchar *titles[2] = { "Ingredients", "Amount" }; - - gtk_init(&argc, &argv); - - window=gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_widget_set_size_request (GTK_WIDGET (window), 300, 150); - - gtk_window_set_title (GTK_WINDOW (window), "GtkCList Example"); - g_signal_connect (G_OBJECT (window), "destroy", - G_CALLBACK (gtk_main_quit), - NULL); - - vbox=gtk_vbox_new (FALSE, 5); - gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); - gtk_container_add (GTK_CONTAINER (window), vbox); - gtk_widget_show (vbox); - - /* Create a scrolled window to pack the CList widget into */ - scrolled_window = gtk_scrolled_window_new (NULL, NULL); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), - GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); - - gtk_box_pack_start (GTK_BOX (vbox), scrolled_window, TRUE, TRUE, 0); - gtk_widget_show (scrolled_window); - - /* Create the CList. For this example we use 2 columns */ - clist = gtk_clist_new_with_titles (2, titles); - - /* When a selection is made, we want to know about it. The callback - * used is selection_made, and its code can be found further down */ - g_signal_connect (G_OBJECT (clist), "select_row", - G_CALLBACK (selection_made), - NULL); - - /* It isn't necessary to shadow the border, but it looks nice :) */ - gtk_clist_set_shadow_type (GTK_CLIST (clist), GTK_SHADOW_OUT); - - /* What however is important, is that we set the column widths as - * they will never be right otherwise. Note that the columns are - * numbered from 0 and up (to 1 in this case). - */ - gtk_clist_set_column_width (GTK_CLIST (clist), 0, 150); - - /* Add the CList widget to the vertical box and show it. */ - gtk_container_add (GTK_CONTAINER (scrolled_window), clist); - gtk_widget_show (clist); - - /* Create the buttons and add them to the window. See the button - * tutorial for more examples and comments on this. - */ - hbox = gtk_hbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 0); - gtk_widget_show (hbox); - - button_add = gtk_button_new_with_label ("Add List"); - button_clear = gtk_button_new_with_label ("Clear List"); - button_hide_show = gtk_button_new_with_label ("Hide/Show titles"); - - gtk_box_pack_start (GTK_BOX (hbox), button_add, TRUE, TRUE, 0); - gtk_box_pack_start (GTK_BOX (hbox), button_clear, TRUE, TRUE, 0); - gtk_box_pack_start (GTK_BOX (hbox), button_hide_show, TRUE, TRUE, 0); - - /* Connect our callbacks to the three buttons */ - g_signal_connect_swapped (G_OBJECT (button_add), "clicked", - G_CALLBACK (button_add_clicked), - clist); - g_signal_connect_swapped (G_OBJECT (button_clear), "clicked", - G_CALLBACK (button_clear_clicked), - clist); - g_signal_connect_swapped (G_OBJECT (button_hide_show), "clicked", - G_CALLBACK (button_hide_show_clicked), - clist); - - gtk_widget_show (button_add); - gtk_widget_show (button_clear); - gtk_widget_show (button_hide_show); - - /* The interface is completely set up so we show the window and - * enter the gtk_main loop. - */ - gtk_widget_show (window); - - gtk_main(); - - return 0; -} diff --git a/examples/colorsel/colorsel.c b/examples/colorsel/colorsel.c index cd2801c875..9d3671de69 100644 --- a/examples/colorsel/colorsel.c +++ b/examples/colorsel/colorsel.c @@ -90,7 +90,7 @@ gint main( gint argc, window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window), "Color selection test"); - gtk_window_set_policy (GTK_WINDOW (window), TRUE, TRUE, TRUE); + gtk_window_set_resizable (GTK_WINDOW (window), TRUE); /* Attach to the "delete" and "destroy" events so we can exit */ diff --git a/examples/filesel/Makefile b/examples/filesel/Makefile deleted file mode 100644 index 92d5e3d003..0000000000 --- a/examples/filesel/Makefile +++ /dev/null @@ -1,14 +0,0 @@ - -CC = gcc - -CFLAGS = -Wall \ - -DG_DISABLE_DEPRECATED \ - -DGDK_DISABLE_DEPRECATED \ - -DGDK_PIXBUF_DISABLE_DEPRECATED \ - -DGTK_DISABLE_DEPRECATED - -filesel: filesel.c - $(CC) filesel.c -o filesel $(CFLAGS) `pkg-config gtk+-2.0 --cflags --libs` - -clean: - rm -f *.o filesel diff --git a/examples/filesel/filesel.c b/examples/filesel/filesel.c deleted file mode 100644 index 33eaef7a78..0000000000 --- a/examples/filesel/filesel.c +++ /dev/null @@ -1,40 +0,0 @@ - -#include - -/* Get the selected filename and print it to the console */ -static void file_ok_sel( GtkWidget *w, - GtkFileSelection *fs ) -{ - g_print ("%s\n", gtk_file_selection_get_filename (GTK_FILE_SELECTION (fs))); -} - -int main( int argc, - char *argv[] ) -{ - GtkWidget *filew; - - gtk_init (&argc, &argv); - - /* Create a new file selection widget */ - filew = gtk_file_selection_new ("File selection"); - - g_signal_connect (G_OBJECT (filew), "destroy", - G_CALLBACK (gtk_main_quit), NULL); - /* Connect the ok_button to file_ok_sel function */ - g_signal_connect (G_OBJECT (GTK_FILE_SELECTION (filew)->ok_button), - "clicked", G_CALLBACK (file_ok_sel), (gpointer) filew); - - /* Connect the cancel_button to destroy the widget */ - g_signal_connect_swapped (G_OBJECT (GTK_FILE_SELECTION (filew)->cancel_button), - "clicked", G_CALLBACK (gtk_widget_destroy), - G_OBJECT (filew)); - - /* Lets set the filename, as if this were a save dialog, and we are giving - a default filename */ - gtk_file_selection_set_filename (GTK_FILE_SELECTION(filew), - "penguin.png"); - - gtk_widget_show (filew); - gtk_main (); - return 0; -} diff --git a/examples/gdk/composited-window-example.c b/examples/gdk/composited-window-example.c new file mode 100644 index 0000000000..b28f712a2e --- /dev/null +++ b/examples/gdk/composited-window-example.c @@ -0,0 +1,136 @@ +#include + +/* The expose event handler for the event box. + * + * This function simply draws a transparency onto a widget on the area + * for which it receives expose events. This is intended to give the + * event box a "transparent" background. + * + * In order for this to work properly, the widget must have an RGBA + * colourmap. The widget should also be set as app-paintable since it + * doesn't make sense for GTK+ to draw a background if we are drawing it + * (and because GTK+ might actually replace our transparency with its + * default background colour). + */ +static gboolean +transparent_expose (GtkWidget *widget, + GdkEventExpose *event) +{ + cairo_t *cr; + + cr = gdk_cairo_create (widget->window); + cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR); + gdk_cairo_region (cr, event->region); + cairo_fill (cr); + cairo_destroy (cr); + + return FALSE; + } + +/* The expose event handler for the window. + * + * This function performs the actual compositing of the event box onto + * the already-existing background of the window at 50% normal opacity. + * + * In this case we do not want app-paintable to be set on the widget + * since we want it to draw its own (red) background. Because of this, + * however, we must ensure that we use g_signal_connect_after so that + * this handler is called after the red has been drawn. If it was + * called before then GTK would just blindly paint over our work. + * + * Note: if the child window has children, then you need a cairo 1.6 + * feature to make this work correctly. + */ +static gboolean +window_expose_event (GtkWidget *widget, + GdkEventExpose *event) +{ + GdkRegion *region; + GtkWidget *child; + cairo_t *cr; + + /* get our child (in this case, the event box) */ + child = gtk_bin_get_child (GTK_BIN (widget)); + + /* create a cairo context to draw to the window */ + cr = gdk_cairo_create (widget->window); + + /* the source data is the (composited) event box */ + gdk_cairo_set_source_pixmap (cr, child->window, + child->allocation.x, + child->allocation.y); + + /* draw no more than our expose event intersects our child */ + region = gdk_region_rectangle (&child->allocation); + gdk_region_intersect (region, event->region); + gdk_cairo_region (cr, region); + cairo_clip (cr); + + /* composite, with a 50% opacity */ + cairo_set_operator (cr, CAIRO_OPERATOR_OVER); + cairo_paint_with_alpha (cr, 0.5); + + /* we're done */ + cairo_destroy (cr); + + return FALSE; +} + +int +main (int argc, char **argv) +{ + GtkWidget *window, *event, *button; + GdkScreen *screen; + GdkColormap *rgba; + GdkColor red; + + gtk_init (&argc, &argv); + + /* Make the widgets */ + button = gtk_button_new_with_label ("A Button"); + event = gtk_event_box_new (); + window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + + /* Put a red background on the window */ + gdk_color_parse ("red", &red); + gtk_widget_modify_bg (window, GTK_STATE_NORMAL, &red); + + /* Set the colourmap for the event box. + * Must be done before the event box is realised. + */ + screen = gtk_widget_get_screen (event); + rgba = gdk_screen_get_rgba_colormap (screen); + gtk_widget_set_colormap (event, rgba); + + /* Set our event box to have a fully-transparent background + * drawn on it. Currently there is no way to simply tell GTK+ + * that "transparency" is the background colour for a widget. + */ + gtk_widget_set_app_paintable (GTK_WIDGET (event), TRUE); + g_signal_connect (event, "expose-event", + G_CALLBACK (transparent_expose), NULL); + + /* Put them inside one another */ + gtk_container_set_border_width (GTK_CONTAINER (window), 10); + gtk_container_add (GTK_CONTAINER (window), event); + gtk_container_add (GTK_CONTAINER (event), button); + + /* Realise and show everything */ + gtk_widget_show_all (window); + + /* Set the event box GdkWindow to be composited. + * Obviously must be performed after event box is realised. + */ + gdk_window_set_composited (event->window, TRUE); + + /* Set up the compositing handler. + * Note that we do _after_ so that the normal (red) background is drawn + * by gtk before our compositing occurs. + */ + g_signal_connect_after (window, "expose-event", + G_CALLBACK (window_expose_event), NULL); + + gtk_main (); + + return 0; +} diff --git a/examples/list/Makefile b/examples/list/Makefile deleted file mode 100644 index 59cc93aa49..0000000000 --- a/examples/list/Makefile +++ /dev/null @@ -1,16 +0,0 @@ - -CC = gcc - -#CFLAGS = -Wall \ -# -DG_DISABLE_DEPRECATED \ -# -DGDK_DISABLE_DEPRECATED \ -# -DGDK_PIXBUF_DISABLE_DEPRECATED \ -# -DGTK_DISABLE_DEPRECATED - -CFLAGS = - -list: list.c - $(CC) list.c -o list $(CFLAGS) `pkg-config gtk+-2.0 --cflags --libs` - -clean: - rm -f *.o list diff --git a/examples/list/list.c b/examples/list/list.c deleted file mode 100644 index 966e31e76e..0000000000 --- a/examples/list/list.c +++ /dev/null @@ -1,266 +0,0 @@ - -#include "config.h" -#include -#include - -/* This is our data identification string to store - * data in list items - */ -const gchar *list_item_data_key="list_item_data"; - - -/* prototypes for signal handler that we are going to connect - * to the List widget - */ -static void sigh_print_selection( GtkWidget *gtklist, - gpointer func_data); - -static void sigh_button_event( GtkWidget *gtklist, - GdkEventButton *event, - GtkWidget *frame ); - - -/* Main function to set up the user interface */ - -gint main( int argc, - gchar *argv[] ) -{ - GtkWidget *separator; - GtkWidget *window; - GtkWidget *vbox; - GtkWidget *scrolled_window; - GtkWidget *frame; - GtkWidget *gtklist; - GtkWidget *button; - GtkWidget *list_item; - GList *dlist; - guint i; - gchar buffer[64]; - - - /* Initialize GTK (and subsequently GDK) */ - - gtk_init (&argc, &argv); - - - /* Create a window to put all the widgets in - * connect gtk_main_quit() to the "destroy" event of - * the window to handle window manager close-window-events - */ - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_window_set_title (GTK_WINDOW (window), "GtkList Example"); - g_signal_connect (window, "destroy", - G_CALLBACK (gtk_main_quit), - NULL); - - - /* Inside the window we need a box to arrange the widgets - * vertically */ - vbox=gtk_vbox_new (FALSE, 5); - gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); - gtk_container_add (GTK_CONTAINER (window), vbox); - gtk_widget_show (vbox); - - /* This is the scrolled window to put the List widget inside */ - scrolled_window = gtk_scrolled_window_new (NULL, NULL); - gtk_widget_set_size_request (scrolled_window, 250, 150); - gtk_container_add (GTK_CONTAINER (vbox), scrolled_window); - gtk_widget_show (scrolled_window); - - /* Create thekList widget. - * Connect the sigh_print_selection() signal handler - * function to the "selection_changed" signal of the List - * to print out the selected items each time the selection - * has changed */ - gtklist=gtk_list_new (); - gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolled_window), - gtklist); - gtk_widget_show (gtklist); - g_signal_connect (gtklist, "selection-changed", - G_CALLBACK (sigh_print_selection), - NULL); - - /* We create a "Prison" to put a list item in ;) */ - frame=gtk_frame_new ("Prison"); - gtk_widget_set_size_request (frame, 200, 50); - gtk_container_set_border_width (GTK_CONTAINER (frame), 5); - gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT); - gtk_container_add (GTK_CONTAINER (vbox), frame); - gtk_widget_show (frame); - - /* Connect the sigh_button_event() signal handler to the List - * which will handle the "arresting" of list items - */ - g_signal_connect (gtklist, "button-release-event", - G_CALLBACK (sigh_button_event), - frame); - - /* Create a separator */ - separator=gtk_hseparator_new (); - gtk_container_add (GTK_CONTAINER (vbox), separator); - gtk_widget_show (separator); - - /* Finally create a button and connect its "clicked" signal - * to the destruction of the window */ - button=gtk_button_new_with_label ("Close"); - gtk_container_add (GTK_CONTAINER (vbox), button); - gtk_widget_show (button); - g_signal_connect_swapped (button, "clicked", - G_CALLBACK (gtk_widget_destroy), - window); - - - /* Now we create 5 list items, each having its own - * label and add them to the List using gtk_container_add() - * Also we query the text string from the label and - * associate it with the list_item_data_key for each list item - */ - for (i = 0; i < 5; i++) { - GtkWidget *label; - gchar *string; - - sprintf(buffer, "ListItemContainer with Label #%d", i); - label=gtk_label_new (buffer); - list_item=gtk_list_item_new (); - gtk_container_add (GTK_CONTAINER (list_item), label); - gtk_widget_show (label); - gtk_container_add (GTK_CONTAINER (gtklist), list_item); - gtk_widget_show (list_item); - gtk_label_get (GTK_LABEL (label), &string); - g_object_set_data (G_OBJECT (list_item), list_item_data_key, string); - } - /* Here, we are creating another 5 labels, this time - * we use gtk_list_item_new_with_label() for the creation - * we can't query the text string from the label because - * we don't have the labels pointer and therefore - * we just associate the list_item_data_key of each - * list item with the same text string. - * For adding of the list items we put them all into a doubly - * linked list (GList), and then add them by a single call to - * gtk_list_append_items(). - * Because we use g_list_prepend() to put the items into the - * doubly linked list, their order will be descending (instead - * of ascending when using g_list_append()) - */ - dlist = NULL; - for (; i < 10; i++) { - sprintf(buffer, "List Item with Label %d", i); - list_item = gtk_list_item_new_with_label (buffer); - dlist = g_list_prepend (dlist, list_item); - gtk_widget_show (list_item); - g_object_set_data (G_OBJECT (list_item), - list_item_data_key, - "ListItem with integrated Label"); - } - gtk_list_append_items (GTK_LIST (gtklist), dlist); - - /* Finally we want to see the window, don't we? ;) */ - gtk_widget_show (window); - - /* Fire up the main event loop of gtk */ - gtk_main (); - - /* We get here after gtk_main_quit() has been called which - * happens if the main window gets destroyed - */ - return 0; -} - -/* This is the signal handler that got connected to button - * press/release events of the List - */ -void sigh_button_event( GtkWidget *gtklist, - GdkEventButton *event, - GtkWidget *frame ) -{ - /* We only do something if the third (rightmost mouse button - * was released - */ - if (event->type == GDK_BUTTON_RELEASE && - event->button == 3) { - GList *dlist, *free_list; - GtkWidget *new_prisoner; - - /* Fetch the currently selected list item which - * will be our next prisoner ;) - */ - dlist = GTK_LIST (gtklist)->selection; - if (dlist) - new_prisoner = GTK_WIDGET (dlist->data); - else - new_prisoner = NULL; - - /* Look for already imprisoned list items, we - * will put them back into the list. - * Remember to free the doubly linked list that - * gtk_container_children() returns - */ - dlist = gtk_container_children (GTK_CONTAINER (frame)); - free_list = dlist; - while (dlist) { - GtkWidget *list_item; - - list_item = dlist->data; - - gtk_widget_reparent (list_item, gtklist); - - dlist = dlist->next; - } - g_list_free (free_list); - - /* If we have a new prisoner, remove him from the - * List and put him into the frame "Prison". - * We need to unselect the item first. - */ - if (new_prisoner) { - GList static_dlist; - - static_dlist.data = new_prisoner; - static_dlist.next = NULL; - static_dlist.prev = NULL; - - gtk_list_unselect_child (GTK_LIST (gtklist), - new_prisoner); - gtk_widget_reparent (new_prisoner, frame); - } - } -} - -/* This is the signal handler that gets called if List - * emits the "selection_changed" signal - */ -void sigh_print_selection( GtkWidget *gtklist, - gpointer func_data ) -{ - GList *dlist; - - /* Fetch the doubly linked list of selected items - * of the List, remember to treat this as read-only! - */ - dlist = GTK_LIST (gtklist)->selection; - - /* If there are no selected items there is nothing more - * to do than just telling the user so - */ - if (!dlist) { - g_print ("Selection cleared\n"); - return; - } - /* Ok, we got a selection and so we print it - */ - g_print ("The selection is a "); - - /* Get the list item from the doubly linked list - * and then query the data associated with list_item_data_key. - * We then just print it */ - while (dlist) { - const gchar *item_data_string; - - item_data_string = g_object_get_data (G_OBJECT (dlist->data), - list_item_data_key); - g_print("%s ", item_data_string); - - dlist = dlist->next; - } - g_print ("\n"); -} diff --git a/examples/scribble-xinput/Makefile b/examples/scribble-xinput/Makefile index 47d24b4c31..4907190fdc 100644 --- a/examples/scribble-xinput/Makefile +++ b/examples/scribble-xinput/Makefile @@ -4,11 +4,10 @@ CC = gcc CFLAGS = -Wall \ -DG_DISABLE_DEPRECATED \ -DGDK_DISABLE_DEPRECATED \ - -DGDK_PIXBUF_DISABLE_DEPRECATED \ - -DGTK_DISABLE_DEPRECATED + -DGDK_PIXBUF_DISABLE_DEPRECATED scribble-xinput: scribble-xinput.c - $(CC) scribble-xinput.c -o scribble-xinput $(CFLAGS) `pkg-config gtk+-2.0 --cflags --libs` + $(CC) $(CFLAGS) `pkg-config --cflags gtk+-2.0` scribble-xinput.c -o scribble-xinput $(LDFLAGS) `pkg-config --libs gtk+-2.0` clean: rm -f *.o scribble-xinput diff --git a/examples/text/Makefile b/examples/text/Makefile deleted file mode 100644 index 2632928f4a..0000000000 --- a/examples/text/Makefile +++ /dev/null @@ -1,16 +0,0 @@ - -CC = gcc - -#CFLAGS = -Wall \ -# -DG_DISABLE_DEPRECATED \ -# -DGDK_DISABLE_DEPRECATED \ -# -DGDK_PIXBUF_DISABLE_DEPRECATED \ -# -DGTK_DISABLE_DEPRECATED - -CFLAGS = - -text: text.c - $(CC) text.c -o text $(CFLAGS) `pkg-config gtk+-2.0 --cflags --libs` - -clean: - rm -f *.o text diff --git a/examples/text/text.c b/examples/text/text.c deleted file mode 100644 index 2b05c472b5..0000000000 --- a/examples/text/text.c +++ /dev/null @@ -1,182 +0,0 @@ - -#define GTK_ENABLE_BROKEN -#include "config.h" -#include -#include - -void text_toggle_editable (GtkWidget *checkbutton, - GtkWidget *text) -{ - gtk_text_set_editable (GTK_TEXT (text), - GTK_TOGGLE_BUTTON (checkbutton)->active); -} - -void text_toggle_word_wrap (GtkWidget *checkbutton, - GtkWidget *text) -{ - gtk_text_set_word_wrap (GTK_TEXT (text), - GTK_TOGGLE_BUTTON (checkbutton)->active); -} - -void close_application( GtkWidget *widget, - gpointer data ) -{ - gtk_main_quit (); -} - -int main( int argc, - char *argv[] ) -{ - GtkWidget *window; - GtkWidget *box1; - GtkWidget *box2; - GtkWidget *hbox; - GtkWidget *button; - GtkWidget *check; - GtkWidget *separator; - GtkWidget *table; - GtkWidget *vscrollbar; - GtkWidget *text; - GdkColormap *cmap; - GdkColor color; - GdkFont *fixed_font; - - FILE *infile; - - gtk_init (&argc, &argv); - - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_widget_set_size_request (window, 600, 500); - gtk_window_set_policy (GTK_WINDOW (window), TRUE, TRUE, FALSE); - g_signal_connect (G_OBJECT (window), "destroy", - G_CALLBACK (close_application), - NULL); - gtk_window_set_title (GTK_WINDOW (window), "Text Widget Example"); - gtk_container_set_border_width (GTK_CONTAINER (window), 0); - - - box1 = gtk_vbox_new (FALSE, 0); - gtk_container_add (GTK_CONTAINER (window), box1); - gtk_widget_show (box1); - - - box2 = gtk_vbox_new (FALSE, 10); - gtk_container_set_border_width (GTK_CONTAINER (box2), 10); - gtk_box_pack_start (GTK_BOX (box1), box2, TRUE, TRUE, 0); - gtk_widget_show (box2); - - - table = gtk_table_new (2, 2, FALSE); - gtk_table_set_row_spacing (GTK_TABLE (table), 0, 2); - gtk_table_set_col_spacing (GTK_TABLE (table), 0, 2); - gtk_box_pack_start (GTK_BOX (box2), table, TRUE, TRUE, 0); - gtk_widget_show (table); - - /* Create the GtkText widget */ - text = gtk_text_new (NULL, NULL); - gtk_text_set_editable (GTK_TEXT (text), TRUE); - gtk_table_attach (GTK_TABLE (table), text, 0, 1, 0, 1, - GTK_EXPAND | GTK_SHRINK | GTK_FILL, - GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0); - gtk_widget_show (text); - - /* Add a vertical scrollbar to the GtkText widget */ - vscrollbar = gtk_vscrollbar_new (GTK_TEXT (text)->vadj); - gtk_table_attach (GTK_TABLE (table), vscrollbar, 1, 2, 0, 1, - GTK_FILL, GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0); - gtk_widget_show (vscrollbar); - - /* Get the system color map and allocate the color red */ - cmap = gdk_colormap_get_system (); - color.red = 0xffff; - color.green = 0; - color.blue = 0; - if (!gdk_color_alloc (cmap, &color)) { - g_error ("couldn't allocate color"); - } - - /* Load a fixed font */ - fixed_font = gdk_font_load ("-misc-fixed-medium-r-*-*-*-140-*-*-*-*-*-*"); - - /* Realizing a widget creates a window for it, - * ready for us to insert some text */ - gtk_widget_realize (text); - - /* Freeze the text widget, ready for multiple updates */ - gtk_text_freeze (GTK_TEXT (text)); - - /* Insert some colored text */ - gtk_text_insert (GTK_TEXT (text), NULL, &text->style->black, NULL, - "Supports ", -1); - gtk_text_insert (GTK_TEXT (text), NULL, &color, NULL, - "colored ", -1); - gtk_text_insert (GTK_TEXT (text), NULL, &text->style->black, NULL, - "text and different ", -1); - gtk_text_insert (GTK_TEXT (text), fixed_font, &text->style->black, NULL, - "fonts\n\n", -1); - - /* Load the file text.c into the text window */ - - infile = fopen ("text.c", "r"); - - if (infile) { - char buffer[1024]; - int nchars; - - while (1) - { - nchars = fread (buffer, 1, 1024, infile); - gtk_text_insert (GTK_TEXT (text), fixed_font, NULL, - NULL, buffer, nchars); - - if (nchars < 1024) - break; - } - - fclose (infile); - } - - /* Thaw the text widget, allowing the updates to become visible */ - gtk_text_thaw (GTK_TEXT (text)); - - hbox = gtk_hbutton_box_new (); - gtk_box_pack_start (GTK_BOX (box2), hbox, FALSE, FALSE, 0); - gtk_widget_show (hbox); - - check = gtk_check_button_new_with_label ("Editable"); - gtk_box_pack_start (GTK_BOX (hbox), check, FALSE, FALSE, 0); - g_signal_connect (G_OBJECT (check), "toggled", - G_CALLBACK (text_toggle_editable), text); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), TRUE); - gtk_widget_show (check); - check = gtk_check_button_new_with_label ("Wrap Words"); - gtk_box_pack_start (GTK_BOX (hbox), check, FALSE, TRUE, 0); - g_signal_connect (G_OBJECT (check), "toggled", - G_CALLBACK (text_toggle_word_wrap), text); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), FALSE); - gtk_widget_show (check); - - separator = gtk_hseparator_new (); - gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 0); - gtk_widget_show (separator); - - box2 = gtk_vbox_new (FALSE, 10); - gtk_container_set_border_width (GTK_CONTAINER (box2), 10); - gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, TRUE, 0); - gtk_widget_show (box2); - - button = gtk_button_new_with_label ("close"); - g_signal_connect (G_OBJECT (button), "clicked", - G_CALLBACK (close_application), - NULL); - gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); - gtk_widget_set_can_default (button, TRUE); - gtk_widget_grab_default (button); - gtk_widget_show (button); - - gtk_widget_show (window); - - gtk_main (); - - return 0; -} diff --git a/examples/tree/Makefile b/examples/tree/Makefile deleted file mode 100644 index bbeea5992b..0000000000 --- a/examples/tree/Makefile +++ /dev/null @@ -1,16 +0,0 @@ - -CC = gcc - -#CFLAGS = -Wall \ -# -DG_DISABLE_DEPRECATED \ -# -DGDK_DISABLE_DEPRECATED \ -# -DGDK_PIXBUF_DISABLE_DEPRECATED \ -# -DGTK_DISABLE_DEPRECATED - -CFLAGS = - -tree: tree.c - $(CC) tree.c -o tree $(CFLAGS) `pkg-config gtk+-2.0 --cflags --libs` - -clean: - rm -f *.o tree diff --git a/examples/tree/tree.c b/examples/tree/tree.c deleted file mode 100644 index 9c3962e6b2..0000000000 --- a/examples/tree/tree.c +++ /dev/null @@ -1,184 +0,0 @@ - -#define GTK_ENABLE_BROKEN -#include "config.h" -#include - -/* for all the GtkItem:: and GtkTreeItem:: signals */ -static void cb_itemsignal( GtkWidget *item, - gchar *signame ) -{ - gchar *name; - GtkLabel *label; - - /* It's a Bin, so it has one child, which we know to be a - label, so get that */ - label = GTK_LABEL (GTK_BIN (item)->child); - /* Get the text of the label */ - gtk_label_get (label, &name); - /* Get the level of the tree which the item is in */ - g_print ("%s called for item %s->%p, level %d\n", signame, name, - item, GTK_TREE (item->parent)->level); -} - -/* Note that this is never called */ -static void cb_unselect_child( GtkWidget *root_tree, - GtkWidget *child, - GtkWidget *subtree ) -{ - g_print ("unselect_child called for root tree %p, subtree %p, child %p\n", - root_tree, subtree, child); -} - -/* Note that this is called every time the user clicks on an item, - whether it is already selected or not. */ -static void cb_select_child (GtkWidget *root_tree, GtkWidget *child, - GtkWidget *subtree) -{ - g_print ("select_child called for root tree %p, subtree %p, child %p\n", - root_tree, subtree, child); -} - -static void cb_selection_changed( GtkWidget *tree ) -{ - GList *i; - - g_print ("selection_change called for tree %p\n", tree); - g_print ("selected objects are:\n"); - - i = GTK_TREE_SELECTION_OLD (tree); - while (i) { - gchar *name; - GtkLabel *label; - GtkWidget *item; - - /* Get a GtkWidget pointer from the list node */ - item = GTK_WIDGET (i->data); - label = GTK_LABEL (GTK_BIN (item)->child); - gtk_label_get (label, &name); - g_print ("\t%s on level %d\n", name, GTK_TREE - (item->parent)->level); - i = i->next; - } -} - -int main( int argc, - char *argv[] ) -{ - GtkWidget *window, *scrolled_win, *tree; - static gchar *itemnames[] = {"Foo", "Bar", "Baz", "Quux", - "Maurice"}; - gint i; - - gtk_init (&argc, &argv); - - /* a generic toplevel window */ - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - g_signal_connect (G_OBJECT (window), "delete_event", - G_CALLBACK (gtk_main_quit), NULL); - gtk_container_set_border_width (GTK_CONTAINER (window), 5); - - /* A generic scrolled window */ - scrolled_win = gtk_scrolled_window_new (NULL, NULL); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win), - GTK_POLICY_AUTOMATIC, - GTK_POLICY_AUTOMATIC); - gtk_widget_set_size_request (scrolled_win, 150, 200); - gtk_container_add (GTK_CONTAINER (window), scrolled_win); - gtk_widget_show (scrolled_win); - - /* Create the root tree */ - tree = gtk_tree_new (); - g_print ("root tree is %p\n", tree); - /* connect all GtkTree:: signals */ - g_signal_connect (G_OBJECT (tree), "select_child", - G_CALLBACK (cb_select_child), tree); - g_signal_connect (G_OBJECT (tree), "unselect_child", - G_CALLBACK (cb_unselect_child), tree); - g_signal_connect (G_OBJECT(tree), "selection_changed", - G_CALLBACK(cb_selection_changed), tree); - /* Add it to the scrolled window */ - gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolled_win), - tree); - /* Set the selection mode */ - gtk_tree_set_selection_mode (GTK_TREE (tree), - GTK_SELECTION_MULTIPLE); - /* Show it */ - gtk_widget_show (tree); - - for (i = 0; i < 5; i++){ - GtkWidget *subtree, *item; - gint j; - - /* Create a tree item */ - item = gtk_tree_item_new_with_label (itemnames[i]); - /* Connect all GtkItem:: and GtkTreeItem:: signals */ - g_signal_connect (G_OBJECT (item), "select", - G_CALLBACK (cb_itemsignal), "select"); - g_signal_connect (G_OBJECT (item), "deselect", - G_CALLBACK (cb_itemsignal), "deselect"); - g_signal_connect (G_OBJECT (item), "toggle", - G_CALLBACK (cb_itemsignal), "toggle"); - g_signal_connect (G_OBJECT (item), "expand", - G_CALLBACK (cb_itemsignal), "expand"); - g_signal_connect (G_OBJECT (item), "collapse", - G_CALLBACK (cb_itemsignal), "collapse"); - /* Add it to the parent tree */ - gtk_tree_append (GTK_TREE (tree), item); - /* Show it - this can be done at any time */ - gtk_widget_show (item); - /* Create this item's subtree */ - subtree = gtk_tree_new (); - g_print ("-> item %s->%p, subtree %p\n", itemnames[i], item, - subtree); - - /* This is still necessary if you want these signals to be called - for the subtree's children. Note that selection_change will be - signalled for the root tree regardless. */ - g_signal_connect (G_OBJECT (subtree), "select_child", - G_CALLBACK (cb_select_child), subtree); - g_signal_connect (G_OBJECT (subtree), "unselect_child", - G_CALLBACK (cb_unselect_child), subtree); - /* This has absolutely no effect, because it is completely ignored - in subtrees */ - gtk_tree_set_selection_mode (GTK_TREE (subtree), - GTK_SELECTION_SINGLE); - /* Neither does this, but for a rather different reason - the - view_mode and view_line values of a tree are propagated to - subtrees when they are mapped. So, setting it later on would - actually have a (somewhat unpredictable) effect */ - gtk_tree_set_view_mode (GTK_TREE (subtree), GTK_TREE_VIEW_ITEM); - /* Set this item's subtree - note that you cannot do this until - AFTER the item has been added to its parent tree! */ - gtk_tree_item_set_subtree (GTK_TREE_ITEM (item), subtree); - - for (j = 0; j < 5; j++){ - GtkWidget *subitem; - - /* Create a subtree item, in much the same way */ - subitem = gtk_tree_item_new_with_label (itemnames[j]); - /* Connect all GtkItem:: and GtkTreeItem:: signals */ - g_signal_connect (G_OBJECT (subitem), "select", - G_CALLBACK (cb_itemsignal), "select"); - g_signal_connect (G_OBJECT (subitem), "deselect", - G_CALLBACK (cb_itemsignal), "deselect"); - g_signal_connect (G_OBJECT (subitem), "toggle", - G_CALLBACK (cb_itemsignal), "toggle"); - g_signal_connect (G_OBJECT (subitem), "expand", - G_CALLBACK (cb_itemsignal), "expand"); - g_signal_connect (G_OBJECT (subitem), "collapse", - G_CALLBACK (cb_itemsignal), "collapse"); - g_print ("-> -> item %s->%p\n", itemnames[j], subitem); - /* Add it to its parent tree */ - gtk_tree_append (GTK_TREE (subtree), subitem); - /* Show it */ - gtk_widget_show (subitem); - } - } - - /* Show the window and loop endlessly */ - gtk_widget_show (window); - - gtk_main(); - - return 0; -} diff --git a/examples/wheelbarrow/wheelbarrow.c b/examples/wheelbarrow/wheelbarrow.c index 0976076dbe..12d8395c0c 100644 --- a/examples/wheelbarrow/wheelbarrow.c +++ b/examples/wheelbarrow/wheelbarrow.c @@ -1,5 +1,4 @@ -#include "config.h" #include /* XPM */ diff --git a/gail-uninstalled.pc.in b/gail-3.0-uninstalled.pc.in similarity index 94% rename from gail-uninstalled.pc.in rename to gail-3.0-uninstalled.pc.in index 21f8ebd7d7..50a802e90d 100644 --- a/gail-uninstalled.pc.in +++ b/gail-3.0-uninstalled.pc.in @@ -6,6 +6,6 @@ includedir=@includedir@ Name: Gail Description: GNOME Accessibility Implementation Library Version: @VERSION@ -Requires: atk gtk+-2.0 +Requires: atk gtk+-3. Libs: ${pc_top_builddir}/${pcfiledir}/modules/other/gail/libgail.la ${pc_top_builddir}/${pcfiledir}/modules/other/gail/libgail-util/libgailutil.la Cflags: -I${pc_top_builddir}/${pcfiledir}/modules/other/gail diff --git a/gail.pc.in b/gail-3.0.pc.in similarity index 65% rename from gail.pc.in rename to gail-3.0.pc.in index bab729a897..5b42e83e11 100644 --- a/gail.pc.in +++ b/gail-3.0.pc.in @@ -6,6 +6,6 @@ includedir=@includedir@ Name: Gail Description: GNOME Accessibility Implementation Library Version: @VERSION@ -Requires: atk gtk+-2.0 -Libs: -L${libdir} -lgailutil -Cflags: -I${includedir}/gail-1.0 +Requires: atk gtk+-3.0 +Libs: -L${libdir} -lgailutil-3.0 +Cflags: -I${includedir}/gail-3.0 diff --git a/gdk-2.0-uninstalled.pc.in b/gdk-3.0-uninstalled.pc.in similarity index 84% rename from gdk-2.0-uninstalled.pc.in rename to gdk-3.0-uninstalled.pc.in index f945a3f3b7..45adcf0f06 100644 --- a/gdk-2.0-uninstalled.pc.in +++ b/gdk-3.0-uninstalled.pc.in @@ -3,6 +3,6 @@ target=@gdktarget@ Name: GDK Uninstalled Description: GTK+ Drawing Kit (${target} target), Not Installed Version: @VERSION@ -Requires: gdk-pixbuf-2.0-uninstalled @GDK_PACKAGES@ +Requires: gdk-pixbuf-@GTK_API_VERSION@-uninstalled @GDK_PACKAGES@ Libs: ${pc_top_builddir}/${pcfiledir}/gdk/libgdk-${target}-@GTK_API_VERSION@.la @GDK_EXTRA_LIBS@ Cflags: -I${pc_top_builddir}/${pcfiledir}/@srcdir@/gdk -I${pc_top_builddir}/${pcfiledir}/@srcdir@ -I${pc_top_builddir}/${pcfiledir} @GDK_EXTRA_CFLAGS@ diff --git a/gdk-2.0.pc.in b/gdk-3.0.pc.in similarity index 60% rename from gdk-2.0.pc.in rename to gdk-3.0.pc.in index 24a5dfb72c..ca12b2eef2 100644 --- a/gdk-2.0.pc.in +++ b/gdk-3.0.pc.in @@ -7,6 +7,6 @@ target=@gdktarget@ Name: GDK Description: GTK+ Drawing Kit (${target} target) Version: @VERSION@ -Requires: gdk-pixbuf-2.0 @GDK_PACKAGES@ +Requires: gdk-pixbuf-@GTK_API_VERSION@ @GDK_PACKAGES@ Libs: -L${libdir} -lgdk-${target}-@GTK_API_VERSION@ @GDK_EXTRA_LIBS@ -Cflags: -I${includedir}/gtk-2.0 -I${libdir}/gtk-2.0/include @GDK_EXTRA_CFLAGS@ +Cflags: -I${includedir}/gtk-@GTK_API_VERSION@ -I${libdir}/gtk-@GTK_API_VERSION@/include @GDK_EXTRA_CFLAGS@ diff --git a/gdk-pixbuf-2.0-uninstalled.pc.in b/gdk-pixbuf-3.0-uninstalled.pc.in similarity index 100% rename from gdk-pixbuf-2.0-uninstalled.pc.in rename to gdk-pixbuf-3.0-uninstalled.pc.in diff --git a/gdk-pixbuf-2.0.pc.in b/gdk-pixbuf-3.0.pc.in similarity index 79% rename from gdk-pixbuf-2.0.pc.in rename to gdk-pixbuf-3.0.pc.in index b3b09154de..e65398b8f0 100644 --- a/gdk-pixbuf-2.0.pc.in +++ b/gdk-pixbuf-3.0.pc.in @@ -8,5 +8,5 @@ Description: Image loading and scaling Version: @VERSION@ Requires: gobject-2.0,gmodule-no-export-2.0 Libs: -L${libdir} -lgdk_pixbuf-@GTK_API_VERSION@ @GDK_PIXBUF_EXTRA_LIBS@ -Cflags: -I${includedir}/gtk-2.0 @GDK_PIXBUF_EXTRA_CFLAGS@ +Cflags: -I${includedir}/gtk-@GTK_API_VERSION@ @GDK_PIXBUF_EXTRA_CFLAGS@ diff --git a/gdk-pixbuf/Makefile.am b/gdk-pixbuf/Makefile.am index cf1769bae9..6ab748e865 100644 --- a/gdk-pixbuf/Makefile.am +++ b/gdk-pixbuf/Makefile.am @@ -62,9 +62,9 @@ TESTS = abicheck.sh pltcheck.sh endif lib_LTLIBRARIES = \ - libgdk_pixbuf-2.0.la + libgdk_pixbuf-3.0.la -loaderdir = $(libdir)/gtk-2.0/$(GTK_BINARY_VERSION)/loaders +loaderdir = $(libdir)/gtk-3.0/$(GTK_BINARY_VERSION)/loaders module_libs = libgdk_pixbuf-$(GTK_API_VERSION).la $(GDK_PIXBUF_DEP_LIBS) @@ -244,9 +244,6 @@ libstatic_pixbufloader_gdip_gif_la_SOURCES = \ libstatic_pixbufloader_gdip_jpeg_la_SOURCES = \ io-gdip-jpeg.c -libstatic_pixbufloader_gdip_png_la_SOURCES = \ - io-gdip-png.c - libstatic_pixbufloader_gdip_tiff_la_SOURCES = \ io-gdip-tiff.c @@ -327,17 +324,6 @@ libpixbufloader_gdip_jpeg_la_SOURCES = \ io-gdip-jpeg.c libpixbufloader_gdip_jpeg_la_LIBADD = $(module_libs) $(libole32) -libpixbufloader_gdip_png_la_LDFLAGS = -avoid-version -module -no-undefined -libpixbufloader_gdip_png_la_SOURCES = \ - io-gdip-native.h \ - io-gdip-propertytags.h \ - io-gdip-utils.h \ - io-gdip-utils.c \ - io-gdip-animation.c \ - io-gdip-animation.h \ - io-gdip-png.c -libpixbufloader_gdip_png_la_LIBADD = $(module_libs) $(libole32) - libpixbufloader_gdip_tiff_la_LDFLAGS = -avoid-version -module -no-undefined libpixbufloader_gdip_tiff_la_SOURCES = \ io-gdip-native.h \ @@ -523,7 +509,7 @@ INCLUDES = \ -I$(top_srcdir) -I$(top_builddir) \ -I$(top_srcdir)/gdk-pixbuf \ -I$(top_builddir)/gdk-pixbuf \ - -DGTK_SYSCONFDIR=\"$(sysconfdir)\" \ + -DGTK_LIBDIR=\"$(libdir)\" \ -DGTK_VERSION=\"$(GTK_VERSION)\" \ -DGTK_BINARY_VERSION=\"$(GTK_BINARY_VERSION)\" \ -DGTK_PREFIX=\"$(prefix)\" \ @@ -538,21 +524,21 @@ LDADDS = libgdk_pixbuf-$(GTK_API_VERSION).la $(GDK_PIXBUF_DEP_LIBS) noinst_PROGRAMS = test-gdk-pixbuf test_gdk_pixbuf_LDADD = $(LDADDS) -bin_PROGRAMS = gdk-pixbuf-csource gdk-pixbuf-query-loaders -gdk_pixbuf_csource_SOURCES = gdk-pixbuf-csource.c -gdk_pixbuf_csource_LDADD = $(LDADDS) +bin_PROGRAMS = gdk-pixbuf-csource-3.0 gdk-pixbuf-query-loaders-3.0 +gdk_pixbuf_csource_3_0_SOURCES = gdk-pixbuf-csource.c +gdk_pixbuf_csource_3_0_LDADD = $(LDADDS) -gdk_pixbuf_query_loaders_DEPENDENCIES = $(DEPS) -gdk_pixbuf_query_loaders_LDADD = $(LDADDS) +gdk_pixbuf_query_loaders_3_0_DEPENDENCIES = $(DEPS) +gdk_pixbuf_query_loaders_3_0_LDADD = $(LDADDS) -gdk_pixbuf_query_loaders_SOURCES = queryloaders.c +gdk_pixbuf_query_loaders_3_0_SOURCES = queryloaders.c # # The GdkPixBuf library # -libgdk_pixbufincludedir = $(includedir)/gtk-2.0/gdk-pixbuf -libgdk_pixbuf_2_0_la_SOURCES = \ +libgdk_pixbufincludedir = $(includedir)/gtk-3.0/gdk-pixbuf +libgdk_pixbuf_3_0_la_SOURCES = \ gdk-pixbuf-i18n.h \ gdk-pixbuf.c \ gdk-pixbuf-animation.c \ @@ -566,7 +552,7 @@ libgdk_pixbuf_2_0_la_SOURCES = \ gdk-pixdata.c \ gdk-pixbuf-enum-types.c -libgdk_pixbuf_2_0_la_LDFLAGS = \ +libgdk_pixbuf_3_0_la_LDFLAGS = \ $(gdk_pixbuf_win32_res_ldflag) \ -version-info $(LT_VERSION_INFO) \ $(LIBTOOL_EXPORT_OPTIONS) \ @@ -574,8 +560,8 @@ libgdk_pixbuf_2_0_la_LDFLAGS = \ $(gdk_pixbuf_symbols) -libgdk_pixbuf_2_0_la_LIBADD = pixops/libpixops.la $(builtin_objs) $(GDK_PIXBUF_DEP_LIBS) $(libole32) -libgdk_pixbuf_2_0_la_DEPENDENCIES = pixops/libpixops.la $(builtin_objs) $(gdk_pixbuf_def) $(gdk_pixbuf_win32_res) +libgdk_pixbuf_3_0_la_LIBADD = pixops/libpixops.la $(builtin_objs) $(GDK_PIXBUF_DEP_LIBS) $(libole32) +libgdk_pixbuf_3_0_la_DEPENDENCIES = pixops/libpixops.la $(builtin_objs) $(gdk_pixbuf_def) $(gdk_pixbuf_win32_res) gdk_pixbuf_headers = \ gdk-pixbuf.h \ @@ -615,7 +601,7 @@ MAINTAINERCLEANFILES = \ gdk-pixbuf-enum-types.c \ gdk-pixbuf-marshal.h \ gdk-pixbuf-marshal.c \ - gdk-pixbuf.loaders + loaders.cache # # gdk-pixbuf-enum-types.h @@ -691,15 +677,15 @@ EXTRA_DIST += \ if HAVE_INTROSPECTION -GdkPixbuf-2.0.gir: libgdk_pixbuf-2.0.la Makefile -GdkPixbuf_2_0_gir_SCANNERFLAGS = --strip-prefix=Gdk -GdkPixbuf_2_0_gir_INCLUDES = GModule-2.0 Gio-2.0 -GdkPixbuf_2_0_gir_LIBS = libgdk_pixbuf-2.0.la -GdkPixbuf_2_0_gir_CFLAGS = $(INCLUDES) -GdkPixbuf_2_0_gir_FILES = \ +GdkPixbuf-3.0.gir: libgdk_pixbuf-3.0.la Makefile +GdkPixbuf_3_0_gir_SCANNERFLAGS = --strip-prefix=Gdk +GdkPixbuf_3_0_gir_INCLUDES = GModule-2.0 Gio-2.0 +GdkPixbuf_3_0_gir_LIBS = libgdk_pixbuf-3.0.la +GdkPixbuf_3_0_gir_CFLAGS = $(INCLUDES) +GdkPixbuf_3_0_gir_FILES = \ $(addprefix $(srcdir)/,$(libgdk_pixbufinclude_HEADERS)) \ - $(addprefix $(srcdir)/,$(libgdk_pixbuf_2_0_la_SOURCES)) -INTROSPECTION_GIRS += GdkPixbuf-2.0.gir + $(addprefix $(srcdir)/,$(libgdk_pixbuf_3_0_la_SOURCES)) +INTROSPECTION_GIRS += GdkPixbuf-3.0.gir girdir = $(datadir)/gir-1.0 dist_gir_DATA = $(INTROSPECTION_GIRS) @@ -724,39 +710,39 @@ endif # after the libraries are installed in their final locations. install-data-hook: install-ms-lib install-def-file @if $(RUN_QUERY_LOADER_TEST) ; then \ - $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/gtk-2.0 ; \ - $(top_builddir)/gdk-pixbuf/gdk-pixbuf-query-loaders > $(DESTDIR)$(sysconfdir)/gtk-2.0/gdk-pixbuf.loaders ; \ + $(mkinstalldirs) $(DESTDIR)$(libdir)/gtk-3.0/3.0.0 ; \ + $(top_builddir)/gdk-pixbuf/gdk-pixbuf-query-loaders-3.0 > $(DESTDIR)$(libdir)/gtk-3.0/3.0.0/loaders.cache ; \ else \ echo "***" ; \ - echo "*** Warning: gdk-pixbuf.loaders not built" ; \ + echo "*** Warning: loaders.cache not built" ; \ echo "***" ; \ echo "*** Generate this file manually on host" ; \ - echo "*** system using gdk-pixbuf-query-loaders" ; \ + echo "*** system using gdk-pixbuf-query-loaders-3.0" ; \ echo "***" ; \ fi uninstall-local: uninstall-ms-lib uninstall-def-file - rm -f $(DESTDIR)$(sysconfdir)/gtk-2.0/gdk-pixbuf.loaders + rm -f $(DESTDIR)$(libdir)/gtk-3.0/3.0.0/loaders.cache if CROSS_COMPILING else -all-local: gdk-pixbuf.loaders +all-local: loaders.cache endif if BUILD_DYNAMIC_MODULES -gdk-pixbuf.loaders: $(loader_LTLIBRARIES) gdk-pixbuf-query-loaders$(EXEEXT) +loaders.cache: $(loader_LTLIBRARIES) gdk-pixbuf-query-loaders-3.0$(EXEEXT) LOADERS=`echo libpixbufloader-*.la` ; \ if test "x$$LOADERS" != 'xlibpixbufloader-*.la' ; then \ - echo "Writing a gdk-pixbuf.loader file to use when running examples before installing gdk-pixbuf."; \ - $(top_builddir)/gdk-pixbuf/gdk-pixbuf-query-loaders $$LOADERS > ./gdk-pixbuf.loaders ;\ + echo "Writing a loaders.cache file to use when running examples before installing gdk-pixbuf."; \ + $(top_builddir)/gdk-pixbuf/gdk-pixbuf-query-loaders-3.0 $$LOADERS > ./loaders.cache ;\ else \ echo "No dynamic modules found; will use only static modules for uninstalled example programs."; \ - touch gdk-pixbuf.loaders; \ + touch loaders.cache; \ fi else -gdk-pixbuf.loaders: +loaders.cache: echo "No dynamic modules found; will use only static modules for uninstalled example programs."; \ - touch gdk-pixbuf.loaders; + touch loaders.cache; endif -include $(top_srcdir)/git.mk diff --git a/gdk-pixbuf/abicheck.sh b/gdk-pixbuf/abicheck.sh index dd8f37a61e..b6b47ab454 100755 --- a/gdk-pixbuf/abicheck.sh +++ b/gdk-pixbuf/abicheck.sh @@ -1,5 +1,5 @@ #! /bin/sh cpp -DINCLUDE_VARIABLES -P -DALL_FILES ${srcdir:-.}/gdk-pixbuf.symbols | sed -e '/^$/d' -e 's/ G_GNUC.*$//' -e 's/ PRIVATE$//' | sort > expected-abi -nm -D -g --defined-only .libs/libgdk_pixbuf-2.0.so | cut -d ' ' -f 3 | sort > actual-abi +nm -D -g --defined-only .libs/libgdk_pixbuf-3.0.so | cut -d ' ' -f 3 | egrep -v '^(__bss_start|_edata|_end)' | sort > actual-abi diff -u expected-abi actual-abi && rm -f expected-abi actual-abi diff --git a/gdk-pixbuf/gdk-pixbuf-animation.c b/gdk-pixbuf/gdk-pixbuf-animation.c index 28da439d99..6d5e835963 100644 --- a/gdk-pixbuf/gdk-pixbuf-animation.c +++ b/gdk-pixbuf/gdk-pixbuf-animation.c @@ -257,36 +257,6 @@ gdk_pixbuf_animation_new_from_file (const char *filename, #endif -/** - * gdk_pixbuf_animation_ref: - * @animation: An animation. - * - * Adds a reference to an animation. - * - * Return value: The same as the @animation argument. - * - * Deprecated: 2.0: Use g_object_ref(). - **/ -GdkPixbufAnimation * -gdk_pixbuf_animation_ref (GdkPixbufAnimation *animation) -{ - return (GdkPixbufAnimation*) g_object_ref (animation); -} - -/** - * gdk_pixbuf_animation_unref: - * @animation: An animation. - * - * Removes a reference from an animation. - * - * Deprecated: 2.0: Use g_object_unref(). - **/ -void -gdk_pixbuf_animation_unref (GdkPixbufAnimation *animation) -{ - g_object_unref (animation); -} - /** * gdk_pixbuf_animation_is_static_image: * @animation: a #GdkPixbufAnimation diff --git a/gdk-pixbuf/gdk-pixbuf-animation.h b/gdk-pixbuf/gdk-pixbuf-animation.h index 32757ee764..a67e3c9073 100644 --- a/gdk-pixbuf/gdk-pixbuf-animation.h +++ b/gdk-pixbuf/gdk-pixbuf-animation.h @@ -24,7 +24,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GDK_PIXBUF_DISABLE_SINGLE_INCLUDES) && !defined (GDK_PIXBUF_H_INSIDE) && !defined (GDK_PIXBUF_COMPILATION) +#if !defined (GDK_PIXBUF_H_INSIDE) && !defined (GDK_PIXBUF_COMPILATION) #error "Only can be included directly." #endif @@ -58,11 +58,6 @@ GType gdk_pixbuf_animation_get_type (void) G_GNUC_CONST; GdkPixbufAnimation *gdk_pixbuf_animation_new_from_file (const char *filename, GError **error); -#ifndef GDK_PIXBUF_DISABLE_DEPRECATED -GdkPixbufAnimation *gdk_pixbuf_animation_ref (GdkPixbufAnimation *animation); -void gdk_pixbuf_animation_unref (GdkPixbufAnimation *animation); -#endif - int gdk_pixbuf_animation_get_width (GdkPixbufAnimation *animation); int gdk_pixbuf_animation_get_height (GdkPixbufAnimation *animation); gboolean gdk_pixbuf_animation_is_static_image (GdkPixbufAnimation *animation); diff --git a/gdk-pixbuf/gdk-pixbuf-core.h b/gdk-pixbuf/gdk-pixbuf-core.h index b2563809ed..4ea16934c3 100644 --- a/gdk-pixbuf/gdk-pixbuf-core.h +++ b/gdk-pixbuf/gdk-pixbuf-core.h @@ -23,7 +23,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GDK_PIXBUF_DISABLE_SINGLE_INCLUDES) && !defined (GDK_PIXBUF_H_INSIDE) && !defined (GDK_PIXBUF_COMPILATION) +#if !defined (GDK_PIXBUF_H_INSIDE) && !defined (GDK_PIXBUF_COMPILATION) #error "Only can be included directly." #endif @@ -84,13 +84,6 @@ GQuark gdk_pixbuf_error_quark (void); GType gdk_pixbuf_get_type (void) G_GNUC_CONST; -/* Reference counting */ - -#ifndef GDK_PIXBUF_DISABLE_DEPRECATED -GdkPixbuf *gdk_pixbuf_ref (GdkPixbuf *pixbuf); -void gdk_pixbuf_unref (GdkPixbuf *pixbuf); -#endif - /* GdkPixbuf accessors */ GdkColorspace gdk_pixbuf_get_colorspace (const GdkPixbuf *pixbuf); diff --git a/gdk-pixbuf/gdk-pixbuf-csource.c b/gdk-pixbuf/gdk-pixbuf-csource.c index b774d0c180..c9b0d4f238 100644 --- a/gdk-pixbuf/gdk-pixbuf-csource.c +++ b/gdk-pixbuf/gdk-pixbuf-csource.c @@ -31,8 +31,8 @@ /* --- defines --- */ #undef G_LOG_DOMAIN #define G_LOG_DOMAIN "Gdk-Pixbuf-CSource" -#define PRG_NAME "gdk-pixbuf-csource" -#define PKG_NAME "Gtk+" +#define PRG_NAME "gdk-pixbuf-csource-3.0" +#define PKG_NAME "GTK+" #define PKG_HTTP_HOME "http://www.gtk.org" diff --git a/gdk-pixbuf/gdk-pixbuf-enum-types.h.template b/gdk-pixbuf/gdk-pixbuf-enum-types.h.template index 4ecb7161da..3989980b03 100644 --- a/gdk-pixbuf/gdk-pixbuf-enum-types.h.template +++ b/gdk-pixbuf/gdk-pixbuf-enum-types.h.template @@ -1,5 +1,5 @@ /*** BEGIN file-header ***/ -#if defined(GDK_PIXBUF_DISABLE_SINGLE_INCLUDES) && !defined (GDK_PIXBUF_H_INSIDE) && !defined (GDK_PIXBUF_COMPILATION) +#if !defined (GDK_PIXBUF_H_INSIDE) && !defined (GDK_PIXBUF_COMPILATION) #error "Only can be included directly." #endif diff --git a/gdk-pixbuf/gdk-pixbuf-features.h.in b/gdk-pixbuf/gdk-pixbuf-features.h.in index ea1674d577..ec5f647ed0 100644 --- a/gdk-pixbuf/gdk-pixbuf-features.h.in +++ b/gdk-pixbuf/gdk-pixbuf-features.h.in @@ -1,4 +1,4 @@ -#if defined(GDK_PIXBUF_DISABLE_SINGLE_INCLUDES) && !defined (GDK_PIXBUF_H_INSIDE) && !defined (GDK_PIXBUF_COMPILATION) +#if !defined (GDK_PIXBUF_H_INSIDE) && !defined (GDK_PIXBUF_COMPILATION) #error "Only can be included directly." #endif diff --git a/gdk-pixbuf/gdk-pixbuf-io.c b/gdk-pixbuf/gdk-pixbuf-io.c index 7140766ef2..bd6a78722c 100644 --- a/gdk-pixbuf/gdk-pixbuf-io.c +++ b/gdk-pixbuf/gdk-pixbuf-io.c @@ -55,53 +55,53 @@ static gint format_check (GdkPixbufModule *module, guchar *buffer, int size) { - int i, j; - gchar m; - GdkPixbufModulePattern *pattern; - gboolean anchored; - guchar *prefix; - gchar *mask; + int i, j; + gchar m; + GdkPixbufModulePattern *pattern; + gboolean anchored; + guchar *prefix; + gchar *mask; - for (pattern = module->info->signature; pattern->prefix; pattern++) { - if (pattern->mask && pattern->mask[0] == '*') { - prefix = (guchar *)pattern->prefix + 1; - mask = pattern->mask + 1; - anchored = FALSE; - } - else { - prefix = (guchar *)pattern->prefix; - mask = pattern->mask; - anchored = TRUE; - } - for (i = 0; i < size; i++) { - for (j = 0; i + j < size && prefix[j] != 0; j++) { - m = mask ? mask[j] : ' '; - if (m == ' ') { - if (buffer[i + j] != prefix[j]) - break; - } - else if (m == '!') { - if (buffer[i + j] == prefix[j]) - break; - } - else if (m == 'z') { - if (buffer[i + j] != 0) - break; - } - else if (m == 'n') { - if (buffer[i + j] == 0) - break; - } - } + for (pattern = module->info->signature; pattern->prefix; pattern++) { + if (pattern->mask && pattern->mask[0] == '*') { + prefix = (guchar *)pattern->prefix + 1; + mask = pattern->mask + 1; + anchored = FALSE; + } + else { + prefix = (guchar *)pattern->prefix; + mask = pattern->mask; + anchored = TRUE; + } + for (i = 0; i < size; i++) { + for (j = 0; i + j < size && prefix[j] != 0; j++) { + m = mask ? mask[j] : ' '; + if (m == ' ') { + if (buffer[i + j] != prefix[j]) + break; + } + else if (m == '!') { + if (buffer[i + j] == prefix[j]) + break; + } + else if (m == 'z') { + if (buffer[i + j] != 0) + break; + } + else if (m == 'n') { + if (buffer[i + j] == 0) + break; + } + } - if (prefix[j] == 0) - return pattern->relevance; + if (prefix[j] == 0) + return pattern->relevance; - if (anchored) - break; - } - } - return 0; + if (anchored) + break; + } + } + return 0; } #endif @@ -111,22 +111,22 @@ G_LOCK_DEFINE_STATIC (threadunsafe_loader_lock); gboolean _gdk_pixbuf_lock (GdkPixbufModule *image_module) { - if (g_threads_got_initialized && - !(image_module->info->flags & GDK_PIXBUF_FORMAT_THREADSAFE)) { - G_LOCK (threadunsafe_loader_lock); + if (g_threads_got_initialized && + !(image_module->info->flags & GDK_PIXBUF_FORMAT_THREADSAFE)) { + G_LOCK (threadunsafe_loader_lock); - return TRUE; - } + return TRUE; + } - return FALSE; + return FALSE; } void _gdk_pixbuf_unlock (GdkPixbufModule *image_module) { - if (!(image_module->info->flags & GDK_PIXBUF_FORMAT_THREADSAFE)) { - G_UNLOCK (threadunsafe_loader_lock); - } + if (!(image_module->info->flags & GDK_PIXBUF_FORMAT_THREADSAFE)) { + G_UNLOCK (threadunsafe_loader_lock); + } } static GSList *file_formats = NULL; @@ -136,12 +136,12 @@ static void gdk_pixbuf_io_init (void); static GSList * get_file_formats (void) { - G_LOCK (init_lock); - if (file_formats == NULL) - gdk_pixbuf_io_init (); - G_UNLOCK (init_lock); - - return file_formats; + G_LOCK (init_lock); + if (file_formats == NULL) + gdk_pixbuf_io_init (); + G_UNLOCK (init_lock); + + return file_formats; } @@ -150,80 +150,80 @@ get_file_formats (void) static gboolean scan_string (const char **pos, GString *out) { - const char *p = *pos, *q = *pos; - char *tmp, *tmp2; - gboolean quoted; - - while (g_ascii_isspace (*p)) - p++; - - if (!*p) - return FALSE; - else if (*p == '"') { - p++; - quoted = FALSE; - for (q = p; (*q != '"') || quoted; q++) { - if (!*q) - return FALSE; - quoted = (*q == '\\') && !quoted; - } - - tmp = g_strndup (p, q - p); - tmp2 = g_strcompress (tmp); - g_string_truncate (out, 0); - g_string_append (out, tmp2); - g_free (tmp); - g_free (tmp2); - } - - q++; - *pos = q; - - return TRUE; + const char *p = *pos, *q = *pos; + char *tmp, *tmp2; + gboolean quoted; + + while (g_ascii_isspace (*p)) + p++; + + if (!*p) + return FALSE; + else if (*p == '"') { + p++; + quoted = FALSE; + for (q = p; (*q != '"') || quoted; q++) { + if (!*q) + return FALSE; + quoted = (*q == '\\') && !quoted; + } + + tmp = g_strndup (p, q - p); + tmp2 = g_strcompress (tmp); + g_string_truncate (out, 0); + g_string_append (out, tmp2); + g_free (tmp); + g_free (tmp2); + } + + q++; + *pos = q; + + return TRUE; } static gboolean scan_int (const char **pos, int *out) { - int i = 0; - char buf[32]; - const char *p = *pos; - - while (g_ascii_isspace (*p)) - p++; - - if (*p < '0' || *p > '9') - return FALSE; - - while ((*p >= '0') && (*p <= '9') && i < sizeof (buf)) { - buf[i] = *p; - i++; - p++; - } - - if (i == sizeof (buf)) - return FALSE; - else - buf[i] = '\0'; - - *out = atoi (buf); - - *pos = p; + int i = 0; + char buf[32]; + const char *p = *pos; + + while (g_ascii_isspace (*p)) + p++; + + if (*p < '0' || *p > '9') + return FALSE; + + while ((*p >= '0') && (*p <= '9') && i < sizeof (buf)) { + buf[i] = *p; + i++; + p++; + } + + if (i == sizeof (buf)) + return FALSE; + else + buf[i] = '\0'; + + *out = atoi (buf); + + *pos = p; - return TRUE; + return TRUE; } static gboolean skip_space (const char **pos) { - const char *p = *pos; - - while (g_ascii_isspace (*p)) - p++; + const char *p = *pos; + + while (g_ascii_isspace (*p)) + p++; - *pos = p; - - return !(*p == '\0'); + *pos = p; + + return !(*p == '\0'); } #ifdef G_OS_WIN32 @@ -234,14 +234,14 @@ static HMODULE gdk_pixbuf_dll; BOOL WINAPI DllMain (HINSTANCE hinstDLL, - DWORD fdwReason, - LPVOID lpvReserved) + DWORD fdwReason, + LPVOID lpvReserved) { - switch (fdwReason) { - case DLL_PROCESS_ATTACH: - gdk_pixbuf_dll = (HMODULE) hinstDLL; - break; - } + switch (fdwReason) { + case DLL_PROCESS_ATTACH: + gdk_pixbuf_dll = (HMODULE) hinstDLL; + break; + } return TRUE; } @@ -252,7 +252,7 @@ get_toplevel (void) static char *toplevel = NULL; if (toplevel == NULL) - toplevel = g_win32_get_package_installation_directory_of_module (gdk_pixbuf_dll); + toplevel = g_win32_get_package_installation_directory_of_module (gdk_pixbuf_dll); return toplevel; } @@ -263,7 +263,7 @@ get_sysconfdir (void) static char *sysconfdir = NULL; if (sysconfdir == NULL) - sysconfdir = g_build_filename (get_toplevel (), "etc", NULL); + sysconfdir = g_build_filename (get_toplevel (), "etc", NULL); return sysconfdir; } @@ -277,12 +277,12 @@ correct_prefix (gchar **path) if (strncmp (*path, GTK_PREFIX "/", strlen (GTK_PREFIX "/")) == 0 || strncmp (*path, GTK_PREFIX "\\", strlen (GTK_PREFIX "\\")) == 0) { - gchar *tem = NULL; + gchar *tem = NULL; if (strlen(*path) > 5 && strncmp (*path - 5, ".libs", 5) == 0) { /* We are being run from inside the build tree, and shouldn't mess about. */ return; - } + } /* This is an entry put there by gdk-pixbuf-query-loaders on the * packager's system. On Windows a prebuilt GTK+ package can be @@ -305,269 +305,269 @@ gdk_pixbuf_get_module_file (void) gchar *result = g_strdup (g_getenv ("GDK_PIXBUF_MODULE_FILE")); if (!result) - result = g_build_filename (GTK_SYSCONFDIR, "gtk-2.0", "gdk-pixbuf.loaders", NULL); + result = g_build_filename (GTK_LIBDIR, "gtk-3.0", GTK_BINARY_VERSION, "loaders.cache", NULL); return result; } -#endif /* USE_GMODULE */ +#endif /* USE_GMODULE */ static gboolean gdk_pixbuf_load_module_unlocked (GdkPixbufModule *image_module, - GError **error); + GError **error); static void gdk_pixbuf_io_init (void) { #ifdef USE_GMODULE - GIOChannel *channel; - gchar *line_buf; - gsize term; - GString *tmp_buf = g_string_new (NULL); - gboolean have_error = FALSE; - GdkPixbufModule *module = NULL; - gchar *filename = gdk_pixbuf_get_module_file (); - int flags; - int n_patterns = 0; - GdkPixbufModulePattern *pattern; - GError *error = NULL; + GIOChannel *channel; + gchar *line_buf; + gsize term; + GString *tmp_buf = g_string_new (NULL); + gboolean have_error = FALSE; + GdkPixbufModule *module = NULL; + gchar *filename = gdk_pixbuf_get_module_file (); + int flags; + int n_patterns = 0; + GdkPixbufModulePattern *pattern; + GError *error = NULL; #endif - GdkPixbufModule *builtin_module ; + GdkPixbufModule *builtin_module ; /* initialize on separate line to avoid compiler warnings in the * common case of no compiled-in modules. */ - builtin_module = NULL; + builtin_module = NULL; -#define load_one_builtin_module(format) \ - builtin_module = g_new0 (GdkPixbufModule, 1); \ - builtin_module->module_name = #format; \ - if (gdk_pixbuf_load_module_unlocked (builtin_module, NULL)) \ - file_formats = g_slist_prepend (file_formats, builtin_module);\ - else \ - g_free (builtin_module) +#define load_one_builtin_module(format) \ + builtin_module = g_new0 (GdkPixbufModule, 1); \ + builtin_module->module_name = #format; \ + if (gdk_pixbuf_load_module_unlocked (builtin_module, NULL)) \ + file_formats = g_slist_prepend (file_formats, builtin_module);\ + else \ + g_free (builtin_module) #ifdef INCLUDE_ani - load_one_builtin_module (ani); + load_one_builtin_module (ani); #endif #ifdef INCLUDE_png - load_one_builtin_module (png); + load_one_builtin_module (png); #endif #ifdef INCLUDE_bmp - load_one_builtin_module (bmp); + load_one_builtin_module (bmp); #endif #ifdef INCLUDE_wbmp - load_one_builtin_module (wbmp); + load_one_builtin_module (wbmp); #endif #ifdef INCLUDE_gif - load_one_builtin_module (gif); + load_one_builtin_module (gif); #endif #ifdef INCLUDE_ico - load_one_builtin_module (ico); + load_one_builtin_module (ico); #endif #ifdef INCLUDE_jpeg - load_one_builtin_module (jpeg); + load_one_builtin_module (jpeg); #endif #ifdef INCLUDE_pnm - load_one_builtin_module (pnm); + load_one_builtin_module (pnm); #endif #ifdef INCLUDE_ras - load_one_builtin_module (ras); + load_one_builtin_module (ras); #endif #ifdef INCLUDE_tiff - load_one_builtin_module (tiff); + load_one_builtin_module (tiff); #endif #ifdef INCLUDE_xpm - load_one_builtin_module (xpm); + load_one_builtin_module (xpm); #endif #ifdef INCLUDE_xbm - load_one_builtin_module (xbm); + load_one_builtin_module (xbm); #endif #ifdef INCLUDE_tga - load_one_builtin_module (tga); + load_one_builtin_module (tga); #endif #ifdef INCLUDE_pcx - load_one_builtin_module (pcx); + load_one_builtin_module (pcx); #endif #ifdef INCLUDE_icns - load_one_builtin_module (icns); + load_one_builtin_module (icns); #endif #ifdef INCLUDE_jasper - load_one_builtin_module (jasper); + load_one_builtin_module (jasper); #endif #ifdef INCLUDE_qtif - load_one_builtin_module (qtif); + load_one_builtin_module (qtif); #endif #ifdef INCLUDE_gdiplus - /* We don't bother having the GDI+ loaders individually selectable - * for building in or not. - */ - load_one_builtin_module (ico); - load_one_builtin_module (wmf); - load_one_builtin_module (emf); - load_one_builtin_module (bmp); - load_one_builtin_module (gif); - load_one_builtin_module (jpeg); - load_one_builtin_module (tiff); + /* We don't bother having the GDI+ loaders individually selectable + * for building in or not. + */ + load_one_builtin_module (ico); + load_one_builtin_module (wmf); + load_one_builtin_module (emf); + load_one_builtin_module (bmp); + load_one_builtin_module (gif); + load_one_builtin_module (jpeg); + load_one_builtin_module (tiff); #endif #ifdef INCLUDE_gdip_png - /* Except the gdip-png loader which normally isn't built at all even */ - load_one_builtin_module (png); + /* Except the gdip-png loader which normally isn't built at all even */ + load_one_builtin_module (png); #endif #undef load_one_builtin_module #ifdef USE_GMODULE - channel = g_io_channel_new_file (filename, "r", &error); - if (!channel) { - /* Don't bother warning if we have some built-in loaders */ - if (file_formats == NULL) - g_warning ("Cannot open pixbuf loader module file '%s': %s", - filename, error->message); - g_string_free (tmp_buf, TRUE); - g_free (filename); - return; - } - - while (!have_error && g_io_channel_read_line (channel, &line_buf, NULL, &term, NULL) == G_IO_STATUS_NORMAL) { - const char *p; - - p = line_buf; + channel = g_io_channel_new_file (filename, "r", &error); + if (!channel) { + /* Don't bother warning if we have some built-in loaders */ + if (file_formats == NULL) + g_warning ("Cannot open pixbuf loader module file '%s': %s", + filename, error->message); + g_string_free (tmp_buf, TRUE); + g_free (filename); + return; + } + + while (!have_error && g_io_channel_read_line (channel, &line_buf, NULL, &term, NULL) == G_IO_STATUS_NORMAL) { + const char *p; + + p = line_buf; - line_buf[term] = 0; + line_buf[term] = 0; - if (!skip_space (&p)) { - /* Blank line marking the end of a module - */ - if (module && *p != '#') { + if (!skip_space (&p)) { + /* Blank line marking the end of a module + */ + if (module && *p != '#') { #ifdef G_OS_WIN32 - correct_prefix (&module->module_path); + correct_prefix (&module->module_path); #endif - file_formats = g_slist_prepend (file_formats, module); - module = NULL; - } - - goto next_line; - } + file_formats = g_slist_prepend (file_formats, module); + module = NULL; + } + + goto next_line; + } - if (*p == '#') - goto next_line; - - if (!module) { - /* Read a module location - */ - module = g_new0 (GdkPixbufModule, 1); - n_patterns = 0; - - if (!scan_string (&p, tmp_buf)) { - g_warning ("Error parsing loader info in '%s'\n %s", - filename, line_buf); - have_error = TRUE; - } - module->module_path = g_strdup (tmp_buf->str); - } - else if (!module->module_name) { - module->info = g_new0 (GdkPixbufFormat, 1); - if (!scan_string (&p, tmp_buf)) { - g_warning ("Error parsing loader info in '%s'\n %s", - filename, line_buf); - have_error = TRUE; - } - module->info->name = g_strdup (tmp_buf->str); - module->module_name = module->info->name; + if (*p == '#') + goto next_line; + + if (!module) { + /* Read a module location + */ + module = g_new0 (GdkPixbufModule, 1); + n_patterns = 0; + + if (!scan_string (&p, tmp_buf)) { + g_warning ("Error parsing loader info in '%s'\n %s", + filename, line_buf); + have_error = TRUE; + } + module->module_path = g_strdup (tmp_buf->str); + } + else if (!module->module_name) { + module->info = g_new0 (GdkPixbufFormat, 1); + if (!scan_string (&p, tmp_buf)) { + g_warning ("Error parsing loader info in '%s'\n %s", + filename, line_buf); + have_error = TRUE; + } + module->info->name = g_strdup (tmp_buf->str); + module->module_name = module->info->name; - if (!scan_int (&p, &flags)) { - g_warning ("Error parsing loader info in '%s'\n %s", - filename, line_buf); - have_error = TRUE; - } - module->info->flags = flags; - - if (!scan_string (&p, tmp_buf)) { - g_warning ("Error parsing loader info in '%s'\n %s", - filename, line_buf); - have_error = TRUE; - } - if (tmp_buf->str[0] != 0) - module->info->domain = g_strdup (tmp_buf->str); + if (!scan_int (&p, &flags)) { + g_warning ("Error parsing loader info in '%s'\n %s", + filename, line_buf); + have_error = TRUE; + } + module->info->flags = flags; + + if (!scan_string (&p, tmp_buf)) { + g_warning ("Error parsing loader info in '%s'\n %s", + filename, line_buf); + have_error = TRUE; + } + if (tmp_buf->str[0] != 0) + module->info->domain = g_strdup (tmp_buf->str); - if (!scan_string (&p, tmp_buf)) { - g_warning ("Error parsing loader info in '%s'\n %s", - filename, line_buf); - have_error = TRUE; - } - module->info->description = g_strdup (tmp_buf->str); + if (!scan_string (&p, tmp_buf)) { + g_warning ("Error parsing loader info in '%s'\n %s", + filename, line_buf); + have_error = TRUE; + } + module->info->description = g_strdup (tmp_buf->str); - if (scan_string (&p, tmp_buf)) { - module->info->license = g_strdup (tmp_buf->str); - } - } - else if (!module->info->mime_types) { - int n = 1; - module->info->mime_types = g_new0 (gchar*, 1); - while (scan_string (&p, tmp_buf)) { - if (tmp_buf->str[0] != 0) { - module->info->mime_types = - g_realloc (module->info->mime_types, (n + 1) * sizeof (gchar*)); - module->info->mime_types[n - 1] = g_strdup (tmp_buf->str); - module->info->mime_types[n] = NULL; - n++; - } - } - } - else if (!module->info->extensions) { - int n = 1; - module->info->extensions = g_new0 (gchar*, 1); - while (scan_string (&p, tmp_buf)) { - if (tmp_buf->str[0] != 0) { - module->info->extensions = - g_realloc (module->info->extensions, (n + 1) * sizeof (gchar*)); - module->info->extensions[n - 1] = g_strdup (tmp_buf->str); - module->info->extensions[n] = NULL; - n++; - } - } - } - else { - n_patterns++; - module->info->signature = (GdkPixbufModulePattern *) - g_realloc (module->info->signature, (n_patterns + 1) * sizeof (GdkPixbufModulePattern)); - pattern = module->info->signature + n_patterns; - pattern->prefix = NULL; - pattern->mask = NULL; - pattern->relevance = 0; - pattern--; - if (!scan_string (&p, tmp_buf)) - goto context_error; - pattern->prefix = g_strdup (tmp_buf->str); - - if (!scan_string (&p, tmp_buf)) - goto context_error; - if (*tmp_buf->str) - pattern->mask = g_strdup (tmp_buf->str); - else - pattern->mask = NULL; - - if (!scan_int (&p, &pattern->relevance)) - goto context_error; - - goto next_line; + if (scan_string (&p, tmp_buf)) { + module->info->license = g_strdup (tmp_buf->str); + } + } + else if (!module->info->mime_types) { + int n = 1; + module->info->mime_types = g_new0 (gchar*, 1); + while (scan_string (&p, tmp_buf)) { + if (tmp_buf->str[0] != 0) { + module->info->mime_types = + g_realloc (module->info->mime_types, (n + 1) * sizeof (gchar*)); + module->info->mime_types[n - 1] = g_strdup (tmp_buf->str); + module->info->mime_types[n] = NULL; + n++; + } + } + } + else if (!module->info->extensions) { + int n = 1; + module->info->extensions = g_new0 (gchar*, 1); + while (scan_string (&p, tmp_buf)) { + if (tmp_buf->str[0] != 0) { + module->info->extensions = + g_realloc (module->info->extensions, (n + 1) * sizeof (gchar*)); + module->info->extensions[n - 1] = g_strdup (tmp_buf->str); + module->info->extensions[n] = NULL; + n++; + } + } + } + else { + n_patterns++; + module->info->signature = (GdkPixbufModulePattern *) + g_realloc (module->info->signature, (n_patterns + 1) * sizeof (GdkPixbufModulePattern)); + pattern = module->info->signature + n_patterns; + pattern->prefix = NULL; + pattern->mask = NULL; + pattern->relevance = 0; + pattern--; + if (!scan_string (&p, tmp_buf)) + goto context_error; + pattern->prefix = g_strdup (tmp_buf->str); + + if (!scan_string (&p, tmp_buf)) + goto context_error; + if (*tmp_buf->str) + pattern->mask = g_strdup (tmp_buf->str); + else + pattern->mask = NULL; + + if (!scan_int (&p, &pattern->relevance)) + goto context_error; + + goto next_line; - context_error: - g_free (pattern->prefix); - g_free (pattern->mask); - g_free (pattern); - g_warning ("Error parsing loader info in '%s'\n %s", - filename, line_buf); - have_error = TRUE; - } - next_line: - g_free (line_buf); - } - g_string_free (tmp_buf, TRUE); - g_io_channel_unref (channel); - g_free (filename); + context_error: + g_free (pattern->prefix); + g_free (pattern->mask); + g_free (pattern); + g_warning ("Error parsing loader info in '%s'\n %s", + filename, line_buf); + have_error = TRUE; + } + next_line: + g_free (line_buf); + } + g_string_free (tmp_buf, TRUE); + g_io_channel_unref (channel); + g_free (filename); #endif } @@ -609,161 +609,161 @@ module (gdip_tiff); /* perhaps these actions should be combined in one function */ static gboolean gdk_pixbuf_load_module_unlocked (GdkPixbufModule *image_module, - GError **error) + GError **error) { - GdkPixbufModuleFillInfoFunc fill_info = NULL; + GdkPixbufModuleFillInfoFunc fill_info = NULL; GdkPixbufModuleFillVtableFunc fill_vtable = NULL; - + if (image_module->module != NULL) return TRUE; -#define try_module(format,id) \ - if (fill_info == NULL && \ - strcmp (image_module->module_name, #format) == 0) { \ - fill_info = _gdk_pixbuf__##id##_fill_info; \ - fill_vtable = _gdk_pixbuf__##id##_fill_vtable; \ - } -#ifdef INCLUDE_png - try_module (png,png); +#define try_module(format,id) \ + if (fill_info == NULL && \ + strcmp (image_module->module_name, #format) == 0) { \ + fill_info = _gdk_pixbuf__##id##_fill_info; \ + fill_vtable = _gdk_pixbuf__##id##_fill_vtable; \ + } +#ifdef INCLUDE_png + try_module (png,png); #endif #ifdef INCLUDE_bmp - try_module (bmp,bmp); + try_module (bmp,bmp); #endif #ifdef INCLUDE_wbmp - try_module (wbmp,wbmp); + try_module (wbmp,wbmp); #endif #ifdef INCLUDE_gif - try_module (gif,gif); + try_module (gif,gif); #endif #ifdef INCLUDE_ico - try_module (ico,ico); + try_module (ico,ico); #endif #ifdef INCLUDE_ani - try_module (ani,ani); + try_module (ani,ani); #endif #ifdef INCLUDE_jpeg - try_module (jpeg,jpeg); + try_module (jpeg,jpeg); #endif #ifdef INCLUDE_pnm - try_module (pnm,pnm); + try_module (pnm,pnm); #endif #ifdef INCLUDE_ras - try_module (ras,ras); + try_module (ras,ras); #endif #ifdef INCLUDE_tiff - try_module (tiff,tiff); + try_module (tiff,tiff); #endif #ifdef INCLUDE_xpm - try_module (xpm,xpm); + try_module (xpm,xpm); #endif #ifdef INCLUDE_xbm - try_module (xbm,xbm); + try_module (xbm,xbm); #endif #ifdef INCLUDE_tga - try_module (tga,tga); + try_module (tga,tga); #endif #ifdef INCLUDE_pcx - try_module (pcx,pcx); + try_module (pcx,pcx); #endif #ifdef INCLUDE_icns - try_module (icns,icns); + try_module (icns,icns); #endif #ifdef INCLUDE_jasper - try_module (jasper,jasper); + try_module (jasper,jasper); #endif #ifdef INCLUDE_qtif - try_module (qtif,qtif); + try_module (qtif,qtif); #endif #ifdef INCLUDE_gdiplus - try_module (ico,gdip_ico); - try_module (wmf,gdip_wmf); - try_module (emf,gdip_emf); - try_module (bmp,gdip_bmp); - try_module (gif,gdip_gif); - try_module (jpeg,gdip_jpeg); - try_module (tiff,gdip_tiff); + try_module (ico,gdip_ico); + try_module (wmf,gdip_wmf); + try_module (emf,gdip_emf); + try_module (bmp,gdip_bmp); + try_module (gif,gdip_gif); + try_module (jpeg,gdip_jpeg); + try_module (tiff,gdip_tiff); #endif #ifdef INCLUDE_gdip_png - try_module (png,gdip_png); + try_module (png,gdip_png); #endif #undef try_module if (fill_vtable) { - image_module->module = (void *) 1; + image_module->module = (void *) 1; (* fill_vtable) (image_module); - if (image_module->info == NULL) { - image_module->info = g_new0 (GdkPixbufFormat, 1); - (* fill_info) (image_module->info); - } + if (image_module->info == NULL) { + image_module->info = g_new0 (GdkPixbufFormat, 1); + (* fill_info) (image_module->info); + } return TRUE; - } - else + } + else #ifdef USE_GMODULE - { - char *path; - GModule *module; - gpointer sym; + { + char *path; + GModule *module; + gpointer sym; - path = image_module->module_path; - module = g_module_open (path, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL); + path = image_module->module_path; + module = g_module_open (path, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL); - if (!module) { - g_set_error (error, - GDK_PIXBUF_ERROR, - GDK_PIXBUF_ERROR_FAILED, - _("Unable to load image-loading module: %s: %s"), - path, g_module_error ()); - return FALSE; - } + if (!module) { + g_set_error (error, + GDK_PIXBUF_ERROR, + GDK_PIXBUF_ERROR_FAILED, + _("Unable to load image-loading module: %s: %s"), + path, g_module_error ()); + return FALSE; + } - image_module->module = module; + image_module->module = module; - if (g_module_symbol (module, "fill_vtable", &sym)) { - fill_vtable = (GdkPixbufModuleFillVtableFunc) sym; - (* fill_vtable) (image_module); - return TRUE; - } else { - g_set_error (error, - GDK_PIXBUF_ERROR, - GDK_PIXBUF_ERROR_FAILED, - _("Image-loading module %s does not export the proper interface; perhaps it's from a different GTK version?"), - path); - return FALSE; - } - } + if (g_module_symbol (module, "fill_vtable", &sym)) { + fill_vtable = (GdkPixbufModuleFillVtableFunc) sym; + (* fill_vtable) (image_module); + return TRUE; + } else { + g_set_error (error, + GDK_PIXBUF_ERROR, + GDK_PIXBUF_ERROR_FAILED, + _("Image-loading module %s does not export the proper interface; perhaps it's from a different GTK version?"), + path); + return FALSE; + } + } #else - g_set_error (error, - GDK_PIXBUF_ERROR, - GDK_PIXBUF_ERROR_UNKNOWN_TYPE, - _("Image type '%s' is not supported"), - image_module->module_name); - return FALSE; + g_set_error (error, + GDK_PIXBUF_ERROR, + GDK_PIXBUF_ERROR_UNKNOWN_TYPE, + _("Image type '%s' is not supported"), + image_module->module_name); + return FALSE; #endif /* !USE_GMODULE */ } gboolean _gdk_pixbuf_load_module (GdkPixbufModule *image_module, - GError **error) + GError **error) { - gboolean ret; - gboolean locked = FALSE; + gboolean ret; + gboolean locked = FALSE; - /* be extra careful, maybe the module initializes - * the thread system - */ - if (g_threads_got_initialized) { - G_LOCK (init_lock); - locked = TRUE; - } + /* be extra careful, maybe the module initializes + * the thread system + */ + if (g_threads_got_initialized) { + G_LOCK (init_lock); + locked = TRUE; + } ret = gdk_pixbuf_load_module_unlocked (image_module, error); - if (locked) - G_UNLOCK (init_lock); + if (locked) + G_UNLOCK (init_lock); - return ret; + return ret; } @@ -772,17 +772,17 @@ GdkPixbufModule * _gdk_pixbuf_get_named_module (const char *name, GError **error) { - GSList *modules; + GSList *modules; - for (modules = get_file_formats (); modules; modules = g_slist_next (modules)) { - GdkPixbufModule *module = (GdkPixbufModule *)modules->data; + for (modules = get_file_formats (); modules; modules = g_slist_next (modules)) { + GdkPixbufModule *module = (GdkPixbufModule *)modules->data; - if (module->info->disabled) - continue; + if (module->info->disabled) + continue; - if (!strcmp (name, module->module_name)) - return module; - } + if (!strcmp (name, module->module_name)) + return module; + } g_set_error (error, GDK_PIXBUF_ERROR, @@ -790,7 +790,7 @@ _gdk_pixbuf_get_named_module (const char *name, _("Image type '%s' is not supported"), name); - return NULL; + return NULL; } GdkPixbufModule * @@ -798,72 +798,72 @@ _gdk_pixbuf_get_module (guchar *buffer, guint size, const gchar *filename, GError **error) { - GSList *modules; + GSList *modules; - GdkPixbufModule *selected = NULL; - gchar *display_name = NULL; + GdkPixbufModule *selected = NULL; + gchar *display_name = NULL; #ifdef GDK_PIXBUF_USE_GIO_MIME - gchar *mime_type; - gchar **mimes; - gchar *type; - gint j; - gboolean uncertain; + gchar *mime_type; + gchar **mimes; + gchar *type; + gint j; + gboolean uncertain; - mime_type = g_content_type_guess (NULL, buffer, size, &uncertain); - if (uncertain) - mime_type = g_content_type_guess (filename, buffer, size, NULL); + mime_type = g_content_type_guess (NULL, buffer, size, &uncertain); + if (uncertain) + mime_type = g_content_type_guess (filename, buffer, size, NULL); - for (modules = get_file_formats (); modules; modules = g_slist_next (modules)) { - GdkPixbufModule *module = (GdkPixbufModule *)modules->data; - GdkPixbufFormat *info = module->info; + for (modules = get_file_formats (); modules; modules = g_slist_next (modules)) { + GdkPixbufModule *module = (GdkPixbufModule *)modules->data; + GdkPixbufFormat *info = module->info; - if (info->disabled) - continue; + if (info->disabled) + continue; - mimes = info->mime_types; - for (j = 0; mimes[j] != NULL; j++) { - type = g_content_type_from_mime_type (mimes[j]); - if (g_ascii_strcasecmp (type, mime_type) == 0) { - g_free (type); - selected = module; - break; - } - g_free (type); - } - } - g_free (mime_type); + mimes = info->mime_types; + for (j = 0; mimes[j] != NULL; j++) { + type = g_content_type_from_mime_type (mimes[j]); + if (g_ascii_strcasecmp (type, mime_type) == 0) { + g_free (type); + selected = module; + break; + } + g_free (type); + } + } + g_free (mime_type); #else - gint score, best = 0; + gint score, best = 0; - for (modules = get_file_formats (); modules; modules = g_slist_next (modules)) { - GdkPixbufModule *module = (GdkPixbufModule *)modules->data; + for (modules = get_file_formats (); modules; modules = g_slist_next (modules)) { + GdkPixbufModule *module = (GdkPixbufModule *)modules->data; - if (module->info->disabled) - continue; + if (module->info->disabled) + continue; - score = format_check (module, buffer, size); - if (score > best) { - best = score; - selected = module; - } - if (score >= 100) - break; - } + score = format_check (module, buffer, size); + if (score > best) { + best = score; + selected = module; + } + if (score >= 100) + break; + } #endif - if (selected != NULL) - return selected; + if (selected != NULL) + return selected; if (filename) - { - display_name = g_filename_display_name (filename); - g_set_error (error, - GDK_PIXBUF_ERROR, - GDK_PIXBUF_ERROR_UNKNOWN_TYPE, - _("Couldn't recognize the image file format for file '%s'"), - display_name); - g_free (display_name); - } + { + display_name = g_filename_display_name (filename); + g_set_error (error, + GDK_PIXBUF_ERROR, + GDK_PIXBUF_ERROR_UNKNOWN_TYPE, + _("Couldn't recognize the image file format for file '%s'"), + display_name); + g_free (display_name); + } else g_set_error_literal (error, GDK_PIXBUF_ERROR, @@ -871,76 +871,76 @@ _gdk_pixbuf_get_module (guchar *buffer, guint size, _("Unrecognized image file format")); - return NULL; + return NULL; } static void prepared_notify (GdkPixbuf *pixbuf, - GdkPixbufAnimation *anim, - gpointer user_data) + GdkPixbufAnimation *anim, + gpointer user_data) { - if (pixbuf != NULL) - g_object_ref (pixbuf); - *((GdkPixbuf **)user_data) = pixbuf; + if (pixbuf != NULL) + g_object_ref (pixbuf); + *((GdkPixbuf **)user_data) = pixbuf; } GdkPixbuf * _gdk_pixbuf_generic_image_load (GdkPixbufModule *module, - FILE *f, - GError **error) + FILE *f, + GError **error) { - guchar buffer[LOAD_BUFFER_SIZE]; - size_t length; - GdkPixbuf *pixbuf = NULL; - GdkPixbufAnimation *animation = NULL; - gpointer context; - gboolean locked; + guchar buffer[LOAD_BUFFER_SIZE]; + size_t length; + GdkPixbuf *pixbuf = NULL; + GdkPixbufAnimation *animation = NULL; + gpointer context; + gboolean locked; - locked = _gdk_pixbuf_lock (module); + locked = _gdk_pixbuf_lock (module); - if (module->load != NULL) { - pixbuf = (* module->load) (f, error); - } else if (module->begin_load != NULL) { - - context = module->begin_load (NULL, prepared_notify, NULL, &pixbuf, error); - - if (!context) - goto out; - - while (!feof (f) && !ferror (f)) { - length = fread (buffer, 1, sizeof (buffer), f); - if (length > 0) - if (!module->load_increment (context, buffer, length, error)) { - module->stop_load (context, NULL); - if (pixbuf != NULL) { - g_object_unref (pixbuf); - pixbuf = NULL; - } - goto out; - } - } - - if (!module->stop_load (context, error)) { - if (pixbuf != NULL) { - g_object_unref (pixbuf); - pixbuf = NULL; - } - } - } else if (module->load_animation != NULL) { - animation = (* module->load_animation) (f, error); - if (animation != NULL) { - pixbuf = gdk_pixbuf_animation_get_static_image (animation); + if (module->load != NULL) { + pixbuf = (* module->load) (f, error); + } else if (module->begin_load != NULL) { + + context = module->begin_load (NULL, prepared_notify, NULL, &pixbuf, error); + + if (!context) + goto out; + + while (!feof (f) && !ferror (f)) { + length = fread (buffer, 1, sizeof (buffer), f); + if (length > 0) + if (!module->load_increment (context, buffer, length, error)) { + module->stop_load (context, NULL); + if (pixbuf != NULL) { + g_object_unref (pixbuf); + pixbuf = NULL; + } + goto out; + } + } + + if (!module->stop_load (context, error)) { + if (pixbuf != NULL) { + g_object_unref (pixbuf); + pixbuf = NULL; + } + } + } else if (module->load_animation != NULL) { + animation = (* module->load_animation) (f, error); + if (animation != NULL) { + pixbuf = gdk_pixbuf_animation_get_static_image (animation); - g_object_ref (pixbuf); - g_object_unref (animation); - } - } + g_object_ref (pixbuf); + g_object_unref (animation); + } + } out: - if (locked) - _gdk_pixbuf_unlock (module); - return pixbuf; + if (locked) + _gdk_pixbuf_unlock (module); + return pixbuf; } /** @@ -961,21 +961,21 @@ GdkPixbuf * gdk_pixbuf_new_from_file (const char *filename, GError **error) { - GdkPixbuf *pixbuf; - int size; - FILE *f; - guchar buffer[SNIFF_BUFFER_SIZE]; - GdkPixbufModule *image_module; - gchar *display_name; + GdkPixbuf *pixbuf; + int size; + FILE *f; + guchar buffer[SNIFF_BUFFER_SIZE]; + GdkPixbufModule *image_module; + gchar *display_name; - g_return_val_if_fail (filename != NULL, NULL); + g_return_val_if_fail (filename != NULL, NULL); g_return_val_if_fail (error == NULL || *error == NULL, NULL); - - display_name = g_filename_display_name (filename); + + display_name = g_filename_display_name (filename); - f = g_fopen (filename, "rb"); - if (!f) { - gint save_errno = errno; + f = g_fopen (filename, "rb"); + if (!f) { + gint save_errno = errno; g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (save_errno), @@ -983,22 +983,22 @@ gdk_pixbuf_new_from_file (const char *filename, display_name, g_strerror (save_errno)); g_free (display_name); - return NULL; + return NULL; } - size = fread (&buffer, 1, sizeof (buffer), f); - if (size == 0) { + size = fread (&buffer, 1, sizeof (buffer), f); + if (size == 0) { g_set_error (error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_CORRUPT_IMAGE, _("Image file '%s' contains no data"), display_name); g_free (display_name); - fclose (f); - return NULL; - } + fclose (f); + return NULL; + } - image_module = _gdk_pixbuf_get_module (buffer, size, filename, error); + image_module = _gdk_pixbuf_get_module (buffer, size, filename, error); if (image_module == NULL) { g_free (display_name); fclose (f); @@ -1006,14 +1006,14 @@ gdk_pixbuf_new_from_file (const char *filename, } if (!_gdk_pixbuf_load_module (image_module, error)) { - g_free (display_name); - fclose (f); - return NULL; + g_free (display_name); + fclose (f); + return NULL; } - fseek (f, 0, SEEK_SET); - pixbuf = _gdk_pixbuf_generic_image_load (image_module, f, error); - fclose (f); + fseek (f, 0, SEEK_SET); + pixbuf = _gdk_pixbuf_generic_image_load (image_module, f, error); + fclose (f); if (pixbuf == NULL && error != NULL && *error == NULL) { @@ -1042,8 +1042,8 @@ gdk_pixbuf_new_from_file (const char *filename, g_free (old); } - g_free (display_name); - return pixbuf; + g_free (display_name); + return pixbuf; } #ifdef G_OS_WIN32 @@ -1053,18 +1053,18 @@ GdkPixbuf * gdk_pixbuf_new_from_file (const char *filename, GError **error) { - gchar *utf8_filename = - g_locale_to_utf8 (filename, -1, NULL, NULL, error); - GdkPixbuf *retval; + gchar *utf8_filename = + g_locale_to_utf8 (filename, -1, NULL, NULL, error); + GdkPixbuf *retval; - if (utf8_filename == NULL) - return NULL; + if (utf8_filename == NULL) + return NULL; - retval = gdk_pixbuf_new_from_file_utf8 (utf8_filename, error); + retval = gdk_pixbuf_new_from_file_utf8 (utf8_filename, error); - g_free (utf8_filename); + g_free (utf8_filename); - return retval; + return retval; } #endif @@ -1097,13 +1097,13 @@ gdk_pixbuf_new_from_file (const char *filename, **/ GdkPixbuf * gdk_pixbuf_new_from_file_at_size (const char *filename, - int width, - int height, - GError **error) + int width, + int height, + GError **error) { - return gdk_pixbuf_new_from_file_at_scale (filename, - width, height, - TRUE, error); + return gdk_pixbuf_new_from_file_at_scale (filename, + width, height, + TRUE, error); } #ifdef G_OS_WIN32 @@ -1112,74 +1112,74 @@ gdk_pixbuf_new_from_file_at_size (const char *filename, GdkPixbuf * gdk_pixbuf_new_from_file_at_size (const char *filename, - int width, - int height, - GError **error) + int width, + int height, + GError **error) { - gchar *utf8_filename = - g_locale_to_utf8 (filename, -1, NULL, NULL, error); - GdkPixbuf *retval; + gchar *utf8_filename = + g_locale_to_utf8 (filename, -1, NULL, NULL, error); + GdkPixbuf *retval; - if (utf8_filename == NULL) - return NULL; + if (utf8_filename == NULL) + return NULL; - retval = gdk_pixbuf_new_from_file_at_size_utf8 (utf8_filename, - width, height, - error); + retval = gdk_pixbuf_new_from_file_at_size_utf8 (utf8_filename, + width, height, + error); - g_free (utf8_filename); + g_free (utf8_filename); - return retval; + return retval; } #endif -typedef struct { - gint width; - gint height; - gboolean preserve_aspect_ratio; +typedef struct { + gint width; + gint height; + gboolean preserve_aspect_ratio; } AtScaleData; static void at_scale_size_prepared_cb (GdkPixbufLoader *loader, - int width, - int height, - gpointer data) + int width, + int height, + gpointer data) { - AtScaleData *info = data; + AtScaleData *info = data; - g_return_if_fail (width > 0 && height > 0); + g_return_if_fail (width > 0 && height > 0); - if (info->preserve_aspect_ratio && - (info->width > 0 || info->height > 0)) { - if (info->width < 0) - { - width = width * (double)info->height/(double)height; - height = info->height; - } - else if (info->height < 0) - { - height = height * (double)info->width/(double)width; - width = info->width; - } - else if ((double)height * (double)info->width > - (double)width * (double)info->height) { - width = 0.5 + (double)width * (double)info->height / (double)height; - height = info->height; - } else { - height = 0.5 + (double)height * (double)info->width / (double)width; - width = info->width; - } - } else { - if (info->width > 0) - width = info->width; - if (info->height > 0) - height = info->height; - } - - width = MAX (width, 1); + if (info->preserve_aspect_ratio && + (info->width > 0 || info->height > 0)) { + if (info->width < 0) + { + width = width * (double)info->height/(double)height; + height = info->height; + } + else if (info->height < 0) + { + height = height * (double)info->width/(double)width; + width = info->width; + } + else if ((double)height * (double)info->width > + (double)width * (double)info->height) { + width = 0.5 + (double)width * (double)info->height / (double)height; + height = info->height; + } else { + height = 0.5 + (double)height * (double)info->width / (double)width; + width = info->width; + } + } else { + if (info->width > 0) + width = info->width; + if (info->height > 0) + height = info->height; + } + + width = MAX (width, 1); height = MAX (height, 1); - gdk_pixbuf_loader_set_size (loader, width, height); + gdk_pixbuf_loader_set_size (loader, width, height); } /** @@ -1212,29 +1212,29 @@ at_scale_size_prepared_cb (GdkPixbufLoader *loader, **/ GdkPixbuf * gdk_pixbuf_new_from_file_at_scale (const char *filename, - int width, - int height, - gboolean preserve_aspect_ratio, - GError **error) + int width, + int height, + gboolean preserve_aspect_ratio, + GError **error) { - GdkPixbufLoader *loader; - GdkPixbuf *pixbuf; - guchar buffer[LOAD_BUFFER_SIZE]; - int length; - FILE *f; - AtScaleData info; - GdkPixbufAnimation *animation; - GdkPixbufAnimationIter *iter; - gboolean has_frame; + GdkPixbufLoader *loader; + GdkPixbuf *pixbuf; + guchar buffer[LOAD_BUFFER_SIZE]; + int length; + FILE *f; + AtScaleData info; + GdkPixbufAnimation *animation; + GdkPixbufAnimationIter *iter; + gboolean has_frame; - g_return_val_if_fail (filename != NULL, NULL); + g_return_val_if_fail (filename != NULL, NULL); g_return_val_if_fail (width > 0 || width == -1, NULL); g_return_val_if_fail (height > 0 || height == -1, NULL); - f = g_fopen (filename, "rb"); - if (!f) { - gint save_errno = errno; + f = g_fopen (filename, "rb"); + if (!f) { + gint save_errno = errno; gchar *display_name = g_filename_display_name (filename); g_set_error (error, G_FILE_ERROR, @@ -1243,65 +1243,65 @@ gdk_pixbuf_new_from_file_at_scale (const char *filename, display_name, g_strerror (save_errno)); g_free (display_name); - return NULL; + return NULL; } - loader = gdk_pixbuf_loader_new (); + loader = gdk_pixbuf_loader_new (); - info.width = width; - info.height = height; + info.width = width; + info.height = height; info.preserve_aspect_ratio = preserve_aspect_ratio; - g_signal_connect (loader, "size-prepared", - G_CALLBACK (at_scale_size_prepared_cb), &info); + g_signal_connect (loader, "size-prepared", + G_CALLBACK (at_scale_size_prepared_cb), &info); - has_frame = FALSE; - while (!has_frame && !feof (f) && !ferror (f)) { - length = fread (buffer, 1, sizeof (buffer), f); - if (length > 0) - if (!gdk_pixbuf_loader_write (loader, buffer, length, error)) { - gdk_pixbuf_loader_close (loader, NULL); - fclose (f); - g_object_unref (loader); - return NULL; - } - - animation = gdk_pixbuf_loader_get_animation (loader); - if (animation) { - iter = gdk_pixbuf_animation_get_iter (animation, NULL); - if (!gdk_pixbuf_animation_iter_on_currently_loading_frame (iter)) { - has_frame = TRUE; - } - g_object_unref (iter); - } - } + has_frame = FALSE; + while (!has_frame && !feof (f) && !ferror (f)) { + length = fread (buffer, 1, sizeof (buffer), f); + if (length > 0) + if (!gdk_pixbuf_loader_write (loader, buffer, length, error)) { + gdk_pixbuf_loader_close (loader, NULL); + fclose (f); + g_object_unref (loader); + return NULL; + } + + animation = gdk_pixbuf_loader_get_animation (loader); + if (animation) { + iter = gdk_pixbuf_animation_get_iter (animation, NULL); + if (!gdk_pixbuf_animation_iter_on_currently_loading_frame (iter)) { + has_frame = TRUE; + } + g_object_unref (iter); + } + } - fclose (f); + fclose (f); - if (!gdk_pixbuf_loader_close (loader, error) && !has_frame) { - g_object_unref (loader); - return NULL; - } + if (!gdk_pixbuf_loader_close (loader, error) && !has_frame) { + g_object_unref (loader); + return NULL; + } - pixbuf = gdk_pixbuf_loader_get_pixbuf (loader); + pixbuf = gdk_pixbuf_loader_get_pixbuf (loader); - if (!pixbuf) { + if (!pixbuf) { gchar *display_name = g_filename_display_name (filename); - g_object_unref (loader); + g_object_unref (loader); g_set_error (error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_FAILED, _("Failed to load image '%s': reason not known, probably a corrupt image file"), display_name); g_free (display_name); - return NULL; - } + return NULL; + } - g_object_ref (pixbuf); + g_object_ref (pixbuf); - g_object_unref (loader); + g_object_unref (loader); - return pixbuf; + return pixbuf; } #ifdef G_OS_WIN32 @@ -1310,80 +1310,80 @@ gdk_pixbuf_new_from_file_at_scale (const char *filename, GdkPixbuf * gdk_pixbuf_new_from_file_at_scale (const char *filename, - int width, - int height, - gboolean preserve_aspect_ratio, - GError **error) + int width, + int height, + gboolean preserve_aspect_ratio, + GError **error) { - gchar *utf8_filename = - g_locale_to_utf8 (filename, -1, NULL, NULL, error); - GdkPixbuf *retval; + gchar *utf8_filename = + g_locale_to_utf8 (filename, -1, NULL, NULL, error); + GdkPixbuf *retval; - if (utf8_filename == NULL) - return NULL; + if (utf8_filename == NULL) + return NULL; - retval = gdk_pixbuf_new_from_file_at_scale_utf8 (utf8_filename, - width, height, - preserve_aspect_ratio, - error); + retval = gdk_pixbuf_new_from_file_at_scale_utf8 (utf8_filename, + width, height, + preserve_aspect_ratio, + error); - g_free (utf8_filename); + g_free (utf8_filename); - return retval; + return retval; } #endif static GdkPixbuf * load_from_stream (GdkPixbufLoader *loader, - GInputStream *stream, - GCancellable *cancellable, - GError **error) + GInputStream *stream, + GCancellable *cancellable, + GError **error) { - GdkPixbuf *pixbuf; - gssize n_read; - guchar buffer[LOAD_BUFFER_SIZE]; - gboolean res; + GdkPixbuf *pixbuf; + gssize n_read; + guchar buffer[LOAD_BUFFER_SIZE]; + gboolean res; - res = TRUE; - while (1) { - n_read = g_input_stream_read (stream, - buffer, - sizeof (buffer), - cancellable, - error); - if (n_read < 0) { - res = FALSE; - error = NULL; /* Ignore further errors */ - break; - } + res = TRUE; + while (1) { + n_read = g_input_stream_read (stream, + buffer, + sizeof (buffer), + cancellable, + error); + if (n_read < 0) { + res = FALSE; + error = NULL; /* Ignore further errors */ + break; + } - if (n_read == 0) - break; + if (n_read == 0) + break; - if (!gdk_pixbuf_loader_write (loader, - buffer, - n_read, - error)) { - res = FALSE; - error = NULL; - break; - } - } + if (!gdk_pixbuf_loader_write (loader, + buffer, + n_read, + error)) { + res = FALSE; + error = NULL; + break; + } + } - if (!gdk_pixbuf_loader_close (loader, error)) { - res = FALSE; - error = NULL; - } + if (!gdk_pixbuf_loader_close (loader, error)) { + res = FALSE; + error = NULL; + } - pixbuf = NULL; - if (res) { - pixbuf = gdk_pixbuf_loader_get_pixbuf (loader); - if (pixbuf) - g_object_ref (pixbuf); - } + pixbuf = NULL; + if (res) { + pixbuf = gdk_pixbuf_loader_get_pixbuf (loader); + if (pixbuf) + g_object_ref (pixbuf); + } - return pixbuf; + return pixbuf; } @@ -1422,29 +1422,29 @@ load_from_stream (GdkPixbufLoader *loader, */ GdkPixbuf * gdk_pixbuf_new_from_stream_at_scale (GInputStream *stream, - gint width, - gint height, - gboolean preserve_aspect_ratio, - GCancellable *cancellable, - GError **error) + gint width, + gint height, + gboolean preserve_aspect_ratio, + GCancellable *cancellable, + GError **error) { - GdkPixbufLoader *loader; - GdkPixbuf *pixbuf; - AtScaleData info; + GdkPixbufLoader *loader; + GdkPixbuf *pixbuf; + AtScaleData info; - loader = gdk_pixbuf_loader_new (); + loader = gdk_pixbuf_loader_new (); - info.width = width; - info.height = height; + info.width = width; + info.height = height; info.preserve_aspect_ratio = preserve_aspect_ratio; - g_signal_connect (loader, "size-prepared", - G_CALLBACK (at_scale_size_prepared_cb), &info); + g_signal_connect (loader, "size-prepared", + G_CALLBACK (at_scale_size_prepared_cb), &info); - pixbuf = load_from_stream (loader, stream, cancellable, error); - g_object_unref (loader); + pixbuf = load_from_stream (loader, stream, cancellable, error); + g_object_unref (loader); - return pixbuf; + return pixbuf; } /** @@ -1472,38 +1472,38 @@ gdk_pixbuf_new_from_stream_at_scale (GInputStream *stream, **/ GdkPixbuf * gdk_pixbuf_new_from_stream (GInputStream *stream, - GCancellable *cancellable, - GError **error) + GCancellable *cancellable, + GError **error) { - GdkPixbuf *pixbuf; - GdkPixbufLoader *loader; + GdkPixbuf *pixbuf; + GdkPixbufLoader *loader; - loader = gdk_pixbuf_loader_new (); - pixbuf = load_from_stream (loader, stream, cancellable, error); - g_object_unref (loader); + loader = gdk_pixbuf_loader_new (); + pixbuf = load_from_stream (loader, stream, cancellable, error); + g_object_unref (loader); - return pixbuf; + return pixbuf; } static void info_cb (GdkPixbufLoader *loader, - int width, - int height, - gpointer data) + int width, + int height, + gpointer data) { - struct { - GdkPixbufFormat *format; - int width; - int height; - } *info = data; + struct { + GdkPixbufFormat *format; + int width; + int height; + } *info = data; - g_return_if_fail (width > 0 && height > 0); + g_return_if_fail (width > 0 && height > 0); - info->format = gdk_pixbuf_loader_get_format (loader); - info->width = width; - info->height = height; + info->format = gdk_pixbuf_loader_get_format (loader); + info->width = width; + info->height = height; - gdk_pixbuf_loader_set_size (loader, 0, 0); + gdk_pixbuf_loader_set_size (loader, 0, 0); } /** @@ -1522,53 +1522,53 @@ info_cb (GdkPixbufLoader *loader, **/ GdkPixbufFormat * gdk_pixbuf_get_file_info (const gchar *filename, - gint *width, - gint *height) + gint *width, + gint *height) { - GdkPixbufLoader *loader; - guchar buffer[SNIFF_BUFFER_SIZE]; - int length; - FILE *f; - struct { - GdkPixbufFormat *format; - gint width; - gint height; - } info; + GdkPixbufLoader *loader; + guchar buffer[SNIFF_BUFFER_SIZE]; + int length; + FILE *f; + struct { + GdkPixbufFormat *format; + gint width; + gint height; + } info; - g_return_val_if_fail (filename != NULL, NULL); + g_return_val_if_fail (filename != NULL, NULL); - f = g_fopen (filename, "rb"); - if (!f) - return NULL; + f = g_fopen (filename, "rb"); + if (!f) + return NULL; - loader = gdk_pixbuf_loader_new (); + loader = gdk_pixbuf_loader_new (); - info.format = NULL; - info.width = -1; - info.height = -1; - - g_signal_connect (loader, "size-prepared", G_CALLBACK (info_cb), &info); + info.format = NULL; + info.width = -1; + info.height = -1; + + g_signal_connect (loader, "size-prepared", G_CALLBACK (info_cb), &info); - while (!feof (f) && !ferror (f)) { - length = fread (buffer, 1, sizeof (buffer), f); - if (length > 0) { - if (!gdk_pixbuf_loader_write (loader, buffer, length, NULL)) - break; - } - if (info.format != NULL) - break; - } + while (!feof (f) && !ferror (f)) { + length = fread (buffer, 1, sizeof (buffer), f); + if (length > 0) { + if (!gdk_pixbuf_loader_write (loader, buffer, length, NULL)) + break; + } + if (info.format != NULL) + break; + } - fclose (f); - gdk_pixbuf_loader_close (loader, NULL); - g_object_unref (loader); + fclose (f); + gdk_pixbuf_loader_close (loader, NULL); + g_object_unref (loader); - if (width) - *width = info.width; - if (height) - *height = info.height; + if (width) + *width = info.width; + if (height) + *height = info.height; - return info.format; + return info.format; } /** @@ -1583,20 +1583,20 @@ gdk_pixbuf_get_file_info (const gchar *filename, GdkPixbuf * gdk_pixbuf_new_from_xpm_data (const char **data) { - GdkPixbuf *(* load_xpm_data) (const char **data); - GdkPixbuf *pixbuf; + GdkPixbuf *(* load_xpm_data) (const char **data); + GdkPixbuf *pixbuf; GError *error = NULL; - GdkPixbufModule *xpm_module; - gboolean locked; + GdkPixbufModule *xpm_module; + gboolean locked; - g_return_val_if_fail (data != NULL, NULL); + g_return_val_if_fail (data != NULL, NULL); - xpm_module = _gdk_pixbuf_get_named_module ("xpm", &error); - if (xpm_module == NULL) { - g_warning ("Error loading XPM image loader: %s", error->message); - g_error_free (error); - return NULL; - } + xpm_module = _gdk_pixbuf_get_named_module ("xpm", &error); + if (xpm_module == NULL) { + g_warning ("Error loading XPM image loader: %s", error->message); + g_error_free (error); + return NULL; + } if (!_gdk_pixbuf_load_module (xpm_module, &error)) { g_warning ("Error loading XPM image loader: %s", error->message); @@ -1604,19 +1604,19 @@ gdk_pixbuf_new_from_xpm_data (const char **data) return NULL; } - locked = _gdk_pixbuf_lock (xpm_module); + locked = _gdk_pixbuf_lock (xpm_module); - if (xpm_module->load_xpm_data == NULL) { - g_warning ("gdk-pixbuf XPM module lacks XPM data capability"); - pixbuf = NULL; - } else { - load_xpm_data = xpm_module->load_xpm_data; - pixbuf = (* load_xpm_data) (data); - } - - if (locked) - _gdk_pixbuf_unlock (xpm_module); - return pixbuf; + if (xpm_module->load_xpm_data == NULL) { + g_warning ("gdk-pixbuf XPM module lacks XPM data capability"); + pixbuf = NULL; + } else { + load_xpm_data = xpm_module->load_xpm_data; + pixbuf = (* load_xpm_data) (data); + } + + if (locked) + _gdk_pixbuf_unlock (xpm_module); + return pixbuf; } static void @@ -1657,24 +1657,24 @@ collect_save_options (va_list opts, static gboolean save_to_file_callback (const gchar *buf, - gsize count, - GError **error, - gpointer data) + gsize count, + GError **error, + gpointer data) { - FILE *filehandle = data; - gsize n; + FILE *filehandle = data; + gsize n; - n = fwrite (buf, 1, count, filehandle); - if (n != count) { - gint save_errno = errno; + n = fwrite (buf, 1, count, filehandle); + if (n != count) { + gint save_errno = errno; g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (save_errno), _("Error writing to image file: %s"), g_strerror (save_errno)); return FALSE; - } - return TRUE; + } + return TRUE; } static gboolean @@ -1685,174 +1685,174 @@ gdk_pixbuf_real_save (GdkPixbuf *pixbuf, gchar **values, GError **error) { - gboolean ret; - GdkPixbufModule *image_module = NULL; - gboolean locked; + gboolean ret; + GdkPixbufModule *image_module = NULL; + gboolean locked; - image_module = _gdk_pixbuf_get_named_module (type, error); + image_module = _gdk_pixbuf_get_named_module (type, error); - if (image_module == NULL) - return FALSE; + if (image_module == NULL) + return FALSE; - if (!_gdk_pixbuf_load_module (image_module, error)) - return FALSE; + if (!_gdk_pixbuf_load_module (image_module, error)) + return FALSE; - locked = _gdk_pixbuf_lock (image_module); + locked = _gdk_pixbuf_lock (image_module); - if (image_module->save) { - /* save normally */ - ret = (* image_module->save) (filehandle, pixbuf, - keys, values, - error); - } else if (image_module->save_to_callback) { - /* save with simple callback */ - ret = (* image_module->save_to_callback) (save_to_file_callback, - filehandle, pixbuf, - keys, values, - error); - } else { - /* can't save */ - g_set_error (error, - GDK_PIXBUF_ERROR, - GDK_PIXBUF_ERROR_UNSUPPORTED_OPERATION, - _("This build of gdk-pixbuf does not support saving the image format: %s"), - type); - ret = FALSE; - } + if (image_module->save) { + /* save normally */ + ret = (* image_module->save) (filehandle, pixbuf, + keys, values, + error); + } else if (image_module->save_to_callback) { + /* save with simple callback */ + ret = (* image_module->save_to_callback) (save_to_file_callback, + filehandle, pixbuf, + keys, values, + error); + } else { + /* can't save */ + g_set_error (error, + GDK_PIXBUF_ERROR, + GDK_PIXBUF_ERROR_UNSUPPORTED_OPERATION, + _("This build of gdk-pixbuf does not support saving the image format: %s"), + type); + ret = FALSE; + } - if (locked) - _gdk_pixbuf_unlock (image_module); - return ret; + if (locked) + _gdk_pixbuf_unlock (image_module); + return ret; } #define TMP_FILE_BUF_SIZE 4096 static gboolean save_to_callback_with_tmp_file (GdkPixbufModule *image_module, - GdkPixbuf *pixbuf, - GdkPixbufSaveFunc save_func, - gpointer user_data, - gchar **keys, - gchar **values, - GError **error) + GdkPixbuf *pixbuf, + GdkPixbufSaveFunc save_func, + gpointer user_data, + gchar **keys, + gchar **values, + GError **error) { - int fd; - FILE *f = NULL; - gboolean retval = FALSE; - gchar *buf = NULL; - gsize n; - gchar *filename = NULL; - gboolean locked; + int fd; + FILE *f = NULL; + gboolean retval = FALSE; + gchar *buf = NULL; + gsize n; + gchar *filename = NULL; + gboolean locked; - buf = g_try_malloc (TMP_FILE_BUF_SIZE); - if (buf == NULL) { - g_set_error_literal (error, + buf = g_try_malloc (TMP_FILE_BUF_SIZE); + if (buf == NULL) { + g_set_error_literal (error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY, _("Insufficient memory to save image to callback")); - goto end; - } + goto end; + } - fd = g_file_open_tmp ("gdkpixbuf-save-tmp.XXXXXX", &filename, error); - if (fd == -1) - goto end; - f = fdopen (fd, "wb+"); - if (f == NULL) { - gint save_errno = errno; - g_set_error_literal (error, + fd = g_file_open_tmp ("gdkpixbuf-save-tmp.XXXXXX", &filename, error); + if (fd == -1) + goto end; + f = fdopen (fd, "wb+"); + if (f == NULL) { + gint save_errno = errno; + g_set_error_literal (error, G_FILE_ERROR, g_file_error_from_errno (save_errno), _("Failed to open temporary file")); - goto end; - } + goto end; + } - locked = _gdk_pixbuf_lock (image_module); - retval = (image_module->save) (f, pixbuf, keys, values, error); - if (locked) - _gdk_pixbuf_unlock (image_module); - if (!retval) - goto end; + locked = _gdk_pixbuf_lock (image_module); + retval = (image_module->save) (f, pixbuf, keys, values, error); + if (locked) + _gdk_pixbuf_unlock (image_module); + if (!retval) + goto end; - rewind (f); - for (;;) { - n = fread (buf, 1, TMP_FILE_BUF_SIZE, f); - if (n > 0) { - if (!save_func (buf, n, error, user_data)) - goto end; - } - if (n != TMP_FILE_BUF_SIZE) - break; - } - if (ferror (f)) { - gint save_errno = errno; - g_set_error_literal (error, + rewind (f); + for (;;) { + n = fread (buf, 1, TMP_FILE_BUF_SIZE, f); + if (n > 0) { + if (!save_func (buf, n, error, user_data)) + goto end; + } + if (n != TMP_FILE_BUF_SIZE) + break; + } + if (ferror (f)) { + gint save_errno = errno; + g_set_error_literal (error, G_FILE_ERROR, g_file_error_from_errno (save_errno), _("Failed to read from temporary file")); - goto end; - } - retval = TRUE; + goto end; + } + retval = TRUE; end: - /* cleanup and return retval */ - if (f) - fclose (f); - if (filename) { - g_unlink (filename); - g_free (filename); - } - g_free (buf); + /* cleanup and return retval */ + if (f) + fclose (f); + if (filename) { + g_unlink (filename); + g_free (filename); + } + g_free (buf); - return retval; + return retval; } static gboolean gdk_pixbuf_real_save_to_callback (GdkPixbuf *pixbuf, - GdkPixbufSaveFunc save_func, - gpointer user_data, - const char *type, - gchar **keys, - gchar **values, - GError **error) + GdkPixbufSaveFunc save_func, + gpointer user_data, + const char *type, + gchar **keys, + gchar **values, + GError **error) { - gboolean ret; - GdkPixbufModule *image_module = NULL; - gboolean locked; + gboolean ret; + GdkPixbufModule *image_module = NULL; + gboolean locked; - image_module = _gdk_pixbuf_get_named_module (type, error); + image_module = _gdk_pixbuf_get_named_module (type, error); - if (image_module == NULL) - return FALSE; + if (image_module == NULL) + return FALSE; - if (!_gdk_pixbuf_load_module (image_module, error)) - return FALSE; + if (!_gdk_pixbuf_load_module (image_module, error)) + return FALSE; - locked = _gdk_pixbuf_lock (image_module); + locked = _gdk_pixbuf_lock (image_module); - if (image_module->save_to_callback) { - /* save normally */ - ret = (* image_module->save_to_callback) (save_func, user_data, - pixbuf, keys, values, - error); - } else if (image_module->save) { - /* use a temporary file */ - ret = save_to_callback_with_tmp_file (image_module, pixbuf, - save_func, user_data, - keys, values, - error); - } else { - /* can't save */ - g_set_error (error, - GDK_PIXBUF_ERROR, - GDK_PIXBUF_ERROR_UNSUPPORTED_OPERATION, - _("This build of gdk-pixbuf does not support saving the image format: %s"), - type); - ret = FALSE; - } + if (image_module->save_to_callback) { + /* save normally */ + ret = (* image_module->save_to_callback) (save_func, user_data, + pixbuf, keys, values, + error); + } else if (image_module->save) { + /* use a temporary file */ + ret = save_to_callback_with_tmp_file (image_module, pixbuf, + save_func, user_data, + keys, values, + error); + } else { + /* can't save */ + g_set_error (error, + GDK_PIXBUF_ERROR, + GDK_PIXBUF_ERROR_UNSUPPORTED_OPERATION, + _("This build of gdk-pixbuf does not support saving the image format: %s"), + type); + ret = FALSE; + } - if (locked) - _gdk_pixbuf_unlock (image_module); - return ret; + if (locked) + _gdk_pixbuf_unlock (image_module); + return ret; } @@ -1969,18 +1969,18 @@ gdk_pixbuf_save (GdkPixbuf *pixbuf, GError **error, ...) { - char *utf8_filename; + char *utf8_filename; gchar **keys = NULL; gchar **values = NULL; va_list args; - gboolean result; + gboolean result; g_return_val_if_fail (error == NULL || *error == NULL, FALSE); - utf8_filename = g_locale_to_utf8 (filename, -1, NULL, NULL, error); + utf8_filename = g_locale_to_utf8 (filename, -1, NULL, NULL, error); - if (utf8_filename == NULL) - return FALSE; + if (utf8_filename == NULL) + return FALSE; va_start (args, error); @@ -1989,10 +1989,10 @@ gdk_pixbuf_save (GdkPixbuf *pixbuf, va_end (args); result = gdk_pixbuf_savev_utf8 (pixbuf, utf8_filename, type, - keys, values, - error); + keys, values, + error); - g_free (utf8_filename); + g_free (utf8_filename); g_strfreev (keys); g_strfreev (values); @@ -2036,7 +2036,7 @@ gdk_pixbuf_savev (GdkPixbuf *pixbuf, f = g_fopen (filename, "wb"); if (f == NULL) { - gint save_errno = errno; + gint save_errno = errno; gchar *display_name = g_filename_display_name (filename); g_set_error (error, G_FILE_ERROR, @@ -2062,7 +2062,7 @@ gdk_pixbuf_savev (GdkPixbuf *pixbuf, } if (fclose (f) < 0) { - gint save_errno = errno; + gint save_errno = errno; gchar *display_name = g_filename_display_name (filename); g_set_error (error, G_FILE_ERROR, @@ -2089,22 +2089,22 @@ gdk_pixbuf_savev (GdkPixbuf *pixbuf, char **option_values, GError **error) { - char *utf8_filename; - gboolean retval; + char *utf8_filename; + gboolean retval; g_return_val_if_fail (filename != NULL, FALSE); - utf8_filename = g_locale_to_utf8 (filename, -1, NULL, NULL, error); + utf8_filename = g_locale_to_utf8 (filename, -1, NULL, NULL, error); - if (utf8_filename == NULL) - return FALSE; + if (utf8_filename == NULL) + return FALSE; - retval = gdk_pixbuf_savev_utf8 (pixbuf, utf8_filename, type, - option_keys, option_values, error); + retval = gdk_pixbuf_savev_utf8 (pixbuf, utf8_filename, type, + option_keys, option_values, error); - g_free (utf8_filename); + g_free (utf8_filename); - return retval; + return retval; } #endif @@ -2134,11 +2134,11 @@ gdk_pixbuf_savev (GdkPixbuf *pixbuf, **/ gboolean gdk_pixbuf_save_to_callback (GdkPixbuf *pixbuf, - GdkPixbufSaveFunc save_func, - gpointer user_data, - const char *type, - GError **error, - ...) + GdkPixbufSaveFunc save_func, + gpointer user_data, + const char *type, + GError **error, + ...) { gchar **keys = NULL; gchar **values = NULL; @@ -2154,8 +2154,8 @@ gdk_pixbuf_save_to_callback (GdkPixbuf *pixbuf, va_end (args); result = gdk_pixbuf_save_to_callbackv (pixbuf, save_func, user_data, - type, keys, values, - error); + type, keys, values, + error); g_strfreev (keys); g_strfreev (values); @@ -2184,12 +2184,12 @@ gdk_pixbuf_save_to_callback (GdkPixbuf *pixbuf, **/ gboolean gdk_pixbuf_save_to_callbackv (GdkPixbuf *pixbuf, - GdkPixbufSaveFunc save_func, - gpointer user_data, - const char *type, - char **option_keys, - char **option_values, - GError **error) + GdkPixbufSaveFunc save_func, + gpointer user_data, + const char *type, + char **option_keys, + char **option_values, + GError **error) { gboolean result; @@ -2199,9 +2199,9 @@ gdk_pixbuf_save_to_callbackv (GdkPixbuf *pixbuf, g_return_val_if_fail (error == NULL || *error == NULL, FALSE); result = gdk_pixbuf_real_save_to_callback (pixbuf, - save_func, user_data, type, - option_keys, option_values, - error); + save_func, user_data, type, + option_keys, option_values, + error); if (!result) { g_return_val_if_fail (error == NULL || *error != NULL, FALSE); @@ -2236,11 +2236,11 @@ gdk_pixbuf_save_to_callbackv (GdkPixbuf *pixbuf, **/ gboolean gdk_pixbuf_save_to_buffer (GdkPixbuf *pixbuf, - gchar **buffer, - gsize *buffer_size, - const char *type, - GError **error, - ...) + gchar **buffer, + gsize *buffer_size, + const char *type, + GError **error, + ...) { gchar **keys = NULL; gchar **values = NULL; @@ -2256,8 +2256,8 @@ gdk_pixbuf_save_to_buffer (GdkPixbuf *pixbuf, va_end (args); result = gdk_pixbuf_save_to_bufferv (pixbuf, buffer, buffer_size, - type, keys, values, - error); + type, keys, values, + error); g_strfreev (keys); g_strfreev (values); @@ -2266,36 +2266,36 @@ gdk_pixbuf_save_to_buffer (GdkPixbuf *pixbuf, } struct SaveToBufferData { - gchar *buffer; - gsize len, max; + gchar *buffer; + gsize len, max; }; static gboolean save_to_buffer_callback (const gchar *data, - gsize count, - GError **error, - gpointer user_data) + gsize count, + GError **error, + gpointer user_data) { - struct SaveToBufferData *sdata = user_data; - gchar *new_buffer; - gsize new_max; + struct SaveToBufferData *sdata = user_data; + gchar *new_buffer; + gsize new_max; - if (sdata->len + count > sdata->max) { - new_max = MAX (sdata->max*2, sdata->len + count); - new_buffer = g_try_realloc (sdata->buffer, new_max); - if (!new_buffer) { - g_set_error_literal (error, + if (sdata->len + count > sdata->max) { + new_max = MAX (sdata->max*2, sdata->len + count); + new_buffer = g_try_realloc (sdata->buffer, new_max); + if (!new_buffer) { + g_set_error_literal (error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY, _("Insufficient memory to save image into a buffer")); - return FALSE; - } - sdata->buffer = new_buffer; - sdata->max = new_max; - } - memcpy (sdata->buffer + sdata->len, data, count); - sdata->len += count; - return TRUE; + return FALSE; + } + sdata->buffer = new_buffer; + sdata->max = new_max; + } + memcpy (sdata->buffer + sdata->len, data, count); + sdata->len += count; + return TRUE; } /** @@ -2318,82 +2318,82 @@ save_to_buffer_callback (const gchar *data, **/ gboolean gdk_pixbuf_save_to_bufferv (GdkPixbuf *pixbuf, - gchar **buffer, - gsize *buffer_size, - const char *type, - char **option_keys, - char **option_values, - GError **error) + gchar **buffer, + gsize *buffer_size, + const char *type, + char **option_keys, + char **option_values, + GError **error) { - static const gint initial_max = 1024; - struct SaveToBufferData sdata; + static const gint initial_max = 1024; + struct SaveToBufferData sdata; - *buffer = NULL; - *buffer_size = 0; + *buffer = NULL; + *buffer_size = 0; - sdata.buffer = g_try_malloc (initial_max); - sdata.max = initial_max; - sdata.len = 0; - if (!sdata.buffer) { + sdata.buffer = g_try_malloc (initial_max); + sdata.max = initial_max; + sdata.len = 0; + if (!sdata.buffer) { g_set_error_literal (error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY, _("Insufficient memory to save image into a buffer")); - return FALSE; - } + return FALSE; + } - if (!gdk_pixbuf_save_to_callbackv (pixbuf, - save_to_buffer_callback, &sdata, - type, option_keys, option_values, - error)) { - g_free (sdata.buffer); - return FALSE; - } + if (!gdk_pixbuf_save_to_callbackv (pixbuf, + save_to_buffer_callback, &sdata, + type, option_keys, option_values, + error)) { + g_free (sdata.buffer); + return FALSE; + } - *buffer = sdata.buffer; - *buffer_size = sdata.len; - return TRUE; + *buffer = sdata.buffer; + *buffer_size = sdata.len; + return TRUE; } typedef struct { - GOutputStream *stream; - GCancellable *cancellable; + GOutputStream *stream; + GCancellable *cancellable; } SaveToStreamData; static gboolean save_to_stream (const gchar *buffer, - gsize count, - GError **error, - gpointer data) + gsize count, + GError **error, + gpointer data) { - SaveToStreamData *sdata = (SaveToStreamData *)data; - gsize remaining; - gssize written; + SaveToStreamData *sdata = (SaveToStreamData *)data; + gsize remaining; + gssize written; GError *my_error = NULL; - remaining = count; - written = 0; - while (remaining > 0) { - buffer += written; - remaining -= written; - written = g_output_stream_write (sdata->stream, - buffer, remaining, - sdata->cancellable, - &my_error); - if (written < 0) { - if (!my_error) { - g_set_error_literal (error, + remaining = count; + written = 0; + while (remaining > 0) { + buffer += written; + remaining -= written; + written = g_output_stream_write (sdata->stream, + buffer, remaining, + sdata->cancellable, + &my_error); + if (written < 0) { + if (!my_error) { + g_set_error_literal (error, G_IO_ERROR, 0, _("Error writing to image stream")); - } - else { - g_propagate_error (error, my_error); - } - return FALSE; - } - } + } + else { + g_propagate_error (error, my_error); + } + return FALSE; + } + } - return TRUE; + return TRUE; } /** @@ -2424,34 +2424,34 @@ save_to_stream (const gchar *buffer, */ gboolean gdk_pixbuf_save_to_stream (GdkPixbuf *pixbuf, - GOutputStream *stream, - const char *type, - GCancellable *cancellable, - GError **error, - ...) + GOutputStream *stream, + const char *type, + GCancellable *cancellable, + GError **error, + ...) { - gboolean res; - gchar **keys = NULL; - gchar **values = NULL; - va_list args; - SaveToStreamData data; + gboolean res; + gchar **keys = NULL; + gchar **values = NULL; + va_list args; + SaveToStreamData data; - va_start (args, error); - collect_save_options (args, &keys, &values); - va_end (args); + va_start (args, error); + collect_save_options (args, &keys, &values); + va_end (args); - data.stream = stream; - data.cancellable = cancellable; + data.stream = stream; + data.cancellable = cancellable; - res = gdk_pixbuf_save_to_callbackv (pixbuf, save_to_stream, - &data, type, - keys, values, - error); + res = gdk_pixbuf_save_to_callbackv (pixbuf, save_to_stream, + &data, type, + keys, values, + error); - g_strfreev (keys); - g_strfreev (values); + g_strfreev (keys); + g_strfreev (values); - return res; + return res; } /** @@ -2467,9 +2467,9 @@ gdk_pixbuf_save_to_stream (GdkPixbuf *pixbuf, gchar * gdk_pixbuf_format_get_name (GdkPixbufFormat *format) { - g_return_val_if_fail (format != NULL, NULL); + g_return_val_if_fail (format != NULL, NULL); - return g_strdup (format->name); + return g_strdup (format->name); } /** @@ -2485,17 +2485,17 @@ gdk_pixbuf_format_get_name (GdkPixbufFormat *format) gchar * gdk_pixbuf_format_get_description (GdkPixbufFormat *format) { - gchar *domain; - const gchar *description; - g_return_val_if_fail (format != NULL, NULL); + gchar *domain; + const gchar *description; + g_return_val_if_fail (format != NULL, NULL); - if (format->domain != NULL) - domain = format->domain; - else - domain = GETTEXT_PACKAGE; - description = g_dgettext (domain, format->description); + if (format->domain != NULL) + domain = format->domain; + else + domain = GETTEXT_PACKAGE; + description = g_dgettext (domain, format->description); - return g_strdup (description); + return g_strdup (description); } /** @@ -2512,9 +2512,9 @@ gdk_pixbuf_format_get_description (GdkPixbufFormat *format) gchar ** gdk_pixbuf_format_get_mime_types (GdkPixbufFormat *format) { - g_return_val_if_fail (format != NULL, NULL); + g_return_val_if_fail (format != NULL, NULL); - return g_strdupv (format->mime_types); + return g_strdupv (format->mime_types); } /** @@ -2532,9 +2532,9 @@ gdk_pixbuf_format_get_mime_types (GdkPixbufFormat *format) gchar ** gdk_pixbuf_format_get_extensions (GdkPixbufFormat *format) { - g_return_val_if_fail (format != NULL, NULL); + g_return_val_if_fail (format != NULL, NULL); - return g_strdupv (format->extensions); + return g_strdupv (format->extensions); } /** @@ -2550,9 +2550,9 @@ gdk_pixbuf_format_get_extensions (GdkPixbufFormat *format) gboolean gdk_pixbuf_format_is_writable (GdkPixbufFormat *format) { - g_return_val_if_fail (format != NULL, FALSE); + g_return_val_if_fail (format != NULL, FALSE); - return (format->flags & GDK_PIXBUF_FORMAT_WRITABLE) != 0; + return (format->flags & GDK_PIXBUF_FORMAT_WRITABLE) != 0; } /** @@ -2571,9 +2571,9 @@ gdk_pixbuf_format_is_writable (GdkPixbufFormat *format) gboolean gdk_pixbuf_format_is_scalable (GdkPixbufFormat *format) { - g_return_val_if_fail (format != NULL, FALSE); + g_return_val_if_fail (format != NULL, FALSE); - return (format->flags & GDK_PIXBUF_FORMAT_SCALABLE) != 0; + return (format->flags & GDK_PIXBUF_FORMAT_SCALABLE) != 0; } /** @@ -2590,9 +2590,9 @@ gdk_pixbuf_format_is_scalable (GdkPixbufFormat *format) gboolean gdk_pixbuf_format_is_disabled (GdkPixbufFormat *format) { - g_return_val_if_fail (format != NULL, FALSE); + g_return_val_if_fail (format != NULL, FALSE); - return format->disabled; + return format->disabled; } /** @@ -2609,11 +2609,11 @@ gdk_pixbuf_format_is_disabled (GdkPixbufFormat *format) */ void gdk_pixbuf_format_set_disabled (GdkPixbufFormat *format, - gboolean disabled) + gboolean disabled) { - g_return_if_fail (format != NULL); - - format->disabled = disabled != FALSE; + g_return_if_fail (format != NULL); + + format->disabled = disabled != FALSE; } /** @@ -2632,17 +2632,17 @@ gdk_pixbuf_format_set_disabled (GdkPixbufFormat *format, gchar* gdk_pixbuf_format_get_license (GdkPixbufFormat *format) { - g_return_val_if_fail (format != NULL, NULL); + g_return_val_if_fail (format != NULL, NULL); - return g_strdup (format->license); + return g_strdup (format->license); } GdkPixbufFormat * _gdk_pixbuf_get_format (GdkPixbufModule *module) { - g_return_val_if_fail (module != NULL, NULL); + g_return_val_if_fail (module != NULL, NULL); - return module->info; + return module->info; } /** @@ -2661,16 +2661,16 @@ _gdk_pixbuf_get_format (GdkPixbufModule *module) GSList * gdk_pixbuf_get_formats (void) { - GSList *result = NULL; - GSList *modules; + GSList *result = NULL; + GSList *modules; - for (modules = get_file_formats (); modules; modules = g_slist_next (modules)) { - GdkPixbufModule *module = (GdkPixbufModule *)modules->data; - GdkPixbufFormat *info = _gdk_pixbuf_get_format (module); - result = g_slist_prepend (result, info); - } + for (modules = get_file_formats (); modules; modules = g_slist_next (modules)) { + GdkPixbufModule *module = (GdkPixbufModule *)modules->data; + GdkPixbufFormat *info = _gdk_pixbuf_get_format (module); + result = g_slist_prepend (result, info); + } - return result; + return result; } diff --git a/gdk-pixbuf/gdk-pixbuf-io.h b/gdk-pixbuf/gdk-pixbuf-io.h index b1a162f89c..a6e07ca623 100644 --- a/gdk-pixbuf/gdk-pixbuf-io.h +++ b/gdk-pixbuf/gdk-pixbuf-io.h @@ -26,7 +26,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GDK_PIXBUF_DISABLE_SINGLE_INCLUDES) && !defined (GDK_PIXBUF_H_INSIDE) && !defined (GDK_PIXBUF_COMPILATION) +#if !defined (GDK_PIXBUF_H_INSIDE) && !defined (GDK_PIXBUF_COMPILATION) #error "Only can be included directly." #endif diff --git a/gdk-pixbuf/gdk-pixbuf-loader.c b/gdk-pixbuf/gdk-pixbuf-loader.c index 9ef23c1ad0..6b7b547971 100644 --- a/gdk-pixbuf/gdk-pixbuf-loader.c +++ b/gdk-pixbuf/gdk-pixbuf-loader.c @@ -221,9 +221,13 @@ gdk_pixbuf_loader_set_size (GdkPixbufLoader *loader, gint width, gint height) { - GdkPixbufLoaderPrivate *priv = GDK_PIXBUF_LOADER (loader)->priv; + GdkPixbufLoaderPrivate *priv; + + g_return_if_fail (GDK_IS_PIXBUF_LOADER (loader)); g_return_if_fail (width >= 0 && height >= 0); + priv = GDK_PIXBUF_LOADER (loader)->priv; + if (!priv->size_fixed) { priv->width = width; diff --git a/gdk-pixbuf/gdk-pixbuf-loader.h b/gdk-pixbuf/gdk-pixbuf-loader.h index 5d1f17cd1c..de4c53763b 100644 --- a/gdk-pixbuf/gdk-pixbuf-loader.h +++ b/gdk-pixbuf/gdk-pixbuf-loader.h @@ -23,7 +23,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GDK_PIXBUF_DISABLE_SINGLE_INCLUDES) && !defined (GDK_PIXBUF_H_INSIDE) && !defined (GDK_PIXBUF_COMPILATION) +#if !defined (GDK_PIXBUF_H_INSIDE) && !defined (GDK_PIXBUF_COMPILATION) #error "Only can be included directly." #endif diff --git a/gdk-pixbuf/gdk-pixbuf-simple-anim.h b/gdk-pixbuf/gdk-pixbuf-simple-anim.h index cb96c538d5..fe364bec5e 100644 --- a/gdk-pixbuf/gdk-pixbuf-simple-anim.h +++ b/gdk-pixbuf/gdk-pixbuf-simple-anim.h @@ -21,7 +21,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GDK_PIXBUF_DISABLE_SINGLE_INCLUDES) && !defined (GDK_PIXBUF_H_INSIDE) && !defined (GDK_PIXBUF_COMPILATION) +#if !defined (GDK_PIXBUF_H_INSIDE) && !defined (GDK_PIXBUF_COMPILATION) #error "Only can be included directly." #endif diff --git a/gdk-pixbuf/gdk-pixbuf-transform.h b/gdk-pixbuf/gdk-pixbuf-transform.h index 4965acf203..57ced64d08 100644 --- a/gdk-pixbuf/gdk-pixbuf-transform.h +++ b/gdk-pixbuf/gdk-pixbuf-transform.h @@ -23,7 +23,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GDK_PIXBUF_DISABLE_SINGLE_INCLUDES) && !defined (GDK_PIXBUF_H_INSIDE) && !defined (GDK_PIXBUF_COMPILATION) +#if !defined (GDK_PIXBUF_H_INSIDE) && !defined (GDK_PIXBUF_COMPILATION) #error "Only can be included directly." #endif diff --git a/gdk-pixbuf/gdk-pixbuf.c b/gdk-pixbuf/gdk-pixbuf.c index 349c98a1c6..71e0c61e9a 100644 --- a/gdk-pixbuf/gdk-pixbuf.c +++ b/gdk-pixbuf/gdk-pixbuf.c @@ -181,39 +181,6 @@ gdk_pixbuf_finalize (GObject *object) G_OBJECT_CLASS (gdk_pixbuf_parent_class)->finalize (object); } - - -/** - * gdk_pixbuf_ref: - * @pixbuf: A pixbuf. - * - * Adds a reference to a pixbuf. - * - * Return value: The same as the @pixbuf argument. - * - * Deprecated: 2.0: Use g_object_ref(). - **/ -GdkPixbuf * -gdk_pixbuf_ref (GdkPixbuf *pixbuf) -{ - return (GdkPixbuf *) g_object_ref (pixbuf); -} - -/** - * gdk_pixbuf_unref: - * @pixbuf: A pixbuf. - * - * Removes a reference from a pixbuf. - * - * Deprecated: 2.0: Use g_object_unref(). - **/ -void -gdk_pixbuf_unref (GdkPixbuf *pixbuf) -{ - g_object_unref (pixbuf); -} - - /* Used as the destroy notification function for gdk_pixbuf_new() */ static void diff --git a/gdk-pixbuf/gdk-pixbuf.symbols b/gdk-pixbuf/gdk-pixbuf.symbols index ddf01c0411..93885956ea 100644 --- a/gdk-pixbuf/gdk-pixbuf.symbols +++ b/gdk-pixbuf/gdk-pixbuf.symbols @@ -15,10 +15,6 @@ #if IN_FILE(__GDK_PIXBUF_C__) gdk_pixbuf_error_quark gdk_pixbuf_get_type G_GNUC_CONST -#ifndef GDK_PIXBUF_DISABLE_DEPRECATED -gdk_pixbuf_ref -gdk_pixbuf_unref -#endif gdk_pixbuf_new gdk_pixbuf_get_bits_per_sample gdk_pixbuf_get_colorspace @@ -118,10 +114,6 @@ gdk_pixbuf_animation_new_from_file PRIVATE #ifdef G_OS_WIN32 gdk_pixbuf_animation_new_from_file_utf8 #endif -#ifndef GDK_PIXBUF_DISABLE_DEPRECATED -gdk_pixbuf_animation_ref -gdk_pixbuf_animation_unref -#endif gdk_pixbuf_non_anim_new gdk_pixbuf_non_anim_get_type G_GNUC_CONST #endif diff --git a/gdk-pixbuf/io-png.c b/gdk-pixbuf/io-png.c index 43db70aa16..844064a748 100644 --- a/gdk-pixbuf/io-png.c +++ b/gdk-pixbuf/io-png.c @@ -261,7 +261,7 @@ gdk_pixbuf__png_image_load (FILE *f, GError **error) gchar *icc_profile_base64; const gchar *icc_profile_title; const gchar *icc_profile; - gulong icc_profile_size; + png_uint_32 icc_profile_size; guint32 retval; gint compression_type; @@ -344,7 +344,7 @@ gdk_pixbuf__png_image_load (FILE *f, GError **error) (png_charpp) &icc_profile_title, &compression_type, (png_charpp) &icc_profile, (png_uint_32*) &icc_profile_size); if (retval != 0) { - icc_profile_base64 = g_base64_encode ((const guchar *) icc_profile, icc_profile_size); + icc_profile_base64 = g_base64_encode ((const guchar *) icc_profile, (gsize)icc_profile_size); gdk_pixbuf_set_option (pixbuf, "icc-profile", icc_profile_base64); g_free (icc_profile_base64); } @@ -607,7 +607,7 @@ png_info_callback (png_structp png_read_ptr, gchar *icc_profile_base64; const gchar *icc_profile_title; const gchar *icc_profile; - gulong icc_profile_size; + png_uint_32 icc_profile_size; guint32 retval; gint compression_type; @@ -679,9 +679,9 @@ png_info_callback (png_structp png_read_ptr, /* Extract embedded ICC profile */ retval = png_get_iCCP (png_read_ptr, png_info_ptr, (png_charpp) &icc_profile_title, &compression_type, - (png_charpp) &icc_profile, (png_uint_32*) &icc_profile_size); + (png_charpp) &icc_profile, &icc_profile_size); if (retval != 0) { - icc_profile_base64 = g_base64_encode ((const guchar *) icc_profile, icc_profile_size); + icc_profile_base64 = g_base64_encode ((const guchar *) icc_profile, (gsize)icc_profile_size); gdk_pixbuf_set_option (lc->pixbuf, "icc-profile", icc_profile_base64); g_free (icc_profile_base64); } diff --git a/gdk-pixbuf/make-inline-pixbuf.c b/gdk-pixbuf/make-inline-pixbuf.c index f100820f7f..e2e1f6100d 100644 --- a/gdk-pixbuf/make-inline-pixbuf.c +++ b/gdk-pixbuf/make-inline-pixbuf.c @@ -219,7 +219,7 @@ main (int argc, char **argv) output_pixbuf (outfile, ext_symbols, argv[i], pixbuf); - gdk_pixbuf_unref (pixbuf); + g_object_unref (pixbuf); i += 2; } diff --git a/gdk-pixbuf/queryloaders.c b/gdk-pixbuf/queryloaders.c index 71805d43ee..b8f993517f 100644 --- a/gdk-pixbuf/queryloaders.c +++ b/gdk-pixbuf/queryloaders.c @@ -3,7 +3,7 @@ * queryloaders.c: * * Copyright (C) 2002 The Free Software Foundation - * + * * Author: Matthias Clasen * * This library is free software; you can redistribute it and/or @@ -13,7 +13,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public @@ -50,278 +50,312 @@ #endif static void -print_escaped (const char *str) +print_escaped (GString *contents, const char *str) { - gchar *tmp = g_strescape (str, ""); - g_printf ("\"%s\" ", tmp); - g_free (tmp); + gchar *tmp = g_strescape (str, ""); + g_string_append_printf (contents, "\"%s\" ", tmp); + g_free (tmp); } static int loader_sanity_check (const char *path, GdkPixbufFormat *info, GdkPixbufModule *vtable) { - const GdkPixbufModulePattern *pattern; - const char *error = ""; + const GdkPixbufModulePattern *pattern; + const char *error = ""; - for (pattern = info->signature; pattern->prefix; pattern++) - { - int prefix_len = strlen (pattern->prefix); - if (prefix_len == 0) - { - error = "empty pattern"; + for (pattern = info->signature; pattern->prefix; pattern++) + { + int prefix_len = strlen (pattern->prefix); + if (prefix_len == 0) + { + error = "empty pattern"; - goto error; - } - if (pattern->mask) - { - int mask_len = strlen (pattern->mask); - if (mask_len != prefix_len) - { - error = "mask length mismatch"; - - goto error; - } - if (strspn (pattern->mask, " !xzn*") < mask_len) - { - error = "bad char in mask"; - - goto error; - } - } - } + goto error; + } + if (pattern->mask) + { + int mask_len = strlen (pattern->mask); + if (mask_len != prefix_len) + { + error = "mask length mismatch"; - if (!vtable->load && !vtable->begin_load && !vtable->load_animation) - { - error = "no load method implemented"; + goto error; + } + if (strspn (pattern->mask, " !xzn*") < mask_len) + { + error = "bad char in mask"; - goto error; - } + goto error; + } + } + } - if (vtable->begin_load && (!vtable->stop_load || !vtable->load_increment)) - { - error = "incremental loading support incomplete"; + if (!vtable->load && !vtable->begin_load && !vtable->load_animation) + { + error = "no load method implemented"; - goto error; - } + goto error; + } - if ((info->flags & GDK_PIXBUF_FORMAT_WRITABLE) && !(vtable->save || vtable->save_to_callback)) - { - error = "loader claims to support saving but doesn't implement save"; - goto error; - } - - return 1; + if (vtable->begin_load && (!vtable->stop_load || !vtable->load_increment)) + { + error = "incremental loading support incomplete"; + + goto error; + } + + if ((info->flags & GDK_PIXBUF_FORMAT_WRITABLE) && !(vtable->save || vtable->save_to_callback)) + { + error = "loader claims to support saving but doesn't implement save"; + goto error; + } + + return 1; error: - g_fprintf (stderr, "Loader sanity check failed for %s: %s\n", - path, error); - - return 0; + g_fprintf (stderr, "Loader sanity check failed for %s: %s\n", + path, error); + + return 0; } static void -write_loader_info (const char *path, GdkPixbufFormat *info) +write_loader_info (GString *contents, const char *path, GdkPixbufFormat *info) { - const GdkPixbufModulePattern *pattern; - char **mime; - char **ext; + const GdkPixbufModulePattern *pattern; + char **mime; + char **ext; - g_printf("\"%s\"\n", path); - g_printf ("\"%s\" %u \"%s\" \"%s\" \"%s\"\n", - info->name, + g_string_append_printf (contents, "\"%s\"\n", path); + g_string_append_printf (contents, "\"%s\" %u \"%s\" \"%s\" \"%s\"\n", + info->name, info->flags, - info->domain ? info->domain : GETTEXT_PACKAGE, + info->domain ? info->domain : GETTEXT_PACKAGE, info->description, info->license ? info->license : ""); - for (mime = info->mime_types; *mime; mime++) { - g_printf ("\"%s\" ", *mime); - } - g_printf ("\"\"\n"); - for (ext = info->extensions; *ext; ext++) { - g_printf ("\"%s\" ", *ext); - } - g_printf ("\"\"\n"); - for (pattern = info->signature; pattern->prefix; pattern++) { - print_escaped (pattern->prefix); - print_escaped (pattern->mask ? (const char *)pattern->mask : ""); - g_printf ("%d\n", pattern->relevance); - } - g_printf ("\n"); + for (mime = info->mime_types; *mime; mime++) { + g_string_append_printf (contents, "\"%s\" ", *mime); + } + g_string_append (contents, "\"\"\n"); + for (ext = info->extensions; *ext; ext++) { + g_string_append_printf (contents, "\"%s\" ", *ext); + } + g_string_append (contents, "\"\"\n"); + for (pattern = info->signature; pattern->prefix; pattern++) { + print_escaped (contents, pattern->prefix); + print_escaped (contents, pattern->mask ? (const char *)pattern->mask : ""); + g_string_append_printf (contents, "%d\n", pattern->relevance); + } + g_string_append_c (contents, '\n'); } static void -query_module (const char *dir, const char *file) +query_module (GString *contents, const char *dir, const char *file) { - char *path; - GModule *module; - void (*fill_info) (GdkPixbufFormat *info); - void (*fill_vtable) (GdkPixbufModule *module); - gpointer fill_info_ptr; - gpointer fill_vtable_ptr; + char *path; + GModule *module; + void (*fill_info) (GdkPixbufFormat *info); + void (*fill_vtable) (GdkPixbufModule *module); + gpointer fill_info_ptr; + gpointer fill_vtable_ptr; - if (g_path_is_absolute (file)) - path = g_strdup (file); - else - path = g_build_filename (dir, file, NULL); + if (g_path_is_absolute (file)) + path = g_strdup (file); + else + path = g_build_filename (dir, file, NULL); + + module = g_module_open (path, 0); + if (module && + g_module_symbol (module, "fill_info", &fill_info_ptr) && + g_module_symbol (module, "fill_vtable", &fill_vtable_ptr)) { + GdkPixbufFormat *info; + GdkPixbufModule *vtable; - module = g_module_open (path, 0); - if (module && - g_module_symbol (module, "fill_info", &fill_info_ptr) && - g_module_symbol (module, "fill_vtable", &fill_vtable_ptr)) { - GdkPixbufFormat *info; - GdkPixbufModule *vtable; - #ifdef G_OS_WIN32 - /* Replace backslashes in path with forward slashes, so that - * it reads in without problems. - */ - { - char *p = path; - while (*p) { - if (*p == '\\') - *p = '/'; - p++; - } - } -#endif - info = g_new0 (GdkPixbufFormat, 1); - vtable = g_new0 (GdkPixbufModule, 1); + /* Replace backslashes in path with forward slashes, so that + * it reads in without problems. + */ + { + char *p = path; + while (*p) { + if (*p == '\\') + *p = '/'; + p++; + } + } +#endif + info = g_new0 (GdkPixbufFormat, 1); + vtable = g_new0 (GdkPixbufModule, 1); - vtable->module = module; + vtable->module = module; - fill_info = fill_info_ptr; - fill_vtable = fill_vtable_ptr; + fill_info = fill_info_ptr; + fill_vtable = fill_vtable_ptr; - (*fill_info) (info); - (*fill_vtable) (vtable); - - if (loader_sanity_check (path, info, vtable)) - write_loader_info (path, info); - - g_free (info); - g_free (vtable); - } - else { - if (module == NULL) - g_fprintf (stderr, "g_module_open() failed for %s: %s\n", path, - g_module_error()); - else - g_fprintf (stderr, "Cannot load loader %s\n", path); - } - if (module) - g_module_close (module); - g_free (path); + (*fill_info) (info); + (*fill_vtable) (vtable); + + if (loader_sanity_check (path, info, vtable)) + write_loader_info (contents, path, info); + + g_free (info); + g_free (vtable); + } + else { + if (module == NULL) + g_fprintf (stderr, "g_module_open() failed for %s: %s\n", path, + g_module_error()); + else + g_fprintf (stderr, "Cannot load loader %s\n", path); + } + if (module) + g_module_close (module); + g_free (path); +} + +static gchar * +gdk_pixbuf_get_module_file (void) +{ + gchar *result = g_strdup (g_getenv ("GDK_PIXBUF_MODULE_FILE")); + + if (!result) + result = g_build_filename (GTK_LIBDIR, "gtk-3.0", GTK_BINARY_VERSION, "loaders.cache", NULL); + + return result; } int main (int argc, char **argv) { - gint i; - gchar *prgname; + gint i; + gchar *prgname; + GString *contents; + gchar *cache_file = NULL; + gint first_file = 1; #ifdef G_OS_WIN32 - gchar *libdir; - gchar *runtime_prefix; - gchar *slash; + gchar *libdir; + gchar *runtime_prefix; + gchar *slash; - if (g_ascii_strncasecmp (PIXBUF_LIBDIR, GTK_PREFIX, strlen (GTK_PREFIX)) == 0 && - G_IS_DIR_SEPARATOR (PIXBUF_LIBDIR[strlen (GTK_PREFIX)])) { - /* GTK_PREFIX is a prefix of PIXBUF_LIBDIR, as it - * normally is. Replace that prefix in PIXBUF_LIBDIR - * with the installation directory on this machine. - * We assume this invokation of - * gdk-pixbuf-query-loaders is run from either a "bin" - * subdirectory of the installation directory, or in - * the installation directory itself. - */ - wchar_t fn[1000]; - GetModuleFileNameW (NULL, fn, G_N_ELEMENTS (fn)); - runtime_prefix = g_utf16_to_utf8 (fn, -1, NULL, NULL, NULL); - slash = strrchr (runtime_prefix, '\\'); - *slash = '\0'; - slash = strrchr (runtime_prefix, '\\'); - /* If running from some weird location, or from the - * build directory (either in the .libs folder where - * libtool places the real executable when using a - * wrapper, or directly from the gdk-pixbuf folder), - * use the compile-time libdir. - */ - if (slash == NULL || - g_ascii_strcasecmp (slash + 1, ".libs") == 0 || - g_ascii_strcasecmp (slash + 1, "gdk-pixbuf") == 0) { - libdir = PIXBUF_LIBDIR; - } - else { - if (slash != NULL && g_ascii_strcasecmp (slash + 1, "bin") == 0) { - *slash = '\0'; - } - - libdir = g_strconcat (runtime_prefix, - "/", - PIXBUF_LIBDIR + strlen (GTK_PREFIX) + 1, - NULL); - } - } - else { - libdir = PIXBUF_LIBDIR; - } + if (g_ascii_strncasecmp (PIXBUF_LIBDIR, GTK_PREFIX, strlen (GTK_PREFIX)) == 0 && + G_IS_DIR_SEPARATOR (PIXBUF_LIBDIR[strlen (GTK_PREFIX)])) { + /* GTK_PREFIX is a prefix of PIXBUF_LIBDIR, as it + * normally is. Replace that prefix in PIXBUF_LIBDIR + * with the installation directory on this machine. + * We assume this invokation of + * gdk-pixbuf-query-loaders is run from either a "bin" + * subdirectory of the installation directory, or in + * the installation directory itself. + */ + wchar_t fn[1000]; + GetModuleFileNameW (NULL, fn, G_N_ELEMENTS (fn)); + runtime_prefix = g_utf16_to_utf8 (fn, -1, NULL, NULL, NULL); + slash = strrchr (runtime_prefix, '\\'); + *slash = '\0'; + slash = strrchr (runtime_prefix, '\\'); + /* If running from some weird location, or from the + * build directory (either in the .libs folder where + * libtool places the real executable when using a + * wrapper, or directly from the gdk-pixbuf folder), + * use the compile-time libdir. + */ + if (slash == NULL || + g_ascii_strcasecmp (slash + 1, ".libs") == 0 || + g_ascii_strcasecmp (slash + 1, "gdk-pixbuf") == 0) { + libdir = PIXBUF_LIBDIR; + } + else { + if (slash != NULL && g_ascii_strcasecmp (slash + 1, "bin") == 0) { + *slash = '\0'; + } + + libdir = g_strconcat (runtime_prefix, + "/", + PIXBUF_LIBDIR + strlen (GTK_PREFIX) + 1, + NULL); + } + } + else { + libdir = PIXBUF_LIBDIR; + } #undef PIXBUF_LIBDIR #define PIXBUF_LIBDIR libdir #endif - prgname = g_get_prgname (); - g_printf ("# GdkPixbuf Image Loader Modules file\n" - "# Automatically generated file, do not edit\n" - "# Created by %s from gtk+-%s\n" - "#\n", - (prgname ? prgname : "gdk-pixbuf-query-loaders"), - GDK_PIXBUF_VERSION); - - if (argc == 1) { + + if (argc > 1 && strcmp (argv[1], "--update-cache") == 0) { + cache_file = gdk_pixbuf_get_module_file (); + first_file = 2; + } + + contents = g_string_new (""); + + prgname = g_get_prgname (); + g_string_append_printf (contents, + "# GdkPixbuf Image Loader Modules file\n" + "# Automatically generated file, do not edit\n" + "# Created by %s from gtk+-%s\n" + "#\n", + (prgname ? prgname : "gdk-pixbuf-query-loaders-3.0"), + GDK_PIXBUF_VERSION); + + if (argc == first_file) { #ifdef USE_GMODULE - const char *path; - GDir *dir; - - path = g_getenv ("GDK_PIXBUF_MODULEDIR"); + const char *path; + GDir *dir; + + path = g_getenv ("GDK_PIXBUF_MODULEDIR"); #ifdef G_OS_WIN32 - if (path != NULL && *path != '\0') - path = g_locale_to_utf8 (path, -1, NULL, NULL, NULL); + if (path != NULL && *path != '\0') + path = g_locale_to_utf8 (path, -1, NULL, NULL, NULL); #endif - if (path == NULL || *path == '\0') - path = PIXBUF_LIBDIR; + if (path == NULL || *path == '\0') + path = PIXBUF_LIBDIR; - g_printf ("# LoaderDir = %s\n#\n", path); + g_string_append_printf (contents, "# LoaderDir = %s\n#\n", path); - dir = g_dir_open (path, 0, NULL); - if (dir) { - const char *dent; + dir = g_dir_open (path, 0, NULL); + if (dir) { + const char *dent; - while ((dent = g_dir_read_name (dir))) { - gint len = strlen (dent); - if (len > SOEXT_LEN && - strcmp (dent + len - SOEXT_LEN, SOEXT) == 0) { - query_module (path, dent); - } - } - g_dir_close (dir); - } + while ((dent = g_dir_read_name (dir))) { + gint len = strlen (dent); + if (len > SOEXT_LEN && + strcmp (dent + len - SOEXT_LEN, SOEXT) == 0) { + query_module (contents, path, dent); + } + } + g_dir_close (dir); + } #else - g_printf ("# dynamic loading of modules not supported\n"); + g_string_append_printf (contents, "# dynamic loading of modules not supported\n"); #endif - } - else { - char *cwd = g_get_current_dir (); + } + else { + char *cwd = g_get_current_dir (); - for (i = 1; i < argc; i++) { - char *infilename = argv[i]; + for (i = 1; i < argc; i++) { + char *infilename = argv[i]; #ifdef G_OS_WIN32 - infilename = g_locale_to_utf8 (infilename, - -1, NULL, NULL, NULL); + infilename = g_locale_to_utf8 (infilename, + -1, NULL, NULL, NULL); #endif - query_module (cwd, infilename); - } - g_free (cwd); - } + query_module (contents, cwd, infilename); + } + g_free (cwd); + } - return 0; + if (cache_file) { + GError *err; + + err = NULL; + if (!g_file_set_contents (cache_file, contents->str, -1, &err)) { + g_fprintf (stderr, "%s\n", err->message); + } + } + else + g_print ("%s\n", contents->str); + + return 0; } diff --git a/gdk/Makefile.am b/gdk/Makefile.am index 1a783c370a..7db3e9a7b1 100644 --- a/gdk/Makefile.am +++ b/gdk/Makefile.am @@ -3,6 +3,7 @@ include $(top_srcdir)/Makefile.decl -include $(INTROSPECTION_MAKEFILE) INTROSPECTION_GIRS = INTROSPECTION_SCANNER_ARGS = \ + --add-include-path=../gdk \ --add-include-path=../gdk-pixbuf INTROSPECTION_COMPILER_ARGS = \ --includedir=$(srcdir) \ @@ -77,6 +78,8 @@ gdk_public_h_sources = \ gdkcairo.h \ gdkcolor.h \ gdkcursor.h \ + gdkdevice.h \ + gdkdevicemanager.h \ gdkdisplay.h \ gdkdisplaymanager.h \ gdkdnd.h \ @@ -84,7 +87,6 @@ gdk_public_h_sources = \ gdkevents.h \ gdkfont.h \ gdkgc.h \ - gdki18n.h \ gdkimage.h \ gdkinput.h \ gdkkeys.h \ @@ -110,10 +112,11 @@ gdk_built_public_sources = \ gdk_built_private_headers = \ gdkalias.h -gdk_private_headers = \ - gdkinternals.h \ - gdkintl.h \ - gdkpoly-generic.h \ +gdk_private_headers = \ + gdkinternals.h \ + gdkdeviceprivate.h \ + gdkintl.h \ + gdkpoly-generic.h \ gdkregion-generic.h gdk_c_sources = \ @@ -123,6 +126,8 @@ gdk_c_sources = \ gdkcairo.c \ gdkcolor.c \ gdkcursor.c \ + gdkdevice.c \ + gdkdevicemanager.c \ gdkdisplay.c \ gdkdisplaymanager.c \ gdkdnd.c \ @@ -161,7 +166,7 @@ gdk_built_sources = \ # setup GDK sources and their dependencies # -gdkincludedir = $(includedir)/gtk-2.0/gdk +gdkincludedir = $(includedir)/gtk-3.0/gdk gdkinclude_HEADERS = $(gdk_public_h_sources) $(gdk_built_public_sources) common_sources = \ @@ -171,26 +176,26 @@ common_sources = \ gdkmarshalers.c \ gdkmarshalers.h -libgdk_directfb_2_0_la_SOURCES = $(common_sources) -libgdk_directfb_2_0_la_LIBADD = directfb/libgdk-directfb.la $(GDK_DEP_LIBS) \ +libgdk_directfb_3_0_la_SOURCES = $(common_sources) +libgdk_directfb_3_0_la_LIBADD = directfb/libgdk-directfb.la $(GDK_DEP_LIBS) \ $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la -libgdk_directfb_2_0_la_LDFLAGS = $(LDADD) +libgdk_directfb_3_0_la_LDFLAGS = $(LDADD) -libgdk_x11_2_0_la_SOURCES = $(common_sources) -libgdk_x11_2_0_la_LIBADD = x11/libgdk-x11.la $(GDK_DEP_LIBS) \ +libgdk_x11_3_0_la_SOURCES = $(common_sources) +libgdk_x11_3_0_la_LIBADD = x11/libgdk-x11.la $(GDK_DEP_LIBS) \ $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la -libgdk_x11_2_0_la_LDFLAGS = $(LDADD) +libgdk_x11_3_0_la_LDFLAGS = $(LDADD) -libgdk_quartz_2_0_la_SOURCES = $(common_sources) gdkkeynames.c -libgdk_quartz_2_0_la_LIBADD = quartz/libgdk-quartz.la $(GDK_DEP_LIBS) \ +libgdk_quartz_3_0_la_SOURCES = $(common_sources) gdkkeynames.c +libgdk_quartz_3_0_la_LIBADD = quartz/libgdk-quartz.la $(GDK_DEP_LIBS) \ $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la -libgdk_quartz_2_0_la_LDFLAGS = $(LDADD) +libgdk_quartz_3_0_la_LDFLAGS = $(LDADD) -libgdk_win32_2_0_la_SOURCES = $(common_sources) gdkkeynames.c -libgdk_win32_2_0_la_LIBADD = win32/libgdk-win32.la $(GDK_DEP_LIBS) \ +libgdk_win32_3_0_la_SOURCES = $(common_sources) gdkkeynames.c +libgdk_win32_3_0_la_LIBADD = win32/libgdk-win32.la $(GDK_DEP_LIBS) \ $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la -libgdk_win32_2_0_la_DEPENDENCIES = win32/libgdk-win32.la win32/rc/gdk-win32-res.o gdk.def -libgdk_win32_2_0_la_LDFLAGS = -Wl,win32/rc/gdk-win32-res.o -export-symbols $(srcdir)/gdk.def $(LDADD) +libgdk_win32_3_0_la_DEPENDENCIES = win32/libgdk-win32.la win32/rc/gdk-win32-res.o gdk.def +libgdk_win32_3_0_la_LDFLAGS = -Wl,win32/rc/gdk-win32-res.o -export-symbols $(srcdir)/gdk.def $(LDADD) if HAVE_INTROSPECTION @@ -198,16 +203,29 @@ introspection_files = \ $(gdk_public_h_sources) \ $(gdk_c_sources) \ gdkenumtypes.c \ - gdkenumtypes.h \ - $(srcdir)/x11/*.c + gdkenumtypes.h -Gdk-2.0.gir: $(gdktargetlib) Makefile -Gdk_2_0_gir_SCANNERFLAGS = --strip-prefix=Gdk --add-include-path=../gdk-pixbuf -Gdk_2_0_gir_INCLUDES = Gio-2.0 GdkPixbuf-2.0 Pango-1.0 -Gdk_2_0_gir_LIBS = $(gdktargetlib) -Gdk_2_0_gir_FILES = $(addprefix $(srcdir)/,$(introspection_files)) -Gdk_2_0_gir_CFLAGS = $(INCLUDES) -INTROSPECTION_GIRS += Gdk-2.0.gir +Gdk-3.0.gir: $(gdktargetlib) Makefile +Gdk_3_0_gir_SCANNERFLAGS = --strip-prefix=Gdk --add-include-path=../gdk-pixbuf +Gdk_3_0_gir_INCLUDES = Gio-2.0 GdkPixbuf-3.0 Pango-1.0 +Gdk_3_0_gir_LIBS = $(gdktargetlib) +Gdk_3_0_gir_FILES = $(addprefix $(srcdir)/,$(introspection_files)) +Gdk_3_0_gir_CFLAGS = $(INCLUDES) +INTROSPECTION_GIRS += Gdk-3.0.gir + +if USE_X11 +x11_introspection_files = \ + x11/*.c \ + x11/gdkx.h + +GdkX11-3.0.gir: $(gdktargetlib) Makefile +GdkX11_3_0_gir_SCANNERFLAGS = --strip-prefix=gdk_x11 --add-include-path=../gdk-pixbuf +GdkX11_3_0_gir_INCLUDES = Gio-2.0 Gdk-3.0 GdkPixbuf-3.0 Pango-1.0 xlib-2.0 +GdkX11_3_0_gir_LIBS = $(gdktargetlib) +GdkX11_3_0_gir_FILES = $(addprefix $(srcdir)/,$(x11_introspection_files)) +GdkX11_3_0_gir_CFLAGS = $(INCLUDES) +INTROSPECTION_GIRS += GdkX11-3.0.gir +endif # USE_X11 girdir = $(datadir)/gir-1.0 dist_gir_DATA = $(INTROSPECTION_GIRS) @@ -216,13 +234,14 @@ typelibsdir = $(libdir)/girepository-1.0 typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib) CLEANFILES += $(dist_gir_DATA) $(typelibs_DATA) -endif + +endif # HAVE_INTROSPECTION if OS_WIN32 install-def-file: gdk.def - $(INSTALL) $(srcdir)/gdk.def $(DESTDIR)$(libdir)/gdk-win32-2.0.def + $(INSTALL) $(srcdir)/gdk.def $(DESTDIR)$(libdir)/gdk-win32-3.0.def uninstall-def-file: - -rm $(DESTDIR)$(libdir)/gdk-win32-2.0.def + -rm $(DESTDIR)$(libdir)/gdk-win32-3.0.def else install-def-file: uninstall-def-file: @@ -262,7 +281,7 @@ endif lib_LTLIBRARIES = $(gdktargetlib) -EXTRA_LTLIBRARIES = libgdk-x11-2.0.la libgdk-win32-2.0.la libgdk-quartz-2.0.la libgdk-directfb-2.0.la +EXTRA_LTLIBRARIES = libgdk-x11-3.0.la libgdk-win32-3.0.la libgdk-quartz-3.0.la libgdk-directfb-3.0.la MAINTAINERCLEANFILES = $(gdk_built_sources) stamp-gdkenumtypes.h EXTRA_DIST += $(gdk_built_sources) @@ -271,7 +290,7 @@ EXTRA_HEADERS = # # Rule to install gdkconfig.h header file # -configexecincludedir = $(libdir)/gtk-2.0/include +configexecincludedir = $(libdir)/gtk-3.0/include #configexecinclude_DATA = gdkconfig.h install-exec-local: gdkconfig.h @@ -326,7 +345,7 @@ stamp-gc-h: $(top_builddir)/config.status dist-hook: ../build/win32/vs9/gdk.vcproj ../build/win32/vs9/gdk.vcproj: ../build/win32/vs9/gdk.vcprojin - for F in $(libgdk_win32_2_0_la_SOURCES); do \ + for F in $(libgdk_win32_3_0_la_SOURCES); do \ case $$F in \ *.c) echo ' ' \ ;; \ diff --git a/gdk/abicheck.sh b/gdk/abicheck.sh index e8ed7f4191..422cee9a24 100755 --- a/gdk/abicheck.sh +++ b/gdk/abicheck.sh @@ -1,5 +1,5 @@ #! /bin/sh -cpp -DINCLUDE_VARIABLES -P -DALL_FILES -DGDK_ENABLE_BROKEN -DGDK_WINDOWING_X11 ${srcdir:-.}/gdk.symbols | sed -e '/^$/d' -e 's/ G_GNUC.*$//' | sort | uniq > expected-abi -nm -D -g --defined-only .libs/libgdk-x11-2.0.so | cut -d ' ' -f 3 | sort > actual-abi +cpp -DINCLUDE_VARIABLES -P -DALL_FILES -DGDK_ENABLE_BROKEN -include ${srcdir:-.}/../config.h -include ${srcdir:-.}/gdkconfig.h ${srcdir:-.}/gdk.symbols | sed -e '/^$/d' -e 's/ G_GNUC.*$//' | sort | uniq > expected-abi +nm -D -g --defined-only .libs/libgdk-x11-3.0.so | cut -d ' ' -f 3 | egrep -v '^(__bss_start|_edata|_end)' | sort > actual-abi diff -u expected-abi actual-abi && rm -f expected-abi actual-abi diff --git a/gdk/directfb/gdkcolor-directfb.c b/gdk/directfb/gdkcolor-directfb.c index 86f68da1ed..7b2c5df1c1 100644 --- a/gdk/directfb/gdkcolor-directfb.c +++ b/gdk/directfb/gdkcolor-directfb.c @@ -218,45 +218,6 @@ gdk_screen_get_system_colormap (GdkScreen *screen) return colormap; } -gint -gdk_colormap_get_system_size (void) -{ - GdkVisual *visual; - - visual = gdk_visual_get_system (); - - return visual->colormap_size; -} - -void -gdk_colormap_change (GdkColormap *colormap, - gint ncolors) -{ - g_message ("gdk_colormap_change() is deprecated and unimplemented"); -} - -gboolean -gdk_colors_alloc (GdkColormap *colormap, - gboolean contiguous, - gulong *planes, - gint nplanes, - gulong *pixels, - gint npixels) -{ - /* g_message ("gdk_colors_alloc() is deprecated and unimplemented"); */ - - return TRUE; /* return TRUE here to make GdkRGB happy */ -} - -void -gdk_colors_free (GdkColormap *colormap, - gulong *in_pixels, - gint in_npixels, - gulong planes) -{ - /* g_message ("gdk_colors_free() is deprecated and unimplemented"); */ -} - void gdk_colormap_free_colors (GdkColormap *colormap, const GdkColor *colors, @@ -344,44 +305,6 @@ gdk_colormap_alloc_colors (GdkColormap *colormap, return 0; } -gboolean -gdk_color_change (GdkColormap *colormap, - GdkColor *color) -{ - GdkColormapPrivateDirectFB *private; - IDirectFBPalette *palette; - - g_return_val_if_fail (GDK_IS_COLORMAP (colormap), FALSE); - g_return_val_if_fail (color != NULL, FALSE); - - private = colormap->windowing_data; - if (!private) - return FALSE; - - palette = private->palette; - if (!palette) - return FALSE; - - if (color->pixel < 0 || color->pixel >= colormap->size) - return FALSE; - - if (private->info[color->pixel].flags & GDK_COLOR_WRITEABLE) - { - DFBColor entry = { 0xFF, - color->red >> 8, - color->green >> 8, - color->blue >> 8 }; - - if (palette->SetEntries (palette, &entry, 1, color->pixel) != DFB_OK) - return FALSE; - - colormap->colors[color->pixel] = *color; - return TRUE; - } - - return FALSE; -} - void gdk_colormap_query_color (GdkColormap *colormap, gulong pixel, diff --git a/gdk/directfb/gdkdirectfb.h b/gdk/directfb/gdkdirectfb.h index bc2ba7a00a..0b0d411514 100644 --- a/gdk/directfb/gdkdirectfb.h +++ b/gdk/directfb/gdkdirectfb.h @@ -68,15 +68,6 @@ extern gboolean gdk_directfb_monochrome_fonts; void gdk_directfb_window_set_opacity (GdkWindow *window, guchar opacity); -#ifndef GDK_DISABLE_DEPRECATED -GdkWindow * gdk_directfb_window_new (GdkWindow *parent, - GdkWindowAttr *attributes, - gint attributes_mask, - DFBWindowCapabilities window_caps, - DFBWindowOptions window_options, - DFBSurfaceCapabilities surface_caps); -#endif /* GDK_DISABLE_DEPRECATED */ - GdkVisual * gdk_directfb_visual_by_format (DFBSurfacePixelFormat pixel_format); IDirectFBWindow *gdk_directfb_window_lookup(GdkWindow *window); diff --git a/gdk/directfb/gdkdnd-directfb.c b/gdk/directfb/gdkdnd-directfb.c index 35624c7af5..527a817c0d 100644 --- a/gdk/directfb/gdkdnd-directfb.c +++ b/gdk/directfb/gdkdnd-directfb.c @@ -121,18 +121,6 @@ gdk_drag_context_new (void) return g_object_new (gdk_drag_context_get_type (), NULL); } -void -gdk_drag_context_ref (GdkDragContext *context) -{ - g_object_ref (context); -} - -void -gdk_drag_context_unref (GdkDragContext *context) -{ - g_object_unref (context); -} - static GdkDragContext * gdk_drag_context_find (gboolean is_source, GdkWindow *source, diff --git a/gdk/directfb/gdkevents-directfb.c b/gdk/directfb/gdkevents-directfb.c index 2dd5000e02..7260547bcb 100644 --- a/gdk/directfb/gdkevents-directfb.c +++ b/gdk/directfb/gdkevents-directfb.c @@ -318,36 +318,6 @@ gdk_events_pending (void) return _gdk_event_queue_find_first (display) ? TRUE : FALSE; } -GdkEvent * -gdk_event_get_graphics_expose (GdkWindow *window) -{ - GdkDisplay *display; - GList *list; - - g_return_val_if_fail (GDK_IS_WINDOW (window), NULL); - - display = gdk_drawable_get_display (GDK_DRAWABLE (window)); - - for (list = _gdk_event_queue_find_first (display); list; list = list->next) - { - GdkEvent *event = list->data; - if (event->type == GDK_EXPOSE && event->expose.window == window) - break; - } - - if (list) - { - GdkEvent *retval = list->data; - - _gdk_event_queue_remove_link (display, list); - g_list_free_1 (list); - - return retval; - } - - return NULL; -} - void _gdk_events_queue (GdkDisplay *display) { diff --git a/gdk/directfb/gdkimage-directfb.c b/gdk/directfb/gdkimage-directfb.c index 0485dfdb18..8e1ed66c38 100644 --- a/gdk/directfb/gdkimage-directfb.c +++ b/gdk/directfb/gdkimage-directfb.c @@ -131,40 +131,6 @@ _gdk_image_exit (void) } } -GdkImage * -gdk_image_new_bitmap (GdkVisual *visual, - gpointer data, - gint w, - gint h) -{ - GdkImage *image; - GdkImageDirectFB *private; - - image = g_object_new (gdk_image_get_type (), NULL); - private = image->windowing_data; - - image->type = GDK_IMAGE_SHARED; - image->visual = visual; - image->width = w; - image->height = h; - image->depth = 1; - - GDK_NOTE (MISC, g_print ("gdk_image_new_bitmap: %dx%d\n", w, h)); - - g_message ("not fully implemented %s", G_STRFUNC); - - image->bpl = (w + 7) / 8; - image->mem = g_malloc (image->bpl * h); -#if G_BYTE_ORDER == G_BIG_ENDIAN - image->byte_order = GDK_MSB_FIRST; -#else - image->byte_order = GDK_LSB_FIRST; -#endif - image->bpp = 1; - - return image; -} - void _gdk_windowing_image_init (void) { @@ -229,7 +195,7 @@ _gdk_image_new_for_depth (GdkScreen *screen, if (ret) { DirectFBError( "IDirectFBSurface::Lock() for writing failed!\n", ret ); - gdk_image_unref( image ); + g_object_unref( image ); return NULL; } diff --git a/gdk/directfb/gdkmain-directfb.c b/gdk/directfb/gdkmain-directfb.c index 05aa0429de..0e9b873fce 100644 --- a/gdk/directfb/gdkmain-directfb.c +++ b/gdk/directfb/gdkmain-directfb.c @@ -63,17 +63,6 @@ _gdk_windowing_init (void) */ } -void -gdk_set_use_xshm (gboolean use_xshm) -{ -} - -gboolean -gdk_get_use_xshm (void) -{ - return FALSE; -} - void _gdk_windowing_display_set_sm_client_id (GdkDisplay *display,const gchar *sm_client_id) { diff --git a/gdk/directfb/gdkwindow-directfb.c b/gdk/directfb/gdkwindow-directfb.c index 8e67680f7e..83da5b8a84 100644 --- a/gdk/directfb/gdkwindow-directfb.c +++ b/gdk/directfb/gdkwindow-directfb.c @@ -356,214 +356,6 @@ _gdk_windowing_window_init (void) gdk_drawable_set_colormap (GDK_DRAWABLE (_gdk_parent_root),gdk_colormap_get_system()); } - -GdkWindow * -gdk_directfb_window_new (GdkWindow *parent, - GdkWindowAttr *attributes, - gint attributes_mask, - DFBWindowCapabilities window_caps, - DFBWindowOptions window_options, - DFBSurfaceCapabilities surface_caps) -{ - GdkWindow *window; - GdkWindowObject *private; - GdkWindowObject *parent_private; - GdkWindowImplDirectFB *impl; - GdkWindowImplDirectFB *parent_impl; - GdkVisual *visual; - DFBWindowDescription desc; - gint x, y; - - g_return_val_if_fail (attributes != NULL, NULL); - - D_DEBUG_AT( GDKDFB_Window, "%s( %p )\n", G_STRFUNC, parent ); - - if (!parent || attributes->window_type != GDK_WINDOW_CHILD) - parent = _gdk_parent_root; - - window = g_object_new (GDK_TYPE_WINDOW, NULL); - private = GDK_WINDOW_OBJECT (window); - private->impl = g_object_new (_gdk_window_impl_get_type (), NULL); - - parent_private = GDK_WINDOW_OBJECT (parent); - parent_impl = GDK_WINDOW_IMPL_DIRECTFB (parent_private->impl); - private->parent = parent_private; - - x = (attributes_mask & GDK_WA_X) ? attributes->x : 0; - y = (attributes_mask & GDK_WA_Y) ? attributes->y : 0; - - gdk_window_set_events (window, attributes->event_mask | GDK_STRUCTURE_MASK); - - impl = GDK_WINDOW_IMPL_DIRECTFB (private->impl); - impl->drawable.wrapper = GDK_DRAWABLE (window); - impl->gdkWindow = window; - - private->x = x; - private->y = y; - - _gdk_directfb_calc_abs (window); - - impl->drawable.width = MAX (1, attributes->width); - impl->drawable.height = MAX (1, attributes->height); - - private->window_type = attributes->window_type; - - desc.flags = 0; - - if (attributes_mask & GDK_WA_VISUAL) - visual = attributes->visual; - else - visual = gdk_drawable_get_visual (parent); - - switch (attributes->wclass) - { - case GDK_INPUT_OUTPUT: - private->input_only = FALSE; - - desc.flags |= DWDESC_PIXELFORMAT; - desc.pixelformat = ((GdkVisualDirectFB *) visual)->format; - - if (DFB_PIXELFORMAT_HAS_ALPHA (desc.pixelformat)) - { - desc.flags |= DWDESC_CAPS; - desc.caps = DWCAPS_ALPHACHANNEL; - } - break; - - case GDK_INPUT_ONLY: - private->input_only = TRUE; - desc.flags |= DWDESC_CAPS; - desc.caps = DWCAPS_INPUTONLY; - break; - - default: - g_warning ("gdk_window_new: unsupported window class\n"); - _gdk_window_destroy (window, FALSE); - return NULL; - } - - switch (private->window_type) - { - case GDK_WINDOW_TOPLEVEL: - case GDK_WINDOW_DIALOG: - case GDK_WINDOW_TEMP: - desc.flags |= ( DWDESC_WIDTH | DWDESC_HEIGHT | - DWDESC_POSX | DWDESC_POSY ); - desc.posx = x; - desc.posy = y; - desc.width = impl->drawable.width; - desc.height = impl->drawable.height; - -#if 0 - if (window_caps) - { - if (! (desc.flags & DWDESC_CAPS)) - { - desc.flags |= DWDESC_CAPS; - desc.caps = DWCAPS_NONE; - } - - desc.caps |= window_caps; - } - - if (surface_caps) - { - desc.flags |= DWDESC_SURFACE_CAPS; - desc.surface_caps = surface_caps; - } -#endif - - if (!create_directfb_window (impl, &desc, window_options)) - { - g_assert(0); - _gdk_window_destroy (window, FALSE); - - return NULL; - } - - if (desc.caps != DWCAPS_INPUTONLY) - { - impl->window->SetOpacity(impl->window, 0x00 ); - } - - break; - - case GDK_WINDOW_CHILD: - impl->window=NULL; - - if (!private->input_only && parent_impl->drawable.surface) - { - - DFBRectangle rect = - { x, y, impl->drawable.width, impl->drawable.height }; - parent_impl->drawable.surface->GetSubSurface (parent_impl->drawable.surface, - &rect, - &impl->drawable.surface); - } - - break; - - default: - g_warning ("gdk_window_new: unsupported window type: %d", - private->window_type); - _gdk_window_destroy (window, FALSE); - - return NULL; - } - - if (impl->drawable.surface) - { - GdkColormap *colormap; - - impl->drawable.surface->GetPixelFormat (impl->drawable.surface, - &impl->drawable.format); - - private->depth = DFB_BITS_PER_PIXEL(impl->drawable.format); - - if ((attributes_mask & GDK_WA_COLORMAP) && attributes->colormap) - { - colormap = attributes->colormap; - } - else - { - if (gdk_visual_get_system () == visual) - colormap = gdk_colormap_get_system (); - else - colormap =gdk_drawable_get_colormap (parent); - } - - gdk_drawable_set_colormap (GDK_DRAWABLE (window), colormap); - } - else - { - impl->drawable.format = ((GdkVisualDirectFB *)visual)->format; - private->depth = visual->depth; - } - - gdk_window_set_cursor (window, ((attributes_mask & GDK_WA_CURSOR) ? - (attributes->cursor) : NULL)); - - if (parent_private) - parent_private->children = g_list_prepend (parent_private->children, - window); - - /* we hold a reference count on ourselves */ - g_object_ref (window); - - if (impl->window) - { - impl->window->GetID (impl->window, &impl->dfb_id); - gdk_directfb_window_id_table_insert (impl->dfb_id, window); - gdk_directfb_event_windows_add (window); - } - - if (attributes_mask & GDK_WA_TYPE_HINT) - gdk_window_set_type_hint (window, attributes->type_hint); - - return window; -} - - void _gdk_window_impl_new (GdkWindow *window, GdkWindow *real_parent, @@ -1734,26 +1526,6 @@ gdk_window_directfb_lower (GdkWindow *window) } } -void -gdk_window_set_hints (GdkWindow *window, - gint x, - gint y, - gint min_width, - gint min_height, - gint max_width, - gint max_height, - gint flags) -{ - g_return_if_fail (GDK_IS_WINDOW (window)); - - if (GDK_WINDOW_DESTROYED (window)) - return; - - D_DEBUG_AT( GDKDFB_Window, "%s( %p, %3d,%3d, min %4dx%4d, max %4dx%4d, flags 0x%08x )\n", G_STRFUNC, - window, x,y, min_width, min_height, max_width, max_height, flags ); - /* N/A */ -} - void gdk_window_set_geometry_hints (GdkWindow *window, const GdkGeometry *geometry, diff --git a/gdk/gdk.c b/gdk/gdk.c index 110d662dc7..89a4e2f8e8 100644 --- a/gdk/gdk.c +++ b/gdk/gdk.c @@ -386,31 +386,6 @@ gdk_init (int *argc, char ***argv) } } -/* - *-------------------------------------------------------------- - * gdk_exit - * - * Restores the library to an un-itialized state and exits - * the program using the "exit" system call. - * - * Arguments: - * "errorcode" is the error value to pass to "exit". - * - * Results: - * Allocated structures are freed and the program exits - * cleanly. - * - * Side effects: - * - *-------------------------------------------------------------- - */ - -void -gdk_exit (gint errorcode) -{ - exit (errorcode); -} - void gdk_threads_enter (void) { @@ -812,5 +787,28 @@ gdk_set_program_class (const char *program_class) gdk_progclass = g_strdup (program_class); } +/** + * gdk_enable_multidevice: + * + * Enables multidevice support in GDK. This call must happen prior + * to gdk_display_open(), gtk_init(), gtk_init_with_args() or + * gtk_init_check() in order to take effect. + * + * Note that individual #GdkWindows still need to explicitly + * enable multidevice awareness through gdk_window_set_support_multidevice(). + * + * This function must be called before initializing GDK. + * + * Since: 3.0 + **/ +void +gdk_enable_multidevice (void) +{ + if (gdk_initialized) + return; + + _gdk_enable_multidevice = TRUE; +} + #define __GDK_C__ #include "gdkaliasdef.c" diff --git a/gdk/gdk.h b/gdk/gdk.h index d834bb1622..89a9a8b4a6 100644 --- a/gdk/gdk.h +++ b/gdk/gdk.h @@ -33,6 +33,8 @@ #include #include #include +#include +#include #include #include #include @@ -66,6 +68,7 @@ G_BEGIN_DECLS /* Initialization, exit and events */ #define GDK_PRIORITY_EVENTS (G_PRIORITY_DEFAULT) +void gdk_enable_multidevice (void); void gdk_parse_args (gint *argc, gchar ***argv); void gdk_init (gint *argc, @@ -75,9 +78,6 @@ gboolean gdk_init_check (gint *argc, void gdk_add_option_entries_libgtk_only (GOptionGroup *group); void gdk_pre_parse_libgtk_only (void); -#ifndef GDK_DISABLE_DEPRECATED -void gdk_exit (gint error_code); -#endif /* GDK_DISABLE_DEPRECATED */ gchar* gdk_set_locale (void); G_CONST_RETURN char *gdk_get_program_class (void); @@ -88,11 +88,6 @@ void gdk_set_program_class (const char *program_class); void gdk_error_trap_push (void); gint gdk_error_trap_pop (void); -#ifndef GDK_DISABLE_DEPRECATED -void gdk_set_use_xshm (gboolean use_xshm); -gboolean gdk_get_use_xshm (void); -#endif /* GDK_DISABLE_DEPRECATED */ - gchar* gdk_get_display (void); G_CONST_RETURN gchar* gdk_get_display_arg_name (void); @@ -112,6 +107,7 @@ gint gdk_input_add (gint source, void gdk_input_remove (gint tag); #endif /* GDK_DISABLE_DEPRECATED */ +#ifndef GDK_MULTIDEVICE_SAFE GdkGrabStatus gdk_pointer_grab (GdkWindow *window, gboolean owner_events, GdkEventMask event_mask, @@ -121,18 +117,15 @@ GdkGrabStatus gdk_pointer_grab (GdkWindow *window, GdkGrabStatus gdk_keyboard_grab (GdkWindow *window, gboolean owner_events, guint32 time_); - -gboolean gdk_pointer_grab_info_libgtk_only (GdkDisplay *display, - GdkWindow **grab_window, - gboolean *owner_events); -gboolean gdk_keyboard_grab_info_libgtk_only (GdkDisplay *display, - GdkWindow **grab_window, - gboolean *owner_events); +#endif /* GDK_MULTIDEVICE_SAFE */ #ifndef GDK_MULTIHEAD_SAFE + +#ifndef GDK_MULTIDEVICE_SAFE void gdk_pointer_ungrab (guint32 time_); void gdk_keyboard_ungrab (guint32 time_); gboolean gdk_pointer_is_grabbed (void); +#endif /* GDK_MULTIDEVICE_SAFE */ gint gdk_screen_width (void) G_GNUC_CONST; gint gdk_screen_height (void) G_GNUC_CONST; diff --git a/gdk/gdk.symbols b/gdk/gdk.symbols index bb6e2b2475..35676067cf 100644 --- a/gdk/gdk.symbols +++ b/gdk/gdk.symbols @@ -19,16 +19,6 @@ #define IN_HEADER(x) 1 #endif -#if IN_HEADER(__GDK_EVENTS_H__) -#if IN_FILE(__GDK_EVENTS_X11_C__) -gdk_add_client_message_filter -#ifndef GDK_DISABLE_DEPRECATED -gdk_event_get_graphics_expose -#endif -gdk_events_pending -#endif -#endif - #if IN_HEADER(__GDK_TEST_UTILS_H__) #if IN_FILE(__GDK_TEST_UTILS_X11_C__) gdk_test_simulate_button @@ -44,6 +34,7 @@ gdk_event_free gdk_event_get gdk_event_get_axis gdk_event_get_coords +gdk_event_get_device gdk_event_get_root_coords gdk_event_get_screen gdk_event_get_state @@ -54,23 +45,73 @@ gdk_event_new gdk_event_peek gdk_event_put gdk_event_request_motions +gdk_event_set_device gdk_event_set_screen +gdk_events_get_distance +gdk_events_get_angle +gdk_events_get_center gdk_get_show_events gdk_set_show_events gdk_setting_get #endif #endif +#if IN_HEADER(__GDK_EVENTS_H__) +#if IN_FILE(__GDK_DISPLAY_X11_C__) +gdk_add_client_message_filter +#endif +#endif + +#if IN_HEADER(__GDK_EVENTS_H__) +#if IN_FILE(__GDK_EVENT_SOURCE_C__) +gdk_events_pending +#endif +#endif + +#if IN_HEADER(__GDK_EVENT_TRANSLATOR_H__) +#if IN_FILE(__GDK_EVENT_TRANSLATOR_C__) +#ifdef GDK_WINDOWING_X11 +gdk_event_translator_get_type G_GNUC_CONST +gdk_event_translator_translate +gdk_event_translator_get_handled_events +gdk_event_translator_select_window_events +#endif +#endif +#endif + +#if IN_HEADER(__GDK_DEVICE_MANAGER_CORE_H__) +#if IN_FILE(__GDK_DEVICE_MANAGER_CORE_C__) +#ifdef GDK_WINDOWING_X11 +gdk_device_manager_core_get_type +#endif +#endif +#endif + +#if IN_HEADER(__GDK_DEVICE_MANAGER_XI2_H__) +#if IN_FILE(__GDK_DEVICE_MANAGER_XI2_C__) +#ifdef GDK_WINDOWING_X11 +#ifdef XINPUT_2 +gdk_device_manager_xi2_get_type +#endif +#endif +#endif +#endif + +#if IN_HEADER(__GDK_DEVICE_MANAGER_XI_H__) +#if IN_FILE(__GDK_DEVICE_MANAGER_XI_C__) +#ifdef GDK_WINDOWING_X11 +#ifdef XINPUT_XFREE +gdk_device_manager_xi_get_type +#endif +#endif +#endif +#endif + #if IN_HEADER(__GDK_H__) #if IN_FILE(__GDK_MAIN_X11_C__) gdk_error_trap_pop gdk_error_trap_push gdk_get_display -#ifndef GDK_DISABLE_DEPRECATED -gdk_get_use_xshm -gdk_set_use_xshm -#endif -gdk_keyboard_grab #endif #endif @@ -78,17 +119,24 @@ gdk_keyboard_grab #if IN_HEADER(__GDK_H__) #if IN_FILE(__GDK_DISPLAY_C__) gdk_beep +#ifndef GDK_MULTIDEVICE_SAFE +#ifndef GDK_DISABLE_DEPRECATED +#ifndef GDK_MULTIHEAD_SAFE +gdk_device_get_core_pointer gdk_set_pointer_hooks +#endif +#endif gdk_keyboard_ungrab gdk_pointer_is_grabbed gdk_pointer_ungrab +#endif gdk_event_send_client_message gdk_event_send_clientmessage_toall -gdk_keyboard_grab_info_libgtk_only -gdk_pointer_grab_info_libgtk_only +#ifndef GDK_MULTIDEVICE_SAFE gdk_display_pointer_is_grabbed #endif #endif +#endif #if IN_HEADER(__GDK_H__) #if IN_FILE(__GDK_IM_X11_C__) @@ -101,14 +149,12 @@ gdk_set_locale #endif #if IN_HEADER(__GDK_H__) -#if IN_FILE(__GDK_EVENTS_X11_C__) +#if IN_FILE(__GDK_DISPLAY_X11_C__) +#ifndef GDK_DISABLE_DEPRECATED +gdk_display_list_devices +#endif gdk_event_send_client_message_for_display gdk_flush -#endif -#endif - -#if IN_HEADER(__GDK_H__) -#if IN_FILE(__GDK_DISPLAY_X11_C__) gdk_notify_startup_complete gdk_notify_startup_complete_with_id #endif @@ -135,9 +181,7 @@ gdk_get_display_arg_name gdk_get_program_class gdk_init gdk_init_check -#ifndef GDK_DISABLE_DEPRECATED -gdk_exit -#endif +gdk_enable_multidevice gdk_pre_parse_libgtk_only gdk_parse_args gdk_set_program_class @@ -173,6 +217,14 @@ gdk_screen_height_mm G_GNUC_CONST #endif #endif +#if IN_HEADER(__GDK_H__) +#if IN_FILE(__GDK_WINDOW_C__) +#ifndef GDK_MULTIDEVICE_SAFE +gdk_keyboard_grab +#endif +#endif +#endif + #if IN_HEADER(__GDK_PROPERTY_H__) #if IN_FILE(__GDK_SELECTION_C__) gdk_string_to_compound_text @@ -216,6 +268,7 @@ gdk_axis_use_get_type G_GNUC_CONST gdk_byte_order_get_type G_GNUC_CONST gdk_cap_style_get_type G_GNUC_CONST gdk_crossing_mode_get_type G_GNUC_CONST +gdk_device_type_get_type G_GNUC_CONST gdk_extension_mode_get_type G_GNUC_CONST gdk_event_mask_get_type G_GNUC_CONST gdk_event_type_get_type G_GNUC_CONST @@ -223,6 +276,7 @@ gdk_fill_get_type G_GNUC_CONST gdk_fill_rule_get_type G_GNUC_CONST gdk_filter_return_get_type G_GNUC_CONST gdk_function_get_type G_GNUC_CONST +gdk_grab_ownership_get_type G_GNUC_CONST gdk_grab_status_get_type G_GNUC_CONST gdk_gravity_get_type G_GNUC_CONST gdk_join_style_get_type G_GNUC_CONST @@ -312,12 +366,6 @@ gdk_cairo_region #if IN_HEADER(__GDK_COLOR_H__) #if IN_FILE(__GDK_COLOR_C__) -#ifndef GDK_DISABLE_DEPRECATED -gdk_colors_store -gdk_color_white -gdk_color_black -gdk_color_alloc -#endif gdk_color_copy gdk_color_equal gdk_color_free @@ -326,10 +374,6 @@ gdk_color_hash gdk_colormap_alloc_color gdk_colormap_get_system gdk_colormap_get_visual -#ifndef GDK_DISABLE_DEPRECATED -gdk_colormap_ref -gdk_colormap_unref -#endif gdk_color_parse gdk_color_to_string #endif @@ -339,13 +383,6 @@ gdk_color_to_string #if IN_FILE(__GDK_COLOR_X11_C__) gdk_colormap_new gdk_colormap_get_type G_GNUC_CONST -#ifndef GDK_DISABLE_DEPRECATED -gdk_colormap_change -gdk_colors_alloc -gdk_colors_free -gdk_colormap_get_system_size -gdk_color_change -#endif gdk_colormap_alloc_colors gdk_colormap_free_colors gdk_colormap_query_color @@ -373,70 +410,99 @@ gdk_cursor_get_image #endif #endif -#if IN_HEADER(__GDK_INPUT_H__) -#if IN_FILE(__GDK_INPUT_C__) +#if IN_HEADER(__GDK_DEVICE_MANAGER_H__) +#if IN_FILE(__GDK_DEVICE_MANAGER_C__) +gdk_device_manager_get_display +gdk_device_manager_get_type G_GNUC_CONST +gdk_device_manager_list_devices +#endif +#endif + +#if IN_HEADER(__GDK_DEVICE_H__) +#if IN_FILE(__GDK_DEVICE_C__) gdk_device_free_history +gdk_device_get_associated_device gdk_device_get_axis +gdk_device_get_axis_use +gdk_device_get_axis_value +gdk_device_get_device_type +gdk_device_get_display +gdk_device_get_has_cursor gdk_device_get_history +gdk_device_get_key +gdk_device_get_mode +gdk_device_get_n_axes +gdk_device_get_name +gdk_device_get_source gdk_device_get_type G_GNUC_CONST +gdk_device_get_state +gdk_device_list_axes gdk_device_set_axis_use gdk_device_set_key +gdk_device_set_mode gdk_device_set_source +gdk_device_grab +#endif +#endif + +#if IN_HEADER(__GDK_DEVICE_H__) +#if IN_FILE(__GDK_DISPLAY_X11_C__) +gdk_device_ungrab +#endif +#endif + +#if IN_HEADER(__GDK_DEVICE_H__) +#if IN_FILE(__GDK_DISPLAY_C__) +gdk_device_grab_info_libgtk_only +#endif +#endif + +#if IN_HEADER(__GDK_INPUT_H__) +#if IN_FILE(__GDK_INPUT_C__) +#ifndef GDK_DISABLE_DEPRECATED +#ifndef GDK_MULTIDEVICE_SAFE +#ifndef GDK_MULTIHEAD_SAFE gdk_devices_list +#endif gdk_input_set_extension_events #endif #endif - -#if IN_HEADER(__GDK_INPUT_H__) -#if IN_FILE(__GDK_DISPLAY_C__) -gdk_device_get_core_pointer -#endif -#endif - -#if IN_HEADER(__GDK_INPUT_H__) -#if IN_FILE(__GDK_INPUT_X11_C__) -gdk_device_get_state -#endif -#endif - -#if IN_HEADER(__GDK_INPUT_H__) -#if IN_FILE(__GDK_INPUT_XFREE_C__) -gdk_device_set_mode -#endif -#endif - -#if IN_HEADER(__GDK_INPUT_H__) -#if IN_FILE(__GDK_INPUT_NONE_C__) -gdk_device_get_state -gdk_device_set_mode -#endif -#endif - -#if IN_HEADER(__GDK_DISPLAY_H__) -#if IN_FILE(__GDK_EVENTS_X11_C__) -gdk_display_add_client_message_filter #endif #endif #if IN_HEADER(__GDK_DISPLAY_H__) #if IN_FILE(__GDK_DISPLAY_C__) gdk_display_close -gdk_display_get_core_pointer gdk_display_get_event -gdk_display_get_pointer +gdk_display_get_device_manager +gdk_display_get_device_state gdk_display_get_type G_GNUC_CONST -gdk_display_get_window_at_pointer +gdk_display_get_window_at_device_position gdk_display_peek_event gdk_display_put_event +#ifndef GDK_MULTIDEVICE_SAFE +gdk_display_get_pointer +gdk_display_get_window_at_pointer +gdk_display_keyboard_ungrab +gdk_display_pointer_ungrab gdk_display_set_pointer_hooks +gdk_display_set_device_hooks +gdk_display_device_is_grabbed +#ifndef GDK_DISABLE_DEPRECATED +gdk_display_get_core_pointer +#endif +#endif #endif #endif #if IN_HEADER(__GDK_DISPLAY_H__) #if IN_FILE(__GDK_WINDOW_X11_C__) +gdk_display_warp_device +#ifndef GDK_MULTIDEVICE_SAFE gdk_display_warp_pointer #endif #endif +#endif #if IN_HEADER(__GDK_DISPLAY_H__) #if IN_FILE(__GDK_DISPLAY_MANAGER_C__) @@ -455,6 +521,7 @@ gdk_display_supports_cursor_color #if IN_HEADER(__GDK_DISPLAY_H__) #if IN_FILE(__GDK_DISPLAY_X11_C__) +gdk_display_add_client_message_filter gdk_display_beep gdk_display_sync gdk_display_flush @@ -463,8 +530,6 @@ gdk_display_get_default_screen gdk_display_get_name gdk_display_get_n_screens gdk_display_get_screen -gdk_display_pointer_ungrab -gdk_display_keyboard_ungrab gdk_display_open gdk_display_request_selection_notification gdk_display_store_clipboard @@ -476,12 +541,6 @@ gdk_display_supports_composite #endif #endif -#if IN_HEADER(__GDK_DISPLAY_H__) -#if IN_FILE(__GDK_INPUT_C__) -gdk_display_list_devices -#endif -#endif - #if IN_HEADER(__GDK_DISPLAY_H__) #if IN_FILE(__GDK_C__) gdk_display_open_default_libgtk_only @@ -511,10 +570,8 @@ gdk_drag_abort gdk_drag_begin gdk_drag_context_get_type G_GNUC_CONST gdk_drag_context_new -#ifndef GDK_DISABLE_DEPRECATED -gdk_drag_context_ref -gdk_drag_context_unref -#endif +gdk_drag_context_get_device +gdk_drag_context_set_device gdk_drag_drop gdk_drag_drop_succeeded gdk_drag_find_window_for_screen @@ -529,6 +586,10 @@ gdk_drop_reply #if IN_HEADER(__GDK_DND_H__) #if IN_FILE(__GDK_DND_C__) +gdk_drag_context_get_actions +gdk_drag_context_get_selected_action +gdk_drag_context_get_suggested_action +gdk_drag_context_list_targets gdk_drag_find_window gdk_drag_get_protocol #endif @@ -588,11 +649,6 @@ gdk_draw_layout_with_colors gdk_gc_new gdk_gc_get_type G_GNUC_CONST gdk_gc_new_with_values -#ifndef GDK_DISABLE_DEPRECATED -gdk_gc_ref -gdk_gc_unref -gdk_gc_set_font -#endif gdk_gc_get_values gdk_gc_set_values gdk_gc_set_foreground @@ -659,14 +715,22 @@ gdk_window_resize gdk_window_move_resize gdk_window_scroll gdk_window_move_region -gdk_window_set_background -gdk_window_set_back_pixmap -gdk_window_set_cursor +gdk_window_get_accept_focus +gdk_window_get_back_pixmap +gdk_window_get_background +gdk_window_get_composited gdk_window_get_cursor +gdk_window_get_focus_on_map gdk_window_get_geometry +gdk_window_get_modal_hint gdk_window_get_origin gdk_window_get_root_coords gdk_window_get_deskrelative_origin +gdk_window_set_support_multidevice +gdk_window_get_support_multidevice +gdk_window_set_background +gdk_window_set_back_pixmap +gdk_window_set_cursor gdk_window_shape_combine_mask gdk_window_shape_combine_region gdk_window_set_child_shapes @@ -678,7 +742,9 @@ gdk_window_merge_child_input_shapes gdk_window_set_static_gravities gdk_window_reparent gdk_window_add_filter +#ifndef GDK_MULTIDEVICE_SAFE gdk_window_at_pointer +#endif gdk_window_begin_paint_rect gdk_window_begin_paint_region gdk_window_clear @@ -697,21 +763,22 @@ gdk_window_get_children gdk_window_get_internal_paint_info gdk_window_get_parent gdk_window_get_effective_parent +#ifndef GDK_MULTIDEVICE_SAFE gdk_window_get_pointer +#endif gdk_window_get_position gdk_window_get_state gdk_window_get_toplevel gdk_window_get_effective_toplevel -#ifndef GDK_DISABLE_DEPRECATED -gdk_window_get_toplevels -#endif gdk_window_get_update_area gdk_window_get_user_data gdk_window_get_window_type -gdk_window_is_destroyed gdk_window_invalidate_maybe_recurse gdk_window_invalidate_rect gdk_window_invalidate_region +gdk_window_is_destroyed +gdk_window_is_input_only +gdk_window_is_shaped gdk_window_is_viewable gdk_window_is_visible gdk_window_object_get_type G_GNUC_CONST @@ -726,10 +793,17 @@ gdk_window_set_user_data gdk_window_thaw_toplevel_updates_libgtk_only gdk_window_thaw_updates gdk_window_set_composited +#ifndef GDK_MULTIDEVICE_SAFE gdk_pointer_grab +#endif gdk_window_beep gdk_window_geometry_changed gdk_window_ensure_native +gdk_window_set_device_events +gdk_window_get_device_events +gdk_window_set_device_cursor +gdk_window_get_device_cursor +gdk_window_get_device_position #endif #endif @@ -759,9 +833,6 @@ gdk_window_foreign_new_for_display gdk_window_focus gdk_window_lookup gdk_window_lookup_for_display -#ifndef GDK_DISABLE_DEPRECATED -gdk_window_set_hints -#endif gdk_window_get_type_hint gdk_window_set_type_hint gdk_window_set_modal_hint @@ -806,22 +877,23 @@ gdk_window_configure_finished #if IN_HEADER(__GDK_IMAGE_H__) #if IN_FILE(__GDK_IMAGE_C__) -#ifndef GDK_DISABLE_DEPRECATED -gdk_image_ref -gdk_image_unref -gdk_image_get -#endif -gdk_image_set_colormap +gdk_image_get_bits_per_pixel +gdk_image_get_bytes_per_pixel +gdk_image_get_bytes_per_line +gdk_image_get_byte_order gdk_image_get_colormap +gdk_image_get_depth +gdk_image_get_height +gdk_image_get_image_type +gdk_image_get_visual +gdk_image_get_width +gdk_image_set_colormap gdk_image_new #endif #endif #if IN_HEADER(__GDK_IMAGE_H__) #if IN_FILE(__GDK_IMAGE_X11_C__) -#ifdef GDK_ENABLE_BROKEN -gdk_image_new_bitmap -#endif gdk_image_get_pixel gdk_image_put_pixel gdk_image_get_type G_GNUC_CONST @@ -883,7 +955,15 @@ gdk_keyval_name G_GNUC_CONST #if IN_HEADER(__GDK_VISUAL_H__) #if IN_FILE(__GDK_VISUAL_C__) gdk_list_visuals +gdk_visual_get_bits_per_rgb +gdk_visual_get_blue_pixel_details +gdk_visual_get_byte_order +gdk_visual_get_colormap_size +gdk_visual_get_depth +gdk_visual_get_green_pixel_details +gdk_visual_get_red_pixel_details gdk_visual_get_system +gdk_visual_get_visual_type #endif #endif @@ -902,12 +982,6 @@ gdk_visual_get_type G_GNUC_CONST #endif #endif -#if IN_HEADER(__GDK_X_H__) -#if IN_FILE(__GDK_EVENTS_X11_C__) -gdk_net_wm_supports -#endif -#endif - #if IN_HEADER(__GDK_PANGO_H__) #if IN_FILE(__GDK_PANGO_C__) gdk_pango_attr_emboss_color_new @@ -915,9 +989,6 @@ gdk_pango_attr_embossed_new gdk_pango_attr_stipple_new gdk_pango_context_get gdk_pango_context_get_for_screen -#ifndef GDK_DISABLE_DEPRECATED -gdk_pango_context_set_colormap -#endif gdk_pango_layout_get_clip_region gdk_pango_layout_line_get_clip_region gdk_pango_renderer_get_default @@ -942,10 +1013,6 @@ gdk_pixbuf_get_from_image gdk_pixbuf_render_pixmap_and_mask gdk_pixbuf_render_pixmap_and_mask_for_colormap gdk_pixbuf_render_threshold_alpha -#ifndef GDK_DISABLE_DEPRECATED -gdk_pixbuf_render_to_drawable -gdk_pixbuf_render_to_drawable_alpha -#endif #endif #endif @@ -1011,12 +1078,6 @@ gdk_rgb_ditherable gdk_rgb_find_color gdk_rgb_get_colormap gdk_rgb_get_visual -#ifndef GDK_DISABLE_DEPRECATED -gdk_rgb_init -gdk_rgb_xpixel_from_rgb G_GNUC_CONST -gdk_rgb_gc_set_background -gdk_rgb_gc_set_foreground -#endif gdk_rgb_set_install gdk_rgb_set_min_colors gdk_rgb_set_verbose @@ -1054,13 +1115,6 @@ gdk_screen_get_rgb_visual #endif #endif -#if IN_HEADER(__GDK_SCREEN_H__) -#if IN_FILE(__GDK_EVENTS_X11_C__) -gdk_screen_get_setting -gdk_screen_broadcast_client_message -#endif -#endif - #if IN_HEADER(__GDK_SCREEN_H__) #if IN_FILE(__GDK_VISUAL_X11_C__) gdk_screen_get_system_visual @@ -1076,6 +1130,7 @@ gdk_screen_get_toplevel_windows #if IN_HEADER(__GDK_SCREEN_H__) #if IN_FILE(__GDK_SCREEN_X11_C__) +gdk_screen_broadcast_client_message gdk_screen_get_display gdk_screen_get_width gdk_screen_get_width_mm @@ -1084,6 +1139,7 @@ gdk_screen_get_height_mm gdk_screen_get_number gdk_screen_get_primary_monitor gdk_screen_get_root_window +gdk_screen_get_setting gdk_screen_get_default_colormap gdk_screen_set_default_colormap gdk_screen_get_n_monitors @@ -1207,9 +1263,6 @@ gdk_x11_xatom_to_atom_for_display gdk_x11_colormap_foreign_new gdk_x11_colormap_get_xcolormap gdk_x11_colormap_get_xdisplay -#ifdef GDK_ENABLE_BROKEN -gdkx_colormap_get -#endif #endif #if IN_FILE(__GDK_CURSOR_X11_C__) @@ -1226,6 +1279,7 @@ gdk_x11_display_ungrab gdk_x11_lookup_xdisplay gdk_x11_display_broadcast_startup_message gdk_x11_display_get_startup_notification_id +gdk_x11_register_standard_event_type #endif #if IN_FILE(__GDK_DRAWABLE_X11_C__) @@ -1256,22 +1310,18 @@ gdk_x11_grab_server gdk_x11_ungrab_server #endif -#if IN_FILE(__GDK_EVENTS_X11_C__) -gdk_x11_get_server_time -gdk_x11_register_standard_event_type -gdk_x11_screen_get_window_manager_name -gdk_x11_screen_supports_net_wm_hint -#endif - #if IN_FILE(__GDK_IMAGE_X11_C__) gdk_x11_image_get_xdisplay gdk_x11_image_get_ximage #endif #if IN_FILE(__GDK_SCREEN_X11_C__) +gdk_net_wm_supports gdk_x11_screen_get_screen_number +gdk_x11_screen_get_window_manager_name gdk_x11_screen_get_xscreen gdk_x11_screen_get_monitor_output +gdk_x11_screen_supports_net_wm_hint #endif #if IN_FILE(__GDK_VISUAL_X11_C__) @@ -1281,6 +1331,7 @@ gdkx_visual_get #endif #if IN_FILE(__GDK_WINDOW_X11_C__) +gdk_x11_get_server_time gdk_x11_window_set_user_time gdk_x11_window_move_to_current_desktop #endif diff --git a/gdk/gdkcairo.h b/gdk/gdkcairo.h index 8bddd48c2a..bc2153d7b3 100644 --- a/gdk/gdkcairo.h +++ b/gdk/gdkcairo.h @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) +#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gdk/gdkcolor.c b/gdk/gdkcolor.c index b718038d27..3789436288 100644 --- a/gdk/gdkcolor.c +++ b/gdk/gdkcolor.c @@ -32,36 +32,6 @@ #include "gdkinternals.h" #include "gdkalias.h" -/** - * gdk_colormap_ref: - * @cmap: a #GdkColormap - * - * Deprecated function; use g_object_ref() instead. - * - * Return value: the colormap - * - * Deprecated: 2.0: Use g_object_ref() instead. - **/ -GdkColormap* -gdk_colormap_ref (GdkColormap *cmap) -{ - return (GdkColormap *) g_object_ref (cmap); -} - -/** - * gdk_colormap_unref: - * @cmap: a #GdkColormap - * - * Deprecated function; use g_object_unref() instead. - * - * Deprecated: 2.0: Use g_object_unref() instead. - **/ -void -gdk_colormap_unref (GdkColormap *cmap) -{ - g_object_unref (cmap); -} - /** * gdk_colormap_get_visual: @@ -79,34 +49,6 @@ gdk_colormap_get_visual (GdkColormap *colormap) return colormap->visual; } -/** - * gdk_colors_store: - * @colormap: a #GdkColormap. - * @colors: the new color values. - * @ncolors: the number of colors to change. - * - * Changes the value of the first @ncolors colors in - * a private colormap. This function is obsolete and - * should not be used. See gdk_color_change(). - **/ -void -gdk_colors_store (GdkColormap *colormap, - GdkColor *colors, - gint ncolors) -{ - gint i; - - for (i = 0; i < ncolors; i++) - { - colormap->colors[i].pixel = colors[i].pixel; - colormap->colors[i].red = colors[i].red; - colormap->colors[i].green = colors[i].green; - colormap->colors[i].blue = colors[i].blue; - } - - gdk_colormap_change (colormap, ncolors); -} - /** * gdk_color_copy: * @color: a #GdkColor. @@ -143,70 +85,6 @@ gdk_color_free (GdkColor *color) g_slice_free (GdkColor, color); } -/** - * gdk_color_white: - * @colormap: a #GdkColormap. - * @color: the location to store the color. - * - * Returns the white color for a given colormap. The resulting - * value has already allocated been allocated. - * - * Return value: %TRUE if the allocation succeeded. - **/ -gboolean -gdk_color_white (GdkColormap *colormap, - GdkColor *color) -{ - gint return_val; - - g_return_val_if_fail (colormap != NULL, FALSE); - - if (color) - { - color->red = 65535; - color->green = 65535; - color->blue = 65535; - - return_val = gdk_colormap_alloc_color (colormap, color, FALSE, TRUE); - } - else - return_val = FALSE; - - return return_val; -} - -/** - * gdk_color_black: - * @colormap: a #GdkColormap. - * @color: the location to store the color. - * - * Returns the black color for a given colormap. The resulting - * value has already been allocated. - * - * Return value: %TRUE if the allocation succeeded. - **/ -gboolean -gdk_color_black (GdkColormap *colormap, - GdkColor *color) -{ - gint return_val; - - g_return_val_if_fail (colormap != NULL, FALSE); - - if (color) - { - color->red = 0; - color->green = 0; - color->blue = 0; - - return_val = gdk_colormap_alloc_color (colormap, color, FALSE, TRUE); - } - else - return_val = FALSE; - - return return_val; -} - /******************** * Color allocation * ********************/ @@ -217,14 +95,13 @@ gdk_color_black (GdkColormap *colormap, * @color: the color to allocate. On return the * pixel field will be * filled in if allocation succeeds. - * @writeable: If %TRUE, the color is allocated writeable - * (their values can later be changed using gdk_color_change()). - * Writeable colors cannot be shared between applications. + * @writeable: this parameter has no effect, and it's here for mere + * compatibility. * @best_match: If %TRUE, GDK will attempt to do matching against * existing colors if the color cannot be allocated as requested. * * Allocates a single color from a colormap. - * + * * Return value: %TRUE if the allocation succeeded. **/ gboolean @@ -241,29 +118,6 @@ gdk_colormap_alloc_color (GdkColormap *colormap, return success; } -/** - * gdk_color_alloc: - * @colormap: a #GdkColormap. - * @color: The color to allocate. On return, the - * pixel field will be filled in. - * - * Allocates a single color from a colormap. - * - * Return value: %TRUE if the allocation succeeded. - * - * Deprecated: 2.2: Use gdk_colormap_alloc_color() instead. - **/ -gboolean -gdk_color_alloc (GdkColormap *colormap, - GdkColor *color) -{ - gboolean success; - - gdk_colormap_alloc_colors (colormap, color, 1, FALSE, TRUE, &success); - - return success; -} - /** * gdk_color_hash: * @colora: a #GdkColor. diff --git a/gdk/gdkcolor.h b/gdk/gdkcolor.h index 54fc3015c3..1312991e16 100644 --- a/gdk/gdkcolor.h +++ b/gdk/gdkcolor.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) +#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) #error "Only can be included directly." #endif @@ -71,13 +71,13 @@ struct _GdkColormap GObject parent_instance; /*< public >*/ - gint size; - GdkColor *colors; + gint GSEAL (size); + GdkColor *GSEAL (colors); /*< private >*/ - GdkVisual *visual; + GdkVisual *GSEAL (visual); - gpointer windowing_data; + gpointer GSEAL (windowing_data); }; struct _GdkColormapClass @@ -91,27 +91,12 @@ GType gdk_colormap_get_type (void) G_GNUC_CONST; GdkColormap* gdk_colormap_new (GdkVisual *visual, gboolean allocate); -#ifndef GDK_DISABLE_DEPRECATED -GdkColormap* gdk_colormap_ref (GdkColormap *cmap); -void gdk_colormap_unref (GdkColormap *cmap); -#endif - #ifndef GDK_MULTIHEAD_SAFE GdkColormap* gdk_colormap_get_system (void); #endif GdkScreen *gdk_colormap_get_screen (GdkColormap *cmap); -#ifndef GDK_DISABLE_DEPRECATED -gint gdk_colormap_get_system_size (void); -#endif - -#if !defined (GDK_DISABLE_DEPRECATED) || defined (GDK_COMPILATION) -/* Used by gdk_colors_store () */ -void gdk_colormap_change (GdkColormap *colormap, - gint ncolors); -#endif - gint gdk_colormap_alloc_colors (GdkColormap *colormap, GdkColor *colors, gint n_colors, @@ -142,34 +127,6 @@ gchar * gdk_color_to_string (const GdkColor *color); GType gdk_color_get_type (void) G_GNUC_CONST; -/* The following functions are deprecated */ -#ifndef GDK_DISABLE_DEPRECATED -void gdk_colors_store (GdkColormap *colormap, - GdkColor *colors, - gint ncolors); -gint gdk_color_white (GdkColormap *colormap, - GdkColor *color); -gint gdk_color_black (GdkColormap *colormap, - GdkColor *color); -gint gdk_color_alloc (GdkColormap *colormap, - GdkColor *color); -gint gdk_color_change (GdkColormap *colormap, - GdkColor *color); -#endif /* GDK_DISABLE_DEPRECATED */ - -#if !defined (GDK_DISABLE_DEPRECATED) || defined (GDK_COMPILATION) -/* Used by gdk_rgb_try_colormap () */ -gint gdk_colors_alloc (GdkColormap *colormap, - gboolean contiguous, - gulong *planes, - gint nplanes, - gulong *pixels, - gint npixels); -void gdk_colors_free (GdkColormap *colormap, - gulong *pixels, - gint npixels, - gulong planes); -#endif /* !GDK_DISABLE_DEPRECATED || GDK_COMPILATION */ G_END_DECLS diff --git a/gdk/gdkcursor.h b/gdk/gdkcursor.h index f20400368d..bf17547ce7 100644 --- a/gdk/gdkcursor.h +++ b/gdk/gdkcursor.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) +#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) #error "Only can be included directly." #endif @@ -126,9 +126,9 @@ typedef enum struct _GdkCursor { - GdkCursorType type; + GdkCursorType GSEAL (type); /*< private >*/ - guint ref_count; + guint GSEAL (ref_count); }; /* Cursors @@ -158,9 +158,6 @@ GdkCursor* gdk_cursor_new_from_name (GdkDisplay *display, const gchar *name); GdkPixbuf* gdk_cursor_get_image (GdkCursor *cursor); -#ifndef GDK_DISABLE_DEPRECATED -#define gdk_cursor_destroy gdk_cursor_unref -#endif /* GDK_DISABLE_DEPRECATED */ G_END_DECLS diff --git a/gdk/gdkdevice.c b/gdk/gdkdevice.c new file mode 100644 index 0000000000..6ee68eb310 --- /dev/null +++ b/gdk/gdkdevice.c @@ -0,0 +1,1399 @@ +/* GDK - The GIMP Drawing Kit + * Copyright (C) 2009 Carlos Garnacho + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" +#include "gdkdevice.h" +#include "gdkdeviceprivate.h" +#include "gdkintl.h" +#include "gdkinternals.h" +#include "gdkalias.h" + +typedef struct _GdkAxisInfo GdkAxisInfo; + +struct _GdkAxisInfo +{ + GdkAtom label; + GdkAxisUse use; + + gdouble min_axis; + gdouble max_axis; + + gdouble min_value; + gdouble max_value; + gdouble resolution; +}; + +struct _GdkDevicePrivate +{ + GdkDeviceManager *device_manager; + GdkDisplay *display; + GdkDevice *associated; + GdkDeviceType type; + GArray *axes; +}; + +static void gdk_device_dispose (GObject *object); +static void gdk_device_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec); +static void gdk_device_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec); + + +G_DEFINE_ABSTRACT_TYPE (GdkDevice, gdk_device, G_TYPE_OBJECT) + +enum { + PROP_0, + PROP_DISPLAY, + PROP_DEVICE_MANAGER, + PROP_NAME, + PROP_ASSOCIATED_DEVICE, + PROP_TYPE, + PROP_INPUT_SOURCE, + PROP_INPUT_MODE, + PROP_HAS_CURSOR, + PROP_N_AXES +}; + + +static void +gdk_device_class_init (GdkDeviceClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->dispose = gdk_device_dispose; + object_class->set_property = gdk_device_set_property; + object_class->get_property = gdk_device_get_property; + + /** + * GdkDevice:display: + * + * The #GdkDisplay the #GdkDevice pertains to. + * + * Since: 3.0 + */ + g_object_class_install_property (object_class, + PROP_DISPLAY, + g_param_spec_object ("display", + P_("Device Display"), + P_("Display to which the device belongs to"), + GDK_TYPE_DISPLAY, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + /** + * GdkDevice:device-manager: + * + * The #GdkDeviceManager the #GdkDevice pertains to. + * + * Since: 3.0 + */ + g_object_class_install_property (object_class, + PROP_DEVICE_MANAGER, + g_param_spec_object ("device-manager", + P_("Device manager"), + P_("Device manager to which the device belongs to"), + GDK_TYPE_DEVICE_MANAGER, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + /** + * GdkDevice:name: + * + * The device name. + * + * Since: 3.0 + */ + g_object_class_install_property (object_class, + PROP_NAME, + g_param_spec_string ("name", + P_("Device name"), + P_("Device name"), + NULL, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + /** + * GdkDevice:type: + * + * Device role in the device manager. + * + * Since: 3.0 + */ + g_object_class_install_property (object_class, + PROP_TYPE, + g_param_spec_enum ("type", + P_("Device type"), + P_("Device role in the device manager"), + GDK_TYPE_DEVICE_TYPE, + GDK_DEVICE_TYPE_MASTER, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + /** + * GdkDevice:associated-device: + * + * Associated pointer or keyboard to this device, if any. Devices of type #GDK_DEVICE_TYPE_MASTER + * always come in keyboard/pointer pairs. Other device types will have a %NULL associated device. + * + * Since: 3.0 + */ + g_object_class_install_property (object_class, + PROP_ASSOCIATED_DEVICE, + g_param_spec_object ("associated-device", + P_("Associated device"), + P_("Associated pointer or keyboard to this device"), + GDK_TYPE_DEVICE, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + /** + * GdkDevice:input-source: + * + * Source type for the device. + * + * Since: 3.0 + */ + g_object_class_install_property (object_class, + PROP_INPUT_SOURCE, + g_param_spec_enum ("input-source", + P_("Input source"), + P_("Source type for the device"), + GDK_TYPE_INPUT_SOURCE, + GDK_SOURCE_MOUSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + /** + * GdkDevice:input-mode: + * + * Input mode for the device. + * + * Since: 3.0 + */ + g_object_class_install_property (object_class, + PROP_INPUT_MODE, + g_param_spec_enum ("input-mode", + P_("Input mode for the device"), + P_("Input mode for the device"), + GDK_TYPE_INPUT_MODE, + GDK_MODE_DISABLED, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + /** + * GdkDevice:has-cursor: + * + * Whether the device is represented by a cursor on the screen. Devices of type + * %GDK_DEVICE_TYPE_MASTER will have %TRUE here. + * + * Since: 3.0 + */ + g_object_class_install_property (object_class, + PROP_HAS_CURSOR, + g_param_spec_boolean ("has-cursor", + P_("Whether the device has cursor"), + P_("Whether there is a visible cursor following device motion"), + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + /** + * GdkDevice:n-axes: + * + * Number of axes in the device. + * + * Since: 3.0 + */ + g_object_class_install_property (object_class, + PROP_N_AXES, + g_param_spec_uint ("n-axes", + P_("Number of axes in the device"), + P_("Number of axes in the device"), + 0, G_MAXUINT, 0, + G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + g_type_class_add_private (object_class, sizeof (GdkDevicePrivate)); +} + +static void +gdk_device_init (GdkDevice *device) +{ + GdkDevicePrivate *priv; + + device->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE (device, + GDK_TYPE_DEVICE, + GdkDevicePrivate); + + priv->axes = g_array_new (FALSE, TRUE, sizeof (GdkAxisInfo)); +} + +static void +gdk_device_dispose (GObject *object) +{ + GdkDevicePrivate *priv; + GdkDevice *device; + + device = GDK_DEVICE (object); + priv = device->priv; + + if (priv->associated) + { + _gdk_device_set_associated_device (priv->associated, NULL); + g_object_unref (priv->associated); + priv->associated = NULL; + } + + if (priv->axes) + { + g_array_free (priv->axes, TRUE); + priv->axes = NULL; + } + + g_free (device->name); + g_free (device->keys); + g_free (device->axes); + + device->name = NULL; + device->keys = NULL; + device->axes = NULL; + + G_OBJECT_CLASS (gdk_device_parent_class)->dispose (object); +} + +static void +gdk_device_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GdkDevice *device = GDK_DEVICE (object); + GdkDevicePrivate *priv = device->priv; + + switch (prop_id) + { + case PROP_DISPLAY: + priv->display = g_value_get_object (value); + break; + case PROP_DEVICE_MANAGER: + priv->device_manager = g_value_get_object (value); + break; + case PROP_NAME: + if (device->name) + g_free (device->name); + + device->name = g_value_dup_string (value); + break; + case PROP_TYPE: + priv->type = g_value_get_enum (value); + break; + case PROP_INPUT_SOURCE: + device->source = g_value_get_enum (value); + break; + case PROP_INPUT_MODE: + gdk_device_set_mode (device, g_value_get_enum (value)); + break; + case PROP_HAS_CURSOR: + device->has_cursor = g_value_get_boolean (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gdk_device_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GdkDevice *device = GDK_DEVICE (object); + GdkDevicePrivate *priv = device->priv; + + switch (prop_id) + { + case PROP_DISPLAY: + g_value_set_object (value, priv->display); + break; + case PROP_DEVICE_MANAGER: + g_value_set_object (value, priv->device_manager); + break; + case PROP_ASSOCIATED_DEVICE: + g_value_set_object (value, priv->associated); + break; + case PROP_NAME: + g_value_set_string (value, + device->name); + break; + case PROP_TYPE: + g_value_set_enum (value, priv->type); + break; + case PROP_INPUT_SOURCE: + g_value_set_enum (value, device->source); + break; + case PROP_INPUT_MODE: + g_value_set_enum (value, device->mode); + break; + case PROP_HAS_CURSOR: + g_value_set_boolean (value, + device->has_cursor); + break; + case PROP_N_AXES: + g_value_set_uint (value, priv->axes->len); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +/** + * gdk_device_get_state: + * @device: a #GdkDevice. + * @window: a #GdkWindow. + * @axes: an array of doubles to store the values of the axes of @device in, + * or %NULL. + * @mask: location to store the modifiers, or %NULL. + * + * Gets the current state of a device relative to @window. + */ +void +gdk_device_get_state (GdkDevice *device, + GdkWindow *window, + gdouble *axes, + GdkModifierType *mask) +{ + g_return_if_fail (GDK_IS_DEVICE (device)); + g_return_if_fail (GDK_IS_WINDOW (window)); + + if (GDK_DEVICE_GET_CLASS (device)->get_state) + GDK_DEVICE_GET_CLASS (device)->get_state (device, window, axes, mask); +} + +/** + * gdk_device_get_history: + * @device: a #GdkDevice + * @window: the window with respect to which which the event coordinates will be reported + * @start: starting timestamp for range of events to return + * @stop: ending timestamp for the range of events to return + * @events: (array length=n_events) (out) (transfer none): location to store a newly-allocated array of #GdkTimeCoord, or %NULL + * @n_events: location to store the length of @events, or %NULL + * + * Obtains the motion history for a device; given a starting and + * ending timestamp, return all events in the motion history for + * the device in the given range of time. Some windowing systems + * do not support motion history, in which case, %FALSE will + * be returned. (This is not distinguishable from the case where + * motion history is supported and no events were found.) + * + * Return value: %TRUE if the windowing system supports motion history and + * at least one event was found. + **/ +gboolean +gdk_device_get_history (GdkDevice *device, + GdkWindow *window, + guint32 start, + guint32 stop, + GdkTimeCoord ***events, + guint *n_events) +{ + g_return_val_if_fail (GDK_IS_DEVICE (device), FALSE); + g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE); + + if (n_events) + *n_events = 0; + + if (events) + *events = NULL; + + if (GDK_WINDOW_DESTROYED (window)) + return FALSE; + + if (!GDK_DEVICE_GET_CLASS (device)->get_history) + return FALSE; + + return GDK_DEVICE_GET_CLASS (device)->get_history (device, window, + start, stop, + events, n_events); +} + +GdkTimeCoord ** +_gdk_device_allocate_history (GdkDevice *device, + guint n_events) +{ + GdkTimeCoord **result = g_new (GdkTimeCoord *, n_events); + gint i; + + for (i = 0; i < n_events; i++) + result[i] = g_malloc (sizeof (GdkTimeCoord) - + sizeof (double) * (GDK_MAX_TIMECOORD_AXES - device->num_axes)); + return result; +} + +/** + * gdk_device_free_history: + * @events: (inout) (transfer none): an array of #GdkTimeCoord. + * @n_events: the length of the array. + * + * Frees an array of #GdkTimeCoord that was returned by gdk_device_get_history(). + */ +void +gdk_device_free_history (GdkTimeCoord **events, + gint n_events) +{ + gint i; + + for (i = 0; i < n_events; i++) + g_free (events[i]); + + g_free (events); +} + +/** + * gdk_device_get_name: + * @device: a #GdkDevice + * + * Determines the name of the device. + * + * Return value: a name + * + * Since: 2.20 + **/ +const gchar * +gdk_device_get_name (GdkDevice *device) +{ + g_return_val_if_fail (GDK_IS_DEVICE (device), NULL); + + return device->name; +} + +/** + * gdk_device_get_has_cursor: + * @device: a #GdkDevice + * + * Determines whether the pointer follows device motion. + * + * Return value: %TRUE if the pointer follows device motion + * + * Since: 2.20 + **/ +gboolean +gdk_device_get_has_cursor (GdkDevice *device) +{ + g_return_val_if_fail (GDK_IS_DEVICE (device), FALSE); + + return device->has_cursor; +} + +/** + * gdk_device_get_source: + * @device: a #GdkDevice + * + * Determines the type of the device. + * + * Return value: a #GdkInputSource + * + * Since: 2.20 + **/ +GdkInputSource +gdk_device_get_source (GdkDevice *device) +{ + g_return_val_if_fail (GDK_IS_DEVICE (device), 0); + + return device->source; +} + +/** + * gdk_device_set_source: + * @device: a #GdkDevice. + * @source: the source type. + * + * Sets the source type for an input device. + **/ +void +gdk_device_set_source (GdkDevice *device, + GdkInputSource source) +{ + g_return_if_fail (GDK_IS_DEVICE (device)); + + device->source = source; +} + +/** + * gdk_device_get_mode: + * @device: a #GdkDevice + * + * Determines the mode of the device. + * + * Return value: a #GdkInputSource + * + * Since: 2.20 + **/ +GdkInputMode +gdk_device_get_mode (GdkDevice *device) +{ + g_return_val_if_fail (GDK_IS_DEVICE (device), 0); + + return device->mode; +} + +/** + * gdk_device_set_mode: + * @device: a #GdkDevice. + * @mode: the input mode. + * + * Sets a the mode of an input device. The mode controls if the + * device is active and whether the device's range is mapped to the + * entire screen or to a single window. + * + * Returns: %TRUE if the mode was successfully changed. + **/ +gboolean +gdk_device_set_mode (GdkDevice *device, + GdkInputMode mode) +{ + g_return_val_if_fail (GDK_IS_DEVICE (device), FALSE); + + if (device->mode == mode) + return TRUE; + + if (mode == GDK_MODE_DISABLED && + gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_MASTER) + return FALSE; + + /* FIXME: setting has_cursor when mode is window? */ + + device->mode = mode; + g_object_notify (G_OBJECT (device), "input-mode"); + + if (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_MASTER) + _gdk_input_check_extension_events (device); + + return TRUE; +} + +/** + * gdk_device_get_key: + * @device: a #GdkDevice. + * @index_: the index of the macro button to get. + * @keyval: return value for the keyval. + * @modifiers: return value for modifiers. + * + * If @index_ has a valid keyval, this function will return %TRUE + * and fill in @keyval and @modifiers with the keyval settings. + * + * Returns: %TRUE if keyval is set for @index. + * + * Since: 2.20 + **/ +gboolean +gdk_device_get_key (GdkDevice *device, + guint index_, + guint *keyval, + GdkModifierType *modifiers) +{ + g_return_val_if_fail (GDK_IS_DEVICE (device), FALSE); + g_return_val_if_fail (index_ < device->num_keys, FALSE); + + if (!device->keys[index_].keyval && + !device->keys[index_].modifiers) + return FALSE; + + if (keyval) + *keyval = device->keys[index_].keyval; + + if (modifiers) + *modifiers = device->keys[index_].modifiers; + + return TRUE; +} + +/** + * gdk_device_set_key: + * @device: a #GdkDevice + * @index_: the index of the macro button to set + * @keyval: the keyval to generate + * @modifiers: the modifiers to set + * + * Specifies the X key event to generate when a macro button of a device + * is pressed. + **/ +void +gdk_device_set_key (GdkDevice *device, + guint index_, + guint keyval, + GdkModifierType modifiers) +{ + g_return_if_fail (GDK_IS_DEVICE (device)); + g_return_if_fail (index_ < device->num_keys); + + device->keys[index_].keyval = keyval; + device->keys[index_].modifiers = modifiers; +} + +/** + * gdk_device_get_axis_use: + * @device: a #GdkDevice. + * @index_: the index of the axis. + * + * Returns the axis use for @index_. + * + * Returns: a #GdkAxisUse specifying how the axis is used. + * + * Since: 2.20 + **/ +GdkAxisUse +gdk_device_get_axis_use (GdkDevice *device, + guint index_) +{ + g_return_val_if_fail (GDK_IS_DEVICE (device), GDK_AXIS_IGNORE); + g_return_val_if_fail (index_ < device->num_axes, GDK_AXIS_IGNORE); + + return device->axes[index_].use; +} + +/** + * gdk_device_set_axis_use: + * @device: a #GdkDevice + * @index_: the index of the axis + * @use: specifies how the axis is used + * + * Specifies how an axis of a device is used. + **/ +void +gdk_device_set_axis_use (GdkDevice *device, + guint index_, + GdkAxisUse use) +{ + GdkDevicePrivate *priv; + GdkAxisInfo *info; + + g_return_if_fail (GDK_IS_DEVICE (device)); + g_return_if_fail (index_ < device->num_axes); + + priv = device->priv; + info = &g_array_index (priv->axes, GdkAxisInfo, index_); + info->use = use; + + device->axes[index_].use = use; + + switch (use) + { + case GDK_AXIS_X: + case GDK_AXIS_Y: + device->axes[index_].min = info->min_axis = 0; + device->axes[index_].max = info->max_axis = 0; + break; + case GDK_AXIS_XTILT: + case GDK_AXIS_YTILT: + device->axes[index_].min = info->min_axis = -1; + device->axes[index_].max = info->max_axis = 1; + break; + default: + device->axes[index_].min = info->min_axis = 0; + device->axes[index_].max = info->max_axis = 1; + break; + } +} + +/** + * gdk_device_get_display: + * @device: a #GdkDevice + * + * Returns the #GdkDisplay to which @device pertains. + * + * Returns: a #GdkDisplay. This memory is owned by GTK+, + * and must not be freed or unreffed. + * + * Since: 3.0 + **/ +GdkDisplay * +gdk_device_get_display (GdkDevice *device) +{ + GdkDevicePrivate *priv; + + g_return_val_if_fail (GDK_IS_DEVICE (device), NULL); + + priv = device->priv; + + return priv->display; +} + +/** + * gdk_device_get_associated_device: + * @device: a #GdkDevice + * + * Returns the associated device to @device, if @device is of type + * %GDK_DEVICE_TYPE_MASTER, it will return the paired pointer or + * keyboard. + * + * If @device is of type %GDK_DEVICE_TYPE_SLAVE, it will return + * the master device to which @device is attached to. + * + * If @device is of type %GDK_DEVICE_TYPE_FLOATING, %NULL will be + * returned, as there is no associated device. + * + * Returns: The associated device, or %NULL + * + * Since: 3.0 + **/ +GdkDevice * +gdk_device_get_associated_device (GdkDevice *device) +{ + GdkDevicePrivate *priv; + + g_return_val_if_fail (GDK_IS_DEVICE (device), NULL); + + priv = device->priv; + + return priv->associated; +} + +void +_gdk_device_set_associated_device (GdkDevice *device, + GdkDevice *associated) +{ + GdkDevicePrivate *priv; + + g_return_if_fail (GDK_IS_DEVICE (device)); + g_return_if_fail (GDK_IS_DEVICE (associated)); + + priv = device->priv; + + if (priv->associated == associated) + return; + + if (priv->associated) + { + g_object_unref (priv->associated); + priv->associated = NULL; + } + + if (associated) + priv->associated = g_object_ref (associated); +} + +/** + * gdk_device_get_device_type: + * @device: a #GdkDevice + * + * Returns the device type for @device. + * + * Returns: the #GdkDeviceType for @device. + * + * Since: 3.0 + **/ +GdkDeviceType +gdk_device_get_device_type (GdkDevice *device) +{ + GdkDevicePrivate *priv; + + g_return_val_if_fail (GDK_IS_DEVICE (device), GDK_DEVICE_TYPE_MASTER); + + priv = device->priv; + + return priv->type; +} + +/** + * gdk_device_get_n_axes: + * @device: a #GdkDevice + * + * Returns the number of axes the device currently has. + * + * Returns: the number of axes. + * + * Since: 3.0 + **/ +guint +gdk_device_get_n_axes (GdkDevice *device) +{ + g_return_val_if_fail (GDK_IS_DEVICE (device), 0); + + return device->num_axes; +} + +/** + * gdk_device_list_axes: + * @device: a #GdkDevice + * + * Returns a #GList of #GdkAtoms, containing the labels for + * the axes that @device currently has. + * + * Returns: A #GList of #GdkAtoms, free with g_list_free(). + * + * Since: 3.0 + **/ +GList * +gdk_device_list_axes (GdkDevice *device) +{ + GdkDevicePrivate *priv; + GList *axes = NULL; + gint i; + + priv = device->priv; + + for (i = 0; i < priv->axes->len; i++) + { + GdkAxisInfo axis_info; + + axis_info = g_array_index (priv->axes, GdkAxisInfo, i); + axes = g_list_prepend (axes, GDK_ATOM_TO_POINTER (axis_info.label)); + } + + return g_list_reverse (axes); +} + +/** + * gdk_device_get_axis_value: + * @device: a #GdkDevice. + * @axes: pointer to an array of axes + * @axis_label: #GdkAtom with the axis label. + * @value: location to store the found value. + * + * Interprets an array of double as axis values for a given device, + * and locates the value in the array for a given axis label, as returned + * by gdk_device_list_axes() + * + * Returns: %TRUE if the given axis use was found, otherwise %FALSE. + * + * Since: 3.0 + **/ +gboolean +gdk_device_get_axis_value (GdkDevice *device, + gdouble *axes, + GdkAtom axis_label, + gdouble *value) +{ + GdkDevicePrivate *priv; + gint i; + + g_return_val_if_fail (GDK_IS_DEVICE (device), FALSE); + + if (axes == NULL) + return FALSE; + + priv = device->priv; + + for (i = 0; i < priv->axes->len; i++) + { + GdkAxisInfo axis_info; + + axis_info = g_array_index (priv->axes, GdkAxisInfo, i); + + if (axis_info.label != axis_label) + continue; + + if (value) + *value = axes[i]; + + return TRUE; + } + + return FALSE; +} + +/** + * gdk_device_get_axis: + * @device: a #GdkDevice + * @axes: pointer to an array of axes + * @use: the use to look for + * @value: location to store the found value. + * + * Interprets an array of double as axis values for a given device, + * and locates the value in the array for a given axis use. + * + * Return value: %TRUE if the given axis use was found, otherwise %FALSE + **/ +gboolean +gdk_device_get_axis (GdkDevice *device, + gdouble *axes, + GdkAxisUse use, + gdouble *value) +{ + GdkDevicePrivate *priv; + gint i; + + g_return_val_if_fail (GDK_IS_DEVICE (device), FALSE); + + if (axes == NULL) + return FALSE; + + priv = device->priv; + + g_return_val_if_fail (priv->axes != NULL, FALSE); + + for (i = 0; i < priv->axes->len; i++) + { + GdkAxisInfo axis_info; + + axis_info = g_array_index (priv->axes, GdkAxisInfo, i); + + if (axis_info.use != use) + continue; + + if (value) + *value = axes[i]; + + return TRUE; + } + + return FALSE; +} + +static GdkEventMask +get_native_grab_event_mask (GdkEventMask grab_mask) +{ + /* Similar to the above but for pointer events only */ + return + GDK_POINTER_MOTION_MASK | + GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | + GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | + GDK_SCROLL_MASK | + (grab_mask & + ~(GDK_POINTER_MOTION_HINT_MASK | + GDK_BUTTON_MOTION_MASK | + GDK_BUTTON1_MOTION_MASK | + GDK_BUTTON2_MOTION_MASK | + GDK_BUTTON3_MOTION_MASK)); +} + +/** + * gdk_device_grab: + * @device: a #GdkDevice + * @window: the #GdkWindow which will own the grab (the grab window) + * @grab_ownership: specifies the grab ownership. + * @owner_events: if %FALSE then all device events are reported with respect to + * @window and are only reported if selected by @event_mask. If + * %TRUE then pointer events for this application are reported + * as normal, but pointer events outside this application are + * reported with respect to @window and only if selected by + * @event_mask. In either mode, unreported events are discarded. + * @event_mask: specifies the event mask, which is used in accordance with + * @owner_events. + * @cursor: the cursor to display while the grab is active if the device is + * a pointer. If this is %NULL then the normal cursors are used for + * @window and its descendants, and the cursor for @window is used + * elsewhere. + * @time_: the timestamp of the event which led to this pointer grab. This + * usually comes from the #GdkEvent struct, though %GDK_CURRENT_TIME + * can be used if the time isn't known. + * + * Grabs the device so that all events coming from this device are passed to + * this application until the device is ungrabbed with gdk_device_ungrab(), + * or the window becomes unviewable. This overrides any previous grab on the device + * by this client. + * + * Device grabs are used for operations which need complete control over the + * given device events (either pointer or keyboard). For example in GTK+ this + * is used for Drag and Drop operations, popup menus and such. + * + * Note that if the event mask of an X window has selected both button press + * and button release events, then a button press event will cause an automatic + * pointer grab until the button is released. X does this automatically since + * most applications expect to receive button press and release events in pairs. + * It is equivalent to a pointer grab on the window with @owner_events set to + * %TRUE. + * + * If you set up anything at the time you take the grab that needs to be + * cleaned up when the grab ends, you should handle the #GdkEventGrabBroken + * events that are emitted when the grab ends unvoluntarily. + * + * Returns: %GDK_GRAB_SUCCESS if the grab was successful. + * + * Since: 3.0 + **/ +GdkGrabStatus +gdk_device_grab (GdkDevice *device, + GdkWindow *window, + GdkGrabOwnership grab_ownership, + gboolean owner_events, + GdkEventMask event_mask, + GdkCursor *cursor, + guint32 time_) +{ + GdkGrabStatus res; + GdkWindow *native; + + g_return_val_if_fail (GDK_IS_DEVICE (device), 0); + g_return_val_if_fail (GDK_IS_WINDOW (window), 0); + + if (_gdk_native_windows) + native = window; + else + native = gdk_window_get_toplevel (window); + + while (((GdkWindowObject *) native)->window_type == GDK_WINDOW_OFFSCREEN) + { + native = gdk_offscreen_window_get_embedder (native); + + if (native == NULL || + (!_gdk_window_has_impl (native) && + !gdk_window_is_viewable (native))) + return GDK_GRAB_NOT_VIEWABLE; + + native = gdk_window_get_toplevel (native); + } + + res = _gdk_windowing_device_grab (device, + window, + native, + owner_events, + get_native_grab_event_mask (event_mask), + NULL, + cursor, + time_); + + if (res == GDK_GRAB_SUCCESS) + { + GdkDisplay *display; + gulong serial; + + display = gdk_drawable_get_display (window); + serial = _gdk_windowing_window_get_next_serial (display); + + _gdk_display_add_device_grab (display, + device, + window, + native, + grab_ownership, + owner_events, + event_mask, + serial, + time_, + FALSE); + } + + return res; +} + +/* Private API */ +void +_gdk_device_reset_axes (GdkDevice *device) +{ + GdkDevicePrivate *priv; + gint i; + + priv = device->priv; + + for (i = priv->axes->len - 1; i >= 0; i--) + g_array_remove_index (priv->axes, i); + + g_object_notify (G_OBJECT (device), "n-axes"); + + /* This is done for backwards compatibility */ + g_free (device->axes); + device->axes = NULL; +} + +guint +_gdk_device_add_axis (GdkDevice *device, + GdkAtom label_atom, + GdkAxisUse use, + gdouble min_value, + gdouble max_value, + gdouble resolution) +{ + GdkDevicePrivate *priv; + GdkAxisInfo axis_info; + guint pos; + + priv = device->priv; + + axis_info.use = use; + axis_info.label = label_atom; + axis_info.min_value = min_value; + axis_info.max_value = max_value; + axis_info.resolution = resolution; + + switch (use) + { + case GDK_AXIS_X: + case GDK_AXIS_Y: + axis_info.min_axis = 0; + axis_info.max_axis = 0; + break; + case GDK_AXIS_XTILT: + case GDK_AXIS_YTILT: + axis_info.min_axis = -1; + axis_info.max_axis = 1; + break; + default: + axis_info.min_axis = 0; + axis_info.max_axis = 1; + break; + } + + priv->axes = g_array_append_val (priv->axes, axis_info); + device->num_axes = priv->axes->len; + pos = device->num_axes - 1; + + /* This is done for backwards compatibility, since the public + * struct doesn't actually store the device data. + */ + device->axes = g_realloc (device->axes, sizeof (GdkDeviceAxis) * priv->axes->len); + device->axes[pos].use = axis_info.use; + device->axes[pos].min = axis_info.min_axis; + device->axes[pos].max = axis_info.max_axis; + + g_object_notify (G_OBJECT (device), "n-axes"); + + return pos; +} + +void +_gdk_device_set_keys (GdkDevice *device, + guint num_keys) +{ + if (device->keys) + g_free (device->keys); + + device->num_keys = num_keys; + device->keys = g_new0 (GdkDeviceKey, num_keys); +} + +static GdkAxisInfo * +find_axis_info (GArray *array, + GdkAxisUse use) +{ + GdkAxisInfo *info; + gint i; + + for (i = 0; i < GDK_AXIS_LAST; i++) + { + info = &g_array_index (array, GdkAxisInfo, i); + + if (info->use == use) + return info; + } + + return NULL; +} + +GdkAxisUse +_gdk_device_get_axis_use (GdkDevice *device, + guint index_) +{ + GdkDevicePrivate *priv; + GdkAxisInfo info; + + priv = device->priv; + + info = g_array_index (priv->axes, GdkAxisInfo, index_); + return info.use; +} + +gboolean +_gdk_device_translate_window_coord (GdkDevice *device, + GdkWindow *window, + guint index_, + gdouble value, + gdouble *axis_value) +{ + GdkDevicePrivate *priv; + GdkAxisInfo axis_info; + GdkAxisInfo *axis_info_x, *axis_info_y; + gdouble device_width, device_height; + gdouble x_offset, y_offset; + gdouble x_scale, y_scale; + gdouble x_min, y_min; + gdouble x_resolution, y_resolution; + gdouble device_aspect; + gint window_width, window_height; + GdkWindowObject *window_private; + + priv = device->priv; + + if (index_ >= priv->axes->len) + return FALSE; + + axis_info = g_array_index (priv->axes, GdkAxisInfo, index_); + + if (axis_info.use != GDK_AXIS_X && + axis_info.use != GDK_AXIS_Y) + return FALSE; + + if (axis_info.use == GDK_AXIS_X) + { + axis_info_x = &axis_info; + axis_info_y = find_axis_info (priv->axes, GDK_AXIS_Y); + } + else + { + axis_info_x = find_axis_info (priv->axes, GDK_AXIS_X); + axis_info_y = &axis_info; + } + + device_width = axis_info_x->max_value - axis_info_x->min_value; + device_height = axis_info_y->max_value - axis_info_y->min_value; + + if (device_width > 0) + x_min = axis_info_x->min_value; + else + { + device_width = gdk_screen_get_width (gdk_drawable_get_screen (window)); + x_min = 0; + } + + if (device_height > 0) + y_min = axis_info_y->min_value; + else + { + device_height = gdk_screen_get_height (gdk_drawable_get_screen (window)); + y_min = 0; + } + + window_private = (GdkWindowObject *) window; + gdk_drawable_get_size (window, &window_width, &window_height); + + x_resolution = axis_info_x->resolution; + y_resolution = axis_info_y->resolution; + + /* + * Some drivers incorrectly report the resolution of the device + * as zero (in partiular linuxwacom < 0.5.3 with usb tablets). + * This causes the device_aspect to become NaN and totally + * breaks windowed mode. If this is the case, the best we can + * do is to assume the resolution is non-zero is equal in both + * directions (which is true for many devices). The absolute + * value of the resolution doesn't matter since we only use the + * ratio. + */ + if (x_resolution == 0 || y_resolution == 0) + { + x_resolution = 1; + y_resolution = 1; + } + + device_aspect = (device_height * y_resolution) / + (device_width * x_resolution); + + if (device_aspect * window_width >= window_height) + { + /* device taller than window */ + x_scale = window_width / device_width; + y_scale = (x_scale * x_resolution) / y_resolution; + + x_offset = 0; + y_offset = - (device_height * y_scale - window_height) / 2; + } + else + { + /* window taller than device */ + y_scale = window_height / device_height; + x_scale = (y_scale * y_resolution) / x_resolution; + + y_offset = 0; + x_offset = - (device_width * x_scale - window_width) / 2; + } + + if (axis_value) + { + if (axis_info.use == GDK_AXIS_X) + *axis_value = x_offset + x_scale * (value - x_min); + else + *axis_value = y_offset + y_scale * (value - y_min); + } + + return TRUE; +} + +gboolean +_gdk_device_translate_screen_coord (GdkDevice *device, + GdkWindow *window, + gint window_root_x, + gint window_root_y, + guint index_, + gdouble value, + gdouble *axis_value) +{ + GdkDevicePrivate *priv; + GdkAxisInfo axis_info; + gdouble axis_width, scale, offset; + GdkWindowObject *window_private; + + if (device->mode != GDK_MODE_SCREEN) + return FALSE; + + priv = device->priv; + + if (index_ >= priv->axes->len) + return FALSE; + + axis_info = g_array_index (priv->axes, GdkAxisInfo, index_); + + if (axis_info.use != GDK_AXIS_X && + axis_info.use != GDK_AXIS_Y) + return FALSE; + + axis_width = axis_info.max_value - axis_info.min_value; + window_private = (GdkWindowObject *) window; + + if (axis_info.use == GDK_AXIS_X) + { + if (axis_width > 0) + scale = gdk_screen_get_width (gdk_drawable_get_screen (window)) / axis_width; + else + scale = 1; + + offset = - window_root_x - window_private->abs_x; + } + else + { + if (axis_width > 0) + scale = gdk_screen_get_height (gdk_drawable_get_screen (window)) / axis_width; + else + scale = 1; + + offset = - window_root_y - window_private->abs_y; + } + + if (axis_value) + *axis_value = offset + scale * (value - axis_info.min_value); + + return TRUE; +} + +gboolean +_gdk_device_translate_axis (GdkDevice *device, + guint index_, + gdouble value, + gdouble *axis_value) +{ + GdkDevicePrivate *priv; + GdkAxisInfo axis_info; + gdouble axis_width, out; + + priv = device->priv; + + if (index_ >= priv->axes->len) + return FALSE; + + axis_info = g_array_index (priv->axes, GdkAxisInfo, index_); + + if (axis_info.use == GDK_AXIS_X || + axis_info.use == GDK_AXIS_Y) + return FALSE; + + axis_width = axis_info.max_value - axis_info.min_value; + out = (axis_info.max_axis * (value - axis_info.min_value) + + axis_info.min_axis * (axis_info.max_value - value)) / axis_width; + + if (axis_value) + *axis_value = out; + + return TRUE; +} + +#define __GDK_DEVICE_C__ +#include "gdkaliasdef.c" diff --git a/gdk/gdkdevice.h b/gdk/gdkdevice.h new file mode 100644 index 0000000000..b2a5db8da5 --- /dev/null +++ b/gdk/gdkdevice.h @@ -0,0 +1,292 @@ +/* GDK - The GIMP Drawing Kit + * Copyright (C) 2009 Carlos Garnacho + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __GDK_DEVICE_H__ +#define __GDK_DEVICE_H__ + +#include + + +G_BEGIN_DECLS + +#define GDK_TYPE_DEVICE (gdk_device_get_type ()) +#define GDK_DEVICE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_DEVICE, GdkDevice)) +#define GDK_IS_DEVICE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_DEVICE)) + +typedef struct _GdkDevice GdkDevice; +typedef struct _GdkDevicePrivate GdkDevicePrivate; + +typedef struct _GdkDeviceKey GdkDeviceKey; +typedef struct _GdkDeviceAxis GdkDeviceAxis; +typedef struct _GdkTimeCoord GdkTimeCoord; + +/** + * GdkExtensionMode: + * @GDK_EXTENSION_EVENTS_NONE: no extension events are desired. + * @GDK_EXTENSION_EVENTS_ALL: all extension events are desired. + * @GDK_EXTENSION_EVENTS_CURSOR: extension events are desired only if a cursor + * will be displayed for the device. + * + * An enumeration used to specify which extension events + * are desired for a particular widget. + */ +typedef enum +{ + GDK_EXTENSION_EVENTS_NONE, + GDK_EXTENSION_EVENTS_ALL, + GDK_EXTENSION_EVENTS_CURSOR +} GdkExtensionMode; + +/** + * GdkInputSource: + * @GDK_SOURCE_MOUSE: the device is a mouse. (This will be reported for the core + * pointer, even if it is something else, such as a trackball.) + * @GDK_SOURCE_PEN: the device is a stylus of a graphics tablet or similar device. + * @GDK_SOURCE_ERASER: the device is an eraser. Typically, this would be the other end + * of a stylus on a graphics tablet. + * @GDK_SOURCE_CURSOR: the device is a graphics tablet "puck" or similar device. + * @GDK_SOURCE_KEYBOARD: the device is a keyboard. + * + * An enumeration describing the type of an input device in general terms. + */ +typedef enum +{ + GDK_SOURCE_MOUSE, + GDK_SOURCE_PEN, + GDK_SOURCE_ERASER, + GDK_SOURCE_CURSOR, + GDK_SOURCE_KEYBOARD +} GdkInputSource; + +/** + * GdkInputMode: + * @GDK_MODE_DISABLED: the device is disabled and will not report any events. + * @GDK_MODE_SCREEN: the device is enabled. The device's coordinate space + * maps to the entire screen. + * @GDK_MODE_WINDOW: the device is enabled. The device's coordinate space + * is mapped to a single window. The manner in which this window + * is chosen is undefined, but it will typically be the same + * way in which the focus window for key events is determined. + * + * An enumeration that describes the mode of an input device. + */ +typedef enum +{ + GDK_MODE_DISABLED, + GDK_MODE_SCREEN, + GDK_MODE_WINDOW +} GdkInputMode; + +/** + * GdkAxisUse: + * @GDK_AXIS_IGNORE: the axis is ignored. + * @GDK_AXIS_X: the axis is used as the x axis. + * @GDK_AXIS_Y: the axis is used as the y axis. + * @GDK_AXIS_PRESSURE: the axis is used for pressure information. + * @GDK_AXIS_XTILT: the axis is used for x tilt information. + * @GDK_AXIS_YTILT: the axis is used for x tilt information. + * @GDK_AXIS_WHEEL: the axis is used for wheel information. + * @GDK_AXIS_LAST: a constant equal to the numerically highest axis value. + * + * An enumeration describing the way in which a device + * axis (valuator) maps onto the predefined valuator + * types that GTK+ understands. + */ +typedef enum +{ + GDK_AXIS_IGNORE, + GDK_AXIS_X, + GDK_AXIS_Y, + GDK_AXIS_PRESSURE, + GDK_AXIS_XTILT, + GDK_AXIS_YTILT, + GDK_AXIS_WHEEL, + GDK_AXIS_LAST +} GdkAxisUse; + +/** + * GdkDeviceType: + * @GDK_DEVICE_TYPE_MASTER: Device is a master (or virtual) device. There will + * be an associated focus indicator on the screen. + * @GDK_DEVICE_TYPE_SLAVE: Device is a slave (or physical) device. + * @GDK_DEVICE_TYPE_FLOATING: Device is a physical device, currently not attached to + * any virtual device. + * + * Indicates the device type. See above + * for more information about the meaning of these device types. + */ +typedef enum { + GDK_DEVICE_TYPE_MASTER, + GDK_DEVICE_TYPE_SLAVE, + GDK_DEVICE_TYPE_FLOATING +} GdkDeviceType; + +/** + * GdkDeviceKey: + * @keyval: the keyval to generate when the macro button is pressed. + * If this is 0, no keypress will be generated. + * @modifiers: the modifiers set for the generated key event. + * + * The GdkDeviceKey structure contains information + * about the mapping of one device macro button onto a normal X key event. + */ +struct _GdkDeviceKey +{ + guint keyval; + GdkModifierType modifiers; +}; + +/** + * GdkDeviceAxis: + * @use: specifies how the axis is used. + * @min: the minimal value that will be reported by this axis. + * @max: the maximal value that will be reported by this axis. + * + * The GdkDeviceAxis structure contains information + * about the range and mapping of a device axis. + */ +struct _GdkDeviceAxis +{ + GdkAxisUse use; + gdouble min; + gdouble max; +}; + +/* We don't allocate each coordinate this big, but we use it to + * be ANSI compliant and avoid accessing past the defined limits. + */ +#define GDK_MAX_TIMECOORD_AXES 128 + +/** + * GdkTimeCoord: + * @time: The timestamp for this event. + * @axes: the values of the device's axes. + * + * The #GdkTimeCoord structure stores a single event in a motion history. + */ +struct _GdkTimeCoord +{ + guint32 time; + gdouble axes[GDK_MAX_TIMECOORD_AXES]; +}; + +struct _GdkDevice +{ + GObject parent_instance; + + /* All fields are read-only */ + gchar *GSEAL (name); + GdkInputSource GSEAL (source); + GdkInputMode GSEAL (mode); + gboolean GSEAL (has_cursor); /* TRUE if a X pointer follows device motion */ + + gint GSEAL (num_axes); + GdkDeviceAxis *GSEAL (axes); + + gint GSEAL (num_keys); + GdkDeviceKey *GSEAL (keys); + + /*< private >*/ + GdkDevicePrivate *priv; +}; + +GType gdk_device_get_type (void) G_GNUC_CONST; + +G_CONST_RETURN gchar *gdk_device_get_name (GdkDevice *device); +gboolean gdk_device_get_has_cursor (GdkDevice *device); + +/* Functions to configure a device */ +GdkInputSource gdk_device_get_source (GdkDevice *device); +void gdk_device_set_source (GdkDevice *device, + GdkInputSource source); + +GdkInputMode gdk_device_get_mode (GdkDevice *device); +gboolean gdk_device_set_mode (GdkDevice *device, + GdkInputMode mode); + +gboolean gdk_device_get_key (GdkDevice *device, + guint index_, + guint *keyval, + GdkModifierType *modifiers); +void gdk_device_set_key (GdkDevice *device, + guint index_, + guint keyval, + GdkModifierType modifiers); + +GdkAxisUse gdk_device_get_axis_use (GdkDevice *device, + guint index_); +void gdk_device_set_axis_use (GdkDevice *device, + guint index_, + GdkAxisUse use); + + +void gdk_device_get_state (GdkDevice *device, + GdkWindow *window, + gdouble *axes, + GdkModifierType *mask); +gboolean gdk_device_get_history (GdkDevice *device, + GdkWindow *window, + guint32 start, + guint32 stop, + GdkTimeCoord ***events, + guint *n_events); +void gdk_device_free_history (GdkTimeCoord **events, + gint n_events); + +guint gdk_device_get_n_axes (GdkDevice *device); +GList * gdk_device_list_axes (GdkDevice *device); +gboolean gdk_device_get_axis_value (GdkDevice *device, + gdouble *axes, + GdkAtom axis_label, + gdouble *value); + +gboolean gdk_device_get_axis (GdkDevice *device, + gdouble *axes, + GdkAxisUse use, + gdouble *value); +GdkDisplay * gdk_device_get_display (GdkDevice *device); + +GdkDevice * gdk_device_get_associated_device (GdkDevice *device); + +GdkDeviceType gdk_device_get_device_type (GdkDevice *device); + +GdkGrabStatus gdk_device_grab (GdkDevice *device, + GdkWindow *window, + GdkGrabOwnership grab_ownership, + gboolean owner_events, + GdkEventMask event_mask, + GdkCursor *cursor, + guint32 time_); + +void gdk_device_ungrab (GdkDevice *device, + guint32 time_); + +gboolean gdk_device_grab_info_libgtk_only (GdkDisplay *display, + GdkDevice *device, + GdkWindow **grab_window, + gboolean *owner_events); + + +G_END_DECLS + +#endif /* __GDK_DEVICE_H__ */ diff --git a/gdk/gdkdevicemanager.c b/gdk/gdkdevicemanager.c new file mode 100644 index 0000000000..5bce0fcf91 --- /dev/null +++ b/gdk/gdkdevicemanager.c @@ -0,0 +1,302 @@ +/* GDK - The GIMP Drawing Kit + * Copyright (C) 2009 Carlos Garnacho + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" +#include "gdkdevicemanager.h" +#include "gdkintl.h" +#include "gdkinternals.h" +#include "gdkalias.h" + +/** + * SECTION:gdkdevicemanager + * @Short_description: Functions for handling input devices + * @Long_description: In addition to a single pointer and keyboard for user interface input, GDK + * contains support for a variety of input devices, including graphics tablets, + * touchscreens and multiple pointers/keyboards interacting simultaneously with + * the user interface. Under X, the support for multiple input devices is done + * through the XInput 2 extension, which also supports + * additional features such as sub-pixel positioning information and additional + * device-dependent information. + * @Title: GdkDeviceManager + * @See_also: #GdkDevice, #GdkEvent, gdk_enable_multidevice() + * + * By default, GDK supports the traditional single keyboard/pointer input scheme (Plus additional + * special input devices such as tablets. In short, backwards compatible with 2.X). Since version 3.0, + * if gdk_enable_multidevice() is called before gdk_display_open() and the platform supports it, GDK + * will be aware of multiple keyboard/pointer pairs interacting simultaneously with the user interface. + * + * Conceptually, in multidevice mode there are 2 device types, virtual devices (or master devices) + * are represented by the pointer cursors and keyboard foci that are seen on the screen. physical + * devices (or slave devices) represent the hardware that is controlling the virtual devices, and + * thus has no visible cursor on the screen. + * + * Virtual devices are always paired, there is a keyboard device for every pointer device, + * associations between devices may be inspected through gdk_device_get_associated_device(). + * + * There may be several virtual devices, and several physical devices could be controlling each of + * these virtual devices. Physical devices may also be "floating", which means they are not attached + * to any virtual device. + * + * By default, GDK will automatically listen for events coming from all master devices, setting the + * #GdkDevice for all events coming from input devices + * + * Events containing device information are #GDK_MOTION_NOTIFY, #GDK_BUTTON_PRESS, #GDK_2BUTTON_PRESS, + * #GDK_3BUTTON_PRESS, #GDK_BUTTON_RELEASE, #GDK_SCROLL, #GDK_KEY_PRESS, #GDK_KEY_RELEASE, + * #GDK_ENTER_NOTIFY, #GDK_LEAVE_NOTIFY, #GDK_FOCUS_CHANGE, #GDK_PROXIMITY_IN, #GDK_PROXIMITY_OUT, + * #GDK_DRAG_ENTER, #GDK_DRAG_LEAVE, #GDK_DRAG_MOTION, #GDK_DRAG_STATUS, #GDK_DROP_START, + * #GDK_DROP_FINISHED and #GDK_GRAB_BROKEN. + * + * , although gdk_window_set_support_multidevice() has to be called on #GdkWindow in order to + * support additional features of multiple pointer interaction, such as multiple, per-device enter/leave + * events. The default setting will emit just one enter/leave event pair for all devices on the window. + * See gdk_window_set_support_multidevice() documentation for more information. + * + * In order to listen for events coming from other than a virtual device, gdk_window_set_device_events() + * must be called. Generally, this function can be used to modify the event mask for any given device. + * + * Input devices may also provide additional information besides X/Y. For example, graphics tablets may + * also provide pressure and X/Y tilt information. This information is device-dependent, and may be + * queried through gdk_device_get_axis(). In multidevice mode, virtual devices will change axes in order + * to always represent the physical device that is routing events through it. Whenever the physical device + * changes, the #GdkDevice:n-axes property will be notified, and gdk_device_list_axes() will return the + * new device axes. + * + * Devices may also have associated keys or macro buttons. Such keys can be + * globally set to map into normal X keyboard events. The mapping is set using gdk_device_set_key(). + * + * In order to query the device hierarchy and be aware of changes in the device hierarchy (such as + * virtual devices being created or removed, or physical devices being plugged or unplugged), GDK + * provides #GdkDeviceManager. On X11, multidevice support is implemented through XInput 2. If + * gdk_enable_multidevice() is called, the XInput 2.x #GdkDeviceManager implementation will be used + * as input source, else either the core or XInput 1.x implementations will be used. + */ + +static void gdk_device_manager_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec); +static void gdk_device_manager_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec); + + +G_DEFINE_ABSTRACT_TYPE (GdkDeviceManager, gdk_device_manager, G_TYPE_OBJECT) + +enum { + PROP_0, + PROP_DISPLAY +}; + +enum { + DEVICE_ADDED, + DEVICE_REMOVED, + DEVICE_CHANGED, + LAST_SIGNAL +}; + +static guint signals [LAST_SIGNAL] = { 0 }; + + +struct _GdkDeviceManagerPrivate +{ + GdkDisplay *display; +}; + + +static void +gdk_device_manager_class_init (GdkDeviceManagerClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->set_property = gdk_device_manager_set_property; + object_class->get_property = gdk_device_manager_get_property; + + g_object_class_install_property (object_class, + PROP_DISPLAY, + g_param_spec_object ("display", + P_("Display"), + P_("Display for the device manager"), + GDK_TYPE_DISPLAY, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + + /** + * GdkDeviceManager::device-added: + * @device_manager: the object on which the signal is emitted + * @device: the newly added #GdkDevice. + * + * The ::device-added signal is emitted either when a new master + * pointer is created, or when a slave (Hardware) input device + * is plugged in. + */ + signals [DEVICE_ADDED] = + g_signal_new (g_intern_static_string ("device-added"), + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GdkDeviceManagerClass, device_added), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + GDK_TYPE_DEVICE); + + /** + * GdkDeviceManager::device-removed: + * @device_manager: the object on which the signal is emitted + * @device: the just removed #GdkDevice. + * + * The ::device-removed signal is emitted either when a master + * pointer is removed, or when a slave (Hardware) input device + * is unplugged. + */ + signals [DEVICE_REMOVED] = + g_signal_new (g_intern_static_string ("device-removed"), + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GdkDeviceManagerClass, device_removed), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + GDK_TYPE_DEVICE); + + /** + * GdkDeviceManager::device-changed: + * @device_manager: the object on which the signal is emitted + * @device: the #GdkDevice that changed. + * + * The ::device-changed signal is emitted either when some + * #GdkDevice has changed the number of either axes or keys. + * For example In X this will normally happen when the slave + * device routing events through the master device changes, + * in that case the master device will change to reflect the + * new slave device axes and keys. + */ + signals [DEVICE_CHANGED] = + g_signal_new (g_intern_static_string ("device-changed"), + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GdkDeviceManagerClass, device_changed), + NULL, NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + GDK_TYPE_DEVICE); + + g_type_class_add_private (object_class, sizeof (GdkDeviceManagerPrivate)); +} + +static void +gdk_device_manager_init (GdkDeviceManager *device_manager) +{ + GdkDeviceManagerPrivate *priv; + + device_manager->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE (device_manager, + GDK_TYPE_DEVICE_MANAGER, + GdkDeviceManagerPrivate); +} + +static void +gdk_device_manager_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GdkDeviceManagerPrivate *priv; + + priv = GDK_DEVICE_MANAGER (object)->priv; + + switch (prop_id) + { + case PROP_DISPLAY: + priv->display = g_value_get_object (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gdk_device_manager_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GdkDeviceManagerPrivate *priv; + + priv = GDK_DEVICE_MANAGER (object)->priv; + + switch (prop_id) + { + case PROP_DISPLAY: + g_value_set_object (value, priv->display); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +/** + * gdk_device_manager_get_display: + * @device_manager: a #GdkDeviceManager + * + * Gets the #GdkDisplay associated to @device_manager. + * + * Returns: the #GdkDisplay to which @device_manager is + * associated to, or #NULL. + * + * Since: 3.0 + **/ +GdkDisplay * +gdk_device_manager_get_display (GdkDeviceManager *device_manager) +{ + GdkDeviceManagerPrivate *priv; + + g_return_val_if_fail (GDK_IS_DEVICE_MANAGER (device_manager), NULL); + + priv = device_manager->priv; + + return priv->display; +} + +/** + * gdk_device_manager_list_devices: + * @device_manager: a #GdkDeviceManager + * @type: device type to get. + * + * Returns the list of devices of type @type currently attached to + * @device_manager. + * + * Returns: a list of #GdkDevices. The returned list must be + * freed with g_list_free (). The list elements are owned by + * GTK+ and must not be freed or unreffed. + * + * Since: 3.0 + **/ +GList * +gdk_device_manager_list_devices (GdkDeviceManager *device_manager, + GdkDeviceType type) +{ + g_return_val_if_fail (GDK_IS_DEVICE_MANAGER (device_manager), NULL); + + return GDK_DEVICE_MANAGER_GET_CLASS (device_manager)->list_devices (device_manager, type); +} + +#define __GDK_DEVICE_MANAGER_C__ +#include "gdkaliasdef.c" diff --git a/gdk/gdkdevicemanager.h b/gdk/gdkdevicemanager.h new file mode 100644 index 0000000000..32ac376884 --- /dev/null +++ b/gdk/gdkdevicemanager.h @@ -0,0 +1,76 @@ +/* GDK - The GIMP Drawing Kit + * Copyright (C) 2009 Carlos Garnacho + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __GDK_DEVICE_MANAGER_H__ +#define __GDK_DEVICE_MANAGER_H__ + +#include +#include + +G_BEGIN_DECLS + +#define GDK_TYPE_DEVICE_MANAGER (gdk_device_manager_get_type ()) +#define GDK_DEVICE_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_DEVICE_MANAGER, GdkDeviceManager)) +#define GDK_DEVICE_MANAGER_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_DEVICE_MANAGER, GdkDeviceManagerClass)) +#define GDK_IS_DEVICE_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_DEVICE_MANAGER)) +#define GDK_IS_DEVICE_MANAGER_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_DEVICE_MANAGER)) +#define GDK_DEVICE_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_DEVICE_MANAGER, GdkDeviceManagerClass)) + +typedef struct _GdkDeviceManager GdkDeviceManager; +typedef struct _GdkDeviceManagerPrivate GdkDeviceManagerPrivate; +typedef struct _GdkDeviceManagerClass GdkDeviceManagerClass; + +struct _GdkDeviceManager +{ + GObject parent_instance; + + /*< private >*/ + GdkDeviceManagerPrivate *priv; +}; + +struct _GdkDeviceManagerClass +{ + GObjectClass parent_class; + + /* Signals */ + void (* device_added) (GdkDeviceManager *device_manager, + GdkDevice *device); + void (* device_removed) (GdkDeviceManager *device_manager, + GdkDevice *device); + void (* device_changed) (GdkDeviceManager *device_manager, + GdkDevice *device); + + /* VMethods */ + GList * (* list_devices) (GdkDeviceManager *device_manager, + GdkDeviceType type); +}; + +GType gdk_device_manager_get_type (void) G_GNUC_CONST; + +GdkDisplay * gdk_device_manager_get_display (GdkDeviceManager *device_manager); +GList * gdk_device_manager_list_devices (GdkDeviceManager *device_manager, + GdkDeviceType type); + +G_END_DECLS + +#endif /* __GDK_DEVICE_MANAGER_H__ */ diff --git a/gdk/gdkdeviceprivate.h b/gdk/gdkdeviceprivate.h new file mode 100644 index 0000000000..8a804e0abc --- /dev/null +++ b/gdk/gdkdeviceprivate.h @@ -0,0 +1,131 @@ +/* GDK - The GIMP Drawing Kit + * Copyright (C) 2009 Carlos Garnacho + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GDK_DEVICE_PRIVATE_H__ +#define __GDK_DEVICE_PRIVATE_H__ + +#include +#include + +G_BEGIN_DECLS + +#define GDK_DEVICE_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_DEVICE, GdkDeviceClass)) +#define GDK_IS_DEVICE_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_DEVICE)) +#define GDK_DEVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_DEVICE, GdkDeviceClass)) + +typedef struct _GdkDeviceClass GdkDeviceClass; + +struct _GdkDeviceClass +{ + GObjectClass parent_class; + + gboolean (* get_history) (GdkDevice *device, + GdkWindow *window, + guint32 start, + guint32 stop, + GdkTimeCoord ***events, + guint *n_events); + + void (* get_state) (GdkDevice *device, + GdkWindow *window, + gdouble *axes, + GdkModifierType *mask); + + void (* set_window_cursor) (GdkDevice *device, + GdkWindow *window, + GdkCursor *cursor); + + void (* warp) (GdkDevice *device, + GdkScreen *screen, + gint x, + gint y); + gboolean (* query_state) (GdkDevice *device, + GdkWindow *window, + GdkWindow **root_window, + GdkWindow **child_window, + gint *root_x, + gint *root_y, + gint *win_x, + gint *win_y, + GdkModifierType *mask); + GdkGrabStatus (* grab) (GdkDevice *device, + GdkWindow *window, + gboolean owner_events, + GdkEventMask event_mask, + GdkWindow *confine_to, + GdkCursor *cursor, + guint32 time_); + void (*ungrab) (GdkDevice *device, + guint32 time_); + + GdkWindow * (* window_at_position) (GdkDevice *device, + gint *win_x, + gint *win_y, + GdkModifierType *mask, + gboolean get_toplevel); + void (* select_window_events) (GdkDevice *device, + GdkWindow *window, + GdkEventMask event_mask); +}; + +void _gdk_device_set_associated_device (GdkDevice *device, + GdkDevice *relative); + +void _gdk_device_reset_axes (GdkDevice *device); +guint _gdk_device_add_axis (GdkDevice *device, + GdkAtom label_atom, + GdkAxisUse use, + gdouble min_value, + gdouble max_value, + gdouble resolution); + +void _gdk_device_set_keys (GdkDevice *device, + guint num_keys); + +GdkAxisUse _gdk_device_get_axis_use (GdkDevice *device, + guint index); + +gboolean _gdk_device_translate_window_coord (GdkDevice *device, + GdkWindow *window, + guint index, + gdouble value, + gdouble *axis_value); + +gboolean _gdk_device_translate_screen_coord (GdkDevice *device, + GdkWindow *window, + gint window_root_x, + gint window_root_y, + guint index, + gdouble value, + gdouble *axis_value); + +gboolean _gdk_device_translate_axis (GdkDevice *device, + guint index, + gdouble value, + gdouble *axis_value); + +GdkTimeCoord ** _gdk_device_allocate_history (GdkDevice *device, + guint n_events); + +void _gdk_input_check_extension_events (GdkDevice *device); + + +G_END_DECLS + +#endif /* __GDK_DEVICE_PRIVATE_H__ */ diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c index ac49a5bf49..d1f6a47a19 100644 --- a/gdk/gdkdisplay.c +++ b/gdk/gdkdisplay.c @@ -33,12 +33,44 @@ #include "gdkalias.h" enum { + OPENED, CLOSED, LAST_SIGNAL }; -static void gdk_display_dispose (GObject *object); -static void gdk_display_finalize (GObject *object); +static void gdk_display_dispose (GObject *object); +static void gdk_display_finalize (GObject *object); + +static void multihead_get_device_state (GdkDisplay *display, + GdkDevice *device, + GdkScreen **screen, + gint *x, + gint *y, + GdkModifierType *mask); +static GdkWindow * multihead_window_get_device_position (GdkDisplay *display, + GdkDevice *device, + GdkWindow *window, + gint *x, + gint *y, + GdkModifierType *mask); +static GdkWindow * multihead_window_at_device_position (GdkDisplay *display, + GdkDevice *device, + gint *win_x, + gint *win_y); + +static void multihead_default_get_pointer (GdkDisplay *display, + GdkScreen **screen, + gint *x, + gint *y, + GdkModifierType *mask); +static GdkWindow * multihead_default_window_get_pointer (GdkDisplay *display, + GdkWindow *window, + gint *x, + gint *y, + GdkModifierType *mask); +static GdkWindow * multihead_default_window_at_pointer (GdkDisplay *display, + gint *win_x, + gint *win_y); static void singlehead_get_pointer (GdkDisplay *display, @@ -62,23 +94,37 @@ static GdkWindow* singlehead_default_window_get_pointer (GdkWindow *window static GdkWindow* singlehead_default_window_at_pointer (GdkScreen *screen, gint *win_x, gint *win_y); -static GdkWindow *gdk_window_real_window_get_pointer (GdkDisplay *display, - GdkWindow *window, - gint *x, - gint *y, - GdkModifierType *mask); -static GdkWindow *gdk_display_real_get_window_at_pointer (GdkDisplay *display, - gint *win_x, - gint *win_y); +static GdkWindow *gdk_window_real_window_get_device_position (GdkDisplay *display, + GdkDevice *device, + GdkWindow *window, + gint *x, + gint *y, + GdkModifierType *mask); +static GdkWindow *gdk_display_real_get_window_at_device_position (GdkDisplay *display, + GdkDevice *device, + gint *win_x, + gint *win_y); static guint signals[LAST_SIGNAL] = { 0 }; static char *gdk_sm_client_id; -static const GdkDisplayPointerHooks default_pointer_hooks = { - _gdk_windowing_get_pointer, - gdk_window_real_window_get_pointer, - gdk_display_real_get_window_at_pointer +static const GdkDisplayDeviceHooks default_device_hooks = { + _gdk_windowing_get_device_state, + gdk_window_real_window_get_device_position, + gdk_display_real_get_window_at_device_position +}; + +static const GdkDisplayDeviceHooks multihead_pointer_hooks = { + multihead_get_device_state, + multihead_window_get_device_position, + multihead_window_at_device_position +}; + +static const GdkDisplayPointerHooks multihead_default_pointer_hooks = { + multihead_default_get_pointer, + multihead_default_window_get_pointer, + multihead_default_window_at_pointer }; static const GdkDisplayPointerHooks singlehead_pointer_hooks = { @@ -93,6 +139,7 @@ static const GdkPointerHooks singlehead_default_pointer_hooks = { }; static const GdkPointerHooks *singlehead_current_pointer_hooks = &singlehead_default_pointer_hooks; +static const GdkDisplayPointerHooks *multihead_current_pointer_hooks = &multihead_default_pointer_hooks; G_DEFINE_TYPE (GdkDisplay, gdk_display, G_TYPE_OBJECT) @@ -100,10 +147,25 @@ static void gdk_display_class_init (GdkDisplayClass *class) { GObjectClass *object_class = G_OBJECT_CLASS (class); - + object_class->finalize = gdk_display_finalize; object_class->dispose = gdk_display_dispose; + /** + * GdkDisplay::opened: + * @display: the object on which the signal is emitted + * + * The ::opened signal is emitted when the connection to the windowing + * system for @display is opened. + */ + signals[OPENED] = + g_signal_new (g_intern_static_string ("opened"), + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_LAST, + 0, NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + /** * GdkDisplay::closed: * @display: the object on which the signal is emitted @@ -126,27 +188,88 @@ gdk_display_class_init (GdkDisplayClass *class) G_TYPE_BOOLEAN); } +static void +free_pointer_info (GdkPointerWindowInfo *info) +{ + g_object_unref (info->toplevel_under_pointer); + g_slice_free (GdkPointerWindowInfo, info); +} + +static void +free_device_grab (GdkDeviceGrabInfo *info) +{ + g_object_unref (info->window); + g_object_unref (info->native_window); + g_free (info); +} + +static gboolean +free_device_grabs_foreach (gpointer key, + gpointer value, + gpointer user_data) +{ + GList *list = value; + + g_list_foreach (list, (GFunc) free_device_grab, NULL); + g_list_free (list); + + return TRUE; +} + +static void +device_removed_cb (GdkDeviceManager *device_manager, + GdkDevice *device, + GdkDisplay *display) +{ + g_hash_table_remove (display->multiple_click_info, device); + g_hash_table_remove (display->device_grabs, device); + g_hash_table_remove (display->pointers_info, device); + + /* FIXME: change core pointer and remove from device list */ +} + +static void +gdk_display_opened (GdkDisplay *display) +{ + GdkDeviceManager *device_manager; + + device_manager = gdk_display_get_device_manager (display); + + g_signal_connect (device_manager, "device-removed", + G_CALLBACK (device_removed_cb), display); +} + static void gdk_display_init (GdkDisplay *display) { _gdk_displays = g_slist_prepend (_gdk_displays, display); - display->button_click_time[0] = display->button_click_time[1] = 0; - display->button_window[0] = display->button_window[1] = NULL; - display->button_number[0] = display->button_number[1] = -1; - display->button_x[0] = display->button_x[1] = 0; - display->button_y[0] = display->button_y[1] = 0; - display->double_click_time = 250; display->double_click_distance = 5; - display->pointer_hooks = &default_pointer_hooks; + display->device_hooks = &default_device_hooks; + + display->device_grabs = g_hash_table_new (NULL, NULL); + display->motion_hint_info = g_hash_table_new_full (NULL, NULL, NULL, + (GDestroyNotify) g_free); + + display->pointers_info = g_hash_table_new_full (NULL, NULL, NULL, + (GDestroyNotify) free_pointer_info); + + display->multiple_click_info = g_hash_table_new_full (NULL, NULL, NULL, + (GDestroyNotify) g_free); + + g_signal_connect (display, "opened", + G_CALLBACK (gdk_display_opened), NULL); } static void gdk_display_dispose (GObject *object) { GdkDisplay *display = GDK_DISPLAY_OBJECT (object); + GdkDeviceManager *device_manager; + + device_manager = gdk_display_get_device_manager (GDK_DISPLAY_OBJECT (object)); g_list_foreach (display->queued_events, (GFunc)gdk_event_free, NULL); g_list_free (display->queued_events); @@ -165,12 +288,28 @@ gdk_display_dispose (GObject *object) NULL); } + if (device_manager) + g_signal_handlers_disconnect_by_func (device_manager, device_removed_cb, object); + G_OBJECT_CLASS (gdk_display_parent_class)->dispose (object); } static void gdk_display_finalize (GObject *object) { + GdkDisplay *display = GDK_DISPLAY_OBJECT (object); + + g_hash_table_foreach_remove (display->device_grabs, + free_device_grabs_foreach, + NULL); + g_hash_table_destroy (display->device_grabs); + + g_hash_table_destroy (display->pointers_info); + g_hash_table_destroy (display->multiple_click_info); + + if (display->device_manager) + g_object_unref (display->device_manager); + G_OBJECT_CLASS (gdk_display_parent_class)->finalize (object); } @@ -272,6 +411,46 @@ gdk_display_put_event (GdkDisplay *display, g_main_context_wakeup (NULL); } +/** + * gdk_display_pointer_ungrab: + * @display: a #GdkDisplay. + * @time_: a timestap (e.g. %GDK_CURRENT_TIME). + * + * Release any pointer grab. + * + * Since: 2.2 + * + * Deprecated: 3.0: Use gdk_device_ungrab(), together with gdk_device_grab() + * instead. + */ +void +gdk_display_pointer_ungrab (GdkDisplay *display, + guint32 time_) +{ + GdkDeviceManager *device_manager; + GList *devices, *dev; + GdkDevice *device; + + g_return_if_fail (GDK_IS_DISPLAY (display)); + + device_manager = gdk_display_get_device_manager (display); + devices = gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_MASTER); + + /* FIXME: Should this be generic to all backends? */ + /* FIXME: What happens with extended devices? */ + for (dev = devices; dev; dev = dev->next) + { + device = dev->data; + + if (device->source != GDK_SOURCE_MOUSE) + continue; + + gdk_device_ungrab (device, time_); + } + + g_list_free (devices); +} + /** * gdk_pointer_ungrab: * @time_: a timestamp from a #GdkEvent, or %GDK_CURRENT_TIME if no @@ -279,6 +458,9 @@ gdk_display_put_event (GdkDisplay *display, * * Ungrabs the pointer on the default display, if it is grabbed by this * application. + * + * Deprecated: 3.0: Use gdk_device_ungrab(), together with gdk_device_grab() + * instead. **/ void gdk_pointer_ungrab (guint32 time) @@ -294,8 +476,10 @@ gdk_pointer_ungrab (guint32 time) * * Note that this does not take the inmplicit pointer grab on button * presses into account. - - * Return value: %TRUE if the pointer is currently grabbed by this application.* + * + * Return value: %TRUE if the pointer is currently grabbed by this application. + * + * Deprecated: 3.0: Use gdk_display_device_is_grabbed() instead. **/ gboolean gdk_pointer_is_grabbed (void) @@ -303,6 +487,46 @@ gdk_pointer_is_grabbed (void) return gdk_display_pointer_is_grabbed (gdk_display_get_default ()); } +/** + * gdk_display_keyboard_ungrab: + * @display: a #GdkDisplay. + * @time_: a timestap (e.g #GDK_CURRENT_TIME). + * + * Release any keyboard grab + * + * Since: 2.2 + * + * Deprecated: 3.0: Use gdk_device_ungrab(), together with gdk_device_grab() + * instead. + */ +void +gdk_display_keyboard_ungrab (GdkDisplay *display, + guint32 time) +{ + GdkDeviceManager *device_manager; + GList *devices, *dev; + GdkDevice *device; + + g_return_if_fail (GDK_IS_DISPLAY (display)); + + device_manager = gdk_display_get_device_manager (display); + devices = gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_MASTER); + + /* FIXME: Should this be generic to all backends? */ + /* FIXME: What happens with extended devices? */ + for (dev = devices; dev; dev = dev->next) + { + device = dev->data; + + if (device->source != GDK_SOURCE_KEYBOARD) + continue; + + gdk_device_ungrab (device, time); + } + + g_list_free (devices); +} + /** * gdk_keyboard_ungrab: * @time_: a timestamp from a #GdkEvent, or %GDK_CURRENT_TIME if no @@ -310,6 +534,9 @@ gdk_pointer_is_grabbed (void) * * Ungrabs the keyboard on the default display, if it is grabbed by this * application. + * + * Deprecated: 3.0: Use gdk_device_ungrab(), together with gdk_device_grab() + * instead. **/ void gdk_keyboard_ungrab (guint32 time) @@ -377,6 +604,10 @@ gdk_event_send_clientmessage_toall (GdkEvent *event) * * Return value: the core pointer device; this is owned by the * display and should not be freed. + * + * Deprecated: 3.0: Use gdk_display_get_device_manager() instead, or + * gdk_event_get_device() if a #GdkEvent with pointer device + * information is available. **/ GdkDevice * gdk_device_get_core_pointer (void) @@ -394,6 +625,10 @@ gdk_device_get_core_pointer (void) * display and should not be freed. * * Since: 2.2 + * + * Deprecated: 3.0: Use gdk_display_get_device_manager() instead, or + * gdk_event_get_device() if a #GdkEvent with device + * information is available. **/ GdkDevice * gdk_display_get_core_pointer (GdkDisplay *display) @@ -445,11 +680,21 @@ _gdk_get_sm_client_id (void) } void -_gdk_display_enable_motion_hints (GdkDisplay *display) +_gdk_display_enable_motion_hints (GdkDisplay *display, + GdkDevice *device) { - gulong serial; - - if (display->pointer_info.motion_hint_serial != 0) + gulong *device_serial, serial; + + device_serial = g_hash_table_lookup (display->motion_hint_info, device); + + if (!device_serial) + { + device_serial = g_new0 (gulong, 1); + *device_serial = G_MAXULONG; + g_hash_table_insert (display->motion_hint_info, device, device_serial); + } + + if (*device_serial != 0) { serial = _gdk_windowing_window_get_next_serial (display); /* We might not actually generate the next request, so @@ -458,11 +703,118 @@ _gdk_display_enable_motion_hints (GdkDisplay *display) anyway. */ if (serial > 0) serial--; - if (serial < display->pointer_info.motion_hint_serial) - display->pointer_info.motion_hint_serial = serial; + if (serial < *device_serial) + *device_serial = serial; } } +/** + * gdk_display_get_device_state: + * @display: a #GdkDisplay. + * @device: device to query status to. + * @screen: location to store the #GdkScreen the @device is on, or %NULL. + * @x: location to store root window X coordinate of @device, or %NULL. + * @y: location to store root window Y coordinate of @device, or %NULL. + * @mask: location to store current modifier mask for @device, or %NULL. + * + * Gets the current location and state of @device for a given display. + * + * Since: 3.0 + **/ +void +gdk_display_get_device_state (GdkDisplay *display, + GdkDevice *device, + GdkScreen **screen, + gint *x, + gint *y, + GdkModifierType *mask) +{ + GdkScreen *tmp_screen; + gint tmp_x, tmp_y; + GdkModifierType tmp_mask; + + g_return_if_fail (GDK_IS_DISPLAY (display)); + g_return_if_fail (GDK_IS_DEVICE (device)); + + display->device_hooks->get_device_state (display, device, &tmp_screen, &tmp_x, &tmp_y, &tmp_mask); + + if (screen) + *screen = tmp_screen; + if (x) + *x = tmp_x; + if (y) + *y = tmp_y; + if (mask) + *mask = tmp_mask; +} + +/** + * gdk_display_get_window_at_device_position: + * @display: a #GdkDisplay. + * @device: #GdkDevice to query info to. + * @win_x: return location for the X coordinate of the device location, relative to the window origin, or %NULL. + * @win_y: return location for the Y coordinate of the device location, relative to the window origin, or %NULL. + * + * Obtains the window underneath @device, returning the location of the device in @win_x and @win_y. Returns + * %NULL if the window tree under @device is not known to GDK (for example, belongs to another application). + * + * Returns: the #GdkWindow under the device position, or %NULL. + * + * Since: 3.0 + **/ +GdkWindow * +gdk_display_get_window_at_device_position (GdkDisplay *display, + GdkDevice *device, + gint *win_x, + gint *win_y) +{ + gint tmp_x, tmp_y; + GdkWindow *window; + + g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL); + g_return_val_if_fail (GDK_IS_DEVICE (device), NULL); + + window = display->device_hooks->window_at_device_position (display, device, &tmp_x, &tmp_y); + + if (win_x) + *win_x = tmp_x; + if (win_y) + *win_y = tmp_y; + + return window; +} + +/** + * gdk_display_set_device_hooks: + * @display: a #GdkDisplay. + * @new_hooks: a table of pointers to functions for getting quantities related to all + * devices position, or %NULL to restore the default table. + * + * This function allows for hooking into the operation of getting the current location of any + * #GdkDevice on a particular #GdkDisplay. This is only useful for such low-level tools as + * an event recorder. Applications should never have any reason to use this facility. + * + * Returns: The previous device hook table. + * + * Since: 3.0 + **/ +GdkDisplayDeviceHooks * +gdk_display_set_device_hooks (GdkDisplay *display, + const GdkDisplayDeviceHooks *new_hooks) +{ + const GdkDisplayDeviceHooks *result; + + g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL); + result = display->device_hooks; + + if (new_hooks) + display->device_hooks = new_hooks; + else + display->device_hooks = &default_device_hooks; + + return (GdkDisplayDeviceHooks *) result; +} + /** * gdk_display_get_pointer: * @display: a #GdkDisplay @@ -476,6 +828,8 @@ _gdk_display_enable_motion_hints (GdkDisplay *display) * mask for a given display. * * Since: 2.2 + * + * Deprecated: 3.0: Use gdk_display_get_device_state() instead. **/ void gdk_display_get_pointer (GdkDisplay *display, @@ -484,33 +838,21 @@ gdk_display_get_pointer (GdkDisplay *display, gint *y, GdkModifierType *mask) { - GdkScreen *tmp_screen; - gint tmp_x, tmp_y; - GdkModifierType tmp_mask; - g_return_if_fail (GDK_IS_DISPLAY (display)); - display->pointer_hooks->get_pointer (display, &tmp_screen, &tmp_x, &tmp_y, &tmp_mask); - - if (screen) - *screen = tmp_screen; - if (x) - *x = tmp_x; - if (y) - *y = tmp_y; - if (mask) - *mask = tmp_mask; + gdk_display_get_device_state (display, display->core_pointer, screen, x, y, mask); } static GdkWindow * -gdk_display_real_get_window_at_pointer (GdkDisplay *display, - gint *win_x, - gint *win_y) +gdk_display_real_get_window_at_device_position (GdkDisplay *display, + GdkDevice *device, + gint *win_x, + gint *win_y) { GdkWindow *window; gint x, y; - window = _gdk_windowing_window_at_pointer (display, &x, &y, NULL, FALSE); + window = _gdk_windowing_window_at_device_position (display, device, &x, &y, NULL, FALSE); /* This might need corrections, as the native window returned may contain client side children */ @@ -532,11 +874,12 @@ gdk_display_real_get_window_at_pointer (GdkDisplay *display, } static GdkWindow * -gdk_window_real_window_get_pointer (GdkDisplay *display, - GdkWindow *window, - gint *x, - gint *y, - GdkModifierType *mask) +gdk_window_real_window_get_device_position (GdkDisplay *display, + GdkDevice *device, + GdkWindow *window, + gint *x, + gint *y, + GdkModifierType *mask) { GdkWindowObject *private; gint tmpx, tmpy; @@ -545,9 +888,10 @@ gdk_window_real_window_get_pointer (GdkDisplay *display, private = (GdkWindowObject *) window; - normal_child = GDK_WINDOW_IMPL_GET_IFACE (private->impl)->get_pointer (window, - &tmpx, &tmpy, - &tmp_mask); + normal_child = GDK_WINDOW_IMPL_GET_IFACE (private->impl)->get_device_state (window, + device, + &tmpx, &tmpy, + &tmp_mask); /* We got the coords on the impl, convert to the window */ tmpx -= private->abs_x; tmpy -= private->abs_y; @@ -580,25 +924,82 @@ gdk_window_real_window_get_pointer (GdkDisplay *display, * Returns: (transfer none): the window under the mouse pointer, or %NULL * * Since: 2.2 + * + * Deprecated: 3.0: Use gdk_display_get_window_at_device_position() instead. **/ GdkWindow * gdk_display_get_window_at_pointer (GdkDisplay *display, gint *win_x, gint *win_y) { - gint tmp_x, tmp_y; - GdkWindow *window; - g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL); - window = display->pointer_hooks->window_at_pointer (display, &tmp_x, &tmp_y); + return gdk_display_get_window_at_device_position (display, display->core_pointer, win_x, win_y); +} - if (win_x) - *win_x = tmp_x; - if (win_y) - *win_y = tmp_y; +static void +multihead_get_device_state (GdkDisplay *display, + GdkDevice *device, + GdkScreen **screen, + gint *x, + gint *y, + GdkModifierType *mask) +{ + multihead_current_pointer_hooks->get_pointer (display, screen, x, y, mask); +} - return window; +static GdkWindow * +multihead_window_get_device_position (GdkDisplay *display, + GdkDevice *device, + GdkWindow *window, + gint *x, + gint *y, + GdkModifierType *mask) +{ + return multihead_current_pointer_hooks->window_get_pointer (display, window, x, y, mask); +} + +static GdkWindow * +multihead_window_at_device_position (GdkDisplay *display, + GdkDevice *device, + gint *win_x, + gint *win_y) +{ + return multihead_current_pointer_hooks->window_at_pointer (display, win_x, win_y); +} + +static void +multihead_default_get_pointer (GdkDisplay *display, + GdkScreen **screen, + gint *x, + gint *y, + GdkModifierType *mask) +{ + return _gdk_windowing_get_device_state (display, + display->core_pointer, + screen, x, y, mask); +} + +static GdkWindow * +multihead_default_window_get_pointer (GdkDisplay *display, + GdkWindow *window, + gint *x, + gint *y, + GdkModifierType *mask) +{ + return gdk_window_real_window_get_device_position (display, + display->core_pointer, + window, x, y, mask); +} + +static GdkWindow * +multihead_default_window_at_pointer (GdkDisplay *display, + gint *win_x, + gint *win_y) +{ + return gdk_display_real_get_window_at_device_position (display, + display->core_pointer, + win_x, win_y); } /** @@ -617,20 +1018,23 @@ gdk_display_get_window_at_pointer (GdkDisplay *display, * Return value: the previous pointer hook table * * Since: 2.2 + * + * Deprecated: 3.0: Use gdk_display_set_device_hooks() instead. **/ GdkDisplayPointerHooks * gdk_display_set_pointer_hooks (GdkDisplay *display, const GdkDisplayPointerHooks *new_hooks) { - const GdkDisplayPointerHooks *result; + const GdkDisplayPointerHooks *result = multihead_current_pointer_hooks; g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL); - result = display->pointer_hooks; if (new_hooks) - display->pointer_hooks = new_hooks; + multihead_current_pointer_hooks = new_hooks; else - display->pointer_hooks = &default_pointer_hooks; + multihead_current_pointer_hooks = &multihead_default_pointer_hooks; + + gdk_display_set_device_hooks (display, &multihead_pointer_hooks); return (GdkDisplayPointerHooks *)result; } @@ -677,8 +1081,13 @@ singlehead_default_window_get_pointer (GdkWindow *window, gint *y, GdkModifierType *mask) { - return gdk_window_real_window_get_pointer (gdk_drawable_get_display (window), - window, x, y, mask); + GdkDisplay *display; + + display = gdk_drawable_get_display (window); + + return gdk_window_real_window_get_device_position (display, + display->core_pointer, + window, x, y, mask); } static GdkWindow* @@ -686,8 +1095,13 @@ singlehead_default_window_at_pointer (GdkScreen *screen, gint *win_x, gint *win_y) { - return gdk_display_real_get_window_at_pointer (gdk_screen_get_display (screen), - win_x, win_y); + GdkDisplay *display; + + display = gdk_screen_get_display (screen); + + return gdk_display_real_get_window_at_device_position (display, + display->core_pointer, + win_x, win_y); } /** @@ -706,6 +1120,8 @@ singlehead_default_window_at_pointer (GdkScreen *screen, * see gdk_display_set_pointer_hooks(). * * Return value: the previous pointer hook table + * + * Deprecated: 3.0: Use gdk_display_set_device_hooks() instead. **/ GdkPointerHooks * gdk_set_pointer_hooks (const GdkPointerHooks *new_hooks) @@ -725,7 +1141,7 @@ gdk_set_pointer_hooks (const GdkPointerHooks *new_hooks) static void generate_grab_broken_event (GdkWindow *window, - gboolean keyboard, + GdkDevice *device, gboolean implicit, GdkWindow *grab_window) { @@ -733,45 +1149,54 @@ generate_grab_broken_event (GdkWindow *window, if (!GDK_WINDOW_DESTROYED (window)) { - GdkEvent event; - event.type = GDK_GRAB_BROKEN; - event.grab_broken.window = window; - event.grab_broken.send_event = 0; - event.grab_broken.keyboard = keyboard; - event.grab_broken.implicit = implicit; - event.grab_broken.grab_window = grab_window; - gdk_event_put (&event); + GdkEvent *event; + + event = gdk_event_new (GDK_GRAB_BROKEN); + event->grab_broken.window = g_object_ref (window); + event->grab_broken.send_event = FALSE; + event->grab_broken.implicit = implicit; + event->grab_broken.grab_window = grab_window; + gdk_event_set_device (event, device); + event->grab_broken.keyboard = (device->source == GDK_SOURCE_KEYBOARD) ? TRUE : FALSE; + + gdk_event_put (event); + gdk_event_free (event); } } -GdkPointerGrabInfo * -_gdk_display_get_last_pointer_grab (GdkDisplay *display) +GdkDeviceGrabInfo * +_gdk_display_get_last_device_grab (GdkDisplay *display, + GdkDevice *device) { GList *l; - l = g_list_last (display->pointer_grabs); + l = g_hash_table_lookup (display->device_grabs, device); - if (l == NULL) - return NULL; - else - return (GdkPointerGrabInfo *)l->data; + if (l) + { + l = g_list_last (l); + return l->data; + } + + return NULL; } - -GdkPointerGrabInfo * -_gdk_display_add_pointer_grab (GdkDisplay *display, - GdkWindow *window, - GdkWindow *native_window, - gboolean owner_events, - GdkEventMask event_mask, - unsigned long serial_start, - guint32 time, - gboolean implicit) +GdkDeviceGrabInfo * +_gdk_display_add_device_grab (GdkDisplay *display, + GdkDevice *device, + GdkWindow *window, + GdkWindow *native_window, + GdkGrabOwnership grab_ownership, + gboolean owner_events, + GdkEventMask event_mask, + unsigned long serial_start, + guint32 time, + gboolean implicit) { - GdkPointerGrabInfo *info, *other_info; - GList *l; + GdkDeviceGrabInfo *info, *other_info; + GList *grabs, *l; - info = g_new0 (GdkPointerGrabInfo, 1); + info = g_new0 (GdkDeviceGrabInfo, 1); info->window = g_object_ref (window); info->native_window = g_object_ref (native_window); @@ -781,19 +1206,22 @@ _gdk_display_add_pointer_grab (GdkDisplay *display, info->event_mask = event_mask; info->time = time; info->implicit = implicit; + info->ownership = grab_ownership; + + grabs = g_hash_table_lookup (display->device_grabs, device); /* Find the first grab that has a larger start time (if any) and insert * before that. I.E we insert after already existing grabs with same * start time */ - for (l = display->pointer_grabs; l != NULL; l = l->next) + for (l = grabs; l != NULL; l = l->next) { other_info = l->data; - + if (info->serial_start < other_info->serial_start) break; } - display->pointer_grabs = - g_list_insert_before (display->pointer_grabs, l, info); + + grabs = g_list_insert_before (grabs, l, info); /* Make sure the new grab end before next grab */ if (l) @@ -801,9 +1229,9 @@ _gdk_display_add_pointer_grab (GdkDisplay *display, other_info = l->data; info->serial_end = other_info->serial_start; } - + /* Find any previous grab and update its end time */ - l = g_list_find (display->pointer_grabs, info); + l = g_list_find (grabs, info); l = l->prev; if (l) { @@ -811,27 +1239,22 @@ _gdk_display_add_pointer_grab (GdkDisplay *display, other_info->serial_end = serial_start; } - return info; -} + g_hash_table_insert (display->device_grabs, device, grabs); -static void -free_pointer_grab (GdkPointerGrabInfo *info) -{ - g_object_unref (info->window); - g_object_unref (info->native_window); - g_free (info); + return info; } /* _gdk_synthesize_crossing_events only works inside one toplevel. This function splits things into two calls if needed, converting the coordinates to the right toplevel */ static void -synthesize_crossing_events (GdkDisplay *display, - GdkWindow *src_window, - GdkWindow *dest_window, - GdkCrossingMode crossing_mode, - guint32 time, - gulong serial) +synthesize_crossing_events (GdkDisplay *display, + GdkDevice *device, + GdkWindow *src_window, + GdkWindow *dest_window, + GdkCrossingMode crossing_mode, + guint32 time, + gulong serial) { GdkWindow *src_toplevel, *dest_toplevel; GdkModifierType state; @@ -862,6 +1285,7 @@ synthesize_crossing_events (GdkDisplay *display, _gdk_synthesize_crossing_events (display, src_window, dest_window, + device, crossing_mode, x, y, state, time, @@ -873,13 +1297,14 @@ synthesize_crossing_events (GdkDisplay *display, gdk_window_get_pointer (src_toplevel, &x, &y, &state); _gdk_synthesize_crossing_events (display, - src_window, - NULL, - crossing_mode, - x, y, state, - time, - NULL, - serial, FALSE); + src_window, + NULL, + device, + crossing_mode, + x, y, state, + time, + NULL, + serial, FALSE); } else { @@ -889,6 +1314,7 @@ synthesize_crossing_events (GdkDisplay *display, _gdk_synthesize_crossing_events (display, src_window, NULL, + device, crossing_mode, x, y, state, time, @@ -899,6 +1325,7 @@ synthesize_crossing_events (GdkDisplay *display, _gdk_synthesize_crossing_events (display, NULL, dest_window, + device, crossing_mode, x, y, state, time, @@ -908,15 +1335,18 @@ synthesize_crossing_events (GdkDisplay *display, } static GdkWindow * -get_current_toplevel (GdkDisplay *display, - int *x_out, int *y_out, +get_current_toplevel (GdkDisplay *display, + GdkDevice *device, + int *x_out, + int *y_out, GdkModifierType *state_out) { GdkWindow *pointer_window; int x, y; GdkModifierType state; - pointer_window = _gdk_windowing_window_at_pointer (display, &x, &y, &state, TRUE); + pointer_window = _gdk_windowing_window_at_device_position (display, device, &x, &y, &state, TRUE); + if (pointer_window != NULL && (GDK_WINDOW_DESTROYED (pointer_window) || GDK_WINDOW_TYPE (pointer_window) == GDK_WINDOW_ROOT || @@ -930,29 +1360,32 @@ get_current_toplevel (GdkDisplay *display, } static void -switch_to_pointer_grab (GdkDisplay *display, - GdkPointerGrabInfo *grab, - GdkPointerGrabInfo *last_grab, - guint32 time, - gulong serial) +switch_to_pointer_grab (GdkDisplay *display, + GdkDevice *device, + GdkDeviceGrabInfo *grab, + GdkDeviceGrabInfo *last_grab, + guint32 time, + gulong serial) { GdkWindow *src_window, *pointer_window, *new_toplevel; + GdkPointerWindowInfo *info; GList *old_grabs; GdkModifierType state; int x, y; /* Temporarily unset pointer to make sure we send the crossing events below */ - old_grabs = display->pointer_grabs; - display->pointer_grabs = NULL; - + old_grabs = g_hash_table_lookup (display->device_grabs, device); + g_hash_table_steal (display->device_grabs, device); + info = _gdk_display_get_pointer_info (display, device); + if (grab) { /* New grab is in effect */ - + /* We need to generate crossing events for the grab. * However, there are never any crossing events for implicit grabs * TODO: ... Actually, this could happen if the pointer window - * doesn't have button mask so a parent gets the event... + * doesn't have button mask so a parent gets the event... */ if (!grab->implicit) { @@ -961,19 +1394,17 @@ switch_to_pointer_grab (GdkDisplay *display, if (last_grab) src_window = last_grab->window; else - src_window = display->pointer_info.window_under_pointer; - + src_window = info->window_under_pointer; + if (src_window != grab->window) - { - synthesize_crossing_events (display, - src_window, grab->window, - GDK_CROSSING_GRAB, time, serial); - } + synthesize_crossing_events (display, device, + src_window, grab->window, + GDK_CROSSING_GRAB, time, serial); /* !owner_event Grabbing a window that we're not inside, current status is now NULL (i.e. outside grabbed window) */ - if (!grab->owner_events && display->pointer_info.window_under_pointer != grab->window) - _gdk_display_set_window_under_pointer (display, NULL); + if (!grab->owner_events && info->window_under_pointer != grab->window) + _gdk_display_set_window_under_pointer (display, device, NULL); } grab->activated = TRUE; @@ -989,18 +1420,18 @@ switch_to_pointer_grab (GdkDisplay *display, /* We force check what window we're in, and update the toplevel_under_pointer info, * as that won't get told of this change with toplevel enter events. */ - if (display->pointer_info.toplevel_under_pointer) - g_object_unref (display->pointer_info.toplevel_under_pointer); - display->pointer_info.toplevel_under_pointer = NULL; + if (info->toplevel_under_pointer) + g_object_unref (info->toplevel_under_pointer); + info->toplevel_under_pointer = NULL; - new_toplevel = get_current_toplevel (display, &x, &y, &state); + new_toplevel = get_current_toplevel (display, device, &x, &y, &state); if (new_toplevel) { /* w is now toplevel and x,y in toplevel coords */ - display->pointer_info.toplevel_under_pointer = g_object_ref (new_toplevel); - display->pointer_info.toplevel_x = x; - display->pointer_info.toplevel_y = y; - display->pointer_info.state = state; + info->toplevel_under_pointer = g_object_ref (new_toplevel); + info->toplevel_x = x; + info->toplevel_y = y; + info->state = state; } } @@ -1015,55 +1446,59 @@ switch_to_pointer_grab (GdkDisplay *display, x, y, NULL, NULL); } - + if (pointer_window != last_grab->window) - synthesize_crossing_events (display, - last_grab->window, pointer_window, - GDK_CROSSING_UNGRAB, time, serial); - + synthesize_crossing_events (display, device, + last_grab->window, pointer_window, + GDK_CROSSING_UNGRAB, time, serial); + /* We're now ungrabbed, update the window_under_pointer */ - _gdk_display_set_window_under_pointer (display, pointer_window); + _gdk_display_set_window_under_pointer (display, device, pointer_window); } } - - display->pointer_grabs = old_grabs; + g_hash_table_insert (display->device_grabs, device, old_grabs); } void -_gdk_display_pointer_grab_update (GdkDisplay *display, - gulong current_serial) +_gdk_display_device_grab_update (GdkDisplay *display, + GdkDevice *device, + gulong current_serial) { - GdkPointerGrabInfo *current_grab, *next_grab; + GdkDeviceGrabInfo *current_grab, *next_grab; + GList *grabs; guint32 time; - - time = display->last_event_time; - while (display->pointer_grabs != NULL) + time = display->last_event_time; + grabs = g_hash_table_lookup (display->device_grabs, device); + + while (grabs != NULL) { - current_grab = display->pointer_grabs->data; + current_grab = grabs->data; if (current_grab->serial_start > current_serial) return; /* Hasn't started yet */ - + if (current_grab->serial_end > current_serial) { /* This one hasn't ended yet. its the currently active one or scheduled to be active */ if (!current_grab->activated) - switch_to_pointer_grab (display, current_grab, NULL, time, current_serial); - + { + if (device->source != GDK_SOURCE_KEYBOARD) + switch_to_pointer_grab (display, device, current_grab, NULL, time, current_serial); + } + break; } - next_grab = NULL; - if (display->pointer_grabs->next) + if (grabs->next) { /* This is the next active grab */ - next_grab = display->pointer_grabs->next->data; - + next_grab = grabs->next->data; + if (next_grab->serial_start > current_serial) next_grab = NULL; /* Actually its not yet active */ } @@ -1071,52 +1506,64 @@ _gdk_display_pointer_grab_update (GdkDisplay *display, if ((next_grab == NULL && current_grab->implicit_ungrab) || (next_grab != NULL && current_grab->window != next_grab->window)) generate_grab_broken_event (GDK_WINDOW (current_grab->window), - FALSE, current_grab->implicit, + device, + current_grab->implicit, next_grab? next_grab->window : NULL); /* Remove old grab */ - display->pointer_grabs = - g_list_delete_link (display->pointer_grabs, - display->pointer_grabs); - - switch_to_pointer_grab (display, - next_grab, current_grab, - time, current_serial); - - free_pointer_grab (current_grab); + grabs = g_list_delete_link (grabs, grabs); + g_hash_table_insert (display->device_grabs, device, grabs); + + if (device->source != GDK_SOURCE_KEYBOARD) + switch_to_pointer_grab (display, device, + next_grab, current_grab, + time, current_serial); + + free_device_grab (current_grab); } } static GList * -find_pointer_grab (GdkDisplay *display, - gulong serial) +grab_list_find (GList *grabs, + gulong serial) { - GdkPointerGrabInfo *grab; - GList *l; + GdkDeviceGrabInfo *grab; - for (l = display->pointer_grabs; l != NULL; l = l->next) + while (grabs) { - grab = l->data; + grab = grabs->data; if (serial >= grab->serial_start && serial < grab->serial_end) - return l; + return grabs; + + grabs = grabs->next; } - + return NULL; } - - -GdkPointerGrabInfo * -_gdk_display_has_pointer_grab (GdkDisplay *display, - gulong serial) +static GList * +find_device_grab (GdkDisplay *display, + GdkDevice *device, + gulong serial) { GList *l; - l = find_pointer_grab (display, serial); + l = g_hash_table_lookup (display->device_grabs, device); + return grab_list_find (l, serial); +} + +GdkDeviceGrabInfo * +_gdk_display_has_device_grab (GdkDisplay *display, + GdkDevice *device, + gulong serial) +{ + GList *l; + + l = find_device_grab (display, device, serial); if (l) return l->data; - + return NULL; } @@ -1124,16 +1571,17 @@ _gdk_display_has_pointer_grab (GdkDisplay *display, * If if_child is non-NULL, end the grab only if the grabbed * window is the same as if_child or a descendant of it */ gboolean -_gdk_display_end_pointer_grab (GdkDisplay *display, - gulong serial, - GdkWindow *if_child, - gboolean implicit) +_gdk_display_end_device_grab (GdkDisplay *display, + GdkDevice *device, + gulong serial, + GdkWindow *if_child, + gboolean implicit) { - GdkPointerGrabInfo *grab; + GdkDeviceGrabInfo *grab; GList *l; - l = find_pointer_grab (display, serial); - + l = find_device_grab (display, device, serial); + if (l == NULL) return FALSE; @@ -1150,96 +1598,128 @@ _gdk_display_end_pointer_grab (GdkDisplay *display, return FALSE; } -void -_gdk_display_set_has_keyboard_grab (GdkDisplay *display, - GdkWindow *window, - GdkWindow *native_window, - gboolean owner_events, - unsigned long serial, - guint32 time) +/* Returns TRUE if device events are not blocked by any grab */ +gboolean +_gdk_display_check_grab_ownership (GdkDisplay *display, + GdkDevice *device, + gulong serial) { - if (display->keyboard_grab.window != NULL && - display->keyboard_grab.window != window) - generate_grab_broken_event (display->keyboard_grab.window, - TRUE, FALSE, window); - - display->keyboard_grab.window = window; - display->keyboard_grab.native_window = native_window; - display->keyboard_grab.owner_events = owner_events; - display->keyboard_grab.serial = serial; - display->keyboard_grab.time = time; + GHashTableIter iter; + gpointer key, value; + GdkGrabOwnership higher_ownership, device_ownership; + gboolean device_is_keyboard; + + g_hash_table_iter_init (&iter, display->device_grabs); + higher_ownership = device_ownership = GDK_OWNERSHIP_NONE; + device_is_keyboard = (device->source == GDK_SOURCE_KEYBOARD); + + while (g_hash_table_iter_next (&iter, &key, &value)) + { + GdkDeviceGrabInfo *grab; + GdkDevice *dev; + GList *grabs; + + dev = key; + grabs = value; + grabs = grab_list_find (grabs, serial); + + if (!grabs) + continue; + + /* Discard device if it's not of the same type */ + if ((device_is_keyboard && dev->source != GDK_SOURCE_KEYBOARD) || + (!device_is_keyboard && dev->source == GDK_SOURCE_KEYBOARD)) + continue; + + grab = grabs->data; + + if (dev == device) + device_ownership = grab->ownership; + else + { + if (grab->ownership > higher_ownership) + higher_ownership = grab->ownership; + } + } + + if (higher_ownership > device_ownership) + { + /* There's a higher priority ownership + * going on for other device(s) + */ + return FALSE; + } + + return TRUE; +} + +GdkPointerWindowInfo * +_gdk_display_get_pointer_info (GdkDisplay *display, + GdkDevice *device) +{ + GdkPointerWindowInfo *info; + + if (G_UNLIKELY (!device)) + return NULL; + + info = g_hash_table_lookup (display->pointers_info, device); + + if (G_UNLIKELY (!info)) + { + info = g_slice_new0 (GdkPointerWindowInfo); + g_hash_table_insert (display->pointers_info, device, info); + } + + return info; } void -_gdk_display_unset_has_keyboard_grab (GdkDisplay *display, - gboolean implicit) +_gdk_display_pointer_info_foreach (GdkDisplay *display, + GdkDisplayPointerInfoForeach func, + gpointer user_data) { - if (implicit) - generate_grab_broken_event (display->keyboard_grab.window, - TRUE, FALSE, NULL); - display->keyboard_grab.window = NULL; + GHashTableIter iter; + gpointer key, value; + + g_hash_table_iter_init (&iter, display->pointers_info); + + while (g_hash_table_iter_next (&iter, &key, &value)) + { + GdkPointerWindowInfo *info = value; + GdkDevice *device = key; + + (func) (display, device, info, user_data); + } } /** - * gdk_keyboard_grab_info_libgtk_only: + * gdk_device_grab_info_libgtk_only: * @display: the display for which to get the grab information + * @device: device to get the grab information from * @grab_window: location to store current grab window * @owner_events: location to store boolean indicating whether - * the @owner_events flag to gdk_keyboard_grab() was %TRUE. - * + * the @owner_events flag to gdk_keyboard_grab() or + * gdk_pointer_grab() was %TRUE. + * * Determines information about the current keyboard grab. * This is not public API and must not be used by applications. - * + * * Return value: %TRUE if this application currently has the * keyboard grabbed. **/ gboolean -gdk_keyboard_grab_info_libgtk_only (GdkDisplay *display, - GdkWindow **grab_window, - gboolean *owner_events) +gdk_device_grab_info_libgtk_only (GdkDisplay *display, + GdkDevice *device, + GdkWindow **grab_window, + gboolean *owner_events) { + GdkDeviceGrabInfo *info; + g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE); + g_return_val_if_fail (GDK_IS_DEVICE (device), FALSE); - if (display->keyboard_grab.window) - { - if (grab_window) - *grab_window = display->keyboard_grab.window; - if (owner_events) - *owner_events = display->keyboard_grab.owner_events; + info = _gdk_display_get_last_device_grab (display, device); - return TRUE; - } - else - return FALSE; -} - -/** - * gdk_pointer_grab_info_libgtk_only: - * @display: the #GdkDisplay for which to get the grab information - * @grab_window: location to store current grab window - * @owner_events: location to store boolean indicating whether - * the @owner_events flag to gdk_pointer_grab() was %TRUE. - * - * Determines information about the current pointer grab. - * This is not public API and must not be used by applications. - * - * Return value: %TRUE if this application currently has the - * pointer grabbed. - **/ -gboolean -gdk_pointer_grab_info_libgtk_only (GdkDisplay *display, - GdkWindow **grab_window, - gboolean *owner_events) -{ - GdkPointerGrabInfo *info; - - g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE); - - /* What we're interested in is the steady state (ie last grab), - because we're interested e.g. if we grabbed so that we - can ungrab, even if our grab is not active just yet. */ - info = _gdk_display_get_last_pointer_grab (display); - if (info) { if (grab_window) @@ -1253,7 +1733,6 @@ gdk_pointer_grab_info_libgtk_only (GdkDisplay *display, return FALSE; } - /** * gdk_display_pointer_is_grabbed: * @display: a #GdkDisplay @@ -1263,21 +1742,77 @@ gdk_pointer_grab_info_libgtk_only (GdkDisplay *display, * Returns: %TRUE if an active X pointer grab is in effect * * Since: 2.2 + * + * Deprecated: 3.0: Use gdk_display_device_is_grabbed() instead. */ gboolean gdk_display_pointer_is_grabbed (GdkDisplay *display) { - GdkPointerGrabInfo *info; - + GdkDeviceManager *device_manager; + GList *devices, *dev; + GdkDevice *device; + g_return_val_if_fail (GDK_IS_DISPLAY (display), TRUE); + device_manager = gdk_display_get_device_manager (display); + devices = gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_MASTER); + + for (dev = devices; dev; dev = dev->next) + { + device = dev->data; + + if (device->source == GDK_SOURCE_MOUSE && + gdk_display_device_is_grabbed (display, device)) + return TRUE; + } + + return FALSE; +} + +/** + * gdk_display_device_is_grabbed: + * @display: a #GdkDisplay + * @device: a #GdkDevice + * + * Returns %TRUE if there is an ongoing grab on @device for @display. + * + * Returns: %TRUE if there is a grab in effect for @device. + **/ +gboolean +gdk_display_device_is_grabbed (GdkDisplay *display, + GdkDevice *device) +{ + GdkDeviceGrabInfo *info; + + g_return_val_if_fail (GDK_IS_DISPLAY (display), TRUE); + g_return_val_if_fail (GDK_IS_DEVICE (device), TRUE); + /* What we're interested in is the steady state (ie last grab), because we're interested e.g. if we grabbed so that we can ungrab, even if our grab is not active just yet. */ - info = _gdk_display_get_last_pointer_grab (display); - + info = _gdk_display_get_last_device_grab (display, device); + return (info && !info->implicit); } +/** + * gdk_display_get_device_manager: + * @display: a #GdkDisplay. + * + * Returns the #GdkDeviceManager associated to @display. + * + * Returns: A #GdkDeviceManager, or %NULL. This memory is + * owned by GDK and must not be freed or unreferenced. + * + * Since: 3.0 + **/ +GdkDeviceManager * +gdk_display_get_device_manager (GdkDisplay *display) +{ + g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL); + + return display->device_manager; +} + #define __GDK_DISPLAY_C__ #include "gdkaliasdef.c" diff --git a/gdk/gdkdisplay.h b/gdk/gdkdisplay.h index 2838d44a02..55fcf3825d 100644 --- a/gdk/gdkdisplay.h +++ b/gdk/gdkdisplay.h @@ -21,7 +21,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) +#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) #error "Only can be included directly." #endif @@ -30,11 +30,13 @@ #include #include +#include G_BEGIN_DECLS typedef struct _GdkDisplayClass GdkDisplayClass; typedef struct _GdkDisplayPointerHooks GdkDisplayPointerHooks; +typedef struct _GdkDisplayDeviceHooks GdkDisplayDeviceHooks; #define GDK_TYPE_DISPLAY (gdk_display_get_type ()) #define GDK_DISPLAY_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DISPLAY, GdkDisplay)) @@ -67,42 +69,51 @@ typedef struct gdouble toplevel_x, toplevel_y; guint32 state; guint32 button; - gulong motion_hint_serial; /* 0 == didn't deliver hinted motion event */ } GdkPointerWindowInfo; +typedef struct +{ + guint32 button_click_time[2]; /* The last 2 button click times. */ + GdkWindow *button_window[2]; /* The last 2 windows to receive button presses. */ + gint button_number[2]; /* The last 2 buttons to be pressed. */ + gint button_x[2]; /* The last 2 button click positions. */ + gint button_y[2]; +} GdkMultipleClickInfo; + struct _GdkDisplay { GObject parent_instance; /*< private >*/ - GList *queued_events; - GList *queued_tail; + GList *GSEAL (queued_events); + GList *GSEAL (queued_tail); /* Information for determining if the latest button click * is part of a double-click or triple-click */ - guint32 button_click_time[2]; /* The last 2 button click times. */ - GdkWindow *button_window[2]; /* The last 2 windows to receive button presses. */ - gint button_number[2]; /* The last 2 buttons to be pressed. */ + GHashTable *GSEAL (multiple_click_info); - guint double_click_time; /* Maximum time between clicks in msecs */ - GdkDevice *core_pointer; /* Core pointer device */ + guint GSEAL (double_click_time); /* Maximum time between clicks in msecs */ + GdkDevice *GSEAL (core_pointer); /* Core pointer device */ - const GdkDisplayPointerHooks *pointer_hooks; /* Current hooks for querying pointer */ + const GdkDisplayDeviceHooks *GSEAL (device_hooks); /* Current hooks for querying pointer */ - guint closed : 1; /* Whether this display has been closed */ - guint ignore_core_events : 1; /* Don't send core motion and button event */ + guint GSEAL (closed) : 1; /* Whether this display has been closed */ + guint GSEAL (ignore_core_events) : 1; /* Don't send core motion and button event */ - guint double_click_distance; /* Maximum distance between clicks in pixels */ - gint button_x[2]; /* The last 2 button click positions. */ - gint button_y[2]; + guint GSEAL (double_click_distance); /* Maximum distance between clicks in pixels */ - GList *pointer_grabs; - GdkKeyboardGrabInfo keyboard_grab; - GdkPointerWindowInfo pointer_info; + GHashTable *GSEAL (device_grabs); + GHashTable *GSEAL (motion_hint_info); + + /* Hashtable containing a GdkPointerWindowInfo for each device */ + GHashTable *GSEAL (pointers_info); /* Last reported event time from server */ - guint32 last_event_time; + guint32 GSEAL (last_event_time); + + /* Device manager associated to the display */ + GdkDeviceManager *GSEAL (device_manager); }; struct _GdkDisplayClass @@ -138,6 +149,44 @@ struct _GdkDisplayPointerHooks gint *win_y); }; +/** + * GdkDisplayDeviceHooks: + * @get_device_state: Obtains the current position and modifier state for + * @device. The position is given in coordinates relative to the window + * containing the pointer, which is returned in @window. + * @window_get_device_position: Obtains the window underneath the device + * position. Current device position and modifier state are returned in + * @x, @y and @mask. The position is given in coordinates relative to + * @window. + * @window_at_device_position: Obtains the window underneath the device + * position, returning the location of that window in @win_x, @win_y. + * Returns %NULL if the window under the mouse pointer is not known to + * GDK (for example, belongs to another application). + * + * A table of pointers to functions for getting quantities related to + * the current device position. Each #GdkDisplay has a table of this type, + * which can be set using gdk_display_set_device_hooks(). + */ +struct _GdkDisplayDeviceHooks +{ + void (* get_device_state) (GdkDisplay *display, + GdkDevice *device, + GdkScreen **screen, + gint *x, + gint *y, + GdkModifierType *mask); + GdkWindow * (* window_get_device_position) (GdkDisplay *display, + GdkDevice *device, + GdkWindow *window, + gint *x, + gint *y, + GdkModifierType *mask); + GdkWindow * (* window_at_device_position) (GdkDisplay *display, + GdkDevice *device, + gint *win_x, + gint *win_y); +}; + GType gdk_display_get_type (void) G_GNUC_CONST; GdkDisplay *gdk_display_open (const gchar *display_name); @@ -147,18 +196,26 @@ gint gdk_display_get_n_screens (GdkDisplay *display); GdkScreen * gdk_display_get_screen (GdkDisplay *display, gint screen_num); GdkScreen * gdk_display_get_default_screen (GdkDisplay *display); + +#ifndef GDK_MULTIDEVICE_SAFE void gdk_display_pointer_ungrab (GdkDisplay *display, guint32 time_); void gdk_display_keyboard_ungrab (GdkDisplay *display, guint32 time_); gboolean gdk_display_pointer_is_grabbed (GdkDisplay *display); +#endif /* GDK_MULTIDEVICE_SAFE */ + +gboolean gdk_display_device_is_grabbed (GdkDisplay *display, + GdkDevice *device); void gdk_display_beep (GdkDisplay *display); void gdk_display_sync (GdkDisplay *display); void gdk_display_flush (GdkDisplay *display); void gdk_display_close (GdkDisplay *display); +#ifndef GDK_DISABLE_DEPRECATED GList * gdk_display_list_devices (GdkDisplay *display); +#endif /* GDK_DISABLE_DEPRECATED */ GdkEvent* gdk_display_get_event (GdkDisplay *display); GdkEvent* gdk_display_peek_event (GdkDisplay *display); @@ -177,7 +234,11 @@ void gdk_display_set_double_click_distance (GdkDisplay *display, GdkDisplay *gdk_display_get_default (void); +#ifndef GDK_MULTIDEVICE_SAFE + +#ifndef GDK_DISABLE_DEPRECATED GdkDevice *gdk_display_get_core_pointer (GdkDisplay *display); +#endif /* GDK_DISABLE_DEPRECATED */ void gdk_display_get_pointer (GdkDisplay *display, GdkScreen **screen, @@ -191,9 +252,31 @@ void gdk_display_warp_pointer (GdkDisplay *disp GdkScreen *screen, gint x, gint y); +#endif /* GDK_MULTIDEVICE_SAFE */ +void gdk_display_get_device_state (GdkDisplay *display, + GdkDevice *device, + GdkScreen **screen, + gint *x, + gint *y, + GdkModifierType *mask); +GdkWindow * gdk_display_get_window_at_device_position (GdkDisplay *display, + GdkDevice *device, + gint *win_x, + gint *win_y); +void gdk_display_warp_device (GdkDisplay *display, + GdkDevice *device, + GdkScreen *screen, + gint x, + gint y); + +#ifndef GDK_MULTIDEVICE_SAFE GdkDisplayPointerHooks *gdk_display_set_pointer_hooks (GdkDisplay *display, const GdkDisplayPointerHooks *new_hooks); +#endif /* GDK_MULTIDEVICE_SAFE */ + +GdkDisplayDeviceHooks *gdk_display_set_device_hooks (GdkDisplay *display, + const GdkDisplayDeviceHooks *new_hooks); GdkDisplay *gdk_display_open_default_libgtk_only (void); @@ -221,6 +304,9 @@ gboolean gdk_display_supports_shapes (GdkDisplay *display); gboolean gdk_display_supports_input_shapes (GdkDisplay *display); gboolean gdk_display_supports_composite (GdkDisplay *display); +GdkDeviceManager * gdk_display_get_device_manager (GdkDisplay *display); + + G_END_DECLS #endif /* __GDK_DISPLAY_H__ */ diff --git a/gdk/gdkdisplaymanager.h b/gdk/gdkdisplaymanager.h index eef441f258..9b0afc9f8a 100644 --- a/gdk/gdkdisplaymanager.h +++ b/gdk/gdkdisplaymanager.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) +#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gdk/gdkdnd.c b/gdk/gdkdnd.c index 2d114faf49..e601b961e7 100644 --- a/gdk/gdkdnd.c +++ b/gdk/gdkdnd.c @@ -77,5 +77,78 @@ gdk_drag_get_protocol (GdkNativeWindow xid, return gdk_drag_get_protocol_for_display (gdk_display_get_default (), xid, protocol); } +/** + * gdk_drag_context_list_targets: + * @context: a #GdkDragContext + * + * Retrieves the list of targets of the context. + * + * Return value: a #GList of targets + * + * Since: 2.22 + **/ +GList * +gdk_drag_context_list_targets (GdkDragContext *context) +{ + g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), NULL); + + return context->targets; +} + +/** + * gdk_drag_context_get_actions: + * @context: a #GdkDragContext + * + * Determines the bitmask of actions proposed by the source if + * gdk_drag_context_suggested_action() returns GDK_ACTION_ASK. + * + * Return value: the #GdkDragAction flags + * + * Since: 2.22 + **/ +GdkDragAction +gdk_drag_context_get_actions (GdkDragContext *context) +{ + g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), GDK_ACTION_DEFAULT); + + return context->actions; +} + +/** + * gdk_drag_context_get_suggested_action: + * @context: a #GdkDragContext + * + * Determines the suggested drag action of the context. + * + * Return value: a #GdkDragAction value + * + * Since: 2.22 + **/ +GdkDragAction +gdk_drag_context_get_suggested_action (GdkDragContext *context) +{ + g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), 0); + + return context->suggested_action; +} + +/** + * gdk_drag_context_selected_get_action: + * @context: a #GdkDragContext + * + * Determines the action chosen by the drag destination. + * + * Return value: a #GdkDragAction value + * + * Since: 2.22 + **/ +GdkDragAction +gdk_drag_context_get_selected_action (GdkDragContext *context) +{ + g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), 0); + + return context->action; +} + #define __GDK_DND_C__ #include "gdkaliasdef.c" diff --git a/gdk/gdkdnd.h b/gdk/gdkdnd.h index b9f83352f5..c6a8079d40 100644 --- a/gdk/gdkdnd.h +++ b/gdk/gdkdnd.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) +#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) #error "Only can be included directly." #endif @@ -32,6 +32,7 @@ #define __GDK_DND_H__ #include +#include G_BEGIN_DECLS @@ -77,29 +78,28 @@ struct _GdkDragContext { /*< public >*/ - GdkDragProtocol protocol; - - gboolean is_source; - - GdkWindow *source_window; - GdkWindow *dest_window; + GdkDragProtocol GSEAL (protocol); - GList *targets; - GdkDragAction actions; - GdkDragAction suggested_action; - GdkDragAction action; + gboolean GSEAL (is_source); + + GdkWindow *GSEAL (source_window); + GdkWindow *GSEAL (dest_window); - guint32 start_time; + GList *GSEAL (targets); + GdkDragAction GSEAL (actions); + GdkDragAction GSEAL (suggested_action); + GdkDragAction GSEAL (action); + + guint32 GSEAL (start_time); /*< private >*/ - gpointer windowing_data; + gpointer GSEAL (windowing_data); }; struct _GdkDragContextClass { GObjectClass parent_class; - }; /* Drag and Drop */ @@ -107,10 +107,14 @@ struct _GdkDragContextClass { GType gdk_drag_context_get_type (void) G_GNUC_CONST; GdkDragContext * gdk_drag_context_new (void); -#ifndef GDK_DISABLE_DEPRECATED -void gdk_drag_context_ref (GdkDragContext *context); -void gdk_drag_context_unref (GdkDragContext *context); -#endif +void gdk_drag_context_set_device (GdkDragContext *context, + GdkDevice *device); +GdkDevice * gdk_drag_context_get_device (GdkDragContext *context); + +GList *gdk_drag_context_list_targets (GdkDragContext *context); +GdkDragAction gdk_drag_context_get_actions (GdkDragContext *context); +GdkDragAction gdk_drag_context_get_suggested_action (GdkDragContext *context); +GdkDragAction gdk_drag_context_get_selected_action (GdkDragContext *context); /* Destination side */ diff --git a/gdk/gdkdrawable.h b/gdk/gdkdrawable.h index 44beaf7fdd..b8dabb56f1 100644 --- a/gdk/gdkdrawable.h +++ b/gdk/gdkdrawable.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) +#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gdk/gdkenumtypes.h.template b/gdk/gdkenumtypes.h.template index 85487f47f4..7475ee82f3 100644 --- a/gdk/gdkenumtypes.h.template +++ b/gdk/gdkenumtypes.h.template @@ -1,5 +1,5 @@ /*** BEGIN file-header ***/ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) +#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c index 2dbb242370..e073115d46 100644 --- a/gdk/gdkevents.c +++ b/gdk/gdkevents.c @@ -26,6 +26,7 @@ #include "config.h" #include /* For memset() */ +#include #include "gdk.h" #include "gdkinternals.h" @@ -446,6 +447,7 @@ gdk_event_copy (const GdkEvent *event) GdkEventPrivate *private = (GdkEventPrivate *)event; new_private->screen = private->screen; + new_private->device = private->device; } switch (event->any.type) @@ -511,7 +513,7 @@ gdk_event_copy (const GdkEvent *event) * Frees a #GdkEvent, freeing or decrementing any resources associated with it. * Note that this function should only be called with events returned from * functions such as gdk_event_peek(), gdk_event_get(), - * gdk_event_get_graphics_expose() and gdk_event_copy(). + * gdk_event_get_graphics_expose(), gdk_event_copy() and gdk_event_new(). **/ void gdk_event_free (GdkEvent *event) @@ -645,7 +647,7 @@ gdk_event_get_time (const GdkEvent *event) /** * gdk_event_get_state: * @event: a #GdkEvent or NULL - * @state: return location for state + * @state: (out): return location for state * * If the event contains a "state" field, puts that field in @state. Otherwise * stores an empty state (0). Returns %TRUE if there was a state field @@ -725,8 +727,8 @@ gdk_event_get_state (const GdkEvent *event, /** * gdk_event_get_coords: * @event: a #GdkEvent - * @x_win: location to put event window x coordinate - * @y_win: location to put event window y coordinate + * @x_win: (out): location to put event window x coordinate + * @y_win: (out): location to put event window y coordinate * * Extract the event window relative x/y coordinates from an event. * @@ -784,8 +786,8 @@ gdk_event_get_coords (const GdkEvent *event, /** * gdk_event_get_root_coords: * @event: a #GdkEvent - * @x_root: location to put root window x coordinate - * @y_root: location to put root window y coordinate + * @x_root: (out): location to put root window x coordinate + * @y_root: (out): location to put root window y coordinate * * Extract the root window relative x/y coordinates from an event. * @@ -848,8 +850,8 @@ gdk_event_get_root_coords (const GdkEvent *event, /** * gdk_event_get_axis: * @event: a #GdkEvent - * @axis_use: the axis use to look for - * @value: location to store the value found + * @axis_use: (out): the axis use to look for + * @value: (out): location to store the value found * * Extract the axis value for a particular axis use from * an event structure. @@ -919,6 +921,95 @@ gdk_event_get_axis (const GdkEvent *event, return gdk_device_get_axis (device, axes, axis_use, value); } +/** + * gdk_event_set_device: + * @event: a #GdkEvent + * @device: a #GdkDevice + * + * Sets the device for @event to @device. The event must + * have been allocated by GTK+, for instance, by + * gdk_event_copy(). + * + * Since: 3.0 + **/ +void +gdk_event_set_device (GdkEvent *event, + GdkDevice *device) +{ + GdkEventPrivate *private; + + g_return_if_fail (gdk_event_is_allocated (event)); + + private = (GdkEventPrivate *) event; + + private->device = device; + + switch (event->type) + { + case GDK_MOTION_NOTIFY: + event->motion.device = device; + break; + case GDK_BUTTON_PRESS: + case GDK_2BUTTON_PRESS: + case GDK_3BUTTON_PRESS: + case GDK_BUTTON_RELEASE: + event->button.device = device; + break; + case GDK_SCROLL: + event->scroll.device = device; + break; + case GDK_PROXIMITY_IN: + case GDK_PROXIMITY_OUT: + event->proximity.device = device; + break; + default: + break; + } +} + +/** + * gdk_event_get_device: + * @event: a #GdkEvent. + * + * If the event contains a "device" field, this function will return + * it, else it will return %NULL. + * + * Returns: a #GdkDevice, or %NULL. + * + * Since: 3.0 + **/ +GdkDevice * +gdk_event_get_device (const GdkEvent *event) +{ + g_return_val_if_fail (event != NULL, NULL); + + if (gdk_event_is_allocated (event)) + { + GdkEventPrivate *private = (GdkEventPrivate *) event; + + if (private->device) + return private->device; + } + + switch (event->type) + { + case GDK_MOTION_NOTIFY: + return event->motion.device; + case GDK_BUTTON_PRESS: + case GDK_2BUTTON_PRESS: + case GDK_3BUTTON_PRESS: + case GDK_BUTTON_RELEASE: + return event->button.device; + case GDK_SCROLL: + return event->scroll.device; + case GDK_PROXIMITY_IN: + case GDK_PROXIMITY_OUT: + return event->proximity.device; + default: + return NULL; + } +} + /** * gdk_event_request_motions: * @event: a valid #GdkEvent @@ -954,10 +1045,141 @@ gdk_event_request_motions (const GdkEventMotion *event) gdk_device_get_state (event->device, event->window, NULL, NULL); display = gdk_drawable_get_display (event->window); - _gdk_display_enable_motion_hints (display); + _gdk_display_enable_motion_hints (display, event->device); } } +static gboolean +gdk_events_get_axis_distances (GdkEvent *event1, + GdkEvent *event2, + gdouble *x_distance, + gdouble *y_distance, + gdouble *distance) +{ + gdouble x1, x2, y1, y2; + gdouble xd, yd; + + if (!gdk_event_get_coords (event1, &x1, &y1) || + !gdk_event_get_coords (event2, &x2, &y2)) + return FALSE; + + xd = x2 - x1; + yd = y2 - y1; + + if (x_distance) + *x_distance = xd; + + if (y_distance) + *y_distance = yd; + + if (distance) + *distance = sqrt ((xd * xd) + (yd * yd)); + + return TRUE; +} + +/** + * gdk_events_get_distance: + * @event1: first #GdkEvent + * @event2: second #GdkEvent + * @distance: return location for the distance + * + * If both events have X/Y information, the distance between both coordinates + * (as in a straight line going from @event1 to @event2) will be returned. + * + * Returns: %TRUE if the distance could be calculated. + * + * Since: 3.0 + **/ +gboolean +gdk_events_get_distance (GdkEvent *event1, + GdkEvent *event2, + gdouble *distance) +{ + return gdk_events_get_axis_distances (event1, event2, + NULL, NULL, + distance); +} + +/** + * gdk_events_get_angle: + * @event1: first #GdkEvent + * @event2: second #GdkEvent + * @angle: return location for the relative angle between both events + * + * If both events contain X/Y information, this function will return %TRUE + * and return in @angle the relative angle from @event1 to @event2. The rotation + * direction for positive angles is from the positive X axis towards the positive + * Y axis. + * + * Returns: %TRUE if the angle could be calculated. + * + * Since: 3.0 + **/ +gboolean +gdk_events_get_angle (GdkEvent *event1, + GdkEvent *event2, + gdouble *angle) +{ + gdouble x_distance, y_distance, distance; + + if (!gdk_events_get_axis_distances (event1, event2, + &x_distance, &y_distance, + &distance)) + return FALSE; + + if (angle) + { + *angle = atan2 (x_distance, y_distance); + + /* Invert angle */ + *angle = (2 * G_PI) - *angle; + + /* Shift it 90° */ + *angle += G_PI / 2; + + /* And constraint it to 0°-360° */ + *angle = fmod (*angle, 2 * G_PI); + } + + return TRUE; +} + +/** + * gdk_events_get_center: + * @event1: first #GdkEvent + * @event2: second #GdkEvent + * @x: (out): return location for the X coordinate of the center + * @y: (out): return location for the Y coordinate of the center + * + * If both events contain X/Y information, the center of both coordinates + * will be returned in @x and @y. + * + * Returns: %TRUE if the center could be calculated. + * + * Since: 3.0 + **/ +gboolean +gdk_events_get_center (GdkEvent *event1, + GdkEvent *event2, + gdouble *x, + gdouble *y) +{ + gdouble x1, x2, y1, y2; + + if (!gdk_event_get_coords (event1, &x1, &y1) || + !gdk_event_get_coords (event2, &x2, &y2)) + return FALSE; + + if (x) + *x = (x2 + x1) / 2; + + if (y) + *y = (y2 + y1) / 2; + + return TRUE; +} + /** * gdk_event_set_screen: * @event: a #GdkEvent @@ -1186,54 +1408,67 @@ void _gdk_event_button_generate (GdkDisplay *display, GdkEvent *event) { - if ((event->button.time < (display->button_click_time[1] + 2*display->double_click_time)) && - (event->button.window == display->button_window[1]) && - (event->button.button == display->button_number[1]) && - (ABS (event->button.x - display->button_x[1]) <= display->double_click_distance) && - (ABS (event->button.y - display->button_y[1]) <= display->double_click_distance)) -{ - gdk_synthesize_click (display, event, 3); - - display->button_click_time[1] = 0; - display->button_click_time[0] = 0; - display->button_window[1] = NULL; - display->button_window[0] = NULL; - display->button_number[1] = -1; - display->button_number[0] = -1; - display->button_x[0] = display->button_x[1] = 0; - display->button_y[0] = display->button_y[1] = 0; + GdkMultipleClickInfo *info; + + info = g_hash_table_lookup (display->multiple_click_info, event->button.device); + + if (G_UNLIKELY (!info)) + { + info = g_new0 (GdkMultipleClickInfo, 1); + info->button_number[0] = info->button_number[1] = -1; + + g_hash_table_insert (display->multiple_click_info, + event->button.device, info); } - else if ((event->button.time < (display->button_click_time[0] + display->double_click_time)) && - (event->button.window == display->button_window[0]) && - (event->button.button == display->button_number[0]) && - (ABS (event->button.x - display->button_x[0]) <= display->double_click_distance) && - (ABS (event->button.y - display->button_y[0]) <= display->double_click_distance)) + + if ((event->button.time < (info->button_click_time[1] + 2 * display->double_click_time)) && + (event->button.window == info->button_window[1]) && + (event->button.button == info->button_number[1]) && + (ABS (event->button.x - info->button_x[1]) <= display->double_click_distance) && + (ABS (event->button.y - info->button_y[1]) <= display->double_click_distance)) + { + gdk_synthesize_click (display, event, 3); + + info->button_click_time[1] = 0; + info->button_click_time[0] = 0; + info->button_window[1] = NULL; + info->button_window[0] = NULL; + info->button_number[1] = -1; + info->button_number[0] = -1; + info->button_x[0] = info->button_x[1] = 0; + info->button_y[0] = info->button_y[1] = 0; + } + else if ((event->button.time < (info->button_click_time[0] + display->double_click_time)) && + (event->button.window == info->button_window[0]) && + (event->button.button == info->button_number[0]) && + (ABS (event->button.x - info->button_x[0]) <= display->double_click_distance) && + (ABS (event->button.y - info->button_y[0]) <= display->double_click_distance)) { gdk_synthesize_click (display, event, 2); - display->button_click_time[1] = display->button_click_time[0]; - display->button_click_time[0] = event->button.time; - display->button_window[1] = display->button_window[0]; - display->button_window[0] = event->button.window; - display->button_number[1] = display->button_number[0]; - display->button_number[0] = event->button.button; - display->button_x[1] = display->button_x[0]; - display->button_x[0] = event->button.x; - display->button_y[1] = display->button_y[0]; - display->button_y[0] = event->button.y; + info->button_click_time[1] = info->button_click_time[0]; + info->button_click_time[0] = event->button.time; + info->button_window[1] = info->button_window[0]; + info->button_window[0] = event->button.window; + info->button_number[1] = info->button_number[0]; + info->button_number[0] = event->button.button; + info->button_x[1] = info->button_x[0]; + info->button_x[0] = event->button.x; + info->button_y[1] = info->button_y[0]; + info->button_y[0] = event->button.y; } else { - display->button_click_time[1] = 0; - display->button_click_time[0] = event->button.time; - display->button_window[1] = NULL; - display->button_window[0] = event->button.window; - display->button_number[1] = -1; - display->button_number[0] = event->button.button; - display->button_x[1] = 0; - display->button_x[0] = event->button.x; - display->button_y[1] = 0; - display->button_y[0] = event->button.y; + info->button_click_time[1] = 0; + info->button_click_time[0] = event->button.time; + info->button_window[1] = NULL; + info->button_window[0] = event->button.window; + info->button_number[1] = -1; + info->button_number[0] = event->button.button; + info->button_x[1] = 0; + info->button_x[0] = event->button.x; + info->button_y[1] = 0; + info->button_y[0] = event->button.y; } } diff --git a/gdk/gdkevents.h b/gdk/gdkevents.h index e6c516c780..f8f6d1a61a 100644 --- a/gdk/gdkevents.h +++ b/gdk/gdkevents.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) +#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) #error "Only can be included directly." #endif @@ -34,7 +34,7 @@ #include #include #include -#include +#include G_BEGIN_DECLS @@ -72,10 +72,25 @@ typedef void (*GdkEventFunc) (GdkEvent *event, /* Event filtering */ +/** + * GdkXEvent: + * + * Used to represent native events (XEvents for the X11 + * backend, MSGs for Win32). + */ typedef void GdkXEvent; /* Can be cast to window system specific * even type, XEvent on X11, MSG on Win32. */ +/** + * GdkFilterReturn: + * @GDK_FILTER_CONTINUE: event not handled, continue processing. + * @GDK_FILTER_TRANSLATE: native event translated into a GDK event and stored + * in the event structure that was passed in. + * @GDK_FILTER_REMOVE: event handled, terminate processing. + * + * Specifies the result of applying a #GdkFilterFunc to a native event. + */ typedef enum { GDK_FILTER_CONTINUE, /* Event not handled, continue processesing */ GDK_FILTER_TRANSLATE, /* Native event translated into a GDK event and @@ -84,6 +99,23 @@ typedef enum { GDK_FILTER_REMOVE /* Terminate processing, removing event */ } GdkFilterReturn; +/** + * GdkFilterFunc: + * @xevent: the native event to filter. + * @event: the GDK event to which the X event will be translated. + * @data: user data set when the filter was installed. + * + * Specifies the type of function used to filter native events before they are + * converted to GDK events. + * + * When a filter is called, @event is unpopulated, except for + * event->window. The filter may translate the native + * event to a GDK event and store the result in @event, or handle it without + * translation. If the filter translates the event and processing should + * continue, it should return %GDK_FILTER_TRANSLATE. + * + * Returns: a #GdkFilterReturn value. + */ typedef GdkFilterReturn (*GdkFilterFunc) (GdkXEvent *xevent, GdkEvent *event, gpointer data); @@ -155,35 +187,6 @@ typedef enum GDK_EVENT_LAST /* helper variable for decls */ } GdkEventType; -/* Event masks. (Used to select what types of events a window - * will receive). - */ -typedef enum -{ - GDK_EXPOSURE_MASK = 1 << 1, - GDK_POINTER_MOTION_MASK = 1 << 2, - GDK_POINTER_MOTION_HINT_MASK = 1 << 3, - GDK_BUTTON_MOTION_MASK = 1 << 4, - GDK_BUTTON1_MOTION_MASK = 1 << 5, - GDK_BUTTON2_MOTION_MASK = 1 << 6, - GDK_BUTTON3_MOTION_MASK = 1 << 7, - GDK_BUTTON_PRESS_MASK = 1 << 8, - GDK_BUTTON_RELEASE_MASK = 1 << 9, - GDK_KEY_PRESS_MASK = 1 << 10, - GDK_KEY_RELEASE_MASK = 1 << 11, - GDK_ENTER_NOTIFY_MASK = 1 << 12, - GDK_LEAVE_NOTIFY_MASK = 1 << 13, - GDK_FOCUS_CHANGE_MASK = 1 << 14, - GDK_STRUCTURE_MASK = 1 << 15, - GDK_PROPERTY_CHANGE_MASK = 1 << 16, - GDK_VISIBILITY_NOTIFY_MASK = 1 << 17, - GDK_PROXIMITY_IN_MASK = 1 << 18, - GDK_PROXIMITY_OUT_MASK = 1 << 19, - GDK_SUBSTRUCTURE_MASK = 1 << 20, - GDK_SCROLL_MASK = 1 << 21, - GDK_ALL_EVENTS_MASK = 0x3FFFFE -} GdkEventMask; - typedef enum { GDK_VISIBILITY_UNOBSCURED, @@ -519,9 +522,6 @@ gboolean gdk_events_pending (void); GdkEvent* gdk_event_get (void); GdkEvent* gdk_event_peek (void); -#ifndef GDK_DISABLE_DEPRECATED -GdkEvent* gdk_event_get_graphics_expose (GdkWindow *window); -#endif void gdk_event_put (const GdkEvent *event); GdkEvent* gdk_event_new (GdkEventType type); @@ -540,7 +540,22 @@ gboolean gdk_event_get_root_coords (const GdkEvent *event, gboolean gdk_event_get_axis (const GdkEvent *event, GdkAxisUse axis_use, gdouble *value); +void gdk_event_set_device (GdkEvent *event, + GdkDevice *device); +GdkDevice* gdk_event_get_device (const GdkEvent *event); void gdk_event_request_motions (const GdkEventMotion *event); + +gboolean gdk_events_get_distance (GdkEvent *event1, + GdkEvent *event2, + gdouble *distance); +gboolean gdk_events_get_angle (GdkEvent *event1, + GdkEvent *event2, + gdouble *angle); +gboolean gdk_events_get_center (GdkEvent *event1, + GdkEvent *event2, + gdouble *x, + gdouble *y); + void gdk_event_handler_set (GdkEventFunc func, gpointer data, GDestroyNotify notify); diff --git a/gdk/gdkgc.c b/gdk/gdkgc.c index 42dc712270..fbdfb6d5ed 100644 --- a/gdk/gdkgc.c +++ b/gdk/gdkgc.c @@ -222,36 +222,6 @@ gdk_gc_finalize (GObject *object) G_OBJECT_CLASS (gdk_gc_parent_class)->finalize (object); } -/** - * gdk_gc_ref: - * @gc: a #GdkGC - * - * Deprecated function; use g_object_ref() instead. - * - * Return value: the gc. - * - * Deprecated: 2.0: Use g_object_ref() instead. - **/ -GdkGC * -gdk_gc_ref (GdkGC *gc) -{ - return (GdkGC *) g_object_ref (gc); -} - -/** - * gdk_gc_unref: - * @gc: a #GdkGC - * - * Decrement the reference count of @gc. - * - * Deprecated: 2.0: Use g_object_unref() instead. - **/ -void -gdk_gc_unref (GdkGC *gc) -{ - g_object_unref (gc); -} - /** * gdk_gc_get_values: * @gc: a #GdkGC. @@ -409,29 +379,6 @@ gdk_gc_set_background (GdkGC *gc, gdk_gc_set_values (gc, &values, GDK_GC_BACKGROUND); } -/** - * gdk_gc_set_font: - * @gc: a #GdkGC. - * @font: the new font. - * - * Sets the font for a graphics context. (Note that - * all text-drawing functions in GDK take a @font - * argument; the value set here is used when that - * argument is %NULL.) - **/ -void -gdk_gc_set_font (GdkGC *gc, - GdkFont *font) -{ - GdkGCValues values; - - g_return_if_fail (GDK_IS_GC (gc)); - g_return_if_fail (font != NULL); - - values.font = font; - gdk_gc_set_values (gc, &values, GDK_GC_FONT); -} - /** * gdk_gc_set_function: * @gc: a #GdkGC. diff --git a/gdk/gdkgc.h b/gdk/gdkgc.h index c64d2af5b4..a8b84e2c36 100644 --- a/gdk/gdkgc.h +++ b/gdk/gdkgc.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) +#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) #error "Only can be included directly." #endif @@ -190,12 +190,12 @@ struct _GdkGC { GObject parent_instance; - gint clip_x_origin; - gint clip_y_origin; - gint ts_x_origin; - gint ts_y_origin; + gint GSEAL (clip_x_origin); + gint GSEAL (clip_y_origin); + gint GSEAL (ts_x_origin); + gint GSEAL (ts_y_origin); - GdkColormap *colormap; + GdkColormap *GSEAL (colormap); }; struct _GdkGCClass @@ -226,11 +226,6 @@ GdkGC *gdk_gc_new_with_values (GdkDrawable *drawable, GdkGCValues *values, GdkGCValuesMask values_mask); -#ifndef GDK_DISABLE_DEPRECATED -GdkGC *gdk_gc_ref (GdkGC *gc); -void gdk_gc_unref (GdkGC *gc); -#endif - void gdk_gc_get_values (GdkGC *gc, GdkGCValues *values); void gdk_gc_set_values (GdkGC *gc, @@ -240,10 +235,6 @@ void gdk_gc_set_foreground (GdkGC *gc, const GdkColor *color); void gdk_gc_set_background (GdkGC *gc, const GdkColor *color); -#ifndef GDK_DISABLE_DEPRECATED -void gdk_gc_set_font (GdkGC *gc, - GdkFont *font); -#endif /* GDK_DISABLE_DEPRECATED */ void gdk_gc_set_function (GdkGC *gc, GdkFunction function); void gdk_gc_set_fill (GdkGC *gc, @@ -293,9 +284,6 @@ void gdk_gc_set_rgb_bg_color (GdkGC *gc, const GdkColor *color); GdkScreen * gdk_gc_get_screen (GdkGC *gc); -#ifndef GDK_DISABLE_DEPRECATED -#define gdk_gc_destroy g_object_unref -#endif /* GDK_DISABLE_DEPRECATED */ G_END_DECLS diff --git a/gdk/gdkglobals.c b/gdk/gdkglobals.c index 4c3ad80956..a805bcc5bf 100644 --- a/gdk/gdkglobals.c +++ b/gdk/gdkglobals.c @@ -40,6 +40,7 @@ gchar *_gdk_display_name = NULL; gint _gdk_screen_number = -1; gchar *_gdk_display_arg_name = NULL; gboolean _gdk_native_windows = FALSE; +gboolean _gdk_enable_multidevice = FALSE; GSList *_gdk_displays = NULL; diff --git a/gdk/gdki18n.h b/gdk/gdki18n.h deleted file mode 100644 index 9e70be0b6d..0000000000 --- a/gdk/gdki18n.h +++ /dev/null @@ -1,59 +0,0 @@ -/* GDK - The GIMP Drawing Kit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#ifndef __GDK_I18N_H__ -#define __GDK_I18N_H__ - -#ifndef GDK_DISABLE_DEPRECATED - -/* GDK uses "glib". (And so does GTK). - */ -#include -#include - -/* international string support */ - -#include - -#if !defined(GDK_HAVE_BROKEN_WCTYPE) && (defined(GDK_HAVE_WCTYPE_H) || defined(GDK_HAVE_WCHAR_H)) && !defined(X_LOCALE) -# ifdef GDK_HAVE_WCTYPE_H -# include -# else -# ifdef GDK_HAVE_WCHAR_H -# include -# endif -# endif -# define gdk_iswalnum(c) iswalnum(c) -# define gdk_iswspace(c) iswspace(c) -#else -# include -# define gdk_iswalnum(c) ((wchar_t)(c) <= 0xFF && isalnum(c)) -# define gdk_iswspace(c) ((wchar_t)(c) <= 0xFF && isspace(c)) -#endif - -#endif /* GDK_DISABLE_DEPRECATED */ - -#endif /* __GDK_I18N_H__ */ diff --git a/gdk/gdkimage.c b/gdk/gdkimage.c index 9c9b1a3d63..7b04925ffb 100644 --- a/gdk/gdkimage.c +++ b/gdk/gdkimage.c @@ -34,71 +34,6 @@ #include "gdkinternals.h" /* For scratch_image code */ #include "gdkalias.h" -/** - * gdk_image_ref: - * @image: a #GdkImage - * - * Deprecated function; use g_object_ref() instead. - * - * Return value: the image - * - * Deprecated: 2.0: Use g_object_ref() instead. - **/ -GdkImage * -gdk_image_ref (GdkImage *image) -{ - g_return_val_if_fail (GDK_IS_IMAGE (image), NULL); - - return g_object_ref (image); -} - -/** - * gdk_image_unref: - * @image: a #GdkImage - * - * Deprecated function; use g_object_unref() instead. - * - * Deprecated: 2.0: Use g_object_unref() instead. - **/ -void -gdk_image_unref (GdkImage *image) -{ - g_return_if_fail (GDK_IS_IMAGE (image)); - - g_object_unref (image); -} - -/** - * gdk_image_get: - * @drawable: a #GdkDrawable - * @x: x coordinate in @window - * @y: y coordinate in @window - * @width: width of area in @window - * @height: height of area in @window - * - * This is a deprecated wrapper for gdk_drawable_get_image(); - * gdk_drawable_get_image() should be used instead. Or even better: in - * most cases gdk_pixbuf_get_from_drawable() is the most convenient - * choice. - * - * Return value: a new #GdkImage or %NULL - **/ -GdkImage* -gdk_image_get (GdkWindow *drawable, - gint x, - gint y, - gint width, - gint height) -{ - g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL); - g_return_val_if_fail (x >= 0, NULL); - g_return_val_if_fail (y >= 0, NULL); - g_return_val_if_fail (width >= 0, NULL); - g_return_val_if_fail (height >= 0, NULL); - - return gdk_drawable_get_image (drawable, x, y, width, height); -} - /** * gdk_image_set_colormap: * @image: a #GdkImage @@ -146,6 +81,168 @@ gdk_image_get_colormap (GdkImage *image) return image->colormap; } +/** + * gdk_image_get_image_type: + * @image: a #GdkImage + * + * Determines the type of a given image. + * + * Return value: the #GdkImageType of the image + * + * Since: 2.22 + **/ +GdkImageType +gdk_image_get_image_type (GdkImage *image) +{ + g_return_val_if_fail (GDK_IS_IMAGE (image), 0); + + return image->type; +} + +/** + * gdk_image_get_visual: + * @image: a #GdkImage + * + * Determines the visual that was used to create the image. + * + * Return value: a #GdkVisual + * + * Since: 2.22 + **/ +GdkVisual * +gdk_image_get_visual (GdkImage *image) +{ + g_return_val_if_fail (GDK_IS_IMAGE (image), NULL); + + return image->visual; +} + +/** + * gdk_image_get_byte_order: + * @image: a #GdkImage + * + * Determines the byte order of the image. + * + * Return value: a #GdkVisual + * + * Since: 2.22 + **/ +GdkByteOrder +gdk_image_get_byte_order (GdkImage *image) +{ + g_return_val_if_fail (GDK_IS_IMAGE (image), 0); + + return image->byte_order; +} + +/** + * gdk_image_get_width: + * @image: a #GdkImage + * + * Determines the width of the image. + * + * Return value: the width + * + * Since: 2.22 + **/ +gint +gdk_image_get_width (GdkImage *image) +{ + g_return_val_if_fail (GDK_IS_IMAGE (image), 0); + + return image->width; +} + +/** + * gdk_image_get_height: + * @image: a #GdkImage + * + * Determines the height of the image. + * + * Return value: the height + * + * Since: 2.22 + **/ +gint +gdk_image_get_height (GdkImage *image) +{ + g_return_val_if_fail (GDK_IS_IMAGE (image), 0); + + return image->height; +} + +/** + * gdk_image_get_depth: + * @image: a #GdkImage + * + * Determines the depth of the image. + * + * Return value: the depth + * + * Since: 2.22 + **/ +guint16 +gdk_image_get_depth (GdkImage *image) +{ + g_return_val_if_fail (GDK_IS_IMAGE (image), 0); + + return image->depth; +} + +/** + * gdk_image_get_bytes_per_pixel: + * @image: a #GdkImage + * + * Determines the number of bytes per pixel of the image. + * + * Return value: the bytes per pixel + * + * Since: 2.22 + **/ +guint16 +gdk_image_get_bytes_per_pixel (GdkImage *image) +{ + g_return_val_if_fail (GDK_IS_IMAGE (image), 0); + + return image->bpp; +} + +/** + * gdk_image_get_bytes_per_line: + * @image: a #GdkImage + * + * Determines the number of bytes per line of the image. + * + * Return value: the bytes per line + * + * Since: 2.22 + **/ +guint16 +gdk_image_get_bytes_per_line (GdkImage *image) +{ + g_return_val_if_fail (GDK_IS_IMAGE (image), 0); + + return image->bpl; +} + +/** + * gdk_image_get_bits_per_pixel: + * @image: a #GdkImage + * + * Determines the number of bits per pixel of the image. + * + * Return value: the bits per pixel + * + * Since: 2.22 + **/ +guint16 +gdk_image_get_bits_per_pixel (GdkImage *image) +{ + g_return_val_if_fail (GDK_IS_IMAGE (image), 0); + + return image->bits_per_pixel; +} + /* We have N_REGION GDK_SCRATCH_IMAGE_WIDTH x GDK_SCRATCH_IMAGE_HEIGHT regions divided * up between n_images different images. possible_n_images gives * various divisors of N_REGIONS. The reason for allowing this diff --git a/gdk/gdkimage.h b/gdk/gdkimage.h index 92ac4ff800..8106f0b296 100644 --- a/gdk/gdkimage.h +++ b/gdk/gdkimage.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) +#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) #error "Only can be included directly." #endif @@ -68,21 +68,21 @@ struct _GdkImage /*< public >*/ - GdkImageType type; /* read only. */ - GdkVisual *visual; /* read only. visual used to create the image */ - GdkByteOrder byte_order; /* read only. */ - gint width; /* read only. */ - gint height; /* read only. */ - guint16 depth; /* read only. */ - guint16 bpp; /* read only. bytes per pixel */ - guint16 bpl; /* read only. bytes per line */ - guint16 bits_per_pixel; /* read only. bits per pixel */ - gpointer mem; + GdkImageType GSEAL (type); /* read only. */ + GdkVisual *GSEAL (visual); /* read only. visual used to create the image */ + GdkByteOrder GSEAL (byte_order); /* read only. */ + gint GSEAL (width); /* read only. */ + gint GSEAL (height); /* read only. */ + guint16 GSEAL (depth); /* read only. */ + guint16 GSEAL (bpp); /* read only. bytes per pixel */ + guint16 GSEAL (bpl); /* read only. bytes per line */ + guint16 GSEAL (bits_per_pixel); /* read only. bits per pixel */ + gpointer GSEAL (mem); - GdkColormap *colormap; /* read only. */ + GdkColormap *GSEAL (colormap); /* read only. */ /*< private >*/ - gpointer windowing_data; /* read only. */ + gpointer GSEAL (windowing_data); /* read only. */ }; struct _GdkImageClass @@ -97,17 +97,6 @@ GdkImage* gdk_image_new (GdkImageType type, gint width, gint height); -#ifndef GDK_DISABLE_DEPRECATED -GdkImage* gdk_image_get (GdkDrawable *drawable, - gint x, - gint y, - gint width, - gint height); - -GdkImage * gdk_image_ref (GdkImage *image); -void gdk_image_unref (GdkImage *image); -#endif - void gdk_image_put_pixel (GdkImage *image, gint x, gint y, @@ -120,17 +109,16 @@ void gdk_image_set_colormap (GdkImage *image, GdkColormap *colormap); GdkColormap* gdk_image_get_colormap (GdkImage *image); +GdkImageType gdk_image_get_image_type (GdkImage *image); +GdkVisual *gdk_image_get_visual (GdkImage *image); +GdkByteOrder gdk_image_get_byte_order (GdkImage *image); +gint gdk_image_get_width (GdkImage *image); +gint gdk_image_get_height (GdkImage *image); +guint16 gdk_image_get_depth (GdkImage *image); +guint16 gdk_image_get_bytes_per_pixel(GdkImage *image); +guint16 gdk_image_get_bytes_per_line (GdkImage *image); +guint16 gdk_image_get_bits_per_pixel (GdkImage *image); -#ifdef GDK_ENABLE_BROKEN -GdkImage* gdk_image_new_bitmap (GdkVisual *visual, - gpointer data, - gint width, - gint height); -#endif /* GDK_ENABLE_BROKEN */ - -#ifndef GDK_DISABLE_DEPRECATED -#define gdk_image_destroy g_object_unref -#endif /* GDK_DISABLE_DEPRECATED */ G_END_DECLS diff --git a/gdk/gdkinput.h b/gdk/gdkinput.h index 9e1bbc76fe..bc30cd2ef4 100644 --- a/gdk/gdkinput.h +++ b/gdk/gdkinput.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) +#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) #error "Only can be included directly." #endif @@ -32,147 +32,27 @@ #define __GDK_INPUT_H__ #include +#include G_BEGIN_DECLS -#define GDK_TYPE_DEVICE (gdk_device_get_type ()) -#define GDK_DEVICE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DEVICE, GdkDevice)) -#define GDK_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DEVICE, GdkDeviceClass)) -#define GDK_IS_DEVICE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_DEVICE)) -#define GDK_IS_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DEVICE)) -#define GDK_DEVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DEVICE, GdkDeviceClass)) - -typedef struct _GdkDeviceKey GdkDeviceKey; -typedef struct _GdkDeviceAxis GdkDeviceAxis; -typedef struct _GdkDevice GdkDevice; -typedef struct _GdkDeviceClass GdkDeviceClass; -typedef struct _GdkTimeCoord GdkTimeCoord; - -typedef enum -{ - GDK_EXTENSION_EVENTS_NONE, - GDK_EXTENSION_EVENTS_ALL, - GDK_EXTENSION_EVENTS_CURSOR -} GdkExtensionMode; - -typedef enum -{ - GDK_SOURCE_MOUSE, - GDK_SOURCE_PEN, - GDK_SOURCE_ERASER, - GDK_SOURCE_CURSOR -} GdkInputSource; - -typedef enum -{ - GDK_MODE_DISABLED, - GDK_MODE_SCREEN, - GDK_MODE_WINDOW -} GdkInputMode; - -typedef enum -{ - GDK_AXIS_IGNORE, - GDK_AXIS_X, - GDK_AXIS_Y, - GDK_AXIS_PRESSURE, - GDK_AXIS_XTILT, - GDK_AXIS_YTILT, - GDK_AXIS_WHEEL, - GDK_AXIS_LAST -} GdkAxisUse; - -struct _GdkDeviceKey -{ - guint keyval; - GdkModifierType modifiers; -}; - -struct _GdkDeviceAxis -{ - GdkAxisUse use; - gdouble min; - gdouble max; -}; - -struct _GdkDevice -{ - GObject parent_instance; - /* All fields are read-only */ - - gchar *name; - GdkInputSource source; - GdkInputMode mode; - gboolean has_cursor; /* TRUE if the X pointer follows device motion */ - - gint num_axes; - GdkDeviceAxis *axes; - - gint num_keys; - GdkDeviceKey *keys; -}; - -/* We don't allocate each coordinate this big, but we use it to - * be ANSI compliant and avoid accessing past the defined limits. - */ -#define GDK_MAX_TIMECOORD_AXES 128 - -struct _GdkTimeCoord -{ - guint32 time; - gdouble axes[GDK_MAX_TIMECOORD_AXES]; -}; - -GType gdk_device_get_type (void) G_GNUC_CONST; +#if !defined (GDK_MULTIDEVICE_SAFE) && !defined (GDK_DISABLE_DEPRECATED) #ifndef GDK_MULTIHEAD_SAFE -/* Returns a list of GdkDevice * */ -GList * gdk_devices_list (void); + +/* Returns a list of GdkDevice * */ +GList * gdk_devices_list (void); + +GdkDevice *gdk_device_get_core_pointer (void); + #endif /* GDK_MULTIHEAD_SAFE */ -/* Functions to configure a device */ -void gdk_device_set_source (GdkDevice *device, - GdkInputSource source); - -gboolean gdk_device_set_mode (GdkDevice *device, - GdkInputMode mode); - -void gdk_device_set_key (GdkDevice *device, - guint index_, - guint keyval, - GdkModifierType modifiers); - -void gdk_device_set_axis_use (GdkDevice *device, - guint index_, - GdkAxisUse use); - -void gdk_device_get_state (GdkDevice *device, - GdkWindow *window, - gdouble *axes, - GdkModifierType *mask); - -gboolean gdk_device_get_history (GdkDevice *device, - GdkWindow *window, - guint32 start, - guint32 stop, - GdkTimeCoord ***events, - gint *n_events); - -void gdk_device_free_history (GdkTimeCoord **events, - gint n_events); -gboolean gdk_device_get_axis (GdkDevice *device, - gdouble *axes, - GdkAxisUse use, - gdouble *value); - void gdk_input_set_extension_events (GdkWindow *window, gint mask, GdkExtensionMode mode); -#ifndef GDK_MULTIHEAD_SAFE -GdkDevice *gdk_device_get_core_pointer (void); -#endif - +#endif /* !GDK_MULTIDEVICE_SAFE && GDK_DISABLE_DEPRECATED */ + G_END_DECLS #endif /* __GDK_INPUT_H__ */ diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h index 822335fcd4..b154c57240 100644 --- a/gdk/gdkinternals.h +++ b/gdk/gdkinternals.h @@ -169,6 +169,7 @@ struct _GdkEventPrivate guint flags; GdkScreen *screen; gpointer windowing_data; + GdkDevice *device; }; /* Tracks information about the pointer grab on this display */ @@ -182,13 +183,19 @@ typedef struct guint event_mask; gboolean implicit; guint32 time; + GdkGrabOwnership ownership; - gboolean activated; - gboolean implicit_ungrab; -} GdkPointerGrabInfo; + guint activated : 1; + guint implicit_ungrab : 1; +} GdkDeviceGrabInfo; typedef struct _GdkInputWindow GdkInputWindow; +typedef void (* GdkDisplayPointerInfoForeach) (GdkDisplay *display, + GdkDevice *device, + GdkPointerWindowInfo *device_info, + gpointer user_data); + /* Private version of GdkWindowObject. The initial part of this strucuture is public for historical reasons. Don't change that part */ typedef struct _GdkWindowPaint GdkWindowPaint; @@ -236,6 +243,7 @@ struct _GdkWindowObject guint accept_focus : 1; guint focus_on_map : 1; guint shaped : 1; + guint support_multidevice : 1; GdkEventMask event_mask; @@ -255,6 +263,7 @@ struct _GdkWindowObject GdkRegion *clip_region; /* Clip region (wrt toplevel) in window coords */ GdkRegion *clip_region_with_children; /* Clip region in window coords */ GdkCursor *cursor; + GHashTable *device_cursor; gint8 toplevel_window_type; guint synthesize_crossing_event_queued : 1; guint effective_visibility : 2; @@ -274,6 +283,9 @@ struct _GdkWindowObject cairo_surface_t *cairo_surface; guint outstanding_surfaces; /* only set on impl window */ + + GList *devices_inside; + GHashTable *device_events; }; #define GDK_WINDOW_TYPE(d) (((GdkWindowObject*)(GDK_WINDOW (d)))->window_type) @@ -287,6 +299,7 @@ extern GSList *_gdk_displays; extern gchar *_gdk_display_name; extern gint _gdk_screen_number; extern gchar *_gdk_display_arg_name; +extern gboolean _gdk_enable_multidevice; void _gdk_events_queue (GdkDisplay *display); GdkEvent* _gdk_event_unqueue (GdkDisplay *display); @@ -315,6 +328,9 @@ void gdk_synthesize_window_state (GdkWindow *window, GdkWindowState unset_flags, GdkWindowState set_flags); +GdkDeviceManager * _gdk_device_manager_new (GdkDisplay *display); + + #define GDK_SCRATCH_IMAGE_WIDTH 256 #define GDK_SCRATCH_IMAGE_HEIGHT 64 @@ -453,17 +469,20 @@ GdkRegion *_gdk_windowing_get_shape_for_mask (GdkBitmap *mask); void _gdk_windowing_window_beep (GdkWindow *window); -void _gdk_windowing_get_pointer (GdkDisplay *display, +void _gdk_windowing_get_device_state (GdkDisplay *display, + GdkDevice *device, GdkScreen **screen, gint *x, gint *y, GdkModifierType *mask); -GdkWindow* _gdk_windowing_window_at_pointer (GdkDisplay *display, - gint *win_x, - gint *win_y, - GdkModifierType *mask, - gboolean get_toplevel); -GdkGrabStatus _gdk_windowing_pointer_grab (GdkWindow *window, +GdkWindow* _gdk_windowing_window_at_device_position (GdkDisplay *display, + GdkDevice *device, + gint *win_x, + gint *win_y, + GdkModifierType *mask, + gboolean get_toplevel); +GdkGrabStatus _gdk_windowing_device_grab (GdkDevice *device, + GdkWindow *window, GdkWindow *native, gboolean owner_events, GdkEventMask event_mask, @@ -580,34 +599,41 @@ char *_gdk_windowing_get_startup_notify_id (GAppLaunchContext *context, void _gdk_windowing_launch_failed (GAppLaunchContext *context, const char *startup_notify_id); -GdkPointerGrabInfo *_gdk_display_get_active_pointer_grab (GdkDisplay *display); -void _gdk_display_pointer_grab_update (GdkDisplay *display, - gulong current_serial); -GdkPointerGrabInfo *_gdk_display_get_last_pointer_grab (GdkDisplay *display); -GdkPointerGrabInfo *_gdk_display_add_pointer_grab (GdkDisplay *display, - GdkWindow *window, - GdkWindow *native_window, - gboolean owner_events, - GdkEventMask event_mask, - unsigned long serial_start, - guint32 time, - gboolean implicit); -GdkPointerGrabInfo * _gdk_display_has_pointer_grab (GdkDisplay *display, - gulong serial); -gboolean _gdk_display_end_pointer_grab (GdkDisplay *display, - gulong serial, - GdkWindow *if_child, - gboolean implicit); -void _gdk_display_set_has_keyboard_grab (GdkDisplay *display, - GdkWindow *window, - GdkWindow *native_window, - gboolean owner_events, - unsigned long serial, - guint32 time); -void _gdk_display_unset_has_keyboard_grab (GdkDisplay *display, - gboolean implicit); -void _gdk_display_enable_motion_hints (GdkDisplay *display); +void _gdk_display_device_grab_update (GdkDisplay *display, + GdkDevice *device, + gulong current_serial); +GdkDeviceGrabInfo *_gdk_display_get_last_device_grab (GdkDisplay *display, + GdkDevice *device); +GdkDeviceGrabInfo *_gdk_display_add_device_grab (GdkDisplay *display, + GdkDevice *device, + GdkWindow *window, + GdkWindow *native_window, + GdkGrabOwnership grab_ownership, + gboolean owner_events, + GdkEventMask event_mask, + unsigned long serial_start, + guint32 time, + gboolean implicit); +GdkDeviceGrabInfo * _gdk_display_has_device_grab (GdkDisplay *display, + GdkDevice *device, + gulong serial); +gboolean _gdk_display_end_device_grab (GdkDisplay *display, + GdkDevice *device, + gulong serial, + GdkWindow *if_child, + gboolean implicit); +gboolean _gdk_display_check_grab_ownership (GdkDisplay *display, + GdkDevice *device, + gulong serial); +void _gdk_display_enable_motion_hints (GdkDisplay *display, + GdkDevice *device); +GdkPointerWindowInfo * _gdk_display_get_pointer_info (GdkDisplay *display, + GdkDevice *device); + +void _gdk_display_pointer_info_foreach (GdkDisplay *display, + GdkDisplayPointerInfoForeach func, + gpointer user_data); void _gdk_window_invalidate_for_expose (GdkWindow *window, GdkRegion *region); @@ -639,6 +665,7 @@ gboolean _gdk_window_event_parent_of (GdkWindow *parent, void _gdk_synthesize_crossing_events (GdkDisplay *display, GdkWindow *src, GdkWindow *dest, + GdkDevice *device, GdkCrossingMode mode, gint toplevel_x, gint toplevel_y, @@ -648,7 +675,8 @@ void _gdk_synthesize_crossing_events (GdkDisplay *display, gulong serial, gboolean non_linear); void _gdk_display_set_window_under_pointer (GdkDisplay *display, - GdkWindow *window); + GdkDevice *device, + GdkWindow *window); void _gdk_synthesize_crossing_events_for_geometry_change (GdkWindow *changed_window); diff --git a/gdk/gdkkeys.h b/gdk/gdkkeys.h index a6750ce439..ebab21bfcb 100644 --- a/gdk/gdkkeys.h +++ b/gdk/gdkkeys.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) +#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) #error "Only can be included directly." #endif @@ -66,7 +66,7 @@ typedef struct _GdkKeymapClass GdkKeymapClass; struct _GdkKeymap { GObject parent_instance; - GdkDisplay *display; + GdkDisplay *GSEAL (display); }; struct _GdkKeymapClass diff --git a/gdk/gdkoffscreenwindow.c b/gdk/gdkoffscreenwindow.c index 23d92affd2..2c4113b0fa 100644 --- a/gdk/gdkoffscreenwindow.c +++ b/gdk/gdkoffscreenwindow.c @@ -811,10 +811,11 @@ gdk_offscreen_window_get_deskrelative_origin (GdkWindow *window, } static gboolean -gdk_offscreen_window_get_pointer (GdkWindow *window, - gint *x, - gint *y, - GdkModifierType *mask) +gdk_offscreen_window_get_device_state (GdkWindow *window, + GdkDevice *device, + gint *x, + gint *y, + GdkModifierType *mask) { GdkWindowObject *private = GDK_WINDOW_OBJECT (window); GdkOffscreenWindow *offscreen; @@ -829,7 +830,7 @@ gdk_offscreen_window_get_pointer (GdkWindow *window, offscreen = GDK_OFFSCREEN_WINDOW (private->impl); if (offscreen->embedder != NULL) { - gdk_window_get_pointer (offscreen->embedder, &tmpx, &tmpy, &tmpmask); + gdk_window_get_device_position (offscreen->embedder, device, &tmpx, &tmpy, &tmpmask); from_embedder (window, tmpx, tmpy, &dtmpx, &dtmpy); @@ -1109,27 +1110,6 @@ gdk_offscreen_window_set_static_gravities (GdkWindow *window, return TRUE; } -static void -gdk_offscreen_window_set_cursor (GdkWindow *window, - GdkCursor *cursor) -{ - GdkWindowObject *private = (GdkWindowObject *)window; - GdkOffscreenWindow *offscreen; - - offscreen = GDK_OFFSCREEN_WINDOW (private->impl); - - if (offscreen->cursor) - { - gdk_cursor_unref (offscreen->cursor); - offscreen->cursor = NULL; - } - - if (cursor) - offscreen->cursor = gdk_cursor_ref (cursor); - - /* TODO: The cursor is never actually used... */ -} - static void gdk_offscreen_window_get_geometry (GdkWindow *window, gint *x, @@ -1289,7 +1269,6 @@ gdk_offscreen_window_impl_iface_init (GdkWindowImplIface *iface) iface->get_events = gdk_offscreen_window_get_events; iface->set_events = gdk_offscreen_window_set_events; iface->reparent = gdk_offscreen_window_reparent; - iface->set_cursor = gdk_offscreen_window_set_cursor; iface->get_geometry = gdk_offscreen_window_get_geometry; iface->shape_combine_region = gdk_offscreen_window_shape_combine_region; iface->input_shape_combine_region = gdk_offscreen_window_input_shape_combine_region; @@ -1298,7 +1277,7 @@ gdk_offscreen_window_impl_iface_init (GdkWindowImplIface *iface) iface->queue_translation = gdk_offscreen_window_queue_translation; iface->get_root_coords = gdk_offscreen_window_get_root_coords; iface->get_deskrelative_origin = gdk_offscreen_window_get_deskrelative_origin; - iface->get_pointer = gdk_offscreen_window_get_pointer; + iface->get_device_state = gdk_offscreen_window_get_device_state; iface->destroy = gdk_offscreen_window_destroy; } diff --git a/gdk/gdkpango.c b/gdk/gdkpango.c index 825b238b79..a4ca42436f 100644 --- a/gdk/gdkpango.c +++ b/gdk/gdkpango.c @@ -764,24 +764,6 @@ gdk_pango_renderer_set_override_color (GdkPangoRenderer *gdk_renderer, priv->override_color_set[part] = FALSE; } -/** - * gdk_pango_context_set_colormap: - * @context: a #PangoContext - * @colormap: a #GdkColormap - * - * This function used to set the colormap to be used for drawing with - * @context. The colormap is now always derived from the graphics - * context used for drawing, so calling this function is no longer - * necessary. - **/ -void -gdk_pango_context_set_colormap (PangoContext *context, - GdkColormap *colormap) -{ - g_return_if_fail (PANGO_IS_CONTEXT (context)); - g_return_if_fail (colormap == NULL || GDK_IS_COLORMAP (colormap)); -} - /* Gets a renderer to draw with, setting the properties of the * renderer and activating it. Note that since we activate the * renderer here, the implicit setting of the matrix that diff --git a/gdk/gdkpango.h b/gdk/gdkpango.h index 39df0ef4d1..df559e336c 100644 --- a/gdk/gdkpango.h +++ b/gdk/gdkpango.h @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) +#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) #error "Only can be included directly." #endif @@ -108,10 +108,6 @@ PangoContext *gdk_pango_context_get_for_screen (GdkScreen *screen); #ifndef GDK_MULTIHEAD_SAFE PangoContext *gdk_pango_context_get (void); #endif -#ifndef GDK_DISABLE_DEPRECATED -void gdk_pango_context_set_colormap (PangoContext *context, - GdkColormap *colormap); -#endif /* Get a clip region to draw only part of a layout or diff --git a/gdk/gdkpixbuf-render.c b/gdk/gdkpixbuf-render.c index a702e2e7ca..a0ba77d8b2 100644 --- a/gdk/gdkpixbuf-render.c +++ b/gdk/gdkpixbuf-render.c @@ -133,97 +133,6 @@ gdk_pixbuf_render_threshold_alpha (GdkPixbuf *pixbuf, } } - - -/** - * gdk_pixbuf_render_to_drawable: - * @pixbuf: A pixbuf. - * @drawable: Destination drawable. - * @gc: GC used for rendering. - * @src_x: Source X coordinate within pixbuf. - * @src_y: Source Y coordinate within pixbuf. - * @dest_x: Destination X coordinate within drawable. - * @dest_y: Destination Y coordinate within drawable. - * @width: Width of region to render, in pixels, or -1 to use pixbuf width - * @height: Height of region to render, in pixels, or -1 to use pixbuf height - * @dither: Dithering mode for GdkRGB. - * @x_dither: X offset for dither. - * @y_dither: Y offset for dither. - * - * Renders a rectangular portion of a pixbuf to a drawable while using the - * specified GC. This is done using GdkRGB, so the specified drawable must have - * the GdkRGB visual and colormap. Note that this function will ignore the - * opacity information for images with an alpha channel; the GC must already - * have the clipping mask set if you want transparent regions to show through. - * - * For an explanation of dither offsets, see the GdkRGB documentation. In - * brief, the dither offset is important when re-rendering partial regions of an - * image to a rendered version of the full image, or for when the offsets to a - * base position change, as in scrolling. The dither matrix has to be shifted - * for consistent visual results. If you do not have any of these cases, the - * dither offsets can be both zero. - * - * Deprecated: 2.4: This function is obsolete. Use gdk_draw_pixbuf() instead. - **/ -void -gdk_pixbuf_render_to_drawable (GdkPixbuf *pixbuf, - GdkDrawable *drawable, - GdkGC *gc, - int src_x, int src_y, - int dest_x, int dest_y, - int width, int height, - GdkRgbDither dither, - int x_dither, int y_dither) -{ - gdk_draw_pixbuf (drawable, gc, pixbuf, - src_x, src_y, dest_x, dest_y, width, height, - dither, x_dither, y_dither); -} - - - -/** - * gdk_pixbuf_render_to_drawable_alpha: - * @pixbuf: A pixbuf. - * @drawable: Destination drawable. - * @src_x: Source X coordinate within pixbuf. - * @src_y: Source Y coordinates within pixbuf. - * @dest_x: Destination X coordinate within drawable. - * @dest_y: Destination Y coordinate within drawable. - * @width: Width of region to render, in pixels, or -1 to use pixbuf width. - * @height: Height of region to render, in pixels, or -1 to use pixbuf height. - * @alpha_mode: Ignored. Present for backwards compatibility. - * @alpha_threshold: Ignored. Present for backwards compatibility - * @dither: Dithering mode for GdkRGB. - * @x_dither: X offset for dither. - * @y_dither: Y offset for dither. - * - * Renders a rectangular portion of a pixbuf to a drawable. The destination - * drawable must have a colormap. All windows have a colormap, however, pixmaps - * only have colormap by default if they were created with a non-%NULL window argument. - * Otherwise a colormap must be set on them with gdk_drawable_set_colormap. - * - * On older X servers, rendering pixbufs with an alpha channel involves round trips - * to the X server, and may be somewhat slow. - * - * Deprecated: 2.4: This function is obsolete. Use gdk_draw_pixbuf() instead. - **/ -void -gdk_pixbuf_render_to_drawable_alpha (GdkPixbuf *pixbuf, - GdkDrawable *drawable, - int src_x, int src_y, - int dest_x, int dest_y, - int width, int height, - GdkPixbufAlphaMode alpha_mode, - int alpha_threshold, - GdkRgbDither dither, - int x_dither, int y_dither) -{ - gdk_draw_pixbuf (drawable, NULL, pixbuf, - src_x, src_y, dest_x, dest_y, width, height, - dither, x_dither, y_dither); -} - /** * gdk_pixbuf_render_pixmap_and_mask: * @pixbuf: A pixbuf. diff --git a/gdk/gdkpixbuf.h b/gdk/gdkpixbuf.h index e6cd09a36e..c6154ff40d 100644 --- a/gdk/gdkpixbuf.h +++ b/gdk/gdkpixbuf.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) +#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) #error "Only can be included directly." #endif @@ -49,33 +49,6 @@ void gdk_pixbuf_render_threshold_alpha (GdkPixbuf *pixbuf, int width, int height, int alpha_threshold); -#ifndef GDK_DISABLE_DEPRECATED -void gdk_pixbuf_render_to_drawable (GdkPixbuf *pixbuf, - GdkDrawable *drawable, - GdkGC *gc, - int src_x, - int src_y, - int dest_x, - int dest_y, - int width, - int height, - GdkRgbDither dither, - int x_dither, - int y_dither); -void gdk_pixbuf_render_to_drawable_alpha (GdkPixbuf *pixbuf, - GdkDrawable *drawable, - int src_x, - int src_y, - int dest_x, - int dest_y, - int width, - int height, - GdkPixbufAlphaMode alpha_mode, - int alpha_threshold, - GdkRgbDither dither, - int x_dither, - int y_dither); -#endif /* GDK_DISABLE_DEPRECATED */ void gdk_pixbuf_render_pixmap_and_mask_for_colormap (GdkPixbuf *pixbuf, GdkColormap *colormap, GdkPixmap **pixmap_return, diff --git a/gdk/gdkpixmap.h b/gdk/gdkpixmap.h index 470a9e5450..736872c0fd 100644 --- a/gdk/gdkpixmap.h +++ b/gdk/gdkpixmap.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) +#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) #error "Only can be included directly." #endif @@ -51,9 +51,9 @@ struct _GdkPixmapObject { GdkDrawable parent_instance; - GdkDrawable *impl; /* window-system-specific delegate object */ + GdkDrawable *GSEAL (impl); /* window-system-specific delegate object */ - gint depth; + gint GSEAL (depth); }; struct _GdkPixmapObjectClass @@ -118,12 +118,6 @@ GdkPixmap* gdk_pixmap_foreign_new_for_screen (GdkScreen *screen, gint height, gint depth); -#ifndef GDK_DISABLE_DEPRECATED -#define gdk_bitmap_ref g_object_ref -#define gdk_bitmap_unref g_object_unref -#define gdk_pixmap_ref g_object_ref -#define gdk_pixmap_unref g_object_unref -#endif /* GDK_DISABLE_DEPRECATED */ G_END_DECLS diff --git a/gdk/gdkproperty.h b/gdk/gdkproperty.h index 3cfda50191..48d5a07d67 100644 --- a/gdk/gdkproperty.h +++ b/gdk/gdkproperty.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) +#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gdk/gdkregion.h b/gdk/gdkregion.h index 0adffa1a08..f8a00ebe3a 100644 --- a/gdk/gdkregion.h +++ b/gdk/gdkregion.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) +#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gdk/gdkrgb.c b/gdk/gdkrgb.c index 7885c920ab..4c7c858b20 100644 --- a/gdk/gdkrgb.c +++ b/gdk/gdkrgb.c @@ -672,21 +672,6 @@ gdk_rgb_create_info (GdkVisual *visual, GdkColormap *colormap) return image_info; } -void -gdk_rgb_init (void) -{ - static const gint byte_order[1] = { 1 }; - - /* check endian sanity */ -#if G_BYTE_ORDER == G_BIG_ENDIAN - if (((char *)byte_order)[0] == 1) - g_error ("gdk_rgb_init: compiled for big endian, but this is a little endian machine.\n\n"); -#else - if (((char *)byte_order)[0] != 1) - g_error ("gdk_rgb_init: compiled for little endian, but this is a big endian machine.\n\n"); -#endif -} - static GdkRgbInfo * gdk_rgb_get_info_from_colormap (GdkColormap *cmap) { @@ -779,36 +764,6 @@ gdk_rgb_xpixel_from_rgb_internal (GdkColormap *colormap, return pixel; } -/* convert an rgb value into an X pixel code */ -gulong -gdk_rgb_xpixel_from_rgb (guint32 rgb) -{ - guint32 r = rgb & 0xff0000; - guint32 g = rgb & 0xff00; - guint32 b = rgb & 0xff; - - return gdk_rgb_xpixel_from_rgb_internal (gdk_screen_get_rgb_colormap (gdk_screen_get_default ()), - (r >> 8) + (r >> 16), g + (g >> 8), b + (b << 8)); -} - -void -gdk_rgb_gc_set_foreground (GdkGC *gc, guint32 rgb) -{ - GdkColor color; - - color.pixel = gdk_rgb_xpixel_from_rgb (rgb); - gdk_gc_set_foreground (gc, &color); -} - -void -gdk_rgb_gc_set_background (GdkGC *gc, guint32 rgb) -{ - GdkColor color; - - color.pixel = gdk_rgb_xpixel_from_rgb (rgb); - gdk_gc_set_background (gc, &color); -} - /** * gdk_rgb_find_color: * @colormap: a #GdkColormap diff --git a/gdk/gdkrgb.h b/gdk/gdkrgb.h index 2f615865b9..919ac35fe6 100644 --- a/gdk/gdkrgb.h +++ b/gdk/gdkrgb.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) +#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) #error "Only can be included directly." #endif @@ -45,17 +45,6 @@ struct _GdkRgbCmap { GSList *info_list; }; -#ifndef GDK_DISABLE_DEPRECATED -void gdk_rgb_init (void); - -gulong gdk_rgb_xpixel_from_rgb (guint32 rgb) G_GNUC_CONST; -void gdk_rgb_gc_set_foreground (GdkGC *gc, - guint32 rgb); -void gdk_rgb_gc_set_background (GdkGC *gc, - guint32 rgb); -#define gdk_rgb_get_cmap gdk_rgb_get_colormap -#endif /* GDK_DISABLE_DEPRECATED */ - void gdk_rgb_find_color (GdkColormap *colormap, GdkColor *color); diff --git a/gdk/gdkscreen.h b/gdk/gdkscreen.h index 4e3bb1c713..200d643a6f 100644 --- a/gdk/gdkscreen.h +++ b/gdk/gdkscreen.h @@ -21,7 +21,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) +#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) #error "Only can be included directly." #endif @@ -47,14 +47,14 @@ struct _GdkScreen { GObject parent_instance; - guint closed : 1; + guint GSEAL (closed) : 1; - GdkGC *normal_gcs[32]; - GdkGC *exposure_gcs[32]; - GdkGC *subwindow_gcs[32]; + GdkGC *GSEAL (normal_gcs[32]); + GdkGC *GSEAL (exposure_gcs[32]); + GdkGC *GSEAL (subwindow_gcs[32]); - cairo_font_options_t *font_options; - double resolution; /* pixels/points scale factor for fonts */ + cairo_font_options_t *GSEAL (font_options); + double GSEAL (resolution); /* pixels/points scale factor for fonts */ }; struct _GdkScreenClass diff --git a/gdk/gdkselection.h b/gdk/gdkselection.h index 1a96214425..fc5d4b40e8 100644 --- a/gdk/gdkselection.h +++ b/gdk/gdkselection.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) +#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) #error "Only can be included directly." #endif @@ -55,14 +55,6 @@ G_BEGIN_DECLS #define GDK_SELECTION_TYPE_WINDOW _GDK_MAKE_ATOM (33) #define GDK_SELECTION_TYPE_STRING _GDK_MAKE_ATOM (31) -#ifndef GDK_DISABLE_DEPRECATED - -typedef GdkAtom GdkSelection; -typedef GdkAtom GdkTarget; -typedef GdkAtom GdkSelectionType; - -#endif /* GDK_DISABLE_DEPRECATED */ - /* Selections */ diff --git a/gdk/gdkspawn.h b/gdk/gdkspawn.h index ff8c1e4c8c..671219f993 100644 --- a/gdk/gdkspawn.h +++ b/gdk/gdkspawn.h @@ -19,7 +19,7 @@ * Authors: Mark McLoughlin */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) +#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gdk/gdktypes.h b/gdk/gdktypes.h index 506f35d254..f2a1ff4015 100644 --- a/gdk/gdktypes.h +++ b/gdk/gdktypes.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) +#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) #error "Only can be included directly." #endif @@ -56,6 +56,13 @@ /* some common magic values */ #define GDK_CURRENT_TIME 0L + +/** + * GDK_PARENT_RELATIVE: + * + * A special value for #GdkPixmap variables, indicating that the background + * pixmap for a window should be inherited from the parent window. + */ #define GDK_PARENT_RELATIVE 1L @@ -111,6 +118,15 @@ typedef struct _GdkVisual GdkVisual; typedef struct _GdkDrawable GdkDrawable; typedef struct _GdkDrawable GdkBitmap; typedef struct _GdkDrawable GdkPixmap; + +/** + * GdkWindow: + * + * An opaque structure representing an onscreen drawable. Pointers to structures + * of type #GdkPixmap, #GdkBitmap, and #GdkWindow can often be used + * interchangeably. The type #GdkDrawable refers generically to any of these + * types. + */ typedef struct _GdkDrawable GdkWindow; typedef struct _GdkDisplay GdkDisplay; typedef struct _GdkScreen GdkScreen; @@ -123,6 +139,45 @@ typedef enum /* Types of modifiers. */ +/** + * GdkModifierType: + * @GDK_SHIFT_MASK: the Shift key. + * @GDK_LOCK_MASK: a Lock key (depending on the modifier mapping of the + * X server this may either be CapsLock or ShiftLock). + * @GDK_CONTROL_MASK: the Control key. + * @GDK_MOD1_MASK: the fourth modifier key (it depends on the modifier + * mapping of the X server which key is interpreted as this modifier, but + * normally it is the Alt key). + * @GDK_MOD2_MASK: the fifth modifier key (it depends on the modifier + * mapping of the X server which key is interpreted as this modifier). + * @GDK_MOD3_MASK: the sixth modifier key (it depends on the modifier + * mapping of the X server which key is interpreted as this modifier). + * @GDK_MOD4_MASK: the seventh modifier key (it depends on the modifier + * mapping of the X server which key is interpreted as this modifier). + * @GDK_MOD5_MASK: the eighth modifier key (it depends on the modifier + * mapping of the X server which key is interpreted as this modifier). + * @GDK_BUTTON1_MASK: the first mouse button. + * @GDK_BUTTON2_MASK: the second mouse button. + * @GDK_BUTTON3_MASK: the third mouse button. + * @GDK_BUTTON4_MASK: the fourth mouse button. + * @GDK_BUTTON5_MASK: the fifth mouse button. + * @GDK_SUPER_MASK: the Super modifier. Since 2.10 + * @GDK_HYPER_MASK: the Hyper modifier. Since 2.10 + * @GDK_META_MASK: the Meta modifier. Since 2.10 + * @GDK_RELEASE_MASK: not used in GDK itself. GTK+ uses it to differentiate + * between (keyval, modifiers) pairs from key press and release events. + * @GDK_MODIFIER_MASK: a mask covering all modifier types. + * + * A set of bit-flags to indicate the state of modifier keys and mouse buttons + * in various event types. Typical modifier keys are Shift, Control, Meta, + * Super, Hyper, Alt, Compose, Apple, CapsLock or ShiftLock. + * + * Like the X Window System, GDK supports 8 modifier keys and 5 mouse buttons. + * + * Since 2.10, GDK recognizes which of the Meta, Super or Hyper keys are mapped + * to Mod2 - Mod5, and indicates this by setting %GDK_SUPER_MASK, + * %GDK_HYPER_MASK or %GDK_META_MASK in the state field of key events. + */ typedef enum { GDK_SHIFT_MASK = 1 << 0, @@ -181,16 +236,54 @@ typedef enum GDK_GRAB_FROZEN = 4 } GdkGrabStatus; +/** + * GdkGrabOwnership: + * @GDK_OWNERSHIP_NONE: All other devices' events are allowed. + * @GDK_OWNERSHIP_WINDOW: Other devices' events are blocked for the grab window. + * @GDK_OWNERSHIP_APPLICATION: Other devices' events are blocked for the whole application. + * + * Defines how device grabs interact with other devices. + */ +typedef enum +{ + GDK_OWNERSHIP_NONE, + GDK_OWNERSHIP_WINDOW, + GDK_OWNERSHIP_APPLICATION +} GdkGrabOwnership; + +/* Event masks. (Used to select what types of events a window + * * will receive). + * */ +typedef enum +{ + GDK_EXPOSURE_MASK = 1 << 1, + GDK_POINTER_MOTION_MASK = 1 << 2, + GDK_POINTER_MOTION_HINT_MASK = 1 << 3, + GDK_BUTTON_MOTION_MASK = 1 << 4, + GDK_BUTTON1_MOTION_MASK = 1 << 5, + GDK_BUTTON2_MOTION_MASK = 1 << 6, + GDK_BUTTON3_MOTION_MASK = 1 << 7, + GDK_BUTTON_PRESS_MASK = 1 << 8, + GDK_BUTTON_RELEASE_MASK = 1 << 9, + GDK_KEY_PRESS_MASK = 1 << 10, + GDK_KEY_RELEASE_MASK = 1 << 11, + GDK_ENTER_NOTIFY_MASK = 1 << 12, + GDK_LEAVE_NOTIFY_MASK = 1 << 13, + GDK_FOCUS_CHANGE_MASK = 1 << 14, + GDK_STRUCTURE_MASK = 1 << 15, + GDK_PROPERTY_CHANGE_MASK = 1 << 16, + GDK_VISIBILITY_NOTIFY_MASK = 1 << 17, + GDK_PROXIMITY_IN_MASK = 1 << 18, + GDK_PROXIMITY_OUT_MASK = 1 << 19, + GDK_SUBSTRUCTURE_MASK = 1 << 20, + GDK_SCROLL_MASK = 1 << 21, + GDK_ALL_EVENTS_MASK = 0x3FFFFE +} GdkEventMask; + typedef void (*GdkInputFunction) (gpointer data, gint source, GdkInputCondition condition); -#ifndef GDK_DISABLE_DEPRECATED - -typedef void (*GdkDestroyNotify) (gpointer data); - -#endif /* GDK_DISABLE_DEPRECATED */ - struct _GdkPoint { gint x; diff --git a/gdk/gdkvisual.c b/gdk/gdkvisual.c index 9e75563c28..ce1bdd7eb3 100644 --- a/gdk/gdkvisual.c +++ b/gdk/gdkvisual.c @@ -60,5 +60,194 @@ gdk_visual_get_system (void) return gdk_screen_get_system_visual (gdk_screen_get_default()); } +/** + * gdk_visual_get_visual_type: + * @visual: A #GdkVisual. + * + * Returns the type of visual this is (PseudoColor, TrueColor, etc). + * + * Return value: A #GdkVisualType stating the type of @visual. + * + * Since: 2.22 + */ +GdkVisualType +gdk_visual_get_visual_type (GdkVisual *visual) +{ + g_return_val_if_fail (GDK_IS_VISUAL (visual), 0); + + return visual->type; +} + +/** + * gdk_visual_get_depth: + * @visual: A #GdkVisual. + * + * Returns the bit depth of this visual. + * + * Return value: The bit depth of this visual. + * + * Since: 2.22 + */ +gint +gdk_visual_get_depth (GdkVisual *visual) +{ + g_return_val_if_fail (GDK_IS_VISUAL (visual), 0); + + return visual->depth; +} + +/** + * gdk_visual_get_byte_order: + * @visual: A #GdkVisual. + * + * Returns the byte order of this visual. + * + * Return value: A #GdkByteOrder stating the byte order of @visual. + * + * Since: 2.22 + */ +GdkByteOrder +gdk_visual_get_byte_order (GdkVisual *visual) +{ + g_return_val_if_fail (GDK_IS_VISUAL (visual), 0); + + return visual->byte_order; +} + +/** + * gdk_visual_get_colormap_size: + * @visual: A #GdkVisual. + * + * Returns the size of a colormap for this visual. + * + * Return value: The size of a colormap that is suitable for @visual. + * + * Since: 2.22 + */ +gint +gdk_visual_get_colormap_size (GdkVisual *visual) +{ + g_return_val_if_fail (GDK_IS_VISUAL (visual), 0); + + return visual->colormap_size; +} + +/** + * gdk_visual_get_bits_per_rgb: + * @visual: a #GdkVisual + * + * Returns the number of significant bits per red, green and blue value. + * + * Return value: The number of significant bits per color value for @visual. + * + * Since: 2.22 + */ +gint +gdk_visual_get_bits_per_rgb (GdkVisual *visual) +{ + g_return_val_if_fail (GDK_IS_VISUAL (visual), 0); + + return visual->bits_per_rgb; +} + +/** + * gdk_visual_get_red_pixel_details: + * @visual: A #GdkVisual. + * @mask: (out) (allow-none): A pointer to a #guint32 to be filled in, or %NULL. + * @shift: (out) (allow-none): A pointer to a #gint to be filled in, or %NULL. + * @precision: (out) (allow-none): A pointer to a #gint to be filled in, or %NULL. + * + * Obtains values that are needed to calculate red pixel values in TrueColor + * and DirectColor. The "mask" is the significant bits within the pixel. + * The "shift" is the number of bits left we must shift a primary for it + * to be in position (according to the "mask"). Finally, "precision" refers + * to how much precision the pixel value contains for a particular primary. + * + * Since: 2.22 + */ +void +gdk_visual_get_red_pixel_details (GdkVisual *visual, + guint32 *mask, + gint *shift, + gint *precision) +{ + g_return_if_fail (GDK_IS_VISUAL (visual)); + + if (mask) + *mask = visual->red_mask; + + if (shift) + *shift = visual->red_shift; + + if (precision) + *precision = visual->red_prec; +} + +/** + * gdk_visual_get_green_pixel_details: + * @visual: a #GdkVisual + * @mask: (out) (allow-none): A pointer to a #guint32 to be filled in, or %NULL. + * @shift: (out) (allow-none): A pointer to a #gint to be filled in, or %NULL. + * @precision: (out) (allow-none): A pointer to a #gint to be filled in, or %NULL. + * + * Obtains values that are needed to calculate green pixel values in TrueColor + * and DirectColor. The "mask" is the significant bits within the pixel. + * The "shift" is the number of bits left we must shift a primary for it + * to be in position (according to the "mask"). Finally, "precision" refers + * to how much precision the pixel value contains for a particular primary. + * + * Since: 2.22 + */ +void +gdk_visual_get_green_pixel_details (GdkVisual *visual, + guint32 *mask, + gint *shift, + gint *precision) +{ + g_return_if_fail (GDK_IS_VISUAL (visual)); + + if (mask) + *mask = visual->green_mask; + + if (shift) + *shift = visual->green_shift; + + if (precision) + *precision = visual->green_prec; +} + +/** + * gdk_visual_get_blue_pixel_details: + * @visual: a #GdkVisual + * @mask: (out) (allow-none): A pointer to a #guint32 to be filled in, or %NULL. + * @shift: (out) (allow-none): A pointer to a #gint to be filled in, or %NULL. + * @precision: (out) (allow-none): A pointer to a #gint to be filled in, or %NULL. + * + * Obtains values that are needed to calculate blue pixel values in TrueColor + * and DirectColor. The "mask" is the significant bits within the pixel. + * The "shift" is the number of bits left we must shift a primary for it + * to be in position (according to the "mask"). Finally, "precision" refers + * to how much precision the pixel value contains for a particular primary. + * + * Since: 2.22 + */ +void +gdk_visual_get_blue_pixel_details (GdkVisual *visual, + guint32 *mask, + gint *shift, + gint *precision) +{ + g_return_if_fail (GDK_IS_VISUAL (visual)); + + if (mask) + *mask = visual->blue_mask; + + if (shift) + *shift = visual->blue_shift; + + if (precision) + *precision = visual->blue_prec; +} + #define __GDK_VISUAL_C__ #include "gdkaliasdef.c" diff --git a/gdk/gdkvisual.h b/gdk/gdkvisual.h index d9479a5dcc..885dbaa163 100644 --- a/gdk/gdkvisual.h +++ b/gdk/gdkvisual.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) +#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) #error "Only can be included directly." #endif @@ -78,23 +78,23 @@ struct _GdkVisual { GObject parent_instance; - GdkVisualType type; - gint depth; - GdkByteOrder byte_order; - gint colormap_size; - gint bits_per_rgb; + GdkVisualType GSEAL (type); + gint GSEAL (depth); + GdkByteOrder GSEAL (byte_order); + gint GSEAL (colormap_size); + gint GSEAL (bits_per_rgb); - guint32 red_mask; - gint red_shift; - gint red_prec; + guint32 GSEAL (red_mask); + gint GSEAL (red_shift); + gint GSEAL (red_prec); - guint32 green_mask; - gint green_shift; - gint green_prec; + guint32 GSEAL (green_mask); + gint GSEAL (green_shift); + gint GSEAL (green_prec); - guint32 blue_mask; - gint blue_shift; - gint blue_prec; + guint32 GSEAL (blue_mask); + gint GSEAL (blue_shift); + gint GSEAL (blue_prec); }; GType gdk_visual_get_type (void) G_GNUC_CONST; @@ -119,10 +119,23 @@ GList* gdk_list_visuals (void); GdkScreen *gdk_visual_get_screen (GdkVisual *visual); -#ifndef GDK_DISABLE_DEPRECATED -#define gdk_visual_ref(v) g_object_ref(v) -#define gdk_visual_unref(v) g_object_unref(v) -#endif +GdkVisualType gdk_visual_get_visual_type (GdkVisual *visual); +gint gdk_visual_get_depth (GdkVisual *visual); +GdkByteOrder gdk_visual_get_byte_order (GdkVisual *visual); +gint gdk_visual_get_colormap_size (GdkVisual *visual); +gint gdk_visual_get_bits_per_rgb (GdkVisual *visual); +void gdk_visual_get_red_pixel_details (GdkVisual *visual, + guint32 *mask, + gint *shift, + gint *precision); +void gdk_visual_get_green_pixel_details (GdkVisual *visual, + guint32 *mask, + gint *shift, + gint *precision); +void gdk_visual_get_blue_pixel_details (GdkVisual *visual, + guint32 *mask, + gint *shift, + gint *precision); G_END_DECLS diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index d7fcef798a..d754c49857 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -26,25 +26,94 @@ */ #include "config.h" -#include "gdkwindow.h" -#include "gdkwindowimpl.h" -#include "gdkinternals.h" -#include "gdk.h" /* For gdk_rectangle_union() */ -#include "gdkpixmap.h" -#include "gdkdrawable.h" -#include "gdkintl.h" -#include "gdkscreen.h" -#include "gdkmarshalers.h" -#include "gdkalias.h" -#undef DEBUG_WINDOW_PRINTING +#include "gdkwindow.h" #ifdef GDK_WINDOWING_X11 #include "x11/gdkx.h" /* For workaround */ #endif - #include "math.h" +#include "gdk.h" /* For gdk_rectangle_union() */ +#include "gdkinternals.h" +#include "gdkintl.h" +#include "gdkscreen.h" +#include "gdkdeviceprivate.h" +#include "gdkdrawable.h" +#include "gdkmarshalers.h" +#include "gdkpixmap.h" +#include "gdkscreen.h" +#include "gdkwindowimpl.h" + +#include "gdkalias.h" + +#undef DEBUG_WINDOW_PRINTING + + +/** + * SECTION:windows + * @Short_description: Onscreen display areas in the target window system + * @Title: Windows + * + * A #GdkWindow is a rectangular region on the screen. It's a low-level object, + * used to implement high-level objects such as #GtkWidget and #GtkWindow on the + * GTK+ level. A #GtkWindow is a toplevel window, the thing a user might think + * of as a "window" with a titlebar and so on; a #GtkWindow may contain many + * #GdkWindows. For example, each #GtkButton has a #GdkWindow associated + * with it. + * + * + * Composited Windows + * + * Normally, the windowing system takes care of rendering the contents of a + * child window onto its parent window. This mechanism can be intercepted by + * calling gdk_window_set_composited() on the child window. For a + * composited window it is the responsibility of the + * application to render the window contents at the right spot. + * + * + * Composited windows + * + * FIXME: MISSING XINCLUDE CONTENT + * + * + * In the example , a button is + * placed inside of an event box inside of a window. The event box is set as + * composited and therefore is no longer automatically drawn to the screen. + * + * When the contents of the event box change, an expose event is generated on + * it's parent window (which, in this case, belongs to the toplevel #GtkWindow). + * The expose handler for this widget is responsible for merging the changes + * back on the screen in the way that it wishes. + * + * In our case, we merge the contents with a 50% transparency. We also set the + * background colour of the window to red. The effect is that the background + * shows through the button. + * + * + * + * Offscreen Windows + * + * Offscreen windows are more general than composited windows, since they allow + * not only to modify the rendering of the child window onto its parent, but + * also to apply coordinate transformations. + * + * To integrate an offscreen window into a window hierarchy, one has to call + * gdk_offscreen_window_set_embedder() and handle a number of signals. The + * #GdkWindow::pick-embedded-child signal on the embedder window is used to + * select an offscreen child at given coordinates, and the + * #GdkWindow::to-embedder and #GdkWindow::from-embedder signals on the + * offscreen window are used to translate coordinates between the embedder and + * the offscreen window. + * + * For rendering an offscreen window onto its embedder, the contents of the + * offscreen window are available as a pixmap, via + * gdk_offscreen_window_get_pixmap(). + * + * + */ + + /* Historically a GdkWindow always matches a platform native window, * be it a toplevel window or a child window. In this setup the * GdkWindow (and other GdkDrawables) were platform independent classes, @@ -157,7 +226,6 @@ typedef struct { int dx, dy; /* The amount that the source was moved to reach dest_region */ } GdkWindowRegionMove; - /* Global info */ static GdkGC *gdk_window_create_gc (GdkDrawable *drawable, @@ -335,7 +403,8 @@ static void do_move_region_bits_on_impl (GdkWindowObject *private, int dx, int dy); static void gdk_window_invalidate_in_parent (GdkWindowObject *private); static void move_native_children (GdkWindowObject *private); -static void update_cursor (GdkDisplay *display); +static void update_cursor (GdkDisplay *display, + GdkDevice *device); static void impl_window_add_update_area (GdkWindowObject *impl_window, GdkRegion *region); static void gdk_window_region_move_free (GdkWindowRegionMove *move); @@ -581,11 +650,31 @@ gdk_window_class_init (GdkWindowObjectClass *klass) G_TYPE_POINTER); } +static void +device_removed_cb (GdkDeviceManager *device_manager, + GdkDevice *device, + GdkWindow *window) +{ + GdkWindowObject *private; + + private = (GdkWindowObject *) window; + + private->devices_inside = g_list_remove (private->devices_inside, device); + g_hash_table_remove (private->device_cursor, device); + + if (private->device_events) + g_hash_table_remove (private->device_events, device); +} + static void gdk_window_finalize (GObject *object) { GdkWindow *window = GDK_WINDOW (object); GdkWindowObject *obj = (GdkWindowObject *) object; + GdkDeviceManager *device_manager; + + device_manager = gdk_display_get_device_manager (gdk_drawable_get_display (GDK_DRAWABLE (window))); + g_signal_handlers_disconnect_by_func (device_manager, device_removed_cb, window); if (!GDK_WINDOW_DESTROYED (window)) { @@ -622,6 +711,15 @@ gdk_window_finalize (GObject *object) if (obj->cursor) gdk_cursor_unref (obj->cursor); + if (obj->device_cursor) + g_hash_table_destroy (obj->device_cursor); + + if (obj->device_events) + g_hash_table_destroy (obj->device_events); + + if (obj->devices_inside) + g_list_free (obj->devices_inside); + G_OBJECT_CLASS (parent_class)->finalize (object); } @@ -1178,12 +1276,20 @@ find_native_sibling_above (GdkWindowObject *parent, } static GdkEventMask -get_native_event_mask (GdkWindowObject *private) +get_native_device_event_mask (GdkWindowObject *private, + GdkDevice *device) { + GdkEventMask event_mask; + + if (device) + event_mask = GPOINTER_TO_INT (g_hash_table_lookup (private->device_events, device)); + else + event_mask = private->event_mask; + if (_gdk_native_windows || private->window_type == GDK_WINDOW_ROOT || private->window_type == GDK_WINDOW_FOREIGN) - return private->event_mask; + return event_mask; else { GdkEventMask mask; @@ -1245,6 +1351,12 @@ get_native_grab_event_mask (GdkEventMask grab_mask) ~GDK_POINTER_MOTION_HINT_MASK); } +static GdkEventMask +get_native_event_mask (GdkWindowObject *private) +{ + return get_native_device_event_mask (private, NULL); +} + /* Puts the native window in the right order wrt the other native windows * in the hierarchy, given the position it has in the client side data. * This is useful if some operation changed the stacking order. @@ -1297,6 +1409,7 @@ gdk_window_new (GdkWindow *parent, gboolean native; GdkEventMask event_mask; GdkWindow *real_parent; + GdkDeviceManager *device_manager; g_return_val_if_fail (attributes != NULL, NULL); @@ -1473,6 +1586,13 @@ gdk_window_new (GdkWindow *parent, (attributes->cursor) : NULL)); + private->device_cursor = g_hash_table_new_full (NULL, NULL, NULL, + (GDestroyNotify) gdk_cursor_unref); + + device_manager = gdk_display_get_device_manager (gdk_drawable_get_display (GDK_DRAWABLE (parent))); + g_signal_connect (device_manager, "device-removed", + G_CALLBACK (device_removed_cb), window); + return window; } @@ -1935,6 +2055,30 @@ window_remove_filters (GdkWindow *window) } } +static void +update_pointer_info_foreach (GdkDisplay *display, + GdkDevice *device, + GdkPointerWindowInfo *pointer_info, + gpointer user_data) +{ + GdkWindow *window = user_data; + + if (pointer_info->toplevel_under_pointer == window) + { + g_object_unref (pointer_info->toplevel_under_pointer); + pointer_info->toplevel_under_pointer = NULL; + } +} + +static void +window_remove_from_pointer_info (GdkWindow *window, + GdkDisplay *display) +{ + _gdk_display_pointer_info_foreach (display, + update_pointer_info_foreach, + window); +} + /** * _gdk_window_destroy_hierarchy: * @window: a #GdkWindow @@ -2071,9 +2215,6 @@ _gdk_window_destroy_hierarchy (GdkWindow *window, impl_iface = GDK_WINDOW_IMPL_GET_IFACE (private->impl); - if (private->extension_events) - impl_iface->input_window_destroy (window); - if (gdk_window_has_impl (private)) impl_iface->destroy (window, recursing_native, foreign_destroy); @@ -2097,11 +2238,7 @@ _gdk_window_destroy_hierarchy (GdkWindow *window, private->redirect = NULL; - if (display->pointer_info.toplevel_under_pointer == window) - { - g_object_unref (display->pointer_info.toplevel_under_pointer); - display->pointer_info.toplevel_under_pointer = NULL; - } + window_remove_from_pointer_info (window, display); if (private->clip_region) { @@ -2601,27 +2738,6 @@ gdk_screen_get_toplevel_windows (GdkScreen *screen) return new_list; } -/** - * gdk_window_get_toplevels: - * - * Obtains a list of all toplevel windows known to GDK on the default - * screen (see gdk_screen_get_toplevel_windows()). - * A toplevel window is a child of the root window (see - * gdk_get_default_root_window()). - * - * The returned list should be freed with g_list_free(), but - * its elements need not be freed. - * - * Return value: list of toplevel windows, free with g_list_free() - * - * Deprecated: 2.16: Use gdk_screen_get_toplevel_windows() instead. - */ -GList * -gdk_window_get_toplevels (void) -{ - return gdk_screen_get_toplevel_windows (gdk_screen_get_default ()); -} - /** * gdk_window_is_visible: * @window: a #GdkWindow @@ -6330,6 +6446,8 @@ gdk_window_constrain_size (GdkGeometry *geometry, * Return value: (transfer none): the window containing the pointer (as with * gdk_window_at_pointer()), or %NULL if the window containing the * pointer isn't known to GDK + * + * Deprecated: 3.0: Use gdk_window_get_device_position() instead. **/ GdkWindow* gdk_window_get_pointer (GdkWindow *window, @@ -6338,29 +6456,50 @@ gdk_window_get_pointer (GdkWindow *window, GdkModifierType *mask) { GdkDisplay *display; + + g_return_val_if_fail (GDK_IS_WINDOW (window), NULL); + + display = gdk_drawable_get_display (window); + + return gdk_window_get_device_position (window, display->core_pointer, x, y, mask); +} + +/** + * gdk_window_get_device_position: + * @window: a #GdkWindow. + * @device: #GdkDevice to query to. + * @x: return location for the X coordinate of @device, or %NULL. + * @y: return location for the Y coordinate of @device, or %NULL. + * @mask: return location for the modifier mask, or %NULL. + * + * Obtains the current device position and modifier state. + * The position is given in coordinates relative to the upper left + * corner of @window. + * + * Returns: The window underneath @device (as with + * gdk_display_get_window_at_device_position()), or %NULL if the + * window is not known to GDK. + * + * Since: 3.0 + **/ +GdkWindow * +gdk_window_get_device_position (GdkWindow *window, + GdkDevice *device, + gint *x, + gint *y, + GdkModifierType *mask) +{ + GdkDisplay *display; gint tmp_x, tmp_y; GdkModifierType tmp_mask; GdkWindow *child; - g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), NULL); + g_return_val_if_fail (GDK_IS_WINDOW (window), NULL); + g_return_val_if_fail (GDK_IS_DEVICE (device), NULL); - if (window) - { - display = gdk_drawable_get_display (window); - } - else - { - GdkScreen *screen = gdk_screen_get_default (); - - display = gdk_screen_get_display (screen); - window = gdk_screen_get_root_window (screen); - - GDK_NOTE (MULTIHEAD, - g_message ("Passing NULL for window to gdk_window_get_pointer()\n" - "is not multihead safe")); - } - - child = display->pointer_hooks->window_get_pointer (display, window, &tmp_x, &tmp_y, &tmp_mask); + display = gdk_drawable_get_display (window); + child = display->device_hooks->window_get_device_position (display, device, window, + &tmp_x, &tmp_y, &tmp_mask); if (x) *x = tmp_x; @@ -6369,7 +6508,7 @@ gdk_window_get_pointer (GdkWindow *window, if (mask) *mask = tmp_mask; - _gdk_display_enable_motion_hints (display); + _gdk_display_enable_motion_hints (display, device); return child; } @@ -6389,6 +6528,8 @@ gdk_window_get_pointer (GdkWindow *window, * gdk_display_get_window_at_pointer() instead. * * Return value: (transfer none): window under the mouse pointer + * + * Deprecated: 3.0: Use gdk_display_get_window_at_device_position() instead. **/ GdkWindow* gdk_window_at_pointer (gint *win_x, @@ -7039,30 +7180,31 @@ gdk_window_hide (GdkWindow *window) else if (was_mapped) { GdkDisplay *display; + GdkDeviceManager *device_manager; + GList *devices, *d; /* May need to break grabs on children */ display = gdk_drawable_get_display (window); + device_manager = gdk_display_get_device_manager (display); - if (_gdk_display_end_pointer_grab (display, - _gdk_windowing_window_get_next_serial (display), - window, - TRUE)) - gdk_display_pointer_ungrab (display, GDK_CURRENT_TIME); + /* Get all devices */ + devices = gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_MASTER); + devices = g_list_concat (devices, gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_SLAVE)); + devices = g_list_concat (devices, gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_FLOATING)); - if (display->keyboard_grab.window != NULL) - { - if (is_parent_of (window, display->keyboard_grab.window)) - { - /* Call this ourselves, even though gdk_display_keyboard_ungrab - does so too, since we want to pass implicit == TRUE so the - broken grab event is generated */ - _gdk_display_unset_has_keyboard_grab (display, - TRUE); - gdk_display_keyboard_ungrab (display, GDK_CURRENT_TIME); - } - } + for (d = devices; d; d = d->next) + { + GdkDevice *device = d->data; + + if (_gdk_display_end_device_grab (display, device, + _gdk_windowing_window_get_next_serial (display), + window, + TRUE)) + gdk_device_ungrab (device, GDK_CURRENT_TIME); + } private->state = GDK_WINDOW_STATE_WITHDRAWN; + g_list_free (devices); } did_hide = _gdk_window_update_viewable (window); @@ -7144,9 +7286,10 @@ gdk_window_withdraw (GdkWindow *window) * @event_mask: event mask for @window * * The event mask for a window determines which events will be reported - * for that window. For example, an event mask including #GDK_BUTTON_PRESS_MASK - * means the window should report button press events. The event mask - * is the bitwise OR of values from the #GdkEventMask enumeration. + * for that window from all master input devices. For example, an event mask + * including #GDK_BUTTON_PRESS_MASK means the window should report button + * press events. The event mask is the bitwise OR of values from the + * #GdkEventMask enumeration. **/ void gdk_window_set_events (GdkWindow *window, @@ -7166,7 +7309,15 @@ gdk_window_set_events (GdkWindow *window, display = gdk_drawable_get_display (window); if ((private->event_mask & GDK_POINTER_MOTION_HINT_MASK) && !(event_mask & GDK_POINTER_MOTION_HINT_MASK)) - _gdk_display_enable_motion_hints (display); + { + GList *devices = private->devices_inside; + + while (devices) + { + _gdk_display_enable_motion_hints (display, (GdkDevice *) devices->data); + devices = devices->next; + } + } private->event_mask = event_mask; @@ -7183,7 +7334,8 @@ gdk_window_set_events (GdkWindow *window, * gdk_window_get_events: * @window: a #GdkWindow * - * Gets the event mask for @window. See gdk_window_set_events(). + * Gets the event mask for @window for all master input devices. See + * gdk_window_set_events(). * * Return value: event mask for @window **/ @@ -7201,6 +7353,115 @@ gdk_window_get_events (GdkWindow *window) return private->event_mask; } +/** + * gdk_window_set_device_events: + * @window: a #GdkWindow + * @device: #GdkDevice to enable events for. + * @event_mask: event mask for @window + * + * Sets the event mask for a given device (Normally a floating device, not + * attached to any visible pointer) to @window. For example, an event mask + * including #GDK_BUTTON_PRESS_MASK means the window should report button + * press events. The event mask is the bitwise OR of values from the + * #GdkEventMask enumeration. + * + * Since: 3.0 + **/ +void +gdk_window_set_device_events (GdkWindow *window, + GdkDevice *device, + GdkEventMask event_mask) +{ + GdkEventMask device_mask; + GdkWindowObject *private; + GdkDisplay *display; + GdkWindow *native; + + g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_DEVICE (device)); + + if (GDK_WINDOW_DESTROYED (window)) + return; + + private = (GdkWindowObject *) window; + + /* If motion hint is disabled, enable motion events again */ + display = gdk_drawable_get_display (window); + if ((private->event_mask & GDK_POINTER_MOTION_HINT_MASK) && + !(event_mask & GDK_POINTER_MOTION_HINT_MASK)) + _gdk_display_enable_motion_hints (display, device); + + if (G_UNLIKELY (!private->device_events)) + private->device_events = g_hash_table_new (NULL, NULL); + + if (event_mask == 0) + { + /* FIXME: unsetting events on a master device + * would restore private->event_mask + */ + g_hash_table_remove (private->device_events, device); + } + else + g_hash_table_insert (private->device_events, device, + GINT_TO_POINTER (event_mask)); + + if (_gdk_native_windows) + native = window; + else + native = gdk_window_get_toplevel (window); + + while (gdk_window_is_offscreen ((GdkWindowObject *)native)) + { + native = gdk_offscreen_window_get_embedder (native); + + if (native == NULL || + (!_gdk_window_has_impl (native) && + !gdk_window_is_viewable (native))) + return; + + native = gdk_window_get_toplevel (native); + } + + device_mask = get_native_device_event_mask (private, device); + GDK_DEVICE_GET_CLASS (device)->select_window_events (device, native, device_mask); +} + +/** + * gdk_window_get_device_events: + * @window: a #GdkWindow. + * @device: a #GdkDevice. + * + * Returns the event mask for @window corresponding to an specific device. + * + * Returns: device event mask for @window + * + * Since: 3.0 + **/ +GdkEventMask +gdk_window_get_device_events (GdkWindow *window, + GdkDevice *device) +{ + GdkWindowObject *private; + GdkEventMask mask; + + g_return_val_if_fail (GDK_IS_WINDOW (window), 0); + g_return_val_if_fail (GDK_IS_DEVICE (device), 0); + + if (GDK_WINDOW_DESTROYED (window)) + return 0; + + private = (GdkWindowObject *) window; + + if (!private->device_events) + return 0; + + mask = GPOINTER_TO_INT (g_hash_table_lookup (private->device_events, device)); + + /* FIXME: device could be controlled by private->event_mask */ + + return mask; +} + static void gdk_window_move_resize_toplevel (GdkWindow *window, gboolean with_move, @@ -7803,6 +8064,29 @@ gdk_window_move_region (GdkWindow *window, gdk_region_destroy (nocopy_area); } +/** + * gdk_window_get_background: + * @window: a #GdkWindow. + * @color: (out): a #GdkColor to be filled in + * + * Sets @color to equal the current background color of @window. + * + * Since: 2.22 + */ +void +gdk_window_get_background (GdkWindow *window, + GdkColor *color) +{ + GdkWindowObject *private; + + g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (color != NULL); + + private = (GdkWindowObject *) window; + + *color = private->bg_color; +} + /** * gdk_window_set_background: * @window: a #GdkWindow @@ -7816,7 +8100,7 @@ gdk_window_move_region (GdkWindow *window, * The @color must be allocated; gdk_rgb_find_color() is the best way * to allocate a color. * - * See also gdk_window_set_back_pixmap(). + * See also gdk_window_set_background_pixmap(). */ void gdk_window_set_background (GdkWindow *window, @@ -7849,6 +8133,43 @@ gdk_window_set_background (GdkWindow *window, } } +/** + * gdk_window_get_back_pixmap: + * @window: a #GdkWindow. + * @pixmap: (out) (allow-none): a #GdkPixmap to be filled in, or %NULL. + * @parent_relative: (out) (allow-none): a pointer to a #gboolean to be filled in, or %NULL. + * + * Sets @pixmap to the current background pixmap of @window. You do not + * own the pointer that is returned and this pointer should not be freeed + * or unreferenced. Sets @parent_relative to %TRUE if the tiling is done + * based on the origin of the parent window. + * + * Since: 2.22 + */ +void +gdk_window_get_back_pixmap (GdkWindow *window, + GdkPixmap **pixmap, + gboolean *parent_relative) +{ + GdkWindowObject *private; + + g_return_if_fail (GDK_IS_WINDOW (window)); + + private = (GdkWindowObject *) window; + + if (pixmap) + { + if (private->bg_pixmap == GDK_PARENT_RELATIVE_BG || + private->bg_pixmap == GDK_NO_BG) + *pixmap = NULL; + else + *pixmap = private->bg_pixmap; + } + + if (parent_relative) + *parent_relative = (private->bg_pixmap == GDK_PARENT_RELATIVE_BG); +} + /** * gdk_window_set_back_pixmap: * @window: a #GdkWindow @@ -7916,6 +8237,23 @@ gdk_window_set_back_pixmap (GdkWindow *window, } } +static void +update_cursor_foreach (GdkDisplay *display, + GdkDevice *device, + GdkPointerWindowInfo *pointer_info, + gpointer user_data) +{ + GdkWindow *window = user_data; + GdkWindowObject *private = (GdkWindowObject *) window; + + if (_gdk_native_windows || + private->window_type == GDK_WINDOW_ROOT || + private->window_type == GDK_WINDOW_FOREIGN) + GDK_WINDOW_IMPL_GET_IFACE (private->impl)->set_device_cursor (window, device, private->cursor); + else if (_gdk_window_event_parent_of (window, pointer_info->window_under_pointer)) + update_cursor (display, device); +} + /** * gdk_window_get_cursor: * @window: a #GdkWindow @@ -7948,7 +8286,7 @@ gdk_window_get_cursor (GdkWindow *window) * @window: a #GdkWindow * @cursor: a cursor * - * Sets the mouse pointer for a #GdkWindow. Use gdk_cursor_new_for_display() + * Sets the default mouse pointer for a #GdkWindow. Use gdk_cursor_new_for_display() * or gdk_cursor_new_from_pixmap() to create the cursor. To make the cursor * invisible, use %GDK_BLANK_CURSOR. Passing %NULL for the @cursor argument * to gdk_window_set_cursor() means that @window will use the cursor of its @@ -7959,7 +8297,6 @@ gdk_window_set_cursor (GdkWindow *window, GdkCursor *cursor) { GdkWindowObject *private; - GdkWindowImplIface *impl_iface; GdkDisplay *display; g_return_if_fail (GDK_IS_WINDOW (window)); @@ -7978,20 +8315,89 @@ gdk_window_set_cursor (GdkWindow *window, if (cursor) private->cursor = gdk_cursor_ref (cursor); - if (_gdk_native_windows || - private->window_type == GDK_WINDOW_ROOT || - private->window_type == GDK_WINDOW_FOREIGN) - { - impl_iface = GDK_WINDOW_IMPL_GET_IFACE (private->impl); - impl_iface->set_cursor (window, cursor); - } - else if (_gdk_window_event_parent_of (window, display->pointer_info.window_under_pointer)) - update_cursor (display); + _gdk_display_pointer_info_foreach (display, + update_cursor_foreach, + window); g_object_notify (G_OBJECT (window), "cursor"); } } +/** + * gdk_window_get_device_cursor: + * @window: a #GdkWindow. + * @device: a #GdkDevice. + * + * Retrieves a #GdkCursor pointer for the @device currently set on the + * specified #GdkWindow, or %NULL. If the return value is %NULL then + * there is no custom cursor set on the specified window, and it is + * using the cursor for its parent window. + * + * Returns: a #GdkCursor, or %NULL. The returned object is owned + * by the #GdkWindow and should not be unreferenced directly. Use + * gdk_window_set_cursor() to unset the cursor of the window + * + * Since: 3.0 + **/ +GdkCursor * +gdk_window_get_device_cursor (GdkWindow *window, + GdkDevice *device) +{ + GdkWindowObject *private; + + g_return_val_if_fail (GDK_IS_WINDOW (window), NULL); + g_return_val_if_fail (GDK_IS_DEVICE (device), NULL); + + private = (GdkWindowObject *) window; + + return g_hash_table_lookup (private->device_cursor, device); +} + +/** + * gdk_window_set_device_cursor: + * @window: a #Gdkwindow + * @device: a #GdkDevice + * @cursor: a #GdkCursor + * + * Sets a specific #GdkCursor for a given device when it gets inside @window. + * Use gdk_cursor_new_for_display() or gdk_cursor_new_from_pixmap() to create + * the cursor. To make the cursor invisible, use %GDK_BLANK_CURSOR. Passing + * %NULL for the @cursor argument to gdk_window_set_cursor() means that + * @window will use the cursor of its parent window. Most windows should + * use this default. + * + * Since: 3.0 + **/ +void +gdk_window_set_device_cursor (GdkWindow *window, + GdkDevice *device, + GdkCursor *cursor) +{ + GdkWindowObject *private; + GdkDisplay *display; + + g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_DEVICE (device)); + + private = (GdkWindowObject *) window; + display = gdk_drawable_get_display (window); + + if (!cursor) + g_hash_table_remove (private->device_cursor, device); + else + g_hash_table_replace (private->device_cursor, device, cursor); + + if (!GDK_WINDOW_DESTROYED (window)) + { + GdkPointerWindowInfo *pointer_info; + + pointer_info = _gdk_display_get_pointer_info (display, device); + + if (_gdk_window_event_parent_of (window, pointer_info->window_under_pointer)) + update_cursor (display, device); + } +} + /** * gdk_window_get_geometry: * @window: a #GdkWindow @@ -8175,8 +8581,10 @@ gdk_window_get_root_coords (GdkWindow *window, * @window: a child window * @x: X coordinate in child's coordinate system * @y: Y coordinate in child's coordinate system - * @parent_x: return location for X coordinate in parent's coordinate system - * @parent_y: return location for Y coordinate in parent's coordinate system + * @parent_x: (out) (allow-none): return location for X coordinate + * in parent's coordinate system, or %NULL + * @parent_y: (out) (allow-none): return location for Y coordinate + * in parent's coordinate system, or %NULL * * Transforms window coordinates from a child window to its parent * window, where the parent window is the normal parent as returned by @@ -8237,8 +8645,8 @@ gdk_window_coords_to_parent (GdkWindow *window, * @window: a child window * @parent_x: X coordinate in parent's coordinate system * @parent_y: Y coordinate in parent's coordinate system - * @x: return location for X coordinate in child's coordinate system - * @y: return location for Y coordinate in child's coordinate system + * @x: (out) (allow-none): return location for X coordinate in child's coordinate system + * @y: (out) (allow-none): return location for Y coordinate in child's coordinate system * * Transforms window coordinates from a parent window to a child * window, where the parent window is the normal parent as returned by @@ -8759,6 +9167,30 @@ gdk_window_set_static_gravities (GdkWindow *window, return FALSE; } +/** + * gdk_window_get_composited: + * @window: a #GdkWindow + * + * Determines whether @window is composited. + * + * See gdk_window_set_composited(). + * + * Returns: %TRUE if the window is composited. + * + * Since: 2.22 + **/ +gboolean +gdk_window_get_composited (GdkWindow *window) +{ + GdkWindowObject *private; + + g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE); + + private = (GdkWindowObject *)window; + + return private->composited; +} + /** * gdk_window_set_composited: * @window: a #GdkWindow @@ -8874,6 +9306,120 @@ gdk_window_remove_redirection (GdkWindow *window) } } +/** + * gdk_window_get_modal_hint: + * @window: A toplevel #GdkWindow. + * + * Determines whether or not the window manager is hinted that @window + * has modal behaviour. + * + * Return value: whether or not the window has the modal hint set. + * + * Since: 2.22 + */ +gboolean +gdk_window_get_modal_hint (GdkWindow *window) +{ + GdkWindowObject *private; + + g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE); + + private = (GdkWindowObject*) window; + + return private->modal_hint; +} + +/** + * gdk_window_get_accept_focus: + * @window: a toplevel #GdkWindow. + * + * Determines whether or not the desktop environment shuld be hinted that + * the window does not want to receive input focus. + * + * Return value: whether or not the window should receive input focus. + * + * Since: 2.22 + */ +gboolean +gdk_window_get_accept_focus (GdkWindow *window) +{ + GdkWindowObject *private; + + g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE); + + private = (GdkWindowObject *)window; + + return private->accept_focus; +} + +/** + * gdk_window_get_focus_on_map: + * @window: a toplevel #GdkWindow. + * + * Determines whether or not the desktop environment should be hinted that the + * window does not want to receive input focus when it is mapped. + * + * Return value: whether or not the window wants to receive input focus when + * it is mapped. + * + * Since: 2.22 + */ +gboolean +gdk_window_get_focus_on_map (GdkWindow *window) +{ + GdkWindowObject *private; + + g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE); + + private = (GdkWindowObject *)window; + + return private->focus_on_map; +} + +/** + * gdk_window_is_input_only: + * @window: a toplevel #GdkWindow + * + * Determines whether or not the window is an input only window. + * + * Return value: %TRUE if @window is input only + * + * Since: 2.22 + */ +gboolean +gdk_window_is_input_only (GdkWindow *window) +{ + GdkWindowObject *private; + + g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE); + + private = (GdkWindowObject *)window; + + return private->input_only; +} + +/** + * gdk_window_is_shaped: + * @window: a toplevel #GdkWindow + * + * Determines whether or not the window is shaped. + * + * Return value: %TRUE if @window is shaped + * + * Since: 2.22 + */ +gboolean +gdk_window_is_shaped (GdkWindow *window) +{ + GdkWindowObject *private; + + g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE); + + private = (GdkWindowObject *)window; + + return private->shaped; +} + static void apply_redirect_to_children (GdkWindowObject *private, GdkWindowRedirect *redirect) @@ -9147,27 +9693,34 @@ _gdk_window_event_parent_of (GdkWindow *parent, } static void -update_cursor (GdkDisplay *display) +update_cursor (GdkDisplay *display, + GdkDevice *device) { GdkWindowObject *cursor_window, *parent, *toplevel; GdkWindow *pointer_window; GdkWindowImplIface *impl_iface; - GdkPointerGrabInfo *grab; + GdkPointerWindowInfo *pointer_info; + GdkDeviceGrabInfo *grab; - pointer_window = display->pointer_info.window_under_pointer; + pointer_info = _gdk_display_get_pointer_info (display, device); + pointer_window = pointer_info->window_under_pointer; /* We ignore the serials here and just pick the last grab we've sent, as that would shortly be used anyway. */ - grab = _gdk_display_get_last_pointer_grab (display); + grab = _gdk_display_get_last_device_grab (display, device); if (/* have grab */ grab != NULL && /* the pointer is not in a descendant of the grab window */ !_gdk_window_event_parent_of (grab->window, pointer_window)) - /* use the cursor from the grab window */ - cursor_window = (GdkWindowObject *)grab->window; + { + /* use the cursor from the grab window */ + cursor_window = (GdkWindowObject *) grab->window; + } else - /* otherwise use the cursor from the pointer window */ - cursor_window = (GdkWindowObject *)pointer_window; + { + /* otherwise use the cursor from the pointer window */ + cursor_window = (GdkWindowObject *) pointer_window; + } /* Find the first window with the cursor actually set, as the cursor is inherited from the parent */ @@ -9178,9 +9731,10 @@ update_cursor (GdkDisplay *display) /* Set all cursors on toplevel, otherwise its tricky to keep track of * which native window has what cursor set. */ - toplevel = (GdkWindowObject *)get_event_toplevel (pointer_window); + toplevel = (GdkWindowObject *) get_event_toplevel (pointer_window); impl_iface = GDK_WINDOW_IMPL_GET_IFACE (toplevel->impl); - impl_iface->set_cursor ((GdkWindow *)toplevel, cursor_window->cursor); + impl_iface->set_device_cursor ((GdkWindow *) toplevel, device, + cursor_window->cursor); } static gboolean @@ -9412,6 +9966,61 @@ gdk_window_beep (GdkWindow *window) gdk_display_beep (display); } +/** + * gdk_window_set_support_multidevice: + * @window: a #GdkWindow. + * @support_multidevice: %TRUE to enable multidevice support in @window. + * + * This function will enable multidevice features in @window. + * + * Multidevice aware windows will need to handle properly multiple, + * per device enter/leave events, device grabs and grab ownerships. + * + * Since: 3.0 + **/ +void +gdk_window_set_support_multidevice (GdkWindow *window, + gboolean support_multidevice) +{ + GdkWindowObject *private = (GdkWindowObject *) window; + + g_return_if_fail (GDK_IS_WINDOW (window)); + + if (GDK_WINDOW_DESTROYED (window)) + return; + + if (private->support_multidevice == support_multidevice) + return; + + private->support_multidevice = support_multidevice; + + /* FIXME: What to do if called when some pointers are inside the window ? */ +} + +/** + * gdk_window_get_support_multidevice: + * @window: a #GdkWindow. + * + * Returns %TRUE if the window is aware of the existence of multiple + * devices. + * + * Returns: %TRUE if the window handles multidevice features. + * + * Since: 3.0 + **/ +gboolean +gdk_window_get_support_multidevice (GdkWindow *window) +{ + GdkWindowObject *private = (GdkWindowObject *) window; + + g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE); + + if (GDK_WINDOW_DESTROYED (window)) + return FALSE; + + return private->support_multidevice; +} + static const guint type_masks[] = { GDK_SUBSTRUCTURE_MASK, /* GDK_DELETE = 0 */ GDK_STRUCTURE_MASK, /* GDK_DESTROY = 1 */ @@ -9641,6 +10250,7 @@ send_crossing_event (GdkDisplay *display, GdkCrossingMode mode, GdkNotifyType notify_type, GdkWindow *subwindow, + GdkDevice *device, gint toplevel_x, gint toplevel_y, GdkModifierType mask, @@ -9650,10 +10260,10 @@ send_crossing_event (GdkDisplay *display, { GdkEvent *event; guint32 window_event_mask, type_event_mask; - GdkPointerGrabInfo *grab; - GdkWindowImplIface *impl_iface; + GdkDeviceGrabInfo *grab; + gboolean block_event = FALSE; - grab = _gdk_display_has_pointer_grab (display, serial); + grab = _gdk_display_has_device_grab (display, device, serial); if (grab != NULL && !grab->owner_events) @@ -9667,20 +10277,39 @@ send_crossing_event (GdkDisplay *display, window_event_mask = window->event_mask; if (type == GDK_LEAVE_NOTIFY) - type_event_mask = GDK_LEAVE_NOTIFY_MASK; - else - type_event_mask = GDK_ENTER_NOTIFY_MASK; - - if (window->extension_events != 0) { - impl_iface = GDK_WINDOW_IMPL_GET_IFACE (window->impl); - impl_iface->input_window_crossing ((GdkWindow *)window, - type == GDK_ENTER_NOTIFY); + type_event_mask = GDK_LEAVE_NOTIFY_MASK; + window->devices_inside = g_list_remove (window->devices_inside, device); + + if (!window->support_multidevice && window->devices_inside) + { + /* Block leave events unless it's the last pointer */ + block_event = TRUE; + } } + else + { + type_event_mask = GDK_ENTER_NOTIFY_MASK; + + if (!window->support_multidevice && window->devices_inside) + { + /* Only emit enter events for the first device */ + block_event = TRUE; + } + + if (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_MASTER && + device->mode != GDK_MODE_DISABLED && + !g_list_find (window->devices_inside, device)) + window->devices_inside = g_list_prepend (window->devices_inside, device); + } + + if (block_event) + return; if (window_event_mask & type_event_mask) { event = _gdk_make_event ((GdkWindow *)window, type, event_in_queue, TRUE); + gdk_event_set_device (event, device); event->crossing.time = time_; event->crossing.subwindow = subwindow; if (subwindow) @@ -9707,6 +10336,7 @@ void _gdk_synthesize_crossing_events (GdkDisplay *display, GdkWindow *src, GdkWindow *dest, + GdkDevice *device, GdkCrossingMode mode, gint toplevel_x, gint toplevel_y, @@ -9731,6 +10361,18 @@ _gdk_synthesize_crossing_events (GdkDisplay *display, if (a == b) return; /* No crossings generated between src and dest */ + if (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_MASTER) + { + if (a && gdk_window_get_device_events (src, device) == 0) + a = NULL; + + if (b && gdk_window_get_device_events (dest, device) == 0) + b = NULL; + } + + if (!a && !b) + return; + c = find_common_ancestor (a, b); non_linear |= (c != a) && (c != b); @@ -9750,7 +10392,7 @@ _gdk_synthesize_crossing_events (GdkDisplay *display, a, GDK_LEAVE_NOTIFY, mode, notify_type, - NULL, + NULL, device, toplevel_x, toplevel_y, mask, time_, event_in_queue, @@ -9772,6 +10414,7 @@ _gdk_synthesize_crossing_events (GdkDisplay *display, mode, notify_type, (GdkWindow *)last, + device, toplevel_x, toplevel_y, mask, time_, event_in_queue, @@ -9818,6 +10461,7 @@ _gdk_synthesize_crossing_events (GdkDisplay *display, mode, notify_type, (GdkWindow *)next, + device, toplevel_x, toplevel_y, mask, time_, event_in_queue, @@ -9839,6 +10483,7 @@ _gdk_synthesize_crossing_events (GdkDisplay *display, mode, notify_type, NULL, + device, toplevel_x, toplevel_y, mask, time_, event_in_queue, @@ -9853,14 +10498,18 @@ _gdk_synthesize_crossing_events (GdkDisplay *display, static GdkWindow * get_pointer_window (GdkDisplay *display, GdkWindow *event_window, + GdkDevice *device, gdouble toplevel_x, gdouble toplevel_y, gulong serial) { GdkWindow *pointer_window; - GdkPointerGrabInfo *grab; + GdkDeviceGrabInfo *grab; + GdkPointerWindowInfo *pointer_info; - if (event_window == display->pointer_info.toplevel_under_pointer) + pointer_info = _gdk_display_get_pointer_info (display, device); + + if (event_window == pointer_info->toplevel_under_pointer) pointer_window = _gdk_window_find_descendant_at (event_window, toplevel_x, toplevel_y, @@ -9868,7 +10517,7 @@ get_pointer_window (GdkDisplay *display, else pointer_window = NULL; - grab = _gdk_display_has_pointer_grab (display, serial); + grab = _gdk_display_has_device_grab (display, device, serial); if (grab != NULL && !grab->owner_events && pointer_window != grab->window) @@ -9879,47 +10528,80 @@ get_pointer_window (GdkDisplay *display, void _gdk_display_set_window_under_pointer (GdkDisplay *display, - GdkWindow *window) + GdkDevice *device, + GdkWindow *window) { + GdkPointerWindowInfo *device_info; + /* We don't track this if all native, and it can cause issues with the update_cursor call below */ if (_gdk_native_windows) return; - if (display->pointer_info.window_under_pointer) - g_object_unref (display->pointer_info.window_under_pointer); - display->pointer_info.window_under_pointer = window; - if (window) - g_object_ref (window); + device_info = _gdk_display_get_pointer_info (display, device); + + if (device_info->window_under_pointer) + g_object_unref (device_info->window_under_pointer); + device_info->window_under_pointer = window; if (window) - update_cursor (display); + { + g_object_ref (window); + update_cursor (display, device); + } - _gdk_display_enable_motion_hints (display); + _gdk_display_enable_motion_hints (display, device); } -/* - *-------------------------------------------------------------- - * gdk_pointer_grab +/** + * gdk_pointer_grab: + * @window: the #GdkWindow which will own the grab (the grab window). + * @owner_events: if %FALSE then all pointer events are reported with respect to + * @window and are only reported if selected by @event_mask. If %TRUE then pointer + * events for this application are reported as normal, but pointer events outside + * this application are reported with respect to @window and only if selected by + * @event_mask. In either mode, unreported events are discarded. + * @event_mask: specifies the event mask, which is used in accordance with + * @owner_events. Note that only pointer events (i.e. button and motion events) + * may be selected. + * @confine_to: If non-%NULL, the pointer will be confined to this + * window during the grab. If the pointer is outside @confine_to, it will + * automatically be moved to the closest edge of @confine_to and enter + * and leave events will be generated as necessary. + * @cursor: the cursor to display while the grab is active. If this is %NULL then + * the normal cursors are used for @window and its descendants, and the cursor + * for @window is used for all other windows. + * @time_: the timestamp of the event which led to this pointer grab. This usually + * comes from a #GdkEventButton struct, though %GDK_CURRENT_TIME can be used if + * the time isn't known. * - * Grabs the pointer to a specific window + * Grabs the pointer (usually a mouse) so that all events are passed to this + * application until the pointer is ungrabbed with gdk_pointer_ungrab(), or + * the grab window becomes unviewable. + * This overrides any previous pointer grab by this client. * - * Arguments: - * "window" is the window which will receive the grab - * "owner_events" specifies whether events will be reported as is, - * or relative to "window" - * "event_mask" masks only interesting events - * "confine_to" limits the cursor movement to the specified window - * "cursor" changes the cursor for the duration of the grab - * "time" specifies the time + * Pointer grabs are used for operations which need complete control over mouse + * events, even if the mouse leaves the application. + * For example in GTK+ it is used for Drag and Drop, for dragging the handle in + * the #GtkHPaned and #GtkVPaned widgets, and for resizing columns in #GtkCList + * widgets. * - * Results: + * Note that if the event mask of an X window has selected both button press and + * button release events, then a button press event will cause an automatic + * pointer grab until the button is released. + * X does this automatically since most applications expect to receive button + * press and release events in pairs. + * It is equivalent to a pointer grab on the window with @owner_events set to + * %TRUE. * - * Side effects: - * requires a corresponding call to gdk_pointer_ungrab + * If you set up anything at the time you take the grab that needs to be cleaned + * up when the grab ends, you should handle the #GdkEventGrabBroken events that + * are emitted when the grab ends unvoluntarily. * - *-------------------------------------------------------------- - */ + * Returns: %GDK_GRAB_SUCCESS if the grab was successful. + * + * Deprecated: 3.0: Use gdk_device_grab() instead. + **/ GdkGrabStatus gdk_pointer_grab (GdkWindow * window, gboolean owner_events, @@ -9930,8 +10612,11 @@ gdk_pointer_grab (GdkWindow * window, { GdkWindow *native; GdkDisplay *display; - GdkGrabStatus res; + GdkDeviceManager *device_manager; + GdkDevice *device; + GdkGrabStatus res = 0; gulong serial; + GList *devices, *dev; g_return_val_if_fail (window != NULL, 0); g_return_val_if_fail (GDK_IS_WINDOW (window), 0); @@ -9971,24 +10656,147 @@ gdk_pointer_grab (GdkWindow * window, display = gdk_drawable_get_display (window); serial = _gdk_windowing_window_get_next_serial (display); + device_manager = gdk_display_get_device_manager (display); + devices = gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_MASTER); - res = _gdk_windowing_pointer_grab (window, - native, - owner_events, - get_native_grab_event_mask (event_mask), - confine_to, - cursor, - time); + /* FIXME: Should this be generic to all backends? */ + /* FIXME: What happens with extended devices? */ + for (dev = devices; dev; dev = dev->next) + { + device = dev->data; - if (res == GDK_GRAB_SUCCESS) - _gdk_display_add_pointer_grab (display, - window, - native, - owner_events, - event_mask, - serial, - time, - FALSE); + if (device->source != GDK_SOURCE_MOUSE) + continue; + + res = _gdk_windowing_device_grab (device, + window, + native, + owner_events, + get_native_grab_event_mask (event_mask), + confine_to, + cursor, + time); + + if (res == GDK_GRAB_SUCCESS) + _gdk_display_add_device_grab (display, + device, + window, + native, + GDK_OWNERSHIP_NONE, + owner_events, + event_mask, + serial, + time, + FALSE); + } + + /* FIXME: handle errors when grabbing */ + + g_list_free (devices); + + return res; +} + +/** + * gdk_keyboard_grab: + * @window: the #GdkWindow which will own the grab (the grab window). + * @owner_events: if %FALSE then all keyboard events are reported with respect to + * @window. If %TRUE then keyboard events for this application are + * reported as normal, but keyboard events outside this application + * are reported with respect to @window. Both key press and key + * release events are always reported, independant of the event mask + * set by the application. + * @time: a timestamp from a #GdkEvent, or %GDK_CURRENT_TIME if no timestamp is +available. + * + * Grabs the keyboard so that all events are passed to this + * application until the keyboard is ungrabbed with gdk_keyboard_ungrab(). + * This overrides any previous keyboard grab by this client. + * + * If you set up anything at the time you take the grab that needs to be cleaned + * up when the grab ends, you should handle the #GdkEventGrabBroken events that + * are emitted when the grab ends unvoluntarily. + * + * Returns: %GDK_GRAB_SUCCESS if the grab was successful. + * + * Deprecated: 3.0: Use gdk_device_grab() instead. + **/ +GdkGrabStatus +gdk_keyboard_grab (GdkWindow *window, + gboolean owner_events, + guint32 time) +{ + GdkWindow *native; + GdkDisplay *display; + GdkDeviceManager *device_manager; + GdkDevice *device; + GdkGrabStatus res = 0; + gulong serial; + GList *devices, *dev; + + g_return_val_if_fail (GDK_IS_WINDOW (window), 0); + + /* Non-viewable client side window => fail */ + if (!_gdk_window_has_impl (window) && + !gdk_window_is_viewable (window)) + return GDK_GRAB_NOT_VIEWABLE; + + if (_gdk_native_windows) + native = window; + else + native = gdk_window_get_toplevel (window); + + while (gdk_window_is_offscreen ((GdkWindowObject *)native)) + { + native = gdk_offscreen_window_get_embedder (native); + + if (native == NULL || + (!_gdk_window_has_impl (native) && + !gdk_window_is_viewable (native))) + return GDK_GRAB_NOT_VIEWABLE; + + native = gdk_window_get_toplevel (native); + } + + display = gdk_drawable_get_display (window); + + serial = _gdk_windowing_window_get_next_serial (display); + device_manager = gdk_display_get_device_manager (display); + devices = gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_MASTER); + + /* FIXME: Should this be generic to all backends? */ + /* FIXME: What happens with extended devices? */ + for (dev = devices; dev; dev = dev->next) + { + device = dev->data; + + if (device->source != GDK_SOURCE_KEYBOARD) + continue; + + res = _gdk_windowing_device_grab (device, + window, + native, + owner_events, + GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK, + NULL, + NULL, + time); + + if (res == GDK_GRAB_SUCCESS) + _gdk_display_add_device_grab (display, + device, + window, + native, + GDK_OWNERSHIP_NONE, + owner_events, 0, + serial, + time, + FALSE); + } + + /* FIXME: handle errors when grabbing */ + + g_list_free (devices); return res; } @@ -10015,7 +10823,8 @@ do_synthesize_crossing_event (gpointer data) GdkDisplay *display; GdkWindow *changed_toplevel; GdkWindowObject *changed_toplevel_priv; - GdkWindow *new_window_under_pointer; + GHashTableIter iter; + gpointer key, value; gulong serial; changed_toplevel = data; @@ -10028,30 +10837,39 @@ do_synthesize_crossing_event (gpointer data) display = gdk_drawable_get_display (changed_toplevel); serial = _gdk_windowing_window_get_next_serial (display); + g_hash_table_iter_init (&iter, display->pointers_info); - if (changed_toplevel == display->pointer_info.toplevel_under_pointer) + while (g_hash_table_iter_next (&iter, &key, &value)) { - new_window_under_pointer = - get_pointer_window (display, changed_toplevel, - display->pointer_info.toplevel_x, - display->pointer_info.toplevel_y, - serial); - if (new_window_under_pointer != - display->pointer_info.window_under_pointer) - { - _gdk_synthesize_crossing_events (display, - display->pointer_info.window_under_pointer, - new_window_under_pointer, - GDK_CROSSING_NORMAL, - display->pointer_info.toplevel_x, - display->pointer_info.toplevel_y, - display->pointer_info.state, - GDK_CURRENT_TIME, - NULL, - serial, - FALSE); - _gdk_display_set_window_under_pointer (display, new_window_under_pointer); - } + GdkWindow *new_window_under_pointer; + GdkPointerWindowInfo *pointer_info = value; + GdkDevice *device = key; + + if (changed_toplevel == pointer_info->toplevel_under_pointer) + { + new_window_under_pointer = + get_pointer_window (display, changed_toplevel, + device, + pointer_info->toplevel_x, + pointer_info->toplevel_y, + serial); + if (new_window_under_pointer != pointer_info->window_under_pointer) + { + _gdk_synthesize_crossing_events (display, + pointer_info->window_under_pointer, + new_window_under_pointer, + device, + GDK_CROSSING_NORMAL, + pointer_info->toplevel_x, + pointer_info->toplevel_y, + pointer_info->state, + GDK_CURRENT_TIME, + NULL, + serial, + FALSE); + _gdk_display_set_window_under_pointer (display, device, new_window_under_pointer); + } + } } return FALSE; @@ -10070,12 +10888,12 @@ _gdk_synthesize_crossing_events_for_geometry_change (GdkWindow *changed_window) display = gdk_drawable_get_display (changed_window); toplevel = get_event_toplevel (changed_window); - toplevel_priv = (GdkWindowObject *)toplevel; + toplevel_priv = (GdkWindowObject *) toplevel; - if (toplevel == display->pointer_info.toplevel_under_pointer && - !toplevel_priv->synthesize_crossing_event_queued) + if (!toplevel_priv->synthesize_crossing_event_queued) { toplevel_priv->synthesize_crossing_event_queued = TRUE; + g_idle_add_full (GDK_PRIORITY_EVENTS - 1, do_synthesize_crossing_event, g_object_ref (toplevel), @@ -10086,6 +10904,7 @@ _gdk_synthesize_crossing_events_for_geometry_change (GdkWindow *changed_window) /* Don't use for crossing events */ static GdkWindow * get_event_window (GdkDisplay *display, + GdkDevice *device, GdkWindow *pointer_window, GdkEventType type, GdkModifierType mask, @@ -10095,9 +10914,9 @@ get_event_window (GdkDisplay *display, guint evmask; GdkWindow *grab_window; GdkWindowObject *w; - GdkPointerGrabInfo *grab; + GdkDeviceGrabInfo *grab; - grab = _gdk_display_has_pointer_grab (display, serial); + grab = _gdk_display_has_device_grab (display, device, serial); if (grab != NULL && !grab->owner_events) { @@ -10158,6 +10977,8 @@ proxy_pointer_event (GdkDisplay *display, { GdkWindow *toplevel_window, *event_window; GdkWindow *pointer_window; + GdkPointerWindowInfo *pointer_info; + GdkDevice *device; GdkEvent *event; guint state; gdouble toplevel_x, toplevel_y; @@ -10168,6 +10989,8 @@ proxy_pointer_event (GdkDisplay *display, gdk_event_get_coords (source_event, &toplevel_x, &toplevel_y); gdk_event_get_state (source_event, &state); time_ = gdk_event_get_time (source_event); + device = gdk_event_get_device (source_event); + pointer_info = _gdk_display_get_pointer_info (display, device); toplevel_window = convert_native_coords_to_toplevel (event_window, toplevel_x, toplevel_y, &toplevel_x, &toplevel_y); @@ -10198,8 +11021,9 @@ proxy_pointer_event (GdkDisplay *display, /* Send leave events from window under pointer to event window that will get the subwindow == NULL window */ _gdk_synthesize_crossing_events (display, - display->pointer_info.window_under_pointer, + pointer_info->window_under_pointer, event_window, + device, source_event->crossing.mode, toplevel_x, toplevel_y, state, time_, @@ -10215,16 +11039,17 @@ proxy_pointer_event (GdkDisplay *display, source_event->crossing.mode, source_event->crossing.detail, NULL, - toplevel_x, toplevel_y, + device, + toplevel_x, toplevel_y, state, time_, source_event, serial); - _gdk_display_set_window_under_pointer (display, NULL); + _gdk_display_set_window_under_pointer (display, device, NULL); return TRUE; } - pointer_window = get_pointer_window (display, toplevel_window, + pointer_window = get_pointer_window (display, toplevel_window, device, toplevel_x, toplevel_y, serial); if (((source_event->type == GDK_ENTER_NOTIFY && @@ -10244,7 +11069,8 @@ proxy_pointer_event (GdkDisplay *display, source_event->crossing.mode, source_event->crossing.detail, NULL, - toplevel_x, toplevel_y, + device, + toplevel_x, toplevel_y, state, time_, source_event, serial); @@ -10253,30 +11079,32 @@ proxy_pointer_event (GdkDisplay *display, _gdk_synthesize_crossing_events (display, event_window, pointer_window, + device, source_event->crossing.mode, toplevel_x, toplevel_y, state, time_, source_event, serial, non_linear); - _gdk_display_set_window_under_pointer (display, pointer_window); + _gdk_display_set_window_under_pointer (display, device, pointer_window); return TRUE; } - if (display->pointer_info.window_under_pointer != pointer_window) + if (pointer_info->window_under_pointer != pointer_window) { /* Either a toplevel crossing notify that ended up inside a child window, or a motion notify that got into another child window */ /* Different than last time, send crossing events */ _gdk_synthesize_crossing_events (display, - display->pointer_info.window_under_pointer, + pointer_info->window_under_pointer, pointer_window, + device, GDK_CROSSING_NORMAL, toplevel_x, toplevel_y, state, time_, source_event, serial, non_linear); - _gdk_display_set_window_under_pointer (display, pointer_window); + _gdk_display_set_window_under_pointer (display, device, pointer_window); } else if (source_event->type == GDK_MOTION_NOTIFY) { @@ -10285,24 +11113,35 @@ proxy_pointer_event (GdkDisplay *display, gboolean is_hint; event_win = get_event_window (display, - pointer_window, - source_event->type, - state, - &evmask, - serial); + device, + pointer_window, + source_event->type, + state, + &evmask, + serial); + + if (event_win && + gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_MASTER && + gdk_window_get_device_events (event_win, device) == 0) + return TRUE; is_hint = FALSE; if (event_win && (evmask & GDK_POINTER_MOTION_HINT_MASK)) { - if (display->pointer_info.motion_hint_serial != 0 && - serial < display->pointer_info.motion_hint_serial) + gulong *device_serial; + + device_serial = g_hash_table_lookup (display->motion_hint_info, device); + + if (!device_serial || + (*device_serial != 0 && + serial < *device_serial)) event_win = NULL; /* Ignore event */ else { is_hint = TRUE; - display->pointer_info.motion_hint_serial = G_MAXULONG; + *device_serial = G_MAXULONG; } } @@ -10314,11 +11153,12 @@ proxy_pointer_event (GdkDisplay *display, toplevel_x, toplevel_y, &event->motion.x, &event->motion.y); event->motion.x_root = source_event->motion.x_root; - event->motion.y_root = source_event->motion.y_root;; + event->motion.y_root = source_event->motion.y_root; event->motion.state = state; event->motion.is_hint = is_hint; - event->motion.device = NULL; event->motion.device = source_event->motion.device; + event->motion.axes = g_memdup (source_event->motion.axes, + sizeof (gdouble) * source_event->motion.device->num_axes); } } @@ -10348,12 +11188,14 @@ proxy_button_event (GdkEvent *source_event, gdouble toplevel_x, toplevel_y; GdkDisplay *display; GdkWindowObject *w; + GdkDevice *device; type = source_event->any.type; event_window = source_event->any.window; gdk_event_get_coords (source_event, &toplevel_x, &toplevel_y); gdk_event_get_state (source_event, &state); time_ = gdk_event_get_time (source_event); + device = gdk_event_get_device (source_event); display = gdk_drawable_get_display (source_event->any.window); toplevel_window = convert_native_coords_to_toplevel (event_window, toplevel_x, toplevel_y, @@ -10361,7 +11203,7 @@ proxy_button_event (GdkEvent *source_event, if (type == GDK_BUTTON_PRESS && !source_event->any.send_event && - _gdk_display_has_pointer_grab (display, serial) == NULL) + _gdk_display_has_device_grab (display, device, serial) == NULL) { pointer_window = _gdk_window_find_descendant_at (toplevel_window, @@ -10380,22 +11222,25 @@ proxy_button_event (GdkEvent *source_event, } pointer_window = (GdkWindow *)w; - _gdk_display_add_pointer_grab (display, - pointer_window, - toplevel_window, - FALSE, - gdk_window_get_events (pointer_window), - serial, + _gdk_display_add_device_grab (display, + device, + pointer_window, + toplevel_window, + GDK_OWNERSHIP_NONE, + FALSE, + gdk_window_get_events (pointer_window), + serial, time_, - TRUE); - _gdk_display_pointer_grab_update (display, serial); + TRUE); + _gdk_display_device_grab_update (display, device, serial); } - pointer_window = get_pointer_window (display, toplevel_window, + pointer_window = get_pointer_window (display, toplevel_window, device, toplevel_x, toplevel_y, serial); event_win = get_event_window (display, + device, pointer_window, type, state, NULL, serial); @@ -10403,6 +11248,10 @@ proxy_button_event (GdkEvent *source_event, if (event_win == NULL || display->ignore_core_events) return TRUE; + if (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_MASTER && + gdk_window_get_device_events (event_win, device) == 0) + return TRUE; + event = _gdk_make_event (event_win, type, source_event, FALSE); switch (type) @@ -10417,6 +11266,8 @@ proxy_button_event (GdkEvent *source_event, event->button.y_root = source_event->button.y_root; event->button.state = state; event->button.device = source_event->button.device; + event->button.axes = g_memdup (source_event->button.axes, + sizeof (gdouble) * source_event->button.device->num_axes); if (type == GDK_BUTTON_PRESS) _gdk_event_button_generate (display, event); @@ -10515,22 +11366,6 @@ gdk_window_print_tree (GdkWindow *window, #endif /* DEBUG_WINDOW_PRINTING */ -static gboolean -is_input_event (GdkDisplay *display, - GdkEvent *event) -{ - GdkDevice *core_pointer; - - core_pointer = gdk_display_get_core_pointer (display); - if ((event->type == GDK_MOTION_NOTIFY && - event->motion.device != core_pointer) || - ((event->type == GDK_BUTTON_PRESS || - event->type == GDK_BUTTON_RELEASE) && - event->button.device != core_pointer)) - return TRUE; - return FALSE; -} - void _gdk_windowing_got_event (GdkDisplay *display, GList *event_link, @@ -10542,19 +11377,39 @@ _gdk_windowing_got_event (GdkDisplay *display, gdouble x, y; gboolean unlink_event; guint old_state, old_button; - GdkPointerGrabInfo *button_release_grab; + GdkDeviceGrabInfo *button_release_grab; + GdkPointerWindowInfo *pointer_info; + GdkDevice *device; gboolean is_toplevel; if (gdk_event_get_time (event) != GDK_CURRENT_TIME) display->last_event_time = gdk_event_get_time (event); - _gdk_display_pointer_grab_update (display, - serial); + device = gdk_event_get_device (event); + + if (device) + { + GdkInputMode mode; + + g_object_get (device, "input-mode", &mode, NULL); + _gdk_display_device_grab_update (display, device, serial); + + if (mode == GDK_MODE_DISABLED || + !_gdk_display_check_grab_ownership (display, device, serial)) + { + /* Device events are blocked by another + * device grab, or the device is disabled + */ + unlink_event = TRUE; + goto out; + } + } event_window = event->any.window; if (!event_window) return; + pointer_info = _gdk_display_get_pointer_info (display, device); event_private = GDK_WINDOW_OBJECT (event_window); #ifdef DEBUG_WINDOW_PRINTING @@ -10571,31 +11426,32 @@ _gdk_windowing_got_event (GdkDisplay *display, { if (event->type == GDK_BUTTON_PRESS && !event->any.send_event && - _gdk_display_has_pointer_grab (display, serial) == NULL) + _gdk_display_has_device_grab (display, device, serial) == NULL) { - _gdk_display_add_pointer_grab (display, - event_window, - event_window, - FALSE, - gdk_window_get_events (event_window), - serial, - gdk_event_get_time (event), - TRUE); - _gdk_display_pointer_grab_update (display, - serial); + _gdk_display_add_device_grab (display, + device, + event_window, + event_window, + GDK_OWNERSHIP_NONE, + FALSE, + gdk_window_get_events (event_window), + serial, + gdk_event_get_time (event), + TRUE); + _gdk_display_device_grab_update (display, device, serial); } if (event->type == GDK_BUTTON_RELEASE && !event->any.send_event) { button_release_grab = - _gdk_display_has_pointer_grab (display, serial); + _gdk_display_has_device_grab (display, device, serial); if (button_release_grab && button_release_grab->implicit && (event->button.state & GDK_ANY_BUTTON_MASK & ~(GDK_BUTTON1_MASK << (event->button.button - 1))) == 0) { button_release_grab->serial_end = serial; button_release_grab->implicit_ungrab = FALSE; - _gdk_display_pointer_grab_update (display, serial); + _gdk_display_device_grab_update (display, device, serial); } } @@ -10613,9 +11469,6 @@ _gdk_windowing_got_event (GdkDisplay *display, return; } - if (is_input_event (display, event)) - return; - if (!(is_button_type (event->type) || is_motion_type (event->type)) || event_private->window_type == GDK_WINDOW_ROOT) @@ -10627,7 +11480,7 @@ _gdk_windowing_got_event (GdkDisplay *display, event->type == GDK_LEAVE_NOTIFY) && (event->crossing.mode == GDK_CROSSING_GRAB || event->crossing.mode == GDK_CROSSING_UNGRAB) && - (_gdk_display_has_pointer_grab (display, serial) || + (_gdk_display_has_device_grab (display, device, serial) || event->crossing.detail == GDK_NOTIFY_INFERIOR)) { /* We synthesize all crossing events due to grabs ourselves, @@ -10653,9 +11506,9 @@ _gdk_windowing_got_event (GdkDisplay *display, event->type == GDK_ENTER_NOTIFY && event->crossing.mode == GDK_CROSSING_UNGRAB) { - if (display->pointer_info.toplevel_under_pointer) - g_object_unref (display->pointer_info.toplevel_under_pointer); - display->pointer_info.toplevel_under_pointer = g_object_ref (event_window); + if (pointer_info->toplevel_under_pointer) + g_object_unref (pointer_info->toplevel_under_pointer); + pointer_info->toplevel_under_pointer = g_object_ref (event_window); } unlink_event = TRUE; @@ -10668,36 +11521,37 @@ _gdk_windowing_got_event (GdkDisplay *display, if (event->type == GDK_ENTER_NOTIFY && event->crossing.detail != GDK_NOTIFY_INFERIOR) { - if (display->pointer_info.toplevel_under_pointer) - g_object_unref (display->pointer_info.toplevel_under_pointer); - display->pointer_info.toplevel_under_pointer = g_object_ref (event_window); + if (pointer_info->toplevel_under_pointer) + g_object_unref (pointer_info->toplevel_under_pointer); + pointer_info->toplevel_under_pointer = g_object_ref (event_window); } else if (event->type == GDK_LEAVE_NOTIFY && event->crossing.detail != GDK_NOTIFY_INFERIOR && - display->pointer_info.toplevel_under_pointer == event_window) + pointer_info->toplevel_under_pointer == event_window) { - if (display->pointer_info.toplevel_under_pointer) - g_object_unref (display->pointer_info.toplevel_under_pointer); - display->pointer_info.toplevel_under_pointer = NULL; + if (pointer_info->toplevel_under_pointer) + g_object_unref (pointer_info->toplevel_under_pointer); + pointer_info->toplevel_under_pointer = NULL; } } /* Store last pointer window and position/state */ - old_state = display->pointer_info.state; - old_button = display->pointer_info.button; + old_state = pointer_info->state; + old_button = pointer_info->button; gdk_event_get_coords (event, &x, &y); convert_native_coords_to_toplevel (event_window, x, y, &x, &y); - display->pointer_info.toplevel_x = x; - display->pointer_info.toplevel_y = y; - gdk_event_get_state (event, &display->pointer_info.state); + pointer_info->toplevel_x = x; + pointer_info->toplevel_y = y; + gdk_event_get_state (event, &pointer_info->state); if (event->type == GDK_BUTTON_PRESS || event->type == GDK_BUTTON_RELEASE) - display->pointer_info.button = event->button.button; + pointer_info->button = event->button.button; - if (display->pointer_info.state != old_state || - display->pointer_info.button != old_button) - _gdk_display_enable_motion_hints (display); + if (device && + (pointer_info->state != old_state || + pointer_info->button != old_button)) + _gdk_display_enable_motion_hints (display, device); unlink_event = FALSE; if (is_motion_type (event->type)) @@ -10712,14 +11566,14 @@ _gdk_windowing_got_event (GdkDisplay *display, !event->any.send_event) { button_release_grab = - _gdk_display_has_pointer_grab (display, serial); + _gdk_display_has_device_grab (display, device, serial); if (button_release_grab && button_release_grab->implicit && (event->button.state & GDK_ANY_BUTTON_MASK & ~(GDK_BUTTON1_MASK << (event->button.button - 1))) == 0) { button_release_grab->serial_end = serial; button_release_grab->implicit_ungrab = FALSE; - _gdk_display_pointer_grab_update (display, serial); + _gdk_display_device_grab_update (display, device, serial); } } @@ -10742,9 +11596,10 @@ get_extension_event_window (GdkDisplay *display, guint evmask; GdkWindow *grab_window; GdkWindowObject *w; - GdkPointerGrabInfo *grab; + GdkDeviceGrabInfo *grab; - grab = _gdk_display_has_pointer_grab (display, serial); + /* FIXME: which device? */ + grab = _gdk_display_has_device_grab (display, display->core_pointer, serial); if (grab != NULL && !grab->owner_events) { @@ -10803,7 +11658,8 @@ _gdk_window_get_input_window_for_event (GdkWindow *native_window, toplevel_window = convert_native_coords_to_toplevel (native_window, toplevel_x, toplevel_y, &toplevel_x, &toplevel_y); - pointer_window = get_pointer_window (display, toplevel_window, + /* FIXME: which device? */ + pointer_window = get_pointer_window (display, toplevel_window, NULL, toplevel_x, toplevel_y, serial); event_win = get_extension_event_window (display, pointer_window, diff --git a/gdk/gdkwindow.h b/gdk/gdkwindow.h index 2402078214..640f6af3f4 100644 --- a/gdk/gdkwindow.h +++ b/gdk/gdkwindow.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) +#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) #error "Only can be included directly." #endif @@ -42,14 +42,16 @@ typedef struct _GdkWindowAttr GdkWindowAttr; typedef struct _GdkPointerHooks GdkPointerHooks; typedef struct _GdkWindowRedirect GdkWindowRedirect; -/* Classes of windows. - * InputOutput: Almost every window should be of this type. Such windows - * receive events and are also displayed on screen. - * InputOnly: Used only in special circumstances when events need to be - * stolen from another window or windows. Input only windows - * have no visible output, so they are handy for placing over - * top of a group of windows in order to grab the events (or - * filter the events) from those windows. +/** + * GdkWindowClass: + * @GDK_INPUT_OUTPUT: window for graphics and events + * @GDK_INPUT_ONLY: window for events only + * + * @GDK_INPUT_OUTPUT windows are the standard kind of window you might expect. + * Such windows receive events and are also displayed on screen. + * @GDK_INPUT_ONLY windows are invisible; they are usually placed above other + * windows in order to trap or filter the events. You can't draw on + * @GDK_INPUT_ONLY windows. */ typedef enum { @@ -57,18 +59,20 @@ typedef enum GDK_INPUT_ONLY } GdkWindowClass; -/* Types of windows. - * Root: There is only 1 root window and it is initialized - * at startup. Creating a window of type GDK_WINDOW_ROOT - * is an error. - * Toplevel: Windows which interact with the window manager. - * Child: Windows which are children of some other type of window. - * (Any other type of window). Most windows are child windows. - * Dialog: A special kind of toplevel window which interacts with - * the window manager slightly differently than a regular - * toplevel window. Dialog windows should be used for any - * transient window. - * Foreign: A window that actually belongs to another application +/** + * GdkWindowType: + * @GDK_WINDOW_ROOT: root window; this window has no parent, covers the entire + * screen, and is created by the window system + * @GDK_WINDOW_TOPLEVEL: toplevel window (used to implement #GtkWindow) + * @GDK_WINDOW_CHILD: child window (used to implement e.g. #GtkEntry) + * @GDK_WINDOW_DIALOG: useless/deprecated compatibility type + * @GDK_WINDOW_TEMP: override redirect temporary window (used to implement + * #GtkMenu) + * @GDK_WINDOW_FOREIGN: foreign window (see gdk_window_foreign_new()) + * @GDK_WINDOW_OFFSCREEN: offscreen window (see + * ). Since 2.18 + * + * Describes the kind of window. */ typedef enum { @@ -81,13 +85,24 @@ typedef enum GDK_WINDOW_OFFSCREEN } GdkWindowType; -/* Window attribute mask values. - * GDK_WA_TITLE: The "title" field is valid. - * GDK_WA_X: The "x" field is valid. - * GDK_WA_Y: The "y" field is valid. - * GDK_WA_CURSOR: The "cursor" field is valid. - * GDK_WA_COLORMAP: The "colormap" field is valid. - * GDK_WA_VISUAL: The "visual" field is valid. +/** + * GdkWindowAttributesType: + * @GDK_WA_TITLE: Honor the title field + * @GDK_WA_X: Honor the X coordinate field + * @GDK_WA_Y: Honor the Y coordinate field + * @GDK_WA_CURSOR: Honor the cursor field + * @GDK_WA_COLORMAP: Honor the colormap field + * @GDK_WA_VISUAL: Honor the visual field + * @GDK_WA_WMCLASS: Honor the wmclass_class and wmclass_name fields + * @GDK_WA_NOREDIR: Honor the override_redirect field + * @GDK_WA_TYPE_HINT: Honor the type_hint field + * + * Used to indicate which fields in the #GdkWindowAttr struct should be honored. + * For example, if you filled in the "cursor" and "x" fields of #GdkWindowAttr, + * pass "@GDK_WA_X | @GDK_WA_CURSOR" to gdk_window_new(). Fields in + * #GdkWindowAttr not covered by a bit in this enum are required; for example, + * the @width/@height, @wclass, and @window_type fields are required, they have + * no corresponding flag in #GdkWindowAttributesType. */ typedef enum { @@ -104,6 +119,29 @@ typedef enum /* Size restriction enumeration. */ +/** + * GdkWindowHints: + * @GDK_HINT_POS: indicates that the program has positioned the window + * @GDK_HINT_MIN_SIZE: min size fields are set + * @GDK_HINT_MAX_SIZE: max size fields are set + * @GDK_HINT_BASE_SIZE: base size fields are set + * @GDK_HINT_ASPECT: aspect ratio fields are set + * @GDK_HINT_RESIZE_INC: resize increment fields are set + * @GDK_HINT_WIN_GRAVITY: window gravity field is set + * @GDK_HINT_USER_POS: indicates that the window's position was explicitly set + * by the user + * @GDK_HINT_USER_SIZE: indicates that the window's size was explicitly set by + * the user + * + * Used to indicate which fields of a #GdkGeometry struct should be paid + * attention to. Also, the presence/absence of @GDK_HINT_POS, + * @GDK_HINT_USER_POS, and @GDK_HINT_USER_SIZE is significant, though they don't + * directly refer to #GdkGeometry fields. @GDK_HINT_USER_POS will be set + * automatically by #GtkWindow if you call gtk_window_move(). + * @GDK_HINT_USER_POS and @GDK_HINT_USER_SIZE should be set if the user + * specified a size/position using a --geometry command-line argument; + * gtk_window_parse_geometry() automatically sets these flags. + */ typedef enum { GDK_HINT_POS = 1 << 0, @@ -118,17 +156,37 @@ typedef enum } GdkWindowHints; -/* Window type hints. - * These are hints for the window manager that indicate - * what type of function the window has. The window manager - * can use this when determining decoration and behaviour - * of the window. The hint must be set before mapping the - * window. +/** + * GdkWindowTypeHint: + * @GDK_WINDOW_TYPE_HINT_NORMAL: Normal toplevel window. + * @GDK_WINDOW_TYPE_HINT_DIALOG: Dialog window. + * @GDK_WINDOW_TYPE_HINT_MENU: Window used to implement a menu; GTK+ uses + * this hint only for torn-off menus, see #GtkTearoffMenuItem. + * @GDK_WINDOW_TYPE_HINT_TOOLBAR: Window used to implement toolbars. + * @GDK_WINDOW_TYPE_HINT_SPLASHSCREEN: Window used to display a splash + * screen during application startup. + * @GDK_WINDOW_TYPE_HINT_UTILITY: Utility windows which are not detached + * toolbars or dialogs. + * @GDK_WINDOW_TYPE_HINT_DOCK: Used for creating dock or panel windows. + * @GDK_WINDOW_TYPE_HINT_DESKTOP: Used for creating the desktop background + * window. + * @GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU: A menu that belongs to a menubar. + * @GDK_WINDOW_TYPE_HINT_POPUP_MENU: A menu that does not belong to a menubar, + * e.g. a context menu. + * @GDK_WINDOW_TYPE_HINT_TOOLTIP: A tooltip. + * @GDK_WINDOW_TYPE_HINT_NOTIFICATION: A notification - typically a "bubble" + * that belongs to a status icon. + * @GDK_WINDOW_TYPE_HINT_COMBO: A popup from a combo box. + * @GDK_WINDOW_TYPE_HINT_DND: A window that is used to implement a DND cursor. * - * Normal: Normal toplevel window - * Dialog: Dialog window - * Menu: Window used to implement a menu. - * Toolbar: Window used to implement toolbars. + * These are hints for the window manager that indicate what type of function + * the window has. The window manager can use this when determining decoration + * and behaviour of the window. The hint must be set before mapping the window. + * + * See the + * Extended + * Window Manager Hints specification for more details about + * window types. */ typedef enum { @@ -153,6 +211,20 @@ typedef enum * of gdk_window_set_decorations/gdk_window_set_functions * will need to change as well. */ +/** + * GdkWMDecoration: + * @GDK_DECOR_ALL: all decorations should be applied. + * @GDK_DECOR_BORDER: a frame should be drawn around the window. + * @GDK_DECOR_RESIZEH: the frame should have resize handles. + * @GDK_DECOR_TITLE: a titlebar should be placed above the window. + * @GDK_DECOR_MENU: a button for opening a menu should be included. + * @GDK_DECOR_MINIMIZE: a minimize button should be included. + * @GDK_DECOR_MAXIMIZE: a maximize button should be included. + * + * These are hints originally defined by the Motif toolkit. + * The window manager can use them when determining how to decorate + * the window. The hint must be set before mapping the window. + */ typedef enum { GDK_DECOR_ALL = 1 << 0, @@ -164,6 +236,19 @@ typedef enum GDK_DECOR_MAXIMIZE = 1 << 6 } GdkWMDecoration; +/** + * GdkWMFunction: + * @GDK_FUNC_ALL: all functions should be offered. + * @GDK_FUNC_RESIZE: the window should be resizable. + * @GDK_FUNC_MOVE: the window should be movable. + * @GDK_FUNC_MINIMIZE: the window should be minimizable. + * @GDK_FUNC_MAXIMIZE: the window should be maximizable. + * @GDK_FUNC_CLOSE: the window should be closable. + * + * These are hints originally defined by the Motif toolkit. The window manager + * can use them when determining the functions to offer for the window. The + * hint must be set before mapping the window. + */ typedef enum { GDK_FUNC_ALL = 1 << 0, @@ -178,6 +263,26 @@ typedef enum * X protocol. If you change that, gdkwindow-x11.c/gdk_window_set_geometry_hints() * will need fixing. */ +/** + * GdkGravity: + * @GDK_GRAVITY_NORTH_WEST: the reference point is at the top left corner. + * @GDK_GRAVITY_NORTH: the reference point is in the middle of the top edge. + * @GDK_GRAVITY_NORTH_EAST: the reference point is at the top right corner. + * @GDK_GRAVITY_WEST: the reference point is at the middle of the left edge. + * @GDK_GRAVITY_CENTER: the reference point is at the center of the window. + * @GDK_GRAVITY_EAST: the reference point is at the middle of the right edge. + * @GDK_GRAVITY_SOUTH_WEST: the reference point is at the lower left corner. + * @GDK_GRAVITY_SOUTH: the reference point is at the middle of the lower edge. + * @GDK_GRAVITY_SOUTH_EAST: the reference point is at the lower right corner. + * @GDK_GRAVITY_STATIC: the reference point is at the top left corner of the + * window itself, ignoring window manager decorations. + * + * Defines the reference point of a window and the meaning of coordinates + * passed to gtk_window_move(). See gtk_window_move() and the "implementation + * notes" section of the + * Extended + * Window Manager Hints specification for more details. + */ typedef enum { GDK_GRAVITY_NORTH_WEST = 1, @@ -193,6 +298,19 @@ typedef enum } GdkGravity; +/** + * GdkWindowEdge: + * @GDK_WINDOW_EDGE_NORTH_WEST: the top left corner. + * @GDK_WINDOW_EDGE_NORTH: the top edge. + * @GDK_WINDOW_EDGE_NORTH_EAST: the top right corner. + * @GDK_WINDOW_EDGE_WEST: the left edge. + * @GDK_WINDOW_EDGE_EAST: the right edge. + * @GDK_WINDOW_EDGE_SOUTH_WEST: the lower left corner. + * @GDK_WINDOW_EDGE_SOUTH: the lower edge. + * @GDK_WINDOW_EDGE_SOUTH_EAST: the lower right corner. + * + * Determines a window edge or corner. + */ typedef enum { GDK_WINDOW_EDGE_NORTH_WEST, @@ -205,6 +323,27 @@ typedef enum GDK_WINDOW_EDGE_SOUTH_EAST } GdkWindowEdge; +/** + * GdkWindowAttr: + * @title: title of the window (for toplevel windows) + * @event_mask: event mask (see gdk_window_set_events()) + * @x: X coordinate relative to parent window (see gdk_window_move()) + * @y: Y coordinate relative to parent window (see gdk_window_move()) + * @width: width of window + * @height: height of window + * @wclass: #GDK_INPUT_OUTPUT (normal window) or #GDK_INPUT_ONLY (invisible + * window that receives events) + * @visual: #GdkVisual for window + * @colormap: #GdkColormap for window + * @window_type: type of window + * @cursor: cursor for the window (see gdk_window_set_cursor()) + * @wmclass_name: don't use (see gtk_window_set_wmclass()) + * @wmclass_class: don't use (see gtk_window_set_wmclass()) + * @override_redirect: %TRUE to bypass the window manager + * @type_hint: a hint of the function of the window + * + * Attributes to use for a newly-created window. + */ struct _GdkWindowAttr { gchar *title; @@ -223,6 +362,82 @@ struct _GdkWindowAttr GdkWindowTypeHint type_hint; }; +/** + * GdkGeometry: + * @min_width: minimum width of window (or -1 to use requisition, with + * #GtkWindow only) + * @min_height: minimum height of window (or -1 to use requisition, with + * #GtkWindow only) + * @max_width: maximum width of window (or -1 to use requisition, with + * #GtkWindow only) + * @max_height: maximum height of window (or -1 to use requisition, with + * #GtkWindow only) + * @base_width: allowed window widths are @base_width + @width_inc * N where N + * is any integer (-1 allowed with #GtkWindow) + * @base_height: allowed window widths are @base_height + @height_inc * N where + * N is any integer (-1 allowed with #GtkWindow) + * @width_inc: width resize increment + * @height_inc: height resize increment + * @min_aspect: minimum width/height ratio + * @max_aspect: maximum width/height ratio + * @win_gravity: window gravity, see gtk_window_set_gravity() + * + * The #GdkGeometry struct gives the window manager information about + * a window's geometry constraints. Normally you would set these on + * the GTK+ level using gtk_window_set_geometry_hints(). #GtkWindow + * then sets the hints on the #GdkWindow it creates. + * + * gdk_window_set_geometry_hints() expects the hints to be fully valid already + * and simply passes them to the window manager; in contrast, + * gtk_window_set_geometry_hints() performs some interpretation. For example, + * #GtkWindow will apply the hints to the geometry widget instead of the + * toplevel window, if you set a geometry widget. Also, the + * @min_width/@min_height/@max_width/@max_height fields may be set to -1, and + * #GtkWindow will substitute the size request of the window or geometry widget. + * If the minimum size hint is not provided, #GtkWindow will use its requisition + * as the minimum size. If the minimum size is provided and a geometry widget is + * set, #GtkWindow will take the minimum size as the minimum size of the + * geometry widget rather than the entire window. The base size is treated + * similarly. + * + * The canonical use-case for gtk_window_set_geometry_hints() is to get a + * terminal widget to resize properly. Here, the terminal text area should be + * the geometry widget; #GtkWindow will then automatically set the base size to + * the size of other widgets in the terminal window, such as the menubar and + * scrollbar. Then, the @width_inc and @height_inc fields should be set to the + * size of one character in the terminal. Finally, the base size should be set + * to the size of one character. The net effect is that the minimum size of the + * terminal will have a 1x1 character terminal area, and only terminal sizes on + * the "character grid" will be allowed. + * + * Here's an example of how the terminal example would be implemented, assuming + * a terminal area widget called "terminal" and a toplevel window "toplevel": + * + * char_width; + * hints.base_height = terminal->char_height; + * hints.min_width = terminal->char_width; + * hints.min_height = terminal->char_height; + * hints.width_inc = terminal->char_width; + * hints.height_inc = terminal->char_height; + * + * gtk_window_set_geometry_hints (GTK_WINDOW (toplevel), + * GTK_WIDGET (terminal), + * &hints, + * GDK_HINT_RESIZE_INC | + * GDK_HINT_MIN_SIZE | + * GDK_HINT_BASE_SIZE); + * ]]> + * + * The other useful fields are the @min_aspect and @max_aspect fields; these + * contain a width/height ratio as a floating point number. If a geometry widget + * is set, the aspect applies to the geometry widget rather than the entire + * window. The most common use of these hints is probably to set @min_aspect and + * @max_aspect to the same value, thus forcing the window to keep a constant + * aspect ratio. + */ struct _GdkGeometry { gint min_width; @@ -238,6 +453,23 @@ struct _GdkGeometry GdkGravity win_gravity; }; +/** + * GdkPointerHooks: + * @get_pointer: Obtains the current pointer position and modifier state. + * The position is given in coordinates relative to the window containing + * the pointer, which is returned in @window. + * @window_at_pointer: Obtains the window underneath the mouse pointer, + * returning the location of that window in @win_x, @win_y. Returns %NULL + * if the window under the mouse pointer is not known to GDK (for example, + * belongs to another application). + * + * A table of pointers to functions for getting quantities related to + * the current pointer position. GDK has one global table of this type, + * which can be set using gdk_set_pointer_hooks(). + * + * This is only useful for such low-level tools as an event recorder. + * Applications should never have any reason to use this facility + */ struct _GdkPointerHooks { GdkWindow* (*get_pointer) (GdkWindow *window, @@ -273,50 +505,51 @@ struct _GdkWindowObject { GdkDrawable parent_instance; - GdkDrawable *impl; /* window-system-specific delegate object */ + GdkDrawable *GSEAL (impl); /* window-system-specific delegate object */ - GdkWindowObject *parent; + GdkWindowObject *GSEAL (parent); - gpointer user_data; + gpointer GSEAL (user_data); - gint x; - gint y; + gint GSEAL (x); + gint GSEAL (y); - gint extension_events; + gint GSEAL (extension_events); - GList *filters; - GList *children; + GList *GSEAL (filters); + GList *GSEAL (children); - GdkColor bg_color; - GdkPixmap *bg_pixmap; + GdkColor GSEAL (bg_color); + GdkPixmap *GSEAL (bg_pixmap); - GSList *paint_stack; + GSList *GSEAL (paint_stack); - GdkRegion *update_area; - guint update_freeze_count; + GdkRegion *GSEAL (update_area); + guint GSEAL (update_freeze_count); - guint8 window_type; - guint8 depth; - guint8 resize_count; + guint8 GSEAL (window_type); + guint8 GSEAL (depth); + guint8 GSEAL (resize_count); - GdkWindowState state; + GdkWindowState GSEAL (state); - guint guffaw_gravity : 1; - guint input_only : 1; - guint modal_hint : 1; - guint composited : 1; + guint GSEAL (guffaw_gravity) : 1; + guint GSEAL (input_only) : 1; + guint GSEAL (modal_hint) : 1; + guint GSEAL (composited) : 1; - guint destroyed : 2; + guint GSEAL (destroyed) : 2; - guint accept_focus : 1; - guint focus_on_map : 1; - guint shaped : 1; + guint GSEAL (accept_focus) : 1; + guint GSEAL (focus_on_map) : 1; + guint GSEAL (shaped) : 1; + guint GSEAL (support_multidevice) : 1; - GdkEventMask event_mask; + GdkEventMask GSEAL (event_mask); - guint update_and_descendants_freeze_count; + guint GSEAL (update_and_descendants_freeze_count); - GdkWindowRedirect *redirect; + GdkWindowRedirect *GSEAL (redirect); }; #endif #endif @@ -335,8 +568,11 @@ GdkWindow* gdk_window_new (GdkWindow *parent, void gdk_window_destroy (GdkWindow *window); GdkWindowType gdk_window_get_window_type (GdkWindow *window); gboolean gdk_window_is_destroyed (GdkWindow *window); + +#ifndef GDK_MULTIDEVICE_SAFE GdkWindow* gdk_window_at_pointer (gint *win_x, gint *win_y); +#endif /* GDK_MULTIDEVICE_SAFE */ void gdk_window_show (GdkWindow *window); void gdk_window_hide (GdkWindow *window); void gdk_window_withdraw (GdkWindow *window); @@ -378,8 +614,10 @@ void gdk_window_set_user_data (GdkWindow *window, gpointer user_data); void gdk_window_set_override_redirect (GdkWindow *window, gboolean override_redirect); +gboolean gdk_window_get_accept_focus (GdkWindow *window); void gdk_window_set_accept_focus (GdkWindow *window, gboolean accept_focus); +gboolean gdk_window_get_focus_on_map (GdkWindow *window); void gdk_window_set_focus_on_map (GdkWindow *window, gboolean focus_on_map); void gdk_window_add_filter (GdkWindow *window, @@ -421,6 +659,7 @@ void gdk_window_shape_combine_region (GdkWindow *window, */ void gdk_window_set_child_shapes (GdkWindow *window); +gboolean gdk_window_get_composited (GdkWindow *window); void gdk_window_set_composited (GdkWindow *window, gboolean composited); @@ -453,6 +692,8 @@ void gdk_window_merge_child_input_shapes (GdkWindow *window); */ gboolean gdk_window_is_visible (GdkWindow *window); gboolean gdk_window_is_viewable (GdkWindow *window); +gboolean gdk_window_is_input_only (GdkWindow *window); +gboolean gdk_window_is_shaped (GdkWindow *window); GdkWindowState gdk_window_get_state (GdkWindow *window); @@ -475,20 +716,11 @@ GdkWindow* gdk_window_lookup_for_display (GdkDisplay *display, /* GdkWindow */ -#ifndef GDK_DISABLE_DEPRECATED -void gdk_window_set_hints (GdkWindow *window, - gint x, - gint y, - gint min_width, - gint min_height, - gint max_width, - gint max_height, - gint flags); -#endif void gdk_window_set_type_hint (GdkWindow *window, GdkWindowTypeHint hint); GdkWindowTypeHint gdk_window_get_type_hint (GdkWindow *window); +gboolean gdk_window_get_modal_hint (GdkWindow *window); void gdk_window_set_modal_hint (GdkWindow *window, gboolean modal); @@ -513,20 +745,30 @@ void gdk_window_flush (GdkWindow *window); void gdk_window_set_title (GdkWindow *window, const gchar *title); -void gdk_window_set_role (GdkWindow *window, - const gchar *role); -void gdk_window_set_startup_id (GdkWindow *window, - const gchar *startup_id); -void gdk_window_set_transient_for (GdkWindow *window, - GdkWindow *parent); +void gdk_window_set_role (GdkWindow *window, + const gchar *role); +void gdk_window_set_startup_id (GdkWindow *window, + const gchar *startup_id); +void gdk_window_set_transient_for (GdkWindow *window, + GdkWindow *parent); +void gdk_window_get_background (GdkWindow *window, + GdkColor *color); void gdk_window_set_background (GdkWindow *window, const GdkColor *color); +void gdk_window_get_back_pixmap (GdkWindow *window, + GdkPixmap **pixmap, + gboolean *parent_relative); void gdk_window_set_back_pixmap (GdkWindow *window, GdkPixmap *pixmap, gboolean parent_relative); void gdk_window_set_cursor (GdkWindow *window, GdkCursor *cursor); GdkCursor *gdk_window_get_cursor (GdkWindow *window); +void gdk_window_set_device_cursor (GdkWindow *window, + GdkDevice *device, + GdkCursor *cursor); +GdkCursor *gdk_window_get_device_cursor (GdkWindow *window, + GdkDevice *device); void gdk_window_get_user_data (GdkWindow *window, gpointer *data); void gdk_window_get_geometry (GdkWindow *window, @@ -569,10 +811,18 @@ void gdk_window_get_root_origin (GdkWindow *window, gint *y); void gdk_window_get_frame_extents (GdkWindow *window, GdkRectangle *rect); + +#ifndef GDK_MULTIDEVICE_SAFE GdkWindow* gdk_window_get_pointer (GdkWindow *window, gint *x, gint *y, GdkModifierType *mask); +#endif /* GDK_MULTIDEVICE_SAFE */ +GdkWindow * gdk_window_get_device_position (GdkWindow *window, + GdkDevice *device, + gint *x, + gint *y, + GdkModifierType *mask); GdkWindow * gdk_window_get_parent (GdkWindow *window); GdkWindow * gdk_window_get_toplevel (GdkWindow *window); @@ -584,6 +834,11 @@ GList * gdk_window_peek_children (GdkWindow *window); GdkEventMask gdk_window_get_events (GdkWindow *window); void gdk_window_set_events (GdkWindow *window, GdkEventMask event_mask); +void gdk_window_set_device_events (GdkWindow *window, + GdkDevice *device, + GdkEventMask event_mask); +GdkEventMask gdk_window_get_device_events (GdkWindow *window, + GdkDevice *device); void gdk_window_set_icon_list (GdkWindow *window, GList *pixbufs); @@ -602,9 +857,6 @@ gboolean gdk_window_get_decorations (GdkWindow *window, GdkWMDecoration *decorations); void gdk_window_set_functions (GdkWindow *window, GdkWMFunction functions); -#if !defined(GDK_MULTIHEAD_SAFE) && !defined(GDK_DISABLE_DEPRECATED) -GList * gdk_window_get_toplevels (void); -#endif void gdk_window_beep (GdkWindow *window); void gdk_window_iconify (GdkWindow *window); @@ -676,9 +928,9 @@ void gdk_window_get_internal_paint_info (GdkWindow *window, void gdk_window_enable_synchronized_configure (GdkWindow *window); void gdk_window_configure_finished (GdkWindow *window); -#ifndef GDK_MULTIHEAD_SAFE -GdkPointerHooks *gdk_set_pointer_hooks (const GdkPointerHooks *new_hooks); -#endif /* GDK_MULTIHEAD_SAFE */ +#if !defined (GDK_MULTIHEAD_SAFE) && !defined (GDK_MULTIDEVICE_SAFE) +GdkPointerHooks *gdk_set_pointer_hooks (const GdkPointerHooks *new_hooks); +#endif /* !GDK_MULTIHEAD_SAFE && !GDK_MULTIDEVICE_SAFE */ GdkWindow *gdk_get_default_root_window (void); @@ -699,19 +951,10 @@ void gdk_window_redirect_to_drawable (GdkWindow *window, gint height); void gdk_window_remove_redirection (GdkWindow *window); -#ifndef GDK_DISABLE_DEPRECATED -#define GDK_ROOT_PARENT() (gdk_get_default_root_window ()) -#define gdk_window_get_size gdk_drawable_get_size -#define gdk_window_get_type gdk_window_get_window_type -#define gdk_window_get_colormap gdk_drawable_get_colormap -#define gdk_window_set_colormap gdk_drawable_set_colormap -#define gdk_window_get_visual gdk_drawable_get_visual -#define gdk_window_ref g_object_ref -#define gdk_window_unref g_object_unref - -#define gdk_window_copy_area(drawable,gc,x,y,source_drawable,source_x,source_y,width,height) \ - gdk_draw_pixmap(drawable,gc,source_drawable,source_x,source_y,x,y,width,height) -#endif /* GDK_DISABLE_DEPRECATED */ +/* Multidevice support */ +void gdk_window_set_support_multidevice (GdkWindow *window, + gboolean support_multidevice); +gboolean gdk_window_get_support_multidevice (GdkWindow *window); G_END_DECLS diff --git a/gdk/gdkwindowimpl.h b/gdk/gdkwindowimpl.h index 3a5029b016..dc0ca75e93 100644 --- a/gdk/gdkwindowimpl.h +++ b/gdk/gdkwindowimpl.h @@ -77,8 +77,9 @@ struct _GdkWindowImplIface void (* clear_region) (GdkWindow *window, GdkRegion *region, gboolean send_expose); - - void (* set_cursor) (GdkWindow *window, + + void (* set_device_cursor) (GdkWindow *window, + GdkDevice *device, GdkCursor *cursor); void (* get_geometry) (GdkWindow *window, @@ -95,10 +96,11 @@ struct _GdkWindowImplIface gint (* get_deskrelative_origin) (GdkWindow *window, gint *x, gint *y); - gboolean (* get_pointer) (GdkWindow *window, + gboolean (* get_device_state) (GdkWindow *window, + GdkDevice *device, gint *x, gint *y, - GdkModifierType *mask); + GdkModifierType *mask); void (* shape_combine_region) (GdkWindow *window, const GdkRegion *shape_region, @@ -142,10 +144,6 @@ struct _GdkWindowImplIface void (* destroy) (GdkWindow *window, gboolean recursing, gboolean foreign_destroy); - - void (* input_window_destroy) (GdkWindow *window); - void (* input_window_crossing)(GdkWindow *window, - gboolean enter); gboolean supports_native_bg; }; diff --git a/gdk/makefile.msc b/gdk/makefile.msc index ded0aa277d..4599fb9eff 100644 --- a/gdk/makefile.msc +++ b/gdk/makefile.msc @@ -108,7 +108,6 @@ gdk_public_h_sources = \ gdkfont.h \ gdkgc.h \ gdkkeysyms.h \ - gdki18n.h \ gdkimage.h \ gdkinput.h \ gdkkeys.h \ diff --git a/gdk/makegdkalias.pl b/gdk/makegdkalias.pl index 8f0665dd97..02ba61d76d 100755 --- a/gdk/makegdkalias.pl +++ b/gdk/makegdkalias.pl @@ -83,7 +83,7 @@ while (<>) { next; } - if ($_ =~ /^\#ifn?def\s+G/) + if ($_ =~ /^\#ifn?def/) { print $_; diff --git a/gdk/quartz/GdkQuartzView.c b/gdk/quartz/GdkQuartzView.c index a3a8d2aadb..02018ff8d0 100644 --- a/gdk/quartz/GdkQuartzView.c +++ b/gdk/quartz/GdkQuartzView.c @@ -18,8 +18,9 @@ * Boston, MA 02111-1307, USA. */ - #import "GdkQuartzView.h" +#include "gdkregion.h" +#include "gdkregion-generic.h" #include "gdkwindow-quartz.h" #include "gdkprivate-quartz.h" @@ -92,33 +93,16 @@ } [self getRectsBeingDrawn:&drawn_rects count:&count]; - - /* Note: arbitrary limit here to not degrade performace too much. It would - * be better to optimize the construction of the region below, by using - * _gdk_region_new_from_yxbanded_rects. - */ - if (count > 25) + region = gdk_region_new (); + + for (i = 0; i < count; i++) { - gdk_rect.x = rect.origin.x; - gdk_rect.y = rect.origin.y; - gdk_rect.width = rect.size.width; - gdk_rect.height = rect.size.height; - - region = gdk_region_rectangle (&gdk_rect); - } - else - { - region = gdk_region_new (); - - for (i = 0; i < count; i++) - { - gdk_rect.x = drawn_rects[i].origin.x; - gdk_rect.y = drawn_rects[i].origin.y; - gdk_rect.width = drawn_rects[i].size.width; - gdk_rect.height = drawn_rects[i].size.height; - - gdk_region_union_with_rect (region, &gdk_rect); - } + gdk_rect.x = drawn_rects[i].origin.x; + gdk_rect.y = drawn_rects[i].origin.y; + gdk_rect.width = drawn_rects[i].size.width; + gdk_rect.height = drawn_rects[i].size.height; + + gdk_region_union_with_rect (region, &gdk_rect); } impl->in_paint_rect_count++; diff --git a/gdk/quartz/Makefile.am b/gdk/quartz/Makefile.am index a5721b1c3e..ac6c2c743b 100644 --- a/gdk/quartz/Makefile.am +++ b/gdk/quartz/Makefile.am @@ -24,6 +24,8 @@ libgdk_quartz_la_SOURCES = \ gdkapplaunchcontext-quartz.c \ gdkcolor-quartz.c \ gdkcursor-quartz.c \ + gdkdevice-core.c \ + gdkdevicemanager-core.c \ gdkdisplay-quartz.c \ gdkdnd-quartz.c \ gdkdrawable-quartz.c \ diff --git a/gdk/quartz/gdkcolor-quartz.c b/gdk/quartz/gdkcolor-quartz.c index e5289067b5..b722185792 100644 --- a/gdk/quartz/gdkcolor-quartz.c +++ b/gdk/quartz/gdkcolor-quartz.c @@ -99,39 +99,6 @@ gdk_screen_get_rgba_colormap (GdkScreen *screen) return colormap; } -gint -gdk_colormap_get_system_size (void) -{ - /* FIXME: Implement */ - return 0; -} - -void -gdk_colormap_change (GdkColormap *colormap, - gint ncolors) -{ - /* FIXME: Implement */ -} - -gboolean -gdk_colors_alloc (GdkColormap *colormap, - gboolean contiguous, - gulong *planes, - gint nplanes, - gulong *pixels, - gint npixels) -{ - return TRUE; -} - -void -gdk_colors_free (GdkColormap *colormap, - gulong *pixels, - gint npixels, - gulong planes) -{ -} - void gdk_colormap_free_colors (GdkColormap *colormap, const GdkColor *colors, @@ -213,14 +180,3 @@ _gdk_quartz_colormap_get_rgba_from_pixel (GdkColormap *colormap, else *alpha = 1.0; } - -gboolean -gdk_color_change (GdkColormap *colormap, - GdkColor *color) -{ - if (color->pixel < 0 || color->pixel >= colormap->size) - return FALSE; - - return TRUE; -} - diff --git a/gdk/quartz/gdkdevice-core.c b/gdk/quartz/gdkdevice-core.c new file mode 100644 index 0000000000..81cd6a3447 --- /dev/null +++ b/gdk/quartz/gdkdevice-core.c @@ -0,0 +1,356 @@ +/* GDK - The GIMP Drawing Kit + * Copyright (C) 2009 Carlos Garnacho + * Copyright (C) 2010 Kristian Rietveld + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#import "GdkQuartzView.h" +#include "gdkwindow-quartz.h" +#include "gdkprivate-quartz.h" +#include "gdkdevice-core.h" + +static gboolean gdk_device_core_get_history (GdkDevice *device, + GdkWindow *window, + guint32 start, + guint32 stop, + GdkTimeCoord ***events, + guint *n_events); +static void gdk_device_core_get_state (GdkDevice *device, + GdkWindow *window, + gdouble *axes, + GdkModifierType *mask); +static void gdk_device_core_set_window_cursor (GdkDevice *device, + GdkWindow *window, + GdkCursor *cursor); +static void gdk_device_core_warp (GdkDevice *device, + GdkScreen *screen, + gint x, + gint y); +static gboolean gdk_device_core_query_state (GdkDevice *device, + GdkWindow *window, + GdkWindow **root_window, + GdkWindow **child_window, + gint *root_x, + gint *root_y, + gint *win_x, + gint *win_y, + GdkModifierType *mask); +static GdkGrabStatus gdk_device_core_grab (GdkDevice *device, + GdkWindow *window, + gboolean owner_events, + GdkEventMask event_mask, + GdkWindow *confine_to, + GdkCursor *cursor, + guint32 time_); +static void gdk_device_core_ungrab (GdkDevice *device, + guint32 time_); +static GdkWindow * gdk_device_core_window_at_position (GdkDevice *device, + gint *win_x, + gint *win_y, + GdkModifierType *mask, + gboolean get_toplevel); +static void gdk_device_core_select_window_events (GdkDevice *device, + GdkWindow *window, + GdkEventMask event_mask); + + +G_DEFINE_TYPE (GdkDeviceCore, gdk_device_core, GDK_TYPE_DEVICE) + +static void +gdk_device_core_class_init (GdkDeviceCoreClass *klass) +{ + GdkDeviceClass *device_class = GDK_DEVICE_CLASS (klass); + + device_class->get_history = gdk_device_core_get_history; + device_class->get_state = gdk_device_core_get_state; + device_class->set_window_cursor = gdk_device_core_set_window_cursor; + device_class->warp = gdk_device_core_warp; + device_class->query_state = gdk_device_core_query_state; + device_class->grab = gdk_device_core_grab; + device_class->ungrab = gdk_device_core_ungrab; + device_class->window_at_position = gdk_device_core_window_at_position; + device_class->select_window_events = gdk_device_core_select_window_events; +} + +static void +gdk_device_core_init (GdkDeviceCore *device_core) +{ + GdkDevice *device; + + device = GDK_DEVICE (device_core); + + _gdk_device_add_axis (device, GDK_NONE, GDK_AXIS_X, 0, 0, 1); + _gdk_device_add_axis (device, GDK_NONE, GDK_AXIS_Y, 0, 0, 1); +} + +static gboolean +gdk_device_core_get_history (GdkDevice *device, + GdkWindow *window, + guint32 start, + guint32 stop, + GdkTimeCoord ***events, + guint *n_events) +{ + return FALSE; +} + +static void +gdk_device_core_get_state (GdkDevice *device, + GdkWindow *window, + gdouble *axes, + GdkModifierType *mask) +{ + gint x_int, y_int; + + gdk_window_get_pointer (window, &x_int, &y_int, mask); + + if (axes) + { + axes[0] = x_int; + axes[1] = y_int; + } +} + +static void +translate_coords_to_child_coords (GdkWindow *parent, + GdkWindow *child, + gint *x, + gint *y) +{ + GdkWindow *current = child; + + if (child == parent) + return; + + while (current != parent) + { + gint tmp_x, tmp_y; + + gdk_window_get_origin (current, &tmp_x, &tmp_y); + + *x -= tmp_x; + *y -= tmp_y; + + current = gdk_window_get_parent (current); + } +} + +static void +gdk_device_core_set_window_cursor (GdkDevice *device, + GdkWindow *window, + GdkCursor *cursor) +{ + GdkCursorPrivate *cursor_private; + NSCursor *nscursor; + + cursor_private = (GdkCursorPrivate*) cursor; + + if (GDK_WINDOW_DESTROYED (window)) + return; + + if (!cursor) + nscursor = [NSCursor arrowCursor]; + else + nscursor = cursor_private->nscursor; + + [nscursor set]; +} + +static void +gdk_device_core_warp (GdkDevice *device, + GdkScreen *screen, + gint x, + gint y) +{ + CGDisplayMoveCursorToPoint (CGMainDisplayID (), CGPointMake (x, y)); +} + +static GdkWindow * +gdk_device_core_query_state_helper (GdkWindow *window, + GdkDevice *device, + gint *x, + gint *y, + GdkModifierType *mask) +{ + GdkWindowObject *toplevel; + GdkWindowObject *private; + NSPoint point; + gint x_tmp, y_tmp; + GdkWindow *found_window; + + g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), NULL); + + if (GDK_WINDOW_DESTROYED (window)) + { + *x = 0; + *y = 0; + *mask = 0; + return NULL; + } + + toplevel = GDK_WINDOW_OBJECT (gdk_window_get_toplevel (window)); + + *mask = _gdk_quartz_events_get_current_event_mask (); + + /* Get the y coordinate, needs to be flipped. */ + if (window == _gdk_root) + { + point = [NSEvent mouseLocation]; + _gdk_quartz_window_nspoint_to_gdk_xy (point, &x_tmp, &y_tmp); + } + else + { + GdkWindowImplQuartz *impl; + NSWindow *nswindow; + + impl = GDK_WINDOW_IMPL_QUARTZ (toplevel->impl); + private = GDK_WINDOW_OBJECT (toplevel); + nswindow = impl->toplevel; + + point = [nswindow mouseLocationOutsideOfEventStream]; + + x_tmp = point.x; + y_tmp = private->height - point.y; + + window = (GdkWindow *)toplevel; + } + + found_window = _gdk_quartz_window_find_child (window, x_tmp, y_tmp, + FALSE); + + if (found_window == _gdk_root) + found_window = NULL; + else if (found_window) + translate_coords_to_child_coords (window, found_window, + &x_tmp, &y_tmp); + + *x = x_tmp; + *y = y_tmp; + + return found_window; +} + +static gboolean +gdk_device_core_query_state (GdkDevice *device, + GdkWindow *window, + GdkWindow **root_window, + GdkWindow **child_window, + gint *root_x, + gint *root_y, + gint *win_x, + gint *win_y, + GdkModifierType *mask) +{ + GdkDisplay *display; + GdkWindow *found_window; + NSPoint point; + gint x_tmp, y_tmp; + + found_window = gdk_device_core_query_state_helper (window, device, + win_x, win_y, + mask); + if (!found_window) + return FALSE; + + display = gdk_drawable_get_display (window); + + if (root_window) + *root_window = _gdk_root; + + if (child_window) + *child_window = found_window; + + point = [NSEvent mouseLocation]; + _gdk_quartz_window_nspoint_to_gdk_xy (point, &x_tmp, &y_tmp); + + if (root_x) + *root_x = x_tmp; + + if (root_y) + *root_y = y_tmp; + + return TRUE; +} + +static GdkGrabStatus +gdk_device_core_grab (GdkDevice *device, + GdkWindow *window, + gboolean owner_events, + GdkEventMask event_mask, + GdkWindow *confine_to, + GdkCursor *cursor, + guint32 time_) +{ + /* Should remain empty */ + return GDK_GRAB_SUCCESS; +} + +static void +gdk_device_core_ungrab (GdkDevice *device, + guint32 time_) +{ + /* Should remain empty */ +} + +static GdkWindow * +gdk_device_core_window_at_position (GdkDevice *device, + gint *win_x, + gint *win_y, + GdkModifierType *mask, + gboolean get_toplevel) +{ + GdkDisplay *display; + GdkScreen *screen; + GdkWindow *found_window; + NSPoint point; + gint x_tmp, y_tmp; + + display = gdk_device_get_display (device); + screen = gdk_display_get_default_screen (display); + + /* Get mouse coordinates, find window under the mouse pointer */ + point = [NSEvent mouseLocation]; + _gdk_quartz_window_nspoint_to_gdk_xy (point, &x_tmp, &y_tmp); + + found_window = _gdk_quartz_window_find_child (_gdk_root, x_tmp, y_tmp, + get_toplevel); + + if (found_window) + translate_coords_to_child_coords (_gdk_root, found_window, + &x_tmp, &y_tmp); + + if (win_x) + *win_x = found_window ? x_tmp : -1; + + if (win_y) + *win_y = found_window ? y_tmp : -1; + + if (mask) + *mask = _gdk_quartz_events_get_current_event_mask (); + + return found_window; +} + +static void +gdk_device_core_select_window_events (GdkDevice *device, + GdkWindow *window, + GdkEventMask event_mask) +{ + /* The mask is set in the common code. */ +} diff --git a/gdk/quartz/gdkdevice-core.h b/gdk/quartz/gdkdevice-core.h new file mode 100644 index 0000000000..8f53d6fad8 --- /dev/null +++ b/gdk/quartz/gdkdevice-core.h @@ -0,0 +1,51 @@ +/* GDK - The GIMP Drawing Kit + * Copyright (C) 2009 Carlos Garnacho + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GDK_DEVICE_CORE_H__ +#define __GDK_DEVICE_CORE_H__ + +#include + +G_BEGIN_DECLS + +#define GDK_TYPE_DEVICE_CORE (gdk_device_core_get_type ()) +#define GDK_DEVICE_CORE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_DEVICE_CORE, GdkDeviceCore)) +#define GDK_DEVICE_CORE_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_DEVICE_CORE, GdkDeviceCoreClass)) +#define GDK_IS_DEVICE_CORE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_DEVICE_CORE)) +#define GDK_IS_DEVICE_CORE_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_DEVICE_CORE)) +#define GDK_DEVICE_CORE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_DEVICE_CORE, GdkDeviceCoreClass)) + +typedef struct _GdkDeviceCore GdkDeviceCore; +typedef struct _GdkDeviceCoreClass GdkDeviceCoreClass; + +struct _GdkDeviceCore +{ + GdkDevice parent_instance; +}; + +struct _GdkDeviceCoreClass +{ + GdkDeviceClass parent_class; +}; + +GType gdk_device_core_get_type (void) G_GNUC_CONST; + +G_END_DECLS + +#endif /* __GDK_DEVICE_CORE_H__ */ diff --git a/gdk/quartz/gdkdevicemanager-core.c b/gdk/quartz/gdkdevicemanager-core.c new file mode 100644 index 0000000000..d4765c1335 --- /dev/null +++ b/gdk/quartz/gdkdevicemanager-core.c @@ -0,0 +1,130 @@ +/* GDK - The GIMP Drawing Kit + * Copyright (C) 2009 Carlos Garnacho + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include +#include +#include "gdkdevicemanager-core.h" +#include "gdkdevice-core.h" +#include "gdkkeysyms.h" + + +#define HAS_FOCUS(toplevel) \ + ((toplevel)->has_focus || (toplevel)->has_pointer_focus) + +static void gdk_device_manager_core_finalize (GObject *object); +static void gdk_device_manager_core_constructed (GObject *object); + +static GList * gdk_device_manager_core_list_devices (GdkDeviceManager *device_manager, + GdkDeviceType type); + + +G_DEFINE_TYPE (GdkDeviceManagerCore, gdk_device_manager_core, GDK_TYPE_DEVICE_MANAGER) + +static void +gdk_device_manager_core_class_init (GdkDeviceManagerCoreClass *klass) +{ + GdkDeviceManagerClass *device_manager_class = GDK_DEVICE_MANAGER_CLASS (klass); + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->finalize = gdk_device_manager_core_finalize; + object_class->constructed = gdk_device_manager_core_constructed; + device_manager_class->list_devices = gdk_device_manager_core_list_devices; +} + +static GdkDevice * +create_core_pointer (GdkDeviceManager *device_manager, + GdkDisplay *display) +{ + return g_object_new (GDK_TYPE_DEVICE_CORE, + "name", "Core Pointer", + "type", GDK_DEVICE_TYPE_MASTER, + "input-source", GDK_SOURCE_MOUSE, + "input-mode", GDK_MODE_SCREEN, + "has-cursor", TRUE, + "display", display, + "device-manager", device_manager, + NULL); +} + +static GdkDevice * +create_core_keyboard (GdkDeviceManager *device_manager, + GdkDisplay *display) +{ + return g_object_new (GDK_TYPE_DEVICE_CORE, + "name", "Core Keyboard", + "type", GDK_DEVICE_TYPE_MASTER, + "input-source", GDK_SOURCE_KEYBOARD, + "input-mode", GDK_MODE_SCREEN, + "has-cursor", FALSE, + "display", display, + "device-manager", device_manager, + NULL); +} + +static void +gdk_device_manager_core_init (GdkDeviceManagerCore *device_manager) +{ +} + +static void +gdk_device_manager_core_finalize (GObject *object) +{ + GdkDeviceManagerCore *device_manager_core; + + device_manager_core = GDK_DEVICE_MANAGER_CORE (object); + + g_object_unref (device_manager_core->core_pointer); + g_object_unref (device_manager_core->core_keyboard); + + G_OBJECT_CLASS (gdk_device_manager_core_parent_class)->finalize (object); +} + +static void +gdk_device_manager_core_constructed (GObject *object) +{ + GdkDeviceManagerCore *device_manager; + GdkDisplay *display; + + device_manager = GDK_DEVICE_MANAGER_CORE (object); + display = gdk_device_manager_get_display (GDK_DEVICE_MANAGER (object)); + device_manager->core_pointer = create_core_pointer (GDK_DEVICE_MANAGER (device_manager), display); + device_manager->core_keyboard = create_core_keyboard (GDK_DEVICE_MANAGER (device_manager), display); + + _gdk_device_set_associated_device (device_manager->core_pointer, device_manager->core_keyboard); + _gdk_device_set_associated_device (device_manager->core_keyboard, device_manager->core_pointer); +} + +static GList * +gdk_device_manager_core_list_devices (GdkDeviceManager *device_manager, + GdkDeviceType type) +{ + GdkDeviceManagerCore *device_manager_core; + GList *devices = NULL; + + if (type == GDK_DEVICE_TYPE_MASTER) + { + device_manager_core = (GdkDeviceManagerCore *) device_manager; + devices = g_list_prepend (devices, device_manager_core->core_keyboard); + devices = g_list_prepend (devices, device_manager_core->core_pointer); + } + + return devices; +} diff --git a/gdk/quartz/gdkdevicemanager-core.h b/gdk/quartz/gdkdevicemanager-core.h new file mode 100644 index 0000000000..0a337fcd00 --- /dev/null +++ b/gdk/quartz/gdkdevicemanager-core.h @@ -0,0 +1,54 @@ +/* GDK - The GIMP Drawing Kit + * Copyright (C) 2009 Carlos Garnacho + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GDK_DEVICE_MANAGER_CORE_H__ +#define __GDK_DEVICE_MANAGER_CORE_H__ + +#include + +G_BEGIN_DECLS + +#define GDK_TYPE_DEVICE_MANAGER_CORE (gdk_device_manager_core_get_type ()) +#define GDK_DEVICE_MANAGER_CORE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_DEVICE_MANAGER_CORE, GdkDeviceManagerCore)) +#define GDK_DEVICE_MANAGER_CORE_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_DEVICE_MANAGER_CORE, GdkDeviceManagerCoreClass)) +#define GDK_IS_DEVICE_MANAGER_CORE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_DEVICE_MANAGER_CORE)) +#define GDK_IS_DEVICE_MANAGER_CORE_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_DEVICE_MANAGER_CORE)) +#define GDK_DEVICE_MANAGER_CORE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_DEVICE_MANAGER_CORE, GdkDeviceManagerCoreClass)) + +typedef struct _GdkDeviceManagerCore GdkDeviceManagerCore; +typedef struct _GdkDeviceManagerCoreClass GdkDeviceManagerCoreClass; + +struct _GdkDeviceManagerCore +{ + GdkDeviceManager parent_object; + GdkDevice *core_pointer; + GdkDevice *core_keyboard; +}; + +struct _GdkDeviceManagerCoreClass +{ + GdkDeviceManagerClass parent_class; +}; + +GType gdk_device_manager_core_get_type (void) G_GNUC_CONST; + + +G_END_DECLS + +#endif /* __GDK_DEVICE_MANAGER_CORE_H__ */ diff --git a/gdk/quartz/gdkdisplay-quartz.c b/gdk/quartz/gdkdisplay-quartz.c index 5de6519207..556f84eee5 100644 --- a/gdk/quartz/gdkdisplay-quartz.c +++ b/gdk/quartz/gdkdisplay-quartz.c @@ -23,6 +23,7 @@ #include "gdk.h" #include "gdkprivate-quartz.h" #include "gdkscreen-quartz.h" +#include "gdkdevicemanager-core.h" GdkWindow * gdk_display_get_default_group (GdkDisplay *display) @@ -40,6 +41,14 @@ _gdk_windowing_set_default_display (GdkDisplay *display) g_assert (display == NULL || _gdk_display == display); } +GdkDeviceManager * +_gdk_device_manager_new (GdkDisplay *display) +{ + return g_object_new (GDK_TYPE_DEVICE_MANAGER_CORE, + "display", display, + NULL); +} + GdkDisplay * gdk_display_open (const gchar *display_name) { @@ -50,6 +59,7 @@ gdk_display_open (const gchar *display_name) [NSApplication sharedApplication]; _gdk_display = g_object_new (GDK_TYPE_DISPLAY, NULL); + _gdk_display->device_manager = _gdk_device_manager_new (_gdk_display); _gdk_visual_init (); @@ -58,6 +68,7 @@ gdk_display_open (const gchar *display_name) _gdk_windowing_window_init (); _gdk_events_init (); + _gdk_input_init (); #if 0 diff --git a/gdk/quartz/gdkdnd-quartz.c b/gdk/quartz/gdkdnd-quartz.c index bb70b710fc..2292d1fbb1 100644 --- a/gdk/quartz/gdkdnd-quartz.c +++ b/gdk/quartz/gdkdnd-quartz.c @@ -87,18 +87,6 @@ gdk_drag_context_new (void) return (GdkDragContext *)g_object_new (gdk_drag_context_get_type (), NULL); } -void -gdk_drag_context_ref (GdkDragContext *context) -{ - g_object_ref (context); -} - -void -gdk_drag_context_unref (GdkDragContext *context) -{ - g_object_unref (context); -} - GdkDragContext *_gdk_quartz_drag_source_context = NULL; GdkDragContext * diff --git a/gdk/quartz/gdkeventloop-quartz.c b/gdk/quartz/gdkeventloop-quartz.c index 9f87371a20..f11d4d88e7 100644 --- a/gdk/quartz/gdkeventloop-quartz.c +++ b/gdk/quartz/gdkeventloop-quartz.c @@ -987,6 +987,7 @@ _gdk_quartz_event_loop_init (void) event_poll_fd.fd = -1; source = g_source_new (&event_funcs, sizeof (GSource)); + g_source_set_name (source, "GDK Quartz event source"); g_source_add_poll (source, &event_poll_fd); g_source_set_priority (source, GDK_PRIORITY_EVENTS); g_source_set_can_recurse (source, TRUE); diff --git a/gdk/quartz/gdkevents-quartz.c b/gdk/quartz/gdkevents-quartz.c index 1a0b67846b..5a7180d3ed 100644 --- a/gdk/quartz/gdkevents-quartz.c +++ b/gdk/quartz/gdkevents-quartz.c @@ -32,6 +32,7 @@ #include "gdkscreen.h" #include "gdkkeysyms.h" #include "gdkprivate-quartz.h" +#include "gdkdevicemanager-core.h" #define GRIP_WIDTH 15 #define GRIP_HEIGHT 15 @@ -75,70 +76,45 @@ gdk_event_get_graphics_expose (GdkWindow *window) return NULL; } -GdkGrabStatus -gdk_keyboard_grab (GdkWindow *window, - gint owner_events, - guint32 time) -{ - GdkDisplay *display; - GdkWindow *toplevel; - - g_return_val_if_fail (window != NULL, 0); - g_return_val_if_fail (GDK_IS_WINDOW (window), 0); - - display = gdk_drawable_get_display (window); - toplevel = gdk_window_get_toplevel (window); - - _gdk_display_set_has_keyboard_grab (display, - window, - toplevel, - owner_events, - 0, - time); - - return GDK_GRAB_SUCCESS; -} - void -gdk_display_keyboard_ungrab (GdkDisplay *display, - guint32 time) +gdk_device_ungrab (GdkDevice *device, + guint32 time_) { - _gdk_display_unset_has_keyboard_grab (display, FALSE); -} + GdkDeviceGrabInfo *grab; -void -gdk_display_pointer_ungrab (GdkDisplay *display, - guint32 time) -{ - GdkPointerGrabInfo *grab; - - grab = _gdk_display_get_last_pointer_grab (display); + grab = _gdk_display_get_last_device_grab (_gdk_display, device); if (grab) grab->serial_end = 0; - _gdk_display_pointer_grab_update (display, 0); + _gdk_display_device_grab_update (_gdk_display, device, 0); } GdkGrabStatus -_gdk_windowing_pointer_grab (GdkWindow *window, - GdkWindow *native, - gboolean owner_events, - GdkEventMask event_mask, - GdkWindow *confine_to, - GdkCursor *cursor, - guint32 time) +_gdk_windowing_device_grab (GdkDevice *device, + GdkWindow *window, + GdkWindow *native, + gboolean owner_events, + GdkEventMask event_mask, + GdkWindow *confine_to, + GdkCursor *cursor, + guint32 time) { g_return_val_if_fail (GDK_IS_WINDOW (window), 0); g_return_val_if_fail (confine_to == NULL || GDK_IS_WINDOW (confine_to), 0); - _gdk_display_add_pointer_grab (_gdk_display, - window, - native, - owner_events, - event_mask, - 0, - time, - FALSE); + if (!window || GDK_WINDOW_DESTROYED (window)) + return GDK_GRAB_NOT_VIEWABLE; + + _gdk_display_add_device_grab (_gdk_display, + device, + window, + native, + GDK_OWNERSHIP_NONE, + owner_events, + event_mask, + 0, + time, + FALSE); return GDK_GRAB_SUCCESS; } @@ -146,19 +122,27 @@ _gdk_windowing_pointer_grab (GdkWindow *window, static void break_all_grabs (guint32 time) { - GdkPointerGrabInfo *grab; + GList *list, *l; + GdkDeviceManager *device_manager; - if (_gdk_display->keyboard_grab.window) - _gdk_display_unset_has_keyboard_grab (_gdk_display, FALSE); - - grab = _gdk_display_get_last_pointer_grab (_gdk_display); - if (grab) + device_manager = gdk_display_get_device_manager (_gdk_display); + list = gdk_device_manager_list_devices (device_manager, + GDK_DEVICE_TYPE_MASTER); + for (l = list; l; l = l->next) { - grab->serial_end = 0; - grab->implicit_ungrab = TRUE; + GdkDeviceGrabInfo *grab; + + grab = _gdk_display_get_last_device_grab (_gdk_display, l->data); + if (grab) + { + grab->serial_end = 0; + grab->implicit_ungrab = TRUE; + } + + _gdk_display_device_grab_update (_gdk_display, l->data, 0); } - _gdk_display_pointer_grab_update (_gdk_display, 0); + g_list_free (list); } static void @@ -351,11 +335,15 @@ create_focus_event (GdkWindow *window, gboolean in) { GdkEvent *event; + GdkDeviceManagerCore *device_manager; event = gdk_event_new (GDK_FOCUS_CHANGE); event->focus_change.window = window; event->focus_change.in = in; + device_manager = GDK_DEVICE_MANAGER_CORE (_gdk_display->device_manager); + gdk_event_set_device (event, device_manager->core_keyboard); + return event; } @@ -488,6 +476,8 @@ _gdk_quartz_events_send_enter_notify_event (GdkWindow *window) event->crossing.detail = GDK_NOTIFY_ANCESTOR; event->crossing.state = 0; + gdk_event_set_device (event, _gdk_display->core_pointer); + append_event (event, TRUE); } @@ -518,8 +508,10 @@ find_toplevel_under_pointer (GdkDisplay *display, gint *y) { GdkWindow *toplevel; + GdkPointerWindowInfo *info; - toplevel = display->pointer_info.toplevel_under_pointer; + info = _gdk_display_get_pointer_info (display, display->core_pointer); + toplevel = info->toplevel_under_pointer; if (toplevel) { GdkWindowObject *private; @@ -538,6 +530,197 @@ find_toplevel_under_pointer (GdkDisplay *display, return toplevel; } +static GdkWindow * +find_toplevel_for_keyboard_event (NSEvent *nsevent) +{ + GList *list, *l; + GdkWindow *window; + GdkDisplay *display; + GdkQuartzView *view; + GdkDeviceManager *device_manager; + + view = (GdkQuartzView *)[[nsevent window] contentView]; + window = [view gdkWindow]; + + display = gdk_drawable_get_display (GDK_DRAWABLE (window)); + + device_manager = gdk_display_get_device_manager (display); + list = gdk_device_manager_list_devices (device_manager, + GDK_DEVICE_TYPE_MASTER); + for (l = list; l; l = l->next) + { + GdkDeviceGrabInfo *grab; + GdkDevice *device = l->data; + + if (device->source != GDK_SOURCE_KEYBOARD) + continue; + + grab = _gdk_display_get_last_device_grab (display, device); + if (grab && grab->window && !grab->owner_events) + { + window = gdk_window_get_toplevel (grab->window); + break; + } + } + + g_list_free (list); + + return window; +} + +static GdkWindow * +find_toplevel_for_mouse_event (NSEvent *nsevent, + gint *x, + gint *y) +{ + NSPoint point; + NSPoint screen_point; + NSEventType event_type; + GdkWindow *toplevel; + GdkQuartzView *view; + GdkDisplay *display; + GdkDeviceGrabInfo *grab; + GdkWindowObject *private; + + view = (GdkQuartzView *)[[nsevent window] contentView]; + toplevel = [view gdkWindow]; + + display = gdk_drawable_get_display (toplevel); + private = GDK_WINDOW_OBJECT (toplevel); + + event_type = [nsevent type]; + point = [nsevent locationInWindow]; + screen_point = [[nsevent window] convertBaseToScreen:point]; + + /* From the docs for XGrabPointer: + * + * If owner_events is True and if a generated pointer event + * would normally be reported to this client, it is reported + * as usual. Otherwise, the event is reported with respect to + * the grab_window and is reported only if selected by + * event_mask. For either value of owner_events, unreported + * events are discarded. + */ + grab = _gdk_display_get_last_device_grab (display, + display->core_pointer); + if (grab) + { + /* Implicit grabs do not go through XGrabPointer and thus the + * event mask should not be checked. + */ + if (!grab->implicit + && (grab->event_mask & get_event_mask_from_ns_event (nsevent)) == 0) + return NULL; + + if (grab->owner_events) + { + /* For owner events, we need to use the toplevel under the + * pointer, not the window from the NSEvent, since that is + * reported with respect to the key window, which could be + * wrong. + */ + GdkWindow *toplevel_under_pointer; + gint x_tmp, y_tmp; + + toplevel_under_pointer = find_toplevel_under_pointer (display, + screen_point, + &x_tmp, &y_tmp); + if (toplevel_under_pointer) + { + toplevel = toplevel_under_pointer; + *x = x_tmp; + *y = y_tmp; + } + + return toplevel; + } + else + { + /* Finally check the grab window. */ + GdkWindow *grab_toplevel; + GdkWindowObject *grab_private; + NSWindow *grab_nswindow; + + grab_toplevel = gdk_window_get_toplevel (grab->window); + grab_private = (GdkWindowObject *)grab_toplevel; + + grab_nswindow = ((GdkWindowImplQuartz *)grab_private->impl)->toplevel; + point = [grab_nswindow convertScreenToBase:screen_point]; + + /* Note: x_root and y_root are already right. */ + *x = point.x; + *y = grab_private->height - point.y; + + return grab_toplevel; + } + + return NULL; + } + else + { + /* The non-grabbed case. */ + GdkWindow *toplevel_under_pointer; + gint x_tmp, y_tmp; + + /* Ignore all events but mouse moved that might be on the title + * bar (above the content view). The reason is that otherwise + * gdk gets confused about getting e.g. button presses with no + * window (the title bar is not known to it). + */ + if (event_type != NSMouseMoved) + if (*y < 0) + return NULL; + + /* As for owner events, we need to use the toplevel under the + * pointer, not the window from the NSEvent. + */ + toplevel_under_pointer = find_toplevel_under_pointer (display, + screen_point, + &x_tmp, &y_tmp); + if (toplevel_under_pointer) + { + GdkWindowObject *toplevel_private; + GdkWindowImplQuartz *toplevel_impl; + + toplevel = toplevel_under_pointer; + + toplevel_private = (GdkWindowObject *)toplevel; + toplevel_impl = (GdkWindowImplQuartz *)toplevel_private->impl; + + if ([toplevel_impl->toplevel showsResizeIndicator]) + { + NSRect frame; + + /* If the resize indicator is visible and the event + * is in the lower right 15x15 corner, we leave these + * events to Cocoa as to be handled as resize events. + * Applications may have widgets in this area. These + * will most likely be larger than 15x15 and for + * scroll bars there are also other means to move + * the scroll bar. Since the resize indicator is + * the only way of resizing windows on Mac OS, it + * is too important to not make functional. + */ + frame = [toplevel_impl->view bounds]; + if (x_tmp > frame.size.width - GRIP_WIDTH + && x_tmp < frame.size.width + && y_tmp > frame.size.height - GRIP_HEIGHT + && y_tmp < frame.size.height) + { + return NULL; + } + } + + *x = x_tmp; + *y = y_tmp; + } + + return toplevel; + } + + return NULL; +} + /* This function finds the correct window to send an event to, taking * into account grabs, event propagation, and event masks. */ @@ -549,14 +732,13 @@ find_window_for_ns_event (NSEvent *nsevent, gint *y_root) { GdkQuartzView *view; - GdkWindow *toplevel; - GdkWindowObject *private; NSPoint point; NSPoint screen_point; NSEventType event_type; + GdkWindow *toplevel; + GdkWindowObject *private; view = (GdkQuartzView *)[[nsevent window] contentView]; - toplevel = [view gdkWindow]; private = GDK_WINDOW_OBJECT (toplevel); @@ -583,138 +765,7 @@ find_window_for_ns_event (NSEvent *nsevent, case NSLeftMouseDragged: case NSRightMouseDragged: case NSOtherMouseDragged: - { - GdkDisplay *display; - GdkPointerGrabInfo *grab; - - display = gdk_drawable_get_display (toplevel); - - /* From the docs for XGrabPointer: - * - * If owner_events is True and if a generated pointer event - * would normally be reported to this client, it is reported - * as usual. Otherwise, the event is reported with respect to - * the grab_window and is reported only if selected by - * event_mask. For either value of owner_events, unreported - * events are discarded. - */ - grab = _gdk_display_get_last_pointer_grab (display); - if (grab) - { - /* Implicit grabs do not go through XGrabPointer and thus the - * event mask should not be checked. - */ - if (!grab->implicit - && (grab->event_mask & get_event_mask_from_ns_event (nsevent)) == 0) - return NULL; - - if (grab->owner_events) - { - /* For owner events, we need to use the toplevel under the - * pointer, not the window from the NSEvent, since that is - * reported with respect to the key window, which could be - * wrong. - */ - GdkWindow *toplevel_under_pointer; - gint x_tmp, y_tmp; - - toplevel_under_pointer = find_toplevel_under_pointer (display, - screen_point, - &x_tmp, &y_tmp); - if (toplevel_under_pointer) - { - toplevel = toplevel_under_pointer; - *x = x_tmp; - *y = y_tmp; - } - - return toplevel; - } - else - { - /* Finally check the grab window. */ - GdkWindow *grab_toplevel; - GdkWindowObject *grab_private; - NSWindow *grab_nswindow; - - grab_toplevel = gdk_window_get_toplevel (grab->window); - grab_private = (GdkWindowObject *)grab_toplevel; - - grab_nswindow = ((GdkWindowImplQuartz *)grab_private->impl)->toplevel; - point = [grab_nswindow convertScreenToBase:screen_point]; - - /* Note: x_root and y_root are already right. */ - *x = point.x; - *y = grab_private->height - point.y; - - return grab_toplevel; - } - - return NULL; - } - else - { - /* The non-grabbed case. */ - GdkWindow *toplevel_under_pointer; - gint x_tmp, y_tmp; - - /* Ignore all events but mouse moved that might be on the title - * bar (above the content view). The reason is that otherwise - * gdk gets confused about getting e.g. button presses with no - * window (the title bar is not known to it). - */ - if (event_type != NSMouseMoved) - if (*y < 0) - return NULL; - - /* As for owner events, we need to use the toplevel under the - * pointer, not the window from the NSEvent. - */ - toplevel_under_pointer = find_toplevel_under_pointer (display, - screen_point, - &x_tmp, &y_tmp); - if (toplevel_under_pointer) - { - GdkWindowObject *toplevel_private; - GdkWindowImplQuartz *toplevel_impl; - - toplevel = toplevel_under_pointer; - - toplevel_private = (GdkWindowObject *)toplevel; - toplevel_impl = (GdkWindowImplQuartz *)toplevel_private->impl; - - if ([toplevel_impl->toplevel showsResizeIndicator]) - { - NSRect frame; - - /* If the resize indicator is visible and the event - * is in the lower right 15x15 corner, we leave these - * events to Cocoa as to be handled as resize events. - * Applications may have widgets in this area. These - * will most likely be larger than 15x15 and for - * scroll bars there are also other means to move - * the scroll bar. Since the resize indicator is - * the only way of resizing windows on Mac OS, it - * is too important to not make functional. - */ - frame = [toplevel_impl->view bounds]; - if (x_tmp > frame.size.width - GRIP_WIDTH - && x_tmp < frame.size.width - && y_tmp > frame.size.height - GRIP_HEIGHT - && y_tmp < frame.size.height) - { - return NULL; - } - } - - *x = x_tmp; - *y = y_tmp; - } - - return toplevel; - } - } - break; + return find_toplevel_for_mouse_event (nsevent, x, y); case NSMouseEntered: case NSMouseExited: @@ -729,10 +780,7 @@ find_window_for_ns_event (NSEvent *nsevent, case NSKeyDown: case NSKeyUp: case NSFlagsChanged: - if (_gdk_display->keyboard_grab.window && !_gdk_display->keyboard_grab.owner_events) - return gdk_window_get_toplevel (_gdk_display->keyboard_grab.window); - - return toplevel; + return find_toplevel_for_keyboard_event (nsevent); default: /* Ignore everything else. */ @@ -766,6 +814,8 @@ fill_crossing_event (GdkWindow *toplevel, event->crossing.detail = detail; event->crossing.state = get_keyboard_modifiers_from_ns_event (nsevent); + gdk_event_set_device (event, _gdk_display->core_pointer); + /* FIXME: Focus and button state? */ } @@ -890,6 +940,7 @@ fill_key_event (GdkWindow *window, GdkEventType type) { GdkEventPrivate *priv; + GdkDeviceManagerCore *device_manager; gchar buf[7]; gunichar c = 0; @@ -903,6 +954,9 @@ fill_key_event (GdkWindow *window, event->key.hardware_keycode = [nsevent keyCode]; event->key.group = ([nsevent modifierFlags] & NSAlternateKeyMask) ? 1 : 0; event->key.keyval = GDK_VoidSymbol; + + device_manager = GDK_DEVICE_MANAGER_CORE (_gdk_display->device_manager); + gdk_event_set_device (event, device_manager->core_keyboard); gdk_keymap_translate_keyboard_state (NULL, event->key.hardware_keycode, @@ -1184,9 +1238,10 @@ gdk_event_translate (GdkEvent *event, } else if (![impl->toplevel isKeyWindow]) { - GdkPointerGrabInfo *grab; + GdkDeviceGrabInfo *grab; - grab = _gdk_display_get_last_pointer_grab (_gdk_display); + grab = _gdk_display_get_last_device_grab (_gdk_display, + _gdk_display->core_pointer); if (!grab) [impl->toplevel makeKeyWindow]; } diff --git a/gdk/quartz/gdkim-quartz.c b/gdk/quartz/gdkim-quartz.c index c602ecc2be..a3382449a0 100644 --- a/gdk/quartz/gdkim-quartz.c +++ b/gdk/quartz/gdkim-quartz.c @@ -28,7 +28,6 @@ #include -#include "gdki18n.h" #include "gdkinternals.h" #include "gdkprivate-quartz.h" diff --git a/gdk/quartz/gdkimage-quartz.c b/gdk/quartz/gdkimage-quartz.c index c8e37bcbaa..cbe2b3b21f 100644 --- a/gdk/quartz/gdkimage-quartz.c +++ b/gdk/quartz/gdkimage-quartz.c @@ -224,16 +224,6 @@ gdk_image_get_type (void) return object_type; } -GdkImage * -gdk_image_new_bitmap (GdkVisual *visual, gpointer data, gint width, gint height) -{ - /* We don't implement this function because it's broken, deprecated and - * tricky to implement. */ - g_warning ("This function is unimplemented"); - - return NULL; -} - GdkImage* _gdk_image_new_for_depth (GdkScreen *screen, GdkImageType type, diff --git a/gdk/quartz/gdkinput.c b/gdk/quartz/gdkinput.c index d05638cea9..c431fc47af 100644 --- a/gdk/quartz/gdkinput.c +++ b/gdk/quartz/gdkinput.c @@ -31,11 +31,11 @@ #include "gdkinput.h" #include "gdkprivate.h" #include "gdkinputprivate.h" +#include +#include -static GdkDeviceAxis gdk_input_core_axes[] = { - { GDK_AXIS_X, 0, 0 }, - { GDK_AXIS_Y, 0, 0 } -}; +/* Addition used for extension_events mask */ +#define GDK_ALL_DEVICES_MASK (1<<30) GdkDevice *_gdk_core_pointer = NULL; @@ -47,62 +47,6 @@ gint _gdk_input_ignore_core; GList *_gdk_input_windows; GList *_gdk_input_devices; -void -_gdk_init_input_core (void) -{ - _gdk_core_pointer = g_object_new (GDK_TYPE_DEVICE, NULL); - - _gdk_core_pointer->name = "Core Pointer"; - _gdk_core_pointer->source = GDK_SOURCE_MOUSE; - _gdk_core_pointer->mode = GDK_MODE_SCREEN; - _gdk_core_pointer->has_cursor = TRUE; - _gdk_core_pointer->num_axes = 2; - _gdk_core_pointer->axes = gdk_input_core_axes; - _gdk_core_pointer->num_keys = 0; - _gdk_core_pointer->keys = NULL; - - _gdk_display->core_pointer = _gdk_core_pointer; -} - -static void -gdk_device_finalize (GObject *object) -{ - g_error ("A GdkDevice object was finalized. This should not happen"); -} - -static void -gdk_device_class_init (GObjectClass *class) -{ - class->finalize = gdk_device_finalize; -} - -GType -gdk_device_get_type (void) -{ - static GType object_type = 0; - - if (!object_type) - { - const GTypeInfo object_info = - { - sizeof (GdkDeviceClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) gdk_device_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (GdkDevicePrivate), - 0, /* n_preallocs */ - (GInstanceInitFunc) NULL, - }; - - object_type = g_type_register_static (G_TYPE_OBJECT, - "GdkDevice", - &object_info, 0); - } - - return object_type; -} GList * gdk_devices_list (void) @@ -116,112 +60,50 @@ gdk_display_list_devices (GdkDisplay *dpy) return _gdk_input_devices; } -void -gdk_device_set_source (GdkDevice *device, - GdkInputSource source) +static void +_gdk_input_select_device_events (GdkWindow *impl_window, + GdkDevice *device) { - device->source = source; -} + guint event_mask; + GdkWindowObject *w; + GdkInputWindow *iw; + GdkInputMode mode; + gboolean has_cursor; + GdkDeviceType type; + GList *l; + event_mask = 0; + iw = ((GdkWindowObject *)impl_window)->input_window; -void -gdk_device_set_key (GdkDevice *device, - guint index, - guint keyval, - GdkModifierType modifiers) -{ - g_return_if_fail (device != NULL); - g_return_if_fail (index < device->num_keys); + g_object_get (device, + "type", &type, + "input-mode", &mode, + "has-cursor", &has_cursor, + NULL); - device->keys[index].keyval = keyval; - device->keys[index].modifiers = modifiers; -} + if (iw == NULL || + mode == GDK_MODE_DISABLED || + type == GDK_DEVICE_TYPE_MASTER) + return; -void -gdk_device_set_axis_use (GdkDevice *device, - guint index, - GdkAxisUse use) -{ - g_return_if_fail (device != NULL); - g_return_if_fail (index < device->num_axes); - - device->axes[index].use = use; - - switch (use) + for (l = _gdk_input_windows; l != NULL; l = l->next) { - case GDK_AXIS_X: - case GDK_AXIS_Y: - device->axes[index].min = 0.; - device->axes[index].max = 0.; - break; - case GDK_AXIS_XTILT: - case GDK_AXIS_YTILT: - device->axes[index].min = -1.; - device->axes[index].max = 1; - break; - default: - device->axes[index].min = 0.; - device->axes[index].max = 1; - break; + w = l->data; + + if (has_cursor || (w->extension_events & GDK_ALL_DEVICES_MASK)) + { + event_mask = w->extension_events; + + if (event_mask) + event_mask |= GDK_PROXIMITY_OUT_MASK + | GDK_BUTTON_PRESS_MASK + | GDK_BUTTON_RELEASE_MASK; + + gdk_window_set_device_events ((GdkWindow *) w, device, event_mask); + } } } -void -gdk_device_get_state (GdkDevice *device, - GdkWindow *window, - gdouble *axes, - GdkModifierType *mask) -{ - gint x_int, y_int; - - g_assert (device == _gdk_core_pointer); - - gdk_window_get_pointer (window, &x_int, &y_int, mask); - - if (axes) - { - axes[0] = x_int; - axes[1] = y_int; - } -} - -void -gdk_device_free_history (GdkTimeCoord **events, - gint n_events) -{ - gint i; - - for (i = 0; i < n_events; i++) - g_free (events[i]); - - g_free (events); -} - -gboolean -gdk_device_get_history (GdkDevice *device, - GdkWindow *window, - guint32 start, - guint32 stop, - GdkTimeCoord ***events, - gint *n_events) -{ - g_return_val_if_fail (window != NULL, FALSE); - g_return_val_if_fail (GDK_WINDOW_IS_QUARTZ (window), FALSE); - g_return_val_if_fail (events != NULL, FALSE); - g_return_val_if_fail (n_events != NULL, FALSE); - - *n_events = 0; - *events = NULL; - return FALSE; -} - -gboolean -gdk_device_set_mode (GdkDevice *device, - GdkInputMode mode) -{ - return FALSE; -} - gint _gdk_input_enable_window (GdkWindow *window, GdkDevicePrivate *gdkdev) { @@ -254,10 +136,12 @@ _gdk_input_window_find(GdkWindow *window) cases */ void -gdk_input_set_extension_events (GdkWindow *window, gint mask, - GdkExtensionMode mode) +gdk_input_set_extension_events (GdkWindow *window, + gint mask, + GdkExtensionMode mode) { GdkWindowObject *window_private; + GdkWindowObject *impl_window; GList *tmp_list; GdkInputWindow *iw; @@ -265,13 +149,14 @@ gdk_input_set_extension_events (GdkWindow *window, gint mask, g_return_if_fail (GDK_WINDOW_IS_QUARTZ (window)); window_private = (GdkWindowObject*) window; + impl_window = (GdkWindowObject *)_gdk_window_get_impl_window (window); if (mode == GDK_EXTENSION_EVENTS_NONE) mask = 0; if (mask != 0) { - iw = g_new(GdkInputWindow,1); + iw = g_new (GdkInputWindow, 1); iw->window = window; iw->mode = mode; @@ -280,39 +165,32 @@ gdk_input_set_extension_events (GdkWindow *window, gint mask, iw->num_obscuring = 0; iw->grabbed = FALSE; - _gdk_input_windows = g_list_append (_gdk_input_windows,iw); + _gdk_input_windows = g_list_append (_gdk_input_windows, iw); window_private->extension_events = mask; /* Add enter window events to the event mask */ /* FIXME, this is not needed for XINPUT_NONE */ gdk_window_set_events (window, - gdk_window_get_events (window) | - GDK_ENTER_NOTIFY_MASK); + gdk_window_get_events (window) | + GDK_ENTER_NOTIFY_MASK); } else { iw = _gdk_input_window_find (window); if (iw) - { - _gdk_input_windows = g_list_remove (_gdk_input_windows,iw); - g_free (iw); - } + { + _gdk_input_windows = g_list_remove (_gdk_input_windows,iw); + g_free (iw); + } window_private->extension_events = 0; } for (tmp_list = _gdk_input_devices; tmp_list; tmp_list = tmp_list->next) { - GdkDevicePrivate *gdkdev = (GdkDevicePrivate *)(tmp_list->data); + GdkDevice *dev = tmp_list->data; - if (gdkdev != (GdkDevicePrivate *)_gdk_core_pointer) - { - if (mask != 0 && gdkdev->info.mode != GDK_MODE_DISABLED - && (gdkdev->info.has_cursor || mode == GDK_EXTENSION_EVENTS_ALL)) - _gdk_input_enable_window (window,gdkdev); - else - _gdk_input_disable_window (window,gdkdev); - } + _gdk_input_select_device_events (GDK_WINDOW (impl_window), dev); } } @@ -328,11 +206,58 @@ _gdk_input_window_destroy (GdkWindow *window) g_free (input_window); } +void +_gdk_input_check_extension_events (GdkDevice *device) +{ +} + void _gdk_input_init (void) { - _gdk_init_input_core (); - _gdk_input_devices = g_list_append (NULL, _gdk_core_pointer); + GdkDeviceManager *device_manager; + GList *list, *l; + + device_manager = gdk_display_get_device_manager (_gdk_display); + + /* For backward compatibility, just add floating devices that are + * not keyboards. + */ + list = gdk_device_manager_list_devices (device_manager, + GDK_DEVICE_TYPE_FLOATING); + for (l = list; l; l = l->next) + { + GdkDevice *device = l->data; + + if (device->source == GDK_SOURCE_KEYBOARD) + continue; + + _gdk_input_devices = g_list_prepend (_gdk_input_devices, l->data); + } + + g_list_free (list); + + /* Now set "core" pointer to the first master device that is a pointer. + */ + list = gdk_device_manager_list_devices (device_manager, + GDK_DEVICE_TYPE_MASTER); + + for (l = list; l; l = l->next) + { + GdkDevice *device = list->data; + + if (device->source != GDK_SOURCE_MOUSE) + continue; + + _gdk_display->core_pointer = device; + break; + } + + g_list_free (list); + + /* Add the core pointer to the devices list */ + _gdk_input_devices = g_list_prepend (_gdk_input_devices, + _gdk_display->core_pointer); + _gdk_input_ignore_core = FALSE; } @@ -364,30 +289,3 @@ _gdk_input_exit (void) } g_list_free (_gdk_input_windows); } - -gboolean -gdk_device_get_axis (GdkDevice *device, gdouble *axes, GdkAxisUse use, gdouble *value) -{ - gint i; - - g_return_val_if_fail (device != NULL, FALSE); - - if (axes == NULL) - return FALSE; - - for (i = 0; i < device->num_axes; i++) - if (device->axes[i].use == use) - { - if (value) - *value = axes[i]; - return TRUE; - } - - return FALSE; -} - -void -_gdk_input_window_crossing (GdkWindow *window, - gboolean enter) -{ -} diff --git a/gdk/quartz/gdkinputprivate.h b/gdk/quartz/gdkinputprivate.h index b8f13ac38a..0868f33a08 100644 --- a/gdk/quartz/gdkinputprivate.h +++ b/gdk/quartz/gdkinputprivate.h @@ -97,11 +97,6 @@ struct _GdkDevicePrivate { GdkDevice info; }; -struct _GdkDeviceClass -{ - GObjectClass parent_class; -}; - struct _GdkInputWindow { /* gdk window */ diff --git a/gdk/quartz/gdkmain-quartz.c b/gdk/quartz/gdkmain-quartz.c index 6e82478ea2..af765d02b1 100644 --- a/gdk/quartz/gdkmain-quartz.c +++ b/gdk/quartz/gdkmain-quartz.c @@ -86,16 +86,3 @@ _gdk_windowing_display_set_sm_client_id (GdkDisplay *display, const gchar *sm_client_id) { } - -void -gdk_set_use_xshm (gboolean use_xshm) -{ - /* Always on, since we're always on the local machine */ -} - -gboolean -gdk_get_use_xshm (void) -{ - return TRUE; -} - diff --git a/gdk/quartz/gdkprivate-quartz.h b/gdk/quartz/gdkprivate-quartz.h index 49aafb416f..0809dcf82b 100644 --- a/gdk/quartz/gdkprivate-quartz.h +++ b/gdk/quartz/gdkprivate-quartz.h @@ -152,7 +152,8 @@ void _gdk_quartz_window_nspoint_to_gdk_xy (NSPoint point, gint *y); GdkWindow *_gdk_quartz_window_find_child (GdkWindow *window, gint x, - gint y); + gint y, + gboolean get_toplevel); 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); diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c index a8e385f0dd..efc0672e7c 100644 --- a/gdk/quartz/gdkwindow-quartz.c +++ b/gdk/quartz/gdkwindow-quartz.c @@ -23,6 +23,7 @@ #include #include "gdk.h" +#include "gdkdeviceprivate.h" #include "gdkwindowimpl.h" #include "gdkprivate-quartz.h" #include "gdkscreen-quartz.h" @@ -143,41 +144,47 @@ gdk_window_impl_quartz_get_context (GdkDrawable *drawable, static void check_grab_unmap (GdkWindow *window) { + GList *list, *l; GdkDisplay *display = gdk_drawable_get_display (window); + GdkDeviceManager *device_manager; - _gdk_display_end_pointer_grab (display, 0, window, TRUE); - - if (display->keyboard_grab.window) + device_manager = gdk_display_get_device_manager (display); + list = gdk_device_manager_list_devices (device_manager, + GDK_DEVICE_TYPE_FLOATING); + for (l = list; l; l = l->next) { - GdkWindowObject *private = GDK_WINDOW_OBJECT (window); - GdkWindowObject *tmp = GDK_WINDOW_OBJECT (display->keyboard_grab.window); - - while (tmp && tmp != private) - tmp = tmp->parent; - - if (tmp) - _gdk_display_unset_has_keyboard_grab (display, TRUE); + _gdk_display_end_device_grab (display, l->data, 0, window, TRUE); } + + g_list_free (list); } static void check_grab_destroy (GdkWindow *window) { + GList *list, *l; GdkDisplay *display = gdk_drawable_get_display (window); - GdkPointerGrabInfo *grab; + GdkDeviceManager *device_manager; /* Make sure there is no lasting grab in this native window */ - grab = _gdk_display_get_last_pointer_grab (display); - if (grab && grab->native_window == window) + device_manager = gdk_display_get_device_manager (display); + list = gdk_device_manager_list_devices (device_manager, + GDK_DEVICE_TYPE_MASTER); + + for (l = list; l; l = l->next) { - /* Serials are always 0 in quartz, but for clarity: */ - grab->serial_end = grab->serial_start; - grab->implicit_ungrab = TRUE; + GdkDeviceGrabInfo *grab; + + grab = _gdk_display_get_last_device_grab (display, l->data); + if (grab && grab->native_window == window) + { + /* Serials are always 0 in quartz, but for clarity: */ + grab->serial_end = grab->serial_start; + grab->implicit_ungrab = TRUE; + } } - if (window == display->keyboard_grab.native_window && - display->keyboard_grab.window != NULL) - _gdk_display_unset_has_keyboard_grab (display, TRUE); + g_list_free (list); } static void @@ -698,7 +705,8 @@ find_child_window_helper (GdkWindow *window, gint x, gint y, gint x_offset, - gint y_offset) + gint y_offset, + gboolean get_toplevel) { GdkWindowImplQuartz *impl; GList *l; @@ -751,13 +759,15 @@ find_child_window_helper (GdkWindow *window, } } - if (x >= temp_x && y >= temp_y && + if ((!get_toplevel || (get_toplevel && window == _gdk_root)) && + x >= temp_x && y >= temp_y && x < temp_x + child_private->width && y < temp_y + child_private->height) { /* Look for child windows. */ return find_child_window_helper (l->data, x, y, - temp_x, temp_y); + temp_x, temp_y, + get_toplevel); } } @@ -771,12 +781,13 @@ find_child_window_helper (GdkWindow *window, GdkWindow * _gdk_quartz_window_find_child (GdkWindow *window, gint x, - gint y) + gint y, + gboolean get_toplevel) { GdkWindowObject *private = GDK_WINDOW_OBJECT (window); if (x >= 0 && y >= 0 && x < private->width && y < private->height) - return find_child_window_helper (window, x, y, 0, 0); + return find_child_window_helper (window, x, y, 0, 0, get_toplevel); return NULL; } @@ -804,7 +815,7 @@ _gdk_quartz_window_did_resign_main (GdkWindow *window) { GList *toplevels; - toplevels = gdk_window_get_toplevels (); + toplevels = gdk_screen_get_toplevel_windows (gdk_screen_get_default ()); if (toplevels) new_window = toplevels->data; g_list_free (toplevels); @@ -1333,9 +1344,9 @@ move_resize_window_internal (GdkWindow *window, old_visible.x = -private->x; old_visible.y = -private->y; - gdk_window_get_size (GDK_DRAWABLE (private->parent), - &old_visible.width, - &old_visible.height); + gdk_drawable_get_size (GDK_DRAWABLE (private->parent), + &old_visible.width, + &old_visible.height); } if (x != -1) @@ -1701,8 +1712,9 @@ gdk_window_quartz_set_back_pixmap (GdkWindow *window, } static void -gdk_window_quartz_set_cursor (GdkWindow *window, - GdkCursor *cursor) +gdk_window_quartz_set_device_cursor (GdkWindow *window, + GdkDevice *device, + GdkCursor *cursor) { GdkCursorPrivate *cursor_private; NSCursor *nscursor; @@ -1893,10 +1905,11 @@ gdk_window_get_root_origin (GdkWindow *window, /* Returns coordinates relative to the passed in window. */ static GdkWindow * -gdk_window_quartz_get_pointer_helper (GdkWindow *window, - gint *x, - gint *y, - GdkModifierType *mask) +gdk_window_quartz_get_device_state_helper (GdkWindow *window, + GdkDevice *device, + gint *x, + gint *y, + GdkModifierType *mask) { GdkWindowObject *toplevel; GdkWindowObject *private; @@ -1941,7 +1954,8 @@ gdk_window_quartz_get_pointer_helper (GdkWindow *window, window = (GdkWindow *)toplevel; } - found_window = _gdk_quartz_window_find_child (window, x_tmp, y_tmp); + found_window = _gdk_quartz_window_find_child (window, x_tmp, y_tmp, + FALSE); /* We never return the root window. */ if (found_window == _gdk_root) @@ -1954,26 +1968,30 @@ gdk_window_quartz_get_pointer_helper (GdkWindow *window, } static gboolean -gdk_window_quartz_get_pointer (GdkWindow *window, - gint *x, - gint *y, - GdkModifierType *mask) +gdk_window_quartz_get_device_state (GdkWindow *window, + GdkDevice *device, + gint *x, + gint *y, + GdkModifierType *mask) { - return gdk_window_quartz_get_pointer_helper (window, x, y, mask) != NULL; + return gdk_window_quartz_get_device_state_helper (window, + device, + x, y, mask) != NULL; } /* Returns coordinates relative to the root. */ void -_gdk_windowing_get_pointer (GdkDisplay *display, - GdkScreen **screen, - gint *x, - gint *y, - GdkModifierType *mask) +_gdk_windowing_get_device_state (GdkDisplay *display, + GdkDevice *device, + GdkScreen **screen, + gint *x, + gint *y, + GdkModifierType *mask) { g_return_if_fail (display == _gdk_display); *screen = _gdk_screen; - gdk_window_quartz_get_pointer_helper (_gdk_root, x, y, mask); + gdk_window_quartz_get_device_state_helper (_gdk_root, device, x, y, mask); } void @@ -1997,9 +2015,10 @@ _gdk_windowing_window_at_pointer (GdkDisplay *display, gint x, y; GdkModifierType tmp_mask = 0; - found_window = gdk_window_quartz_get_pointer_helper (_gdk_root, - &x, &y, - &tmp_mask); + found_window = gdk_window_quartz_get_device_state_helper (_gdk_root, + display->core_pointer, + &x, &y, + &tmp_mask); if (found_window) { GdkWindowObject *private; @@ -2052,6 +2071,21 @@ _gdk_windowing_window_at_pointer (GdkDisplay *display, return found_window; } +GdkWindow* +_gdk_windowing_window_at_device_position (GdkDisplay *display, + GdkDevice *device, + gint *win_x, + gint *win_y, + GdkModifierType *mask, + gboolean get_toplevel) +{ + return GDK_DEVICE_GET_CLASS (device)->window_at_position (device, + win_x, win_y, + mask, + get_toplevel); +} + + static GdkEventMask gdk_window_quartz_get_events (GdkWindow *window) { @@ -2341,19 +2375,6 @@ gdk_window_focus (GdkWindow *window, } } -void -gdk_window_set_hints (GdkWindow *window, - gint x, - gint y, - gint min_width, - gint min_height, - gint max_width, - gint max_height, - gint flags) -{ - /* FIXME: Implement */ -} - static gint window_type_hint_to_level (GdkWindowTypeHint hint) { @@ -3078,10 +3099,10 @@ gdk_window_impl_iface_init (GdkWindowImplIface *iface) iface->set_background = gdk_window_quartz_set_background; iface->set_back_pixmap = gdk_window_quartz_set_back_pixmap; iface->reparent = gdk_window_quartz_reparent; - iface->set_cursor = gdk_window_quartz_set_cursor; + iface->set_device_cursor = gdk_window_quartz_set_device_cursor; iface->get_geometry = gdk_window_quartz_get_geometry; iface->get_root_coords = gdk_window_quartz_get_root_coords; - iface->get_pointer = gdk_window_quartz_get_pointer; + iface->get_device_state = gdk_window_quartz_get_device_state; iface->get_deskrelative_origin = gdk_window_quartz_get_deskrelative_origin; iface->shape_combine_region = gdk_window_quartz_shape_combine_region; iface->input_shape_combine_region = gdk_window_quartz_input_shape_combine_region; @@ -3089,6 +3110,4 @@ gdk_window_impl_iface_init (GdkWindowImplIface *iface) iface->queue_antiexpose = _gdk_quartz_window_queue_antiexpose; iface->queue_translation = _gdk_quartz_window_queue_translation; iface->destroy = _gdk_quartz_window_destroy; - iface->input_window_destroy = _gdk_input_window_destroy; - iface->input_window_crossing = _gdk_input_window_crossing; } diff --git a/gdk/testgdk.c b/gdk/testgdk.c index 2209e44ea7..a5d9abdd21 100644 --- a/gdk/testgdk.c +++ b/gdk/testgdk.c @@ -195,8 +195,6 @@ test_colourmaps (void) static void test_colours (void) { - ASSERT (gdk_color_white (system_colourmap, &white)); - ASSERT (gdk_color_black (system_colourmap, &black)); red.red = 65535; red.green = red.blue = 0; TEST (gdk_colormap_alloc_color (system_colourmap, &red, FALSE, TRUE)); @@ -361,15 +359,15 @@ test_pixmaps (gint depth) { pixmap = gdk_pixmap_new (NULL, width, height, depth); ASSERT (pixmap != NULL); - gdk_window_get_size (pixmap, &w, &h); + gdk_drawable_get_size (pixmap, &w, &h); QTESTF (w == width, (" w:%d", w)); QTESTF (h == height, (" h:%d", h)); - image = gdk_image_get (pixmap, 0, 0, w, h); + image = gdk_drawable_get_image (pixmap, 0, 0, w, h); QTEST (image != NULL); QTEST (image->width == width); QTEST (image->height == height); QTEST (image->depth == depth); - gdk_image_destroy (image); + g_object_unref (image); g_object_unref (pixmap); } TEST (retval); @@ -405,7 +403,7 @@ test_images (void) QTEST (image->depth == system_visual->depth); QTEST (image->bpp >= (image->depth-1)/8 + 1); QTEST (image->mem != NULL); - gdk_image_destroy (image); + g_object_unref (image); } } TEST (retval); @@ -444,10 +442,10 @@ test_temp_windows (void) gdk_window_get_geometry (window, &x, &y, &w, &h, &d); QTESTF (w == 37, ("w:%d", w)); QTESTF (h == 19, ("h:%d", h)); - visual = gdk_window_get_visual (window); + visual = gdk_drawable_get_visual (window); QTEST (visual == system_visual); gdk_window_hide (window); - gdk_window_unref (window); + g_object_unref (window); } TEST (retval); } @@ -512,14 +510,14 @@ test_one_point_on_drawable (GdkDrawable *drawable, gdk_gc_get_values (gc, &gcvalues); - image = gdk_image_get (drawable, x+-1, y+-1, 3, 3); + image = gdk_drawable_get_image (drawable, x+-1, y+-1, 3, 3); QTEST (image != NULL); for (xoff = -1; xoff <= 1; xoff++) for (yoff = -1; yoff <= 1; yoff++) { oldpixels[xoff+1][yoff+1] = gdk_image_get_pixel (image, xoff+1, yoff+1); } - gdk_image_destroy (image); + g_object_unref (image); if (depth == 32) mask = 0xFFFFFFFF; @@ -528,7 +526,7 @@ test_one_point_on_drawable (GdkDrawable *drawable, gdk_draw_point (drawable, gc, x, y); - image = gdk_image_get (drawable, x-1, y-1, 3, 3); + image = gdk_drawable_get_image (drawable, x-1, y-1, 3, 3); QTEST (image != NULL); for (xoff = -1; xoff <= 1; xoff++) for (yoff = -1; yoff <= 1; yoff++) @@ -540,7 +538,7 @@ test_one_point_on_drawable (GdkDrawable *drawable, else QTEST (newpixel == oldpixels[xoff+1][yoff+1]); } - gdk_image_destroy (image); + g_object_unref (image); } @@ -600,8 +598,8 @@ test_one_line_on_drawable (GdkDrawable *drawable, line_width = gcvalues.line_width > 0 ? gcvalues.line_width : 1; w_up = w_left = line_width/2; w_down = w_right = (line_width & 1) ? line_width/2 : line_width/2-1; - gdk_window_get_size (drawable, &w, &h); - oldimage = gdk_image_get (drawable, 0, 0, w, h); + gdk_drawable_get_size (drawable, &w, &h); + oldimage = gdk_drawable_get_image (drawable, 0, 0, w, h); if (depth == 32) mask = 0xFFFFFFFF; @@ -616,7 +614,7 @@ test_one_line_on_drawable (GdkDrawable *drawable, const gint y2 = y1; gdk_draw_line (drawable, gc, x1, y1, x2, y2); - newimage = gdk_image_get (drawable, 0, 0, w, h); + newimage = gdk_drawable_get_image (drawable, 0, 0, w, h); for (x = x1-1; x <= x2+1; x++) for (y = y1-w_up-1; y <= y1+w_down+1; y++) { @@ -637,7 +635,7 @@ test_one_line_on_drawable (GdkDrawable *drawable, const gint y2 = 13; gdk_draw_line (drawable, gc, x1, y1, x2, y2); - newimage = gdk_image_get (drawable, 0, 0, w, h); + newimage = gdk_drawable_get_image (drawable, 0, 0, w, h); for (x = x1-w_left-1; x <= x1+w_right+1; x++) for (y = y1-1; y <= y2+1; y++) { @@ -651,8 +649,8 @@ test_one_line_on_drawable (GdkDrawable *drawable, } } - gdk_image_destroy (oldimage); - gdk_image_destroy (newimage); + g_object_unref (oldimage); + g_object_unref (newimage); } /* Test drawing lines. @@ -714,8 +712,8 @@ test_one_rectangle_on_drawable (GdkDrawable *drawable, w_down = w_right = (line_width & 1) ? line_width/2 : line_width/2-1; } - gdk_window_get_size (drawable, &w, &h); - oldimage = gdk_image_get (drawable, 0, 0, w, h); + gdk_drawable_get_size (drawable, &w, &h); + oldimage = gdk_drawable_get_image (drawable, 0, 0, w, h); if (depth == 32) mask = 0xFFFFFFFF; @@ -723,7 +721,7 @@ test_one_rectangle_on_drawable (GdkDrawable *drawable, mask = (1 << depth) - 1; gdk_draw_rectangle (drawable, gc, filled, x0, y0, width, height); - newimage = gdk_image_get (drawable, 0, 0, w, h); + newimage = gdk_drawable_get_image (drawable, 0, 0, w, h); for (x = x0 - 1; x <= x0 + width + 1; x++) for (y = y0 - 1; y < y0 + height + 1; y++) @@ -757,8 +755,8 @@ test_one_rectangle_on_drawable (GdkDrawable *drawable, } } - gdk_image_destroy (oldimage); - gdk_image_destroy (newimage); + g_object_unref (oldimage); + g_object_unref (newimage); } /* Test drawing rectangles. @@ -820,8 +818,8 @@ test_some_arcs_on_drawable (GdkDrawable *drawable, w_down = w_right = (line_width & 1) ? line_width/2 : line_width/2-1; } - gdk_window_get_size (drawable, &w, &h); - oldimage = gdk_image_get (drawable, 0, 0, w, h); + gdk_drawable_get_size (drawable, &w, &h); + oldimage = gdk_drawable_get_image (drawable, 0, 0, w, h); if (depth == 32) mask = 0xFFFFFFFF; @@ -829,7 +827,7 @@ test_some_arcs_on_drawable (GdkDrawable *drawable, mask = (1 << depth) - 1; /* XXX */ - newimage = gdk_image_get (drawable, 0, 0, w, h); + newimage = gdk_drawable_get_image (drawable, 0, 0, w, h); for (x = x0 - 1; x <= x0 + width + 1; x++) for (y = y0 - 1; y < y0 + height + 1; y++) @@ -847,8 +845,8 @@ test_some_arcs_on_drawable (GdkDrawable *drawable, } } - gdk_image_destroy (oldimage); - gdk_image_destroy (newimage); + g_object_unref (oldimage); + g_object_unref (newimage); } /* Test drawing arcs. Results don't have to be exactly as on X11, diff --git a/gdk/tests/Makefile.am b/gdk/tests/Makefile.am index 423a353d61..2567627a39 100644 --- a/gdk/tests/Makefile.am +++ b/gdk/tests/Makefile.am @@ -5,7 +5,7 @@ NULL= # check_PROGRAMS=check-gdk-cairo check_PROGRAMS= TESTS=$(check_PROGRAMS) -TESTS_ENVIRONMENT=GDK_PIXBUF_MODULE_FILE=$(top_builddir)/gdk-pixbuf/gdk-pixbuf.loaders +TESTS_ENVIRONMENT=GDK_PIXBUF_MODULE_FILE=$(top_builddir)/gdk-pixbuf/loaders.cache AM_CPPFLAGS=\ $(GDK_DEP_CFLAGS) \ diff --git a/gdk/win32/Makefile.am b/gdk/win32/Makefile.am index 17d048edde..e6c5b2deb4 100644 --- a/gdk/win32/Makefile.am +++ b/gdk/win32/Makefile.am @@ -29,6 +29,12 @@ libgdk_win32_la_SOURCES = \ gdkapplaunchcontext-win32.c \ gdkcolor-win32.c \ gdkcursor-win32.c \ + gdkdevicemanager-win32.c \ + gdkdevicemanager-win32.h \ + gdkdevice-win32.c \ + gdkdevice-win32.h \ + gdkdevice-wintab.c \ + gdkdevice-wintab.h \ gdkdisplay-win32.c \ gdkdnd-win32.c \ gdkdrawable-win32.c \ @@ -41,8 +47,6 @@ libgdk_win32_la_SOURCES = \ gdkim-win32.c \ gdkimage-win32.c \ gdkinput.c \ - gdkinput-win32.c \ - gdkinput-win32.h \ gdkkeys-win32.c \ gdkmain-win32.c \ gdkpixmap-win32.c \ diff --git a/gdk/win32/gdkcolor-win32.c b/gdk/win32/gdkcolor-win32.c index 60a8464c1f..5e49907d6c 100644 --- a/gdk/win32/gdkcolor-win32.c +++ b/gdk/win32/gdkcolor-win32.c @@ -570,9 +570,6 @@ gdk_colormap_new (GdkVisual *visual, if (private_cmap) { sync_colors (colormap); -#if 0 /* XXX is this needed or not? Seems redundant */ - gdk_colormap_change (colormap, colormap->size); -#endif } break; @@ -640,82 +637,7 @@ gdk_screen_get_system_colormap (GdkScreen *screen) return colormap; } -gint -gdk_colormap_get_system_size (void) -{ - return gdk_colormap_get_system ()->size; -} - -void -gdk_colormap_change (GdkColormap *colormap, - gint ncolors) -{ - GdkColormapPrivateWin32 *cmapp; - PALETTEENTRY *pe; - int i; - - g_return_if_fail (GDK_IS_COLORMAP (colormap)); - - cmapp = GDK_WIN32_COLORMAP_DATA (colormap); - - GDK_NOTE (COLORMAP, g_print ("gdk_colormap_change: hpal=%p ncolors=%d\n", - cmapp->hpal, ncolors)); - - switch (colormap->visual->type) - { - case GDK_VISUAL_GRAYSCALE: - case GDK_VISUAL_PSEUDO_COLOR: - pe = g_new (PALETTEENTRY, ncolors); - - for (i = 0; i < ncolors; i++) - { - pe[i].peRed = (colormap->colors[i].red >> 8); - pe[i].peGreen = (colormap->colors[i].green >> 8); - pe[i].peBlue = (colormap->colors[i].blue >> 8); - pe[i].peFlags = 0; - } - - GDI_CALL (SetPaletteEntries, (cmapp->hpal, 0, ncolors, pe)); - g_free (pe); - break; - - default: - break; - } -} - -gboolean -gdk_colors_alloc (GdkColormap *colormap, - gboolean contiguous, - gulong *planes, - gint nplanes, - gulong *pixels, - gint npixels) -{ - GdkColormapPrivateWin32 *private; - gint return_val; - gint i; - - g_return_val_if_fail (GDK_IS_COLORMAP (colormap), FALSE); - - private = GDK_WIN32_COLORMAP_DATA (colormap); - - return_val = alloc_color_cells (colormap, contiguous, - planes, nplanes, pixels, npixels); - - if (return_val) - { - for (i = 0; i < npixels; i++) - { - private->info[pixels[i]].ref_count++; - private->info[pixels[i]].flags |= GDK_COLOR_WRITEABLE; - } - } - - return return_val != 0; -} - -void +static void gdk_colors_free (GdkColormap *colormap, gulong *in_pixels, gint in_npixels, @@ -1236,33 +1158,6 @@ gdk_colormap_query_color (GdkColormap *colormap, } } -gboolean -gdk_color_change (GdkColormap *colormap, - GdkColor *color) -{ - GdkColormapPrivateWin32 *private; - PALETTEENTRY pe; - - g_return_val_if_fail (GDK_IS_COLORMAP (colormap), FALSE); - g_return_val_if_fail (color != NULL, FALSE); - - private = GDK_WIN32_COLORMAP_DATA (colormap); - - if (color->pixel < 0 || color->pixel >= colormap->size) - return FALSE; - - if (private->use[color->pixel] == GDK_WIN32_PE_STATIC) - return FALSE; - - pe.peRed = color->red >> 8; - pe.peGreen = color->green >> 8; - pe.peBlue = color->blue >> 8; - - GDI_CALL (SetPaletteEntries, (private->hpal, color->pixel, 1, &pe)); - - return TRUE; -} - static gint gdk_colormap_match_color (GdkColormap *cmap, GdkColor *color, diff --git a/gdk/win32/gdkdevice-win32.c b/gdk/win32/gdkdevice-win32.c new file mode 100644 index 0000000000..9e4eb81644 --- /dev/null +++ b/gdk/win32/gdkdevice-win32.c @@ -0,0 +1,396 @@ +/* GDK - The GIMP Drawing Kit + * Copyright (C) 2009 Carlos Garnacho + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include + +#include +#include + +#include "gdkdevice-win32.h" +#include "gdkwin32.h" + +static gboolean gdk_device_win32_get_history (GdkDevice *device, + GdkWindow *window, + guint32 start, + guint32 stop, + GdkTimeCoord ***events, + guint *n_events); +static void gdk_device_win32_get_state (GdkDevice *device, + GdkWindow *window, + gdouble *axes, + GdkModifierType *mask); +static void gdk_device_win32_set_window_cursor (GdkDevice *device, + GdkWindow *window, + GdkCursor *cursor); +static void gdk_device_win32_warp (GdkDevice *device, + GdkScreen *screen, + gint x, + gint y); +static gboolean gdk_device_win32_query_state (GdkDevice *device, + GdkWindow *window, + GdkWindow **root_window, + GdkWindow **child_window, + gint *root_x, + gint *root_y, + gint *win_x, + gint *win_y, + GdkModifierType *mask); +static GdkGrabStatus gdk_device_win32_grab (GdkDevice *device, + GdkWindow *window, + gboolean owner_events, + GdkEventMask event_mask, + GdkWindow *confine_to, + GdkCursor *cursor, + guint32 time_); +static void gdk_device_win32_ungrab (GdkDevice *device, + guint32 time_); +static GdkWindow * gdk_device_win32_window_at_position (GdkDevice *device, + gint *win_x, + gint *win_y, + GdkModifierType *mask, + gboolean get_toplevel); +static void gdk_device_win32_select_window_events (GdkDevice *device, + GdkWindow *window, + GdkEventMask event_mask); + + +G_DEFINE_TYPE (GdkDeviceWin32, gdk_device_win32, GDK_TYPE_DEVICE) + +static void +gdk_device_win32_class_init (GdkDeviceWin32Class *klass) +{ + GdkDeviceClass *device_class = GDK_DEVICE_CLASS (klass); + + device_class->get_history = gdk_device_win32_get_history; + device_class->get_state = gdk_device_win32_get_state; + device_class->set_window_cursor = gdk_device_win32_set_window_cursor; + device_class->warp = gdk_device_win32_warp; + device_class->query_state = gdk_device_win32_query_state; + device_class->grab = gdk_device_win32_grab; + device_class->ungrab = gdk_device_win32_ungrab; + device_class->window_at_position = gdk_device_win32_window_at_position; + device_class->select_window_events = gdk_device_win32_select_window_events; +} + +static void +gdk_device_win32_init (GdkDeviceWin32 *device_win32) +{ + GdkDevice *device; + + device = GDK_DEVICE (device_win32); + + _gdk_device_add_axis (device, GDK_NONE, GDK_AXIS_X, 0, 0, 1); + _gdk_device_add_axis (device, GDK_NONE, GDK_AXIS_Y, 0, 0, 1); +} + +static gboolean +gdk_device_win32_get_history (GdkDevice *device, + GdkWindow *window, + guint32 start, + guint32 stop, + GdkTimeCoord ***events, + guint *n_events) +{ + return FALSE; +} + +static void +gdk_device_win32_get_state (GdkDevice *device, + GdkWindow *window, + gdouble *axes, + GdkModifierType *mask) +{ + gint x_int, y_int; + + gdk_window_get_pointer (window, &x_int, &y_int, mask); + + if (axes) + { + axes[0] = x_int; + axes[1] = y_int; + } +} + +static void +gdk_device_win32_set_window_cursor (GdkDevice *device, + GdkWindow *window, + GdkCursor *cursor) +{ + GdkCursorPrivate *cursor_private; + GdkWindowObject *parent_window; + GdkWindowImplWin32 *impl; + HCURSOR hcursor; + HCURSOR hprevcursor; + + impl = GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (window)->impl); + cursor_private = (GdkCursorPrivate*) cursor; + + hprevcursor = impl->hcursor; + + if (!cursor) + hcursor = NULL; + else + hcursor = cursor_private->hcursor; + + if (hcursor != NULL) + { + /* If the pointer is over our window, set new cursor */ + GdkWindow *curr_window = gdk_window_get_pointer (window, NULL, NULL, NULL); + + if (curr_window == window || + (curr_window && window == gdk_window_get_toplevel (curr_window))) + SetCursor (hcursor); + else + { + /* Climb up the tree and find whether our window is the + * first ancestor that has cursor defined, and if so, set + * new cursor. + */ + GdkWindowObject *curr_window_obj = GDK_WINDOW_OBJECT (curr_window); + + while (curr_window_obj && + !GDK_WINDOW_IMPL_WIN32 (curr_window_obj->impl)->hcursor) + { + curr_window_obj = curr_window_obj->parent; + if (curr_window_obj == GDK_WINDOW_OBJECT (window)) + { + SetCursor (hcursor); + break; + } + } + } + } + + /* Unset the previous cursor: Need to make sure it's no longer in + * use before we destroy it, in case we're not over our window but + * the cursor is still set to our old one. + */ + if (hprevcursor != NULL && + GetCursor () == hprevcursor) + { + /* Look for a suitable cursor to use instead */ + hcursor = NULL; + parent_window = GDK_WINDOW_OBJECT (window)->parent; + + while (hcursor == NULL) + { + if (parent_window) + { + impl = GDK_WINDOW_IMPL_WIN32 (parent_window->impl); + hcursor = impl->hcursor; + parent_window = parent_window->parent; + } + else + hcursor = LoadCursor (NULL, IDC_ARROW); + } + + SetCursor (hcursor); + } +} + +static void +gdk_device_win32_warp (GdkDevice *device, + GdkScreen *screen, + gint x, + gint y) +{ + SetCursorPos (x - _gdk_offset_x, y - _gdk_offset_y); +} + +static GdkModifierType +get_current_mask (void) +{ + GdkModifierType mask; + BYTE kbd[256]; + + GetKeyboardState (kbd); + mask = 0; + if (kbd[VK_SHIFT] & 0x80) + mask |= GDK_SHIFT_MASK; + if (kbd[VK_CAPITAL] & 0x80) + mask |= GDK_LOCK_MASK; + if (kbd[VK_CONTROL] & 0x80) + mask |= GDK_CONTROL_MASK; + if (kbd[VK_MENU] & 0x80) + mask |= GDK_MOD1_MASK; + if (kbd[VK_LBUTTON] & 0x80) + mask |= GDK_BUTTON1_MASK; + if (kbd[VK_MBUTTON] & 0x80) + mask |= GDK_BUTTON2_MASK; + if (kbd[VK_RBUTTON] & 0x80) + mask |= GDK_BUTTON3_MASK; + + return mask; +} + +static gboolean +gdk_device_win32_query_state (GdkDevice *device, + GdkWindow *window, + GdkWindow **root_window, + GdkWindow **child_window, + gint *root_x, + gint *root_y, + gint *win_x, + gint *win_y, + GdkModifierType *mask) +{ + gboolean return_val; + POINT point; + HWND hwnd, hwndc; + + g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), FALSE); + + return_val = TRUE; + + hwnd = GDK_WINDOW_HWND (window); + GetCursorPos (&point); + + if (root_x) + *root_x = point.x; + + if (root_y) + *root_y = point.y; + + ScreenToClient (hwnd, &point); + + if (win_x) + *win_x = point.x; + + if (win_y) + *win_y = point.y; + + if (window == _gdk_root) + { + if (win_x) + *win_x += _gdk_offset_x; + + if (win_y) + *win_y += _gdk_offset_y; + } + + if (child_window) + { + hwndc = ChildWindowFromPoint (hwnd, point); + + if (hwndc && hwndc != hwnd) + *child_window = gdk_win32_handle_table_lookup ((GdkNativeWindow) hwndc); + else + *child_window = NULL; /* Direct child unknown to gdk */ + } + + if (root_window) + { + GdkScreen *screen; + + screen = gdk_drawable_get_screen (GDK_DRAWABLE (window)); + *root_window = gdk_screen_get_root_window (screen); + } + + if (mask) + *mask = get_current_mask (); + + return TRUE; +} + +static GdkGrabStatus +gdk_device_win32_grab (GdkDevice *device, + GdkWindow *window, + gboolean owner_events, + GdkEventMask event_mask, + GdkWindow *confine_to, + GdkCursor *cursor, + guint32 time_) +{ + if (device->source != GDK_SOURCE_KEYBOARD) + SetCapture (GDK_WINDOW_HWND (window)); + + return GDK_GRAB_SUCCESS; +} + +static void +gdk_device_win32_ungrab (GdkDevice *device, + guint32 time_) +{ + GdkDisplay *display; + + display = gdk_device_get_display (device); + + if (device->source != GDK_SOURCE_KEYBOARD) + ReleaseCapture (); +} + +static GdkWindow * +gdk_device_win32_window_at_position (GdkDevice *device, + gint *win_x, + gint *win_y, + GdkModifierType *mask, + gboolean get_toplevel) +{ + GdkWindow *window; + POINT point, pointc; + HWND hwnd, hwndc; + RECT rect; + + GetCursorPos (&pointc); + point = pointc; + hwnd = WindowFromPoint (point); + + if (hwnd == NULL) + { + window = _gdk_root; + *win_x = pointc.x + _gdk_offset_x; + *win_y = pointc.y + _gdk_offset_y; + return window; + } + + ScreenToClient (hwnd, &point); + + do + { + if (get_toplevel && + (window = gdk_win32_handle_table_lookup ((GdkNativeWindow) hwnd)) != NULL && + GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN) + break; + + hwndc = ChildWindowFromPoint (hwnd, point); + ClientToScreen (hwnd, &point); + ScreenToClient (hwndc, &point); + } + while (hwndc != hwnd && (hwnd = hwndc, 1)); + + window = gdk_win32_handle_table_lookup ((GdkNativeWindow) hwnd); + + if (window && (win_x || win_y)) + { + GetClientRect (hwnd, &rect); + *win_x = point.x - rect.left; + *win_y = point.y - rect.top; + } + + return window; +} + +static void +gdk_device_win32_select_window_events (GdkDevice *device, + GdkWindow *window, + GdkEventMask event_mask) +{ +} diff --git a/gdk/win32/gdkdevice-win32.h b/gdk/win32/gdkdevice-win32.h new file mode 100644 index 0000000000..ef9c322b3d --- /dev/null +++ b/gdk/win32/gdkdevice-win32.h @@ -0,0 +1,51 @@ +/* GDK - The GIMP Drawing Kit + * Copyright (C) 2009 Carlos Garnacho + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GDK_DEVICE_WIN32_H__ +#define __GDK_DEVICE_WIN32_H__ + +#include + +G_BEGIN_DECLS + +#define GDK_TYPE_DEVICE_WIN32 (gdk_device_win32_get_type ()) +#define GDK_DEVICE_WIN32(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_DEVICE_WIN32, GdkDeviceWin32)) +#define GDK_DEVICE_WIN32_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_DEVICE_WIN32, GdkDeviceWin32Class)) +#define GDK_IS_DEVICE_WIN32(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_DEVICE_WIN32)) +#define GDK_IS_DEVICE_WIN32_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_DEVICE_WIN32)) +#define GDK_DEVICE_WIN32_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_DEVICE_WIN32, GdkDeviceWin32Class)) + +typedef struct _GdkDeviceWin32 GdkDeviceWin32; +typedef struct _GdkDeviceWin32Class GdkDeviceWin32Class; + +struct _GdkDeviceWin32 +{ + GdkDevice parent_instance; +}; + +struct _GdkDeviceWin32Class +{ + GdkDeviceClass parent_class; +}; + +GType gdk_device_win32_get_type (void) G_GNUC_CONST; + +G_END_DECLS + +#endif /* __GDK_DEVICE_WIN32_H__ */ diff --git a/gdk/win32/gdkdevice-wintab.c b/gdk/win32/gdkdevice-wintab.c new file mode 100644 index 0000000000..392e10b2e4 --- /dev/null +++ b/gdk/win32/gdkdevice-wintab.c @@ -0,0 +1,386 @@ +/* GDK - The GIMP Drawing Kit + * Copyright (C) 2009 Carlos Garnacho + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include + +#include +#include + +#include "gdkwin32.h" +#include "gdkdevice-wintab.h" + +static GQuark quark_window_input_info = 0; +static GSList *input_windows = NULL; + +typedef struct +{ + gdouble root_x; + gdouble root_y; + GHashTable *device_events; +} GdkWindowInputInfo; + +static gboolean gdk_device_wintab_get_history (GdkDevice *device, + GdkWindow *window, + guint32 start, + guint32 stop, + GdkTimeCoord ***events, + guint *n_events); +static void gdk_device_wintab_get_state (GdkDevice *device, + GdkWindow *window, + gdouble *axes, + GdkModifierType *mask); +static void gdk_device_wintab_set_window_cursor (GdkDevice *device, + GdkWindow *window, + GdkCursor *cursor); +static void gdk_device_wintab_warp (GdkDevice *device, + GdkScreen *screen, + gint x, + gint y); +static gboolean gdk_device_wintab_query_state (GdkDevice *device, + GdkWindow *window, + GdkWindow **root_window, + GdkWindow **child_window, + gint *root_x, + gint *root_y, + gint *win_x, + gint *win_y, + GdkModifierType *mask); +static GdkGrabStatus gdk_device_wintab_grab (GdkDevice *device, + GdkWindow *window, + gboolean owner_events, + GdkEventMask event_mask, + GdkWindow *confine_to, + GdkCursor *cursor, + guint32 time_); +static void gdk_device_wintab_ungrab (GdkDevice *device, + guint32 time_); +static GdkWindow * gdk_device_wintab_window_at_position (GdkDevice *device, + gint *win_x, + gint *win_y, + GdkModifierType *mask, + gboolean get_toplevel); +static void gdk_device_wintab_select_window_events (GdkDevice *device, + GdkWindow *window, + GdkEventMask event_mask); + + +G_DEFINE_TYPE (GdkDeviceWintab, gdk_device_wintab, GDK_TYPE_DEVICE) + +static void +gdk_device_wintab_class_init (GdkDeviceWintabClass *klass) +{ + GdkDeviceClass *device_class = GDK_DEVICE_CLASS (klass); + + device_class->get_history = gdk_device_wintab_get_history; + device_class->get_state = gdk_device_wintab_get_state; + device_class->set_window_cursor = gdk_device_wintab_set_window_cursor; + device_class->warp = gdk_device_wintab_warp; + device_class->query_state = gdk_device_wintab_query_state; + device_class->grab = gdk_device_wintab_grab; + device_class->ungrab = gdk_device_wintab_ungrab; + device_class->window_at_position = gdk_device_wintab_window_at_position; + device_class->select_window_events = gdk_device_wintab_select_window_events; + + quark_window_input_info = g_quark_from_static_string ("gdk-window-input-info"); +} + +static void +gdk_device_wintab_init (GdkDeviceWintab *device_wintab) +{ + GdkDevice *device; + + device = GDK_DEVICE (device_wintab); +} + +static gboolean +gdk_device_wintab_get_history (GdkDevice *device, + GdkWindow *window, + guint32 start, + guint32 stop, + GdkTimeCoord ***events, + guint *n_events) +{ + return FALSE; +} + +static void +gdk_device_wintab_get_state (GdkDevice *device, + GdkWindow *window, + gdouble *axes, + GdkModifierType *mask) +{ + GdkDeviceWintab *device_wintab; + + device_wintab = GDK_DEVICE_WINTAB (device); + + /* For now just use the last known button and axis state of the device. + * Since graphical tablets send an insane amount of motion events each + * second, the info should be fairly up to date */ + if (mask) + { + gdk_window_get_pointer (window, NULL, NULL, mask); + *mask &= 0xFF; /* Mask away core pointer buttons */ + *mask |= ((device_wintab->button_state << 8) + & (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK + | GDK_BUTTON3_MASK | GDK_BUTTON4_MASK + | GDK_BUTTON5_MASK)); + } + + if (device_wintab->last_axis_data) + _gdk_device_wintab_translate_axes (device, window, axes, NULL, NULL); +} + +static void +gdk_device_wintab_set_window_cursor (GdkDevice *device, + GdkWindow *window, + GdkCursor *cursor) +{ +} + +static void +gdk_device_wintab_warp (GdkDevice *device, + GdkScreen *screen, + gint x, + gint y) +{ +} + +static gboolean +gdk_device_wintab_query_state (GdkDevice *device, + GdkWindow *window, + GdkWindow **root_window, + GdkWindow **child_window, + gint *root_x, + gint *root_y, + gint *win_x, + gint *win_y, + GdkModifierType *mask) +{ + return FALSE; +} + +static GdkGrabStatus +gdk_device_wintab_grab (GdkDevice *device, + GdkWindow *window, + gboolean owner_events, + GdkEventMask event_mask, + GdkWindow *confine_to, + GdkCursor *cursor, + guint32 time_) +{ + return GDK_GRAB_SUCCESS; +} + +static void +gdk_device_wintab_ungrab (GdkDevice *device, + guint32 time_) +{ +} + +static GdkWindow * +gdk_device_wintab_window_at_position (GdkDevice *device, + gint *win_x, + gint *win_y, + GdkModifierType *mask, + gboolean get_toplevel) +{ + return NULL; +} + +static void +input_info_free (GdkWindowInputInfo *info) +{ + g_hash_table_destroy (info->device_events); + g_free (info); +} + +static void +gdk_device_wintab_select_window_events (GdkDevice *device, + GdkWindow *window, + GdkEventMask event_mask) +{ + GdkWindowInputInfo *info; + + info = g_object_get_qdata (G_OBJECT (window), + quark_window_input_info); + if (event_mask) + { + if (!info) + { + info = g_new0 (GdkWindowInputInfo, 1); + info->device_events = g_hash_table_new (NULL, NULL); + + g_object_set_qdata_full (G_OBJECT (window), + quark_window_input_info, + info, + (GDestroyNotify) input_info_free); + input_windows = g_slist_prepend (input_windows, window); + } + + g_hash_table_insert (info->device_events, device, + GUINT_TO_POINTER (event_mask)); + } + else if (info) + { + g_hash_table_remove (info->device_events, device); + + if (g_hash_table_size (info->device_events) == 0) + { + g_object_set_qdata (G_OBJECT (window), + quark_window_input_info, + NULL); + input_windows = g_slist_remove (input_windows, window); + } + } +} + +GdkEventMask +_gdk_device_wintab_get_events (GdkDeviceWintab *device, + GdkWindow *window) +{ + GdkWindowInputInfo *info; + + info = g_object_get_qdata (G_OBJECT (window), + quark_window_input_info); + + if (!info) + return 0; + + return GPOINTER_TO_UINT (g_hash_table_lookup (info->device_events, device)); +} + +gboolean +_gdk_device_wintab_get_window_coords (GdkWindow *window, + gdouble *root_x, + gdouble *root_y) +{ + GdkWindowInputInfo *info; + + info = g_object_get_qdata (G_OBJECT (window), + quark_window_input_info); + + if (!info) + return FALSE; + + *root_x = info->root_x; + *root_y = info->root_y; + + return TRUE; +} + +void +_gdk_device_wintab_update_window_coords (GdkWindow *window) +{ + GdkWindowInputInfo *info; + gint root_x, root_y; + + info = g_object_get_qdata (G_OBJECT (window), + quark_window_input_info); + + g_return_if_fail (info != NULL); + + gdk_window_get_origin (window, &root_x, &root_y); + info->root_x = (gdouble) root_x; + info->root_y = (gdouble) root_y; +} + +void +_gdk_device_wintab_translate_axes (GdkDeviceWintab *device_wintab, + GdkWindow *window, + gdouble *axes, + gdouble *x, + gdouble *y) +{ + GdkDevice *device; + GdkWindow *impl_window; + gdouble root_x, root_y; + gdouble temp_x, temp_y; + gint i; + + device = GDK_DEVICE (device_wintab); + impl_window = _gdk_window_get_impl_window (window); + temp_x = temp_y = 0; + + if (!_gdk_device_wintab_get_window_coords (impl_window, &root_x, &root_y)) + return; + + for (i = 0; i < device->num_axes; i++) + { + GdkAxisUse use; + + use = _gdk_device_get_axis_use (device, i); + + switch (use) + { + case GDK_AXIS_X: + case GDK_AXIS_Y: + if (gdk_device_get_mode (device) == GDK_MODE_WINDOW) + _gdk_device_translate_window_coord (device, window, i, + device_wintab->last_axis_data[i], + &axes[i]); + else + _gdk_device_translate_screen_coord (device, window, + root_x, root_y, i, + device_wintab->last_axis_data[i], + &axes[i]); + if (use == GDK_AXIS_X) + temp_x = axes[i]; + else if (use == GDK_AXIS_Y) + temp_y = axes[i]; + + break; + default: + _gdk_device_translate_axis (device, i, + device_wintab->last_axis_data[i], + &axes[i]); + break; + } + } + + if (x) + *x = temp_x; + + if (y) + *y = temp_y; +} + +void +_gdk_input_check_extension_events (GdkDevice *device) +{ + GSList *l; + + if (!GDK_IS_DEVICE_WINTAB (device)) + return; + + for (l = input_windows; l; l = l->next) + { + GdkWindowObject *window_private; + GdkEventMask event_mask = 0; + + window_private = l->data; + + if (gdk_device_get_mode (device) != GDK_MODE_DISABLED) + event_mask = window_private->extension_events; + + gdk_window_set_device_events (GDK_WINDOW (window_private), + device, event_mask); + } +} diff --git a/gdk/win32/gdkdevice-wintab.h b/gdk/win32/gdkdevice-wintab.h new file mode 100644 index 0000000000..79fae8a8e2 --- /dev/null +++ b/gdk/win32/gdkdevice-wintab.h @@ -0,0 +1,79 @@ +/* GDK - The GIMP Drawing Kit + * Copyright (C) 2009 Carlos Garnacho + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GDK_DEVICE_WINTAB_H__ +#define __GDK_DEVICE_WINTAB_H__ + +#include + +#include +#include + +G_BEGIN_DECLS + +#define GDK_TYPE_DEVICE_WINTAB (gdk_device_wintab_get_type ()) +#define GDK_DEVICE_WINTAB(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_DEVICE_WINTAB, GdkDeviceWintab)) +#define GDK_DEVICE_WINTAB_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_DEVICE_WINTAB, GdkDeviceWintabClass)) +#define GDK_IS_DEVICE_WINTAB(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_DEVICE_WINTAB)) +#define GDK_IS_DEVICE_WINTAB_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_DEVICE_WINTAB)) +#define GDK_DEVICE_WINTAB_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_DEVICE_WINTAB, GdkDeviceWintabClass)) + +typedef struct _GdkDeviceWintab GdkDeviceWintab; +typedef struct _GdkDeviceWintabClass GdkDeviceWintabClass; + +struct _GdkDeviceWintab +{ + GdkDevice parent_instance; + + gint *last_axis_data; + gint button_state; + + /* WINTAB stuff: */ + HCTX hctx; + /* Cursor number */ + UINT cursor; + /* The cursor's CSR_PKTDATA */ + WTPKT pktdata; + /* Azimuth and altitude axis */ + AXIS orientation_axes[2]; +}; + +struct _GdkDeviceWintabClass +{ + GdkDeviceClass parent_class; +}; + +GType gdk_device_wintab_get_type (void) G_GNUC_CONST; + +GdkEventMask _gdk_device_wintab_get_events (GdkDeviceWintab *device, + GdkWindow *window); +gboolean _gdk_device_wintab_get_window_coords (GdkWindow *window, + gdouble *root_x, + gdouble *root_y); +void _gdk_device_wintab_update_window_coords (GdkWindow *window); + +void _gdk_device_wintab_translate_axes (GdkDeviceWintab *device, + GdkWindow *window, + gdouble *axes, + gdouble *x, + gdouble *y); + +G_END_DECLS + +#endif /* __GDK_DEVICE_WINTAB_H__ */ diff --git a/gdk/win32/gdkdevicemanager-win32.c b/gdk/win32/gdkdevicemanager-win32.c new file mode 100644 index 0000000000..eea814296b --- /dev/null +++ b/gdk/win32/gdkdevicemanager-win32.c @@ -0,0 +1,1089 @@ +/* GDK - The GIMP Drawing Kit + * Copyright (C) 2009 Carlos Garnacho + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include +#include +#include + +#include +#include "gdkprivate-win32.h" +#include "gdkdevicemanager-win32.h" +#include "gdkdeviceprivate.h" +#include "gdkdevice-win32.h" +#include "gdkdevice-wintab.h" + +#include +#include + +#define PACKETDATA (PK_CONTEXT | PK_CURSOR | PK_BUTTONS | PK_X | PK_Y | PK_NORMAL_PRESSURE | PK_ORIENTATION) +/* We want everything in absolute mode */ +#define PACKETMODE (0) +#include + +#define DEBUG_WINTAB 1 /* Verbose debug messages enabled */ +#define PROXIMITY_OUT_DELAY 200 /* In milliseconds, see set_ignore_core */ +#define TWOPI (2 * G_PI) + +static GList *wintab_contexts = NULL; +static GdkWindow *wintab_window = NULL; +static guint ignore_core_timer = 0; +extern gint _gdk_input_ignore_core; + +typedef UINT (WINAPI *t_WTInfoA) (UINT a, UINT b, LPVOID c); +typedef UINT (WINAPI *t_WTInfoW) (UINT a, UINT b, LPVOID c); +typedef BOOL (WINAPI *t_WTEnable) (HCTX a, BOOL b); +typedef HCTX (WINAPI *t_WTOpenA) (HWND a, LPLOGCONTEXTA b, BOOL c); +typedef BOOL (WINAPI *t_WTOverlap) (HCTX a, BOOL b); +typedef BOOL (WINAPI *t_WTPacket) (HCTX a, UINT b, LPVOID c); +typedef int (WINAPI *t_WTQueueSizeSet) (HCTX a, int b); + +static t_WTInfoA p_WTInfoA; +static t_WTInfoW p_WTInfoW; +static t_WTEnable p_WTEnable; +static t_WTOpenA p_WTOpenA; +static t_WTOverlap p_WTOverlap; +static t_WTPacket p_WTPacket; +static t_WTQueueSizeSet p_WTQueueSizeSet; + + +static void gdk_device_manager_win32_finalize (GObject *object); +static void gdk_device_manager_win32_constructed (GObject *object); + +static GList * gdk_device_manager_win32_list_devices (GdkDeviceManager *device_manager, + GdkDeviceType type); + + +G_DEFINE_TYPE (GdkDeviceManagerWin32, gdk_device_manager_win32, GDK_TYPE_DEVICE_MANAGER) + +static void +gdk_device_manager_win32_class_init (GdkDeviceManagerWin32Class *klass) +{ + GdkDeviceManagerClass *device_manager_class = GDK_DEVICE_MANAGER_CLASS (klass); + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->finalize = gdk_device_manager_win32_finalize; + object_class->constructed = gdk_device_manager_win32_constructed; + device_manager_class->list_devices = gdk_device_manager_win32_list_devices; +} + +static GdkDevice * +create_core_pointer (GdkDeviceManager *device_manager) +{ + return g_object_new (GDK_TYPE_DEVICE_WIN32, + "name", "Core Pointer", + "type", GDK_DEVICE_TYPE_MASTER, + "input-source", GDK_SOURCE_MOUSE, + "input-mode", GDK_MODE_SCREEN, + "has-cursor", TRUE, + "display", _gdk_display, + "device-manager", device_manager, + NULL); +} + +static GdkDevice * +create_core_keyboard (GdkDeviceManager *device_manager) +{ + return g_object_new (GDK_TYPE_DEVICE_WIN32, + "name", "Core Keyboard", + "type", GDK_DEVICE_TYPE_MASTER, + "input-source", GDK_SOURCE_KEYBOARD, + "input-mode", GDK_MODE_SCREEN, + "has-cursor", FALSE, + "display", _gdk_display, + "device-manager", device_manager, + NULL); +} + +static void +gdk_device_manager_win32_init (GdkDeviceManagerWin32 *device_manager_win32) +{ +} + +static void +gdk_device_manager_win32_finalize (GObject *object) +{ + GdkDeviceManagerWin32 *device_manager_win32; + + device_manager_win32 = GDK_DEVICE_MANAGER_WIN32 (object); + + g_object_unref (device_manager_win32->core_pointer); + g_object_unref (device_manager_win32->core_keyboard); + + G_OBJECT_CLASS (gdk_device_manager_win32_parent_class)->finalize (object); +} + +#if DEBUG_WINTAB + +static void +print_lc(LOGCONTEXT *lc) +{ + g_print ("lcName = %s\n", lc->lcName); + g_print ("lcOptions ="); + if (lc->lcOptions & CXO_SYSTEM) g_print (" CXO_SYSTEM"); + if (lc->lcOptions & CXO_PEN) g_print (" CXO_PEN"); + if (lc->lcOptions & CXO_MESSAGES) g_print (" CXO_MESSAGES"); + if (lc->lcOptions & CXO_MARGIN) g_print (" CXO_MARGIN"); + if (lc->lcOptions & CXO_MGNINSIDE) g_print (" CXO_MGNINSIDE"); + if (lc->lcOptions & CXO_CSRMESSAGES) g_print (" CXO_CSRMESSAGES"); + g_print ("\n"); + g_print ("lcStatus ="); + if (lc->lcStatus & CXS_DISABLED) g_print (" CXS_DISABLED"); + if (lc->lcStatus & CXS_OBSCURED) g_print (" CXS_OBSCURED"); + if (lc->lcStatus & CXS_ONTOP) g_print (" CXS_ONTOP"); + g_print ("\n"); + g_print ("lcLocks ="); + if (lc->lcLocks & CXL_INSIZE) g_print (" CXL_INSIZE"); + if (lc->lcLocks & CXL_INASPECT) g_print (" CXL_INASPECT"); + if (lc->lcLocks & CXL_SENSITIVITY) g_print (" CXL_SENSITIVITY"); + if (lc->lcLocks & CXL_MARGIN) g_print (" CXL_MARGIN"); + g_print ("\n"); + g_print ("lcMsgBase = %#x, lcDevice = %#x, lcPktRate = %d\n", + lc->lcMsgBase, lc->lcDevice, lc->lcPktRate); + g_print ("lcPktData ="); + if (lc->lcPktData & PK_CONTEXT) g_print (" PK_CONTEXT"); + if (lc->lcPktData & PK_STATUS) g_print (" PK_STATUS"); + if (lc->lcPktData & PK_TIME) g_print (" PK_TIME"); + if (lc->lcPktData & PK_CHANGED) g_print (" PK_CHANGED"); + if (lc->lcPktData & PK_SERIAL_NUMBER) g_print (" PK_SERIAL_NUMBER"); + if (lc->lcPktData & PK_CURSOR) g_print (" PK_CURSOR"); + if (lc->lcPktData & PK_BUTTONS) g_print (" PK_BUTTONS"); + if (lc->lcPktData & PK_X) g_print (" PK_X"); + if (lc->lcPktData & PK_Y) g_print (" PK_Y"); + if (lc->lcPktData & PK_Z) g_print (" PK_Z"); + if (lc->lcPktData & PK_NORMAL_PRESSURE) g_print (" PK_NORMAL_PRESSURE"); + if (lc->lcPktData & PK_TANGENT_PRESSURE) g_print (" PK_TANGENT_PRESSURE"); + if (lc->lcPktData & PK_ORIENTATION) g_print (" PK_ORIENTATION"); + if (lc->lcPktData & PK_ROTATION) g_print (" PK_ROTATION"); + g_print ("\n"); + g_print ("lcPktMode ="); + if (lc->lcPktMode & PK_CONTEXT) g_print (" PK_CONTEXT"); + if (lc->lcPktMode & PK_STATUS) g_print (" PK_STATUS"); + if (lc->lcPktMode & PK_TIME) g_print (" PK_TIME"); + if (lc->lcPktMode & PK_CHANGED) g_print (" PK_CHANGED"); + if (lc->lcPktMode & PK_SERIAL_NUMBER) g_print (" PK_SERIAL_NUMBER"); + if (lc->lcPktMode & PK_CURSOR) g_print (" PK_CURSOR"); + if (lc->lcPktMode & PK_BUTTONS) g_print (" PK_BUTTONS"); + if (lc->lcPktMode & PK_X) g_print (" PK_X"); + if (lc->lcPktMode & PK_Y) g_print (" PK_Y"); + if (lc->lcPktMode & PK_Z) g_print (" PK_Z"); + if (lc->lcPktMode & PK_NORMAL_PRESSURE) g_print (" PK_NORMAL_PRESSURE"); + if (lc->lcPktMode & PK_TANGENT_PRESSURE) g_print (" PK_TANGENT_PRESSURE"); + if (lc->lcPktMode & PK_ORIENTATION) g_print (" PK_ORIENTATION"); + if (lc->lcPktMode & PK_ROTATION) g_print (" PK_ROTATION"); + g_print ("\n"); + g_print ("lcMoveMask ="); + if (lc->lcMoveMask & PK_CONTEXT) g_print (" PK_CONTEXT"); + if (lc->lcMoveMask & PK_STATUS) g_print (" PK_STATUS"); + if (lc->lcMoveMask & PK_TIME) g_print (" PK_TIME"); + if (lc->lcMoveMask & PK_CHANGED) g_print (" PK_CHANGED"); + if (lc->lcMoveMask & PK_SERIAL_NUMBER) g_print (" PK_SERIAL_NUMBER"); + if (lc->lcMoveMask & PK_CURSOR) g_print (" PK_CURSOR"); + if (lc->lcMoveMask & PK_BUTTONS) g_print (" PK_BUTTONS"); + if (lc->lcMoveMask & PK_X) g_print (" PK_X"); + if (lc->lcMoveMask & PK_Y) g_print (" PK_Y"); + if (lc->lcMoveMask & PK_Z) g_print (" PK_Z"); + if (lc->lcMoveMask & PK_NORMAL_PRESSURE) g_print (" PK_NORMAL_PRESSURE"); + if (lc->lcMoveMask & PK_TANGENT_PRESSURE) g_print (" PK_TANGENT_PRESSURE"); + if (lc->lcMoveMask & PK_ORIENTATION) g_print (" PK_ORIENTATION"); + if (lc->lcMoveMask & PK_ROTATION) g_print (" PK_ROTATION"); + g_print ("\n"); + g_print ("lcBtnDnMask = %#x, lcBtnUpMask = %#x\n", + (guint) lc->lcBtnDnMask, (guint) lc->lcBtnUpMask); + g_print ("lcInOrgX = %ld, lcInOrgY = %ld, lcInOrgZ = %ld\n", + lc->lcInOrgX, lc->lcInOrgY, lc->lcInOrgZ); + g_print ("lcInExtX = %ld, lcInExtY = %ld, lcInExtZ = %ld\n", + lc->lcInExtX, lc->lcInExtY, lc->lcInExtZ); + g_print ("lcOutOrgX = %ld, lcOutOrgY = %ld, lcOutOrgZ = %ld\n", + lc->lcOutOrgX, lc->lcOutOrgY, lc->lcOutOrgZ); + g_print ("lcOutExtX = %ld, lcOutExtY = %ld, lcOutExtZ = %ld\n", + lc->lcOutExtX, lc->lcOutExtY, lc->lcOutExtZ); + g_print ("lcSensX = %g, lcSensY = %g, lcSensZ = %g\n", + lc->lcSensX / 65536., lc->lcSensY / 65536., lc->lcSensZ / 65536.); + g_print ("lcSysMode = %d\n", lc->lcSysMode); + g_print ("lcSysOrgX = %d, lcSysOrgY = %d\n", + lc->lcSysOrgX, lc->lcSysOrgY); + g_print ("lcSysExtX = %d, lcSysExtY = %d\n", + lc->lcSysExtX, lc->lcSysExtY); + g_print ("lcSysSensX = %g, lcSysSensY = %g\n", + lc->lcSysSensX / 65536., lc->lcSysSensY / 65536.); +} + +static void +print_cursor (int index) +{ + int size; + int i; + char *name; + BOOL active; + WTPKT wtpkt; + BYTE buttons; + BYTE buttonbits; + char *btnnames; + char *p; + BYTE buttonmap[32]; + BYTE sysbtnmap[32]; + BYTE npbutton; + UINT npbtnmarks[2]; + UINT *npresponse; + BYTE tpbutton; + UINT tpbtnmarks[2]; + UINT *tpresponse; + DWORD physid; + UINT mode; + UINT minpktdata; + UINT minbuttons; + UINT capabilities; + + size = (*p_WTInfoA) (WTI_CURSORS + index, CSR_NAME, NULL); + name = g_malloc (size + 1); + (*p_WTInfoA) (WTI_CURSORS + index, CSR_NAME, name); + g_print ("NAME: %s\n", name); + (*p_WTInfoA) (WTI_CURSORS + index, CSR_ACTIVE, &active); + g_print ("ACTIVE: %s\n", active ? "YES" : "NO"); + (*p_WTInfoA) (WTI_CURSORS + index, CSR_PKTDATA, &wtpkt); + g_print ("PKTDATA: %#x:", (guint) wtpkt); +#define BIT(x) if (wtpkt & PK_##x) g_print (" " #x) + BIT (CONTEXT); + BIT (STATUS); + BIT (TIME); + BIT (CHANGED); + BIT (SERIAL_NUMBER); + BIT (BUTTONS); + BIT (X); + BIT (Y); + BIT (Z); + BIT (NORMAL_PRESSURE); + BIT (TANGENT_PRESSURE); + BIT (ORIENTATION); + BIT (ROTATION); +#undef BIT + g_print ("\n"); + (*p_WTInfoA) (WTI_CURSORS + index, CSR_BUTTONS, &buttons); + g_print ("BUTTONS: %d\n", buttons); + (*p_WTInfoA) (WTI_CURSORS + index, CSR_BUTTONBITS, &buttonbits); + g_print ("BUTTONBITS: %d\n", buttonbits); + size = (*p_WTInfoA) (WTI_CURSORS + index, CSR_BTNNAMES, NULL); + g_print ("BTNNAMES:"); + if (size > 0) + { + btnnames = g_malloc (size + 1); + (*p_WTInfoA) (WTI_CURSORS + index, CSR_BTNNAMES, btnnames); + p = btnnames; + while (*p) + { + g_print (" %s", p); + p += strlen (p) + 1; + } + } + g_print ("\n"); + (*p_WTInfoA) (WTI_CURSORS + index, CSR_BUTTONMAP, buttonmap); + g_print ("BUTTONMAP:"); + for (i = 0; i < buttons; i++) + g_print (" %d", buttonmap[i]); + g_print ("\n"); + (*p_WTInfoA) (WTI_CURSORS + index, CSR_SYSBTNMAP, sysbtnmap); + g_print ("SYSBTNMAP:"); + for (i = 0; i < buttons; i++) + g_print (" %d", sysbtnmap[i]); + g_print ("\n"); + (*p_WTInfoA) (WTI_CURSORS + index, CSR_NPBUTTON, &npbutton); + g_print ("NPBUTTON: %d\n", npbutton); + (*p_WTInfoA) (WTI_CURSORS + index, CSR_NPBTNMARKS, npbtnmarks); + g_print ("NPBTNMARKS: %d %d\n", npbtnmarks[0], npbtnmarks[1]); + size = (*p_WTInfoA) (WTI_CURSORS + index, CSR_NPRESPONSE, NULL); + g_print ("NPRESPONSE:"); + if (size > 0) + { + npresponse = g_malloc (size); + (*p_WTInfoA) (WTI_CURSORS + index, CSR_NPRESPONSE, npresponse); + for (i = 0; i < size / sizeof (UINT); i++) + g_print (" %d", npresponse[i]); + } + g_print ("\n"); + (*p_WTInfoA) (WTI_CURSORS + index, CSR_TPBUTTON, &tpbutton); + g_print ("TPBUTTON: %d\n", tpbutton); + (*p_WTInfoA) (WTI_CURSORS + index, CSR_TPBTNMARKS, tpbtnmarks); + g_print ("TPBTNMARKS: %d %d\n", tpbtnmarks[0], tpbtnmarks[1]); + size = (*p_WTInfoA) (WTI_CURSORS + index, CSR_TPRESPONSE, NULL); + g_print ("TPRESPONSE:"); + if (size > 0) + { + tpresponse = g_malloc (size); + (*p_WTInfoA) (WTI_CURSORS + index, CSR_TPRESPONSE, tpresponse); + for (i = 0; i < size / sizeof (UINT); i++) + g_print (" %d", tpresponse[i]); + } + g_print ("\n"); + (*p_WTInfoA) (WTI_CURSORS + index, CSR_PHYSID, &physid); + g_print ("PHYSID: %#x\n", (guint) physid); + (*p_WTInfoA) (WTI_CURSORS + index, CSR_CAPABILITIES, &capabilities); + g_print ("CAPABILITIES: %#x:", capabilities); +#define BIT(x) if (capabilities & CRC_##x) g_print (" " #x) + BIT (MULTIMODE); + BIT (AGGREGATE); + BIT (INVERT); +#undef BIT + g_print ("\n"); + if (capabilities & CRC_MULTIMODE) + { + (*p_WTInfoA) (WTI_CURSORS + index, CSR_MODE, &mode); + g_print ("MODE: %d\n", mode); + } + if (capabilities & CRC_AGGREGATE) + { + (*p_WTInfoA) (WTI_CURSORS + index, CSR_MINPKTDATA, &minpktdata); + g_print ("MINPKTDATA: %d\n", minpktdata); + (*p_WTInfoA) (WTI_CURSORS + index, CSR_MINBUTTONS, &minbuttons); + g_print ("MINBUTTONS: %d\n", minbuttons); + } +} +#endif + +static void +_gdk_input_wintab_init_check (GdkDeviceManagerWin32 *device_manager) +{ + static gboolean wintab_initialized = FALSE; + GdkDeviceWintab *device; + GdkWindowAttr wa; + WORD specversion; + HCTX *hctx; + UINT ndevices, ncursors, ncsrtypes, firstcsr, hardware; + BOOL active; + DWORD physid; + AXIS axis_x, axis_y, axis_npressure, axis_or[3]; + int i, devix, cursorix, num_axes = 0; + wchar_t devname[100], csrname[100]; + gchar *devname_utf8, *csrname_utf8, *device_name; + BOOL defcontext_done; + HMODULE wintab32; + + if (wintab_initialized) + return; + + wintab_initialized = TRUE; + + wintab_contexts = NULL; + + if (_gdk_input_ignore_wintab) + return; + + if ((wintab32 = LoadLibrary ("wintab32.dll")) == NULL) + return; + + if ((p_WTInfoA = (t_WTInfoA) GetProcAddress (wintab32, "WTInfoA")) == NULL) + return; + if ((p_WTInfoW = (t_WTInfoW) GetProcAddress (wintab32, "WTInfoW")) == NULL) + return; + if ((p_WTEnable = (t_WTEnable) GetProcAddress (wintab32, "WTEnable")) == NULL) + return; + if ((p_WTOpenA = (t_WTOpenA) GetProcAddress (wintab32, "WTOpenA")) == NULL) + return; + if ((p_WTOverlap = (t_WTOverlap) GetProcAddress (wintab32, "WTOverlap")) == NULL) + return; + if ((p_WTPacket = (t_WTPacket) GetProcAddress (wintab32, "WTPacket")) == NULL) + return; + if ((p_WTQueueSizeSet = (t_WTQueueSizeSet) GetProcAddress (wintab32, "WTQueueSizeSet")) == NULL) + return; + + if (!(*p_WTInfoA) (0, 0, NULL)) + return; + + (*p_WTInfoA) (WTI_INTERFACE, IFC_SPECVERSION, &specversion); + GDK_NOTE (INPUT, g_print ("Wintab interface version %d.%d\n", + HIBYTE (specversion), LOBYTE (specversion))); + (*p_WTInfoA) (WTI_INTERFACE, IFC_NDEVICES, &ndevices); + (*p_WTInfoA) (WTI_INTERFACE, IFC_NCURSORS, &ncursors); +#if DEBUG_WINTAB + GDK_NOTE (INPUT, g_print ("NDEVICES: %d, NCURSORS: %d\n", + ndevices, ncursors)); +#endif + /* Create a dummy window to receive wintab events */ + wa.wclass = GDK_INPUT_OUTPUT; + wa.event_mask = GDK_ALL_EVENTS_MASK; + wa.width = 2; + wa.height = 2; + wa.x = -100; + wa.y = -100; + wa.window_type = GDK_WINDOW_TOPLEVEL; + if ((wintab_window = gdk_window_new (NULL, &wa, GDK_WA_X|GDK_WA_Y)) == NULL) + { + g_warning ("gdk_input_wintab_init: gdk_window_new failed"); + return; + } + g_object_ref (wintab_window); + + for (devix = 0; devix < ndevices; devix++) + { + LOGCONTEXT lc; + + /* We open the Wintab device (hmm, what if there are several, or + * can there even be several, probably not?) as a system + * pointing device, i.e. it controls the normal Windows + * cursor. This seems much more natural. + */ + + (*p_WTInfoW) (WTI_DEVICES + devix, DVC_NAME, devname); + devname_utf8 = g_utf16_to_utf8 (devname, -1, NULL, NULL, NULL); +#ifdef DEBUG_WINTAB + GDK_NOTE (INPUT, (g_print("Device %d: %s\n", devix, devname_utf8))); +#endif + (*p_WTInfoA) (WTI_DEVICES + devix, DVC_NCSRTYPES, &ncsrtypes); + (*p_WTInfoA) (WTI_DEVICES + devix, DVC_FIRSTCSR, &firstcsr); + (*p_WTInfoA) (WTI_DEVICES + devix, DVC_HARDWARE, &hardware); + (*p_WTInfoA) (WTI_DEVICES + devix, DVC_X, &axis_x); + (*p_WTInfoA) (WTI_DEVICES + devix, DVC_Y, &axis_y); + (*p_WTInfoA) (WTI_DEVICES + devix, DVC_NPRESSURE, &axis_npressure); + (*p_WTInfoA) (WTI_DEVICES + devix, DVC_ORIENTATION, axis_or); + + defcontext_done = FALSE; + if (HIBYTE (specversion) > 1 || LOBYTE (specversion) >= 1) + { + /* Try to get device-specific default context */ + /* Some drivers, e.g. Aiptek, don't provide this info */ + if ((*p_WTInfoA) (WTI_DSCTXS + devix, 0, &lc) > 0) + defcontext_done = TRUE; +#if DEBUG_WINTAB + if (defcontext_done) + GDK_NOTE (INPUT, (g_print("Using device-specific default context\n"))); + else + GDK_NOTE (INPUT, (g_print("Note: Driver did not provide device specific default context info despite claiming to support version 1.1\n"))); +#endif + } + + if (!defcontext_done) + (*p_WTInfoA) (WTI_DEFSYSCTX, 0, &lc); +#if DEBUG_WINTAB + GDK_NOTE (INPUT, (g_print("Default context:\n"), print_lc(&lc))); +#endif + lc.lcOptions |= CXO_MESSAGES; + lc.lcStatus = 0; + lc.lcMsgBase = WT_DEFBASE; + lc.lcPktRate = 0; + lc.lcPktData = PACKETDATA; + lc.lcPktMode = PACKETMODE; + lc.lcMoveMask = PACKETDATA; + lc.lcBtnUpMask = lc.lcBtnDnMask = ~0; + lc.lcOutOrgX = axis_x.axMin; + lc.lcOutOrgY = axis_y.axMin; + lc.lcOutExtX = axis_x.axMax - axis_x.axMin; + lc.lcOutExtY = axis_y.axMax - axis_y.axMin; + lc.lcOutExtY = -lc.lcOutExtY; /* We want Y growing downward */ +#if DEBUG_WINTAB + GDK_NOTE (INPUT, (g_print("context for device %d:\n", devix), + print_lc(&lc))); +#endif + hctx = g_new (HCTX, 1); + if ((*hctx = (*p_WTOpenA) (GDK_WINDOW_HWND (wintab_window), &lc, TRUE)) == NULL) + { + g_warning ("gdk_input_wintab_init: WTOpen failed"); + return; + } + GDK_NOTE (INPUT, g_print ("opened Wintab device %d %p\n", + devix, *hctx)); + + wintab_contexts = g_list_append (wintab_contexts, hctx); +#if 0 + (*p_WTEnable) (*hctx, TRUE); +#endif + (*p_WTOverlap) (*hctx, TRUE); + +#if DEBUG_WINTAB + GDK_NOTE (INPUT, (g_print("context for device %d after WTOpen:\n", devix), + print_lc(&lc))); +#endif + /* Increase packet queue size to reduce the risk of lost packets. + * According to the specs, if the function fails we must try again + * with a smaller queue size. + */ + GDK_NOTE (INPUT, g_print("Attempting to increase queue size\n")); + for (i = 32; i >= 1; i >>= 1) + { + if ((*p_WTQueueSizeSet) (*hctx, i)) + { + GDK_NOTE (INPUT, g_print("Queue size set to %d\n", i)); + break; + } + } + if (!i) + GDK_NOTE (INPUT, g_print("Whoops, no queue size could be set\n")); + for (cursorix = firstcsr; cursorix < firstcsr + ncsrtypes; cursorix++) + { +#ifdef DEBUG_WINTAB + GDK_NOTE (INPUT, (g_print("Cursor %d:\n", cursorix), print_cursor (cursorix))); +#endif + active = FALSE; + (*p_WTInfoA) (WTI_CURSORS + cursorix, CSR_ACTIVE, &active); + if (!active) + continue; + + /* Wacom tablets seem to report cursors corresponding to + * nonexistent pens or pucks. At least my ArtPad II reports + * six cursors: a puck, pressure stylus and eraser stylus, + * and then the same three again. I only have a + * pressure-sensitive pen. The puck instances, and the + * second instances of the styluses report physid zero. So + * at least for Wacom, skip cursors with physid zero. + */ + (*p_WTInfoA) (WTI_CURSORS + cursorix, CSR_PHYSID, &physid); + if (wcscmp (devname, L"WACOM Tablet") == 0 && physid == 0) + continue; + + (*p_WTInfoW) (WTI_CURSORS + cursorix, CSR_NAME, csrname); + csrname_utf8 = g_utf16_to_utf8 (csrname, -1, NULL, NULL, NULL); + device_name = g_strconcat (devname_utf8, " ", csrname_utf8, NULL); + + device = g_object_new (GDK_TYPE_DEVICE_WINTAB, + "name", device_name, + "type", GDK_DEVICE_TYPE_SLAVE, + "source", GDK_SOURCE_PEN, + "mode", GDK_MODE_SCREEN, + "has-cursor", FALSE, + "display", _gdk_display, + "device-manager", device_manager, + NULL); + + g_free (csrname_utf8); + + device->hctx = *hctx; + device->cursor = cursorix; + (*p_WTInfoA) (WTI_CURSORS + cursorix, CSR_PKTDATA, &device->pktdata); + + if (device->pktdata & PK_X) + { + _gdk_device_add_axis (GDK_DEVICE (device), + GDK_NONE, + GDK_AXIS_X, + axis_x.axMin, + axis_x.axMax, + axis_x.axResolution / 65535); + num_axes++; + } + + if (device->pktdata & PK_Y) + { + _gdk_device_add_axis (GDK_DEVICE (device), + GDK_NONE, + GDK_AXIS_Y, + axis_y.axMin, + axis_y.axMax, + axis_y.axResolution / 65535); + num_axes++; + } + + + if (device->pktdata & PK_NORMAL_PRESSURE) + { + _gdk_device_add_axis (GDK_DEVICE (device), + GDK_NONE, + GDK_AXIS_PRESSURE, + axis_npressure.axMin, + axis_npressure.axMax, + axis_npressure.axResolution / 65535); + num_axes++; + } + + /* The wintab driver for the Wacom ArtPad II reports + * PK_ORIENTATION in CSR_PKTDATA, but the tablet doesn't + * actually sense tilt. Catch this by noticing that the + * orientation axis's azimuth resolution is zero. + */ + if ((device->pktdata & PK_ORIENTATION) && axis_or[0].axResolution == 0) + { + device->orientation_axes[0] = axis_or[0]; + device->orientation_axes[1] = axis_or[1]; + + /* Wintab gives us aximuth and altitude, which + * we convert to x and y tilt in the -1000..1000 range + */ + _gdk_device_add_axis (GDK_DEVICE (device), + GDK_NONE, + GDK_AXIS_XTILT, + -1000, + 1000, + 1000); + + _gdk_device_add_axis (GDK_DEVICE (device), + GDK_NONE, + GDK_AXIS_YTILT, + -1000, + 1000, + 1000); + num_axes += 2; + } + + device->last_axis_data = g_new (gint, num_axes); + + GDK_NOTE (INPUT, g_print ("device: (%d) %s axes: %d\n", + cursorix, + device_name, + num_axes)); + +#if 0 + for (i = 0; i < gdkdev->info.num_axes; i++) + GDK_NOTE (INPUT, g_print ("... axis %d: %d--%d@%d\n", + i, + gdkdev->axes[i].min_value, + gdkdev->axes[i].max_value, + gdkdev->axes[i].resolution)); +#endif + + device_manager->wintab_devices = g_list_append (device_manager->wintab_devices, + device); + + g_free (device_name); + } + + g_free (devname_utf8); + } +} + +static void +gdk_device_manager_win32_constructed (GObject *object) +{ + GdkDeviceManagerWin32 *device_manager; + + device_manager = GDK_DEVICE_MANAGER_WIN32 (object); + device_manager->core_pointer = create_core_pointer (GDK_DEVICE_MANAGER (device_manager)); + device_manager->core_keyboard = create_core_keyboard (GDK_DEVICE_MANAGER (device_manager)); + + _gdk_device_set_associated_device (device_manager->core_pointer, device_manager->core_keyboard); + _gdk_device_set_associated_device (device_manager->core_keyboard, device_manager->core_pointer); + + _gdk_input_wintab_init_check (device_manager); +} + +static GList * +gdk_device_manager_win32_list_devices (GdkDeviceManager *device_manager, + GdkDeviceType type) +{ + GdkDeviceManagerWin32 *device_manager_win32; + GList *devices = NULL; + + device_manager_win32 = (GdkDeviceManagerWin32 *) device_manager; + + if (type == GDK_DEVICE_TYPE_MASTER) + { + devices = g_list_prepend (devices, device_manager_win32->core_keyboard); + devices = g_list_prepend (devices, device_manager_win32->core_pointer); + } + else if (type == GDK_DEVICE_TYPE_FLOATING) + devices = g_list_copy (device_manager_win32->wintab_devices); + + return devices; +} + +void +_gdk_input_set_tablet_active (void) +{ + GList *tmp_list; + HCTX *hctx; + + /* Bring the contexts to the top of the overlap order when one of the + * application's windows is activated */ + + if (!wintab_contexts) + return; /* No tablet devices found, or Wintab not initialized yet */ + + GDK_NOTE (INPUT, g_print ("_gdk_input_set_tablet_active: " + "Bringing Wintab contexts to the top of the overlap order\n")); + + tmp_list = wintab_contexts; + + while (tmp_list) + { + hctx = (HCTX *) (tmp_list->data); + (*p_WTOverlap) (*hctx, TRUE); + tmp_list = tmp_list->next; + } +} + +static void +decode_tilt (gint *axis_data, + AXIS *axes, + PACKET *packet) +{ + double az, el; + + /* As I don't have a tilt-sensing tablet, + * I cannot test this code. + */ + az = TWOPI * packet->pkOrientation.orAzimuth / + (axes[0].axResolution / 65536.); + el = TWOPI * packet->pkOrientation.orAltitude / + (axes[1].axResolution / 65536.); + + /* X tilt */ + axis_data[0] = cos (az) * cos (el) * 1000; + /* Y tilt */ + axis_data[1] = sin (az) * cos (el) * 1000; +} + +/* + * Get the currently active keyboard modifiers (ignoring the mouse buttons) + * We could use gdk_window_get_pointer but that function does a lot of other + * expensive things besides getting the modifiers. This code is somewhat based + * on build_pointer_event_state from gdkevents-win32.c + */ +static guint +get_modifier_key_state (void) +{ + guint state; + + state = 0; + /* High-order bit is up/down, low order bit is toggled/untoggled */ + if (GetKeyState (VK_CONTROL) < 0) + state |= GDK_CONTROL_MASK; + if (GetKeyState (VK_SHIFT) < 0) + state |= GDK_SHIFT_MASK; + if (GetKeyState (VK_MENU) < 0) + state |= GDK_MOD1_MASK; + if (GetKeyState (VK_CAPITAL) & 0x1) + state |= GDK_LOCK_MASK; + + return state; +} + +static gboolean +ignore_core_timefunc (gpointer data) +{ + /* The delay has passed */ + _gdk_input_ignore_core = FALSE; + ignore_core_timer = 0; + + return FALSE; /* remove timeout */ +} + +/* + * Set or unset the _gdk_input_ignore_core variable that tells GDK + * to ignore events for the core pointer when the tablet is in proximity + * The unsetting is delayed slightly so that if a tablet event arrives + * just after proximity out, it does not cause a core pointer event + * which e.g. causes GIMP to switch tools. + */ +static void +set_ignore_core (gboolean ignore) +{ + if (ignore) + { + _gdk_input_ignore_core = TRUE; + /* Remove any pending clear */ + if (ignore_core_timer) + { + g_source_remove (ignore_core_timer); + ignore_core_timer = 0; + } + } + else if (!ignore_core_timer) + ignore_core_timer = gdk_threads_add_timeout (PROXIMITY_OUT_DELAY, + ignore_core_timefunc, NULL); +} + +static GdkDeviceWintab * +_gdk_device_manager_find_wintab_device (HCTX hctx, + UINT cursor) +{ + GdkDeviceManagerWin32 *device_manager; + GdkDeviceWintab *device; + GList *tmp_list; + + device_manager = GDK_DEVICE_MANAGER_WIN32 (gdk_display_get_device_manager (_gdk_display)); + tmp_list = device_manager->wintab_devices; + + while (tmp_list) + { + device = tmp_list->data; + tmp_list = tmp_list->next; + + if (device->hctx == hctx && + device->cursor == cursor) + return device; + } + + return NULL; +} + +gboolean +_gdk_input_other_event (GdkEvent *event, + MSG *msg, + GdkWindow *window) +{ + GdkDisplay *display; + GdkWindowObject *obj; + GdkDeviceWintab *device = NULL; + GdkDeviceGrabInfo *last_grab; + GdkEventMask masktest; + guint key_state; + POINT pt; + + PACKET packet; + gdouble root_x, root_y; + gint num_axes; + gint x, y; + guint translated_buttons, button_diff, button_mask; + /* Translation from tablet button state to GDK button state for + * buttons 1-3 - swap button 2 and 3. + */ + static guint button_map[8] = {0, 1, 4, 5, 2, 3, 6, 7}; + + if (event->any.window != wintab_window) + { + g_warning ("_gdk_input_other_event: not wintab_window?"); + return FALSE; + } + + window = gdk_window_at_pointer (&x, &y); + if (window == NULL) + window = _gdk_root; + + g_object_ref (window); + display = gdk_drawable_get_display (window); + + GDK_NOTE (EVENTS_OR_INPUT, + g_print ("_gdk_input_other_event: window=%p %+d%+d\n", + GDK_WINDOW_HWND (window), x, y)); + + if (msg->message == WT_PACKET) + { + if (!(*p_WTPacket) ((HCTX) msg->lParam, msg->wParam, &packet)) + return FALSE; + } + + obj = GDK_WINDOW_OBJECT (window); + + switch (msg->message) + { + case WT_PACKET: + /* Don't produce any button or motion events while a window is being + * moved or resized, see bug #151090. + */ + if (_modal_operation_in_progress) + { + GDK_NOTE (EVENTS_OR_INPUT, g_print ("... ignored when moving/sizing\n")); + return FALSE; + } + + if ((device = _gdk_device_manager_find_wintab_device ((HCTX) msg->lParam, + packet.pkCursor)) == NULL) + return FALSE; + + if (gdk_device_get_mode (GDK_DEVICE (device)) == GDK_MODE_DISABLED) + return FALSE; + + last_grab = _gdk_display_get_last_device_grab (_gdk_display, GDK_DEVICE (device)); + + if (last_grab && last_grab->window) + { + g_object_unref (window); + + window = g_object_ref (last_grab->window); + obj = GDK_WINDOW_OBJECT (window); + } + + if (window == _gdk_root) + { + GDK_NOTE (EVENTS_OR_INPUT, g_print ("... is root\n")); + return FALSE; + } + + num_axes = 0; + if (device->pktdata & PK_X) + device->last_axis_data[num_axes++] = packet.pkX; + if (device->pktdata & PK_Y) + device->last_axis_data[num_axes++] = packet.pkY; + if (device->pktdata & PK_NORMAL_PRESSURE) + device->last_axis_data[num_axes++] = packet.pkNormalPressure; + if (device->pktdata & PK_ORIENTATION) + { + decode_tilt (device->last_axis_data + num_axes, + device->orientation_axes, &packet); + num_axes += 2; + } + + translated_buttons = button_map[packet.pkButtons & 0x07] | (packet.pkButtons & ~0x07); + + if (translated_buttons != device->button_state) + { + /* At least one button has changed state so produce a button event + * If more than one button has changed state (unlikely), + * just care about the first and act on the next the next time + * we get a packet + */ + button_diff = translated_buttons ^ device->button_state; + + /* Gdk buttons are numbered 1.. */ + event->button.button = 1; + + for (button_mask = 1; button_mask != 0x80000000; + button_mask <<= 1, event->button.button++) + { + if (button_diff & button_mask) + { + /* Found a button that has changed state */ + break; + } + } + + if (!(translated_buttons & button_mask)) + { + event->any.type = GDK_BUTTON_RELEASE; + masktest = GDK_BUTTON_RELEASE_MASK; + } + else + { + event->any.type = GDK_BUTTON_PRESS; + masktest = GDK_BUTTON_PRESS_MASK; + } + device->button_state ^= button_mask; + } + else + { + event->any.type = GDK_MOTION_NOTIFY; + masktest = GDK_POINTER_MOTION_MASK; + if (device->button_state & (1 << 0)) + masktest |= GDK_BUTTON_MOTION_MASK | GDK_BUTTON1_MOTION_MASK; + if (device->button_state & (1 << 1)) + masktest |= GDK_BUTTON_MOTION_MASK | GDK_BUTTON2_MOTION_MASK; + if (device->button_state & (1 << 2)) + masktest |= GDK_BUTTON_MOTION_MASK | GDK_BUTTON3_MOTION_MASK; + } + + /* Now we can check if the window wants the event, and + * propagate if necessary. + */ + while (gdk_window_get_device_events (window, GDK_DEVICE (device)) == 0) + { + GDK_NOTE (EVENTS_OR_INPUT, g_print ("... not selected\n")); + + if (obj->parent == GDK_WINDOW_OBJECT (_gdk_root)) + return FALSE; + + /* It is not good to propagate the extended events up to the parent + * if this window wants normal (not extended) motion/button events */ + if (obj->event_mask & masktest) + { + GDK_NOTE (EVENTS_OR_INPUT, + g_print ("... wants ordinary event, ignoring this\n")); + return FALSE; + } + + pt.x = x; + pt.y = y; + ClientToScreen (GDK_WINDOW_HWND (window), &pt); + g_object_unref (window); + window = (GdkWindow *) obj->parent; + obj = GDK_WINDOW_OBJECT (window); + g_object_ref (window); + ScreenToClient (GDK_WINDOW_HWND (window), &pt); + x = pt.x; + y = pt.y; + GDK_NOTE (EVENTS_OR_INPUT, g_print ("... propagating to %p %+d%+d\n", + GDK_WINDOW_HWND (window), x, y)); + } + + if (gdk_window_get_device_events (window, GDK_DEVICE (device)) == 0) + return FALSE; + + event->any.window = window; + key_state = get_modifier_key_state (); + if (event->any.type == GDK_BUTTON_PRESS || + event->any.type == GDK_BUTTON_RELEASE) + { + event->button.time = _gdk_win32_get_next_tick (msg->time); + gdk_event_set_device (event, GDK_DEVICE (device)); + + event->button.axes = g_new (gdouble, num_axes); + _gdk_device_wintab_get_window_coords (window, &root_x, &root_y); + + _gdk_device_wintab_translate_axes (device, + window, + event->button.axes, + &event->button.x, + &event->button.y); + + event->button.x_root = event->button.x + root_x; + event->button.y_root = event->button.y + root_y; + + event->button.state = + key_state | ((device->button_state << 8) + & (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK + | GDK_BUTTON3_MASK | GDK_BUTTON4_MASK + | GDK_BUTTON5_MASK)); + + GDK_NOTE (EVENTS_OR_INPUT, + g_print ("WINTAB button %s:%d %g,%g\n", + (event->button.type == GDK_BUTTON_PRESS ? + "press" : "release"), + event->button.button, + event->button.x, event->button.y)); + } + else + { + event->motion.time = _gdk_win32_get_next_tick (msg->time); + event->motion.is_hint = FALSE; + gdk_event_set_device (event, GDK_DEVICE (device)); + + event->motion.axes = g_new (gdouble, num_axes); + _gdk_device_wintab_get_window_coords (window, &root_x, &root_y); + + _gdk_device_wintab_translate_axes (device, + window, + event->motion.axes, + &event->motion.x, + &event->motion.y); + + event->motion.x_root = event->motion.x + root_x; + event->motion.y_root = event->motion.y + root_y; + + event->motion.state = + key_state | ((device->button_state << 8) + & (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK + | GDK_BUTTON3_MASK | GDK_BUTTON4_MASK + | GDK_BUTTON5_MASK)); + + GDK_NOTE (EVENTS_OR_INPUT, + g_print ("WINTAB motion: %g,%g\n", + event->motion.x, event->motion.y)); + } + return TRUE; + + case WT_PROXIMITY: + if (LOWORD (msg->lParam) == 0) + { + event->proximity.type = GDK_PROXIMITY_OUT; + set_ignore_core (FALSE); + } + else + { + event->proximity.type = GDK_PROXIMITY_IN; + set_ignore_core (TRUE); + } + event->proximity.time = _gdk_win32_get_next_tick (msg->time); + gdk_event_set_device (event, GDK_DEVICE (device)); + + GDK_NOTE (EVENTS_OR_INPUT, + g_print ("WINTAB proximity %s\n", + (event->proximity.type == GDK_PROXIMITY_IN ? + "in" : "out"))); + return TRUE; + } + + return FALSE; +} diff --git a/gdk/win32/gdkdevicemanager-win32.h b/gdk/win32/gdkdevicemanager-win32.h new file mode 100644 index 0000000000..69d26b7561 --- /dev/null +++ b/gdk/win32/gdkdevicemanager-win32.h @@ -0,0 +1,59 @@ +/* GDK - The GIMP Drawing Kit + * Copyright (C) 2009 Carlos Garnacho + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GDK_DEVICE_MANAGER_WIN32_H__ +#define __GDK_DEVICE_MANAGER_WIN32_H__ + +#include + +G_BEGIN_DECLS + +#define GDK_TYPE_DEVICE_MANAGER_WIN32 (gdk_device_manager_win32_get_type ()) +#define GDK_DEVICE_MANAGER_WIN32(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_DEVICE_MANAGER_WIN32, GdkDeviceManagerWin32)) +#define GDK_DEVICE_MANAGER_WIN32_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_DEVICE_MANAGER_WIN32, GdkDeviceManagerWin32Class)) +#define GDK_IS_DEVICE_MANAGER_WIN32(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_DEVICE_MANAGER_WIN32)) +#define GDK_IS_DEVICE_MANAGER_WIN32_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_DEVICE_MANAGER_WIN32)) +#define GDK_DEVICE_MANAGER_WIN32_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_DEVICE_MANAGER_WIN32, GdkDeviceManagerWin32Class)) + +typedef struct _GdkDeviceManagerWin32 GdkDeviceManagerWin32; +typedef struct _GdkDeviceManagerWin32Class GdkDeviceManagerWin32Class; + +struct _GdkDeviceManagerWin32 +{ + GdkDeviceManager parent_object; + GdkDevice *core_pointer; + GdkDevice *core_keyboard; + GList *wintab_devices; +}; + +struct _GdkDeviceManagerWin32Class +{ + GdkDeviceManagerClass parent_class; +}; + +GType gdk_device_manager_win32_get_type (void) G_GNUC_CONST; + +void _gdk_input_set_tablet_active (void); +gboolean _gdk_input_other_event (GdkEvent *event, + MSG *msg, + GdkWindow *window); + +G_END_DECLS + +#endif /* __GDK_DEVICE_MANAGER_WIN32_H__ */ diff --git a/gdk/win32/gdkdnd-win32.c b/gdk/win32/gdkdnd-win32.c index 9f4d37ba4c..6436fb7817 100644 --- a/gdk/win32/gdkdnd-win32.c +++ b/gdk/win32/gdkdnd-win32.c @@ -98,6 +98,7 @@ typedef enum { * this is used on both source and destination sides. */ struct _GdkDragContextPrivateWin32 { + GdkDevice *device; gboolean being_finalized; gint ref_count; IUnknown *iface; @@ -203,20 +204,37 @@ gdk_drag_context_new (void) return g_object_new (GDK_TYPE_DRAG_CONTEXT, NULL); } -void -gdk_drag_context_ref (GdkDragContext *context) +GdkDevice * +gdk_drag_context_get_device (GdkDragContext *context) { - g_return_if_fail (GDK_IS_DRAG_CONTEXT (context)); + GdkDragContextPrivateWin32 *private; - g_object_ref (context); + g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), NULL); + + private = PRIVATE_DATA (context); + + return private->device; } void -gdk_drag_context_unref (GdkDragContext *context) +gdk_drag_context_set_device (GdkDragContext *context, + GdkDevice *device) { - g_return_if_fail (GDK_IS_DRAG_CONTEXT (context)); + GdkDragContextPrivateWin32 *private; - g_object_unref (context); + g_return_if_fail (GDK_IS_DRAG_CONTEXT (context)); + g_return_if_fail (GDK_IS_DEVICE (device)); + + private = PRIVATE_DATA (context); + + if (private->device) + { + g_object_unref (private->device); + private->device = NULL; + } + + if (device) + private->device = g_object_ref (device); } static GdkDragContext * @@ -441,24 +459,28 @@ dnd_event_put (GdkEventType type, const POINTL pt, gboolean to_dest_window) { - GdkEvent e; - e.type = type; + GdkEvent *e; + + e = gdk_event_new (type); + if (to_dest_window) - e.dnd.window = context->dest_window; + e->dnd.window = context->dest_window; else - e.dnd.window = context->source_window; - e.dnd.send_event = FALSE; - e.dnd.context = context; - e.dnd.time = GDK_CURRENT_TIME; - e.dnd.x_root = pt.x + _gdk_offset_x; - e.dnd.y_root = pt.x + _gdk_offset_y; + e->dnd.window = context->source_window; + e->dnd.send_event = FALSE; + e->dnd.context = g_object_ref (context); + e->dnd.time = GDK_CURRENT_TIME; + e->dnd.x_root = pt.x + _gdk_offset_x; + e->dnd.y_root = pt.x + _gdk_offset_y; - gdk_drag_context_ref (e.dnd.context); - if (e.dnd.window != NULL) - g_object_ref (e.dnd.window); + if (e->dnd.window != NULL) + g_object_ref (e->dnd.window); - GDK_NOTE (EVENTS, _gdk_win32_print_event (&e)); - gdk_event_put (&e); + gdk_event_set_device (e, gdk_drag_context_get_device (context)); + + GDK_NOTE (EVENTS, _gdk_win32_print_event (e)); + gdk_event_put (e); + gdk_event_free (e); } static HRESULT STDMETHODCALLTYPE @@ -1189,6 +1211,7 @@ target_context_new (GdkWindow *window) { target_drag_context *result; GdkDragContextPrivateWin32 *private; + GdkDevice *device; result = g_new0 (target_drag_context, 1); @@ -1198,6 +1221,9 @@ target_context_new (GdkWindow *window) result->context->protocol = GDK_DRAG_PROTO_OLE2; result->context->is_source = FALSE; + device = gdk_display_get_core_pointer (_gdk_display); + gdk_drag_context_set_device (result->context, device); + result->context->source_window = NULL; result->context->dest_window = window; @@ -1224,6 +1250,7 @@ source_context_new (GdkWindow *window, { source_drag_context *result; GdkDragContextPrivateWin32 *private; + GdkDevice *device; result = g_new0 (source_drag_context, 1); @@ -1233,6 +1260,9 @@ source_context_new (GdkWindow *window, result->context->protocol = GDK_DRAG_PROTO_OLE2; result->context->is_source = TRUE; + device = gdk_display_get_core_pointer (_gdk_display); + gdk_drag_context_set_device (result->context, device); + result->context->source_window = window; g_object_ref (window); @@ -1444,6 +1474,7 @@ gdk_dropfiles_filter (GdkXEvent *xev, POINT pt; gint nfiles, i; gchar *fileName, *linkedFile; + GdkDevice *device; if (msg->message == WM_DROPFILES) { @@ -1453,6 +1484,9 @@ gdk_dropfiles_filter (GdkXEvent *xev, context->protocol = GDK_DRAG_PROTO_WIN32_DROPFILES; context->is_source = FALSE; + device = gdk_display_get_core_pointer (_gdk_display); + gdk_drag_context_set_device (context, device); + context->source_window = _gdk_root; g_object_ref (context->source_window); @@ -1468,6 +1502,7 @@ gdk_dropfiles_filter (GdkXEvent *xev, event->dnd.type = GDK_DROP_START; event->dnd.context = current_dest_drag; + gdk_event_set_device (event, gdk_drag_context_get_device (current_dest_drag)); hdrop = (HANDLE) msg->wParam; DragQueryPoint (hdrop, &pt); @@ -1631,7 +1666,7 @@ static void local_send_leave (GdkDragContext *context, guint32 time) { - GdkEvent tmp_event; + GdkEvent *tmp_event; GDK_NOTE (DND, g_print ("local_send_leave: context=%p current_dest_drag=%p\n", context, @@ -1641,17 +1676,20 @@ local_send_leave (GdkDragContext *context, (current_dest_drag->protocol == GDK_DRAG_PROTO_LOCAL) && (current_dest_drag->source_window == context->source_window)) { - tmp_event.dnd.type = GDK_DRAG_LEAVE; - tmp_event.dnd.window = context->dest_window; + tmp_event = gdk_event_new (GDK_DRAG_LEAVE); + + tmp_event->dnd.window = g_object_ref (context->dest_window); /* Pass ownership of context to the event */ - tmp_event.dnd.send_event = FALSE; - tmp_event.dnd.context = current_dest_drag; - tmp_event.dnd.time = GDK_CURRENT_TIME; /* FIXME? */ + tmp_event->dnd.send_event = FALSE; + tmp_event->dnd.context = g_object_ref (current_dest_drag); + tmp_event->dnd.time = GDK_CURRENT_TIME; /* FIXME? */ + gdk_event_set_device (tmp_event, gdk_drag_context_get_device (context)); current_dest_drag = NULL; - GDK_NOTE (EVENTS, _gdk_win32_print_event (&tmp_event)); - gdk_event_put (&tmp_event); + GDK_NOTE (EVENTS, _gdk_win32_print_event (tmp_event)); + gdk_event_put (tmp_event); + gdk_event_free (tmp_event); } } @@ -1659,9 +1697,10 @@ static void local_send_enter (GdkDragContext *context, guint32 time) { - GdkEvent tmp_event; + GdkEvent *tmp_event; GdkDragContextPrivateWin32 *private; GdkDragContext *new_context; + GdkDevice *device; GDK_NOTE (DND, g_print ("local_send_enter: context=%p current_dest_drag=%p\n", context, @@ -1679,6 +1718,9 @@ local_send_enter (GdkDragContext *context, new_context->protocol = GDK_DRAG_PROTO_LOCAL; new_context->is_source = FALSE; + device = gdk_display_get_core_pointer (_gdk_display); + gdk_drag_context_set_device (new_context, device); + new_context->source_window = context->source_window; g_object_ref (new_context->source_window); @@ -1692,16 +1734,18 @@ local_send_enter (GdkDragContext *context, GDK_PROPERTY_CHANGE_MASK); new_context->actions = context->actions; - tmp_event.type = GDK_DRAG_ENTER; - tmp_event.dnd.window = context->dest_window; - tmp_event.dnd.send_event = FALSE; - tmp_event.dnd.context = new_context; - tmp_event.dnd.time = GDK_CURRENT_TIME; /* FIXME? */ + tmp_event = gdk_event_new (GDK_DRAG_ENTER); + tmp_event->dnd.window = g_object_ref (context->dest_window); + tmp_event->dnd.send_event = FALSE; + tmp_event->dnd.context = g_object_ref (new_context); + tmp_event->dnd.time = GDK_CURRENT_TIME; /* FIXME? */ + gdk_event_set_device (tmp_event, gdk_drag_context_get_device (context)); current_dest_drag = new_context; - GDK_NOTE (EVENTS, _gdk_win32_print_event (&tmp_event)); - gdk_event_put (&tmp_event); + GDK_NOTE (EVENTS, _gdk_win32_print_event (tmp_event)); + gdk_event_put (tmp_event); + gdk_event_free (tmp_event); } static void @@ -1711,7 +1755,7 @@ local_send_motion (GdkDragContext *context, GdkDragAction action, guint32 time) { - GdkEvent tmp_event; + GdkEvent *tmp_event; GDK_NOTE (DND, g_print ("local_send_motion: context=%p (%d,%d) current_dest_drag=%p\n", context, x_root, y_root, @@ -1721,24 +1765,26 @@ local_send_motion (GdkDragContext *context, (current_dest_drag->protocol == GDK_DRAG_PROTO_LOCAL) && (current_dest_drag->source_window == context->source_window)) { - tmp_event.type = GDK_DRAG_MOTION; - tmp_event.dnd.window = current_dest_drag->dest_window; - tmp_event.dnd.send_event = FALSE; - tmp_event.dnd.context = current_dest_drag; - tmp_event.dnd.time = time; + tmp_event = gdk_event_new (GDK_DRAG_MOTION); + tmp_event->dnd.window = g_object_ref (current_dest_drag->dest_window); + tmp_event->dnd.send_event = FALSE; + tmp_event->dnd.context = g_object_ref (current_dest_drag); + tmp_event->dnd.time = time; + gdk_event_set_device (tmp_event, gdk_drag_context_get_device (current_dest_drag)); current_dest_drag->suggested_action = action; - tmp_event.dnd.x_root = x_root; - tmp_event.dnd.y_root = y_root; + tmp_event->dnd.x_root = x_root; + tmp_event->dnd.y_root = y_root; PRIVATE_DATA (current_dest_drag)->last_pt.x = x_root - _gdk_offset_x; PRIVATE_DATA (current_dest_drag)->last_pt.y = y_root - _gdk_offset_y; PRIVATE_DATA (context)->drag_status = GDK_DRAG_STATUS_MOTION_WAIT; - GDK_NOTE (EVENTS, _gdk_win32_print_event (&tmp_event)); - gdk_event_put (&tmp_event); + GDK_NOTE (EVENTS, _gdk_win32_print_event (tmp_event)); + gdk_event_put (tmp_event); + gdk_event_free (tmp_event); } } @@ -1746,7 +1792,7 @@ static void local_send_drop (GdkDragContext *context, guint32 time) { - GdkEvent tmp_event; + GdkEvent *tmp_event; GDK_NOTE (DND, g_print ("local_send_drop: context=%p current_dest_drag=%p\n", context, @@ -1760,19 +1806,21 @@ local_send_drop (GdkDragContext *context, private = PRIVATE_DATA (current_dest_drag); /* Pass ownership of context to the event */ - tmp_event.type = GDK_DROP_START; - tmp_event.dnd.window = current_dest_drag->dest_window; - tmp_event.dnd.send_event = FALSE; - tmp_event.dnd.context = current_dest_drag; - tmp_event.dnd.time = GDK_CURRENT_TIME; + tmp_event = gdk_event_new (GDK_DROP_START); + tmp_event->dnd.window = g_object_ref (current_dest_drag->dest_window); + tmp_event->dnd.send_event = FALSE; + tmp_event->dnd.context = g_object_ref (current_dest_drag); + tmp_event->dnd.time = GDK_CURRENT_TIME; + gdk_event_set_device (tmp_event, gdk_drag_context_get_device (current_dest_drag)); - tmp_event.dnd.x_root = private->last_pt.x + _gdk_offset_x; - tmp_event.dnd.y_root = private->last_pt.y + _gdk_offset_y; + tmp_event->dnd.x_root = private->last_pt.x + _gdk_offset_x; + tmp_event->dnd.y_root = private->last_pt.y + _gdk_offset_y; current_dest_drag = NULL; - GDK_NOTE (EVENTS, _gdk_win32_print_event (&tmp_event)); - gdk_event_put (&tmp_event); + GDK_NOTE (EVENTS, _gdk_win32_print_event (tmp_event)); + gdk_event_put (tmp_event); + gdk_event_free (tmp_event); } } @@ -1803,11 +1851,15 @@ gdk_drag_begin (GdkWindow *window, if (!use_ole2_dnd) { GdkDragContext *new_context; + GdkDevice *device; g_return_val_if_fail (window != NULL, NULL); new_context = gdk_drag_context_new (); + device = gdk_display_get_core_pointer (_gdk_display); + gdk_drag_context_set_device (new_context, device); + new_context->is_source = TRUE; new_context->source_window = window; @@ -1831,7 +1883,7 @@ gdk_drag_begin (GdkWindow *window, _dnd_source_state = GDK_WIN32_DND_PENDING; pending_src_context = ctx; - gdk_drag_context_ref (ctx->context); + g_object_ref (ctx->context); return ctx->context; } @@ -2059,7 +2111,7 @@ gdk_drag_motion (GdkDragContext *context, } else { - GdkEvent tmp_event; + GdkEvent *tmp_event; /* Send a leave to the last destination */ gdk_drag_do_leave (context, time); @@ -2092,18 +2144,20 @@ gdk_drag_motion (GdkDragContext *context, /* Push a status event, to let the client know that * the drag changed */ - tmp_event.type = GDK_DRAG_STATUS; - tmp_event.dnd.window = context->source_window; + tmp_event = gdk_event_new (GDK_DRAG_STATUS); + tmp_event->dnd.window = g_object_ref (context->source_window); /* We use this to signal a synthetic status. Perhaps * we should use an extra field... */ - tmp_event.dnd.send_event = TRUE; + tmp_event->dnd.send_event = TRUE; - tmp_event.dnd.context = context; - tmp_event.dnd.time = time; + tmp_event->dnd.context = g_object_ref (context); + tmp_event->dnd.time = time; + gdk_event_set_device (tmp_event, gdk_drag_context_get_device (context)); - GDK_NOTE (EVENTS, _gdk_win32_print_event (&tmp_event)); - gdk_event_put (&tmp_event); + GDK_NOTE (EVENTS, _gdk_win32_print_event (tmp_event)); + gdk_event_put (tmp_event); + gdk_event_free (tmp_event); } /* Send a drag-motion event */ @@ -2192,7 +2246,7 @@ gdk_drag_status (GdkDragContext *context, { GdkDragContextPrivateWin32 *private; GdkDragContext *src_context; - GdkEvent tmp_event; + GdkEvent *tmp_event; g_return_if_fail (context != NULL); @@ -2221,19 +2275,21 @@ gdk_drag_status (GdkDragContext *context, if (private->drag_status == GDK_DRAG_STATUS_MOTION_WAIT) private->drag_status = GDK_DRAG_STATUS_DRAG; - tmp_event.type = GDK_DRAG_STATUS; - tmp_event.dnd.window = context->source_window; - tmp_event.dnd.send_event = FALSE; - tmp_event.dnd.context = src_context; - tmp_event.dnd.time = GDK_CURRENT_TIME; /* FIXME? */ + tmp_event = gdk_event_new (GDK_DRAG_STATUS); + tmp_event->dnd.window = g_object_ref (context->source_window); + tmp_event->dnd.send_event = FALSE; + tmp_event->dnd.context = g_object_ref (src_context); + tmp_event->dnd.time = GDK_CURRENT_TIME; /* FIXME? */ + gdk_event_set_device (tmp_event, gdk_drag_context_get_device (src_context)); if (action == GDK_ACTION_DEFAULT) action = 0; src_context->action = action; - GDK_NOTE (EVENTS, _gdk_win32_print_event (&tmp_event)); - gdk_event_put (&tmp_event); + GDK_NOTE (EVENTS, _gdk_win32_print_event (tmp_event)); + gdk_event_put (tmp_event); + gdk_event_free (tmp_event); } } } @@ -2262,7 +2318,7 @@ gdk_drop_finish (GdkDragContext *context, { GdkDragContextPrivateWin32 *private; GdkDragContext *src_context; - GdkEvent tmp_event; + GdkEvent *tmp_event; g_return_if_fail (context != NULL); @@ -2277,13 +2333,15 @@ gdk_drop_finish (GdkDragContext *context, context->dest_window); if (src_context) { - tmp_event.type = GDK_DROP_FINISHED; - tmp_event.dnd.window = src_context->source_window; - tmp_event.dnd.send_event = FALSE; - tmp_event.dnd.context = src_context; + tmp_event = gdk_event_new (GDK_DROP_FINISHED); + tmp_event->dnd.window = g_object_ref (src_context->source_window); + tmp_event->dnd.send_event = FALSE; + tmp_event->dnd.context = g_object_ref (src_context); + gdk_event_set_device (tmp_event, gdk_drag_context_get_device (src_context)); - GDK_NOTE (EVENTS, _gdk_win32_print_event (&tmp_event)); - gdk_event_put (&tmp_event); + GDK_NOTE (EVENTS, _gdk_win32_print_event (tmp_event)); + gdk_event_put (tmp_event); + gdk_event_free (tmp_event); } } else @@ -2375,7 +2433,7 @@ gdk_window_register_dnd (GdkWindow *window) OTHER_API_FAILED ("RegisterDragDrop"); else { - gdk_window_ref (window); + g_object_ref (window); g_hash_table_insert (target_ctx_for_window, GDK_WINDOW_HWND (window), ctx); } } diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c index 3773e4dc20..d166980ddd 100644 --- a/gdk/win32/gdkevents-win32.c +++ b/gdk/win32/gdkevents-win32.c @@ -47,8 +47,10 @@ #include "gdk.h" #include "gdkprivate-win32.h" -#include "gdkinput-win32.h" #include "gdkkeysyms.h" +#include "gdkdevicemanager-win32.h" +#include "gdkdeviceprivate.h" +#include "gdkdevice-wintab.h" #include @@ -101,6 +103,7 @@ static gboolean is_modally_blocked (GdkWindow *window); */ static GList *client_filters; /* Filters for client messages */ +extern gint _gdk_input_ignore_core; static HCURSOR p_grab_cursor; @@ -199,31 +202,44 @@ _gdk_win32_get_next_tick (gulong suggested_tick) } static void -generate_focus_event (GdkWindow *window, - gboolean in) +generate_focus_event (GdkDeviceManager *device_manager, + GdkWindow *window, + gboolean in) { + GdkDevice *device; GdkEvent *event; + device = GDK_DEVICE_MANAGER_WIN32 (device_manager)->core_keyboard; + event = gdk_event_new (GDK_FOCUS_CHANGE); event->focus_change.window = window; event->focus_change.in = in; + gdk_event_set_device (event, device); append_event (event); } static void -generate_grab_broken_event (GdkWindow *window, - gboolean keyboard, - GdkWindow *grab_window) +generate_grab_broken_event (GdkDeviceManager *device_manager, + GdkWindow *window, + gboolean keyboard, + GdkWindow *grab_window) { GdkEvent *event = gdk_event_new (GDK_GRAB_BROKEN); + GdkDevice *device; + + if (keyboard) + device = GDK_DEVICE_MANAGER_WIN32 (device_manager)->core_keyboard; + else + device = GDK_DEVICE_MANAGER_WIN32 (device_manager)->core_pointer; event->grab_broken.window = window; event->grab_broken.send_event = 0; event->grab_broken.keyboard = keyboard; event->grab_broken.implicit = FALSE; event->grab_broken.grab_window = grab_window; - + gdk_event_set_device (event, device); + append_event (event); } @@ -377,6 +393,7 @@ _gdk_events_init (void) #endif source = g_source_new (&event_funcs, sizeof (GSource)); + g_source_set_name (source, "GDK Win32 event source"); g_source_set_priority (source, GDK_PRIORITY_EVENTS); #ifdef G_WITH_CYGWIN @@ -402,30 +419,6 @@ gdk_events_pending (void) PeekMessageW (&msg, NULL, 0, 0, PM_NOREMOVE))); } -GdkEvent* -gdk_event_get_graphics_expose (GdkWindow *window) -{ - MSG msg; - GdkEvent *event = NULL; - - g_return_val_if_fail (window != NULL, NULL); - - GDK_NOTE (EVENTS, g_print ("gdk_event_get_graphics_expose\n")); - - if (PeekMessageW (&msg, GDK_WINDOW_HWND (window), WM_PAINT, WM_PAINT, PM_REMOVE)) - { - handle_wm_paint (&msg, window, TRUE, &event); - if (event != NULL) - { - GDK_NOTE (EVENTS, g_print ("gdk_event_get_graphics_expose: got it!\n")); - return event; - } - } - - GDK_NOTE (EVENTS, g_print ("gdk_event_get_graphics_expose: nope\n")); - return NULL; -} - #if 0 /* Unused, but might be useful to re-introduce in some debugging output? */ static char * @@ -467,17 +460,19 @@ event_mask_string (GdkEventMask mask) #endif GdkGrabStatus -_gdk_windowing_pointer_grab (GdkWindow *window, - GdkWindow *native_window, - gboolean owner_events, - GdkEventMask event_mask, - GdkWindow *confine_to, - GdkCursor *cursor, - guint32 time) +_gdk_windowing_device_grab (GdkDevice *device, + GdkWindow *window, + GdkWindow *native_window, + gboolean owner_events, + GdkEventMask event_mask, + GdkWindow *confine_to, + GdkCursor *cursor, + guint32 time) { HCURSOR hcursor; GdkCursorPrivate *cursor_private; gint return_val; + GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (((GdkWindowObject *) native_window)->impl); g_return_val_if_fail (window != NULL, 0); g_return_val_if_fail (GDK_IS_WINDOW (window), 0); @@ -490,54 +485,53 @@ _gdk_windowing_pointer_grab (GdkWindow *window, else if ((hcursor = CopyCursor (cursor_private->hcursor)) == NULL) WIN32_API_FAILED ("CopyCursor"); - return_val = _gdk_input_grab_pointer (native_window, - owner_events, - event_mask, - confine_to, - time); + return_val = GDK_DEVICE_GET_CLASS (device)->grab (device, + native_window, + owner_events, + event_mask, + confine_to, + cursor, + time); - if (return_val == GDK_GRAB_SUCCESS) + /* TODO_CSW: grab brokens, confine window, input_grab */ + if (p_grab_cursor != NULL) { - GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (((GdkWindowObject *) native_window)->impl); - - SetCapture (GDK_WINDOW_HWND (native_window)); - /* TODO_CSW: grab brokens, confine window, input_grab */ - if (p_grab_cursor != NULL) - { - if (GetCursor () == p_grab_cursor) - SetCursor (NULL); - DestroyCursor (p_grab_cursor); - } - - p_grab_cursor = hcursor; - - if (p_grab_cursor != NULL) - SetCursor (p_grab_cursor); - else if (impl->hcursor != NULL) - SetCursor (impl->hcursor); - else - SetCursor (LoadCursor (NULL, IDC_ARROW)); - + if (GetCursor () == p_grab_cursor) + SetCursor (NULL); + DestroyCursor (p_grab_cursor); } + p_grab_cursor = hcursor; + + if (p_grab_cursor != NULL) + SetCursor (p_grab_cursor); + else if (impl->hcursor != NULL) + SetCursor (impl->hcursor); + else + SetCursor (LoadCursor (NULL, IDC_ARROW)); + return return_val; } void -gdk_display_pointer_ungrab (GdkDisplay *display, - guint32 time) +gdk_device_ungrab (GdkDevice *device, + guint32 time) { - GdkPointerGrabInfo *info; + GdkDeviceGrabInfo *info; + GdkDisplay *display; + + g_return_if_fail (GDK_IS_DEVICE (device)); + + display = gdk_device_get_display (device); + info = _gdk_display_get_last_device_grab (display, device); - info = _gdk_display_get_last_pointer_grab (display); if (info) { info->serial_end = 0; - ReleaseCapture (); + GDK_DEVICE_GET_CLASS (device)->ungrab (device, time); } - /* TODO_CSW: cursor, confines, etc */ - _gdk_display_pointer_grab_update (display, 0); + _gdk_display_device_grab_update (display, device, 0); } @@ -549,8 +543,11 @@ find_window_for_mouse_event (GdkWindow* reported_window, POINTS points; POINT pt; GdkWindow* other_window = NULL; + GdkDeviceManagerWin32 *device_manager; - if (!_gdk_display_get_last_pointer_grab (_gdk_display)) + device_manager = GDK_DEVICE_MANAGER_WIN32 (gdk_display_get_device_manager (_gdk_display)); + + if (!_gdk_display_get_last_device_grab (_gdk_display, device_manager->core_pointer)) return reported_window; points = MAKEPOINTS (msg->lParam); @@ -586,41 +583,6 @@ find_window_for_mouse_event (GdkWindow* reported_window, return other_window; } -GdkGrabStatus -gdk_keyboard_grab (GdkWindow *window, - gboolean owner_events, - guint32 time) -{ - GdkDisplay *display; - GdkWindow *toplevel; - - g_return_val_if_fail (window != NULL, 0); - g_return_val_if_fail (GDK_IS_WINDOW (window), 0); - - GDK_NOTE (EVENTS, g_print ("gdk_keyboard_grab %p%s\n", - GDK_WINDOW_HWND (window), owner_events ? " OWNER_EVENTS" : "")); - - display = gdk_drawable_get_display (window); - toplevel = gdk_window_get_toplevel (window); - - _gdk_display_set_has_keyboard_grab (display, - window, - toplevel, - owner_events, - 0, - time); - - return GDK_GRAB_SUCCESS; -} - -void -gdk_display_keyboard_ungrab (GdkDisplay *display, - guint32 time) -{ - GDK_NOTE (EVENTS, g_print ("gdk_display_keyboard_ungrab\n")); - _gdk_display_unset_has_keyboard_grab (display, FALSE); -} - void gdk_display_add_client_message_filter (GdkDisplay *display, GdkAtom message_type, @@ -1219,11 +1181,11 @@ do_show_window (GdkWindow *window, gboolean hide_window) } static void -synthesize_enter_or_leave_event (GdkWindow *window, - MSG *msg, - GdkEventType type, - GdkCrossingMode mode, - GdkNotifyType detail) +synthesize_enter_or_leave_event (GdkWindow *window, + MSG *msg, + GdkEventType type, + GdkCrossingMode mode, + GdkNotifyType detail) { GdkEvent *event; POINT pt; @@ -1243,12 +1205,13 @@ synthesize_enter_or_leave_event (GdkWindow *window, event->crossing.detail = detail; event->crossing.focus = TRUE; /* FIXME: Set correctly */ event->crossing.state = 0; /* FIXME: Set correctly */ + gdk_event_set_device (event, _gdk_display->core_pointer); append_event (event); if (type == GDK_ENTER_NOTIFY && ((GdkWindowObject *) window)->extension_events != 0) - _gdk_input_enter_event (window); + _gdk_device_wintab_update_window_coords (window); } static void @@ -1708,10 +1671,10 @@ handle_display_change (void) } static void -generate_button_event (GdkEventType type, - gint button, - GdkWindow *window, - MSG *msg) +generate_button_event (GdkEventType type, + gint button, + GdkWindow *window, + MSG *msg) { GdkEvent *event = gdk_event_new (type); @@ -1724,7 +1687,7 @@ generate_button_event (GdkEventType type, event->button.axes = NULL; event->button.state = build_pointer_event_state (msg); event->button.button = button; - event->button.device = _gdk_display->core_pointer; + gdk_event_set_device (event, _gdk_display->core_pointer); append_event (event); } @@ -1892,7 +1855,10 @@ gdk_event_translate (MSG *msg, GdkWindow *orig_window, *new_window, *toplevel; - GdkPointerGrabInfo *grab = NULL; + GdkDeviceManager *device_manager; + + GdkDeviceGrabInfo *keyboard_grab = NULL; + GdkDeviceGrabInfo *pointer_grab = NULL; GdkWindow *grab_window = NULL; static gint update_colors_counter = 0; @@ -1953,7 +1919,14 @@ gdk_event_translate (MSG *msg, } return FALSE; } - + + device_manager = gdk_display_get_device_manager (_gdk_display); + + keyboard_grab = _gdk_display_get_last_device_grab (_gdk_display, + GDK_DEVICE_MANAGER_WIN32 (device_manager)->core_keyboard); + pointer_grab = _gdk_display_get_last_device_grab (_gdk_display, + GDK_DEVICE_MANAGER_WIN32 (device_manager)->core_pointer); + g_object_ref (window); /* window's refcount has now been increased, so code below should @@ -2071,7 +2044,7 @@ gdk_event_translate (MSG *msg, /* Let the system handle Alt-Tab, Alt-Space and Alt-F4 unless * the keyboard is grabbed. */ - if (_gdk_display->keyboard_grab.window == NULL && + if (!keyboard_grab && (msg->wParam == VK_TAB || msg->wParam == VK_SPACE || msg->wParam == VK_F4)) @@ -2095,9 +2068,10 @@ gdk_event_translate (MSG *msg, in_ime_composition) break; - if (!propagate (&window, msg, - _gdk_display->keyboard_grab.window, - _gdk_display->keyboard_grab.owner_events, + if (keyboard_grab && + !propagate (&window, msg, + keyboard_grab->window, + keyboard_grab->owner_events, GDK_ALL_EVENTS_MASK, doesnt_want_key, FALSE)) break; @@ -2114,6 +2088,7 @@ gdk_event_translate (MSG *msg, event->key.string = NULL; event->key.length = 0; event->key.hardware_keycode = msg->wParam; + gdk_event_set_device (event, GDK_DEVICE_MANAGER_WIN32 (device_manager)->core_keyboard); if (HIWORD (msg->lParam) & KF_EXTENDED) { switch (msg->wParam) @@ -2199,9 +2174,10 @@ gdk_event_translate (MSG *msg, if (!(msg->lParam & GCS_RESULTSTR)) break; - if (!propagate (&window, msg, - _gdk_display->keyboard_grab.window, - _gdk_display->keyboard_grab.owner_events, + if (keyboard_grab && + !propagate (&window, msg, + keyboard_grab->window, + keyboard_grab->owner_events, GDK_ALL_EVENTS_MASK, doesnt_want_char, FALSE)) break; @@ -2225,6 +2201,7 @@ gdk_event_translate (MSG *msg, /* Build a key press event */ event = gdk_event_new (GDK_KEY_PRESS); event->key.window = window; + gdk_event_set_device (event, GDK_DEVICE_MANAGER_WIN32 (device_manager)->core_keyboard); build_wm_ime_composition_event (event, msg, wbuf[i], key_state); append_event (event); @@ -2235,6 +2212,7 @@ gdk_event_translate (MSG *msg, /* Build a key release event. */ event = gdk_event_new (GDK_KEY_RELEASE); event->key.window = window; + gdk_event_set_device (event, GDK_DEVICE_MANAGER_WIN32 (device_manager)->core_keyboard); build_wm_ime_composition_event (event, msg, wbuf[i], key_state); append_event (event); @@ -2331,10 +2309,10 @@ gdk_event_translate (MSG *msg, current_toplevel ? GDK_WINDOW_HWND (current_toplevel) : NULL, toplevel ? GDK_WINDOW_HWND (toplevel) : NULL)); if (current_toplevel) - synthesize_enter_or_leave_event (current_toplevel, msg, - GDK_LEAVE_NOTIFY, GDK_CROSSING_NORMAL, GDK_NOTIFY_ANCESTOR); - synthesize_enter_or_leave_event (toplevel, msg, - GDK_ENTER_NOTIFY, GDK_CROSSING_NORMAL, GDK_NOTIFY_ANCESTOR); + synthesize_enter_or_leave_event (current_toplevel, msg, + GDK_LEAVE_NOTIFY, GDK_CROSSING_NORMAL, GDK_NOTIFY_ANCESTOR); + synthesize_enter_or_leave_event (toplevel, msg, + GDK_ENTER_NOTIFY, GDK_CROSSING_NORMAL, GDK_NOTIFY_ANCESTOR); assign_object (¤t_toplevel, toplevel); track_mouse_event (TME_LEAVE, GDK_WINDOW_HWND (toplevel)); } @@ -2360,7 +2338,7 @@ gdk_event_translate (MSG *msg, event->motion.axes = NULL; event->motion.state = build_pointer_event_state (msg); event->motion.is_hint = FALSE; - event->motion.device = _gdk_display->core_pointer; + gdk_event_set_device (event, _gdk_display->core_pointer); append_event (event); @@ -2389,8 +2367,8 @@ gdk_event_translate (MSG *msg, { /* we are only interested if we don't know the new window */ if (current_toplevel) - synthesize_enter_or_leave_event (current_toplevel, msg, - GDK_LEAVE_NOTIFY, GDK_CROSSING_NORMAL, GDK_NOTIFY_ANCESTOR); + synthesize_enter_or_leave_event (current_toplevel, msg, + GDK_LEAVE_NOTIFY, GDK_CROSSING_NORMAL, GDK_NOTIFY_ANCESTOR); assign_object (¤t_toplevel, NULL); } else @@ -2436,7 +2414,7 @@ gdk_event_translate (MSG *msg, event->scroll.x_root = (gint16) GET_X_LPARAM (msg->lParam) + _gdk_offset_x; event->scroll.y_root = (gint16) GET_Y_LPARAM (msg->lParam) + _gdk_offset_y; event->scroll.state = build_pointer_event_state (msg); - event->scroll.device = _gdk_display->core_pointer; + gdk_event_set_device (event, _gdk_display->core_pointer); append_event (event); @@ -2536,16 +2514,16 @@ gdk_event_translate (MSG *msg, break; case WM_KILLFOCUS: - if (_gdk_display->keyboard_grab.window != NULL && - !GDK_WINDOW_DESTROYED (_gdk_display->keyboard_grab.window)) + if (keyboard_grab != NULL && + !GDK_WINDOW_DESTROYED (keyboard_grab->window)) { - generate_grab_broken_event (_gdk_display->keyboard_grab.window, FALSE, NULL); + generate_grab_broken_event (device_manager, keyboard_grab->window, FALSE, NULL); } /* fallthrough */ case WM_SETFOCUS: - if (_gdk_display->keyboard_grab.window != NULL && - !_gdk_display->keyboard_grab.owner_events) + if (keyboard_grab != NULL && + !keyboard_grab->owner_events) break; if (!(((GdkWindowObject *) window)->event_mask & GDK_FOCUS_CHANGE_MASK)) @@ -2554,7 +2532,7 @@ gdk_event_translate (MSG *msg, if (GDK_WINDOW_DESTROYED (window)) break; - generate_focus_event (window, (msg->message == WM_SETFOCUS)); + generate_focus_event (device_manager, window, (msg->message == WM_SETFOCUS)); return_val = TRUE; break; @@ -2582,11 +2560,8 @@ gdk_event_translate (MSG *msg, GDK_NOTE (EVENTS, g_print (" %#x %#x", LOWORD (msg->lParam), HIWORD (msg->lParam))); - grab = _gdk_display_get_last_pointer_grab (_gdk_display); - if (grab != NULL) - { - grab_window = grab->window; - } + if (pointer_grab != NULL) + grab_window = pointer_grab->window; if (grab_window == NULL && LOWORD (msg->lParam) != HTCLIENT) break; @@ -2641,14 +2616,14 @@ gdk_event_translate (MSG *msg, SetForegroundWindow (GDK_WINDOW_HWND (impl->transient_owner)); } - grab = _gdk_display_get_last_pointer_grab (_gdk_display); - if (grab != NULL) + if (pointer_grab != NULL) { - if (grab->window == window) + if (pointer_grab->window == window) gdk_pointer_ungrab (msg->time); } - if (_gdk_display->keyboard_grab.window == window) + if (keyboard_grab && + keyboard_grab->window == window) gdk_keyboard_ungrab (msg->time); } @@ -2679,13 +2654,13 @@ gdk_event_translate (MSG *msg, if (msg->wParam == SIZE_MINIMIZED) { /* Don't generate any GDK event. This is *not* an UNMAP. */ - grab = _gdk_display_get_last_pointer_grab (_gdk_display); - if (grab != NULL) + if (pointer_grab != NULL) { - if (grab->window == window) + if (pointer_grab->window == window) gdk_pointer_ungrab (msg->time); } - if (_gdk_display->keyboard_grab.window == window) + if (keyboard_grab && + keyboard_grab->window == window) gdk_keyboard_ungrab (msg->time); gdk_synthesize_window_state (window, @@ -2731,7 +2706,7 @@ gdk_event_translate (MSG *msg, ((GdkWindowObject *) window)->resize_count -= 1; if (((GdkWindowObject *) window)->extension_events != 0) - _gdk_input_configure_event (window); + _gdk_device_wintab_update_window_coords (window); return_val = TRUE; } @@ -3113,14 +3088,14 @@ gdk_event_translate (MSG *msg, break; case WM_DESTROY: - grab = _gdk_display_get_last_pointer_grab (_gdk_display); - if (grab != NULL) + if (pointer_grab != NULL) { - if (grab->window == window) + if (pointer_grab->window == window) gdk_pointer_ungrab (msg->time); } - if (_gdk_display->keyboard_grab.window == window) + if (keyboard_grab && + keyboard_grab->window == window) gdk_keyboard_ungrab (msg->time); if ((window != NULL) && (msg->hwnd != GetDesktopWindow ())) diff --git a/gdk/win32/gdkim-win32.c b/gdk/win32/gdkim-win32.c index b621721f54..3f038e0315 100644 --- a/gdk/win32/gdkim-win32.c +++ b/gdk/win32/gdkim-win32.c @@ -33,7 +33,6 @@ #include "gdkpixmap.h" #include "gdkinternals.h" -#include "gdki18n.h" #include "gdkwin32.h" gchar* diff --git a/gdk/win32/gdkimage-win32.c b/gdk/win32/gdkimage-win32.c index 5292f20622..de54884f36 100644 --- a/gdk/win32/gdkimage-win32.c +++ b/gdk/win32/gdkimage-win32.c @@ -163,41 +163,6 @@ _gdk_win32_new_image (GdkVisual *visual, return image; } -GdkImage * -gdk_image_new_bitmap (GdkVisual *visual, - gpointer data, - gint w, - gint h) -{ - GdkPixmap *pixmap; - GdkImage *image; - guchar *bits; - gint data_bpl = (w-1)/8 + 1; - gint i; - - pixmap = gdk_pixmap_new (NULL, w, h, 1); - - if (pixmap == NULL) - return NULL; - - GDK_NOTE (IMAGE, g_print ("gdk_image_new_bitmap: %dx%d=%p\n", - w, h, GDK_PIXMAP_HBITMAP (pixmap))); - - bits = GDK_PIXMAP_IMPL_WIN32 (GDK_PIXMAP_OBJECT (pixmap)->impl)->bits; - image = _gdk_win32_new_image (visual, w, h, 1, bits); - image->windowing_data = pixmap; - - if (data_bpl != image->bpl) - { - for (i = 0; i < h; i++) - memmove ((guchar *) image->mem + i*image->bpl, ((guchar *) data) + i*data_bpl, data_bpl); - } - else - memmove (image->mem, data, data_bpl*h); - - return image; -} - void _gdk_windowing_image_init (void) { diff --git a/gdk/win32/gdkinput-win32.c b/gdk/win32/gdkinput-win32.c deleted file mode 100644 index d02952dc1e..0000000000 --- a/gdk/win32/gdkinput-win32.c +++ /dev/null @@ -1,1392 +0,0 @@ -/* GDK - The GIMP Drawing Kit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * Copyright (C) 1998-2007 Tor Lillqvist - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#include "config.h" - -#include -#include -#include - -#include "gdk.h" -#include "gdkinput.h" -#include "gdkinternals.h" -#include "gdkprivate-win32.h" -#include "gdkinput-win32.h" - -#define PACKETDATA (PK_CONTEXT | PK_CURSOR | PK_BUTTONS | PK_X | PK_Y | PK_NORMAL_PRESSURE | PK_ORIENTATION) -/* We want everything in absolute mode */ -#define PACKETMODE (0) -#include - -#define DEBUG_WINTAB 1 /* Verbose debug messages enabled */ - -#define PROXIMITY_OUT_DELAY 200 /* In milliseconds, see set_ignore_core */ - -#define TWOPI (2.*G_PI) - -/* Forward declarations */ - -static GdkDevicePrivate *gdk_input_find_dev_from_ctx (HCTX hctx, - UINT id); -static GList *wintab_contexts = NULL; - -static GdkWindow *wintab_window = NULL; - -static GdkWindow *x_grab_window = NULL; /* Window that currently holds - * the extended inputs grab - */ -static GdkEventMask x_grab_mask; -static gboolean x_grab_owner_events; - -typedef UINT (WINAPI *t_WTInfoA) (UINT a, UINT b, LPVOID c); -typedef UINT (WINAPI *t_WTInfoW) (UINT a, UINT b, LPVOID c); -typedef BOOL (WINAPI *t_WTEnable) (HCTX a, BOOL b); -typedef HCTX (WINAPI *t_WTOpenA) (HWND a, LPLOGCONTEXTA b, BOOL c); -typedef BOOL (WINAPI *t_WTOverlap) (HCTX a, BOOL b); -typedef BOOL (WINAPI *t_WTPacket) (HCTX a, UINT b, LPVOID c); -typedef int (WINAPI *t_WTQueueSizeSet) (HCTX a, int b); - -static t_WTInfoA p_WTInfoA; -static t_WTInfoW p_WTInfoW; -static t_WTEnable p_WTEnable; -static t_WTOpenA p_WTOpenA; -static t_WTOverlap p_WTOverlap; -static t_WTPacket p_WTPacket; -static t_WTQueueSizeSet p_WTQueueSizeSet; - -static GdkDevicePrivate * -gdk_input_find_dev_from_ctx (HCTX hctx, - UINT cursor) -{ - GList *tmp_list = _gdk_input_devices; - GdkDevicePrivate *gdkdev; - - while (tmp_list) - { - gdkdev = (GdkDevicePrivate *) (tmp_list->data); - if (gdkdev->hctx == hctx && gdkdev->cursor == cursor) - return gdkdev; - tmp_list = tmp_list->next; - } - return NULL; -} - -#if DEBUG_WINTAB - -static void -print_lc(LOGCONTEXT *lc) -{ - g_print ("lcName = %s\n", lc->lcName); - g_print ("lcOptions ="); - if (lc->lcOptions & CXO_SYSTEM) g_print (" CXO_SYSTEM"); - if (lc->lcOptions & CXO_PEN) g_print (" CXO_PEN"); - if (lc->lcOptions & CXO_MESSAGES) g_print (" CXO_MESSAGES"); - if (lc->lcOptions & CXO_MARGIN) g_print (" CXO_MARGIN"); - if (lc->lcOptions & CXO_MGNINSIDE) g_print (" CXO_MGNINSIDE"); - if (lc->lcOptions & CXO_CSRMESSAGES) g_print (" CXO_CSRMESSAGES"); - g_print ("\n"); - g_print ("lcStatus ="); - if (lc->lcStatus & CXS_DISABLED) g_print (" CXS_DISABLED"); - if (lc->lcStatus & CXS_OBSCURED) g_print (" CXS_OBSCURED"); - if (lc->lcStatus & CXS_ONTOP) g_print (" CXS_ONTOP"); - g_print ("\n"); - g_print ("lcLocks ="); - if (lc->lcLocks & CXL_INSIZE) g_print (" CXL_INSIZE"); - if (lc->lcLocks & CXL_INASPECT) g_print (" CXL_INASPECT"); - if (lc->lcLocks & CXL_SENSITIVITY) g_print (" CXL_SENSITIVITY"); - if (lc->lcLocks & CXL_MARGIN) g_print (" CXL_MARGIN"); - g_print ("\n"); - g_print ("lcMsgBase = %#x, lcDevice = %#x, lcPktRate = %d\n", - lc->lcMsgBase, lc->lcDevice, lc->lcPktRate); - g_print ("lcPktData ="); - if (lc->lcPktData & PK_CONTEXT) g_print (" PK_CONTEXT"); - if (lc->lcPktData & PK_STATUS) g_print (" PK_STATUS"); - if (lc->lcPktData & PK_TIME) g_print (" PK_TIME"); - if (lc->lcPktData & PK_CHANGED) g_print (" PK_CHANGED"); - if (lc->lcPktData & PK_SERIAL_NUMBER) g_print (" PK_SERIAL_NUMBER"); - if (lc->lcPktData & PK_CURSOR) g_print (" PK_CURSOR"); - if (lc->lcPktData & PK_BUTTONS) g_print (" PK_BUTTONS"); - if (lc->lcPktData & PK_X) g_print (" PK_X"); - if (lc->lcPktData & PK_Y) g_print (" PK_Y"); - if (lc->lcPktData & PK_Z) g_print (" PK_Z"); - if (lc->lcPktData & PK_NORMAL_PRESSURE) g_print (" PK_NORMAL_PRESSURE"); - if (lc->lcPktData & PK_TANGENT_PRESSURE) g_print (" PK_TANGENT_PRESSURE"); - if (lc->lcPktData & PK_ORIENTATION) g_print (" PK_ORIENTATION"); - if (lc->lcPktData & PK_ROTATION) g_print (" PK_ROTATION"); - g_print ("\n"); - g_print ("lcPktMode ="); - if (lc->lcPktMode & PK_CONTEXT) g_print (" PK_CONTEXT"); - if (lc->lcPktMode & PK_STATUS) g_print (" PK_STATUS"); - if (lc->lcPktMode & PK_TIME) g_print (" PK_TIME"); - if (lc->lcPktMode & PK_CHANGED) g_print (" PK_CHANGED"); - if (lc->lcPktMode & PK_SERIAL_NUMBER) g_print (" PK_SERIAL_NUMBER"); - if (lc->lcPktMode & PK_CURSOR) g_print (" PK_CURSOR"); - if (lc->lcPktMode & PK_BUTTONS) g_print (" PK_BUTTONS"); - if (lc->lcPktMode & PK_X) g_print (" PK_X"); - if (lc->lcPktMode & PK_Y) g_print (" PK_Y"); - if (lc->lcPktMode & PK_Z) g_print (" PK_Z"); - if (lc->lcPktMode & PK_NORMAL_PRESSURE) g_print (" PK_NORMAL_PRESSURE"); - if (lc->lcPktMode & PK_TANGENT_PRESSURE) g_print (" PK_TANGENT_PRESSURE"); - if (lc->lcPktMode & PK_ORIENTATION) g_print (" PK_ORIENTATION"); - if (lc->lcPktMode & PK_ROTATION) g_print (" PK_ROTATION"); - g_print ("\n"); - g_print ("lcMoveMask ="); - if (lc->lcMoveMask & PK_CONTEXT) g_print (" PK_CONTEXT"); - if (lc->lcMoveMask & PK_STATUS) g_print (" PK_STATUS"); - if (lc->lcMoveMask & PK_TIME) g_print (" PK_TIME"); - if (lc->lcMoveMask & PK_CHANGED) g_print (" PK_CHANGED"); - if (lc->lcMoveMask & PK_SERIAL_NUMBER) g_print (" PK_SERIAL_NUMBER"); - if (lc->lcMoveMask & PK_CURSOR) g_print (" PK_CURSOR"); - if (lc->lcMoveMask & PK_BUTTONS) g_print (" PK_BUTTONS"); - if (lc->lcMoveMask & PK_X) g_print (" PK_X"); - if (lc->lcMoveMask & PK_Y) g_print (" PK_Y"); - if (lc->lcMoveMask & PK_Z) g_print (" PK_Z"); - if (lc->lcMoveMask & PK_NORMAL_PRESSURE) g_print (" PK_NORMAL_PRESSURE"); - if (lc->lcMoveMask & PK_TANGENT_PRESSURE) g_print (" PK_TANGENT_PRESSURE"); - if (lc->lcMoveMask & PK_ORIENTATION) g_print (" PK_ORIENTATION"); - if (lc->lcMoveMask & PK_ROTATION) g_print (" PK_ROTATION"); - g_print ("\n"); - g_print ("lcBtnDnMask = %#x, lcBtnUpMask = %#x\n", - (guint) lc->lcBtnDnMask, (guint) lc->lcBtnUpMask); - g_print ("lcInOrgX = %ld, lcInOrgY = %ld, lcInOrgZ = %ld\n", - lc->lcInOrgX, lc->lcInOrgY, lc->lcInOrgZ); - g_print ("lcInExtX = %ld, lcInExtY = %ld, lcInExtZ = %ld\n", - lc->lcInExtX, lc->lcInExtY, lc->lcInExtZ); - g_print ("lcOutOrgX = %ld, lcOutOrgY = %ld, lcOutOrgZ = %ld\n", - lc->lcOutOrgX, lc->lcOutOrgY, lc->lcOutOrgZ); - g_print ("lcOutExtX = %ld, lcOutExtY = %ld, lcOutExtZ = %ld\n", - lc->lcOutExtX, lc->lcOutExtY, lc->lcOutExtZ); - g_print ("lcSensX = %g, lcSensY = %g, lcSensZ = %g\n", - lc->lcSensX / 65536., lc->lcSensY / 65536., lc->lcSensZ / 65536.); - g_print ("lcSysMode = %d\n", lc->lcSysMode); - g_print ("lcSysOrgX = %d, lcSysOrgY = %d\n", - lc->lcSysOrgX, lc->lcSysOrgY); - g_print ("lcSysExtX = %d, lcSysExtY = %d\n", - lc->lcSysExtX, lc->lcSysExtY); - g_print ("lcSysSensX = %g, lcSysSensY = %g\n", - lc->lcSysSensX / 65536., lc->lcSysSensY / 65536.); -} - -static void -print_cursor (int index) -{ - int size; - int i; - char *name; - BOOL active; - WTPKT wtpkt; - BYTE buttons; - BYTE buttonbits; - char *btnnames; - char *p; - BYTE buttonmap[32]; - BYTE sysbtnmap[32]; - BYTE npbutton; - UINT npbtnmarks[2]; - UINT *npresponse; - BYTE tpbutton; - UINT tpbtnmarks[2]; - UINT *tpresponse; - DWORD physid; - UINT mode; - UINT minpktdata; - UINT minbuttons; - UINT capabilities; - - size = (*p_WTInfoA) (WTI_CURSORS + index, CSR_NAME, NULL); - name = g_malloc (size + 1); - (*p_WTInfoA) (WTI_CURSORS + index, CSR_NAME, name); - g_print ("NAME: %s\n", name); - (*p_WTInfoA) (WTI_CURSORS + index, CSR_ACTIVE, &active); - g_print ("ACTIVE: %s\n", active ? "YES" : "NO"); - (*p_WTInfoA) (WTI_CURSORS + index, CSR_PKTDATA, &wtpkt); - g_print ("PKTDATA: %#x:", (guint) wtpkt); -#define BIT(x) if (wtpkt & PK_##x) g_print (" " #x) - BIT (CONTEXT); - BIT (STATUS); - BIT (TIME); - BIT (CHANGED); - BIT (SERIAL_NUMBER); - BIT (BUTTONS); - BIT (X); - BIT (Y); - BIT (Z); - BIT (NORMAL_PRESSURE); - BIT (TANGENT_PRESSURE); - BIT (ORIENTATION); - BIT (ROTATION); -#undef BIT - g_print ("\n"); - (*p_WTInfoA) (WTI_CURSORS + index, CSR_BUTTONS, &buttons); - g_print ("BUTTONS: %d\n", buttons); - (*p_WTInfoA) (WTI_CURSORS + index, CSR_BUTTONBITS, &buttonbits); - g_print ("BUTTONBITS: %d\n", buttonbits); - size = (*p_WTInfoA) (WTI_CURSORS + index, CSR_BTNNAMES, NULL); - g_print ("BTNNAMES:"); - if (size > 0) - { - btnnames = g_malloc (size + 1); - (*p_WTInfoA) (WTI_CURSORS + index, CSR_BTNNAMES, btnnames); - p = btnnames; - while (*p) - { - g_print (" %s", p); - p += strlen (p) + 1; - } - } - g_print ("\n"); - (*p_WTInfoA) (WTI_CURSORS + index, CSR_BUTTONMAP, buttonmap); - g_print ("BUTTONMAP:"); - for (i = 0; i < buttons; i++) - g_print (" %d", buttonmap[i]); - g_print ("\n"); - (*p_WTInfoA) (WTI_CURSORS + index, CSR_SYSBTNMAP, sysbtnmap); - g_print ("SYSBTNMAP:"); - for (i = 0; i < buttons; i++) - g_print (" %d", sysbtnmap[i]); - g_print ("\n"); - (*p_WTInfoA) (WTI_CURSORS + index, CSR_NPBUTTON, &npbutton); - g_print ("NPBUTTON: %d\n", npbutton); - (*p_WTInfoA) (WTI_CURSORS + index, CSR_NPBTNMARKS, npbtnmarks); - g_print ("NPBTNMARKS: %d %d\n", npbtnmarks[0], npbtnmarks[1]); - size = (*p_WTInfoA) (WTI_CURSORS + index, CSR_NPRESPONSE, NULL); - g_print ("NPRESPONSE:"); - if (size > 0) - { - npresponse = g_malloc (size); - (*p_WTInfoA) (WTI_CURSORS + index, CSR_NPRESPONSE, npresponse); - for (i = 0; i < size / sizeof (UINT); i++) - g_print (" %d", npresponse[i]); - } - g_print ("\n"); - (*p_WTInfoA) (WTI_CURSORS + index, CSR_TPBUTTON, &tpbutton); - g_print ("TPBUTTON: %d\n", tpbutton); - (*p_WTInfoA) (WTI_CURSORS + index, CSR_TPBTNMARKS, tpbtnmarks); - g_print ("TPBTNMARKS: %d %d\n", tpbtnmarks[0], tpbtnmarks[1]); - size = (*p_WTInfoA) (WTI_CURSORS + index, CSR_TPRESPONSE, NULL); - g_print ("TPRESPONSE:"); - if (size > 0) - { - tpresponse = g_malloc (size); - (*p_WTInfoA) (WTI_CURSORS + index, CSR_TPRESPONSE, tpresponse); - for (i = 0; i < size / sizeof (UINT); i++) - g_print (" %d", tpresponse[i]); - } - g_print ("\n"); - (*p_WTInfoA) (WTI_CURSORS + index, CSR_PHYSID, &physid); - g_print ("PHYSID: %#x\n", (guint) physid); - (*p_WTInfoA) (WTI_CURSORS + index, CSR_CAPABILITIES, &capabilities); - g_print ("CAPABILITIES: %#x:", capabilities); -#define BIT(x) if (capabilities & CRC_##x) g_print (" " #x) - BIT (MULTIMODE); - BIT (AGGREGATE); - BIT (INVERT); -#undef BIT - g_print ("\n"); - if (capabilities & CRC_MULTIMODE) - { - (*p_WTInfoA) (WTI_CURSORS + index, CSR_MODE, &mode); - g_print ("MODE: %d\n", mode); - } - if (capabilities & CRC_AGGREGATE) - { - (*p_WTInfoA) (WTI_CURSORS + index, CSR_MINPKTDATA, &minpktdata); - g_print ("MINPKTDATA: %d\n", minpktdata); - (*p_WTInfoA) (WTI_CURSORS + index, CSR_MINBUTTONS, &minbuttons); - g_print ("MINBUTTONS: %d\n", minbuttons); - } -} -#endif - -void -_gdk_input_wintab_init_check (void) -{ - static gboolean wintab_initialized = FALSE; - GdkDevicePrivate *gdkdev; - GdkWindowAttr wa; - WORD specversion; - HCTX *hctx; - UINT ndevices, ncursors, ncsrtypes, firstcsr, hardware; - BOOL active; - DWORD physid; - AXIS axis_x, axis_y, axis_npressure, axis_or[3]; - int i, k; - int devix, cursorix; - wchar_t devname[100], csrname[100]; - gchar *devname_utf8, *csrname_utf8; - BOOL defcontext_done; - HMODULE wintab32; - - if (wintab_initialized) - return; - - wintab_initialized = TRUE; - - wintab_contexts = NULL; - - if (_gdk_input_ignore_wintab) - return; - - if ((wintab32 = LoadLibrary ("wintab32.dll")) == NULL) - return; - - if ((p_WTInfoA = (t_WTInfoA) GetProcAddress (wintab32, "WTInfoA")) == NULL) - return; - if ((p_WTInfoW = (t_WTInfoW) GetProcAddress (wintab32, "WTInfoW")) == NULL) - return; - if ((p_WTEnable = (t_WTEnable) GetProcAddress (wintab32, "WTEnable")) == NULL) - return; - if ((p_WTOpenA = (t_WTOpenA) GetProcAddress (wintab32, "WTOpenA")) == NULL) - return; - if ((p_WTOverlap = (t_WTOverlap) GetProcAddress (wintab32, "WTOverlap")) == NULL) - return; - if ((p_WTPacket = (t_WTPacket) GetProcAddress (wintab32, "WTPacket")) == NULL) - return; - if ((p_WTQueueSizeSet = (t_WTQueueSizeSet) GetProcAddress (wintab32, "WTQueueSizeSet")) == NULL) - return; - - if (!(*p_WTInfoA) (0, 0, NULL)) - return; - - (*p_WTInfoA) (WTI_INTERFACE, IFC_SPECVERSION, &specversion); - GDK_NOTE (INPUT, g_print ("Wintab interface version %d.%d\n", - HIBYTE (specversion), LOBYTE (specversion))); - (*p_WTInfoA) (WTI_INTERFACE, IFC_NDEVICES, &ndevices); - (*p_WTInfoA) (WTI_INTERFACE, IFC_NCURSORS, &ncursors); -#if DEBUG_WINTAB - GDK_NOTE (INPUT, g_print ("NDEVICES: %d, NCURSORS: %d\n", - ndevices, ncursors)); -#endif - /* Create a dummy window to receive wintab events */ - wa.wclass = GDK_INPUT_OUTPUT; - wa.event_mask = GDK_ALL_EVENTS_MASK; - wa.width = 2; - wa.height = 2; - wa.x = -100; - wa.y = -100; - wa.window_type = GDK_WINDOW_TOPLEVEL; - if ((wintab_window = gdk_window_new (NULL, &wa, GDK_WA_X|GDK_WA_Y)) == NULL) - { - g_warning ("gdk_input_wintab_init: gdk_window_new failed"); - return; - } - g_object_ref (wintab_window); - - for (devix = 0; devix < ndevices; devix++) - { - LOGCONTEXT lc; - - /* We open the Wintab device (hmm, what if there are several, or - * can there even be several, probably not?) as a system - * pointing device, i.e. it controls the normal Windows - * cursor. This seems much more natural. - */ - - (*p_WTInfoW) (WTI_DEVICES + devix, DVC_NAME, devname); - devname_utf8 = g_utf16_to_utf8 (devname, -1, NULL, NULL, NULL); -#ifdef DEBUG_WINTAB - GDK_NOTE (INPUT, (g_print("Device %d: %s\n", devix, devname_utf8))); -#endif - (*p_WTInfoA) (WTI_DEVICES + devix, DVC_NCSRTYPES, &ncsrtypes); - (*p_WTInfoA) (WTI_DEVICES + devix, DVC_FIRSTCSR, &firstcsr); - (*p_WTInfoA) (WTI_DEVICES + devix, DVC_HARDWARE, &hardware); - (*p_WTInfoA) (WTI_DEVICES + devix, DVC_X, &axis_x); - (*p_WTInfoA) (WTI_DEVICES + devix, DVC_Y, &axis_y); - (*p_WTInfoA) (WTI_DEVICES + devix, DVC_NPRESSURE, &axis_npressure); - (*p_WTInfoA) (WTI_DEVICES + devix, DVC_ORIENTATION, axis_or); - - defcontext_done = FALSE; - if (HIBYTE (specversion) > 1 || LOBYTE (specversion) >= 1) - { - /* Try to get device-specific default context */ - /* Some drivers, e.g. Aiptek, don't provide this info */ - if ((*p_WTInfoA) (WTI_DSCTXS + devix, 0, &lc) > 0) - defcontext_done = TRUE; -#if DEBUG_WINTAB - if (defcontext_done) - GDK_NOTE (INPUT, (g_print("Using device-specific default context\n"))); - else - GDK_NOTE (INPUT, (g_print("Note: Driver did not provide device specific default context info despite claiming to support version 1.1\n"))); -#endif - } - - if (!defcontext_done) - (*p_WTInfoA) (WTI_DEFSYSCTX, 0, &lc); -#if DEBUG_WINTAB - GDK_NOTE (INPUT, (g_print("Default context:\n"), print_lc(&lc))); -#endif - lc.lcOptions |= CXO_MESSAGES; - lc.lcStatus = 0; - lc.lcMsgBase = WT_DEFBASE; - lc.lcPktRate = 0; - lc.lcPktData = PACKETDATA; - lc.lcPktMode = PACKETMODE; - lc.lcMoveMask = PACKETDATA; - lc.lcBtnUpMask = lc.lcBtnDnMask = ~0; - lc.lcOutOrgX = axis_x.axMin; - lc.lcOutOrgY = axis_y.axMin; - lc.lcOutExtX = axis_x.axMax - axis_x.axMin; - lc.lcOutExtY = axis_y.axMax - axis_y.axMin; - lc.lcOutExtY = -lc.lcOutExtY; /* We want Y growing downward */ -#if DEBUG_WINTAB - GDK_NOTE (INPUT, (g_print("context for device %d:\n", devix), - print_lc(&lc))); -#endif - hctx = g_new (HCTX, 1); - if ((*hctx = (*p_WTOpenA) (GDK_WINDOW_HWND (wintab_window), &lc, TRUE)) == NULL) - { - g_warning ("gdk_input_wintab_init: WTOpen failed"); - return; - } - GDK_NOTE (INPUT, g_print ("opened Wintab device %d %p\n", - devix, *hctx)); - - wintab_contexts = g_list_append (wintab_contexts, hctx); -#if 0 - (*p_WTEnable) (*hctx, TRUE); -#endif - (*p_WTOverlap) (*hctx, TRUE); - -#if DEBUG_WINTAB - GDK_NOTE (INPUT, (g_print("context for device %d after WTOpen:\n", devix), - print_lc(&lc))); -#endif - /* Increase packet queue size to reduce the risk of lost packets. - * According to the specs, if the function fails we must try again - * with a smaller queue size. - */ - GDK_NOTE (INPUT, g_print("Attempting to increase queue size\n")); - for (i = 32; i >= 1; i >>= 1) - { - if ((*p_WTQueueSizeSet) (*hctx, i)) - { - GDK_NOTE (INPUT, g_print("Queue size set to %d\n", i)); - break; - } - } - if (!i) - GDK_NOTE (INPUT, g_print("Whoops, no queue size could be set\n")); - for (cursorix = firstcsr; cursorix < firstcsr + ncsrtypes; cursorix++) - { -#ifdef DEBUG_WINTAB - GDK_NOTE (INPUT, (g_print("Cursor %d:\n", cursorix), print_cursor (cursorix))); -#endif - active = FALSE; - (*p_WTInfoA) (WTI_CURSORS + cursorix, CSR_ACTIVE, &active); - if (!active) - continue; - - /* Wacom tablets seem to report cursors corresponding to - * nonexistent pens or pucks. At least my ArtPad II reports - * six cursors: a puck, pressure stylus and eraser stylus, - * and then the same three again. I only have a - * pressure-sensitive pen. The puck instances, and the - * second instances of the styluses report physid zero. So - * at least for Wacom, skip cursors with physid zero. - */ - (*p_WTInfoA) (WTI_CURSORS + cursorix, CSR_PHYSID, &physid); - if (wcscmp (devname, L"WACOM Tablet") == 0 && physid == 0) - continue; - - gdkdev = g_object_new (GDK_TYPE_DEVICE, NULL); - (*p_WTInfoW) (WTI_CURSORS + cursorix, CSR_NAME, csrname); - csrname_utf8 = g_utf16_to_utf8 (csrname, -1, NULL, NULL, NULL); - gdkdev->info.name = g_strconcat (devname_utf8, " ", csrname_utf8, NULL); - g_free (csrname_utf8); - gdkdev->info.source = GDK_SOURCE_PEN; - gdkdev->info.mode = GDK_MODE_SCREEN; - gdkdev->info.has_cursor = TRUE; - gdkdev->hctx = *hctx; - gdkdev->cursor = cursorix; - (*p_WTInfoA) (WTI_CURSORS + cursorix, CSR_PKTDATA, &gdkdev->pktdata); - gdkdev->info.num_axes = 0; - if (gdkdev->pktdata & PK_X) - gdkdev->info.num_axes++; - if (gdkdev->pktdata & PK_Y) - gdkdev->info.num_axes++; - if (gdkdev->pktdata & PK_NORMAL_PRESSURE) - gdkdev->info.num_axes++; - /* The wintab driver for the Wacom ArtPad II reports - * PK_ORIENTATION in CSR_PKTDATA, but the tablet doesn't - * actually sense tilt. Catch this by noticing that the - * orientation axis's azimuth resolution is zero. - */ - if ((gdkdev->pktdata & PK_ORIENTATION) - && axis_or[0].axResolution == 0) - gdkdev->pktdata &= ~PK_ORIENTATION; - - if (gdkdev->pktdata & PK_ORIENTATION) - gdkdev->info.num_axes += 2; /* x and y tilt */ - - gdkdev->info.axes = g_new (GdkDeviceAxis, gdkdev->info.num_axes); - gdkdev->axes = g_new (GdkAxisInfo, gdkdev->info.num_axes); - gdkdev->last_axis_data = g_new (gint, gdkdev->info.num_axes); - - k = 0; - if (gdkdev->pktdata & PK_X) - { - gdkdev->axes[k].resolution = axis_x.axResolution / 65535.; - gdkdev->axes[k].min_value = axis_x.axMin; - gdkdev->axes[k].max_value = axis_x.axMax; - gdkdev->info.axes[k].use = GDK_AXIS_X; - gdkdev->info.axes[k].min = axis_x.axMin; - gdkdev->info.axes[k].max = axis_x.axMax; - k++; - } - if (gdkdev->pktdata & PK_Y) - { - gdkdev->axes[k].resolution = axis_y.axResolution / 65535.; - gdkdev->axes[k].min_value = axis_y.axMin; - gdkdev->axes[k].max_value = axis_y.axMax; - gdkdev->info.axes[k].use = GDK_AXIS_Y; - gdkdev->info.axes[k].min = axis_y.axMin; - gdkdev->info.axes[k].max = axis_y.axMax; - k++; - } - if (gdkdev->pktdata & PK_NORMAL_PRESSURE) - { - gdkdev->axes[k].resolution = axis_npressure.axResolution / 65535.; - gdkdev->axes[k].min_value = axis_npressure.axMin; - gdkdev->axes[k].max_value = axis_npressure.axMax; - gdkdev->info.axes[k].use = GDK_AXIS_PRESSURE; - /* GIMP seems to expect values in the range 0-1 */ - gdkdev->info.axes[k].min = 0.0; /*axis_npressure.axMin;*/ - gdkdev->info.axes[k].max = 1.0; /*axis_npressure.axMax;*/ - k++; - } - if (gdkdev->pktdata & PK_ORIENTATION) - { - GdkAxisUse axis; - - gdkdev->orientation_axes[0] = axis_or[0]; - gdkdev->orientation_axes[1] = axis_or[1]; - for (axis = GDK_AXIS_XTILT; axis <= GDK_AXIS_YTILT; axis++) - { - /* Wintab gives us aximuth and altitude, which - * we convert to x and y tilt in the -1000..1000 range - */ - gdkdev->axes[k].resolution = 1000; - gdkdev->axes[k].min_value = -1000; - gdkdev->axes[k].max_value = 1000; - gdkdev->info.axes[k].use = axis; - gdkdev->info.axes[k].min = -1000; - gdkdev->info.axes[k].max = 1000; - k++; - } - } - gdkdev->info.num_keys = 0; - gdkdev->info.keys = NULL; - GDK_NOTE (INPUT, g_print ("device: (%d) %s axes: %d\n", - cursorix, - gdkdev->info.name, - gdkdev->info.num_axes)); - for (i = 0; i < gdkdev->info.num_axes; i++) - GDK_NOTE (INPUT, g_print ("... axis %d: %d--%d@%d\n", - i, - gdkdev->axes[i].min_value, - gdkdev->axes[i].max_value, - gdkdev->axes[i].resolution)); - _gdk_input_devices = g_list_append (_gdk_input_devices, - gdkdev); - } - g_free (devname_utf8); - } -} - -static void -decode_tilt (gint *axis_data, - AXIS *axes, - PACKET *packet) -{ - /* As I don't have a tilt-sensing tablet, - * I cannot test this code. - */ - - double az, el; - - az = TWOPI * packet->pkOrientation.orAzimuth / - (axes[0].axResolution / 65536.); - el = TWOPI * packet->pkOrientation.orAltitude / - (axes[1].axResolution / 65536.); - - /* X tilt */ - axis_data[0] = cos (az) * cos (el) * 1000; - /* Y tilt */ - axis_data[1] = sin (az) * cos (el) * 1000; -} - -static void -gdk_input_translate_coordinates (GdkDevicePrivate *gdkdev, - GdkInputWindow *input_window, - gint *axis_data, - gdouble *axis_out, - gdouble *x_out, - gdouble *y_out) -{ - GdkWindowImplWin32 *root_impl; - GdkWindowObject *window_object; - - int i; - int x_axis = 0; - int y_axis = 0; - - double device_width, device_height; - double x_offset, y_offset, x_scale, y_scale; - - window_object = GDK_WINDOW_OBJECT (input_window); - - for (i=0; iinfo.num_axes; i++) - { - switch (gdkdev->info.axes[i].use) - { - case GDK_AXIS_X: - x_axis = i; - break; - case GDK_AXIS_Y: - y_axis = i; - break; - default: - break; - } - } - - device_width = gdkdev->axes[x_axis].max_value - gdkdev->axes[x_axis].min_value; - device_height = gdkdev->axes[y_axis].max_value - gdkdev->axes[y_axis].min_value; - - if (gdkdev->info.mode == GDK_MODE_SCREEN) - { - root_impl = GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (_gdk_root)->impl); - x_scale = GDK_WINDOW_OBJECT (_gdk_root)->width / device_width; - y_scale = GDK_WINDOW_OBJECT (_gdk_root)->height / device_height; - - x_offset = - input_window->root_x; - y_offset = - input_window->root_y; - } - else /* GDK_MODE_WINDOW */ - { - double device_aspect = (device_height*gdkdev->axes[y_axis].resolution) / - (device_width*gdkdev->axes[x_axis].resolution); - - if (device_aspect * window_object->width >= window_object->height) - { - /* device taller than window */ - x_scale = window_object->width / device_width; - y_scale = (x_scale * gdkdev->axes[x_axis].resolution) / gdkdev->axes[y_axis].resolution; - - x_offset = 0; - y_offset = -(device_height * y_scale - window_object->height) / 2; - } - else - { - /* window taller than device */ - y_scale = window_object->height / device_height; - x_scale = (y_scale * gdkdev->axes[y_axis].resolution) - / gdkdev->axes[x_axis].resolution; - - y_offset = 0; - x_offset = - (device_width * x_scale - window_object->width) / 2; - } - } - - for (i = 0; i < gdkdev->info.num_axes; i++) - { - switch (gdkdev->info.axes[i].use) - { - case GDK_AXIS_X: - axis_out[i] = x_offset + x_scale * axis_data[x_axis]; - if (x_out) - *x_out = axis_out[i]; - break; - case GDK_AXIS_Y: - axis_out[i] = y_offset + y_scale * axis_data[y_axis]; - if (y_out) - *y_out = axis_out[i]; - break; - default: - axis_out[i] = - (gdkdev->info.axes[i].max * (axis_data[i] - gdkdev->axes[i].min_value) + - gdkdev->info.axes[i].min * (gdkdev->axes[i].max_value - axis_data[i])) / - (gdkdev->axes[i].max_value - gdkdev->axes[i].min_value); - break; - } - } -} - -static void -gdk_input_get_root_relative_geometry (HWND w, - int *x_ret, - int *y_ret) -{ - RECT rect; - - GetWindowRect (w, &rect); - - if (x_ret) - *x_ret = rect.left + _gdk_offset_x; - if (y_ret) - *y_ret = rect.top + _gdk_offset_y; -} - -void -_gdk_input_configure_event (GdkWindow *window) -{ - GdkInputWindow *input_window; - int root_x, root_y; - - input_window = _gdk_input_window_find (window); - g_return_if_fail (window != NULL); - - gdk_input_get_root_relative_geometry (GDK_WINDOW_HWND (window), - &root_x, &root_y); - - input_window->root_x = root_x; - input_window->root_y = root_y; -} - -void -_gdk_input_enter_event (GdkWindow *window) -{ - GdkInputWindow *input_window; - int root_x, root_y; - - input_window = _gdk_input_window_find (window); - g_return_if_fail (window != NULL); - - gdk_input_get_root_relative_geometry (GDK_WINDOW_HWND (window), &root_x, &root_y); - - input_window->root_x = root_x; - input_window->root_y = root_y; -} - -/* - * Get the currently active keyboard modifiers (ignoring the mouse buttons) - * We could use gdk_window_get_pointer but that function does a lot of other - * expensive things besides getting the modifiers. This code is somewhat based - * on build_pointer_event_state from gdkevents-win32.c - */ -static guint -get_modifier_key_state (void) -{ - guint state; - - state = 0; - /* High-order bit is up/down, low order bit is toggled/untoggled */ - if (GetKeyState (VK_CONTROL) < 0) - state |= GDK_CONTROL_MASK; - if (GetKeyState (VK_SHIFT) < 0) - state |= GDK_SHIFT_MASK; - if (GetKeyState (VK_MENU) < 0) - state |= GDK_MOD1_MASK; - if (GetKeyState (VK_CAPITAL) & 0x1) - state |= GDK_LOCK_MASK; - - return state; -} - -static guint ignore_core_timer = 0; - -static gboolean -ignore_core_timefunc (gpointer data) -{ - /* The delay has passed */ - _gdk_input_ignore_core = FALSE; - ignore_core_timer = 0; - - return FALSE; /* remove timeout */ -} - -/* - * Set or unset the _gdk_input_ignore_core variable that tells GDK - * to ignore events for the core pointer when the tablet is in proximity - * The unsetting is delayed slightly so that if a tablet event arrives - * just after proximity out, it does not cause a core pointer event - * which e.g. causes GIMP to switch tools. - */ -static void -set_ignore_core (gboolean ignore) -{ - if (ignore) - { - _gdk_input_ignore_core = TRUE; - /* Remove any pending clear */ - if (ignore_core_timer) - { - g_source_remove (ignore_core_timer); - ignore_core_timer = 0; - } - } - else - if (!ignore_core_timer) - ignore_core_timer = gdk_threads_add_timeout (PROXIMITY_OUT_DELAY, - ignore_core_timefunc, NULL); -} - -gboolean -_gdk_input_other_event (GdkEvent *event, - MSG *msg, - GdkWindow *window) -{ - GdkDisplay *display; - GdkWindowObject *obj, *grab_obj; - GdkInputWindow *input_window; - GdkDevicePrivate *gdkdev = NULL; - GdkEventMask masktest; - guint key_state; - POINT pt; - - PACKET packet; - gint k; - gint x, y; - guint translated_buttons, button_diff, button_mask; - /* Translation from tablet button state to GDK button state for - * buttons 1-3 - swap button 2 and 3. - */ - static guint button_map[8] = {0, 1, 4, 5, 2, 3, 6, 7}; - - if (event->any.window != wintab_window) - { - g_warning ("_gdk_input_other_event: not wintab_window?"); - return FALSE; - } - - window = gdk_window_at_pointer (&x, &y); - if (window == NULL) - window = _gdk_root; - - g_object_ref (window); - display = gdk_drawable_get_display (window); - - GDK_NOTE (EVENTS_OR_INPUT, - g_print ("_gdk_input_other_event: window=%p %+d%+d\n", - GDK_WINDOW_HWND (window), x, y)); - - if (msg->message == WT_PACKET) - { - if (!(*p_WTPacket) ((HCTX) msg->lParam, msg->wParam, &packet)) - return FALSE; - } - - obj = GDK_WINDOW_OBJECT (window); - - switch (msg->message) - { - case WT_PACKET: - /* Don't produce any button or motion events while a window is being - * moved or resized, see bug #151090. - */ - if (_modal_operation_in_progress) - { - GDK_NOTE (EVENTS_OR_INPUT, g_print ("... ignored when moving/sizing\n")); - return FALSE; - } - if (window == _gdk_root && x_grab_window == NULL) - { - GDK_NOTE (EVENTS_OR_INPUT, g_print ("... is root\n")); - return FALSE; - } - - if ((gdkdev = gdk_input_find_dev_from_ctx ((HCTX) msg->lParam, - packet.pkCursor)) == NULL) - return FALSE; - - if (gdkdev->info.mode == GDK_MODE_DISABLED) - return FALSE; - - k = 0; - if (gdkdev->pktdata & PK_X) - gdkdev->last_axis_data[k++] = packet.pkX; - if (gdkdev->pktdata & PK_Y) - gdkdev->last_axis_data[k++] = packet.pkY; - if (gdkdev->pktdata & PK_NORMAL_PRESSURE) - gdkdev->last_axis_data[k++] = packet.pkNormalPressure; - if (gdkdev->pktdata & PK_ORIENTATION) - { - decode_tilt (gdkdev->last_axis_data + k, - gdkdev->orientation_axes, &packet); - k += 2; - } - - g_assert (k == gdkdev->info.num_axes); - - translated_buttons = button_map[packet.pkButtons & 0x07] | (packet.pkButtons & ~0x07); - - if (translated_buttons != gdkdev->button_state) - { - /* At least one button has changed state so produce a button event - * If more than one button has changed state (unlikely), - * just care about the first and act on the next the next time - * we get a packet - */ - button_diff = translated_buttons ^ gdkdev->button_state; - - /* Gdk buttons are numbered 1.. */ - event->button.button = 1; - - for (button_mask = 1; button_mask != 0x80000000; - button_mask <<= 1, event->button.button++) - { - if (button_diff & button_mask) - { - /* Found a button that has changed state */ - break; - } - } - - if (!(translated_buttons & button_mask)) - { - event->any.type = GDK_BUTTON_RELEASE; - masktest = GDK_BUTTON_RELEASE_MASK; - } - else - { - event->any.type = GDK_BUTTON_PRESS; - masktest = GDK_BUTTON_PRESS_MASK; - } - gdkdev->button_state ^= button_mask; - } - else - { - event->any.type = GDK_MOTION_NOTIFY; - masktest = GDK_POINTER_MOTION_MASK; - if (gdkdev->button_state & (1 << 0)) - masktest |= GDK_BUTTON_MOTION_MASK | GDK_BUTTON1_MOTION_MASK; - if (gdkdev->button_state & (1 << 1)) - masktest |= GDK_BUTTON_MOTION_MASK | GDK_BUTTON2_MOTION_MASK; - if (gdkdev->button_state & (1 << 2)) - masktest |= GDK_BUTTON_MOTION_MASK | GDK_BUTTON3_MOTION_MASK; - } - - /* See if input is grabbed */ - /* FIXME: x_grab_owner_events should probably be handled somehow */ - if (x_grab_window != NULL) - { - grab_obj = GDK_WINDOW_OBJECT (x_grab_window); - if (!GDK_WINDOW_IMPL_WIN32 (grab_obj->impl)->extension_events_selected - || !(grab_obj->extension_events & masktest) - || !(x_grab_mask && masktest)) - { - GDK_NOTE (EVENTS_OR_INPUT, - g_print ("... grabber doesn't want it\n")); - return FALSE; - } - GDK_NOTE (EVENTS_OR_INPUT, g_print ("... to grabber\n")); - - g_object_ref(x_grab_window); - g_object_unref(window); - window = x_grab_window; - obj = grab_obj; - } - /* Now we can check if the window wants the event, and - * propagate if necessary. - */ - loop: - if (!GDK_WINDOW_IMPL_WIN32 (obj->impl)->extension_events_selected - || !(obj->extension_events & masktest)) - { - GDK_NOTE (EVENTS_OR_INPUT, g_print ("... not selected\n")); - - if (obj->parent == GDK_WINDOW_OBJECT (_gdk_root)) - return FALSE; - - /* It is not good to propagate the extended events up to the parent - * if this window wants normal (not extended) motion/button events */ - if (obj->event_mask & masktest) - { - GDK_NOTE (EVENTS_OR_INPUT, - g_print ("... wants ordinary event, ignoring this\n")); - return FALSE; - } - - pt.x = x; - pt.y = y; - ClientToScreen (GDK_WINDOW_HWND (window), &pt); - g_object_unref (window); - window = (GdkWindow *) obj->parent; - obj = GDK_WINDOW_OBJECT (window); - g_object_ref (window); - ScreenToClient (GDK_WINDOW_HWND (window), &pt); - x = pt.x; - y = pt.y; - GDK_NOTE (EVENTS_OR_INPUT, g_print ("... propagating to %p %+d%+d\n", - GDK_WINDOW_HWND (window), x, y)); - goto loop; - } - - input_window = _gdk_input_window_find (window); - - g_assert (input_window != NULL); - - if (gdkdev->info.mode == GDK_MODE_WINDOW - && input_window->mode == GDK_EXTENSION_EVENTS_CURSOR) - return FALSE; - - event->any.window = window; - key_state = get_modifier_key_state (); - if (event->any.type == GDK_BUTTON_PRESS - || event->any.type == GDK_BUTTON_RELEASE) - { - event->button.time = _gdk_win32_get_next_tick (msg->time); - event->button.device = &gdkdev->info; - - event->button.axes = g_new(gdouble, gdkdev->info.num_axes); - - gdk_input_translate_coordinates (gdkdev, input_window, - gdkdev->last_axis_data, - event->button.axes, - &event->button.x, - &event->button.y); - - /* Also calculate root coordinates. Note that input_window->root_x - is in GDK root coordinates. */ - event->button.x_root = event->button.x + input_window->root_x; - event->button.y_root = event->button.y + input_window->root_y; - - event->button.state = ((gdkdev->button_state << 8) - & (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK - | GDK_BUTTON3_MASK | GDK_BUTTON4_MASK - | GDK_BUTTON5_MASK)) - | key_state; - GDK_NOTE (EVENTS_OR_INPUT, - g_print ("WINTAB button %s:%d %g,%g\n", - (event->button.type == GDK_BUTTON_PRESS ? - "press" : "release"), - event->button.button, - event->button.x, event->button.y)); - } - else - { - event->motion.time = _gdk_win32_get_next_tick (msg->time); - event->motion.is_hint = FALSE; - event->motion.device = &gdkdev->info; - - event->motion.axes = g_new(gdouble, gdkdev->info.num_axes); - - gdk_input_translate_coordinates (gdkdev, input_window, - gdkdev->last_axis_data, - event->motion.axes, - &event->motion.x, - &event->motion.y); - - /* Also calculate root coordinates. Note that input_window->root_x - is in GDK root coordinates. */ - event->motion.x_root = event->motion.x + input_window->root_x; - event->motion.y_root = event->motion.y + input_window->root_y; - - event->motion.state = ((gdkdev->button_state << 8) - & (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK - | GDK_BUTTON3_MASK | GDK_BUTTON4_MASK - | GDK_BUTTON5_MASK)) - | key_state; - - GDK_NOTE (EVENTS_OR_INPUT, - g_print ("WINTAB motion: %g,%g\n", - event->motion.x, event->motion.y)); - } - return TRUE; - - case WT_PROXIMITY: - if (LOWORD (msg->lParam) == 0) - { - event->proximity.type = GDK_PROXIMITY_OUT; - set_ignore_core (FALSE); - } - else - { - event->proximity.type = GDK_PROXIMITY_IN; - set_ignore_core (TRUE); - } - event->proximity.time = _gdk_win32_get_next_tick (msg->time); - event->proximity.device = &gdkdev->info; - - GDK_NOTE (EVENTS_OR_INPUT, - g_print ("WINTAB proximity %s\n", - (event->proximity.type == GDK_PROXIMITY_IN ? - "in" : "out"))); - return TRUE; - } - return FALSE; -} - -gboolean -_gdk_input_enable_window (GdkWindow *window, - GdkDevicePrivate *gdkdev) -{ - GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (window)->impl); - - impl->extension_events_selected = TRUE; - - return TRUE; -} - -gboolean -_gdk_input_disable_window (GdkWindow *window, - GdkDevicePrivate *gdkdev) -{ - GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (window)->impl); - - impl->extension_events_selected = FALSE; - - return TRUE; -} - -gint -_gdk_input_grab_pointer (GdkWindow *window, - gint owner_events, - GdkEventMask event_mask, - GdkWindow *confine_to, - guint32 time) -{ - GdkInputWindow *input_window, *new_window; - gboolean need_ungrab; - GdkDevicePrivate *gdkdev; - GList *tmp_list; - - tmp_list = _gdk_input_windows; - new_window = NULL; - need_ungrab = FALSE; - - GDK_NOTE (INPUT, g_print ("_gdk_input_grab_pointer: %p %d %p\n", - GDK_WINDOW_HWND (window), - owner_events, - (confine_to ? GDK_WINDOW_HWND (confine_to) : 0))); - - while (tmp_list) - { - input_window = (GdkInputWindow *)tmp_list->data; - - if (input_window->window == window) - new_window = input_window; - else if (input_window->grabbed) - { - input_window->grabbed = FALSE; - need_ungrab = TRUE; - } - - tmp_list = tmp_list->next; - } - - if (new_window) - { - new_window->grabbed = TRUE; - x_grab_window = window; - x_grab_mask = event_mask; - x_grab_owner_events = owner_events; - - /* FIXME: Do we need to handle confine_to and time? */ - - tmp_list = _gdk_input_devices; - while (tmp_list) - { - gdkdev = (GdkDevicePrivate *)tmp_list->data; - if (!GDK_IS_CORE (gdkdev) && gdkdev->hctx) - { -#if 0 - /* XXX */ - gdk_input_common_find_events (window, gdkdev, - event_mask, - event_classes, &num_classes); - - result = XGrabDevice( GDK_DISPLAY(), gdkdev->xdevice, - GDK_WINDOW_XWINDOW (window), - owner_events, num_classes, event_classes, - GrabModeAsync, GrabModeAsync, time); - - /* FIXME: if failure occurs on something other than the first - device, things will be badly inconsistent */ - if (result != Success) - return result; -#endif - } - tmp_list = tmp_list->next; - } - } - else - { - x_grab_window = NULL; -#if 0 - tmp_list = _gdk_input_devices; - while (tmp_list) - { - gdkdev = (GdkDevicePrivate *)tmp_list->data; - if (!GDK_IS_CORE (gdkdev) && gdkdev->hctx && - ((gdkdev->button_state != 0) || need_ungrab)) - { -#if 0 - /* XXX */ - XUngrabDevice (gdk_display, gdkdev->xdevice, time); -#endif - gdkdev->button_state = 0; - } - - tmp_list = tmp_list->next; - } -#endif - } - - return GDK_GRAB_SUCCESS; -} - -void -_gdk_input_ungrab_pointer (guint32 time) -{ - GdkInputWindow *input_window; - GdkDevicePrivate *gdkdev; - GList *tmp_list; - - GDK_NOTE (INPUT, g_print ("_gdk_input_ungrab_pointer\n")); - - tmp_list = _gdk_input_windows; - while (tmp_list) - { - input_window = (GdkInputWindow *)tmp_list->data; - if (input_window->grabbed) - break; - tmp_list = tmp_list->next; - } - - if (tmp_list) /* we found a grabbed window */ - { - input_window->grabbed = FALSE; - - tmp_list = _gdk_input_devices; - while (tmp_list) - { - gdkdev = (GdkDevicePrivate *)tmp_list->data; -#if 0 - /* XXX */ - if (!GDK_IS_CORE (gdkdev) && gdkdev->xdevice) - XUngrabDevice (gdk_display, gdkdev->xdevice, time); -#endif - tmp_list = tmp_list->next; - } - } - x_grab_window = NULL; -} - -gboolean -_gdk_device_get_history (GdkDevice *device, - GdkWindow *window, - guint32 start, - guint32 stop, - GdkTimeCoord ***events, - gint *n_events) -{ - return FALSE; -} - -void -gdk_device_get_state (GdkDevice *device, - GdkWindow *window, - gdouble *axes, - GdkModifierType *mask) -{ - g_return_if_fail (device != NULL); - g_return_if_fail (GDK_IS_WINDOW (window)); - - if (GDK_IS_CORE (device)) - { - gint x_int, y_int; - - gdk_window_get_pointer (window, &x_int, &y_int, mask); - - if (axes) - { - axes[0] = x_int; - axes[1] = y_int; - } - } - else - { - GdkDevicePrivate *gdkdev; - GdkInputWindow *input_window; - - gdkdev = (GdkDevicePrivate *)device; - /* For now just use the last known button and axis state of the device. - * Since graphical tablets send an insane amount of motion events each - * second, the info should be fairly up to date */ - if (mask) - { - gdk_window_get_pointer (window, NULL, NULL, mask); - *mask &= 0xFF; /* Mask away core pointer buttons */ - *mask |= ((gdkdev->button_state << 8) - & (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK - | GDK_BUTTON3_MASK | GDK_BUTTON4_MASK - | GDK_BUTTON5_MASK)); - } - input_window = _gdk_input_window_find (window); - g_return_if_fail (input_window != NULL); - /* For some reason, input_window is sometimes NULL when I use The GIMP 2 - * (bug #141543?). Avoid crashing if debugging is disabled. */ - if (axes && gdkdev->last_axis_data && input_window) - gdk_input_translate_coordinates (gdkdev, input_window, - gdkdev->last_axis_data, - axes, NULL, NULL); - } -} - -void -_gdk_input_set_tablet_active (void) -{ - GList *tmp_list; - HCTX *hctx; - - /* Bring the contexts to the top of the overlap order when one of the - * application's windows is activated */ - - if (!wintab_contexts) - return; /* No tablet devices found, or Wintab not initialized yet */ - - GDK_NOTE (INPUT, g_print ("_gdk_input_set_tablet_active: " - "Bringing Wintab contexts to the top of the overlap order\n")); - - tmp_list = wintab_contexts; - while (tmp_list) - { - hctx = (HCTX *) (tmp_list->data); - (*p_WTOverlap) (*hctx, TRUE); - tmp_list = tmp_list->next; - } -} - -void -_gdk_input_init (GdkDisplay *display) -{ - _gdk_input_ignore_core = FALSE; - _gdk_input_devices = NULL; - - _gdk_init_input_core (display); -#ifdef WINTAB_NO_LAZY_INIT - /* Normally, Wintab is only initialized when the application performs - * an action that requires it, such as enabling extended input events - * for a window or enumerating the devices. - */ - _gdk_input_wintab_init_check (); -#endif /* WINTAB_NO_LAZY_INIT */ - - _gdk_input_devices = g_list_append (_gdk_input_devices, display->core_pointer); -} - diff --git a/gdk/win32/gdkinput-win32.h b/gdk/win32/gdkinput-win32.h deleted file mode 100644 index 608d8f99d6..0000000000 --- a/gdk/win32/gdkinput-win32.h +++ /dev/null @@ -1,147 +0,0 @@ -/* GDK - The GIMP Drawing Kit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-1999. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#ifndef __GDK_INPUT_WIN32_H__ -#define __GDK_INPUT_WIN32_H__ - -#include -#include - -typedef struct _GdkAxisInfo GdkAxisInfo; -typedef struct _GdkDevicePrivate GdkDevicePrivate; - -/* information about a device axis */ -struct _GdkAxisInfo -{ - /* calibrated resolution (for aspect ratio) - only relative values - between axes used */ - gint resolution; - - /* calibrated minimum/maximum values */ - gint min_value, max_value; -}; - -struct _GdkDeviceClass -{ - GObjectClass parent_class; -}; - -struct _GdkDevicePrivate -{ - GdkDevice info; - - /* information about the axes */ - GdkAxisInfo *axes; - - gint button_state; - - gint *last_axis_data; - - /* WINTAB stuff: */ - HCTX hctx; - /* Cursor number */ - UINT cursor; - /* The cursor's CSR_PKTDATA */ - WTPKT pktdata; - /* Azimuth and altitude axis */ - AXIS orientation_axes[2]; -}; - -struct _GdkInputWindow -{ - /* gdk window */ - GdkWindow *window; - - /* Extension mode (GDK_EXTENSION_EVENTS_ALL/CURSOR) */ - GdkExtensionMode mode; - - /* position relative to root window */ - gint root_x; - gint root_y; - - /* rectangles relative to window of windows obscuring this one */ - GdkRectangle *obscuring; - gint num_obscuring; - - /* Is there a pointer grab for this window ? */ - gint grabbed; -}; - -/* Global data */ - -#define GDK_IS_CORE(d) (((GdkDevice *)(d)) == gdk_display_get_default ()->core_pointer) - -extern GList *_gdk_input_devices; -extern GList *_gdk_input_windows; - -extern gint _gdk_input_ignore_core; - -/* Function declarations */ -void _gdk_init_input_core (GdkDisplay *display); - -GdkTimeCoord ** _gdk_device_allocate_history (GdkDevice *device, - gint n_events); - -/* The following functions are provided by each implementation - * (just wintab for now) - */ -void _gdk_input_configure_event (GdkWindow *window); -void _gdk_input_enter_event (GdkWindow *window); -gboolean _gdk_input_other_event (GdkEvent *event, - MSG *msg, - GdkWindow *window); - -void _gdk_input_crossing_event (GdkWindow *window, - gboolean enter); - - -/* These should be in gdkinternals.h */ - -GdkInputWindow *_gdk_input_window_find (GdkWindow *window); - -void _gdk_input_window_destroy (GdkWindow *window); - -gint _gdk_input_enable_window (GdkWindow *window, - GdkDevicePrivate *gdkdev); -gint _gdk_input_disable_window (GdkWindow *window, - GdkDevicePrivate *gdkdev); -gint _gdk_input_grab_pointer (GdkWindow *window, - gint owner_events, - GdkEventMask event_mask, - GdkWindow *confine_to, - guint32 time); -void _gdk_input_ungrab_pointer (guint32 time); -gboolean _gdk_device_get_history (GdkDevice *device, - GdkWindow *window, - guint32 start, - guint32 stop, - GdkTimeCoord ***events, - gint *n_events); - -void _gdk_input_wintab_init_check (void); -void _gdk_input_set_tablet_active (void); - -#endif /* __GDK_INPUT_WIN32_H__ */ diff --git a/gdk/win32/gdkinput.c b/gdk/win32/gdkinput.c index ca8b33a494..32de7fc28d 100644 --- a/gdk/win32/gdkinput.c +++ b/gdk/win32/gdkinput.c @@ -37,63 +37,13 @@ #include "gdkinput.h" #include "gdkprivate-win32.h" -#include "gdkinput-win32.h" - -static GdkDeviceAxis gdk_input_core_axes[] = { - { GDK_AXIS_X, 0, 0 }, - { GDK_AXIS_Y, 0, 0 } -}; - -/* Global variables */ +#include "gdkdevicemanager-win32.h" gint _gdk_input_ignore_core; GList *_gdk_input_devices; GList *_gdk_input_windows; -void -_gdk_init_input_core (GdkDisplay *display) -{ - display->core_pointer = g_object_new (GDK_TYPE_DEVICE, NULL); - - display->core_pointer->name = "Core Pointer"; - display->core_pointer->source = GDK_SOURCE_MOUSE; - display->core_pointer->mode = GDK_MODE_SCREEN; - display->core_pointer->has_cursor = TRUE; - display->core_pointer->num_axes = 2; - display->core_pointer->axes = gdk_input_core_axes; - display->core_pointer->num_keys = 0; - display->core_pointer->keys = NULL; -} - -GType -gdk_device_get_type (void) -{ - static GType object_type = 0; - - if (!object_type) - { - const GTypeInfo object_info = - { - sizeof (GdkDeviceClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) NULL, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (GdkDevicePrivate), - 0, /* n_preallocs */ - (GInstanceInitFunc) NULL, - }; - - object_type = g_type_register_static (G_TYPE_OBJECT, - g_intern_static_string ("GdkDevice"), - &object_info, 0); - } - - return object_type; -} - GList * gdk_devices_list (void) { @@ -105,126 +55,9 @@ gdk_display_list_devices (GdkDisplay *dpy) { g_return_val_if_fail (dpy == _gdk_display, NULL); - _gdk_input_wintab_init_check (); return _gdk_input_devices; } -void -gdk_device_set_source (GdkDevice *device, - GdkInputSource source) -{ - g_return_if_fail (device != NULL); - - device->source = source; -} - -void -gdk_device_set_key (GdkDevice *device, - guint index, - guint keyval, - GdkModifierType modifiers) -{ - g_return_if_fail (device != NULL); - g_return_if_fail (index < device->num_keys); - - device->keys[index].keyval = keyval; - device->keys[index].modifiers = modifiers; -} - -void -gdk_device_set_axis_use (GdkDevice *device, - guint index, - GdkAxisUse use) -{ - g_return_if_fail (device != NULL); - g_return_if_fail (index < device->num_axes); - - device->axes[index].use = use; - - switch (use) - { - case GDK_AXIS_X: - case GDK_AXIS_Y: - device->axes[index].min = 0.; - device->axes[index].max = 0.; - break; - case GDK_AXIS_XTILT: - case GDK_AXIS_YTILT: - device->axes[index].min = -1.; - device->axes[index].max = 1; - break; - default: - device->axes[index].min = 0.; - device->axes[index].max = 1; - break; - } -} - -gboolean -gdk_device_get_history (GdkDevice *device, - GdkWindow *window, - guint32 start, - guint32 stop, - GdkTimeCoord ***events, - gint *n_events) -{ - g_return_val_if_fail (window != NULL, FALSE); - g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE); - g_return_val_if_fail (events != NULL, FALSE); - g_return_val_if_fail (n_events != NULL, FALSE); - - if (n_events) - *n_events = 0; - if (events) - *events = NULL; - - if (GDK_WINDOW_DESTROYED (window)) - return FALSE; - - if (GDK_IS_CORE (device)) - return FALSE; - else - return _gdk_device_get_history (device, window, start, stop, events, n_events); -} - -GdkTimeCoord ** -_gdk_device_allocate_history (GdkDevice *device, - gint n_events) -{ - GdkTimeCoord **result = g_new (GdkTimeCoord *, n_events); - gint i; - - for (i=0; inum_axes)); - - return result; -} - -void -gdk_device_free_history (GdkTimeCoord **events, - gint n_events) -{ - gint i; - - for (i=0; inext) - if (((GdkInputWindow *)(tmp_list->data))->window == window) - return (GdkInputWindow *)(tmp_list->data); - - return NULL; /* Not found */ -} - /* FIXME: this routine currently needs to be called between creation and the corresponding configure event (because it doesn't get the root_relative_geometry). This should work with @@ -233,212 +66,60 @@ _gdk_input_window_find(GdkWindow *window) void gdk_input_set_extension_events (GdkWindow *window, gint mask, - GdkExtensionMode mode) + GdkExtensionMode mode) { + GdkDeviceManager *device_manager; GdkWindowObject *window_private; - GList *tmp_list; - GdkInputWindow *iw; + GList *devices, *d; - g_return_if_fail (window != NULL); g_return_if_fail (GDK_IS_WINDOW (window)); - window_private = (GdkWindowObject*) window; if (GDK_WINDOW_DESTROYED (window)) return; if (mode == GDK_EXTENSION_EVENTS_NONE) mask = 0; - if (mask != 0) + window_private = (GdkWindowObject *) window; + window_private->extension_events = mask; + + device_manager = gdk_display_get_device_manager (_gdk_display); + devices = gdk_device_manager_list_devices (device_manager, + GDK_DEVICE_TYPE_FLOATING); + + for (d = devices; d; d = d->next) { - _gdk_input_wintab_init_check (); + GdkDevice *dev; + gint dev_mask; - iw = g_new(GdkInputWindow,1); + dev = d->data; + dev_mask = mask; - iw->window = window; - iw->mode = mode; + if (gdk_device_get_mode (dev) == GDK_MODE_DISABLED || + (!gdk_device_get_has_cursor (dev) && mode == GDK_EXTENSION_EVENTS_CURSOR)) + dev_mask = 0; - iw->obscuring = NULL; - iw->num_obscuring = 0; - iw->grabbed = FALSE; - - _gdk_input_windows = g_list_append(_gdk_input_windows,iw); - window_private->extension_events = mask; - - /* Add enter window events to the event mask */ - if (g_list_length (_gdk_input_devices) > 1) - gdk_window_set_events (window, - gdk_window_get_events (window) | - GDK_ENTER_NOTIFY_MASK); - } - else - { - iw = _gdk_input_window_find (window); - if (iw) - { - _gdk_input_windows = g_list_remove(_gdk_input_windows,iw); - g_free(iw); - } - - window_private->extension_events = 0; + gdk_window_set_device_events (window, dev, mask); } - for (tmp_list = _gdk_input_devices; tmp_list; tmp_list = tmp_list->next) - { - GdkDevicePrivate *gdkdev = tmp_list->data; - - if (!GDK_IS_CORE (gdkdev)) - { - if (mask != 0 && gdkdev->info.mode != GDK_MODE_DISABLED - && (gdkdev->info.has_cursor || mode == GDK_EXTENSION_EVENTS_ALL)) - _gdk_input_enable_window (window,gdkdev); - else - _gdk_input_disable_window (window,gdkdev); - } - } + g_list_free (devices); } void -_gdk_input_window_destroy (GdkWindow *window) +_gdk_input_init (GdkDisplay *display) { - GdkInputWindow *input_window; + GdkDeviceManagerWin32 *device_manager; - input_window = _gdk_input_window_find (window); - g_return_if_fail (input_window != NULL); + _gdk_input_ignore_core = FALSE; - _gdk_input_windows = g_list_remove (_gdk_input_windows,input_window); - g_free(input_window); -} - -void -_gdk_input_crossing_event (GdkWindow *window, - gboolean enter) -{ - if (enter) - { -#if 0 /* No idea what to do... */ - GdkWindowObject *priv = (GdkWindowObject *)window; - GdkInputWindow *input_window; - gint root_x, root_y; -#if 0 - gdk_input_check_proximity(display); -#endif - input_window = priv->input_window; - if (input_window != NULL) - { - _gdk_input_get_root_relative_geometry (window, &root_x, &root_y); - input_window->root_x = root_x; - input_window->root_y = root_y; - } -#endif - } - else - _gdk_input_ignore_core = FALSE; -} - -void -_gdk_input_exit (void) -{ - GList *tmp_list; - GdkDevicePrivate *gdkdev; - - for (tmp_list = _gdk_input_devices; tmp_list; tmp_list = tmp_list->next) - { - gdkdev = (GdkDevicePrivate *)(tmp_list->data); - if (!GDK_IS_CORE (gdkdev)) - { - gdk_device_set_mode (&gdkdev->info, GDK_MODE_DISABLED); - - g_free(gdkdev->info.name); - g_free(gdkdev->axes); - g_free(gdkdev->info.axes); - g_free(gdkdev->info.keys); - g_free(gdkdev); - } - } - - g_list_free(_gdk_input_devices); - - for (tmp_list = _gdk_input_windows; tmp_list; tmp_list = tmp_list->next) - g_free(tmp_list->data); - - g_list_free(_gdk_input_windows); -} - -gboolean -gdk_device_get_axis (GdkDevice *device, - gdouble *axes, - GdkAxisUse use, - gdouble *value) -{ - gint i; - - g_return_val_if_fail (device != NULL, FALSE); - - if (axes == NULL) - return FALSE; - - for (i=0; inum_axes; i++) - if (device->axes[i].use == use) - { - if (value) - *value = axes[i]; - return TRUE; - } - - return FALSE; -} - -gboolean -gdk_device_set_mode (GdkDevice *device, - GdkInputMode mode) -{ - GList *tmp_list; - GdkDevicePrivate *gdkdev; - GdkInputMode old_mode; - GdkInputWindow *input_window; - - if (GDK_IS_CORE (device)) - return FALSE; - - gdkdev = (GdkDevicePrivate *)device; - - if (device->mode == mode) - return TRUE; - - old_mode = device->mode; - device->mode = mode; - - if (mode == GDK_MODE_WINDOW) - { - device->has_cursor = FALSE; - for (tmp_list = _gdk_input_windows; tmp_list; tmp_list = tmp_list->next) - { - input_window = (GdkInputWindow *)tmp_list->data; - if (input_window->mode != GDK_EXTENSION_EVENTS_CURSOR) - _gdk_input_enable_window (input_window->window, gdkdev); - else - if (old_mode != GDK_MODE_DISABLED) - _gdk_input_disable_window (input_window->window, gdkdev); - } - } - else if (mode == GDK_MODE_SCREEN) - { - device->has_cursor = TRUE; - for (tmp_list = _gdk_input_windows; tmp_list; tmp_list = tmp_list->next) - _gdk_input_enable_window (((GdkInputWindow *)tmp_list->data)->window, - gdkdev); - } - else /* mode == GDK_MODE_DISABLED */ - { - for (tmp_list = _gdk_input_windows; tmp_list; tmp_list = tmp_list->next) - { - input_window = (GdkInputWindow *)tmp_list->data; - if (old_mode != GDK_MODE_WINDOW || - input_window->mode != GDK_EXTENSION_EVENTS_CURSOR) - _gdk_input_disable_window (input_window->window, gdkdev); - } - } - - return TRUE; + device_manager = g_object_new (GDK_TYPE_DEVICE_MANAGER_WIN32, + "display", display, + NULL); + display->device_manager = GDK_DEVICE_MANAGER (device_manager); + + display->core_pointer = device_manager->core_pointer; + + _gdk_input_devices = g_list_append (NULL, display->core_pointer); + _gdk_input_devices = g_list_concat (_gdk_input_devices, + g_list_copy (device_manager->wintab_devices)); } diff --git a/gdk/win32/gdkmain-win32.c b/gdk/win32/gdkmain-win32.c index 94b7ac793c..e2fd628c82 100644 --- a/gdk/win32/gdkmain-win32.c +++ b/gdk/win32/gdkmain-win32.c @@ -39,10 +39,11 @@ #include "gdkinternals.h" #include "gdkintl.h" #include "gdkprivate-win32.h" -#include "gdkinput-win32.h" #include +#include +#include #include static gboolean gdk_synchronize = FALSE; @@ -151,18 +152,6 @@ _gdk_other_api_failed (const gchar *where, g_warning ("%s: %s failed", where, api); } -void -gdk_set_use_xshm (gboolean use_xshm) -{ - /* Always on */ -} - -gboolean -gdk_get_use_xshm (void) -{ - return TRUE; -} - gint gdk_screen_get_width (GdkScreen *screen) { diff --git a/gdk/win32/gdkwin32.h b/gdk/win32/gdkwin32.h index bf1fd4b160..401bca8fd1 100644 --- a/gdk/win32/gdkwin32.h +++ b/gdk/win32/gdkwin32.h @@ -41,8 +41,6 @@ G_BEGIN_DECLS #include "gdkprivate-win32.h" -#undef GDK_ROOT_PARENT /* internal access is direct */ -#define GDK_ROOT_PARENT() ((GdkWindow *) _gdk_parent_root) #define GDK_WINDOW_HWND(win) (GDK_DRAWABLE_IMPL_WIN32(((GdkWindowObject *)win)->impl)->handle) #define GDK_PIXMAP_HBITMAP(pixmap) (GDK_DRAWABLE_IMPL_WIN32(((GdkPixmapObject *)pixmap)->impl)->handle) #define GDK_DRAWABLE_IMPL_WIN32_HANDLE(d) (((GdkDrawableImplWin32 *) d)->handle) diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c index 598d291ed1..d44d8f464e 100644 --- a/gdk/win32/gdkwindow-win32.c +++ b/gdk/win32/gdkwindow-win32.c @@ -33,7 +33,8 @@ #include "gdk.h" #include "gdkwindowimpl.h" #include "gdkprivate-win32.h" -#include "gdkinput-win32.h" +#include "gdkdeviceprivate.h" +#include "gdkdevicemanager-win32.h" #include "gdkenumtypes.h" static GdkColormap* gdk_window_impl_win32_get_colormap (GdkDrawable *drawable); @@ -787,9 +788,6 @@ _gdk_win32_window_destroy (GdkWindow *window, GDK_NOTE (MISC, g_print ("_gdk_win32_window_destroy: %p\n", GDK_WINDOW_HWND (window))); - if (private->extension_events != 0) - _gdk_input_window_destroy (window); - /* Remove ourself from the modal stack */ _gdk_remove_modal_window (window); @@ -1460,52 +1458,6 @@ gdk_win32_window_lower (GdkWindow *window) } } -void -gdk_window_set_hints (GdkWindow *window, - gint x, - gint y, - gint min_width, - gint min_height, - gint max_width, - gint max_height, - gint flags) -{ - /* Note that this function is obsolete */ - - GdkWindowImplWin32 *impl; - - g_return_if_fail (GDK_IS_WINDOW (window)); - - if (GDK_WINDOW_DESTROYED (window)) - return; - - impl = GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (window)->impl); - - GDK_NOTE (MISC, g_print ("gdk_window_set_hints: %p: %dx%d..%dx%d @%+d%+d\n", - GDK_WINDOW_HWND (window), - min_width, min_height, max_width, max_height, - x, y)); - - if (flags) - { - GdkGeometry geom; - gint geom_mask = 0; - - geom.min_width = min_width; - geom.min_height = min_height; - geom.max_width = max_width; - geom.max_height = max_height; - - if (flags & GDK_HINT_MIN_SIZE) - geom_mask |= GDK_HINT_MIN_SIZE; - - if (flags & GDK_HINT_MAX_SIZE) - geom_mask |= GDK_HINT_MAX_SIZE; - - gdk_window_set_geometry_hints (window, &geom, geom_mask); - } -} - void gdk_window_set_urgency_hint (GdkWindow *window, gboolean urgent) @@ -1875,12 +1827,12 @@ gdk_win32_window_set_back_pixmap (GdkWindow *window, } static void -gdk_win32_window_set_cursor (GdkWindow *window, - GdkCursor *cursor) +gdk_win32_window_set_device_cursor (GdkWindow *window, + GdkDevice *device, + GdkCursor *cursor) { GdkWindowImplWin32 *impl; GdkCursorPrivate *cursor_private; - GdkWindowObject *parent_window; HCURSOR hcursor; HCURSOR hprevcursor; @@ -1905,6 +1857,8 @@ gdk_win32_window_set_cursor (GdkWindow *window, */ hprevcursor = impl->hcursor; + GDK_DEVICE_GET_CLASS (device)->set_window_cursor (device, window, cursor); + if (hcursor == NULL) impl->hcursor = NULL; else @@ -1921,62 +1875,10 @@ gdk_win32_window_set_cursor (GdkWindow *window, hcursor, impl->hcursor)); } - if (impl->hcursor != NULL) - { - /* If the pointer is over our window, set new cursor */ - GdkWindow *curr_window = gdk_window_get_pointer (window, NULL, NULL, NULL); - if (curr_window == window || - (curr_window && window == gdk_window_get_toplevel (curr_window))) - SetCursor (impl->hcursor); - else - { - /* Climb up the tree and find whether our window is the - * first ancestor that has cursor defined, and if so, set - * new cursor. - */ - GdkWindowObject *curr_window_obj = GDK_WINDOW_OBJECT (curr_window); - while (curr_window_obj && - !GDK_WINDOW_IMPL_WIN32 (curr_window_obj->impl)->hcursor) - { - curr_window_obj = curr_window_obj->parent; - if (curr_window_obj == GDK_WINDOW_OBJECT (window)) - { - SetCursor (impl->hcursor); - break; - } - } - } - } - - /* Destroy the previous cursor: Need to make sure it's no longer in - * use before we destroy it, in case we're not over our window but - * the cursor is still set to our old one. - */ + /* Destroy the previous cursor */ if (hprevcursor != NULL) { - if (GetCursor () == hprevcursor) - { - /* Look for a suitable cursor to use instead */ - hcursor = NULL; - parent_window = GDK_WINDOW_OBJECT (window)->parent; - while (hcursor == NULL) - { - if (parent_window) - { - impl = GDK_WINDOW_IMPL_WIN32 (parent_window->impl); - hcursor = impl->hcursor; - parent_window = parent_window->parent; - } - else - { - hcursor = LoadCursor (NULL, IDC_ARROW); - } - } - SetCursor (hcursor); - } - GDK_NOTE (MISC, g_print ("... DestroyCursor (%p)\n", hprevcursor)); - API_CALL (DestroyCursor, (hprevcursor)); } } @@ -2159,87 +2061,43 @@ gdk_window_get_frame_extents (GdkWindow *window, r.left, r.top)); } - -static GdkModifierType -get_current_mask (void) -{ - GdkModifierType mask; - BYTE kbd[256]; - - GetKeyboardState (kbd); - mask = 0; - if (kbd[VK_SHIFT] & 0x80) - mask |= GDK_SHIFT_MASK; - if (kbd[VK_CAPITAL] & 0x80) - mask |= GDK_LOCK_MASK; - if (kbd[VK_CONTROL] & 0x80) - mask |= GDK_CONTROL_MASK; - if (kbd[VK_MENU] & 0x80) - mask |= GDK_MOD1_MASK; - if (kbd[VK_LBUTTON] & 0x80) - mask |= GDK_BUTTON1_MASK; - if (kbd[VK_MBUTTON] & 0x80) - mask |= GDK_BUTTON2_MASK; - if (kbd[VK_RBUTTON] & 0x80) - mask |= GDK_BUTTON3_MASK; - - return mask; -} - static gboolean -gdk_window_win32_get_pointer (GdkWindow *window, - gint *x, - gint *y, - GdkModifierType *mask) +gdk_window_win32_get_device_state (GdkWindow *window, + GdkDevice *device, + gint *x, + gint *y, + GdkModifierType *mask) { - gboolean return_val; - POINT point; - HWND hwnd, hwndc; + GdkWindow *child; g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), FALSE); - - return_val = TRUE; - hwnd = GDK_WINDOW_HWND (window); - GetCursorPos (&point); - ScreenToClient (hwnd, &point); - - *x = point.x; - *y = point.y; - - if (window == _gdk_root) - { - *x += _gdk_offset_x; - *y += _gdk_offset_y; - } - - hwndc = ChildWindowFromPoint (hwnd, point); - if (hwndc != NULL && hwndc != hwnd && - !gdk_win32_handle_table_lookup ((GdkNativeWindow) hwndc)) - return_val = FALSE; /* Direct child unknown to gdk */ - - *mask = get_current_mask (); - - return return_val; + GDK_DEVICE_GET_CLASS (device)->query_state (device, window, + NULL, &child, + NULL, NULL, + x, y, mask); + return (child != NULL); } void -_gdk_windowing_get_pointer (GdkDisplay *display, - GdkScreen **screen, - gint *x, - gint *y, - GdkModifierType *mask) +_gdk_windowing_get_device_state (GdkDisplay *display, + GdkDevice *device, + GdkScreen **screen, + gint *x, + gint *y, + GdkModifierType *mask) { - POINT point; - g_return_if_fail (display == _gdk_display); - - *screen = _gdk_screen; - GetCursorPos (&point); - *x = point.x + _gdk_offset_x; - *y = point.y + _gdk_offset_y; - *mask = get_current_mask (); + if (screen) + *screen = _gdk_screen; + + GDK_DEVICE_GET_CLASS (device)->query_state (device, + gdk_screen_get_root_window (_gdk_screen), + NULL, NULL, + x, y, + NULL, NULL, + mask); } void @@ -2248,64 +2106,40 @@ gdk_display_warp_pointer (GdkDisplay *display, gint x, gint y) { + GdkDeviceManagerWin32 *device_manager; + g_return_if_fail (display == _gdk_display); g_return_if_fail (screen == _gdk_screen); - SetCursorPos (x - _gdk_offset_x, y - _gdk_offset_y); + device_manager = GDK_DEVICE_MANAGER_WIN32 (gdk_display_get_device_manager (display)); + GDK_DEVICE_GET_CLASS (device_manager->core_pointer)->warp (device_manager->core_pointer, + screen, x, y); +} + +void +gdk_display_warp_device (GdkDisplay *display, + GdkDevice *device, + GdkScreen *screen, + gint x, + gint y) +{ + g_return_if_fail (display == _gdk_display); + g_return_if_fail (screen == _gdk_screen); + g_return_if_fail (GDK_IS_DEVICE (device)); + g_return_if_fail (display == gdk_device_get_display (device)); + + GDK_DEVICE_GET_CLASS (device)->warp (device, screen, x, y); } GdkWindow* -_gdk_windowing_window_at_pointer (GdkDisplay *display, - gint *win_x, - gint *win_y, - GdkModifierType *mask, - gboolean get_toplevel) +_gdk_windowing_window_at_device_position (GdkDisplay *display, + GdkDevice *device, + gint *win_x, + gint *win_y, + GdkModifierType *mask, + gboolean get_toplevel) { - GdkWindow *window; - POINT point, pointc; - HWND hwnd, hwndc; - RECT rect; - - GetCursorPos (&pointc); - point = pointc; - hwnd = WindowFromPoint (point); - - if (hwnd == NULL) - { - window = _gdk_root; - *win_x = pointc.x + _gdk_offset_x; - *win_y = pointc.y + _gdk_offset_y; - return window; - } - - ScreenToClient (hwnd, &point); - - do { - if (get_toplevel && - (window = gdk_win32_handle_table_lookup ((GdkNativeWindow) hwnd)) != NULL && - GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN) - break; - - hwndc = ChildWindowFromPoint (hwnd, point); - ClientToScreen (hwnd, &point); - ScreenToClient (hwndc, &point); - } while (hwndc != hwnd && (hwnd = hwndc, 1)); - - window = gdk_win32_handle_table_lookup ((GdkNativeWindow) hwnd); - - if (window && (win_x || win_y)) - { - GetClientRect (hwnd, &rect); - *win_x = point.x - rect.left; - *win_y = point.y - rect.top; - } - - GDK_NOTE (MISC, g_print ("_gdk_windowing_window_at_pointer: %+d%+d %p%s\n", - *win_x, *win_y, - hwnd, - (window == NULL ? " NULL" : ""))); - - return window; + return GDK_DEVICE_GET_CLASS (device)->window_at_position (device, win_x, win_y, mask, get_toplevel); } static GdkEventMask @@ -3531,9 +3365,9 @@ gdk_window_impl_iface_init (GdkWindowImplIface *iface) iface->set_background = gdk_win32_window_set_background; iface->set_back_pixmap = gdk_win32_window_set_back_pixmap; iface->reparent = gdk_win32_window_reparent; - iface->set_cursor = gdk_win32_window_set_cursor; + iface->set_device_cursor = gdk_win32_window_set_device_cursor; iface->get_geometry = gdk_win32_window_get_geometry; - iface->get_pointer = gdk_window_win32_get_pointer; + iface->get_device_state = gdk_window_win32_get_device_state; iface->get_root_coords = gdk_win32_window_get_root_coords; iface->shape_combine_region = gdk_win32_window_shape_combine_region; iface->input_shape_combine_region = gdk_win32_input_shape_combine_region; @@ -3542,6 +3376,4 @@ gdk_window_impl_iface_init (GdkWindowImplIface *iface) iface->queue_antiexpose = _gdk_win32_window_queue_antiexpose; iface->queue_translation = _gdk_win32_window_queue_translation; iface->destroy = _gdk_win32_window_destroy; - iface->input_window_destroy = _gdk_input_window_destroy; - iface->input_window_crossing = _gdk_input_crossing_event; } diff --git a/gdk/x11/Makefile.am b/gdk/x11/Makefile.am index 5d41ec8f3f..2502ac180f 100644 --- a/gdk/x11/Makefile.am +++ b/gdk/x11/Makefile.am @@ -1,7 +1,7 @@ ## Process this file with automake to produce Makefile.in include $(top_srcdir)/Makefile.decl -libgdkincludedir = $(includedir)/gtk-2.0/gdk +libgdkincludedir = $(includedir)/gtk-3.0/gdk INCLUDES = \ -DG_LOG_DOMAIN=\"Gdk\" \ @@ -23,19 +23,27 @@ libgdk_x11_la_SOURCES = \ gdkasync.h \ gdkcolor-x11.c \ gdkcursor-x11.c \ + gdkdevice-core.h \ + gdkdevice-core.c \ + gdkdevicemanager-core.h \ + gdkdevicemanager-core.c \ + gdkdevicemanager-x11.c \ gdkdisplay-x11.c \ gdkdisplay-x11.h \ gdkdnd-x11.c \ gdkdrawable-x11.c \ gdkdrawable-x11.h \ - gdkevents-x11.c \ + gdkeventsource.c \ + gdkeventsource.h \ + gdkeventtranslator.c \ + gdkeventtranslator.h \ gdkfont-x11.c \ gdkgc-x11.c \ gdkgeometry-x11.c \ gdkglobals-x11.c \ gdkim-x11.c \ gdkimage-x11.c \ - gdkinput.c \ + gdkinput.c \ gdkkeys-x11.c \ gdkmain-x11.c \ gdkpixmap-x11.c \ @@ -53,16 +61,24 @@ libgdk_x11_la_SOURCES = \ gdkxid.c \ gdkx.h \ gdkprivate-x11.h \ - gdkinputprivate.h \ xsettings-client.h \ xsettings-client.c \ xsettings-common.h \ xsettings-common.c if XINPUT_XFREE -libgdk_x11_la_SOURCES += gdkinput-x11.c gdkinput-xfree.c -else -libgdk_x11_la_SOURCES += gdkinput-none.c +libgdk_x11_la_SOURCES += \ + gdkdevicemanager-xi.c \ + gdkdevicemanager-xi.h \ + gdkdevice-xi.c \ + gdkdevice-xi.h +if XINPUT_2 +libgdk_x11_la_SOURCES += \ + gdkdevicemanager-xi2.c \ + gdkdevicemanager-xi2.h \ + gdkdevice-xi2.c \ + gdkdevice-xi2.h +endif endif @@ -78,9 +94,6 @@ TESTS = checksettings # We need to include all these C files here since the conditionals # don't seem to be correctly expanded for the dist files. EXTRA_DIST += \ - gdkinput-x11.c \ - gdkinput-xfree.c \ - gdkinput-none.c \ gdksettings.c -include $(top_srcdir)/git.mk diff --git a/gdk/x11/gdkcolor-x11.c b/gdk/x11/gdkcolor-x11.c index 4fc75b9979..e71038f713 100644 --- a/gdk/x11/gdkcolor-x11.c +++ b/gdk/x11/gdkcolor-x11.c @@ -68,6 +68,9 @@ static void gdk_colormap_sync (GdkColormap *colormap, static void gdk_colormap_finalize (GObject *object); +static void gdk_colormap_change (GdkColormap *colormap, + gint ncolors); + G_DEFINE_TYPE (GdkColormap, gdk_colormap, G_TYPE_OBJECT) static void @@ -408,23 +411,7 @@ gdk_screen_get_system_colormap (GdkScreen *screen) return colormap; } -/** - * gdk_colormap_get_system_size: - * - * Returns the size of the system's default colormap. - * (See the description of struct #GdkColormap for an - * explanation of the size of a colormap.) - * - * Return value: the size of the system's default colormap. - **/ -gint -gdk_colormap_get_system_size (void) -{ - return DisplayCells (GDK_SCREEN_XDISPLAY (gdk_screen_get_default()), - GDK_SCREEN_X11 (gdk_screen_get_default())->screen_num); -} - -/** +/* * gdk_colormap_change: * @colormap: a #GdkColormap. * @ncolors: the number of colors to change. @@ -432,9 +419,9 @@ gdk_colormap_get_system_size (void) * Changes the value of the first @ncolors in a private colormap * to match the values in the colors * array in the colormap. This function is obsolete and - * should not be used. See gdk_color_change(). - **/ -void + * should not be used. + */ +static void gdk_colormap_change (GdkColormap *colormap, gint ncolors) { @@ -523,123 +510,6 @@ gdk_colormap_change (GdkColormap *colormap, g_free (palette); } -/** - * gdk_colors_alloc: - * @colormap: a #GdkColormap. - * @contiguous: if %TRUE, the colors should be allocated - * in contiguous color cells. - * @planes: an array in which to store the plane masks. - * @nplanes: the number of planes to allocate. (Or zero, - * to indicate that the color allocation should not be planar.) - * @pixels: an array into which to store allocated pixel values. - * @npixels: the number of pixels in each plane to allocate. - * - * Allocates colors from a colormap. This function - * is obsolete. See gdk_colormap_alloc_colors(). - * For full documentation of the fields, see - * the Xlib documentation for XAllocColorCells(). - * - * Return value: %TRUE if the allocation was successful - **/ -gboolean -gdk_colors_alloc (GdkColormap *colormap, - gboolean contiguous, - gulong *planes, - gint nplanes, - gulong *pixels, - gint npixels) -{ - GdkColormapPrivateX11 *private; - gint return_val; - gint i; - - g_return_val_if_fail (GDK_IS_COLORMAP (colormap), FALSE); - - private = GDK_COLORMAP_PRIVATE_DATA (colormap); - - if (private->screen->closed) - return FALSE; - - return_val = XAllocColorCells (GDK_SCREEN_XDISPLAY (private->screen), - private->xcolormap,contiguous, planes, - nplanes, pixels, npixels); - if (return_val) - { - for (i = 0; i < npixels; i++) - { - private->info[pixels[i]].ref_count++; - private->info[pixels[i]].flags |= GDK_COLOR_WRITEABLE; - } - } - - return return_val != 0; -} - -/* This is almost identical to gdk_colormap_free_colors. - * Keep them in sync! - */ - - -/** - * gdk_colors_free: - * @colormap: a #GdkColormap. - * @pixels: the pixel values of the colors to free. - * @npixels: the number of values in @pixels. - * @planes: the plane masks for all planes to free, OR'd together. - * - * Frees colors allocated with gdk_colors_alloc(). This - * function is obsolete. See gdk_colormap_free_colors(). - **/ -void -gdk_colors_free (GdkColormap *colormap, - gulong *pixels, - gint npixels, - gulong planes) -{ - GdkColormapPrivateX11 *private; - gulong *pixels_to_free; - gint npixels_to_free = 0; - gint i; - - g_return_if_fail (GDK_IS_COLORMAP (colormap)); - g_return_if_fail (pixels != NULL); - - private = GDK_COLORMAP_PRIVATE_DATA (colormap); - - if ((colormap->visual->type != GDK_VISUAL_PSEUDO_COLOR) && - (colormap->visual->type != GDK_VISUAL_GRAYSCALE)) - return; - - pixels_to_free = g_new (gulong, npixels); - - for (i = 0; i < npixels; i++) - { - gulong pixel = pixels[i]; - - if (private->info[pixel].ref_count) - { - private->info[pixel].ref_count--; - - if (private->info[pixel].ref_count == 0) - { - pixels_to_free[npixels_to_free++] = pixel; - if (!(private->info[pixel].flags & GDK_COLOR_WRITEABLE)) - g_hash_table_remove (private->hash, &colormap->colors[pixel]); - private->info[pixel].flags = 0; - } - } - } - - if (npixels_to_free && !private->private_val && !private->screen->closed) - XFreeColors (GDK_SCREEN_XDISPLAY (private->screen), private->xcolormap, - pixels_to_free, npixels_to_free, planes); - g_free (pixels_to_free); -} - -/* This is almost identical to gdk_colors_free. - * Keep them in sync! - */ - /** * gdk_colormap_free_colors: * @colormap: a #GdkColormap. @@ -1039,17 +909,16 @@ gdk_colormap_alloc_colors_pseudocolor (GdkColormap *colormap, * @colors: The color values to allocate. On return, the pixel * values for allocated colors will be filled in. * @n_colors: The number of colors in @colors. - * @writeable: If %TRUE, the colors are allocated writeable - * (their values can later be changed using gdk_color_change()). - * Writeable colors cannot be shared between applications. + * @writeable: this parameter has no effect, and it's here for mere + * compatibility. * @best_match: If %TRUE, GDK will attempt to do matching against * existing colors if the colors cannot be allocated as requested. * @success: An array of length @ncolors. On return, this * indicates whether the corresponding color in @colors was * successfully allocated or not. - * + * * Allocates colors from a colormap. - * + * * Return value: The number of colors that were not successfully * allocated. **/ @@ -1208,44 +1077,6 @@ gdk_colormap_query_color (GdkColormap *colormap, } } -/** - * gdk_color_change: - * @colormap: a #GdkColormap. - * @color: a #GdkColor, with the color to change - * in the pixel field, - * and the new value in the remaining fields. - * - * Changes the value of a color that has already - * been allocated. If @colormap is not a private - * colormap, then the color must have been allocated - * using gdk_colormap_alloc_colors() with the - * @writeable set to %TRUE. - * - * Return value: %TRUE if the color was successfully changed. - **/ -gboolean -gdk_color_change (GdkColormap *colormap, - GdkColor *color) -{ - GdkColormapPrivateX11 *private; - XColor xcolor; - - g_return_val_if_fail (GDK_IS_COLORMAP (colormap), FALSE); - g_return_val_if_fail (color != NULL, FALSE); - - xcolor.pixel = color->pixel; - xcolor.red = color->red; - xcolor.green = color->green; - xcolor.blue = color->blue; - xcolor.flags = DoRed | DoGreen | DoBlue; - - private = GDK_COLORMAP_PRIVATE_DATA (colormap); - if (!private->screen->closed) - XStoreColor (GDK_SCREEN_XDISPLAY (private->screen), private->xcolormap, &xcolor); - - return TRUE; -} - /** * gdk_x11_colormap_foreign_new: * @visual: a #GdkVisual @@ -1320,41 +1151,6 @@ gdk_x11_colormap_foreign_new (GdkVisual *visual, } -/** - * gdkx_colormap_get: - * @xcolormap: the XID of a colormap for the default screen. - * - * Returns a #GdkColormap corresponding to a X colormap; - * this function only works if the colormap is already - * known to GTK+ (a colormap created by GTK+ or the default - * colormap for the screen), since GTK+ - * - * Always use gdk_x11_colormap_foreign_new() instead. - * - * Return value: the existing #GdkColormap object if it was - * already known to GTK+, otherwise warns and return - * %NULL. - **/ -GdkColormap* -gdkx_colormap_get (Colormap xcolormap) -{ - GdkScreen *screen = gdk_screen_get_default (); - GdkColormap *colormap; - - if (xcolormap == DefaultColormap (GDK_SCREEN_XDISPLAY (screen), - GDK_SCREEN_XNUMBER (screen))) - return g_object_ref (gdk_screen_get_system_colormap (screen)); - - colormap = gdk_colormap_lookup (screen, xcolormap); - if (colormap) - return g_object_ref (colormap); - - g_warning ("Colormap passed to gdkx_colormap_get\n" - "does not previously exist"); - - return NULL; -} - static gint gdk_colormap_match_color (GdkColormap *cmap, GdkColor *color, diff --git a/gdk/x11/gdkdevice-core.c b/gdk/x11/gdkdevice-core.c new file mode 100644 index 0000000000..7ff8c4d8a4 --- /dev/null +++ b/gdk/x11/gdkdevice-core.c @@ -0,0 +1,501 @@ +/* GDK - The GIMP Drawing Kit + * Copyright (C) 2009 Carlos Garnacho + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include +#include "gdkdevice-core.h" +#include "gdkprivate-x11.h" +#include "gdkx.h" + +static gboolean gdk_device_core_get_history (GdkDevice *device, + GdkWindow *window, + guint32 start, + guint32 stop, + GdkTimeCoord ***events, + guint *n_events); +static void gdk_device_core_get_state (GdkDevice *device, + GdkWindow *window, + gdouble *axes, + GdkModifierType *mask); +static void gdk_device_core_set_window_cursor (GdkDevice *device, + GdkWindow *window, + GdkCursor *cursor); +static void gdk_device_core_warp (GdkDevice *device, + GdkScreen *screen, + gint x, + gint y); +static gboolean gdk_device_core_query_state (GdkDevice *device, + GdkWindow *window, + GdkWindow **root_window, + GdkWindow **child_window, + gint *root_x, + gint *root_y, + gint *win_x, + gint *win_y, + GdkModifierType *mask); +static GdkGrabStatus gdk_device_core_grab (GdkDevice *device, + GdkWindow *window, + gboolean owner_events, + GdkEventMask event_mask, + GdkWindow *confine_to, + GdkCursor *cursor, + guint32 time_); +static void gdk_device_core_ungrab (GdkDevice *device, + guint32 time_); +static GdkWindow * gdk_device_core_window_at_position (GdkDevice *device, + gint *win_x, + gint *win_y, + GdkModifierType *mask, + gboolean get_toplevel); +static void gdk_device_core_select_window_events (GdkDevice *device, + GdkWindow *window, + GdkEventMask event_mask); + + +G_DEFINE_TYPE (GdkDeviceCore, gdk_device_core, GDK_TYPE_DEVICE) + +static void +gdk_device_core_class_init (GdkDeviceCoreClass *klass) +{ + GdkDeviceClass *device_class = GDK_DEVICE_CLASS (klass); + + device_class->get_history = gdk_device_core_get_history; + device_class->get_state = gdk_device_core_get_state; + device_class->set_window_cursor = gdk_device_core_set_window_cursor; + device_class->warp = gdk_device_core_warp; + device_class->query_state = gdk_device_core_query_state; + device_class->grab = gdk_device_core_grab; + device_class->ungrab = gdk_device_core_ungrab; + device_class->window_at_position = gdk_device_core_window_at_position; + device_class->select_window_events = gdk_device_core_select_window_events; +} + +static void +gdk_device_core_init (GdkDeviceCore *device_core) +{ + GdkDevice *device; + + device = GDK_DEVICE (device_core); + + _gdk_device_add_axis (device, GDK_NONE, GDK_AXIS_X, 0, 0, 1); + _gdk_device_add_axis (device, GDK_NONE, GDK_AXIS_Y, 0, 0, 1); +} + +static gboolean +impl_coord_in_window (GdkWindow *window, + int impl_x, + int impl_y) +{ + GdkWindowObject *priv = (GdkWindowObject *) window; + + if (impl_x < priv->abs_x || + impl_x > priv->abs_x + priv->width) + return FALSE; + + if (impl_y < priv->abs_y || + impl_y > priv->abs_y + priv->height) + return FALSE; + + return TRUE; +} + +static gboolean +gdk_device_core_get_history (GdkDevice *device, + GdkWindow *window, + guint32 start, + guint32 stop, + GdkTimeCoord ***events, + guint *n_events) +{ + GdkWindowObject *priv; + XTimeCoord *xcoords; + GdkTimeCoord **coords; + GdkWindow *impl_window; + int tmp_n_events; + int i, j; + + impl_window = _gdk_window_get_impl_window (window); + xcoords = XGetMotionEvents (GDK_DRAWABLE_XDISPLAY (window), + GDK_DRAWABLE_XID (impl_window), + start, stop, &tmp_n_events); + if (!xcoords) + return FALSE; + + priv = (GdkWindowObject *) window; + coords = _gdk_device_allocate_history (device, tmp_n_events); + + for (i = 0, j = 0; i < tmp_n_events; i++) + { + if (impl_coord_in_window (window, xcoords[i].x, xcoords[i].y)) + { + coords[j]->time = xcoords[i].time; + coords[j]->axes[0] = xcoords[i].x - priv->abs_x; + coords[j]->axes[1] = xcoords[i].y - priv->abs_y; + j++; + } + } + + XFree (xcoords); + + /* free the events we allocated too much */ + for (i = j; i < tmp_n_events; i++) + { + g_free (coords[i]); + coords[i] = NULL; + } + + tmp_n_events = j; + + if (tmp_n_events == 0) + { + gdk_device_free_history (coords, tmp_n_events); + return FALSE; + } + + if (n_events) + *n_events = tmp_n_events; + + if (events) + *events = coords; + else if (coords) + gdk_device_free_history (coords, tmp_n_events); + + return TRUE; +} + +static void +gdk_device_core_get_state (GdkDevice *device, + GdkWindow *window, + gdouble *axes, + GdkModifierType *mask) +{ + gint x_int, y_int; + + gdk_window_get_pointer (window, &x_int, &y_int, mask); + + if (axes) + { + axes[0] = x_int; + axes[1] = y_int; + } +} + +static void +gdk_device_core_set_window_cursor (GdkDevice *device, + GdkWindow *window, + GdkCursor *cursor) +{ + GdkCursorPrivate *cursor_private; + Cursor xcursor; + + cursor_private = (GdkCursorPrivate*) cursor; + + if (!cursor) + xcursor = None; + else + xcursor = cursor_private->xcursor; + + XDefineCursor (GDK_WINDOW_XDISPLAY (window), + GDK_WINDOW_XID (window), + xcursor); +} + +static void +gdk_device_core_warp (GdkDevice *device, + GdkScreen *screen, + gint x, + gint y) +{ + Display *xdisplay; + Window dest; + + xdisplay = GDK_DISPLAY_XDISPLAY (gdk_device_get_display (device)); + dest = GDK_WINDOW_XWINDOW (gdk_screen_get_root_window (screen)); + + XWarpPointer (xdisplay, None, dest, 0, 0, 0, 0, x, y); +} + +static gboolean +gdk_device_core_query_state (GdkDevice *device, + GdkWindow *window, + GdkWindow **root_window, + GdkWindow **child_window, + gint *root_x, + gint *root_y, + gint *win_x, + gint *win_y, + GdkModifierType *mask) +{ + GdkDisplay *display; + Window xroot_window, xchild_window; + int xroot_x, xroot_y, xwin_x, xwin_y; + unsigned int xmask; + + display = gdk_drawable_get_display (window); + + if (!XQueryPointer (GDK_WINDOW_XDISPLAY (window), + GDK_WINDOW_XID (window), + &xroot_window, + &xchild_window, + &xroot_x, + &xroot_y, + &xwin_x, + &xwin_y, + &xmask)) + { + return FALSE; + } + + if (root_window) + *root_window = gdk_window_lookup_for_display (display, xroot_window); + + if (child_window) + *child_window = gdk_window_lookup_for_display (display, xchild_window); + + if (root_x) + *root_x = xroot_x; + + if (root_y) + *root_y = xroot_y; + + if (win_x) + *win_x = xwin_x; + + if (win_y) + *win_y = xwin_y; + + if (mask) + *mask = xmask; + + return TRUE; +} + +static GdkGrabStatus +gdk_device_core_grab (GdkDevice *device, + GdkWindow *window, + gboolean owner_events, + GdkEventMask event_mask, + GdkWindow *confine_to, + GdkCursor *cursor, + guint32 time_) +{ + GdkDisplay *display; + Window xwindow, xconfine_to; + int status; + + display = gdk_device_get_display (device); + + xwindow = GDK_WINDOW_XID (window); + + if (confine_to) + confine_to = _gdk_window_get_impl_window (confine_to); + + if (!confine_to || GDK_WINDOW_DESTROYED (confine_to)) + xconfine_to = None; + else + xconfine_to = GDK_WINDOW_XID (confine_to); + + if (device->source == GDK_SOURCE_KEYBOARD) + { + /* Device is a keyboard */ + status = XGrabKeyboard (GDK_DISPLAY_XDISPLAY (display), + xwindow, + owner_events, + GrabModeAsync, GrabModeAsync, + time_); + } + else + { + Cursor xcursor; + guint xevent_mask; + gint i; + + /* Device is a pointer */ + if (!cursor) + xcursor = None; + else + { + _gdk_x11_cursor_update_theme (cursor); + xcursor = ((GdkCursorPrivate *) cursor)->xcursor; + } + + xevent_mask = 0; + + for (i = 0; i < _gdk_nenvent_masks; i++) + { + if (event_mask & (1 << (i + 1))) + xevent_mask |= _gdk_event_mask_table[i]; + } + + /* We don't want to set a native motion hint mask, as we're emulating motion + * hints. If we set a native one we just wouldn't get any events. + */ + xevent_mask &= ~PointerMotionHintMask; + + status = XGrabPointer (GDK_DISPLAY_XDISPLAY (display), + xwindow, + owner_events, + xevent_mask, + GrabModeAsync, GrabModeAsync, + xconfine_to, + xcursor, + time_); + } + + return _gdk_x11_convert_grab_status (status); +} + +static void +gdk_device_core_ungrab (GdkDevice *device, + guint32 time_) +{ + GdkDisplay *display; + + display = gdk_device_get_display (device); + + if (device->source == GDK_SOURCE_KEYBOARD) + XUngrabKeyboard (GDK_DISPLAY_XDISPLAY (display), time_); + else + XUngrabPointer (GDK_DISPLAY_XDISPLAY (display), time_); +} + +static GdkWindow * +gdk_device_core_window_at_position (GdkDevice *device, + gint *win_x, + gint *win_y, + GdkModifierType *mask, + gboolean get_toplevel) +{ + GdkDisplay *display; + GdkScreen *screen; + Display *xdisplay; + GdkWindow *window; + Window xwindow, root, child, last; + int xroot_x, xroot_y, xwin_x, xwin_y; + unsigned int xmask; + + last = None; + display = gdk_device_get_display (device); + screen = gdk_display_get_default_screen (display); + + /* This function really only works if the mouse pointer is held still + * during its operation. If it moves from one leaf window to another + * than we'll end up with inaccurate values for win_x, win_y + * and the result. + */ + gdk_x11_display_grab (display); + + xdisplay = GDK_SCREEN_XDISPLAY (screen); + xwindow = GDK_SCREEN_XROOTWIN (screen); + + XQueryPointer (xdisplay, xwindow, + &root, &child, + &xroot_x, &xroot_y, + &xwin_x, &xwin_y, + &xmask); + + if (root == xwindow) + xwindow = child; + else + xwindow = root; + + while (xwindow) + { + last = xwindow; + XQueryPointer (xdisplay, xwindow, + &root, &xwindow, + &xroot_x, &xroot_y, + &xwin_x, &xwin_y, + &xmask); + + if (get_toplevel && last != root && + (window = gdk_window_lookup_for_display (display, last)) != NULL && + GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN) + { + xwindow = last; + break; + } + } + + gdk_x11_display_ungrab (display); + + window = gdk_window_lookup_for_display (display, last); + + if (win_x) + *win_x = (window) ? xwin_x : -1; + + if (win_y) + *win_y = (window) ? xwin_y : -1; + + if (mask) + *mask = xmask; + + return window; +} + +static void +gdk_device_core_select_window_events (GdkDevice *device, + GdkWindow *window, + GdkEventMask event_mask) +{ + GdkEventMask filter_mask, window_mask; + guint xmask = 0; + gint i; + + window_mask = gdk_window_get_events (window); + filter_mask = (GDK_POINTER_MOTION_MASK & + GDK_POINTER_MOTION_HINT_MASK & + GDK_BUTTON_MOTION_MASK & + GDK_BUTTON1_MOTION_MASK & + GDK_BUTTON2_MOTION_MASK & + GDK_BUTTON3_MOTION_MASK & + GDK_BUTTON_PRESS_MASK & + GDK_BUTTON_RELEASE_MASK & + GDK_KEY_PRESS_MASK & + GDK_KEY_RELEASE_MASK & + GDK_ENTER_NOTIFY_MASK & + GDK_LEAVE_NOTIFY_MASK & + GDK_FOCUS_CHANGE_MASK & + GDK_PROXIMITY_IN_MASK & + GDK_PROXIMITY_OUT_MASK & + GDK_SCROLL_MASK); + + /* Filter out non-device events */ + event_mask &= filter_mask; + + /* Unset device events on window mask */ + window_mask &= ~(filter_mask); + + /* Combine masks */ + event_mask |= window_mask; + + for (i = 0; i < _gdk_nenvent_masks; i++) + { + if (event_mask & (1 << (i + 1))) + xmask |= _gdk_event_mask_table[i]; + } + + if (GDK_WINDOW_XID (window) != GDK_WINDOW_XROOTWIN (window)) + xmask |= StructureNotifyMask | PropertyChangeMask; + + XSelectInput (GDK_WINDOW_XDISPLAY (window), + GDK_WINDOW_XWINDOW (window), + xmask); +} diff --git a/gdk/x11/gdkdevice-core.h b/gdk/x11/gdkdevice-core.h new file mode 100644 index 0000000000..04424b5883 --- /dev/null +++ b/gdk/x11/gdkdevice-core.h @@ -0,0 +1,52 @@ +/* GDK - The GIMP Drawing Kit + * Copyright (C) 2009 Carlos Garnacho + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GDK_DEVICE_CORE_H__ +#define __GDK_DEVICE_CORE_H__ + +#include + +G_BEGIN_DECLS + +#define GDK_TYPE_DEVICE_CORE (gdk_device_core_get_type ()) +#define GDK_DEVICE_CORE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_DEVICE_CORE, GdkDeviceCore)) +#define GDK_DEVICE_CORE_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_DEVICE_CORE, GdkDeviceCoreClass)) +#define GDK_IS_DEVICE_CORE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_DEVICE_CORE)) +#define GDK_IS_DEVICE_CORE_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_DEVICE_CORE)) +#define GDK_DEVICE_CORE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_DEVICE_CORE, GdkDeviceCoreClass)) + +typedef struct _GdkDeviceCore GdkDeviceCore; +typedef struct _GdkDeviceCoreClass GdkDeviceCoreClass; + +struct _GdkDeviceCore +{ + GdkDevice parent_instance; +}; + +struct _GdkDeviceCoreClass +{ + GdkDeviceClass parent_class; +}; + +G_GNUC_INTERNAL +GType gdk_device_core_get_type (void) G_GNUC_CONST; + +G_END_DECLS + +#endif /* __GDK_DEVICE_CORE_H__ */ diff --git a/gdk/x11/gdkdevice-xi.c b/gdk/x11/gdkdevice-xi.c new file mode 100644 index 0000000000..b82ff18002 --- /dev/null +++ b/gdk/x11/gdkdevice-xi.c @@ -0,0 +1,624 @@ +/* GDK - The GIMP Drawing Kit + * Copyright (C) 2009 Carlos Garnacho + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include +#include "gdkdeviceprivate.h" +#include "gdkdevice-xi.h" +#include "gdkprivate-x11.h" +#include "gdkintl.h" +#include "gdkx.h" + +#define MAX_DEVICE_CLASSES 13 + +static GQuark quark_window_input_info = 0; + +typedef struct +{ + gdouble root_x; + gdouble root_y; +} GdkWindowInputInfo; + +static void gdk_device_xi_constructed (GObject *object); +static void gdk_device_xi_dispose (GObject *object); + +static void gdk_device_xi_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec); +static void gdk_device_xi_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec); + +static gboolean gdk_device_xi_get_history (GdkDevice *device, + GdkWindow *window, + guint32 start, + guint32 stop, + GdkTimeCoord ***events, + guint *n_events); + +static void gdk_device_xi_get_state (GdkDevice *device, + GdkWindow *window, + gdouble *axes, + GdkModifierType *mask); +static void gdk_device_xi_set_window_cursor (GdkDevice *device, + GdkWindow *window, + GdkCursor *cursor); +static void gdk_device_xi_warp (GdkDevice *device, + GdkScreen *screen, + gint x, + gint y); +static gboolean gdk_device_xi_query_state (GdkDevice *device, + GdkWindow *window, + GdkWindow **root_window, + GdkWindow **child_window, + gint *root_x, + gint *root_y, + gint *win_x, + gint *win_y, + GdkModifierType *mask); +static GdkGrabStatus gdk_device_xi_grab (GdkDevice *device, + GdkWindow *window, + gboolean owner_events, + GdkEventMask event_mask, + GdkWindow *confine_to, + GdkCursor *cursor, + guint32 time_); +static void gdk_device_xi_ungrab (GdkDevice *device, + guint32 time_); + +static GdkWindow* gdk_device_xi_window_at_position (GdkDevice *device, + gint *win_x, + gint *win_y, + GdkModifierType *mask, + gboolean get_toplevel); + +static void gdk_device_xi_select_window_events (GdkDevice *device, + GdkWindow *window, + GdkEventMask mask); + + +G_DEFINE_TYPE (GdkDeviceXI, gdk_device_xi, GDK_TYPE_DEVICE) + +enum { + PROP_0, + PROP_DEVICE_ID +}; + +static void +gdk_device_xi_class_init (GdkDeviceXIClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + GdkDeviceClass *device_class = GDK_DEVICE_CLASS (klass); + + quark_window_input_info = g_quark_from_static_string ("gdk-window-input-info"); + + object_class->constructed = gdk_device_xi_constructed; + object_class->set_property = gdk_device_xi_set_property; + object_class->get_property = gdk_device_xi_get_property; + object_class->dispose = gdk_device_xi_dispose; + + device_class->get_history = gdk_device_xi_get_history; + device_class->get_state = gdk_device_xi_get_state; + device_class->set_window_cursor = gdk_device_xi_set_window_cursor; + device_class->warp = gdk_device_xi_warp; + device_class->query_state = gdk_device_xi_query_state; + device_class->grab = gdk_device_xi_grab; + device_class->ungrab = gdk_device_xi_ungrab; + device_class->window_at_position = gdk_device_xi_window_at_position; + device_class->select_window_events = gdk_device_xi_select_window_events; + + g_object_class_install_property (object_class, + PROP_DEVICE_ID, + g_param_spec_int ("device-id", + P_("Device ID"), + P_("Device ID"), + 0, G_MAXINT, 0, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); +} + +static void +gdk_device_xi_init (GdkDeviceXI *device) +{ +} + +static void +gdk_device_xi_constructed (GObject *object) +{ + GdkDeviceXI *device; + GdkDisplay *display; + + device = GDK_DEVICE_XI (object); + display = gdk_device_get_display (GDK_DEVICE (object)); + + gdk_error_trap_push (); + device->xdevice = XOpenDevice (GDK_DISPLAY_XDISPLAY (display), + device->device_id); + + if (gdk_error_trap_pop ()) + g_warning ("Device %s can't be opened", GDK_DEVICE (device)->name); + + if (G_OBJECT_CLASS (gdk_device_xi_parent_class)->constructed) + G_OBJECT_CLASS (gdk_device_xi_parent_class)->constructed (object); +} + +static void +gdk_device_xi_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GdkDeviceXI *device = GDK_DEVICE_XI (object); + + switch (prop_id) + { + case PROP_DEVICE_ID: + device->device_id = g_value_get_int (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gdk_device_xi_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GdkDeviceXI *device = GDK_DEVICE_XI (object); + + switch (prop_id) + { + case PROP_DEVICE_ID: + g_value_set_int (value, device->device_id); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gdk_device_xi_dispose (GObject *object) +{ + GdkDeviceXI *device_xi; + GdkDisplay *display; + + device_xi = GDK_DEVICE_XI (object); + display = gdk_device_get_display (GDK_DEVICE (device_xi)); + + if (device_xi->xdevice) + { + XCloseDevice (GDK_DISPLAY_XDISPLAY (display), device_xi->xdevice); + device_xi->xdevice = NULL; + } + + if (device_xi->axis_data) + { + g_free (device_xi->axis_data); + device_xi->axis_data = NULL; + } + + G_OBJECT_CLASS (gdk_device_xi_parent_class)->dispose (object); +} + +static gboolean +gdk_device_xi_get_history (GdkDevice *device, + GdkWindow *window, + guint32 start, + guint32 stop, + GdkTimeCoord ***events, + guint *n_events) +{ + GdkTimeCoord **coords; + XDeviceTimeCoord *device_coords; + GdkWindow *impl_window; + GdkDeviceXI *device_xi; + gint n_events_return; + gint mode_return; + gint axis_count_return; + gint i; + + device_xi = GDK_DEVICE_XI (device); + impl_window = _gdk_window_get_impl_window (window); + + device_coords = XGetDeviceMotionEvents (GDK_WINDOW_XDISPLAY (impl_window), + device_xi->xdevice, + start, stop, + &n_events_return, + &mode_return, + &axis_count_return); + + if (!device_coords) + return FALSE; + + *n_events = (guint) n_events_return; + coords = _gdk_device_allocate_history (device, *n_events); + + for (i = 0; i < *n_events; i++) + { + coords[i]->time = device_coords[i].time; + gdk_device_xi_translate_axes (device, window, + device_coords[i].data, + coords[i]->axes, + NULL, NULL); + } + + XFreeDeviceMotionEvents (device_coords); + + *events = coords; + + return TRUE; +} + +static void +gdk_device_xi_get_state (GdkDevice *device, + GdkWindow *window, + gdouble *axes, + GdkModifierType *mask) +{ + GdkDeviceXI *device_xi; + XDeviceState *state; + XInputClass *input_class; + gint i; + + if (mask) + gdk_window_get_pointer (window, NULL, NULL, mask); + + device_xi = GDK_DEVICE_XI (device); + state = XQueryDeviceState (GDK_WINDOW_XDISPLAY (window), + device_xi->xdevice); + input_class = state->data; + + for (i = 0; i < state->num_classes; i++) + { + switch (input_class->class) + { + case ValuatorClass: + if (axes) + gdk_device_xi_translate_axes (device, window, + ((XValuatorState *) input_class)->valuators, + axes, NULL, NULL); + break; + + case ButtonClass: + if (mask) + { + *mask &= 0xFF; + if (((XButtonState *)input_class)->num_buttons > 0) + *mask |= ((XButtonState *)input_class)->buttons[0] << 7; + /* GDK_BUTTON1_MASK = 1 << 8, and button n is stored + * in bit 1<<(n%8) in byte n/8. n = 1,2,... */ + } + break; + } + + input_class = (XInputClass *)(((char *)input_class)+input_class->length); + } + + XFreeDeviceState (state); +} + +static void +gdk_device_xi_set_window_cursor (GdkDevice *device, + GdkWindow *window, + GdkCursor *cursor) +{ +} + +static void +gdk_device_xi_warp (GdkDevice *device, + GdkScreen *screen, + gint x, + gint y) +{ +} + +static void +find_events (GdkDevice *device, + GdkEventMask mask, + XEventClass *classes, + int *num_classes) +{ + GdkDeviceXI *device_xi; + XEventClass class; + gint i; + + device_xi = GDK_DEVICE_XI (device); + i = 0; + + if (mask & GDK_BUTTON_PRESS_MASK) + { + DeviceButtonPress (device_xi->xdevice, device_xi->button_press_type, class); + if (class != 0) + classes[i++] = class; + + DeviceButtonPressGrab (device_xi->xdevice, 0, class); + if (class != 0) + classes[i++] = class; + } + + if (mask & GDK_BUTTON_RELEASE_MASK) + { + DeviceButtonRelease (device_xi->xdevice, device_xi->button_release_type, class); + if (class != 0) + classes[i++] = class; + } + + if (mask & (GDK_POINTER_MOTION_MASK | + GDK_BUTTON1_MOTION_MASK | GDK_BUTTON2_MOTION_MASK | + GDK_BUTTON3_MOTION_MASK | GDK_BUTTON_MOTION_MASK)) + { + /* Make sure device->motionnotify_type is set */ + DeviceMotionNotify (device_xi->xdevice, device_xi->motion_notify_type, class); + if (class != 0) + classes[i++] = class; + DeviceStateNotify (device_xi->xdevice, device_xi->state_notify_type, class); + if (class != 0) + classes[i++] = class; + } + + if (mask & GDK_KEY_PRESS_MASK) + { + DeviceKeyPress (device_xi->xdevice, device_xi->key_press_type, class); + if (class != 0) + classes[i++] = class; + } + + if (mask & GDK_KEY_RELEASE_MASK) + { + DeviceKeyRelease (device_xi->xdevice, device_xi->key_release_type, class); + if (class != 0) + classes[i++] = class; + } + + if (mask & GDK_PROXIMITY_IN_MASK) + { + ProximityIn (device_xi->xdevice, device_xi->proximity_in_type, class); + if (class != 0) + classes[i++] = class; + } + + if (mask & GDK_PROXIMITY_OUT_MASK) + { + ProximityOut (device_xi->xdevice, device_xi->proximity_out_type, class); + if (class != 0) + classes[i++] = class; + } + + *num_classes = i; +} + +static gboolean +gdk_device_xi_query_state (GdkDevice *device, + GdkWindow *window, + GdkWindow **root_window, + GdkWindow **child_window, + gint *root_x, + gint *root_y, + gint *win_x, + gint *win_y, + GdkModifierType *mask) +{ + return FALSE; +} + +static GdkGrabStatus +gdk_device_xi_grab (GdkDevice *device, + GdkWindow *window, + gboolean owner_events, + GdkEventMask event_mask, + GdkWindow *confine_to, + GdkCursor *cursor, + guint32 time_) +{ + XEventClass event_classes[MAX_DEVICE_CLASSES]; + gint status, num_classes; + GdkDeviceXI *device_xi; + + device_xi = GDK_DEVICE_XI (device); + find_events (device, event_mask, event_classes, &num_classes); + + status = XGrabDevice (GDK_WINDOW_XDISPLAY (window), + device_xi->xdevice, + GDK_WINDOW_XWINDOW (window), + owner_events, + num_classes, event_classes, + GrabModeAsync, GrabModeAsync, + time_); + + return _gdk_x11_convert_grab_status (status); +} + +static void +gdk_device_xi_ungrab (GdkDevice *device, + guint32 time_) +{ + GdkDisplay *display; + GdkDeviceXI *device_xi; + + device_xi = GDK_DEVICE_XI (device); + display = gdk_device_get_display (device); + + XUngrabDevice (GDK_DISPLAY_XDISPLAY (device), + device_xi->xdevice, + time_); +} + +static GdkWindow* +gdk_device_xi_window_at_position (GdkDevice *device, + gint *win_x, + gint *win_y, + GdkModifierType *mask, + gboolean get_toplevel) +{ + return NULL; +} +static void +gdk_device_xi_select_window_events (GdkDevice *device, + GdkWindow *window, + GdkEventMask event_mask) +{ + XEventClass event_classes[MAX_DEVICE_CLASSES]; + GdkDeviceXI *device_xi; + gint num_classes; + + event_mask |= (GDK_PROXIMITY_IN_MASK | + GDK_PROXIMITY_OUT_MASK); + + device_xi = GDK_DEVICE_XI (device); + find_events (device, event_mask, event_classes, &num_classes); + + XSelectExtensionEvent (GDK_WINDOW_XDISPLAY (window), + GDK_WINDOW_XWINDOW (window), + event_classes, num_classes); + + if (event_mask) + { + GdkWindowInputInfo *info; + + info = g_new0 (GdkWindowInputInfo, 1); + g_object_set_qdata_full (G_OBJECT (window), + quark_window_input_info, + info, + (GDestroyNotify) g_free); + } + else + g_object_set_qdata (G_OBJECT (window), + quark_window_input_info, + NULL); +} + +void +gdk_device_xi_update_window_info (GdkWindow *window) +{ + GdkWindowInputInfo *info; + gint root_x, root_y; + + info = g_object_get_qdata (G_OBJECT (window), + quark_window_input_info); + + if (!info) + return; + + gdk_window_get_origin (window, &root_x, &root_y); + info->root_x = (gdouble) root_x; + info->root_y = (gdouble) root_y; +} + +static gboolean +gdk_device_xi_get_window_info (GdkWindow *window, + gdouble *root_x, + gdouble *root_y) +{ + GdkWindowInputInfo *info; + + info = g_object_get_qdata (G_OBJECT (window), + quark_window_input_info); + + if (!info) + return FALSE; + + *root_x = info->root_x; + *root_y = info->root_y; + + return TRUE; +} + +void +gdk_device_xi_update_axes (GdkDevice *device, + gint axes_count, + gint first_axis, + gint *axis_data) +{ + GdkDeviceXI *device_xi; + int i; + + device_xi = GDK_DEVICE_XI (device); + g_return_if_fail (first_axis >= 0 && first_axis + axes_count <= device->num_axes); + + if (!device_xi->axis_data) + device_xi->axis_data = g_new0 (gint, device->num_axes); + + for (i = 0; i < axes_count; i++) + device_xi->axis_data[first_axis + i] = axis_data[i]; +} + +void +gdk_device_xi_translate_axes (GdkDevice *device, + GdkWindow *window, + gint *axis_data, + gdouble *axes, + gdouble *x, + gdouble *y) +{ + GdkDeviceXI *device_xi; + GdkWindow *impl_window; + gdouble root_x, root_y; + gdouble temp_x, temp_y; + gint i; + + device_xi = GDK_DEVICE_XI (device); + impl_window = _gdk_window_get_impl_window (window); + temp_x = temp_y = 0; + + if (!gdk_device_xi_get_window_info (impl_window, &root_x, &root_y)) + return; + + for (i = 0; i < device->num_axes; i++) + { + GdkAxisUse use; + + use = _gdk_device_get_axis_use (device, i); + + switch (use) + { + case GDK_AXIS_X: + case GDK_AXIS_Y: + if (device->mode == GDK_MODE_WINDOW) + _gdk_device_translate_window_coord (device, window, + i, axis_data[i], + &axes[i]); + else + _gdk_device_translate_screen_coord (device, window, + root_x, root_y, + i, axis_data[i], + &axes[i]); + if (use == GDK_AXIS_X) + temp_x = axes[i]; + else if (use == GDK_AXIS_Y) + temp_y = axes[i]; + + break; + default: + _gdk_device_translate_axis (device, i, axis_data[i], &axes[i]); + break; + } + } + + if (x) + *x = temp_x; + + if (y) + *y = temp_y; +} diff --git a/gdk/x11/gdkdevice-xi.h b/gdk/x11/gdkdevice-xi.h new file mode 100644 index 0000000000..55f33d30a2 --- /dev/null +++ b/gdk/x11/gdkdevice-xi.h @@ -0,0 +1,88 @@ +/* GDK - The GIMP Drawing Kit + * Copyright (C) 2009 Carlos Garnacho + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GDK_DEVICE_XI_H__ +#define __GDK_DEVICE_XI_H__ + +#include +#include + +G_BEGIN_DECLS + +#define GDK_TYPE_DEVICE_XI (gdk_device_xi_get_type ()) +#define GDK_DEVICE_XI(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_DEVICE_XI, GdkDeviceXI)) +#define GDK_DEVICE_XI_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_DEVICE_XI, GdkDeviceXIClass)) +#define GDK_IS_DEVICE_XI(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_DEVICE_XI)) +#define GDK_IS_DEVICE_XI_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_DEVICE_XI)) +#define GDK_DEVICE_XI_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_DEVICE_XI, GdkDeviceXIClass)) + +typedef struct _GdkDeviceXI GdkDeviceXI; +typedef struct _GdkDeviceXIClass GdkDeviceXIClass; + +struct _GdkDeviceXI +{ + GdkDevice parent_instance; + + guint32 device_id; + XDevice *xdevice; + + gint button_press_type; + gint button_release_type; + gint key_press_type; + gint key_release_type; + gint motion_notify_type; + gint proximity_in_type; + gint proximity_out_type; + gint state_notify_type; + + /* minimum key code for device */ + gint min_keycode; + + gint *axis_data; + + guint in_proximity : 1; +}; + +struct _GdkDeviceXIClass +{ + GdkDeviceClass parent_class; +}; + +G_GNUC_INTERNAL +GType gdk_device_xi_get_type (void) G_GNUC_CONST; + +G_GNUC_INTERNAL +void gdk_device_xi_update_window_info (GdkWindow *window); + +G_GNUC_INTERNAL +void gdk_device_xi_update_axes (GdkDevice *device, + gint axes_count, + gint first_axis, + gint *axis_data); +G_GNUC_INTERNAL +void gdk_device_xi_translate_axes (GdkDevice *device, + GdkWindow *window, + gint *axis_data, + gdouble *axes, + gdouble *x, + gdouble *y); + +G_END_DECLS + +#endif /* __GDK_DEVICE_XI_H__ */ diff --git a/gdk/x11/gdkdevice-xi2.c b/gdk/x11/gdkdevice-xi2.c new file mode 100644 index 0000000000..d7bc64e66e --- /dev/null +++ b/gdk/x11/gdkdevice-xi2.c @@ -0,0 +1,621 @@ +/* GDK - The GIMP Drawing Kit + * Copyright (C) 2009 Carlos Garnacho + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include +#include "gdkdevice-xi2.h" +#include "gdkintl.h" +#include "gdkx.h" + + +struct _GdkDeviceXI2Private +{ + int device_id; +}; + +static void gdk_device_xi2_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec); +static void gdk_device_xi2_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec); + +static void gdk_device_xi2_get_state (GdkDevice *device, + GdkWindow *window, + gdouble *axes, + GdkModifierType *mask); +static void gdk_device_xi2_set_window_cursor (GdkDevice *device, + GdkWindow *window, + GdkCursor *cursor); +static void gdk_device_xi2_warp (GdkDevice *device, + GdkScreen *screen, + gint x, + gint y); +static gboolean gdk_device_xi2_query_state (GdkDevice *device, + GdkWindow *window, + GdkWindow **root_window, + GdkWindow **child_window, + gint *root_x, + gint *root_y, + gint *win_x, + gint *win_y, + GdkModifierType *mask); + +static GdkGrabStatus gdk_device_xi2_grab (GdkDevice *device, + GdkWindow *window, + gboolean owner_events, + GdkEventMask event_mask, + GdkWindow *confine_to, + GdkCursor *cursor, + guint32 time_); +static void gdk_device_xi2_ungrab (GdkDevice *device, + guint32 time_); + +static GdkWindow * gdk_device_xi2_window_at_position (GdkDevice *device, + gint *win_x, + gint *win_y, + GdkModifierType *mask, + gboolean get_toplevel); +static void gdk_device_xi2_select_window_events (GdkDevice *device, + GdkWindow *window, + GdkEventMask event_mask); + + +G_DEFINE_TYPE (GdkDeviceXI2, gdk_device_xi2, GDK_TYPE_DEVICE) + +enum { + PROP_0, + PROP_DEVICE_ID +}; + +static void +gdk_device_xi2_class_init (GdkDeviceXI2Class *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + GdkDeviceClass *device_class = GDK_DEVICE_CLASS (klass); + + object_class->get_property = gdk_device_xi2_get_property; + object_class->set_property = gdk_device_xi2_set_property; + + device_class->get_state = gdk_device_xi2_get_state; + device_class->set_window_cursor = gdk_device_xi2_set_window_cursor; + device_class->warp = gdk_device_xi2_warp; + device_class->query_state = gdk_device_xi2_query_state; + device_class->grab = gdk_device_xi2_grab; + device_class->ungrab = gdk_device_xi2_ungrab; + device_class->window_at_position = gdk_device_xi2_window_at_position; + device_class->select_window_events = gdk_device_xi2_select_window_events; + + g_object_class_install_property (object_class, + PROP_DEVICE_ID, + g_param_spec_int ("device-id", + P_("Device ID"), + P_("Device identifier"), + 0, G_MAXINT, 0, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + g_type_class_add_private (object_class, sizeof (GdkDeviceXI2Private)); +} + +static void +gdk_device_xi2_init (GdkDeviceXI2 *device) +{ + GdkDeviceXI2Private *priv; + + device->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE (device, + GDK_TYPE_DEVICE_XI2, + GdkDeviceXI2Private); +} + +static void +gdk_device_xi2_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GdkDeviceXI2Private *priv; + + priv = GDK_DEVICE_XI2 (object)->priv; + + switch (prop_id) + { + case PROP_DEVICE_ID: + g_value_set_int (value, priv->device_id); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gdk_device_xi2_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GdkDeviceXI2Private *priv; + + priv = GDK_DEVICE_XI2 (object)->priv; + + switch (prop_id) + { + case PROP_DEVICE_ID: + priv->device_id = g_value_get_int (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gdk_device_xi2_get_state (GdkDevice *device, + GdkWindow *window, + gdouble *axes, + GdkModifierType *mask) +{ + GdkDeviceXI2Private *priv; + GdkDisplay *display; + XIDeviceInfo *info; + gint i, j, ndevices; + + priv = GDK_DEVICE_XI2 (device)->priv; + display = gdk_device_get_display (device); + + if (axes) + { + info = XIQueryDevice(GDK_DISPLAY_XDISPLAY (display), + priv->device_id, &ndevices); + + for (i = 0, j = 0; i < info->num_classes; i++) + { + XIAnyClassInfo *class_info = info->classes[i]; + GdkAxisUse use; + gdouble value; + + if (class_info->type != XIValuatorClass) + continue; + + value = ((XIValuatorClassInfo *) class_info)->value; + use = _gdk_device_get_axis_use (device, j); + + switch (use) + { + case GDK_AXIS_X: + case GDK_AXIS_Y: + case GDK_AXIS_IGNORE: + if (device->mode == GDK_MODE_WINDOW) + _gdk_device_translate_window_coord (device, window, j, value, &axes[j]); + else + { + gint root_x, root_y; + + /* FIXME: Maybe root coords chaching should happen here */ + gdk_window_get_origin (window, &root_x, &root_y); + _gdk_device_translate_screen_coord (device, window, + root_x, root_y, + j, value, + &axes[j]); + } + break; + default: + _gdk_device_translate_axis (device, j, value, &axes[j]); + break; + } + + j++; + } + + XIFreeDeviceInfo (info); + } + + if (mask) + gdk_device_xi2_query_state (device, window, + NULL, NULL, + NULL, NULL, + NULL, NULL, + mask); +} + +static void +gdk_device_xi2_set_window_cursor (GdkDevice *device, + GdkWindow *window, + GdkCursor *cursor) +{ + GdkDeviceXI2Private *priv; + GdkCursorPrivate *cursor_private; + + priv = GDK_DEVICE_XI2 (device)->priv; + + /* Non-master devices don't have a cursor */ + if (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_MASTER) + return; + + if (cursor) + { + cursor_private = (GdkCursorPrivate*) cursor; + + XIDefineCursor (GDK_WINDOW_XDISPLAY (window), + priv->device_id, + GDK_WINDOW_XWINDOW (window), + cursor_private->xcursor); + } + else + XIUndefineCursor (GDK_WINDOW_XDISPLAY (window), + priv->device_id, + GDK_WINDOW_XWINDOW (window)); +} + +static void +gdk_device_xi2_warp (GdkDevice *device, + GdkScreen *screen, + gint x, + gint y) +{ + GdkDeviceXI2Private *priv; + Window dest; + + priv = GDK_DEVICE_XI2 (device)->priv; + dest = GDK_WINDOW_XWINDOW (gdk_screen_get_root_window (screen)); + + XIWarpPointer (GDK_SCREEN_XDISPLAY (screen), + priv->device_id, + None, dest, + 0, 0, 0, 0, x, y); +} + +static gboolean +gdk_device_xi2_query_state (GdkDevice *device, + GdkWindow *window, + GdkWindow **root_window, + GdkWindow **child_window, + gint *root_x, + gint *root_y, + gint *win_x, + gint *win_y, + GdkModifierType *mask) +{ + GdkDisplay *display; + GdkDeviceXI2Private *priv; + Window xroot_window, xchild_window; + gdouble xroot_x, xroot_y, xwin_x, xwin_y; + XIButtonState button_state; + XIModifierState mod_state; + XIGroupState group_state; + + if (!window || GDK_WINDOW_DESTROYED (window)) + return FALSE; + + priv = GDK_DEVICE_XI2 (device)->priv; + display = gdk_drawable_get_display (window); + + if (!XIQueryPointer (GDK_WINDOW_XDISPLAY (window), + priv->device_id, + GDK_WINDOW_XID (window), + &xroot_window, + &xchild_window, + &xroot_x, + &xroot_y, + &xwin_x, + &xwin_y, + &button_state, + &mod_state, + &group_state)) + { + return FALSE; + } + + if (root_window) + *root_window = gdk_window_lookup_for_display (display, xroot_window); + + if (child_window) + *child_window = gdk_window_lookup_for_display (display, xchild_window); + + if (root_x) + *root_x = (gint) xroot_x; + + if (root_y) + *root_y = (gint) xroot_y; + + if (win_x) + *win_x = (gint) xwin_x; + + if (win_y) + *win_y = (gint) xwin_y; + + if (mask) + *mask = gdk_device_xi2_translate_state (&mod_state, &button_state); + + return TRUE; +} + +static GdkGrabStatus +gdk_device_xi2_grab (GdkDevice *device, + GdkWindow *window, + gboolean owner_events, + GdkEventMask event_mask, + GdkWindow *confine_to, + GdkCursor *cursor, + guint32 time_) +{ + GdkDeviceXI2Private *priv; + GdkDisplay *display; + XIEventMask mask; + Window xwindow; + Cursor xcursor; + int status; + + priv = GDK_DEVICE_XI2 (device)->priv; + display = gdk_device_get_display (device); + + /* FIXME: confine_to is actually unused */ + + xwindow = GDK_WINDOW_XID (window); + + if (!cursor) + xcursor = None; + else + { + _gdk_x11_cursor_update_theme (cursor); + xcursor = ((GdkCursorPrivate *) cursor)->xcursor; + } + + mask.deviceid = priv->device_id; + mask.mask = gdk_device_xi2_translate_event_mask (event_mask, &mask.mask_len); + + status = XIGrabDevice (GDK_DISPLAY_XDISPLAY (display), + priv->device_id, + xwindow, + time_, + xcursor, + GrabModeAsync, GrabModeAsync, + owner_events, + &mask); + + g_free (mask.mask); + + return _gdk_x11_convert_grab_status (status); +} + +static void +gdk_device_xi2_ungrab (GdkDevice *device, + guint32 time_) +{ + GdkDeviceXI2Private *priv; + GdkDisplay *display; + + priv = GDK_DEVICE_XI2 (device)->priv; + display = gdk_device_get_display (device); + + XIUngrabDevice (GDK_DISPLAY_XDISPLAY (display), + priv->device_id, + time_); +} + +static GdkWindow * +gdk_device_xi2_window_at_position (GdkDevice *device, + gint *win_x, + gint *win_y, + GdkModifierType *mask, + gboolean get_toplevel) +{ + GdkDeviceXI2Private *priv; + GdkDisplay *display; + GdkScreen *screen; + Display *xdisplay; + GdkWindow *window; + Window xwindow, root, child, last = None; + gdouble xroot_x, xroot_y, xwin_x, xwin_y; + XIButtonState button_state; + XIModifierState mod_state; + XIGroupState group_state; + + priv = GDK_DEVICE_XI2 (device)->priv; + display = gdk_device_get_display (device); + screen = gdk_display_get_default_screen (display); + + /* This function really only works if the mouse pointer is held still + * during its operation. If it moves from one leaf window to another + * than we'll end up with inaccurate values for win_x, win_y + * and the result. + */ + gdk_x11_display_grab (display); + + xdisplay = GDK_SCREEN_XDISPLAY (screen); + xwindow = GDK_SCREEN_XROOTWIN (screen); + + XIQueryPointer (xdisplay, + priv->device_id, + xwindow, + &root, &child, + &xroot_x, &xroot_y, + &xwin_x, &xwin_y, + &button_state, + &mod_state, + &group_state); + + if (root == xwindow) + xwindow = child; + else + xwindow = root; + + while (xwindow) + { + last = xwindow; + XIQueryPointer (xdisplay, + priv->device_id, + xwindow, + &root, &xwindow, + &xroot_x, &xroot_y, + &xwin_x, &xwin_y, + &button_state, + &mod_state, + &group_state); + + if (get_toplevel && last != root && + (window = gdk_window_lookup_for_display (display, last)) != NULL && + GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN) + { + xwindow = last; + break; + } + } + + gdk_x11_display_ungrab (display); + + window = gdk_window_lookup_for_display (display, last); + + if (win_x) + *win_x = (window) ? (gint) xwin_x : -1; + + if (win_y) + *win_y = (window) ? (gint) xwin_y : -1; + + if (mask) + *mask = gdk_device_xi2_translate_state (&mod_state, &button_state); + + return window; +} + +static void +gdk_device_xi2_select_window_events (GdkDevice *device, + GdkWindow *window, + GdkEventMask event_mask) +{ + GdkDeviceXI2Private *priv; + XIEventMask evmask; + + priv = GDK_DEVICE_XI2 (device)->priv; + + evmask.deviceid = priv->device_id; + evmask.mask = gdk_device_xi2_translate_event_mask (event_mask, &evmask.mask_len); + + XISelectEvents (GDK_WINDOW_XDISPLAY (window), + GDK_WINDOW_XWINDOW (window), + &evmask, 1); + + g_free (evmask.mask); +} + +guchar * +gdk_device_xi2_translate_event_mask (GdkEventMask event_mask, + int *len) +{ + guchar *mask; + + *len = XIMaskLen (XI_LASTEVENT); + mask = g_new0 (guchar, *len); + + if (event_mask & GDK_POINTER_MOTION_MASK || + event_mask & GDK_POINTER_MOTION_HINT_MASK) + XISetMask (mask, XI_Motion); + + if (event_mask & GDK_BUTTON_MOTION_MASK || + event_mask & GDK_BUTTON1_MOTION_MASK || + event_mask & GDK_BUTTON2_MOTION_MASK || + event_mask & GDK_BUTTON3_MOTION_MASK) + { + XISetMask (mask, XI_ButtonPress); + XISetMask (mask, XI_ButtonRelease); + XISetMask (mask, XI_Motion); + } + + if (event_mask & GDK_SCROLL_MASK) + { + XISetMask (mask, XI_ButtonPress); + XISetMask (mask, XI_ButtonRelease); + } + + if (event_mask & GDK_BUTTON_PRESS_MASK) + XISetMask (mask, XI_ButtonPress); + + if (event_mask & GDK_BUTTON_RELEASE_MASK) + XISetMask (mask, XI_ButtonRelease); + + if (event_mask & GDK_KEY_PRESS_MASK) + XISetMask (mask, XI_KeyPress); + + if (event_mask & GDK_KEY_RELEASE_MASK) + XISetMask (mask, XI_KeyRelease); + + if (event_mask & GDK_ENTER_NOTIFY_MASK) + XISetMask (mask, XI_Enter); + + if (event_mask & GDK_LEAVE_NOTIFY_MASK) + XISetMask (mask, XI_Leave); + + if (event_mask & GDK_FOCUS_CHANGE_MASK) + { + XISetMask (mask, XI_FocusIn); + XISetMask (mask, XI_FocusOut); + } + + return mask; +} + +guint +gdk_device_xi2_translate_state (XIModifierState *mods_state, + XIButtonState *buttons_state) +{ + guint state = 0; + + if (mods_state) + state = (guint) mods_state->effective; + + if (buttons_state) + { + gint len, i; + + /* We're only interested in the first 5 buttons */ + len = MIN (5, buttons_state->mask_len * 8); + + for (i = 0; i < len; i++) + { + if (!XIMaskIsSet (buttons_state->mask, i)) + continue; + + switch (i) + { + case 1: + state |= GDK_BUTTON1_MASK; + break; + case 2: + state |= GDK_BUTTON2_MASK; + break; + case 3: + state |= GDK_BUTTON3_MASK; + break; + case 4: + state |= GDK_BUTTON4_MASK; + break; + case 5: + state |= GDK_BUTTON5_MASK; + break; + default: + break; + } + } + } + + return state; +} diff --git a/gdk/x11/gdkdevice-xi2.h b/gdk/x11/gdkdevice-xi2.h new file mode 100644 index 0000000000..67e4dc940a --- /dev/null +++ b/gdk/x11/gdkdevice-xi2.h @@ -0,0 +1,64 @@ +/* GDK - The GIMP Drawing Kit + * Copyright (C) 2009 Carlos Garnacho + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GDK_DEVICE_XI2_H__ +#define __GDK_DEVICE_XI2_H__ + +#include + +G_BEGIN_DECLS + +#define GDK_TYPE_DEVICE_XI2 (gdk_device_xi2_get_type ()) +#define GDK_DEVICE_XI2(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_DEVICE_XI2, GdkDeviceXI2)) +#define GDK_DEVICE_XI2_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_DEVICE_XI2, GdkDeviceXI2Class)) +#define GDK_IS_DEVICE_XI2(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_DEVICE_XI2)) +#define GDK_IS_DEVICE_XI2_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_DEVICE_XI2)) +#define GDK_DEVICE_XI2_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_DEVICE_XI2, GdkDeviceXI2Class)) + +typedef struct _GdkDeviceXI2 GdkDeviceXI2; +typedef struct _GdkDeviceXI2Private GdkDeviceXI2Private; +typedef struct _GdkDeviceXI2Class GdkDeviceXI2Class; + +struct _GdkDeviceXI2 +{ + GdkDevice parent_instance; + + /*< private >*/ + GdkDeviceXI2Private *priv; +}; + +struct _GdkDeviceXI2Class +{ + GdkDeviceClass parent_class; +}; + +G_GNUC_INTERNAL +GType gdk_device_xi2_get_type (void) G_GNUC_CONST; + +G_GNUC_INTERNAL +guchar * gdk_device_xi2_translate_event_mask (GdkEventMask event_mask, + int *len); +G_GNUC_INTERNAL +guint gdk_device_xi2_translate_state (XIModifierState *mods_state, + XIButtonState *buttons_state); + + +G_END_DECLS + +#endif /* __GDK_DEVICE_XI2_H__ */ diff --git a/gdk/x11/gdkdevicemanager-core.c b/gdk/x11/gdkdevicemanager-core.c new file mode 100644 index 0000000000..0e7b8c33d2 --- /dev/null +++ b/gdk/x11/gdkdevicemanager-core.c @@ -0,0 +1,904 @@ +/* GDK - The GIMP Drawing Kit + * Copyright (C) 2009 Carlos Garnacho + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include +#include +#include "gdkdevicemanager-core.h" +#include "gdkeventtranslator.h" +#include "gdkdevice-core.h" +#include "gdkkeysyms.h" +#include "gdkprivate-x11.h" +#include "gdkx.h" +#include "gdkalias.h" + +#ifdef HAVE_XKB +#include +#endif + + +#define HAS_FOCUS(toplevel) \ + ((toplevel)->has_focus || (toplevel)->has_pointer_focus) + +static void gdk_device_manager_core_finalize (GObject *object); +static void gdk_device_manager_core_constructed (GObject *object); + +static GList * gdk_device_manager_core_list_devices (GdkDeviceManager *device_manager, + GdkDeviceType type); + +static void gdk_device_manager_event_translator_init (GdkEventTranslatorIface *iface); + +static gboolean gdk_device_manager_core_translate_event (GdkEventTranslator *translator, + GdkDisplay *display, + GdkEvent *event, + XEvent *xevent); + + +G_DEFINE_TYPE_WITH_CODE (GdkDeviceManagerCore, gdk_device_manager_core, GDK_TYPE_DEVICE_MANAGER, + G_IMPLEMENT_INTERFACE (GDK_TYPE_EVENT_TRANSLATOR, + gdk_device_manager_event_translator_init)) + +static void +gdk_device_manager_core_class_init (GdkDeviceManagerCoreClass *klass) +{ + GdkDeviceManagerClass *device_manager_class = GDK_DEVICE_MANAGER_CLASS (klass); + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->finalize = gdk_device_manager_core_finalize; + object_class->constructed = gdk_device_manager_core_constructed; + device_manager_class->list_devices = gdk_device_manager_core_list_devices; +} + +static void +gdk_device_manager_event_translator_init (GdkEventTranslatorIface *iface) +{ + iface->translate_event = gdk_device_manager_core_translate_event; +} + +static GdkDevice * +create_core_pointer (GdkDeviceManager *device_manager, + GdkDisplay *display) +{ + return g_object_new (GDK_TYPE_DEVICE_CORE, + "name", "Core Pointer", + "type", GDK_DEVICE_TYPE_MASTER, + "input-source", GDK_SOURCE_MOUSE, + "input-mode", GDK_MODE_SCREEN, + "has-cursor", TRUE, + "display", display, + "device-manager", device_manager, + NULL); +} + +static GdkDevice * +create_core_keyboard (GdkDeviceManager *device_manager, + GdkDisplay *display) +{ + return g_object_new (GDK_TYPE_DEVICE_CORE, + "name", "Core Keyboard", + "type", GDK_DEVICE_TYPE_MASTER, + "input-source", GDK_SOURCE_KEYBOARD, + "input-mode", GDK_MODE_SCREEN, + "has-cursor", FALSE, + "display", display, + "device-manager", device_manager, + NULL); +} + +static void +gdk_device_manager_core_init (GdkDeviceManagerCore *device_manager) +{ +} + +static void +gdk_device_manager_core_finalize (GObject *object) +{ + GdkDeviceManagerCore *device_manager_core; + + device_manager_core = GDK_DEVICE_MANAGER_CORE (object); + + g_object_unref (device_manager_core->core_pointer); + g_object_unref (device_manager_core->core_keyboard); + + G_OBJECT_CLASS (gdk_device_manager_core_parent_class)->finalize (object); +} + +static void +gdk_device_manager_core_constructed (GObject *object) +{ + GdkDeviceManagerCore *device_manager; + GdkDisplay *display; + + device_manager = GDK_DEVICE_MANAGER_CORE (object); + display = gdk_device_manager_get_display (GDK_DEVICE_MANAGER (object)); + device_manager->core_pointer = create_core_pointer (GDK_DEVICE_MANAGER (device_manager), display); + device_manager->core_keyboard = create_core_keyboard (GDK_DEVICE_MANAGER (device_manager), display); + + _gdk_device_set_associated_device (device_manager->core_pointer, device_manager->core_keyboard); + _gdk_device_set_associated_device (device_manager->core_keyboard, device_manager->core_pointer); +} + +static void +translate_key_event (GdkDisplay *display, + GdkDeviceManagerCore *device_manager, + GdkEvent *event, + XEvent *xevent) +{ + GdkKeymap *keymap = gdk_keymap_get_for_display (display); + GdkModifierType consumed, state; + gunichar c = 0; + gchar buf[7]; + + event->key.type = xevent->xany.type == KeyPress ? GDK_KEY_PRESS : GDK_KEY_RELEASE; + event->key.time = xevent->xkey.time; + gdk_event_set_device (event, device_manager->core_keyboard); + + event->key.state = (GdkModifierType) xevent->xkey.state; + event->key.group = _gdk_x11_get_group_for_state (display, xevent->xkey.state); + event->key.hardware_keycode = xevent->xkey.keycode; + + event->key.keyval = GDK_VoidSymbol; + + gdk_keymap_translate_keyboard_state (keymap, + event->key.hardware_keycode, + event->key.state, + event->key.group, + &event->key.keyval, + NULL, NULL, &consumed); + + state = event->key.state & ~consumed; + _gdk_keymap_add_virtual_modifiers_compat (keymap, &state); + event->key.state |= state; + + event->key.is_modifier = _gdk_keymap_key_is_modifier (keymap, event->key.hardware_keycode); + + /* Fill in event->string crudely, since various programs + * depend on it. + */ + event->key.string = NULL; + + if (event->key.keyval != GDK_VoidSymbol) + c = gdk_keyval_to_unicode (event->key.keyval); + + if (c) + { + gsize bytes_written; + gint len; + + /* Apply the control key - Taken from Xlib + */ + if (event->key.state & GDK_CONTROL_MASK) + { + if ((c >= '@' && c < '\177') || c == ' ') c &= 0x1F; + else if (c == '2') + { + event->key.string = g_memdup ("\0\0", 2); + event->key.length = 1; + buf[0] = '\0'; + goto out; + } + else if (c >= '3' && c <= '7') c -= ('3' - '\033'); + else if (c == '8') c = '\177'; + else if (c == '/') c = '_' & 0x1F; + } + + len = g_unichar_to_utf8 (c, buf); + buf[len] = '\0'; + + event->key.string = g_locale_from_utf8 (buf, len, + NULL, &bytes_written, + NULL); + if (event->key.string) + event->key.length = bytes_written; + } + else if (event->key.keyval == GDK_Escape) + { + event->key.length = 1; + event->key.string = g_strdup ("\033"); + } + else if (event->key.keyval == GDK_Return || + event->key.keyval == GDK_KP_Enter) + { + event->key.length = 1; + event->key.string = g_strdup ("\r"); + } + + if (!event->key.string) + { + event->key.length = 0; + event->key.string = g_strdup (""); + } + + out: +#ifdef G_ENABLE_DEBUG + if (_gdk_debug_flags & GDK_DEBUG_EVENTS) + { + g_message ("%s:\t\twindow: %ld key: %12s %d", + event->type == GDK_KEY_PRESS ? "key press " : "key release", + xevent->xkey.window, + event->key.keyval ? gdk_keyval_name (event->key.keyval) : "(none)", + event->key.keyval); + + if (event->key.length > 0) + g_message ("\t\tlength: %4d string: \"%s\"", + event->key.length, buf); + } +#endif /* G_ENABLE_DEBUG */ + return; +} + +#ifdef G_ENABLE_DEBUG +static const char notify_modes[][19] = { + "NotifyNormal", + "NotifyGrab", + "NotifyUngrab", + "NotifyWhileGrabbed" +}; + +static const char notify_details[][23] = { + "NotifyAncestor", + "NotifyVirtual", + "NotifyInferior", + "NotifyNonlinear", + "NotifyNonlinearVirtual", + "NotifyPointer", + "NotifyPointerRoot", + "NotifyDetailNone" +}; +#endif + +static void +set_user_time (GdkWindow *window, + GdkEvent *event) +{ + g_return_if_fail (event != NULL); + + window = gdk_window_get_toplevel (event->client.window); + g_return_if_fail (GDK_IS_WINDOW (window)); + + /* If an event doesn't have a valid timestamp, we shouldn't use it + * to update the latest user interaction time. + */ + if (gdk_event_get_time (event) != GDK_CURRENT_TIME) + gdk_x11_window_set_user_time (gdk_window_get_toplevel (window), + gdk_event_get_time (event)); +} + +static void +generate_focus_event (GdkDeviceManagerCore *device_manager, + GdkWindow *window, + gboolean in) +{ + GdkEvent *event; + + event = gdk_event_new (GDK_FOCUS_CHANGE); + event->focus_change.window = g_object_ref (window); + event->focus_change.send_event = FALSE; + event->focus_change.in = in; + gdk_event_set_device (event, device_manager->core_keyboard); + + gdk_event_put (event); + gdk_event_free (event); +} + +static gboolean +set_screen_from_root (GdkDisplay *display, + GdkEvent *event, + Window xrootwin) +{ + GdkScreen *screen; + + screen = _gdk_x11_display_screen_for_xrootwin (display, xrootwin); + + if (screen) + { + gdk_event_set_screen (event, screen); + + return TRUE; + } + + return FALSE; +} + +static GdkCrossingMode +translate_crossing_mode (int mode) +{ + switch (mode) + { + case NotifyNormal: + return GDK_CROSSING_NORMAL; + case NotifyGrab: + return GDK_CROSSING_GRAB; + case NotifyUngrab: + return GDK_CROSSING_UNGRAB; + default: + g_assert_not_reached (); + } +} + +static GdkNotifyType +translate_notify_type (int detail) +{ + switch (detail) + { + case NotifyInferior: + return GDK_NOTIFY_INFERIOR; + case NotifyAncestor: + return GDK_NOTIFY_ANCESTOR; + case NotifyVirtual: + return GDK_NOTIFY_VIRTUAL; + case NotifyNonlinear: + return GDK_NOTIFY_NONLINEAR; + case NotifyNonlinearVirtual: + return GDK_NOTIFY_NONLINEAR_VIRTUAL; + default: + g_assert_not_reached (); + } +} + +static gboolean +is_parent_of (GdkWindow *parent, + GdkWindow *child) +{ + GdkWindow *w; + + w = child; + while (w != NULL) + { + if (w == parent) + return TRUE; + + w = gdk_window_get_parent (w); + } + + return FALSE; +} + +static GdkWindow * +get_event_window (GdkEventTranslator *translator, + XEvent *xevent) +{ + GdkDeviceManager *device_manager; + GdkDisplay *display; + GdkWindow *window; + + device_manager = GDK_DEVICE_MANAGER (translator); + display = gdk_device_manager_get_display (device_manager); + window = gdk_window_lookup_for_display (display, xevent->xany.window); + + /* Apply keyboard grabs to non-native windows */ + if (xevent->type == KeyPress || xevent->type == KeyRelease) + { + GdkDeviceGrabInfo *info; + gulong serial; + + serial = _gdk_windowing_window_get_next_serial (display); + info = _gdk_display_has_device_grab (display, + GDK_DEVICE_MANAGER_CORE (device_manager)->core_keyboard, + serial); + if (info && + (!is_parent_of (info->window, window) || + !info->owner_events)) + { + /* Report key event against grab window */ + window = info->window; + } + } + + return window; +} + +static gboolean +gdk_device_manager_core_translate_event (GdkEventTranslator *translator, + GdkDisplay *display, + GdkEvent *event, + XEvent *xevent) +{ + GdkDeviceManagerCore *device_manager; + GdkWindow *window; + GdkWindowObject *window_private; + GdkWindowImplX11 *window_impl = NULL; + gboolean return_val; + GdkToplevelX11 *toplevel = NULL; + GdkDisplayX11 *display_x11 = GDK_DISPLAY_X11 (display); + + device_manager = GDK_DEVICE_MANAGER_CORE (translator); + return_val = FALSE; + + window = get_event_window (translator, xevent); + window_private = (GdkWindowObject *) window; + + if (window && GDK_WINDOW_DESTROYED (window)) + return FALSE; + + if (window) + { + toplevel = _gdk_x11_window_get_toplevel (window); + window_impl = GDK_WINDOW_IMPL_X11 (window_private->impl); + g_object_ref (window); + } + + event->any.window = window; + event->any.send_event = xevent->xany.send_event ? TRUE : FALSE; + + if (window_private && GDK_WINDOW_DESTROYED (window)) + { + if (xevent->type != DestroyNotify) + { + return_val = FALSE; + goto done; + } + } + + if (window && + (xevent->type == MotionNotify || + xevent->type == ButtonRelease)) + { + if (_gdk_moveresize_handle_event (xevent)) + { + return_val = FALSE; + goto done; + } + } + + /* We do a "manual" conversion of the XEvent to a + * GdkEvent. The structures are mostly the same so + * the conversion is fairly straightforward. We also + * optionally print debugging info regarding events + * received. + */ + + return_val = TRUE; + + switch (xevent->type) + { + case KeyPress: + if (window_private == NULL) + { + return_val = FALSE; + break; + } + translate_key_event (display, device_manager, event, xevent); + set_user_time (window, event); + break; + + case KeyRelease: + if (window_private == NULL) + { + return_val = FALSE; + break; + } + + /* Emulate detectable auto-repeat by checking to see + * if the next event is a key press with the same + * keycode and timestamp, and if so, ignoring the event. + */ + + if (!display_x11->have_xkb_autorepeat && XPending (xevent->xkey.display)) + { + XEvent next_event; + + XPeekEvent (xevent->xkey.display, &next_event); + + if (next_event.type == KeyPress && + next_event.xkey.keycode == xevent->xkey.keycode && + next_event.xkey.time == xevent->xkey.time) + { + return_val = FALSE; + break; + } + } + + translate_key_event (display, device_manager, event, xevent); + break; + + case ButtonPress: + GDK_NOTE (EVENTS, + g_message ("button press:\t\twindow: %ld x,y: %d %d button: %d", + xevent->xbutton.window, + xevent->xbutton.x, xevent->xbutton.y, + xevent->xbutton.button)); + + if (window_private == NULL) + { + return_val = FALSE; + break; + } + + /* If we get a ButtonPress event where the button is 4 or 5, + it's a Scroll event */ + switch (xevent->xbutton.button) + { + case 4: /* up */ + case 5: /* down */ + case 6: /* left */ + case 7: /* right */ + event->scroll.type = GDK_SCROLL; + + if (xevent->xbutton.button == 4) + event->scroll.direction = GDK_SCROLL_UP; + else if (xevent->xbutton.button == 5) + event->scroll.direction = GDK_SCROLL_DOWN; + else if (xevent->xbutton.button == 6) + event->scroll.direction = GDK_SCROLL_LEFT; + else + event->scroll.direction = GDK_SCROLL_RIGHT; + + event->scroll.window = window; + event->scroll.time = xevent->xbutton.time; + event->scroll.x = (gdouble) xevent->xbutton.x; + event->scroll.y = (gdouble) xevent->xbutton.y; + event->scroll.x_root = (gdouble) xevent->xbutton.x_root; + event->scroll.y_root = (gdouble) xevent->xbutton.y_root; + event->scroll.state = (GdkModifierType) xevent->xbutton.state; + event->scroll.device = device_manager->core_pointer; + + if (!set_screen_from_root (display, event, xevent->xbutton.root)) + { + return_val = FALSE; + break; + } + + break; + + default: + event->button.type = GDK_BUTTON_PRESS; + event->button.window = window; + event->button.time = xevent->xbutton.time; + event->button.x = (gdouble) xevent->xbutton.x; + event->button.y = (gdouble) xevent->xbutton.y; + event->button.x_root = (gdouble) xevent->xbutton.x_root; + event->button.y_root = (gdouble) xevent->xbutton.y_root; + event->button.axes = NULL; + event->button.state = (GdkModifierType) xevent->xbutton.state; + event->button.button = xevent->xbutton.button; + event->button.device = device_manager->core_pointer; + + if (!set_screen_from_root (display, event, xevent->xbutton.root)) + return_val = FALSE; + + break; + } + + set_user_time (window, event); + + break; + + case ButtonRelease: + GDK_NOTE (EVENTS, + g_message ("button release:\twindow: %ld x,y: %d %d button: %d", + xevent->xbutton.window, + xevent->xbutton.x, xevent->xbutton.y, + xevent->xbutton.button)); + + if (window_private == NULL) + { + return_val = FALSE; + break; + } + + /* We treat button presses as scroll wheel events, so ignore the release */ + if (xevent->xbutton.button == 4 || xevent->xbutton.button == 5 || + xevent->xbutton.button == 6 || xevent->xbutton.button == 7) + { + return_val = FALSE; + break; + } + + event->button.type = GDK_BUTTON_RELEASE; + event->button.window = window; + event->button.time = xevent->xbutton.time; + event->button.x = (gdouble) xevent->xbutton.x; + event->button.y = (gdouble) xevent->xbutton.y; + event->button.x_root = (gdouble) xevent->xbutton.x_root; + event->button.y_root = (gdouble) xevent->xbutton.y_root; + event->button.axes = NULL; + event->button.state = (GdkModifierType) xevent->xbutton.state; + event->button.button = xevent->xbutton.button; + event->button.device = device_manager->core_pointer; + + if (!set_screen_from_root (display, event, xevent->xbutton.root)) + return_val = FALSE; + + break; + + case MotionNotify: + GDK_NOTE (EVENTS, + g_message ("motion notify:\t\twindow: %ld x,y: %d %d hint: %s", + xevent->xmotion.window, + xevent->xmotion.x, xevent->xmotion.y, + (xevent->xmotion.is_hint) ? "true" : "false")); + + if (window_private == NULL) + { + return_val = FALSE; + break; + } + + event->motion.type = GDK_MOTION_NOTIFY; + event->motion.window = window; + event->motion.time = xevent->xmotion.time; + event->motion.x = (gdouble) xevent->xmotion.x; + event->motion.y = (gdouble) xevent->xmotion.y; + event->motion.x_root = (gdouble) xevent->xmotion.x_root; + event->motion.y_root = (gdouble) xevent->xmotion.y_root; + event->motion.axes = NULL; + event->motion.state = (GdkModifierType) xevent->xmotion.state; + event->motion.is_hint = xevent->xmotion.is_hint; + event->motion.device = device_manager->core_pointer; + + if (!set_screen_from_root (display, event, xevent->xbutton.root)) + { + return_val = FALSE; + break; + } + + break; + + case EnterNotify: + GDK_NOTE (EVENTS, + g_message ("enter notify:\t\twindow: %ld detail: %d subwin: %ld", + xevent->xcrossing.window, + xevent->xcrossing.detail, + xevent->xcrossing.subwindow)); + + if (window_private == NULL) + { + return_val = FALSE; + break; + } + + if (!set_screen_from_root (display, event, xevent->xbutton.root)) + { + return_val = FALSE; + break; + } + + event->crossing.type = GDK_ENTER_NOTIFY; + event->crossing.window = window; + gdk_event_set_device (event, device_manager->core_pointer); + + /* If the subwindow field of the XEvent is non-NULL, then + * lookup the corresponding GdkWindow. + */ + if (xevent->xcrossing.subwindow != None) + event->crossing.subwindow = gdk_window_lookup_for_display (display, xevent->xcrossing.subwindow); + else + event->crossing.subwindow = NULL; + + event->crossing.time = xevent->xcrossing.time; + event->crossing.x = (gdouble) xevent->xcrossing.x; + event->crossing.y = (gdouble) xevent->xcrossing.y; + event->crossing.x_root = (gdouble) xevent->xcrossing.x_root; + event->crossing.y_root = (gdouble) xevent->xcrossing.y_root; + + event->crossing.mode = translate_crossing_mode (xevent->xcrossing.mode); + event->crossing.detail = translate_notify_type (xevent->xcrossing.detail); + + event->crossing.focus = xevent->xcrossing.focus; + event->crossing.state = xevent->xcrossing.state; + + break; + + case LeaveNotify: + GDK_NOTE (EVENTS, + g_message ("leave notify:\t\twindow: %ld detail: %d subwin: %ld", + xevent->xcrossing.window, + xevent->xcrossing.detail, xevent->xcrossing.subwindow)); + + if (window_private == NULL) + { + return_val = FALSE; + break; + } + + if (!set_screen_from_root (display, event, xevent->xbutton.root)) + { + return_val = FALSE; + break; + } + + event->crossing.type = GDK_LEAVE_NOTIFY; + event->crossing.window = window; + gdk_event_set_device (event, device_manager->core_pointer); + + /* If the subwindow field of the XEvent is non-NULL, then + * lookup the corresponding GdkWindow. + */ + if (xevent->xcrossing.subwindow != None) + event->crossing.subwindow = gdk_window_lookup_for_display (display, xevent->xcrossing.subwindow); + else + event->crossing.subwindow = NULL; + + event->crossing.time = xevent->xcrossing.time; + event->crossing.x = (gdouble) xevent->xcrossing.x; + event->crossing.y = (gdouble) xevent->xcrossing.y; + event->crossing.x_root = (gdouble) xevent->xcrossing.x_root; + event->crossing.y_root = (gdouble) xevent->xcrossing.y_root; + + event->crossing.mode = translate_crossing_mode (xevent->xcrossing.mode); + event->crossing.detail = translate_notify_type (xevent->xcrossing.detail); + + event->crossing.focus = xevent->xcrossing.focus; + event->crossing.state = xevent->xcrossing.state; + + break; + + /* We only care about focus events that indicate that _this_ + * window (not a ancestor or child) got or lost the focus + */ + case FocusIn: + GDK_NOTE (EVENTS, + g_message ("focus in:\t\twindow: %ld, detail: %s, mode: %s", + xevent->xfocus.window, + notify_details[xevent->xfocus.detail], + notify_modes[xevent->xfocus.mode])); + + if (toplevel) + { + gboolean had_focus = HAS_FOCUS (toplevel); + + switch (xevent->xfocus.detail) + { + case NotifyAncestor: + case NotifyVirtual: + /* When the focus moves from an ancestor of the window to + * the window or a descendent of the window, *and* the + * pointer is inside the window, then we were previously + * receiving keystroke events in the has_pointer_focus + * case and are now receiving them in the + * has_focus_window case. + */ + if (toplevel->has_pointer && + xevent->xfocus.mode != NotifyGrab && + xevent->xfocus.mode != NotifyUngrab) + toplevel->has_pointer_focus = FALSE; + + /* fall through */ + case NotifyNonlinear: + case NotifyNonlinearVirtual: + if (xevent->xfocus.mode != NotifyGrab && + xevent->xfocus.mode != NotifyUngrab) + toplevel->has_focus_window = TRUE; + /* We pretend that the focus moves to the grab + * window, so we pay attention to NotifyGrab + * NotifyUngrab, and ignore NotifyWhileGrabbed + */ + if (xevent->xfocus.mode != NotifyWhileGrabbed) + toplevel->has_focus = TRUE; + break; + case NotifyPointer: + /* The X server sends NotifyPointer/NotifyGrab, + * but the pointer focus is ignored while a + * grab is in effect + */ + if (xevent->xfocus.mode != NotifyGrab && + xevent->xfocus.mode != NotifyUngrab) + toplevel->has_pointer_focus = TRUE; + break; + case NotifyInferior: + case NotifyPointerRoot: + case NotifyDetailNone: + break; + } + + if (HAS_FOCUS (toplevel) != had_focus) + generate_focus_event (device_manager, window, TRUE); + } + break; + case FocusOut: + GDK_NOTE (EVENTS, + g_message ("focus out:\t\twindow: %ld, detail: %s, mode: %s", + xevent->xfocus.window, + notify_details[xevent->xfocus.detail], + notify_modes[xevent->xfocus.mode])); + + if (toplevel) + { + gboolean had_focus = HAS_FOCUS (toplevel); + + switch (xevent->xfocus.detail) + { + case NotifyAncestor: + case NotifyVirtual: + /* When the focus moves from the window or a descendent + * of the window to an ancestor of the window, *and* the + * pointer is inside the window, then we were previously + * receiving keystroke events in the has_focus_window + * case and are now receiving them in the + * has_pointer_focus case. + */ + if (toplevel->has_pointer && + xevent->xfocus.mode != NotifyGrab && + xevent->xfocus.mode != NotifyUngrab) + toplevel->has_pointer_focus = TRUE; + + /* fall through */ + case NotifyNonlinear: + case NotifyNonlinearVirtual: + if (xevent->xfocus.mode != NotifyGrab && + xevent->xfocus.mode != NotifyUngrab) + toplevel->has_focus_window = FALSE; + if (xevent->xfocus.mode != NotifyWhileGrabbed) + toplevel->has_focus = FALSE; + break; + case NotifyPointer: + if (xevent->xfocus.mode != NotifyGrab && + xevent->xfocus.mode != NotifyUngrab) + toplevel->has_pointer_focus = FALSE; + break; + case NotifyInferior: + case NotifyPointerRoot: + case NotifyDetailNone: + break; + } + + if (HAS_FOCUS (toplevel) != had_focus) + generate_focus_event (device_manager, window, FALSE); + } + break; + + default: + return_val = FALSE; + } + + done: + if (return_val) + { + if (event->any.window) + g_object_ref (event->any.window); + + if (((event->any.type == GDK_ENTER_NOTIFY) || + (event->any.type == GDK_LEAVE_NOTIFY)) && + (event->crossing.subwindow != NULL)) + g_object_ref (event->crossing.subwindow); + } + else + { + /* Mark this event as having no resources to be freed */ + event->any.window = NULL; + event->any.type = GDK_NOTHING; + } + + if (window) + g_object_unref (window); + + return return_val; +} + +static GList * +gdk_device_manager_core_list_devices (GdkDeviceManager *device_manager, + GdkDeviceType type) +{ + GdkDeviceManagerCore *device_manager_core; + GList *devices = NULL; + + if (type == GDK_DEVICE_TYPE_MASTER) + { + device_manager_core = (GdkDeviceManagerCore *) device_manager; + devices = g_list_prepend (devices, device_manager_core->core_keyboard); + devices = g_list_prepend (devices, device_manager_core->core_pointer); + } + + return devices; +} + +#define __GDK_DEVICE_MANAGER_CORE_C__ +#include "gdkaliasdef.c" diff --git a/gdk/x11/gdkdevicemanager-core.h b/gdk/x11/gdkdevicemanager-core.h new file mode 100644 index 0000000000..0a337fcd00 --- /dev/null +++ b/gdk/x11/gdkdevicemanager-core.h @@ -0,0 +1,54 @@ +/* GDK - The GIMP Drawing Kit + * Copyright (C) 2009 Carlos Garnacho + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GDK_DEVICE_MANAGER_CORE_H__ +#define __GDK_DEVICE_MANAGER_CORE_H__ + +#include + +G_BEGIN_DECLS + +#define GDK_TYPE_DEVICE_MANAGER_CORE (gdk_device_manager_core_get_type ()) +#define GDK_DEVICE_MANAGER_CORE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_DEVICE_MANAGER_CORE, GdkDeviceManagerCore)) +#define GDK_DEVICE_MANAGER_CORE_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_DEVICE_MANAGER_CORE, GdkDeviceManagerCoreClass)) +#define GDK_IS_DEVICE_MANAGER_CORE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_DEVICE_MANAGER_CORE)) +#define GDK_IS_DEVICE_MANAGER_CORE_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_DEVICE_MANAGER_CORE)) +#define GDK_DEVICE_MANAGER_CORE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_DEVICE_MANAGER_CORE, GdkDeviceManagerCoreClass)) + +typedef struct _GdkDeviceManagerCore GdkDeviceManagerCore; +typedef struct _GdkDeviceManagerCoreClass GdkDeviceManagerCoreClass; + +struct _GdkDeviceManagerCore +{ + GdkDeviceManager parent_object; + GdkDevice *core_pointer; + GdkDevice *core_keyboard; +}; + +struct _GdkDeviceManagerCoreClass +{ + GdkDeviceManagerClass parent_class; +}; + +GType gdk_device_manager_core_get_type (void) G_GNUC_CONST; + + +G_END_DECLS + +#endif /* __GDK_DEVICE_MANAGER_CORE_H__ */ diff --git a/gdk/x11/gdkdevicemanager-x11.c b/gdk/x11/gdkdevicemanager-x11.c new file mode 100644 index 0000000000..335764b7f0 --- /dev/null +++ b/gdk/x11/gdkdevicemanager-x11.c @@ -0,0 +1,76 @@ +/* GDK - The GIMP Drawing Kit + * Copyright (C) 2009 Carlos Garnacho + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" +#include "gdkx.h" +#include "gdkdevicemanager-core.h" + +#ifdef XINPUT_XFREE +#include "gdkdevicemanager-xi.h" +#ifdef XINPUT_2 +#include "gdkdevicemanager-xi2.h" +#endif +#endif + +GdkDeviceManager * +_gdk_device_manager_new (GdkDisplay *display) +{ + if (!g_getenv ("GDK_CORE_DEVICE_EVENTS")) + { +#if defined (XINPUT_2) || defined (XINPUT_XFREE) + int opcode, firstevent, firsterror; + Display *xdisplay; + + xdisplay = GDK_DISPLAY_XDISPLAY (display); + + if (XQueryExtension (xdisplay, "XInputExtension", + &opcode, &firstevent, &firsterror)) + { +#ifdef XINPUT_2 + int major, minor; + + major = 2; + minor = 0; + + if (_gdk_enable_multidevice && + XIQueryVersion (xdisplay, &major, &minor) != BadRequest) + { + GdkDeviceManagerXI2 *device_manager_xi2; + + device_manager_xi2 = g_object_new (GDK_TYPE_DEVICE_MANAGER_XI2, + "display", display, + NULL); + device_manager_xi2->opcode = opcode; + + return GDK_DEVICE_MANAGER (device_manager_xi2); + } + else +#endif /* XINPUT_2 */ + return g_object_new (GDK_TYPE_DEVICE_MANAGER_XI, + "display", display, + "event-base", firstevent, + NULL); + } +#endif /* XINPUT_2 || XINPUT_XFREE */ + } + + return g_object_new (GDK_TYPE_DEVICE_MANAGER_CORE, + "display", display, + NULL); +} diff --git a/gdk/x11/gdkdevicemanager-xi.c b/gdk/x11/gdkdevicemanager-xi.c new file mode 100644 index 0000000000..61907994f8 --- /dev/null +++ b/gdk/x11/gdkdevicemanager-xi.c @@ -0,0 +1,661 @@ +/* GDK - The GIMP Drawing Kit + * Copyright (C) 2009 Carlos Garnacho + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include "gdkdevicemanager-xi.h" +#include "gdkeventtranslator.h" +#include "gdkdevice-xi.h" +#include "gdkintl.h" +#include "gdkx.h" + +#include "gdkalias.h" + +#include + + +struct _GdkDeviceManagerXIPrivate +{ + GHashTable *id_table; + gint event_base; + GList *devices; + gboolean ignore_core_events; +}; + +static void gdk_device_manager_xi_constructed (GObject *object); +static void gdk_device_manager_xi_finalize (GObject *object); +static void gdk_device_manager_xi_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec); +static void gdk_device_manager_xi_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec); + +static void gdk_device_manager_xi_event_translator_init (GdkEventTranslatorIface *iface); +static gboolean gdk_device_manager_xi_translate_event (GdkEventTranslator *translator, + GdkDisplay *display, + GdkEvent *event, + XEvent *xevent); +static GList * gdk_device_manager_xi_list_devices (GdkDeviceManager *device_manager, + GdkDeviceType type); + + +G_DEFINE_TYPE_WITH_CODE (GdkDeviceManagerXI, gdk_device_manager_xi, GDK_TYPE_DEVICE_MANAGER_CORE, + G_IMPLEMENT_INTERFACE (GDK_TYPE_EVENT_TRANSLATOR, + gdk_device_manager_xi_event_translator_init)) + +enum { + PROP_0, + PROP_EVENT_BASE +}; + +static void +gdk_device_manager_xi_class_init (GdkDeviceManagerXIClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + GdkDeviceManagerClass *device_manager_class = GDK_DEVICE_MANAGER_CLASS (klass); + + object_class->constructed = gdk_device_manager_xi_constructed; + object_class->finalize = gdk_device_manager_xi_finalize; + object_class->set_property = gdk_device_manager_xi_set_property; + object_class->get_property = gdk_device_manager_xi_get_property; + + device_manager_class->list_devices = gdk_device_manager_xi_list_devices; + + g_object_class_install_property (object_class, + PROP_EVENT_BASE, + g_param_spec_int ("event-base", + P_("Event base"), + P_("Event base for XInput events"), + 0, G_MAXINT, 0, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + + g_type_class_add_private (object_class, sizeof (GdkDeviceManagerXIPrivate)); +} + +static GdkFilterReturn +window_input_info_filter (GdkXEvent *xevent, + GdkEvent *event, + gpointer user_data) +{ + GdkDeviceManager *device_manager; + GdkDisplay *display; + GdkWindow *window; + XEvent *xev; + + device_manager = user_data; + xev = (XEvent *) xevent; + + display = gdk_device_manager_get_display (device_manager); + window = gdk_window_lookup_for_display (display, xev->xany.window); + + if (window && xev->type == ConfigureNotify) + gdk_device_xi_update_window_info (window); + + return GDK_FILTER_CONTINUE; +} + +static void +gdk_device_manager_xi_init (GdkDeviceManagerXI *device_manager) +{ + GdkDeviceManagerXIPrivate *priv; + + device_manager->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE (device_manager, + GDK_TYPE_DEVICE_MANAGER_XI, + GdkDeviceManagerXIPrivate); + + priv->id_table = g_hash_table_new_full (NULL, NULL, NULL, + (GDestroyNotify) g_object_unref); + + gdk_window_add_filter (NULL, window_input_info_filter, device_manager); +} + +static void +translate_class_info (GdkDevice *device, + XDeviceInfo *info) +{ + GdkDeviceXI *device_xi; + XAnyClassPtr class; + gint i, j; + + device_xi = GDK_DEVICE_XI (device); + class = info->inputclassinfo; + + for (i = 0; i < info->num_classes; i++) + { + switch (class->class) { + case ButtonClass: + break; + case KeyClass: + { + XKeyInfo *xki = (XKeyInfo *)class; + guint num_keys; + + num_keys = xki->max_keycode - xki->min_keycode + 1; + _gdk_device_set_keys (device, num_keys); + + device_xi->min_keycode = xki->min_keycode; + + break; + } + case ValuatorClass: + { + XValuatorInfo *xvi = (XValuatorInfo *)class; + + for (j = 0; j < xvi->num_axes; j++) + { + GdkAxisUse use; + + switch (j) + { + case 0: + use = GDK_AXIS_X; + break; + case 1: + use = GDK_AXIS_Y; + break; + case 2: + use = GDK_AXIS_PRESSURE; + break; + case 3: + use = GDK_AXIS_XTILT; + break; + case 4: + use = GDK_AXIS_YTILT; + break; + case 5: + use = GDK_AXIS_WHEEL; + break; + default: + use = GDK_AXIS_IGNORE; + } + + _gdk_device_add_axis (device, + GDK_NONE, + use, + xvi->axes[j].min_value, + xvi->axes[j].max_value, + xvi->axes[j].resolution); + } + + break; + } + } + + class = (XAnyClassPtr) (((char *) class) + class->length); + } +} + +/* old versions of XI.h don't define these */ +#ifndef IsXExtensionKeyboard +#define IsXExtensionKeyboard 3 +#define IsXExtensionPointer 4 +#endif + +static GdkDevice * +create_device (GdkDeviceManager *device_manager, + GdkDisplay *display, + XDeviceInfo *info) +{ + GdkInputSource input_source; + GdkDevice *device; + + if (info->use != IsXExtensionPointer && + info->use != IsXExtensionKeyboard) + return NULL; + + if (info->use == IsXExtensionKeyboard) + input_source = GDK_SOURCE_KEYBOARD; + else + { + gchar *tmp_name; + + tmp_name = g_ascii_strdown (info->name, -1); + + if (strstr (tmp_name, "eraser")) + input_source = GDK_SOURCE_ERASER; + else if (strstr (tmp_name, "cursor")) + input_source = GDK_SOURCE_CURSOR; + else if (strstr (tmp_name, "wacom") || + strstr (tmp_name, "pen")) + input_source = GDK_SOURCE_PEN; + else + input_source = GDK_SOURCE_MOUSE; + + g_free (tmp_name); + } + + device = g_object_new (GDK_TYPE_DEVICE_XI, + "name", info->name, + "type", GDK_DEVICE_TYPE_FLOATING, + "input-source", input_source, + "input-mode", GDK_MODE_DISABLED, + "has-cursor", FALSE, + "display", display, + "device-manager", device_manager, + "device-id", info->id, + NULL); + translate_class_info (device, info); + + return device; +} + +static void +gdk_device_manager_xi_constructed (GObject *object) +{ + GdkDeviceManagerXIPrivate *priv; + XDeviceInfo *devices; + gint i, num_devices; + GdkDisplay *display; + + priv = GDK_DEVICE_MANAGER_XI (object)->priv; + display = gdk_device_manager_get_display (GDK_DEVICE_MANAGER (object)); + devices = XListInputDevices(GDK_DISPLAY_XDISPLAY (display), &num_devices); + + for(i = 0; i < num_devices; i++) + { + GdkDevice *device; + + device = create_device (GDK_DEVICE_MANAGER (object), + display, &devices[i]); + if (device) + { + priv->devices = g_list_prepend (priv->devices, device); + g_hash_table_insert (priv->id_table, + GINT_TO_POINTER (devices[i].id), + device); + } + } + + XFreeDeviceList(devices); + + gdk_x11_register_standard_event_type (display, + priv->event_base, + 15 /* Number of events */); + + if (G_OBJECT_CLASS (gdk_device_manager_xi_parent_class)->constructed) + G_OBJECT_CLASS (gdk_device_manager_xi_parent_class)->constructed (object); +} + +static void +gdk_device_manager_xi_finalize (GObject *object) +{ + GdkDeviceManagerXIPrivate *priv; + + priv = GDK_DEVICE_MANAGER_XI (object)->priv; + + g_list_foreach (priv->devices, (GFunc) g_object_unref, NULL); + g_list_free (priv->devices); + + g_hash_table_destroy (priv->id_table); + + gdk_window_remove_filter (NULL, window_input_info_filter, object); + + G_OBJECT_CLASS (gdk_device_manager_xi_parent_class)->finalize (object); +} + +static void +gdk_device_manager_xi_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GdkDeviceManagerXIPrivate *priv; + + priv = GDK_DEVICE_MANAGER_XI (object)->priv; + + switch (prop_id) + { + case PROP_EVENT_BASE: + priv->event_base = g_value_get_int (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gdk_device_manager_xi_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GdkDeviceManagerXIPrivate *priv; + + priv = GDK_DEVICE_MANAGER_XI (object)->priv; + + switch (prop_id) + { + case PROP_EVENT_BASE: + g_value_set_int (value, priv->event_base); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gdk_device_manager_xi_event_translator_init (GdkEventTranslatorIface *iface) +{ + iface->translate_event = gdk_device_manager_xi_translate_event; +} + +/* combine the state of the core device and the device state + * into one - for now we do this in a simple-minded manner - + * we just take the keyboard portion of the core device and + * the button portion (all of?) the device state. + * Any button remapping should go on here. + */ +static guint +translate_state (guint state, guint device_state) +{ + return device_state | (state & 0xFF); +} + +static GdkDevice * +lookup_device (GdkDeviceManagerXI *device_manager, + XEvent *xevent) +{ + GdkDeviceManagerXIPrivate *priv; + guint32 device_id; + + priv = GDK_DEVICE_MANAGER_XI (device_manager)->priv; + + /* This is a sort of a hack, as there isn't any XDeviceAnyEvent - + but it's potentially faster than scanning through the types of + every device. If we were deceived, then it won't match any of + the types for the device anyways */ + device_id = ((XDeviceButtonEvent *)xevent)->deviceid; + + return g_hash_table_lookup (priv->id_table, GINT_TO_POINTER (device_id)); +} + +static gboolean +gdk_device_manager_xi_translate_event (GdkEventTranslator *translator, + GdkDisplay *display, + GdkEvent *event, + XEvent *xevent) +{ + GdkDeviceManagerXIPrivate *priv; + GdkDeviceManagerXI *device_manager; + GdkEventTranslatorIface *parent_iface; + GdkDeviceXI *device_xi; + GdkDevice *device; + GdkWindow *window; + + parent_iface = g_type_interface_peek_parent (GDK_EVENT_TRANSLATOR_GET_IFACE (translator)); + device_manager = GDK_DEVICE_MANAGER_XI (translator); + priv = device_manager->priv; + + if (!priv->ignore_core_events && + parent_iface->translate_event (translator, display, event, xevent)) + return TRUE; + + device = lookup_device (device_manager, xevent); + device_xi = GDK_DEVICE_XI (device); + + if (!device) + return FALSE; + + window = gdk_window_lookup_for_display (display, xevent->xany.window); + + if (!window) + return FALSE; + + if ((xevent->type == device_xi->button_press_type) || + (xevent->type == device_xi->button_release_type)) + { + XDeviceButtonEvent *xdbe = (XDeviceButtonEvent *) xevent; + + event->button.type = (xdbe->type == device_xi->button_press_type) ? + GDK_BUTTON_PRESS : GDK_BUTTON_RELEASE; + + event->button.device = device; + event->button.window = g_object_ref (window); + event->button.time = xdbe->time; + + event->button.x_root = (gdouble) xdbe->x_root; + event->button.y_root = (gdouble) xdbe->y_root; + + event->button.axes = g_new0 (gdouble, device->num_axes); + gdk_device_xi_update_axes (device, xdbe->axes_count, + xdbe->first_axis, xdbe->axis_data); + gdk_device_xi_translate_axes (device, window, + device_xi->axis_data, + event->button.axes, + &event->button.x, + &event->button.y); + + event->button.state = translate_state (xdbe->state, xdbe->device_state); + event->button.button = xdbe->button; + + if (event->button.type == GDK_BUTTON_PRESS) + _gdk_event_button_generate (gdk_drawable_get_display (event->button.window), + event); + + GDK_NOTE (EVENTS, + g_print ("button %s:\t\twindow: %ld device: %ld x,y: %f %f button: %d\n", + (event->button.type == GDK_BUTTON_PRESS) ? "press" : "release", + xdbe->window, + xdbe->deviceid, + event->button.x, event->button.y, + xdbe->button)); + + /* Update the timestamp of the latest user interaction, if the event has + * a valid timestamp. + */ + if (gdk_event_get_time (event) != GDK_CURRENT_TIME) + gdk_x11_window_set_user_time (gdk_window_get_toplevel (window), + gdk_event_get_time (event)); + return TRUE; + } + + if ((xevent->type == device_xi->key_press_type) || + (xevent->type == device_xi->key_release_type)) + { + XDeviceKeyEvent *xdke = (XDeviceKeyEvent *) xevent; + + GDK_NOTE (EVENTS, + g_print ("device key %s:\twindow: %ld device: %ld keycode: %d\n", + (event->key.type == GDK_KEY_PRESS) ? "press" : "release", + xdke->window, + xdke->deviceid, + xdke->keycode)); + + if (xdke->keycode < device_xi->min_keycode || + xdke->keycode >= device_xi->min_keycode + device->num_keys) + { + g_warning ("Invalid device key code received"); + return FALSE; + } + + event->key.keyval = device->keys[xdke->keycode - device_xi->min_keycode].keyval; + + if (event->key.keyval == 0) + { + GDK_NOTE (EVENTS, + g_print ("\t\ttranslation - NONE\n")); + + return FALSE; + } + + event->key.type = (xdke->type == device_xi->key_press_type) ? + GDK_KEY_PRESS : GDK_KEY_RELEASE; + + event->key.window = g_object_ref (window); + event->key.time = xdke->time; + + event->key.state = translate_state (xdke->state, xdke->device_state) + | device->keys[xdke->keycode - device_xi->min_keycode].modifiers; + + /* Add a string translation for the key event */ + if ((event->key.keyval >= 0x20) && (event->key.keyval <= 0xFF)) + { + event->key.length = 1; + event->key.string = g_new (gchar, 2); + event->key.string[0] = (gchar) event->key.keyval; + event->key.string[1] = 0; + } + else + { + event->key.length = 0; + event->key.string = g_new0 (gchar, 1); + } + + GDK_NOTE (EVENTS, + g_print ("\t\ttranslation - keyval: %d modifiers: %#x\n", + event->key.keyval, + event->key.state)); + + /* Update the timestamp of the latest user interaction, if the event has + * a valid timestamp. + */ + if (gdk_event_get_time (event) != GDK_CURRENT_TIME) + gdk_x11_window_set_user_time (gdk_window_get_toplevel (window), + gdk_event_get_time (event)); + return TRUE; + } + + if (xevent->type == device_xi->motion_notify_type) + { + XDeviceMotionEvent *xdme = (XDeviceMotionEvent *) xevent; + + event->motion.device = device; + + if (device_xi->in_proximity) + priv->ignore_core_events = TRUE; + + event->motion.x_root = (gdouble) xdme->x_root; + event->motion.y_root = (gdouble) xdme->y_root; + + event->motion.axes = g_new0 (gdouble, device->num_axes); + gdk_device_xi_update_axes (device, xdme->axes_count, + xdme->first_axis, xdme->axis_data); + gdk_device_xi_translate_axes (device, window, + device_xi->axis_data, + event->motion.axes, + &event->motion.x, + &event->motion.y); + + event->motion.type = GDK_MOTION_NOTIFY; + event->motion.window = g_object_ref (window); + event->motion.time = xdme->time; + event->motion.state = translate_state (xdme->state, + xdme->device_state); + event->motion.is_hint = xdme->is_hint; + + GDK_NOTE (EVENTS, + g_print ("motion notify:\t\twindow: %ld device: %ld x,y: %f %f state %#4x hint: %s\n", + xdme->window, + xdme->deviceid, + event->motion.x, event->motion.y, + event->motion.state, + (xdme->is_hint) ? "true" : "false")); + + + /* Update the timestamp of the latest user interaction, if the event has + * a valid timestamp. + */ + if (gdk_event_get_time (event) != GDK_CURRENT_TIME) + gdk_x11_window_set_user_time (gdk_window_get_toplevel (window), + gdk_event_get_time (event)); + return TRUE; + } + + if (xevent->type == device_xi->proximity_in_type || + xevent->type == device_xi->proximity_out_type) + { + XProximityNotifyEvent *xpne = (XProximityNotifyEvent *) xevent; + + if (xevent->type == device_xi->proximity_in_type) + { + event->proximity.type = GDK_PROXIMITY_IN; + device_xi->in_proximity = TRUE; + priv->ignore_core_events = TRUE; + } + else + { + event->proximity.type = GDK_PROXIMITY_OUT; + device_xi->in_proximity = FALSE; + priv->ignore_core_events = FALSE; + } + + event->proximity.device = device; + event->proximity.window = g_object_ref (window); + event->proximity.time = xpne->time; + + /* Update the timestamp of the latest user interaction, if the event has + * a valid timestamp. + */ + if (gdk_event_get_time (event) != GDK_CURRENT_TIME) + gdk_x11_window_set_user_time (gdk_window_get_toplevel (window), + gdk_event_get_time (event)); + return TRUE; + } + + if (xevent->type == device_xi->state_notify_type) + { + XDeviceStateNotifyEvent *xdse = (XDeviceStateNotifyEvent *) xevent; + XInputClass *input_class = (XInputClass *) xdse->data; + int i; + + for (i = 0; i < xdse->num_classes; i++) + { + if (input_class->class == ValuatorClass) + gdk_device_xi_update_axes (device, device->num_axes, 0, + ((XValuatorState *)input_class)->valuators); + + input_class = (XInputClass *)(((char *)input_class)+input_class->length); + } + + GDK_NOTE (EVENTS, + g_print ("device state notify:\t\twindow: %ld device: %ld\n", + xdse->window, + xdse->deviceid)); + + return FALSE; + } + + return FALSE; +} + +static GList * +gdk_device_manager_xi_list_devices (GdkDeviceManager *device_manager, + GdkDeviceType type) +{ + GdkDeviceManagerXIPrivate *priv; + + priv = GDK_DEVICE_MANAGER_XI (device_manager)->priv; + + if (type == GDK_DEVICE_TYPE_MASTER) + return GDK_DEVICE_MANAGER_CLASS (gdk_device_manager_xi_parent_class)->list_devices (device_manager, type); + else if (type == GDK_DEVICE_TYPE_FLOATING) + { + return g_list_copy (priv->devices); + } + else + return NULL; +} + +#define __GDK_DEVICE_MANAGER_XI_C__ +#include "gdkaliasdef.c" diff --git a/gdk/x11/gdkdevicemanager-xi.h b/gdk/x11/gdkdevicemanager-xi.h new file mode 100644 index 0000000000..e2028fdb8d --- /dev/null +++ b/gdk/x11/gdkdevicemanager-xi.h @@ -0,0 +1,57 @@ +/* GDK - The GIMP Drawing Kit + * Copyright (C) 2009 Carlos Garnacho + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GDK_DEVICE_MANAGER_XI_H__ +#define __GDK_DEVICE_MANAGER_XI_H__ + +#include "gdkdevicemanager-core.h" + +G_BEGIN_DECLS + +#define GDK_TYPE_DEVICE_MANAGER_XI (gdk_device_manager_xi_get_type ()) +#define GDK_DEVICE_MANAGER_XI(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_DEVICE_MANAGER_XI, GdkDeviceManagerXI)) +#define GDK_DEVICE_MANAGER_XI_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_DEVICE_MANAGER_XI, GdkDeviceManagerXIClass)) +#define GDK_IS_DEVICE_MANAGER_XI(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_DEVICE_MANAGER_XI)) +#define GDK_IS_DEVICE_MANAGER_XI_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_DEVICE_MANAGER_XI)) +#define GDK_DEVICE_MANAGER_XI_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_DEVICE_MANAGER_XI, GdkDeviceManagerXIClass)) + +typedef struct _GdkDeviceManagerXI GdkDeviceManagerXI; +typedef struct _GdkDeviceManagerXIPrivate GdkDeviceManagerXIPrivate; +typedef struct _GdkDeviceManagerXIClass GdkDeviceManagerXIClass; + +struct _GdkDeviceManagerXI +{ + GdkDeviceManagerCore parent_object; + GdkDevice *core_pointer; + GdkDevice *core_keyboard; + + /*< private >*/ + GdkDeviceManagerXIPrivate *priv; +}; + +struct _GdkDeviceManagerXIClass +{ + GdkDeviceManagerCoreClass parent_class; +}; + +GType gdk_device_manager_xi_get_type (void) G_GNUC_CONST; + +G_END_DECLS + +#endif /* __GDK_DEVICE_MANAGER_XI_H__ */ diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c new file mode 100644 index 0000000000..9915a3a697 --- /dev/null +++ b/gdk/x11/gdkdevicemanager-xi2.c @@ -0,0 +1,1146 @@ +/* GDK - The GIMP Drawing Kit + * Copyright (C) 2009 Carlos Garnacho + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include +#include + +#include "gdkdevicemanager-xi2.h" +#include "gdkeventtranslator.h" +#include "gdkdevice-xi2.h" +#include "gdkkeysyms.h" +#include "gdkprivate-x11.h" +#include "gdkx.h" +#include "gdkalias.h" + +#define HAS_FOCUS(toplevel) ((toplevel)->has_focus || (toplevel)->has_pointer_focus) + + +static void gdk_device_manager_xi2_constructed (GObject *object); +static void gdk_device_manager_xi2_finalize (GObject *object); + +static GList * gdk_device_manager_xi2_list_devices (GdkDeviceManager *device_manager, + GdkDeviceType type); + +static void gdk_device_manager_xi2_event_translator_init (GdkEventTranslatorIface *iface); + +static gboolean gdk_device_manager_xi2_translate_event (GdkEventTranslator *translator, + GdkDisplay *display, + GdkEvent *event, + XEvent *xevent); +static GdkEventMask gdk_device_manager_xi2_get_handled_events (GdkEventTranslator *translator); +static void gdk_device_manager_xi2_select_window_events (GdkEventTranslator *translator, + Window window, + GdkEventMask event_mask); + + +G_DEFINE_TYPE_WITH_CODE (GdkDeviceManagerXI2, gdk_device_manager_xi2, GDK_TYPE_DEVICE_MANAGER, + G_IMPLEMENT_INTERFACE (GDK_TYPE_EVENT_TRANSLATOR, + gdk_device_manager_xi2_event_translator_init)) + + +static void +gdk_device_manager_xi2_class_init (GdkDeviceManagerXI2Class *klass) +{ + GdkDeviceManagerClass *device_manager_class = GDK_DEVICE_MANAGER_CLASS (klass); + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + object_class->constructed = gdk_device_manager_xi2_constructed; + object_class->finalize = gdk_device_manager_xi2_finalize; + + device_manager_class->list_devices = gdk_device_manager_xi2_list_devices; +} + +static void +gdk_device_manager_xi2_init (GdkDeviceManagerXI2 *device_manager) +{ + device_manager->id_table = g_hash_table_new_full (g_direct_hash, + g_direct_equal, + NULL, + (GDestroyNotify) g_object_unref); +} + +static void +_gdk_device_manager_xi2_select_events (GdkDeviceManager *device_manager, + Window xwindow, + XIEventMask *event_mask) +{ + GdkDisplay *display; + Display *xdisplay; + + display = gdk_device_manager_get_display (device_manager); + xdisplay = GDK_DISPLAY_XDISPLAY (display); + + XISelectEvents (xdisplay, xwindow, event_mask, 1); +} + +static void +translate_valuator_class (GdkDisplay *display, + GdkDevice *device, + XIValuatorClassInfo *info, + gint n_valuator) +{ + static gboolean initialized = FALSE; + static Atom label_atoms [GDK_AXIS_LAST] = { 0 }; + GdkAxisUse use = GDK_AXIS_IGNORE; + GdkAtom label; + gint i; + + if (!initialized) + { + label_atoms [GDK_AXIS_X] = gdk_x11_get_xatom_by_name_for_display (display, "Abs X"); + label_atoms [GDK_AXIS_Y] = gdk_x11_get_xatom_by_name_for_display (display, "Abs Y"); + label_atoms [GDK_AXIS_PRESSURE] = gdk_x11_get_xatom_by_name_for_display (display, "Abs Pressure"); + label_atoms [GDK_AXIS_XTILT] = gdk_x11_get_xatom_by_name_for_display (display, "Abs Tilt X"); + label_atoms [GDK_AXIS_YTILT] = gdk_x11_get_xatom_by_name_for_display (display, "Abs Tilt Y"); + label_atoms [GDK_AXIS_WHEEL] = gdk_x11_get_xatom_by_name_for_display (display, "Abs Wheel"); + initialized = TRUE; + } + + for (i = GDK_AXIS_IGNORE; i <= GDK_AXIS_LAST; i++) + { + if (label_atoms[i] == info->label) + { + use = i; + break; + } + } + + if (info->label != None) + label = gdk_x11_xatom_to_atom_for_display (display, info->label); + else + label = GDK_NONE; + + _gdk_device_add_axis (device, + label, + use, + info->min, + info->max, + info->resolution); +} + +static void +translate_device_classes (GdkDisplay *display, + GdkDevice *device, + XIAnyClassInfo **classes, + guint n_classes) +{ + gint i, n_valuator = 0; + + g_object_freeze_notify (G_OBJECT (device)); + + for (i = 0; i < n_classes; i++) + { + XIAnyClassInfo *class_info = classes[i]; + + switch (class_info->type) + { + case XIKeyClass: + { + XIKeyClassInfo *key_info = (XIKeyClassInfo *) class_info; + gint i; + + _gdk_device_set_keys (device, key_info->num_keycodes); + + for (i = 0; i < key_info->num_keycodes; i++) + gdk_device_set_key (device, i, key_info->keycodes[i], 0); + } + break; + case XIValuatorClass: + translate_valuator_class (display, device, + (XIValuatorClassInfo *) class_info, + n_valuator); + n_valuator++; + break; + default: + /* Ignore */ + break; + } + } + + g_object_thaw_notify (G_OBJECT (device)); +} + +static GdkDevice * +create_device (GdkDeviceManager *device_manager, + GdkDisplay *display, + XIDeviceInfo *dev) +{ + GdkInputSource input_source; + GdkDeviceType type; + GdkDevice *device; + GdkInputMode mode; + + if (dev->use == XIMasterKeyboard || dev->use == XISlaveKeyboard) + input_source = GDK_SOURCE_KEYBOARD; + else + { + gchar *tmp_name; + + tmp_name = g_ascii_strdown (dev->name, -1); + + if (strstr (tmp_name, "eraser")) + input_source = GDK_SOURCE_ERASER; + else if (strstr (tmp_name, "cursor")) + input_source = GDK_SOURCE_CURSOR; + else if (strstr (tmp_name, "wacom") || + strstr (tmp_name, "pen")) + input_source = GDK_SOURCE_PEN; + else + input_source = GDK_SOURCE_MOUSE; + + g_free (tmp_name); + } + + switch (dev->use) + { + case XIMasterKeyboard: + case XIMasterPointer: + type = GDK_DEVICE_TYPE_MASTER; + mode = GDK_MODE_SCREEN; + break; + case XISlaveKeyboard: + case XISlavePointer: + type = GDK_DEVICE_TYPE_SLAVE; + mode = GDK_MODE_DISABLED; + break; + case XIFloatingSlave: + default: + type = GDK_DEVICE_TYPE_FLOATING; + mode = GDK_MODE_DISABLED; + break; + } + + device = g_object_new (GDK_TYPE_DEVICE_XI2, + "name", dev->name, + "type", type, + "input-source", input_source, + "input-mode", mode, + "has-cursor", (dev->use == XIMasterPointer), + "display", display, + "device-manager", device_manager, + "device-id", dev->deviceid, + NULL); + + translate_device_classes (display, device, dev->classes, dev->num_classes); + + return device; +} + +static GdkDevice * +add_device (GdkDeviceManagerXI2 *device_manager, + XIDeviceInfo *dev, + gboolean emit_signal) +{ + GdkDisplay *display; + GdkDevice *device; + + display = gdk_device_manager_get_display (GDK_DEVICE_MANAGER (device_manager)); + device = create_device (GDK_DEVICE_MANAGER (device_manager), display, dev); + + g_hash_table_replace (device_manager->id_table, + GINT_TO_POINTER (dev->deviceid), + device); + + if (dev->use == XIMasterPointer || dev->use == XIMasterKeyboard) + device_manager->master_devices = g_list_append (device_manager->master_devices, device); + else if (dev->use == XISlavePointer || dev->use == XISlaveKeyboard) + device_manager->slave_devices = g_list_append (device_manager->slave_devices, device); + else if (dev->use == XIFloatingSlave) + device_manager->floating_devices = g_list_append (device_manager->floating_devices, device); + else + g_warning ("Unhandled device: %s\n", device->name); + + if (emit_signal) + g_signal_emit_by_name (device_manager, "device-added", device); + + return device; +} + +static void +remove_device (GdkDeviceManagerXI2 *device_manager, + int device_id) +{ + GdkDevice *device; + + device = g_hash_table_lookup (device_manager->id_table, + GINT_TO_POINTER (device_id)); + + if (device) + { + device_manager->master_devices = g_list_remove (device_manager->master_devices, device); + device_manager->slave_devices = g_list_remove (device_manager->slave_devices, device); + device_manager->floating_devices = g_list_remove (device_manager->floating_devices, device); + + g_signal_emit_by_name (device_manager, "device-removed", device); + + g_object_run_dispose (G_OBJECT (device)); + + g_hash_table_remove (device_manager->id_table, + GINT_TO_POINTER (device_id)); + } +} + +static void +relate_devices (gpointer key, + gpointer value, + gpointer user_data) +{ + GdkDeviceManagerXI2 *device_manager; + GdkDevice *device, *relative; + + device_manager = user_data; + device = g_hash_table_lookup (device_manager->id_table, key); + relative = g_hash_table_lookup (device_manager->id_table, value); + + _gdk_device_set_associated_device (device, relative); + _gdk_device_set_associated_device (relative, device); +} + +static void +gdk_device_manager_xi2_constructed (GObject *object) +{ + GdkDeviceManagerXI2 *device_manager_xi2; + GdkDisplay *display; + GdkScreen *screen; + GHashTable *relations; + Display *xdisplay; + XIDeviceInfo *info, *dev; + int ndevices, i; + XIEventMask event_mask; + unsigned char mask[2] = { 0 }; + + device_manager_xi2 = GDK_DEVICE_MANAGER_XI2 (object); + display = gdk_device_manager_get_display (GDK_DEVICE_MANAGER (object)); + xdisplay = GDK_DISPLAY_XDISPLAY (display); + relations = g_hash_table_new (NULL, NULL); + + info = XIQueryDevice(xdisplay, XIAllDevices, &ndevices); + + /* Initialize devices list */ + for (i = 0; i < ndevices; i++) + { + GdkDevice *device; + + dev = &info[i]; + device = add_device (device_manager_xi2, dev, FALSE); + + if (dev->use == XIMasterPointer || + dev->use == XIMasterKeyboard) + { + g_hash_table_insert (relations, + GINT_TO_POINTER (dev->deviceid), + GINT_TO_POINTER (dev->attachment)); + } + } + + XIFreeDeviceInfo(info); + + /* Stablish relationships between devices */ + g_hash_table_foreach (relations, relate_devices, object); + g_hash_table_destroy (relations); + + /* Connect to hierarchy change events */ + screen = gdk_display_get_default_screen (display); + XISetMask (mask, XI_HierarchyChanged); + XISetMask (mask, XI_DeviceChanged); + + event_mask.deviceid = XIAllDevices; + event_mask.mask_len = sizeof (mask); + event_mask.mask = mask; + + _gdk_device_manager_xi2_select_events (GDK_DEVICE_MANAGER (object), + GDK_WINDOW_XWINDOW (gdk_screen_get_root_window (screen)), + &event_mask); +} + +static void +gdk_device_manager_xi2_finalize (GObject *object) +{ + GdkDeviceManagerXI2 *device_manager_xi2; + + device_manager_xi2 = GDK_DEVICE_MANAGER_XI2 (object); + + g_list_foreach (device_manager_xi2->master_devices, (GFunc) g_object_unref, NULL); + g_list_free (device_manager_xi2->master_devices); + + g_list_foreach (device_manager_xi2->slave_devices, (GFunc) g_object_unref, NULL); + g_list_free (device_manager_xi2->slave_devices); + + g_list_foreach (device_manager_xi2->floating_devices, (GFunc) g_object_unref, NULL); + g_list_free (device_manager_xi2->floating_devices); + + g_hash_table_destroy (device_manager_xi2->id_table); + + G_OBJECT_CLASS (gdk_device_manager_xi2_parent_class)->finalize (object); +} + +static GList * +gdk_device_manager_xi2_list_devices (GdkDeviceManager *device_manager, + GdkDeviceType type) +{ + GdkDeviceManagerXI2 *device_manager_xi2; + GList *list = NULL; + + device_manager_xi2 = GDK_DEVICE_MANAGER_XI2 (device_manager); + + switch (type) + { + case GDK_DEVICE_TYPE_MASTER: + list = device_manager_xi2->master_devices; + break; + case GDK_DEVICE_TYPE_SLAVE: + list = device_manager_xi2->slave_devices; + break; + case GDK_DEVICE_TYPE_FLOATING: + list = device_manager_xi2->floating_devices; + break; + default: + g_assert_not_reached (); + } + + return g_list_copy (list); +} + +static void +gdk_device_manager_xi2_event_translator_init (GdkEventTranslatorIface *iface) +{ + iface->translate_event = gdk_device_manager_xi2_translate_event; + iface->get_handled_events = gdk_device_manager_xi2_get_handled_events; + iface->select_window_events = gdk_device_manager_xi2_select_window_events; +} + +static void +handle_hierarchy_changed (GdkDeviceManagerXI2 *device_manager, + XIHierarchyEvent *ev) +{ + GdkDevice *device; + gint i; + + /* We only care about enabled devices */ + if (!(ev->flags & XIDeviceEnabled) && + !(ev->flags & XIDeviceDisabled)) + return; + + for (i = 0; i < ev->num_info; i++) + { + if (ev->info[i].flags & XIDeviceEnabled) + { + GdkDisplay *display; + Display *xdisplay; + XIDeviceInfo *info; + int ndevices; + + display = gdk_device_manager_get_display (GDK_DEVICE_MANAGER (device_manager)); + xdisplay = GDK_DISPLAY_XDISPLAY (display); + + info = XIQueryDevice(xdisplay, ev->info[i].deviceid, &ndevices); + device = add_device (device_manager, &info[0], TRUE); + XIFreeDeviceInfo(info); + } + else if (ev->info[i].flags & XIDeviceDisabled) + remove_device (device_manager, ev->info[i].deviceid); + } +} + +static void +handle_device_changed (GdkDeviceManagerXI2 *device_manager, + XIDeviceChangedEvent *ev) +{ + GdkDisplay *display; + GdkDevice *device; + + display = gdk_device_manager_get_display (GDK_DEVICE_MANAGER (device_manager)); + device = g_hash_table_lookup (device_manager->id_table, + GUINT_TO_POINTER (ev->deviceid)); + + _gdk_device_reset_axes (device); + translate_device_classes (display, device, ev->classes, ev->num_classes); +} + +static GdkCrossingMode +translate_crossing_mode (int mode) +{ + switch (mode) + { + case NotifyNormal: + return GDK_CROSSING_NORMAL; + case NotifyGrab: + return GDK_CROSSING_GRAB; + case NotifyUngrab: + return GDK_CROSSING_UNGRAB; + default: + g_assert_not_reached (); + } +} + +static GdkNotifyType +translate_notify_type (int detail) +{ + switch (detail) + { + case NotifyInferior: + return GDK_NOTIFY_INFERIOR; + case NotifyAncestor: + return GDK_NOTIFY_ANCESTOR; + case NotifyVirtual: + return GDK_NOTIFY_VIRTUAL; + case NotifyNonlinear: + return GDK_NOTIFY_NONLINEAR; + case NotifyNonlinearVirtual: + return GDK_NOTIFY_NONLINEAR_VIRTUAL; + default: + g_assert_not_reached (); + } +} + +static gboolean +set_screen_from_root (GdkDisplay *display, + GdkEvent *event, + Window xrootwin) +{ + GdkScreen *screen; + + screen = _gdk_x11_display_screen_for_xrootwin (display, xrootwin); + + if (screen) + { + gdk_event_set_screen (event, screen); + + return TRUE; + } + + return FALSE; +} + +static void +set_user_time (GdkEvent *event) +{ + GdkWindow *window; + guint32 time; + + window = gdk_window_get_toplevel (event->any.window); + g_return_if_fail (GDK_IS_WINDOW (window)); + + time = gdk_event_get_time (event); + + /* If an event doesn't have a valid timestamp, we shouldn't use it + * to update the latest user interaction time. + */ + if (time != GDK_CURRENT_TIME) + gdk_x11_window_set_user_time (window, time); +} + +static void +translate_keyboard_string (GdkEventKey *event) +{ + gunichar c = 0; + gchar buf[7]; + + /* Fill in event->string crudely, since various programs + * depend on it. + */ + event->string = NULL; + + if (event->keyval != GDK_VoidSymbol) + c = gdk_keyval_to_unicode (event->keyval); + + if (c) + { + gsize bytes_written; + gint len; + + /* Apply the control key - Taken from Xlib + */ + if (event->state & GDK_CONTROL_MASK) + { + if ((c >= '@' && c < '\177') || c == ' ') c &= 0x1F; + else if (c == '2') + { + event->string = g_memdup ("\0\0", 2); + event->length = 1; + buf[0] = '\0'; + return; + } + else if (c >= '3' && c <= '7') c -= ('3' - '\033'); + else if (c == '8') c = '\177'; + else if (c == '/') c = '_' & 0x1F; + } + + len = g_unichar_to_utf8 (c, buf); + buf[len] = '\0'; + + event->string = g_locale_from_utf8 (buf, len, + NULL, &bytes_written, + NULL); + if (event->string) + event->length = bytes_written; + } + else if (event->keyval == GDK_Escape) + { + event->length = 1; + event->string = g_strdup ("\033"); + } + else if (event->keyval == GDK_Return || + event->keyval == GDK_KP_Enter) + { + event->length = 1; + event->string = g_strdup ("\r"); + } + + if (!event->string) + { + event->length = 0; + event->string = g_strdup (""); + } +} + +static void +generate_focus_event (GdkWindow *window, + gboolean in) +{ + GdkEvent event; + + event.type = GDK_FOCUS_CHANGE; + event.focus_change.window = window; + event.focus_change.send_event = FALSE; + event.focus_change.in = in; + + gdk_event_put (&event); +} + +static void +handle_focus_change (GdkWindow *window, + gint detail, + gint mode, + gboolean in) +{ + GdkToplevelX11 *toplevel; + gboolean had_focus; + + toplevel = _gdk_x11_window_get_toplevel (window); + + if (!toplevel) + return; + + had_focus = HAS_FOCUS (toplevel); + + switch (detail) + { + case NotifyAncestor: + case NotifyVirtual: + /* When the focus moves from an ancestor of the window to + * the window or a descendent of the window, *and* the + * pointer is inside the window, then we were previously + * receiving keystroke events in the has_pointer_focus + * case and are now receiving them in the + * has_focus_window case. + */ + if (toplevel->has_pointer && + mode != NotifyGrab && + mode != NotifyUngrab) + toplevel->has_pointer_focus = (in) ? FALSE : TRUE; + + /* fall through */ + case NotifyNonlinear: + case NotifyNonlinearVirtual: + if (mode != NotifyGrab && + mode != NotifyUngrab) + toplevel->has_focus_window = (in) ? TRUE : FALSE; + /* We pretend that the focus moves to the grab + * window, so we pay attention to NotifyGrab + * NotifyUngrab, and ignore NotifyWhileGrabbed + */ + if (mode != NotifyWhileGrabbed) + toplevel->has_focus = (in) ? TRUE : FALSE; + break; + case NotifyPointer: + /* The X server sends NotifyPointer/NotifyGrab, + * but the pointer focus is ignored while a + * grab is in effect + */ + if (mode != NotifyGrab && + mode != NotifyUngrab) + toplevel->has_pointer_focus = (in) ? TRUE :FALSE; + break; + case NotifyInferior: + case NotifyPointerRoot: + case NotifyDetailNone: + break; + } + + if (HAS_FOCUS (toplevel) != had_focus) + generate_focus_event (window, (in) ? TRUE : FALSE); +} + +static gdouble * +translate_axes (GdkDevice *device, + gdouble x, + gdouble y, + GdkWindow *window, + XIValuatorState *valuators) +{ + guint n_axes, i; + gint width, height; + gdouble *axes; + double *vals; + + g_object_get (device, "n-axes", &n_axes, NULL); + + axes = g_new0 (gdouble, n_axes); + vals = valuators->values; + + gdk_drawable_get_size (GDK_DRAWABLE (window), &width, &height); + + for (i = 0; i < valuators->mask_len * 8; i++) + { + GdkAxisUse use; + gdouble val; + + if (!XIMaskIsSet (valuators->mask, i)) + continue; + + use = _gdk_device_get_axis_use (device, i); + val = *vals++; + + switch (use) + { + case GDK_AXIS_X: + case GDK_AXIS_Y: + if (device->mode == GDK_MODE_WINDOW) + _gdk_device_translate_window_coord (device, window, i, val, &axes[i]); + else + { + if (use == GDK_AXIS_X) + axes[i] = x; + else + axes[i] = y; + } + break; + default: + _gdk_device_translate_axis (device, i, val, &axes[i]); + break; + } + } + + return axes; +} + +static gboolean +is_parent_of (GdkWindow *parent, + GdkWindow *child) +{ + GdkWindow *w; + + w = child; + while (w != NULL) + { + if (w == parent) + return TRUE; + + w = gdk_window_get_parent (w); + } + + return FALSE; +} + +static GdkWindow * +get_event_window (GdkEventTranslator *translator, + XIEvent *ev) +{ + GdkDisplay *display; + GdkWindow *window = NULL; + + display = gdk_device_manager_get_display (GDK_DEVICE_MANAGER (translator)); + + switch (ev->evtype) + { + case XI_KeyPress: + case XI_KeyRelease: + case XI_ButtonPress: + case XI_ButtonRelease: + case XI_Motion: + { + XIDeviceEvent *xev = (XIDeviceEvent *) ev; + + window = gdk_window_lookup_for_display (display, xev->event); + + /* Apply keyboard grabs to non-native windows */ + if (ev->evtype == XI_KeyPress || ev->evtype == XI_KeyRelease) + { + GdkDeviceGrabInfo *info; + GdkDevice *device; + gulong serial; + + device = g_hash_table_lookup (GDK_DEVICE_MANAGER_XI2 (translator)->id_table, + GUINT_TO_POINTER (((XIDeviceEvent *) ev)->deviceid)); + + serial = _gdk_windowing_window_get_next_serial (display); + info = _gdk_display_has_device_grab (display, device, serial); + + if (info && + (!is_parent_of (info->window, window) || + !info->owner_events)) + { + /* Report key event against grab window */ + window = info->window; + } + } + } + break; + case XI_Enter: + case XI_Leave: + case XI_FocusIn: + case XI_FocusOut: + { + XIEnterEvent *xev = (XIEnterEvent *) ev; + + window = gdk_window_lookup_for_display (display, xev->event); + } + break; + } + + return window; +} + +static gboolean +gdk_device_manager_xi2_translate_event (GdkEventTranslator *translator, + GdkDisplay *display, + GdkEvent *event, + XEvent *xevent) +{ + GdkDeviceManagerXI2 *device_manager; + XGenericEventCookie *cookie; + gboolean return_val = TRUE; + GdkWindow *window; + XIEvent *ev; + Display *dpy; + + dpy = GDK_DISPLAY_XDISPLAY (display); + device_manager = (GdkDeviceManagerXI2 *) translator; + cookie = &xevent->xcookie; + + if (!XGetEventData (dpy, cookie)) + return FALSE; + + if (cookie->type != GenericEvent || + cookie->extension != device_manager->opcode) + { + XFreeEventData (dpy, cookie); + return FALSE; + } + + ev = (XIEvent *) cookie->data; + + window = get_event_window (translator, ev); + + if (window && GDK_WINDOW_DESTROYED (window)) + { + XFreeEventData (dpy, cookie); + return FALSE; + } + + if (ev->evtype == XI_Motion || + ev->evtype == XI_ButtonRelease) + { + if (_gdk_moveresize_handle_event (xevent)) + { + XFreeEventData (dpy, cookie); + return FALSE; + } + } + + switch (ev->evtype) + { + case XI_HierarchyChanged: + handle_hierarchy_changed (device_manager, + (XIHierarchyEvent *) ev); + return_val = FALSE; + break; + case XI_DeviceChanged: + handle_device_changed (device_manager, + (XIDeviceChangedEvent *) ev); + return_val = FALSE; + break; + case XI_KeyPress: + case XI_KeyRelease: + { + XIDeviceEvent *xev = (XIDeviceEvent *) ev; + GdkKeymap *keymap = gdk_keymap_get_for_display (display); + GdkModifierType consumed, state; + GdkDevice *device; + + event->key.type = xev->evtype == XI_KeyPress ? GDK_KEY_PRESS : GDK_KEY_RELEASE; + + event->key.window = window; + + event->key.time = xev->time; + event->key.state = gdk_device_xi2_translate_state (&xev->mods, &xev->buttons); + event->key.group = _gdk_x11_get_group_for_state (display, event->key.state); + + event->key.hardware_keycode = xev->detail; + event->key.is_modifier = _gdk_keymap_key_is_modifier (keymap, event->key.hardware_keycode); + + device = g_hash_table_lookup (device_manager->id_table, + GUINT_TO_POINTER (xev->deviceid)); + gdk_event_set_device (event, device); + + event->key.keyval = GDK_VoidSymbol; + + gdk_keymap_translate_keyboard_state (keymap, + event->key.hardware_keycode, + event->key.state, + event->key.group, + &event->key.keyval, + NULL, NULL, &consumed); + + state = event->key.state & ~consumed; + _gdk_keymap_add_virtual_modifiers_compat (keymap, &state); + event->key.state |= state; + + translate_keyboard_string ((GdkEventKey *) event); + + if (ev->evtype == XI_KeyPress) + set_user_time (event); + + /* FIXME: emulate autorepeat on key + * release? XI2 seems attached to Xkb. + */ + } + + break; + case XI_ButtonPress: + case XI_ButtonRelease: + { + XIDeviceEvent *xev = (XIDeviceEvent *) ev; + + switch (xev->detail) + { + case 4: + case 5: + case 6: + case 7: + event->scroll.type = GDK_SCROLL; + + if (xev->detail == 4) + event->scroll.direction = GDK_SCROLL_UP; + else if (xev->detail == 5) + event->scroll.direction = GDK_SCROLL_DOWN; + else if (xev->detail == 6) + event->scroll.direction = GDK_SCROLL_LEFT; + else + event->scroll.direction = GDK_SCROLL_RIGHT; + + event->scroll.window = window; + event->scroll.time = xev->time; + event->scroll.x = (gdouble) xev->event_x; + event->scroll.y = (gdouble) xev->event_y; + event->scroll.x_root = (gdouble) xev->root_x; + event->scroll.y_root = (gdouble) xev->root_y; + + event->scroll.device = g_hash_table_lookup (device_manager->id_table, + GUINT_TO_POINTER (xev->deviceid)); + + event->scroll.state = gdk_device_xi2_translate_state (&xev->mods, &xev->buttons); + break; + default: + event->button.type = (ev->evtype == XI_ButtonPress) ? GDK_BUTTON_PRESS : GDK_BUTTON_RELEASE; + + event->button.window = window; + event->button.time = xev->time; + event->button.x = (gdouble) xev->event_x; + event->button.y = (gdouble) xev->event_y; + event->button.x_root = (gdouble) xev->root_x; + event->button.y_root = (gdouble) xev->root_y; + + event->button.device = g_hash_table_lookup (device_manager->id_table, + GUINT_TO_POINTER (xev->deviceid)); + + event->button.axes = translate_axes (event->button.device, + event->button.x, + event->button.y, + event->button.window, + &xev->valuators); + + if (event->button.device->mode == GDK_MODE_WINDOW) + { + GdkDevice *device = event->button.device; + + /* Update event coordinates from axes */ + gdk_device_get_axis (device, event->button.axes, GDK_AXIS_X, &event->button.x); + gdk_device_get_axis (device, event->button.axes, GDK_AXIS_Y, &event->button.y); + } + + event->button.state = gdk_device_xi2_translate_state (&xev->mods, &xev->buttons); + event->button.button = xev->detail; + } + + if (!set_screen_from_root (display, event, xev->root)) + { + return_val = FALSE; + break; + } + + set_user_time (event); + + break; + } + case XI_Motion: + { + XIDeviceEvent *xev = (XIDeviceEvent *) ev; + + event->motion.type = GDK_MOTION_NOTIFY; + + event->motion.window = window; + + event->motion.time = xev->time; + event->motion.x = (gdouble) xev->event_x; + event->motion.y = (gdouble) xev->event_y; + event->motion.x_root = (gdouble) xev->root_x; + event->motion.y_root = (gdouble) xev->root_y; + + event->motion.device = g_hash_table_lookup (device_manager->id_table, + GINT_TO_POINTER (xev->deviceid)); + + event->motion.state = gdk_device_xi2_translate_state (&xev->mods, &xev->buttons); + + /* There doesn't seem to be motion hints in XI */ + event->motion.is_hint = FALSE; + + event->motion.axes = translate_axes (event->motion.device, + event->motion.x, + event->motion.y, + event->motion.window, + &xev->valuators); + + if (event->motion.device->mode == GDK_MODE_WINDOW) + { + GdkDevice *device = event->motion.device; + + /* Update event coordinates from axes */ + gdk_device_get_axis (device, event->motion.axes, GDK_AXIS_X, &event->motion.x); + gdk_device_get_axis (device, event->motion.axes, GDK_AXIS_Y, &event->motion.y); + } + } + break; + case XI_Enter: + case XI_Leave: + { + XIEnterEvent *xev = (XIEnterEvent *) ev; + GdkDevice *device; + + event->crossing.type = (ev->evtype == XI_Enter) ? GDK_ENTER_NOTIFY : GDK_LEAVE_NOTIFY; + + event->crossing.x = (gdouble) xev->event_x; + event->crossing.y = (gdouble) xev->event_y; + event->crossing.x_root = (gdouble) xev->root_x; + event->crossing.y_root = (gdouble) xev->root_y; + event->crossing.time = xev->time; + event->crossing.focus = xev->focus; + + event->crossing.window = window; + event->crossing.subwindow = gdk_window_lookup_for_display (display, xev->child); + + device = g_hash_table_lookup (device_manager->id_table, + GINT_TO_POINTER (xev->deviceid)); + gdk_event_set_device (event, device); + + event->crossing.mode = translate_crossing_mode (xev->mode); + event->crossing.detail = translate_notify_type (xev->detail); + event->crossing.state = gdk_device_xi2_translate_state (&xev->mods, &xev->buttons); + } + break; + case XI_FocusIn: + case XI_FocusOut: + { + XIEnterEvent *xev = (XIEnterEvent *) ev; + + handle_focus_change (window, xev->detail, xev->mode, + (ev->evtype == XI_FocusIn) ? TRUE : FALSE); + + return_val = FALSE; + } + default: + return_val = FALSE; + break; + } + + event->any.send_event = cookie->send_event; + + if (return_val) + { + if (event->any.window) + g_object_ref (event->any.window); + + if (((event->any.type == GDK_ENTER_NOTIFY) || + (event->any.type == GDK_LEAVE_NOTIFY)) && + (event->crossing.subwindow != NULL)) + g_object_ref (event->crossing.subwindow); + } + else + { + /* Mark this event as having no resources to be freed */ + event->any.window = NULL; + event->any.type = GDK_NOTHING; + } + + XFreeEventData (dpy, cookie); + + return return_val; +} + +static GdkEventMask +gdk_device_manager_xi2_get_handled_events (GdkEventTranslator *translator) +{ + return (GDK_KEY_PRESS_MASK | + GDK_KEY_RELEASE_MASK | + GDK_BUTTON_PRESS_MASK | + GDK_BUTTON_RELEASE_MASK | + GDK_SCROLL_MASK | + GDK_ENTER_NOTIFY_MASK | + GDK_LEAVE_NOTIFY_MASK | + GDK_POINTER_MOTION_MASK | + GDK_POINTER_MOTION_HINT_MASK | + GDK_BUTTON1_MOTION_MASK | + GDK_BUTTON2_MOTION_MASK | + GDK_BUTTON3_MOTION_MASK | + GDK_BUTTON_MOTION_MASK | + GDK_FOCUS_CHANGE_MASK); +} + +static void +gdk_device_manager_xi2_select_window_events (GdkEventTranslator *translator, + Window window, + GdkEventMask evmask) +{ + GdkDeviceManager *device_manager; + XIEventMask event_mask; + + device_manager = GDK_DEVICE_MANAGER (translator); + + event_mask.deviceid = XIAllMasterDevices; + event_mask.mask = gdk_device_xi2_translate_event_mask (evmask, &event_mask.mask_len); + + _gdk_device_manager_xi2_select_events (device_manager, window, &event_mask); + g_free (event_mask.mask); +} + +#define __GDK_DEVICE_MANAGER_XI2_C__ +#include "gdkaliasdef.c" diff --git a/gdk/x11/gdkdevicemanager-xi2.h b/gdk/x11/gdkdevicemanager-xi2.h new file mode 100644 index 0000000000..828aec3f48 --- /dev/null +++ b/gdk/x11/gdkdevicemanager-xi2.h @@ -0,0 +1,61 @@ +/* GDK - The GIMP Drawing Kit + * Copyright (C) 2009 Carlos Garnacho + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GDK_DEVICE_MANAGER_XI2_H__ +#define __GDK_DEVICE_MANAGER_XI2_H__ + +#include +#include + +G_BEGIN_DECLS + +#define GDK_TYPE_DEVICE_MANAGER_XI2 (gdk_device_manager_xi2_get_type ()) +#define GDK_DEVICE_MANAGER_XI2(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_DEVICE_MANAGER_XI2, GdkDeviceManagerXI2)) +#define GDK_DEVICE_MANAGER_XI2_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_DEVICE_MANAGER_XI2, GdkDeviceManagerXI2Class)) +#define GDK_IS_DEVICE_MANAGER_XI2(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_DEVICE_MANAGER_XI2)) +#define GDK_IS_DEVICE_MANAGER_XI2_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_DEVICE_MANAGER_XI2)) +#define GDK_DEVICE_MANAGER_XI2_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_DEVICE_MANAGER_XI2, GdkDeviceManagerXI2Class)) + +typedef struct _GdkDeviceManagerXI2 GdkDeviceManagerXI2; +typedef struct _GdkDeviceManagerXI2Class GdkDeviceManagerXI2Class; + +struct _GdkDeviceManagerXI2 +{ + GdkDeviceManager parent_object; + + GHashTable *id_table; + + GList *master_devices; + GList *slave_devices; + GList *floating_devices; + + int opcode; +}; + +struct _GdkDeviceManagerXI2Class +{ + GdkDeviceManagerClass parent_class; +}; + +GType gdk_device_manager_xi2_get_type (void) G_GNUC_CONST; + + +G_END_DECLS + +#endif /* __GDK_DEVICE_MANAGER_XI2_H__ */ diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c index c0cbc99f52..b77c2ceae8 100644 --- a/gdk/x11/gdkdisplay-x11.c +++ b/gdk/x11/gdkdisplay-x11.c @@ -34,10 +34,13 @@ #include "gdkasync.h" #include "gdkdisplay.h" #include "gdkdisplay-x11.h" +#include "gdkeventsource.h" +#include "gdkeventtranslator.h" #include "gdkscreen.h" #include "gdkscreen-x11.h" #include "gdkinternals.h" -#include "gdkinputprivate.h" +#include "gdkdeviceprivate.h" +#include "gdkdevicemanager.h" #include "xsettings-client.h" #include "gdkalias.h" @@ -69,6 +72,13 @@ static void gdk_display_x11_dispose (GObject *object); static void gdk_display_x11_finalize (GObject *object); +static void gdk_display_x11_event_translator_init (GdkEventTranslatorIface *iface); + +static gboolean gdk_display_x11_translate_event (GdkEventTranslator *translator, + GdkDisplay *display, + GdkEvent *event, + XEvent *xevent); + #ifdef HAVE_X11R6 static void gdk_internal_connection_watch (Display *display, XPointer arg, @@ -77,6 +87,14 @@ static void gdk_internal_connection_watch (Display *display, XPointer *watch_data); #endif /* HAVE_X11R6 */ +typedef struct _GdkEventTypeX11 GdkEventTypeX11; + +struct _GdkEventTypeX11 +{ + gint base; + gint n_events; +}; + /* Note that we never *directly* use WM_LOCALE_NAME, WM_PROTOCOLS, * but including them here has the side-effect of getting them * into the internal Xlib cache @@ -120,7 +138,10 @@ static const char *const precache_atoms[] = { "_NET_VIRTUAL_ROOTS" }; -G_DEFINE_TYPE (GdkDisplayX11, _gdk_display_x11, GDK_TYPE_DISPLAY) +G_DEFINE_TYPE_WITH_CODE (GdkDisplayX11, _gdk_display_x11, GDK_TYPE_DISPLAY, + G_IMPLEMENT_INTERFACE (GDK_TYPE_EVENT_TRANSLATOR, + gdk_display_x11_event_translator_init)) + static void _gdk_display_x11_class_init (GdkDisplayX11Class * class) @@ -136,6 +157,1013 @@ _gdk_display_x11_init (GdkDisplayX11 *display) { } +static void +gdk_display_x11_event_translator_init (GdkEventTranslatorIface *iface) +{ + iface->translate_event = gdk_display_x11_translate_event; +} + +static void +do_net_wm_state_changes (GdkWindow *window) +{ + GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (window); + GdkWindowState old_state; + + if (GDK_WINDOW_DESTROYED (window) || + gdk_window_get_window_type (window) != GDK_WINDOW_TOPLEVEL) + return; + + old_state = gdk_window_get_state (window); + + /* For found_sticky to remain TRUE, we have to also be on desktop + * 0xFFFFFFFF + */ + if (old_state & GDK_WINDOW_STATE_STICKY) + { + if (!(toplevel->have_sticky && toplevel->on_all_desktops)) + gdk_synthesize_window_state (window, + GDK_WINDOW_STATE_STICKY, + 0); + } + else + { + if (toplevel->have_sticky || toplevel->on_all_desktops) + gdk_synthesize_window_state (window, + 0, + GDK_WINDOW_STATE_STICKY); + } + + if (old_state & GDK_WINDOW_STATE_FULLSCREEN) + { + if (!toplevel->have_fullscreen) + gdk_synthesize_window_state (window, + GDK_WINDOW_STATE_FULLSCREEN, + 0); + } + else + { + if (toplevel->have_fullscreen) + gdk_synthesize_window_state (window, + 0, + GDK_WINDOW_STATE_FULLSCREEN); + } + + /* Our "maximized" means both vertical and horizontal; if only one, + * we don't expose that via GDK + */ + if (old_state & GDK_WINDOW_STATE_MAXIMIZED) + { + if (!(toplevel->have_maxvert && toplevel->have_maxhorz)) + gdk_synthesize_window_state (window, + GDK_WINDOW_STATE_MAXIMIZED, + 0); + } + else + { + if (toplevel->have_maxvert && toplevel->have_maxhorz) + gdk_synthesize_window_state (window, + 0, + GDK_WINDOW_STATE_MAXIMIZED); + } +} + +static void +gdk_check_wm_desktop_changed (GdkWindow *window) +{ + GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (window); + GdkDisplay *display = GDK_WINDOW_DISPLAY (window); + + Atom type; + gint format; + gulong nitems; + gulong bytes_after; + guchar *data; + gulong *desktop; + + type = None; + gdk_error_trap_push (); + XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), + GDK_WINDOW_XID (window), + gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_DESKTOP"), + 0, G_MAXLONG, False, XA_CARDINAL, &type, + &format, &nitems, + &bytes_after, &data); + gdk_error_trap_pop (); + + if (type != None) + { + desktop = (gulong *)data; + toplevel->on_all_desktops = (*desktop == 0xFFFFFFFF); + XFree (desktop); + } + else + toplevel->on_all_desktops = FALSE; + + do_net_wm_state_changes (window); +} + +static void +gdk_check_wm_state_changed (GdkWindow *window) +{ + GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (window); + GdkDisplay *display = GDK_WINDOW_DISPLAY (window); + + Atom type; + gint format; + gulong nitems; + gulong bytes_after; + guchar *data; + Atom *atoms = NULL; + gulong i; + + gboolean had_sticky = toplevel->have_sticky; + + toplevel->have_sticky = FALSE; + toplevel->have_maxvert = FALSE; + toplevel->have_maxhorz = FALSE; + toplevel->have_fullscreen = FALSE; + + type = None; + gdk_error_trap_push (); + XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window), + gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE"), + 0, G_MAXLONG, False, XA_ATOM, &type, &format, &nitems, + &bytes_after, &data); + gdk_error_trap_pop (); + + if (type != None) + { + Atom sticky_atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE_STICKY"); + Atom maxvert_atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE_MAXIMIZED_VERT"); + Atom maxhorz_atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE_MAXIMIZED_HORZ"); + Atom fullscreen_atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE_FULLSCREEN"); + + atoms = (Atom *)data; + + i = 0; + while (i < nitems) + { + if (atoms[i] == sticky_atom) + toplevel->have_sticky = TRUE; + else if (atoms[i] == maxvert_atom) + toplevel->have_maxvert = TRUE; + else if (atoms[i] == maxhorz_atom) + toplevel->have_maxhorz = TRUE; + else if (atoms[i] == fullscreen_atom) + toplevel->have_fullscreen = TRUE; + + ++i; + } + + XFree (atoms); + } + + /* When have_sticky is turned on, we have to check the DESKTOP property + * as well. + */ + if (toplevel->have_sticky && !had_sticky) + gdk_check_wm_desktop_changed (window); + else + do_net_wm_state_changes (window); +} + +static GdkWindow * +get_event_window (GdkEventTranslator *translator, + XEvent *xevent) +{ + GdkDisplay *display; + Window xwindow; + + display = (GdkDisplay *) translator; + + switch (xevent->type) + { + case DestroyNotify: + xwindow = xevent->xdestroywindow.window; + break; + case UnmapNotify: + xwindow = xevent->xunmap.window; + break; + case MapNotify: + xwindow = xevent->xmap.window; + break; + case ConfigureNotify: + xwindow = xevent->xconfigure.window; + break; + default: + xwindow = xevent->xany.window; + } + + return gdk_window_lookup_for_display (display, xwindow); +} + +static gboolean +gdk_display_x11_translate_event (GdkEventTranslator *translator, + GdkDisplay *display, + GdkEvent *event, + XEvent *xevent) +{ + GdkWindow *window; + GdkWindowObject *window_private; + GdkWindowImplX11 *window_impl = NULL; + GdkScreen *screen = NULL; + GdkScreenX11 *screen_x11 = NULL; + GdkToplevelX11 *toplevel = NULL; + GdkDisplayX11 *display_x11 = GDK_DISPLAY_X11 (display); + gboolean return_val; + Window xwindow = None; + + /* Find the GdkWindow that this event relates to. + * Basically this means substructure events + * are reported same as structure events + */ + window = get_event_window (translator, xevent); + window_private = (GdkWindowObject *) window; + + if (window) + { + /* We may receive events such as NoExpose/GraphicsExpose + * and ShmCompletion for pixmaps + */ + if (!GDK_IS_WINDOW (window)) + return FALSE; + + screen = GDK_WINDOW_SCREEN (window); + screen_x11 = GDK_SCREEN_X11 (screen); + toplevel = _gdk_x11_window_get_toplevel (window); + window_impl = GDK_WINDOW_IMPL_X11 (window_private->impl); + xwindow = GDK_WINDOW_XID (window); + + g_object_ref (window); + } + + event->any.window = window; + event->any.send_event = xevent->xany.send_event ? TRUE : FALSE; + + if (window_private && GDK_WINDOW_DESTROYED (window)) + { + if (xevent->type != DestroyNotify) + { + return_val = FALSE; + goto done; + } + } + + if (xevent->type == DestroyNotify) + { + int i, n; + + n = gdk_display_get_n_screens (display); + for (i = 0; i < n; i++) + { + screen = gdk_display_get_screen (display, i); + screen_x11 = GDK_SCREEN_X11 (screen); + + if (screen_x11->wmspec_check_window == xwindow) + { + screen_x11->wmspec_check_window = None; + screen_x11->last_wmspec_check_time = 0; + g_free (screen_x11->window_manager_name); + screen_x11->window_manager_name = g_strdup ("unknown"); + + /* careful, reentrancy */ + _gdk_x11_screen_window_manager_changed (screen); + + return_val = FALSE; + goto done; + } + } + } + + /* We do a "manual" conversion of the XEvent to a + * GdkEvent. The structures are mostly the same so + * the conversion is fairly straightforward. We also + * optionally print debugging info regarding events + * received. + */ + + return_val = TRUE; + + switch (xevent->type) + { + case KeymapNotify: + GDK_NOTE (EVENTS, + g_message ("keymap notify")); + + /* Not currently handled */ + return_val = FALSE; + break; + + case Expose: + GDK_NOTE (EVENTS, + g_message ("expose:\t\twindow: %ld %d x,y: %d %d w,h: %d %d%s", + xevent->xexpose.window, xevent->xexpose.count, + xevent->xexpose.x, xevent->xexpose.y, + xevent->xexpose.width, xevent->xexpose.height, + event->any.send_event ? " (send)" : "")); + + if (window_private == NULL) + { + return_val = FALSE; + break; + } + + { + GdkRectangle expose_rect; + + expose_rect.x = xevent->xexpose.x; + expose_rect.y = xevent->xexpose.y; + expose_rect.width = xevent->xexpose.width; + expose_rect.height = xevent->xexpose.height; + + _gdk_window_process_expose (window, xevent->xexpose.serial, &expose_rect); + return_val = FALSE; + } + + break; + + case GraphicsExpose: + { + GdkRectangle expose_rect; + + GDK_NOTE (EVENTS, + g_message ("graphics expose:\tdrawable: %ld", + xevent->xgraphicsexpose.drawable)); + + if (window_private == NULL) + { + return_val = FALSE; + break; + } + + expose_rect.x = xevent->xgraphicsexpose.x; + expose_rect.y = xevent->xgraphicsexpose.y; + expose_rect.width = xevent->xgraphicsexpose.width; + expose_rect.height = xevent->xgraphicsexpose.height; + + _gdk_window_process_expose (window, xevent->xgraphicsexpose.serial, &expose_rect); + return_val = FALSE; + } + break; + + case NoExpose: + GDK_NOTE (EVENTS, + g_message ("no expose:\t\tdrawable: %ld", + xevent->xnoexpose.drawable)); + + event->no_expose.type = GDK_NO_EXPOSE; + event->no_expose.window = window; + + break; + + case VisibilityNotify: +#ifdef G_ENABLE_DEBUG + if (_gdk_debug_flags & GDK_DEBUG_EVENTS) + switch (xevent->xvisibility.state) + { + case VisibilityFullyObscured: + g_message ("visibility notify:\twindow: %ld none", + xevent->xvisibility.window); + break; + case VisibilityPartiallyObscured: + g_message ("visibility notify:\twindow: %ld partial", + xevent->xvisibility.window); + break; + case VisibilityUnobscured: + g_message ("visibility notify:\twindow: %ld full", + xevent->xvisibility.window); + break; + } +#endif /* G_ENABLE_DEBUG */ + + if (window_private == NULL) + { + return_val = FALSE; + break; + } + + event->visibility.type = GDK_VISIBILITY_NOTIFY; + event->visibility.window = window; + + switch (xevent->xvisibility.state) + { + case VisibilityFullyObscured: + event->visibility.state = GDK_VISIBILITY_FULLY_OBSCURED; + break; + + case VisibilityPartiallyObscured: + event->visibility.state = GDK_VISIBILITY_PARTIAL; + break; + + case VisibilityUnobscured: + event->visibility.state = GDK_VISIBILITY_UNOBSCURED; + break; + } + + break; + + case CreateNotify: + GDK_NOTE (EVENTS, + g_message ("create notify:\twindow: %ld x,y: %d %d w,h: %d %d b-w: %d parent: %ld ovr: %d", + xevent->xcreatewindow.window, + xevent->xcreatewindow.x, + xevent->xcreatewindow.y, + xevent->xcreatewindow.width, + xevent->xcreatewindow.height, + xevent->xcreatewindow.border_width, + xevent->xcreatewindow.parent, + xevent->xcreatewindow.override_redirect)); + /* not really handled */ + break; + + case DestroyNotify: + GDK_NOTE (EVENTS, + g_message ("destroy notify:\twindow: %ld", + xevent->xdestroywindow.window)); + + /* Ignore DestroyNotify from SubstructureNotifyMask */ + if (xevent->xdestroywindow.window == xevent->xdestroywindow.event) + { + event->any.type = GDK_DESTROY; + event->any.window = window; + + return_val = window_private && !GDK_WINDOW_DESTROYED (window); + + if (window && GDK_WINDOW_XID (window) != screen_x11->xroot_window) + gdk_window_destroy_notify (window); + } + else + return_val = FALSE; + + break; + + case UnmapNotify: + GDK_NOTE (EVENTS, + g_message ("unmap notify:\t\twindow: %ld", + xevent->xmap.window)); + + event->any.type = GDK_UNMAP; + event->any.window = window; + + /* If we are shown (not withdrawn) and get an unmap, it means we + * were iconified in the X sense. If we are withdrawn, and get + * an unmap, it means we hid the window ourselves, so we + * will have already flipped the iconified bit off. + */ + if (window) + { + if (GDK_WINDOW_IS_MAPPED (window)) + gdk_synthesize_window_state (window, + 0, + GDK_WINDOW_STATE_ICONIFIED); + + _gdk_xgrab_check_unmap (window, xevent->xany.serial); + } + + break; + + case MapNotify: + GDK_NOTE (EVENTS, + g_message ("map notify:\t\twindow: %ld", + xevent->xmap.window)); + + event->any.type = GDK_MAP; + event->any.window = window; + + /* Unset iconified if it was set */ + if (window && (((GdkWindowObject*)window)->state & GDK_WINDOW_STATE_ICONIFIED)) + gdk_synthesize_window_state (window, + GDK_WINDOW_STATE_ICONIFIED, + 0); + + break; + + case ReparentNotify: + GDK_NOTE (EVENTS, + g_message ("reparent notify:\twindow: %ld x,y: %d %d parent: %ld ovr: %d", + xevent->xreparent.window, + xevent->xreparent.x, + xevent->xreparent.y, + xevent->xreparent.parent, + xevent->xreparent.override_redirect)); + + /* Not currently handled */ + return_val = FALSE; + break; + + case ConfigureNotify: + GDK_NOTE (EVENTS, + g_message ("configure notify:\twindow: %ld x,y: %d %d w,h: %d %d b-w: %d above: %ld ovr: %d%s", + xevent->xconfigure.window, + xevent->xconfigure.x, + xevent->xconfigure.y, + xevent->xconfigure.width, + xevent->xconfigure.height, + xevent->xconfigure.border_width, + xevent->xconfigure.above, + xevent->xconfigure.override_redirect, + !window + ? " (discarding)" + : GDK_WINDOW_TYPE (window) == GDK_WINDOW_CHILD + ? " (discarding child)" + : xevent->xconfigure.event != xevent->xconfigure.window + ? " (discarding substructure)" + : "")); + if (window && GDK_WINDOW_TYPE (window) == GDK_WINDOW_ROOT) + { + window_private->width = xevent->xconfigure.width; + window_private->height = xevent->xconfigure.height; + + _gdk_window_update_size (window); + _gdk_x11_drawable_update_size (window_private->impl); + _gdk_x11_screen_size_changed (screen, xevent); + } + +#ifdef HAVE_XSYNC + if (toplevel && display_x11->use_sync && !XSyncValueIsZero (toplevel->pending_counter_value)) + { + toplevel->current_counter_value = toplevel->pending_counter_value; + XSyncIntToValue (&toplevel->pending_counter_value, 0); + } +#endif + + if (!window || + xevent->xconfigure.event != xevent->xconfigure.window || + GDK_WINDOW_TYPE (window) == GDK_WINDOW_CHILD || + GDK_WINDOW_TYPE (window) == GDK_WINDOW_ROOT) + return_val = FALSE; + else + { + event->configure.type = GDK_CONFIGURE; + event->configure.window = window; + event->configure.width = xevent->xconfigure.width; + event->configure.height = xevent->xconfigure.height; + + if (!xevent->xconfigure.send_event && + !xevent->xconfigure.override_redirect && + !GDK_WINDOW_DESTROYED (window)) + { + gint tx = 0; + gint ty = 0; + Window child_window = 0; + + gdk_error_trap_push (); + if (XTranslateCoordinates (GDK_DRAWABLE_XDISPLAY (window), + GDK_DRAWABLE_XID (window), + screen_x11->xroot_window, + 0, 0, + &tx, &ty, + &child_window)) + { + event->configure.x = tx; + event->configure.y = ty; + } + gdk_error_trap_pop (); + } + else + { + event->configure.x = xevent->xconfigure.x; + event->configure.y = xevent->xconfigure.y; + } + window_private->x = event->configure.x; + window_private->y = event->configure.y; + window_private->width = xevent->xconfigure.width; + window_private->height = xevent->xconfigure.height; + + _gdk_window_update_size (window); + _gdk_x11_drawable_update_size (window_private->impl); + + if (window_private->resize_count >= 1) + { + window_private->resize_count -= 1; + + if (window_private->resize_count == 0) + _gdk_moveresize_configure_done (display, window); + } + } + break; + + case PropertyNotify: + GDK_NOTE (EVENTS, + g_message ("property notify:\twindow: %ld, atom(%ld): %s%s%s", + xevent->xproperty.window, + xevent->xproperty.atom, + "\"", + gdk_x11_get_xatom_name_for_display (display, xevent->xproperty.atom), + "\"")); + + if (window_private == NULL) + { + return_val = FALSE; + break; + } + + /* We compare with the serial of the last time we mapped the + * window to avoid refetching properties that we set ourselves + */ + if (toplevel && + xevent->xproperty.serial >= toplevel->map_serial) + { + if (xevent->xproperty.atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE")) + gdk_check_wm_state_changed (window); + + if (xevent->xproperty.atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_DESKTOP")) + gdk_check_wm_desktop_changed (window); + } + + if (window_private->event_mask & GDK_PROPERTY_CHANGE_MASK) + { + event->property.type = GDK_PROPERTY_NOTIFY; + event->property.window = window; + event->property.atom = gdk_x11_xatom_to_atom_for_display (display, xevent->xproperty.atom); + event->property.time = xevent->xproperty.time; + event->property.state = xevent->xproperty.state; + } + else + return_val = FALSE; + + break; + + case SelectionClear: + GDK_NOTE (EVENTS, + g_message ("selection clear:\twindow: %ld", + xevent->xproperty.window)); + + if (_gdk_selection_filter_clear_event (&xevent->xselectionclear)) + { + event->selection.type = GDK_SELECTION_CLEAR; + event->selection.window = window; + event->selection.selection = gdk_x11_xatom_to_atom_for_display (display, xevent->xselectionclear.selection); + event->selection.time = xevent->xselectionclear.time; + } + else + return_val = FALSE; + + break; + + case SelectionRequest: + GDK_NOTE (EVENTS, + g_message ("selection request:\twindow: %ld", + xevent->xproperty.window)); + + event->selection.type = GDK_SELECTION_REQUEST; + event->selection.window = window; + event->selection.selection = gdk_x11_xatom_to_atom_for_display (display, xevent->xselectionrequest.selection); + event->selection.target = gdk_x11_xatom_to_atom_for_display (display, xevent->xselectionrequest.target); + event->selection.property = gdk_x11_xatom_to_atom_for_display (display, xevent->xselectionrequest.property); + event->selection.requestor = xevent->xselectionrequest.requestor; + event->selection.time = xevent->xselectionrequest.time; + + break; + + case SelectionNotify: + GDK_NOTE (EVENTS, + g_message ("selection notify:\twindow: %ld", + xevent->xproperty.window)); + + event->selection.type = GDK_SELECTION_NOTIFY; + event->selection.window = window; + event->selection.selection = gdk_x11_xatom_to_atom_for_display (display, xevent->xselection.selection); + event->selection.target = gdk_x11_xatom_to_atom_for_display (display, xevent->xselection.target); + if (xevent->xselection.property == None) + event->selection.property = GDK_NONE; + else + event->selection.property = gdk_x11_xatom_to_atom_for_display (display, xevent->xselection.property); + event->selection.time = xevent->xselection.time; + + break; + + case ColormapNotify: + GDK_NOTE (EVENTS, + g_message ("colormap notify:\twindow: %ld", + xevent->xcolormap.window)); + + /* Not currently handled */ + return_val = FALSE; + break; + + case ClientMessage: + { + GList *tmp_list; + GdkFilterReturn result = GDK_FILTER_CONTINUE; + GdkAtom message_type = gdk_x11_xatom_to_atom_for_display (display, xevent->xclient.message_type); + + GDK_NOTE (EVENTS, + g_message ("client message:\twindow: %ld", + xevent->xclient.window)); + + tmp_list = display_x11->client_filters; + while (tmp_list) + { + GdkClientFilter *filter = tmp_list->data; + tmp_list = tmp_list->next; + + if (filter->type == message_type) + { + result = (*filter->function) (xevent, event, filter->data); + if (result != GDK_FILTER_CONTINUE) + break; + } + } + + switch (result) + { + case GDK_FILTER_REMOVE: + return_val = FALSE; + break; + case GDK_FILTER_TRANSLATE: + return_val = TRUE; + break; + case GDK_FILTER_CONTINUE: + /* Send unknown ClientMessage's on to Gtk for it to use */ + if (window_private == NULL) + { + return_val = FALSE; + } + else + { + event->client.type = GDK_CLIENT_EVENT; + event->client.window = window; + event->client.message_type = message_type; + event->client.data_format = xevent->xclient.format; + memcpy(&event->client.data, &xevent->xclient.data, + sizeof(event->client.data)); + } + break; + } + } + + break; + + case MappingNotify: + GDK_NOTE (EVENTS, + g_message ("mapping notify")); + + /* Let XLib know that there is a new keyboard mapping. + */ + XRefreshKeyboardMapping (&xevent->xmapping); + _gdk_keymap_keys_changed (display); + return_val = FALSE; + break; + + default: +#ifdef HAVE_XFIXES + if (xevent->type - display_x11->xfixes_event_base == XFixesSelectionNotify) + { + XFixesSelectionNotifyEvent *selection_notify = (XFixesSelectionNotifyEvent *)xevent; + + _gdk_x11_screen_process_owner_change (screen, xevent); + + event->owner_change.type = GDK_OWNER_CHANGE; + event->owner_change.window = window; + event->owner_change.owner = selection_notify->owner; + event->owner_change.reason = selection_notify->subtype; + event->owner_change.selection = + gdk_x11_xatom_to_atom_for_display (display, + selection_notify->selection); + event->owner_change.time = selection_notify->timestamp; + event->owner_change.selection_time = selection_notify->selection_timestamp; + + return_val = TRUE; + } + else +#endif +#ifdef HAVE_RANDR + if (xevent->type - display_x11->xrandr_event_base == RRScreenChangeNotify || + xevent->type - display_x11->xrandr_event_base == RRNotify) + { + if (screen) + _gdk_x11_screen_size_changed (screen, xevent); + } + else +#endif +#if defined(HAVE_XCOMPOSITE) && defined (HAVE_XDAMAGE) && defined (HAVE_XFIXES) + if (display_x11->have_xdamage && window_private && window_private->composited && + xevent->type == display_x11->xdamage_event_base + XDamageNotify && + ((XDamageNotifyEvent *) xevent)->damage == window_impl->damage) + { + XDamageNotifyEvent *damage_event = (XDamageNotifyEvent *) xevent; + XserverRegion repair; + GdkRectangle rect; + + rect.x = window_private->x + damage_event->area.x; + rect.y = window_private->y + damage_event->area.y; + rect.width = damage_event->area.width; + rect.height = damage_event->area.height; + + repair = XFixesCreateRegion (display_x11->xdisplay, + &damage_event->area, 1); + XDamageSubtract (display_x11->xdisplay, + window_impl->damage, + repair, None); + XFixesDestroyRegion (display_x11->xdisplay, repair); + + if (window_private->parent != NULL) + _gdk_window_process_expose (GDK_WINDOW (window_private->parent), + damage_event->serial, &rect); + + return_val = TRUE; + } + else +#endif +#ifdef HAVE_XKB + if (xevent->type == display_x11->xkb_event_type) + { + XkbEvent *xkb_event = (XkbEvent *) xevent; + + switch (xkb_event->any.xkb_type) + { + case XkbNewKeyboardNotify: + case XkbMapNotify: + _gdk_keymap_keys_changed (display); + + return_val = FALSE; + break; + + case XkbStateNotify: + _gdk_keymap_state_changed (display, xevent); + break; + } + } + else +#endif + return_val = FALSE; + } + + done: + if (return_val) + { + if (event->any.window) + g_object_ref (event->any.window); + } + else + { + /* Mark this event as having no resources to be freed */ + event->any.window = NULL; + event->any.type = GDK_NOTHING; + } + + if (window) + g_object_unref (window); + + return return_val; +} + +static GdkFilterReturn +gdk_wm_protocols_filter (GdkXEvent *xev, + GdkEvent *event, + gpointer data) +{ + XEvent *xevent = (XEvent *)xev; + GdkWindow *win = event->any.window; + GdkDisplay *display; + Atom atom; + + if (!win) + return GDK_FILTER_REMOVE; + + display = GDK_WINDOW_DISPLAY (win); + atom = (Atom)xevent->xclient.data.l[0]; + + if (atom == gdk_x11_get_xatom_by_name_for_display (display, "WM_DELETE_WINDOW")) + { + /* The delete window request specifies a window + * to delete. We don't actually destroy the + * window because "it is only a request". (The + * window might contain vital data that the + * program does not want destroyed). Instead + * the event is passed along to the program, + * which should then destroy the window. + */ + GDK_NOTE (EVENTS, + g_message ("delete window:\t\twindow: %ld", + xevent->xclient.window)); + + event->any.type = GDK_DELETE; + + gdk_x11_window_set_user_time (win, xevent->xclient.data.l[1]); + + return GDK_FILTER_TRANSLATE; + } + else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "WM_TAKE_FOCUS")) + { + GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (event->any.window); + GdkWindowObject *private = (GdkWindowObject *)win; + + /* There is no way of knowing reliably whether we are viewable; + * _gdk_x11_set_input_focus_safe() traps errors asynchronously. + */ + if (toplevel && private->accept_focus) + _gdk_x11_set_input_focus_safe (display, toplevel->focus_window, + RevertToParent, + xevent->xclient.data.l[1]); + + return GDK_FILTER_REMOVE; + } + else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_PING") && + !_gdk_x11_display_is_root_window (display, + xevent->xclient.window)) + { + XClientMessageEvent xclient = xevent->xclient; + + xclient.window = GDK_WINDOW_XROOTWIN (win); + XSendEvent (GDK_WINDOW_XDISPLAY (win), + xclient.window, + False, + SubstructureRedirectMask | SubstructureNotifyMask, (XEvent *)&xclient); + + return GDK_FILTER_REMOVE; + } + else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_SYNC_REQUEST") && + GDK_DISPLAY_X11 (display)->use_sync) + { + GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (event->any.window); + if (toplevel) + { +#ifdef HAVE_XSYNC + XSyncIntsToValue (&toplevel->pending_counter_value, + xevent->xclient.data.l[2], + xevent->xclient.data.l[3]); +#endif + } + return GDK_FILTER_REMOVE; + } + + return GDK_FILTER_CONTINUE; +} + +static void +_gdk_event_init (GdkDisplay *display) +{ + GdkDisplayX11 *display_x11; + GdkDeviceManager *device_manager; + + display_x11 = GDK_DISPLAY_X11 (display); + display_x11->event_source = gdk_event_source_new (display); + + gdk_event_source_add_translator ((GdkEventSource *) display_x11->event_source, + GDK_EVENT_TRANSLATOR (display)); + + device_manager = gdk_display_get_device_manager (display); + gdk_event_source_add_translator ((GdkEventSource *) display_x11->event_source, + GDK_EVENT_TRANSLATOR (device_manager)); + + gdk_display_add_client_message_filter (display, + gdk_atom_intern_static_string ("WM_PROTOCOLS"), + gdk_wm_protocols_filter, + NULL); +} + +static void +_gdk_input_init (GdkDisplay *display) +{ + GdkDisplayX11 *display_x11; + GdkDeviceManager *device_manager; + GdkDevice *device; + GList *list, *l; + + display_x11 = GDK_DISPLAY_X11 (display); + device_manager = gdk_display_get_device_manager (display); + + /* For backwards compatibility, just add + * floating devices that are not keyboards. + */ + list = gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_FLOATING); + + for (l = list; l; l = l->next) + { + device = l->data; + + if (device->source == GDK_SOURCE_KEYBOARD) + continue; + + display_x11->input_devices = g_list_prepend (display_x11->input_devices, l->data); + } + + g_list_free (list); + + /* Now set "core" pointer to the first + * master device that is a pointer. + */ + list = gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_MASTER); + + for (l = list; l; l = l->next) + { + device = list->data; + + if (device->source != GDK_SOURCE_MOUSE) + continue; + + display->core_pointer = device; + break; + } + + /* Add the core pointer to the devices list */ + display_x11->input_devices = g_list_prepend (display_x11->input_devices, display->core_pointer); + + g_list_free (list); +} + /** * gdk_display_open: * @display_name: the name of the display to open @@ -206,11 +1234,15 @@ gdk_display_open (const gchar *display_name) * structures in places */ for (i = 0; i < ScreenCount (display_x11->xdisplay); i++) - _gdk_x11_events_init_screen (display_x11->screens[i]); - + _gdk_screen_x11_events_init (display_x11->screens[i]); + /*set the default screen */ display_x11->default_screen = display_x11->screens[DefaultScreen (display_x11->xdisplay)]; + display->device_manager = _gdk_device_manager_new (display); + + _gdk_event_init (display); + attr.window_type = GDK_WINDOW_TOPLEVEL; attr.wclass = GDK_INPUT_OUTPUT; attr.x = 10; @@ -395,15 +1427,15 @@ gdk_display_open (const gchar *display_name) display_x11->use_sync = TRUE; } #endif - + _gdk_windowing_image_init (display); - _gdk_events_init (display); _gdk_input_init (display); _gdk_dnd_init (display); for (i = 0; i < ScreenCount (display_x11->xdisplay); i++) _gdk_x11_screen_setup (display_x11->screens[i]); + g_signal_emit_by_name (display, "opened"); g_signal_emit_by_name (gdk_display_manager_get(), "display_opened", display); @@ -592,11 +1624,13 @@ struct XPointerUngrabInfo { }; static void -pointer_ungrab_callback (GdkDisplay *display, - gpointer data, - gulong serial) +device_ungrab_callback (GdkDisplay *display, + gpointer data, + gulong serial) { - _gdk_display_pointer_grab_update (display, serial); + GdkDevice *device = data; + + _gdk_display_device_grab_update (display, device, serial); } @@ -606,77 +1640,46 @@ pointer_ungrab_callback (GdkDisplay *display, ) /** - * gdk_display_pointer_ungrab: - * @display: a #GdkDisplay. + * gdk_device_ungrab: + * @device: a #GdkDevice * @time_: a timestap (e.g. %GDK_CURRENT_TIME). * - * Release any pointer grab. + * Release any grab on @device. * - * Since: 2.2 + * Since: 3.0 */ void -gdk_display_pointer_ungrab (GdkDisplay *display, - guint32 time_) +gdk_device_ungrab (GdkDevice *device, + guint32 time_) { + GdkDisplay *display; Display *xdisplay; - GdkDisplayX11 *display_x11; - GdkPointerGrabInfo *grab; + GdkDeviceGrabInfo *grab; unsigned long serial; - g_return_if_fail (GDK_IS_DISPLAY (display)); + g_return_if_fail (GDK_IS_DEVICE (device)); - display_x11 = GDK_DISPLAY_X11 (display); + display = gdk_device_get_display (device); xdisplay = GDK_DISPLAY_XDISPLAY (display); serial = NextRequest (xdisplay); - - _gdk_input_ungrab_pointer (display, time_); - XUngrabPointer (xdisplay, time_); + + GDK_DEVICE_GET_CLASS (device)->ungrab (device, time_); XFlush (xdisplay); - grab = _gdk_display_get_last_pointer_grab (display); + grab = _gdk_display_get_last_device_grab (display, device); if (grab && (time_ == GDK_CURRENT_TIME || grab->time == GDK_CURRENT_TIME || !XSERVER_TIME_IS_LATER (grab->time, time_))) { grab->serial_end = serial; - _gdk_x11_roundtrip_async (display, - pointer_ungrab_callback, - NULL); + _gdk_x11_roundtrip_async (display, + device_ungrab_callback, + device); } } -/** - * gdk_display_keyboard_ungrab: - * @display: a #GdkDisplay. - * @time_: a timestap (e.g #GDK_CURRENT_TIME). - * - * Release any keyboard grab - * - * Since: 2.2 - */ -void -gdk_display_keyboard_ungrab (GdkDisplay *display, - guint32 time) -{ - Display *xdisplay; - GdkDisplayX11 *display_x11; - - g_return_if_fail (GDK_IS_DISPLAY (display)); - - display_x11 = GDK_DISPLAY_X11 (display); - xdisplay = GDK_DISPLAY_XDISPLAY (display); - - XUngrabKeyboard (xdisplay, time); - XFlush (xdisplay); - - if (time == GDK_CURRENT_TIME || - display->keyboard_grab.time == GDK_CURRENT_TIME || - !XSERVER_TIME_IS_LATER (display->keyboard_grab.time, time)) - _gdk_display_unset_has_keyboard_grab (display, FALSE); -} - /** * gdk_display_beep: * @display: a #GdkDisplay @@ -690,7 +1693,11 @@ gdk_display_beep (GdkDisplay *display) { g_return_if_fail (GDK_IS_DISPLAY (display)); +#ifdef HAVE_XKB XkbBell (GDK_DISPLAY_XDISPLAY (display), None, 0, None); +#else + XBell (GDK_DISPLAY_XDISPLAY (display), 0); +#endif } /** @@ -825,7 +1832,12 @@ gdk_display_x11_dispose (GObject *object) for (i = 0; i < ScreenCount (display_x11->xdisplay); i++) _gdk_screen_close (display_x11->screens[i]); - _gdk_events_uninit (GDK_DISPLAY_OBJECT (object)); + if (display_x11->event_source) + { + g_source_destroy (display_x11->event_source); + g_source_unref (display_x11->event_source); + display_x11->event_source = NULL; + } G_OBJECT_CLASS (_gdk_display_x11_parent_class)->dispose (object); } @@ -1475,6 +2487,185 @@ gdk_display_supports_composite (GdkDisplay *display) x11_display->have_xfixes; } +/** + * gdk_display_list_devices: + * @display: a #GdkDisplay + * + * Returns the list of available input devices attached to @display. + * The list is statically allocated and should not be freed. + * + * Return value: a list of #GdkDevice + * + * Since: 2.2 + * + * Deprecated: 3.0: Use gdk_device_manager_list_devices() instead. + **/ +GList * +gdk_display_list_devices (GdkDisplay *display) +{ + g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL); + + return GDK_DISPLAY_X11 (display)->input_devices; +} + +/** + * gdk_event_send_client_message_for_display: + * @display: the #GdkDisplay for the window where the message is to be sent. + * @event: the #GdkEvent to send, which should be a #GdkEventClient. + * @winid: the window to send the client message to. + * + * On X11, sends an X ClientMessage event to a given window. On + * Windows, sends a message registered with the name + * GDK_WIN32_CLIENT_MESSAGE. + * + * This could be used for communicating between different + * applications, though the amount of data is limited to 20 bytes on + * X11, and to just four bytes on Windows. + * + * Returns: non-zero on success. + * + * Since: 2.2 + */ +gboolean +gdk_event_send_client_message_for_display (GdkDisplay *display, + GdkEvent *event, + GdkNativeWindow winid) +{ + XEvent sev; + + g_return_val_if_fail(event != NULL, FALSE); + + /* Set up our event to send, with the exception of its target window */ + sev.xclient.type = ClientMessage; + sev.xclient.display = GDK_DISPLAY_XDISPLAY (display); + sev.xclient.format = event->client.data_format; + sev.xclient.window = winid; + memcpy(&sev.xclient.data, &event->client.data, sizeof (sev.xclient.data)); + sev.xclient.message_type = gdk_x11_atom_to_xatom_for_display (display, event->client.message_type); + + return _gdk_send_xevent (display, winid, False, NoEventMask, &sev); +} + +/** + * gdk_display_add_client_message_filter: + * @display: a #GdkDisplay for which this message filter applies + * @message_type: the type of ClientMessage events to receive. + * This will be checked against the @message_type field + * of the XClientMessage event struct. + * @func: the function to call to process the event. + * @data: user data to pass to @func. + * + * Adds a filter to be called when X ClientMessage events are received. + * See gdk_window_add_filter() if you are interested in filtering other + * types of events. + * + * Since: 2.2 + **/ +void +gdk_display_add_client_message_filter (GdkDisplay *display, + GdkAtom message_type, + GdkFilterFunc func, + gpointer data) +{ + GdkClientFilter *filter; + g_return_if_fail (GDK_IS_DISPLAY (display)); + filter = g_new (GdkClientFilter, 1); + + filter->type = message_type; + filter->function = func; + filter->data = data; + + GDK_DISPLAY_X11(display)->client_filters = + g_list_append (GDK_DISPLAY_X11 (display)->client_filters, + filter); +} + +/** + * gdk_add_client_message_filter: + * @message_type: the type of ClientMessage events to receive. This will be + * checked against the message_type field of the + * XClientMessage event struct. + * @func: the function to call to process the event. + * @data: user data to pass to @func. + * + * Adds a filter to the default display to be called when X ClientMessage events + * are received. See gdk_display_add_client_message_filter(). + **/ +void +gdk_add_client_message_filter (GdkAtom message_type, + GdkFilterFunc func, + gpointer data) +{ + gdk_display_add_client_message_filter (gdk_display_get_default (), + message_type, func, data); +} + +/* + *-------------------------------------------------------------- + * gdk_flush + * + * Flushes the Xlib output buffer and then waits + * until all requests have been received and processed + * by the X server. The only real use for this function + * is in dealing with XShm. + * + * Arguments: + * + * Results: + * + * Side effects: + * + *-------------------------------------------------------------- + */ +void +gdk_flush (void) +{ + GSList *tmp_list = _gdk_displays; + + while (tmp_list) + { + XSync (GDK_DISPLAY_XDISPLAY (tmp_list->data), False); + tmp_list = tmp_list->next; + } +} + +/** + * gdk_x11_register_standard_event_type: + * @display: a #GdkDisplay + * @event_base: first event type code to register + * @n_events: number of event type codes to register + * + * Registers interest in receiving extension events with type codes + * between @event_base and event_base + n_events - 1. + * The registered events must have the window field in the same place + * as core X events (this is not the case for e.g. XKB extension events). + * + * If an event type is registered, events of this type will go through + * global and window-specific filters (see gdk_window_add_filter()). + * Unregistered events will only go through global filters. + * GDK may register the events of some X extensions on its own. + * + * This function should only be needed in unusual circumstances, e.g. + * when filtering XInput extension events on the root window. + * + * Since: 2.4 + **/ +void +gdk_x11_register_standard_event_type (GdkDisplay *display, + gint event_base, + gint n_events) +{ + GdkEventTypeX11 *event_type; + GdkDisplayX11 *display_x11; + + display_x11 = GDK_DISPLAY_X11 (display); + event_type = g_new (GdkEventTypeX11, 1); + + event_type->base = event_base; + event_type->n_events = n_events; + + display_x11->event_types = g_slist_prepend (display_x11->event_types, event_type); +} #define __GDK_DISPLAY_X11_C__ #include "gdkaliasdef.c" diff --git a/gdk/x11/gdkdnd-x11.c b/gdk/x11/gdkdnd-x11.c index 60adca0d3e..9a474b906a 100644 --- a/gdk/x11/gdkdnd-x11.c +++ b/gdk/x11/gdkdnd-x11.c @@ -25,7 +25,9 @@ */ #include "config.h" + #include +#include #include #include @@ -94,6 +96,7 @@ struct _GdkDragContextPrivateX11 { guint version; /* Xdnd protocol version */ GSList *window_caches; + GdkDevice *device; }; #define PRIVATE_DATA(context) ((GdkDragContextPrivateX11 *) GDK_DRAG_CONTEXT (context)->windowing_data) @@ -219,35 +222,52 @@ gdk_drag_context_new (void) } /** - * gdk_drag_context_ref: - * @context: a #GdkDragContext. + * gdk_drag_context_set_device: + * @context: a #GdkDragContext + * @device: a #GdkDevice * - * Deprecated function; use g_object_ref() instead. - * - * Deprecated: 2.2: Use g_object_ref() instead. + * Associates a #GdkDevice to @context, so all Drag and Drop events + * for @context are emitted as if they came from this device. **/ -void -gdk_drag_context_ref (GdkDragContext *context) +void +gdk_drag_context_set_device (GdkDragContext *context, + GdkDevice *device) { - g_return_if_fail (GDK_IS_DRAG_CONTEXT (context)); + GdkDragContextPrivateX11 *private; - g_object_ref (context); + g_return_if_fail (GDK_IS_DRAG_CONTEXT (context)); + g_return_if_fail (GDK_IS_DEVICE (device)); + + private = PRIVATE_DATA (context); + + if (private->device) + { + g_object_unref (private->device); + private->device = NULL; + } + + if (device) + private->device = g_object_ref (device); } /** - * gdk_drag_context_unref: - * @context: a #GdkDragContext. + * gdk_drag_context_get_device: + * @context: a #GdkDragContext * - * Deprecated function; use g_object_unref() instead. + * Returns the #GdkDevice associated to the drag context. * - * Deprecated: 2.2: Use g_object_unref() instead. + * Returns: The #GdkDevice associated to @context. **/ -void -gdk_drag_context_unref (GdkDragContext *context) +GdkDevice * +gdk_drag_context_get_device (GdkDragContext *context) { - g_return_if_fail (GDK_IS_DRAG_CONTEXT (context)); + GdkDragContextPrivateX11 *private; - g_object_unref (context); + g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), NULL); + + private = PRIVATE_DATA (context); + + return private->device; } static GdkDragContext * @@ -2113,6 +2133,7 @@ xdnd_status_filter (GdkXEvent *xev, event->dnd.send_event = FALSE; event->dnd.type = GDK_DRAG_STATUS; event->dnd.context = context; + gdk_event_set_device (event, gdk_drag_context_get_device (context)); g_object_ref (context); event->dnd.time = GDK_CURRENT_TIME; /* FIXME? */ @@ -2160,6 +2181,7 @@ xdnd_finished_filter (GdkXEvent *xev, event->dnd.type = GDK_DROP_FINISHED; event->dnd.context = context; + gdk_event_set_device (event, gdk_drag_context_get_device (context)); g_object_ref (context); event->dnd.time = GDK_CURRENT_TIME; /* FIXME? */ @@ -2267,7 +2289,7 @@ send_client_message_async_cb (Window window, context->dest_window && window == GDK_WINDOW_XID (context->dest_window)) { - GdkEvent temp_event; + GdkEvent *temp_event; GdkDragContextPrivateX11 *private = PRIVATE_DATA (context); g_object_unref (context->dest_window); @@ -2276,13 +2298,16 @@ send_client_message_async_cb (Window window, private->drag_status = GDK_DRAG_STATUS_DRAG; - temp_event.dnd.type = GDK_DRAG_STATUS; - temp_event.dnd.window = context->source_window; - temp_event.dnd.send_event = TRUE; - temp_event.dnd.context = context; - temp_event.dnd.time = GDK_CURRENT_TIME; + temp_event = gdk_event_new (GDK_DRAG_STATUS); + temp_event->dnd.window = g_object_ref (context->source_window); + temp_event->dnd.send_event = TRUE; + temp_event->dnd.context = g_object_ref (context); + temp_event->dnd.time = GDK_CURRENT_TIME; + gdk_event_set_device (temp_event, gdk_drag_context_get_device (context)); - gdk_event_put (&temp_event); + gdk_event_put (temp_event); + + gdk_event_free (temp_event); } g_object_unref (context); @@ -2339,13 +2364,15 @@ xdnd_send_xevent (GdkDragContext *context, if (gdk_x11_get_xatom_by_name_for_display (display, xdnd_filters[i].atom_name) == event_send->xclient.message_type) { - GdkEvent temp_event; - temp_event.any.window = window; + GdkEvent *temp_event; - if ((*xdnd_filters[i].func) (event_send, &temp_event, NULL) == GDK_FILTER_TRANSLATE) + temp_event = gdk_event_new (GDK_NOTHING); + temp_event->any.window = g_object_ref (window); + + if ((*xdnd_filters[i].func) (event_send, temp_event, NULL) == GDK_FILTER_TRANSLATE) { - gdk_event_put (&temp_event); - g_object_unref (temp_event.dnd.context); + gdk_event_put (temp_event); + gdk_event_free (temp_event); } return TRUE; @@ -2836,6 +2863,9 @@ xdnd_enter_filter (GdkXEvent *xev, new_context->protocol = GDK_DRAG_PROTO_XDND; PRIVATE_DATA(new_context)->version = version; + /* FIXME: Should extend DnD protocol to have device info */ + gdk_drag_context_set_device (new_context, gdk_display_get_core_pointer (display)); + new_context->source_window = gdk_window_lookup_for_display (display, source_window); if (new_context->source_window) g_object_ref (new_context->source_window); @@ -2902,6 +2932,7 @@ xdnd_enter_filter (GdkXEvent *xev, event->dnd.type = GDK_DRAG_ENTER; event->dnd.context = new_context; + gdk_event_set_device (event, gdk_drag_context_get_device (new_context)); g_object_ref (new_context); display_x11->current_dest_drag = new_context; @@ -2939,6 +2970,7 @@ xdnd_leave_filter (GdkXEvent *xev, event->dnd.type = GDK_DRAG_LEAVE; /* Pass ownership of context to the event */ event->dnd.context = display_x11->current_dest_drag; + gdk_event_set_device (event, gdk_drag_context_get_device (event->dnd.context)); display_x11->current_dest_drag = NULL; @@ -2982,6 +3014,7 @@ xdnd_position_filter (GdkXEvent *xev, { event->dnd.type = GDK_DRAG_MOTION; event->dnd.context = display_x11->current_dest_drag; + gdk_event_set_device (event, gdk_drag_context_get_device (event->dnd.context)); g_object_ref (display_x11->current_dest_drag); event->dnd.time = time; @@ -3037,6 +3070,7 @@ xdnd_drop_filter (GdkXEvent *xev, event->dnd.type = GDK_DROP_START; event->dnd.context = display_x11->current_dest_drag; + gdk_event_set_device (event, gdk_drag_context_get_device (event->dnd.context)); g_object_ref (display_x11->current_dest_drag); event->dnd.time = time; @@ -3116,6 +3150,8 @@ gdk_drag_begin (GdkWindow *window, GList *targets) { GdkDragContext *new_context; + GdkDisplay *display; + GdkDevice *device; g_return_val_if_fail (window != NULL, NULL); g_return_val_if_fail (GDK_WINDOW_IS_X11 (window), NULL); @@ -3130,6 +3166,10 @@ gdk_drag_begin (GdkWindow *window, new_context->actions = 0; + display = gdk_drawable_get_display (GDK_DRAWABLE (window)); + device = gdk_display_get_core_pointer (display); + gdk_drag_context_set_device (new_context, device); + return new_context; } @@ -3451,7 +3491,7 @@ gdk_drag_motion (GdkDragContext *context, if (context->dest_window != dest_window) { - GdkEvent temp_event; + GdkEvent *temp_event; /* Send a leave to the last destination */ gdk_drag_do_leave (context, time); @@ -3495,18 +3535,19 @@ gdk_drag_motion (GdkDragContext *context, /* Push a status event, to let the client know that * the drag changed */ - - temp_event.dnd.type = GDK_DRAG_STATUS; - temp_event.dnd.window = context->source_window; + temp_event = gdk_event_new (GDK_DRAG_STATUS); + temp_event->dnd.window = g_object_ref (context->source_window); /* We use this to signal a synthetic status. Perhaps * we should use an extra field... */ - temp_event.dnd.send_event = TRUE; + temp_event->dnd.send_event = TRUE; - temp_event.dnd.context = context; - temp_event.dnd.time = time; + temp_event->dnd.context = g_object_ref (context); + temp_event->dnd.time = time; + gdk_event_set_device (temp_event, gdk_drag_context_get_device (context)); - gdk_event_put (&temp_event); + gdk_event_put (temp_event); + gdk_event_free (temp_event); } else { @@ -3535,7 +3576,7 @@ gdk_drag_motion (GdkDragContext *context, case GDK_DRAG_PROTO_ROOTWIN: { - GdkEvent temp_event; + GdkEvent *temp_event; /* GTK+ traditionally has used application/x-rootwin-drop, * but the XDND spec specifies x-rootwindow-drop. */ @@ -3550,13 +3591,15 @@ gdk_drag_motion (GdkDragContext *context, else context->action = 0; - temp_event.dnd.type = GDK_DRAG_STATUS; - temp_event.dnd.window = context->source_window; - temp_event.dnd.send_event = FALSE; - temp_event.dnd.context = context; - temp_event.dnd.time = time; + temp_event = gdk_event_new (GDK_DRAG_STATUS); + temp_event->dnd.window = g_object_ref (context->source_window); + temp_event->dnd.send_event = FALSE; + temp_event->dnd.context = g_object_ref (context); + temp_event->dnd.time = time; + gdk_event_set_device (temp_event, gdk_drag_context_get_device (context)); - gdk_event_put (&temp_event); + gdk_event_put (temp_event); + gdk_event_free (temp_event); } break; case GDK_DRAG_PROTO_NONE: @@ -3867,6 +3910,12 @@ gdk_drop_finish (GdkDragContext *context, } +/** + * gdk_window_register_dnd: + * @window: a #GdkWindow. + * + * Registers a window as a potential drop destination. + */ void gdk_window_register_dnd (GdkWindow *window) { @@ -3877,6 +3926,9 @@ gdk_window_register_dnd (GdkWindow *window) g_return_if_fail (window != NULL); + if (gdk_window_get_window_type (window) == GDK_WINDOW_OFFSCREEN) + return; + base_precache_atoms (display); if (g_object_get_data (G_OBJECT (window), "gdk-dnd-registered") != NULL) diff --git a/gdk/x11/gdkevents-x11.c b/gdk/x11/gdkevents-x11.c deleted file mode 100644 index 1f27497f3f..0000000000 --- a/gdk/x11/gdkevents-x11.c +++ /dev/null @@ -1,3126 +0,0 @@ -/* GDK - The GIMP Drawing Kit - * Copyright (C) 1995-2007 Peter Mattis, Spencer Kimball, - * Josh MacDonald, Ryan Lortie - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2007. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#include "config.h" - -#include "gdk.h" -#include "gdkprivate-x11.h" -#include "gdkinternals.h" -#include "gdkx.h" -#include "gdkscreen-x11.h" -#include "gdkdisplay-x11.h" -#include "gdkasync.h" - -#include "gdkkeysyms.h" - -#include "xsettings-client.h" - -#include - -#include "gdkinputprivate.h" -#include "gdksettings.c" -#include "gdkalias.h" - - -#ifdef HAVE_XKB -#include -#endif - -#ifdef HAVE_XSYNC -#include -#endif - -#ifdef HAVE_XFIXES -#include -#endif - -#ifdef HAVE_RANDR -#include -#endif - -#include - -typedef struct _GdkIOClosure GdkIOClosure; -typedef struct _GdkDisplaySource GdkDisplaySource; -typedef struct _GdkEventTypeX11 GdkEventTypeX11; - -struct _GdkIOClosure -{ - GdkInputFunction function; - GdkInputCondition condition; - GDestroyNotify notify; - gpointer data; -}; - -struct _GdkDisplaySource -{ - GSource source; - - GdkDisplay *display; - GPollFD event_poll_fd; -}; - -struct _GdkEventTypeX11 -{ - gint base; - gint n_events; -}; - -/* - * Private function declarations - */ - -static gint gdk_event_apply_filters (XEvent *xevent, - GdkEvent *event, - GList *filters); -static gboolean gdk_event_translate (GdkDisplay *display, - GdkEvent *event, - XEvent *xevent, - gboolean return_exposes); - -static gboolean gdk_event_prepare (GSource *source, - gint *timeout); -static gboolean gdk_event_check (GSource *source); -static gboolean gdk_event_dispatch (GSource *source, - GSourceFunc callback, - gpointer user_data); - -static GdkFilterReturn gdk_wm_protocols_filter (GdkXEvent *xev, - GdkEvent *event, - gpointer data); - -static GSource *gdk_display_source_new (GdkDisplay *display); -static gboolean gdk_check_xpending (GdkDisplay *display); - -static Bool gdk_xsettings_watch_cb (Window window, - Bool is_start, - long mask, - void *cb_data); -static void gdk_xsettings_notify_cb (const char *name, - XSettingsAction action, - XSettingsSetting *setting, - void *data); - -/* Private variable declarations - */ - -static GList *display_sources; - -static GSourceFuncs event_funcs = { - gdk_event_prepare, - gdk_event_check, - gdk_event_dispatch, - NULL -}; - -static GSource * -gdk_display_source_new (GdkDisplay *display) -{ - GSource *source = g_source_new (&event_funcs, sizeof (GdkDisplaySource)); - GdkDisplaySource *display_source = (GdkDisplaySource *)source; - - display_source->display = display; - - return source; -} - -static gboolean -gdk_check_xpending (GdkDisplay *display) -{ - return XPending (GDK_DISPLAY_XDISPLAY (display)); -} - -/********************************************* - * Functions for maintaining the event queue * - *********************************************/ - -static void -refcounted_grab_server (Display *xdisplay) -{ - GdkDisplay *display = gdk_x11_lookup_xdisplay (xdisplay); - - gdk_x11_display_grab (display); -} - -static void -refcounted_ungrab_server (Display *xdisplay) -{ - GdkDisplay *display = gdk_x11_lookup_xdisplay (xdisplay); - - gdk_x11_display_ungrab (display); -} - -void -_gdk_x11_events_init_screen (GdkScreen *screen) -{ - GdkScreenX11 *screen_x11 = GDK_SCREEN_X11 (screen); - - /* Keep a flag to avoid extra notifies that we don't need - */ - screen_x11->xsettings_in_init = TRUE; - screen_x11->xsettings_client = xsettings_client_new_with_grab_funcs (screen_x11->xdisplay, - screen_x11->screen_num, - gdk_xsettings_notify_cb, - gdk_xsettings_watch_cb, - screen, - refcounted_grab_server, - refcounted_ungrab_server); - screen_x11->xsettings_in_init = FALSE; -} - -void -_gdk_x11_events_uninit_screen (GdkScreen *screen) -{ - GdkScreenX11 *screen_x11 = GDK_SCREEN_X11 (screen); - - if (screen_x11->xsettings_client) - { - xsettings_client_destroy (screen_x11->xsettings_client); - screen_x11->xsettings_client = NULL; - } -} - -void -_gdk_events_init (GdkDisplay *display) -{ - GSource *source; - GdkDisplaySource *display_source; - GdkDisplayX11 *display_x11 = GDK_DISPLAY_X11 (display); - - int connection_number = ConnectionNumber (display_x11->xdisplay); - GDK_NOTE (MISC, g_message ("connection number: %d", connection_number)); - - - source = display_x11->event_source = gdk_display_source_new (display); - display_source = (GdkDisplaySource*) source; - g_source_set_priority (source, GDK_PRIORITY_EVENTS); - - display_source->event_poll_fd.fd = connection_number; - display_source->event_poll_fd.events = G_IO_IN; - - g_source_add_poll (source, &display_source->event_poll_fd); - g_source_set_can_recurse (source, TRUE); - g_source_attach (source, NULL); - - display_sources = g_list_prepend (display_sources,display_source); - - gdk_display_add_client_message_filter (display, - gdk_atom_intern_static_string ("WM_PROTOCOLS"), - gdk_wm_protocols_filter, - NULL); -} - -void -_gdk_events_uninit (GdkDisplay *display) -{ - GdkDisplayX11 *display_x11 = GDK_DISPLAY_X11 (display); - - if (display_x11->event_source) - { - display_sources = g_list_remove (display_sources, - display_x11->event_source); - g_source_destroy (display_x11->event_source); - g_source_unref (display_x11->event_source); - display_x11->event_source = NULL; - } -} - -/** - * gdk_events_pending: - * - * Checks if any events are ready to be processed for any display. - * - * Return value: %TRUE if any events are pending. - **/ -gboolean -gdk_events_pending (void) -{ - GList *tmp_list; - - for (tmp_list = display_sources; tmp_list; tmp_list = tmp_list->next) - { - GdkDisplaySource *tmp_source = tmp_list->data; - GdkDisplay *display = tmp_source->display; - - if (_gdk_event_queue_find_first (display)) - return TRUE; - } - - for (tmp_list = display_sources; tmp_list; tmp_list = tmp_list->next) - { - GdkDisplaySource *tmp_source = tmp_list->data; - GdkDisplay *display = tmp_source->display; - - if (gdk_check_xpending (display)) - return TRUE; - } - - return FALSE; -} - -static Bool -graphics_expose_predicate (Display *display, - XEvent *xevent, - XPointer arg) -{ - if (xevent->xany.window == GDK_DRAWABLE_XID ((GdkDrawable *)arg) && - (xevent->xany.type == GraphicsExpose || - xevent->xany.type == NoExpose)) - return True; - else - return False; -} - -/** - * gdk_event_get_graphics_expose: - * @window: the #GdkWindow to wait for the events for. - * - * Waits for a GraphicsExpose or NoExpose event from the X server. - * This is used in the #GtkText and #GtkCList widgets in GTK+ to make sure any - * GraphicsExpose events are handled before the widget is scrolled. - * - * Return value: a #GdkEventExpose if a GraphicsExpose was received, or %NULL if a - * NoExpose event was received. - * - * Deprecated: 2.18: - **/ -GdkEvent* -gdk_event_get_graphics_expose (GdkWindow *window) -{ - XEvent xevent; - GdkEvent *event; - - g_return_val_if_fail (window != NULL, NULL); - - XIfEvent (GDK_WINDOW_XDISPLAY (window), &xevent, - graphics_expose_predicate, (XPointer) window); - - if (xevent.xany.type == GraphicsExpose) - { - event = gdk_event_new (GDK_NOTHING); - - if (gdk_event_translate (GDK_WINDOW_DISPLAY (window), event, - &xevent, TRUE)) - return event; - else - gdk_event_free (event); - } - - return NULL; -} - -static gint -gdk_event_apply_filters (XEvent *xevent, - GdkEvent *event, - GList *filters) -{ - GList *tmp_list; - GdkFilterReturn result; - - tmp_list = filters; - - while (tmp_list) - { - GdkEventFilter *filter = (GdkEventFilter*) tmp_list->data; - - tmp_list = tmp_list->next; - result = filter->function (xevent, event, filter->data); - if (result != GDK_FILTER_CONTINUE) - return result; - } - - return GDK_FILTER_CONTINUE; -} - -/** - * gdk_display_add_client_message_filter: - * @display: a #GdkDisplay for which this message filter applies - * @message_type: the type of ClientMessage events to receive. - * This will be checked against the @message_type field - * of the XClientMessage event struct. - * @func: the function to call to process the event. - * @data: user data to pass to @func. - * - * Adds a filter to be called when X ClientMessage events are received. - * See gdk_window_add_filter() if you are interested in filtering other - * types of events. - * - * Since: 2.2 - **/ -void -gdk_display_add_client_message_filter (GdkDisplay *display, - GdkAtom message_type, - GdkFilterFunc func, - gpointer data) -{ - GdkClientFilter *filter; - g_return_if_fail (GDK_IS_DISPLAY (display)); - filter = g_new (GdkClientFilter, 1); - - filter->type = message_type; - filter->function = func; - filter->data = data; - - GDK_DISPLAY_X11(display)->client_filters = - g_list_append (GDK_DISPLAY_X11 (display)->client_filters, - filter); -} - -/** - * gdk_add_client_message_filter: - * @message_type: the type of ClientMessage events to receive. This will be - * checked against the message_type field of the - * XClientMessage event struct. - * @func: the function to call to process the event. - * @data: user data to pass to @func. - * - * Adds a filter to the default display to be called when X ClientMessage events - * are received. See gdk_display_add_client_message_filter(). - **/ -void -gdk_add_client_message_filter (GdkAtom message_type, - GdkFilterFunc func, - gpointer data) -{ - gdk_display_add_client_message_filter (gdk_display_get_default (), - message_type, func, data); -} - -static void -do_net_wm_state_changes (GdkWindow *window) -{ - GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (window); - GdkWindowState old_state; - - if (GDK_WINDOW_DESTROYED (window) || - gdk_window_get_window_type (window) != GDK_WINDOW_TOPLEVEL) - return; - - old_state = gdk_window_get_state (window); - - /* For found_sticky to remain TRUE, we have to also be on desktop - * 0xFFFFFFFF - */ - if (old_state & GDK_WINDOW_STATE_STICKY) - { - if (!(toplevel->have_sticky && toplevel->on_all_desktops)) - gdk_synthesize_window_state (window, - GDK_WINDOW_STATE_STICKY, - 0); - } - else - { - if (toplevel->have_sticky || toplevel->on_all_desktops) - gdk_synthesize_window_state (window, - 0, - GDK_WINDOW_STATE_STICKY); - } - - if (old_state & GDK_WINDOW_STATE_FULLSCREEN) - { - if (!toplevel->have_fullscreen) - gdk_synthesize_window_state (window, - GDK_WINDOW_STATE_FULLSCREEN, - 0); - } - else - { - if (toplevel->have_fullscreen) - gdk_synthesize_window_state (window, - 0, - GDK_WINDOW_STATE_FULLSCREEN); - } - - /* Our "maximized" means both vertical and horizontal; if only one, - * we don't expose that via GDK - */ - if (old_state & GDK_WINDOW_STATE_MAXIMIZED) - { - if (!(toplevel->have_maxvert && toplevel->have_maxhorz)) - gdk_synthesize_window_state (window, - GDK_WINDOW_STATE_MAXIMIZED, - 0); - } - else - { - if (toplevel->have_maxvert && toplevel->have_maxhorz) - gdk_synthesize_window_state (window, - 0, - GDK_WINDOW_STATE_MAXIMIZED); - } -} - -static void -gdk_check_wm_desktop_changed (GdkWindow *window) -{ - GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (window); - GdkDisplay *display = GDK_WINDOW_DISPLAY (window); - - Atom type; - gint format; - gulong nitems; - gulong bytes_after; - guchar *data; - gulong *desktop; - - type = None; - gdk_error_trap_push (); - XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), - GDK_WINDOW_XID (window), - gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_DESKTOP"), - 0, G_MAXLONG, False, XA_CARDINAL, &type, - &format, &nitems, - &bytes_after, &data); - gdk_error_trap_pop (); - - if (type != None) - { - desktop = (gulong *)data; - toplevel->on_all_desktops = (*desktop == 0xFFFFFFFF); - XFree (desktop); - } - else - toplevel->on_all_desktops = FALSE; - - do_net_wm_state_changes (window); -} - -static void -gdk_check_wm_state_changed (GdkWindow *window) -{ - GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (window); - GdkDisplay *display = GDK_WINDOW_DISPLAY (window); - - Atom type; - gint format; - gulong nitems; - gulong bytes_after; - guchar *data; - Atom *atoms = NULL; - gulong i; - - gboolean had_sticky = toplevel->have_sticky; - - toplevel->have_sticky = FALSE; - toplevel->have_maxvert = FALSE; - toplevel->have_maxhorz = FALSE; - toplevel->have_fullscreen = FALSE; - - type = None; - gdk_error_trap_push (); - XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window), - gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE"), - 0, G_MAXLONG, False, XA_ATOM, &type, &format, &nitems, - &bytes_after, &data); - gdk_error_trap_pop (); - - if (type != None) - { - Atom sticky_atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE_STICKY"); - Atom maxvert_atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE_MAXIMIZED_VERT"); - Atom maxhorz_atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE_MAXIMIZED_HORZ"); - Atom fullscreen_atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE_FULLSCREEN"); - - atoms = (Atom *)data; - - i = 0; - while (i < nitems) - { - if (atoms[i] == sticky_atom) - toplevel->have_sticky = TRUE; - else if (atoms[i] == maxvert_atom) - toplevel->have_maxvert = TRUE; - else if (atoms[i] == maxhorz_atom) - toplevel->have_maxhorz = TRUE; - else if (atoms[i] == fullscreen_atom) - toplevel->have_fullscreen = TRUE; - - ++i; - } - - XFree (atoms); - } - - /* When have_sticky is turned on, we have to check the DESKTOP property - * as well. - */ - if (toplevel->have_sticky && !had_sticky) - gdk_check_wm_desktop_changed (window); - else - do_net_wm_state_changes (window); -} - -#define HAS_FOCUS(toplevel) \ - ((toplevel)->has_focus || (toplevel)->has_pointer_focus) - -static void -generate_focus_event (GdkWindow *window, - gboolean in) -{ - GdkEvent event; - - event.type = GDK_FOCUS_CHANGE; - event.focus_change.window = window; - event.focus_change.send_event = FALSE; - event.focus_change.in = in; - - gdk_event_put (&event); -} - -static gboolean -set_screen_from_root (GdkDisplay *display, - GdkEvent *event, - Window xrootwin) -{ - GdkScreen *screen; - - screen = _gdk_x11_display_screen_for_xrootwin (display, xrootwin); - - if (screen) - { - gdk_event_set_screen (event, screen); - - return TRUE; - } - - return FALSE; -} - -static void -translate_key_event (GdkDisplay *display, - GdkEvent *event, - XEvent *xevent) -{ - GdkKeymap *keymap = gdk_keymap_get_for_display (display); - gunichar c = 0; - gchar buf[7]; - GdkModifierType consumed, state; - - event->key.type = xevent->xany.type == KeyPress ? GDK_KEY_PRESS : GDK_KEY_RELEASE; - event->key.time = xevent->xkey.time; - - event->key.state = (GdkModifierType) xevent->xkey.state; - event->key.group = _gdk_x11_get_group_for_state (display, xevent->xkey.state); - event->key.hardware_keycode = xevent->xkey.keycode; - - event->key.keyval = GDK_VoidSymbol; - - gdk_keymap_translate_keyboard_state (keymap, - event->key.hardware_keycode, - event->key.state, - event->key.group, - &event->key.keyval, - NULL, NULL, &consumed); - state = event->key.state & ~consumed; - _gdk_keymap_add_virtual_modifiers_compat (keymap, &state); - event->key.state |= state; - - event->key.is_modifier = _gdk_keymap_key_is_modifier (keymap, event->key.hardware_keycode); - - /* Fill in event->string crudely, since various programs - * depend on it. - */ - event->key.string = NULL; - - if (event->key.keyval != GDK_VoidSymbol) - c = gdk_keyval_to_unicode (event->key.keyval); - - if (c) - { - gsize bytes_written; - gint len; - - /* Apply the control key - Taken from Xlib - */ - if (event->key.state & GDK_CONTROL_MASK) - { - if ((c >= '@' && c < '\177') || c == ' ') c &= 0x1F; - else if (c == '2') - { - event->key.string = g_memdup ("\0\0", 2); - event->key.length = 1; - buf[0] = '\0'; - goto out; - } - else if (c >= '3' && c <= '7') c -= ('3' - '\033'); - else if (c == '8') c = '\177'; - else if (c == '/') c = '_' & 0x1F; - } - - len = g_unichar_to_utf8 (c, buf); - buf[len] = '\0'; - - event->key.string = g_locale_from_utf8 (buf, len, - NULL, &bytes_written, - NULL); - if (event->key.string) - event->key.length = bytes_written; - } - else if (event->key.keyval == GDK_Escape) - { - event->key.length = 1; - event->key.string = g_strdup ("\033"); - } - else if (event->key.keyval == GDK_Return || - event->key.keyval == GDK_KP_Enter) - { - event->key.length = 1; - event->key.string = g_strdup ("\r"); - } - - if (!event->key.string) - { - event->key.length = 0; - event->key.string = g_strdup (""); - } - - out: -#ifdef G_ENABLE_DEBUG - if (_gdk_debug_flags & GDK_DEBUG_EVENTS) - { - g_message ("%s:\t\twindow: %ld key: %12s %d", - event->type == GDK_KEY_PRESS ? "key press " : "key release", - xevent->xkey.window, - event->key.keyval ? gdk_keyval_name (event->key.keyval) : "(none)", - event->key.keyval); - - if (event->key.length > 0) - g_message ("\t\tlength: %4d string: \"%s\"", - event->key.length, buf); - } -#endif /* G_ENABLE_DEBUG */ - return; -} - -/** - * gdk_x11_register_standard_event_type: - * @display: a #GdkDisplay - * @event_base: first event type code to register - * @n_events: number of event type codes to register - * - * Registers interest in receiving extension events with type codes - * between @event_base and event_base + n_events - 1. - * The registered events must have the window field in the same place - * as core X events (this is not the case for e.g. XKB extension events). - * - * If an event type is registered, events of this type will go through - * global and window-specific filters (see gdk_window_add_filter()). - * Unregistered events will only go through global filters. - * GDK may register the events of some X extensions on its own. - * - * This function should only be needed in unusual circumstances, e.g. - * when filtering XInput extension events on the root window. - * - * Since: 2.4 - **/ -void -gdk_x11_register_standard_event_type (GdkDisplay *display, - gint event_base, - gint n_events) -{ - GdkEventTypeX11 *event_type; - GdkDisplayX11 *display_x11; - - display_x11 = GDK_DISPLAY_X11 (display); - event_type = g_new (GdkEventTypeX11, 1); - - event_type->base = event_base; - event_type->n_events = n_events; - - display_x11->event_types = g_slist_prepend (display_x11->event_types, event_type); -} - -/* Return the window this has to do with, if any, rather - * than the frame or root window that was selecting - * for substructure - */ -static void -get_real_window (GdkDisplay *display, - XEvent *event, - Window *event_window, - Window *filter_window) -{ - /* Core events all have an event->xany.window field, but that's - * not true for extension events - */ - if (event->type >= KeyPress && - event->type <= MappingNotify) - { - *filter_window = event->xany.window; - switch (event->type) - { - case CreateNotify: - *event_window = event->xcreatewindow.window; - break; - case DestroyNotify: - *event_window = event->xdestroywindow.window; - break; - case UnmapNotify: - *event_window = event->xunmap.window; - break; - case MapNotify: - *event_window = event->xmap.window; - break; - case MapRequest: - *event_window = event->xmaprequest.window; - break; - case ReparentNotify: - *event_window = event->xreparent.window; - break; - case ConfigureNotify: - *event_window = event->xconfigure.window; - break; - case ConfigureRequest: - *event_window = event->xconfigurerequest.window; - break; - case GravityNotify: - *event_window = event->xgravity.window; - break; - case CirculateNotify: - *event_window = event->xcirculate.window; - break; - case CirculateRequest: - *event_window = event->xcirculaterequest.window; - break; - default: - *event_window = event->xany.window; - } - } - else - { - GdkDisplayX11 *display_x11 = GDK_DISPLAY_X11 (display); - GSList *tmp_list; - - for (tmp_list = display_x11->event_types; - tmp_list; - tmp_list = tmp_list->next) - { - GdkEventTypeX11 *event_type = tmp_list->data; - - if (event->type >= event_type->base && - event->type < event_type->base + event_type->n_events) - { - *event_window = event->xany.window; - *filter_window = event->xany.window; - return; - } - } - - *event_window = None; - *filter_window = None; - } -} - -#ifdef G_ENABLE_DEBUG -static const char notify_modes[][19] = { - "NotifyNormal", - "NotifyGrab", - "NotifyUngrab", - "NotifyWhileGrabbed" -}; - -static const char notify_details[][23] = { - "NotifyAncestor", - "NotifyVirtual", - "NotifyInferior", - "NotifyNonlinear", - "NotifyNonlinearVirtual", - "NotifyPointer", - "NotifyPointerRoot", - "NotifyDetailNone" -}; -#endif - -static void -set_user_time (GdkWindow *window, - GdkEvent *event) -{ - g_return_if_fail (event != NULL); - - window = gdk_window_get_toplevel (event->client.window); - g_return_if_fail (GDK_IS_WINDOW (window)); - - /* If an event doesn't have a valid timestamp, we shouldn't use it - * to update the latest user interaction time. - */ - if (gdk_event_get_time (event) != GDK_CURRENT_TIME) - gdk_x11_window_set_user_time (gdk_window_get_toplevel (window), - gdk_event_get_time (event)); -} - -static gboolean -is_parent_of (GdkWindow *parent, - GdkWindow *child) -{ - GdkWindow *w; - - w = child; - while (w != NULL) - { - if (w == parent) - return TRUE; - - w = gdk_window_get_parent (w); - } - - return FALSE; -} - -static gboolean -gdk_event_translate (GdkDisplay *display, - GdkEvent *event, - XEvent *xevent, - gboolean return_exposes) -{ - - GdkWindow *window; - GdkWindowObject *window_private; - GdkWindow *filter_window; - GdkWindowImplX11 *window_impl = NULL; - gboolean return_val; - GdkScreen *screen = NULL; - GdkScreenX11 *screen_x11 = NULL; - GdkToplevelX11 *toplevel = NULL; - GdkDisplayX11 *display_x11 = GDK_DISPLAY_X11 (display); - Window xwindow, filter_xwindow; - - return_val = FALSE; - - /* init these, since the done: block uses them */ - window = NULL; - window_private = NULL; - event->any.window = NULL; - - if (_gdk_default_filters) - { - /* Apply global filters */ - GdkFilterReturn result; - result = gdk_event_apply_filters (xevent, event, - _gdk_default_filters); - - if (result != GDK_FILTER_CONTINUE) - { - return_val = (result == GDK_FILTER_TRANSLATE) ? TRUE : FALSE; - goto done; - } - } - - /* Find the GdkWindow that this event relates to. - * Basically this means substructure events - * are reported same as structure events - */ - get_real_window (display, xevent, &xwindow, &filter_xwindow); - - window = gdk_window_lookup_for_display (display, xwindow); - /* We may receive events such as NoExpose/GraphicsExpose - * and ShmCompletion for pixmaps - */ - if (window && !GDK_IS_WINDOW (window)) - window = NULL; - window_private = (GdkWindowObject *) window; - - /* We always run the filters for the window where the event - * is delivered, not the window that it relates to - */ - if (filter_xwindow == xwindow) - filter_window = window; - else - { - filter_window = gdk_window_lookup_for_display (display, filter_xwindow); - if (filter_window && !GDK_IS_WINDOW (filter_window)) - filter_window = NULL; - } - - if (window) - { - screen = GDK_WINDOW_SCREEN (window); - screen_x11 = GDK_SCREEN_X11 (screen); - toplevel = _gdk_x11_window_get_toplevel (window); - } - - if (window != NULL) - { - /* Apply keyboard grabs to non-native windows */ - if (/* Is key event */ - (xevent->type == KeyPress || xevent->type == KeyRelease) && - /* And we have a grab */ - display->keyboard_grab.window != NULL && - ( - /* The window is not a descendant of the grabbed window */ - !is_parent_of ((GdkWindow *)display->keyboard_grab.window, window) || - /* Or owner event is false */ - !display->keyboard_grab.owner_events - ) - ) - { - /* Report key event against grab window */ - window = display->keyboard_grab.window;; - window_private = (GdkWindowObject *) window; - } - - window_impl = GDK_WINDOW_IMPL_X11 (window_private->impl); - - /* Move key events on focus window to the real toplevel, and - * filter out all other events on focus window - */ - if (toplevel && xwindow == toplevel->focus_window) - { - switch (xevent->type) - { - case KeyPress: - case KeyRelease: - xwindow = GDK_WINDOW_XID (window); - xevent->xany.window = xwindow; - break; - default: - return FALSE; - } - } - - g_object_ref (window); - } - - event->any.window = window; - event->any.send_event = xevent->xany.send_event ? TRUE : FALSE; - - if (window_private && GDK_WINDOW_DESTROYED (window)) - { - if (xevent->type != DestroyNotify) - { - return_val = FALSE; - goto done; - } - } - else if (filter_window) - { - /* Apply per-window filters */ - GdkWindowObject *filter_private = (GdkWindowObject *) filter_window; - GdkFilterReturn result; - - if (filter_private->filters) - { - g_object_ref (filter_window); - - result = gdk_event_apply_filters (xevent, event, - filter_private->filters); - - g_object_unref (filter_window); - - if (result != GDK_FILTER_CONTINUE) - { - return_val = (result == GDK_FILTER_TRANSLATE) ? TRUE : FALSE; - goto done; - } - } - } - - if (xevent->type == DestroyNotify) - { - int i, n; - - n = gdk_display_get_n_screens (display); - for (i = 0; i < n; i++) - { - screen = gdk_display_get_screen (display, i); - screen_x11 = GDK_SCREEN_X11 (screen); - - if (screen_x11->wmspec_check_window == xwindow) - { - screen_x11->wmspec_check_window = None; - screen_x11->last_wmspec_check_time = 0; - g_free (screen_x11->window_manager_name); - screen_x11->window_manager_name = g_strdup ("unknown"); - - /* careful, reentrancy */ - _gdk_x11_screen_window_manager_changed (screen); - - return_val = FALSE; - goto done; - } - } - } - - if (window && - (xevent->xany.type == MotionNotify || - xevent->xany.type == ButtonRelease)) - { - if (_gdk_moveresize_handle_event (xevent)) - { - return_val = FALSE; - goto done; - } - } - - /* We do a "manual" conversion of the XEvent to a - * GdkEvent. The structures are mostly the same so - * the conversion is fairly straightforward. We also - * optionally print debugging info regarding events - * received. - */ - - return_val = TRUE; - - switch (xevent->type) - { - case KeyPress: - if (window_private == NULL) - { - return_val = FALSE; - break; - } - translate_key_event (display, event, xevent); - set_user_time (window, event); - break; - - case KeyRelease: - if (window_private == NULL) - { - return_val = FALSE; - break; - } - - /* Emulate detectable auto-repeat by checking to see - * if the next event is a key press with the same - * keycode and timestamp, and if so, ignoring the event. - */ - - if (!display_x11->have_xkb_autorepeat && XPending (xevent->xkey.display)) - { - XEvent next_event; - - XPeekEvent (xevent->xkey.display, &next_event); - - if (next_event.type == KeyPress && - next_event.xkey.keycode == xevent->xkey.keycode && - next_event.xkey.time == xevent->xkey.time) - { - return_val = FALSE; - break; - } - } - - translate_key_event (display, event, xevent); - break; - - case ButtonPress: - GDK_NOTE (EVENTS, - g_message ("button press:\t\twindow: %ld x,y: %d %d button: %d", - xevent->xbutton.window, - xevent->xbutton.x, xevent->xbutton.y, - xevent->xbutton.button)); - - if (window_private == NULL) - { - return_val = FALSE; - break; - } - - /* If we get a ButtonPress event where the button is 4 or 5, - it's a Scroll event */ - switch (xevent->xbutton.button) - { - case 4: /* up */ - case 5: /* down */ - case 6: /* left */ - case 7: /* right */ - event->scroll.type = GDK_SCROLL; - - if (xevent->xbutton.button == 4) - event->scroll.direction = GDK_SCROLL_UP; - else if (xevent->xbutton.button == 5) - event->scroll.direction = GDK_SCROLL_DOWN; - else if (xevent->xbutton.button == 6) - event->scroll.direction = GDK_SCROLL_LEFT; - else - event->scroll.direction = GDK_SCROLL_RIGHT; - - event->scroll.window = window; - event->scroll.time = xevent->xbutton.time; - event->scroll.x = xevent->xbutton.x; - event->scroll.y = xevent->xbutton.y; - event->scroll.x_root = (gfloat)xevent->xbutton.x_root; - event->scroll.y_root = (gfloat)xevent->xbutton.y_root; - event->scroll.state = (GdkModifierType) xevent->xbutton.state; - event->scroll.device = display->core_pointer; - - if (!set_screen_from_root (display, event, xevent->xbutton.root)) - { - return_val = FALSE; - break; - } - - break; - - default: - event->button.type = GDK_BUTTON_PRESS; - event->button.window = window; - event->button.time = xevent->xbutton.time; - event->button.x = xevent->xbutton.x; - event->button.y = xevent->xbutton.y; - event->button.x_root = (gfloat)xevent->xbutton.x_root; - event->button.y_root = (gfloat)xevent->xbutton.y_root; - event->button.axes = NULL; - event->button.state = (GdkModifierType) xevent->xbutton.state; - event->button.button = xevent->xbutton.button; - event->button.device = display->core_pointer; - - if (!set_screen_from_root (display, event, xevent->xbutton.root)) - { - return_val = FALSE; - break; - } - break; - } - - set_user_time (window, event); - - break; - - case ButtonRelease: - GDK_NOTE (EVENTS, - g_message ("button release:\twindow: %ld x,y: %d %d button: %d", - xevent->xbutton.window, - xevent->xbutton.x, xevent->xbutton.y, - xevent->xbutton.button)); - - if (window_private == NULL) - { - return_val = FALSE; - break; - } - - /* We treat button presses as scroll wheel events, so ignore the release */ - if (xevent->xbutton.button == 4 || xevent->xbutton.button == 5 || - xevent->xbutton.button == 6 || xevent->xbutton.button ==7) - { - return_val = FALSE; - break; - } - - event->button.type = GDK_BUTTON_RELEASE; - event->button.window = window; - event->button.time = xevent->xbutton.time; - event->button.x = xevent->xbutton.x; - event->button.y = xevent->xbutton.y; - event->button.x_root = (gfloat)xevent->xbutton.x_root; - event->button.y_root = (gfloat)xevent->xbutton.y_root; - event->button.axes = NULL; - event->button.state = (GdkModifierType) xevent->xbutton.state; - event->button.button = xevent->xbutton.button; - event->button.device = display->core_pointer; - - if (!set_screen_from_root (display, event, xevent->xbutton.root)) - return_val = FALSE; - - break; - - case MotionNotify: - GDK_NOTE (EVENTS, - g_message ("motion notify:\t\twindow: %ld x,y: %d %d hint: %s", - xevent->xmotion.window, - xevent->xmotion.x, xevent->xmotion.y, - (xevent->xmotion.is_hint) ? "true" : "false")); - - if (window_private == NULL) - { - return_val = FALSE; - break; - } - - event->motion.type = GDK_MOTION_NOTIFY; - event->motion.window = window; - event->motion.time = xevent->xmotion.time; - event->motion.x = xevent->xmotion.x; - event->motion.y = xevent->xmotion.y; - event->motion.x_root = (gfloat)xevent->xmotion.x_root; - event->motion.y_root = (gfloat)xevent->xmotion.y_root; - event->motion.axes = NULL; - event->motion.state = (GdkModifierType) xevent->xmotion.state; - event->motion.is_hint = xevent->xmotion.is_hint; - event->motion.device = display->core_pointer; - - if (!set_screen_from_root (display, event, xevent->xbutton.root)) - { - return_val = FALSE; - break; - } - - break; - - case EnterNotify: - GDK_NOTE (EVENTS, - g_message ("enter notify:\t\twindow: %ld detail: %d subwin: %ld mode: %d", - xevent->xcrossing.window, - xevent->xcrossing.detail, - xevent->xcrossing.subwindow, - xevent->xcrossing.mode)); - - if (window_private == NULL) - { - return_val = FALSE; - break; - } - - if (!set_screen_from_root (display, event, xevent->xbutton.root)) - { - return_val = FALSE; - break; - } - - /* Handle focusing (in the case where no window manager is running */ - if (toplevel && xevent->xcrossing.detail != NotifyInferior) - { - toplevel->has_pointer = TRUE; - - if (xevent->xcrossing.focus && !toplevel->has_focus_window) - { - gboolean had_focus = HAS_FOCUS (toplevel); - - toplevel->has_pointer_focus = TRUE; - - if (HAS_FOCUS (toplevel) != had_focus) - generate_focus_event (window, TRUE); - } - } - - event->crossing.type = GDK_ENTER_NOTIFY; - event->crossing.window = window; - - /* If the subwindow field of the XEvent is non-NULL, then - * lookup the corresponding GdkWindow. - */ - if (xevent->xcrossing.subwindow != None) - event->crossing.subwindow = gdk_window_lookup_for_display (display, xevent->xcrossing.subwindow); - else - event->crossing.subwindow = NULL; - - event->crossing.time = xevent->xcrossing.time; - event->crossing.x = xevent->xcrossing.x; - event->crossing.y = xevent->xcrossing.y; - event->crossing.x_root = xevent->xcrossing.x_root; - event->crossing.y_root = xevent->xcrossing.y_root; - - /* Translate the crossing mode into Gdk terms. - */ - switch (xevent->xcrossing.mode) - { - case NotifyNormal: - event->crossing.mode = GDK_CROSSING_NORMAL; - break; - case NotifyGrab: - event->crossing.mode = GDK_CROSSING_GRAB; - break; - case NotifyUngrab: - event->crossing.mode = GDK_CROSSING_UNGRAB; - break; - }; - - /* Translate the crossing detail into Gdk terms. - */ - switch (xevent->xcrossing.detail) - { - case NotifyInferior: - event->crossing.detail = GDK_NOTIFY_INFERIOR; - break; - case NotifyAncestor: - event->crossing.detail = GDK_NOTIFY_ANCESTOR; - break; - case NotifyVirtual: - event->crossing.detail = GDK_NOTIFY_VIRTUAL; - break; - case NotifyNonlinear: - event->crossing.detail = GDK_NOTIFY_NONLINEAR; - break; - case NotifyNonlinearVirtual: - event->crossing.detail = GDK_NOTIFY_NONLINEAR_VIRTUAL; - break; - default: - event->crossing.detail = GDK_NOTIFY_UNKNOWN; - break; - } - - event->crossing.focus = xevent->xcrossing.focus; - event->crossing.state = xevent->xcrossing.state; - - break; - - case LeaveNotify: - GDK_NOTE (EVENTS, - g_message ("leave notify:\t\twindow: %ld detail: %d subwin: %ld mode: %d", - xevent->xcrossing.window, - xevent->xcrossing.detail, - xevent->xcrossing.subwindow, - xevent->xcrossing.mode)); - - if (window_private == NULL) - { - return_val = FALSE; - break; - } - - if (!set_screen_from_root (display, event, xevent->xbutton.root)) - { - return_val = FALSE; - break; - } - - /* Handle focusing (in the case where no window manager is running */ - if (toplevel && xevent->xcrossing.detail != NotifyInferior) - { - toplevel->has_pointer = FALSE; - - if (xevent->xcrossing.focus && !toplevel->has_focus_window) - { - gboolean had_focus = HAS_FOCUS (toplevel); - - toplevel->has_pointer_focus = FALSE; - - if (HAS_FOCUS (toplevel) != had_focus) - generate_focus_event (window, FALSE); - } - } - - event->crossing.type = GDK_LEAVE_NOTIFY; - event->crossing.window = window; - - /* If the subwindow field of the XEvent is non-NULL, then - * lookup the corresponding GdkWindow. - */ - if (xevent->xcrossing.subwindow != None) - event->crossing.subwindow = gdk_window_lookup_for_display (display, xevent->xcrossing.subwindow); - else - event->crossing.subwindow = NULL; - - event->crossing.time = xevent->xcrossing.time; - event->crossing.x = xevent->xcrossing.x; - event->crossing.y = xevent->xcrossing.y; - event->crossing.x_root = xevent->xcrossing.x_root; - event->crossing.y_root = xevent->xcrossing.y_root; - - /* Translate the crossing mode into Gdk terms. - */ - switch (xevent->xcrossing.mode) - { - case NotifyNormal: - event->crossing.mode = GDK_CROSSING_NORMAL; - break; - case NotifyGrab: - event->crossing.mode = GDK_CROSSING_GRAB; - break; - case NotifyUngrab: - event->crossing.mode = GDK_CROSSING_UNGRAB; - break; - }; - - /* Translate the crossing detail into Gdk terms. - */ - switch (xevent->xcrossing.detail) - { - case NotifyInferior: - event->crossing.detail = GDK_NOTIFY_INFERIOR; - break; - case NotifyAncestor: - event->crossing.detail = GDK_NOTIFY_ANCESTOR; - break; - case NotifyVirtual: - event->crossing.detail = GDK_NOTIFY_VIRTUAL; - break; - case NotifyNonlinear: - event->crossing.detail = GDK_NOTIFY_NONLINEAR; - break; - case NotifyNonlinearVirtual: - event->crossing.detail = GDK_NOTIFY_NONLINEAR_VIRTUAL; - break; - default: - event->crossing.detail = GDK_NOTIFY_UNKNOWN; - break; - } - - event->crossing.focus = xevent->xcrossing.focus; - event->crossing.state = xevent->xcrossing.state; - - break; - - /* We only care about focus events that indicate that _this_ - * window (not a ancestor or child) got or lost the focus - */ - case FocusIn: - GDK_NOTE (EVENTS, - g_message ("focus in:\t\twindow: %ld, detail: %s, mode: %s", - xevent->xfocus.window, - notify_details[xevent->xfocus.detail], - notify_modes[xevent->xfocus.mode])); - - if (toplevel) - { - gboolean had_focus = HAS_FOCUS (toplevel); - - switch (xevent->xfocus.detail) - { - case NotifyAncestor: - case NotifyVirtual: - /* When the focus moves from an ancestor of the window to - * the window or a descendent of the window, *and* the - * pointer is inside the window, then we were previously - * receiving keystroke events in the has_pointer_focus - * case and are now receiving them in the - * has_focus_window case. - */ - if (toplevel->has_pointer && - xevent->xfocus.mode != NotifyGrab && - xevent->xfocus.mode != NotifyUngrab) - toplevel->has_pointer_focus = FALSE; - - /* fall through */ - case NotifyNonlinear: - case NotifyNonlinearVirtual: - if (xevent->xfocus.mode != NotifyGrab && - xevent->xfocus.mode != NotifyUngrab) - toplevel->has_focus_window = TRUE; - /* We pretend that the focus moves to the grab - * window, so we pay attention to NotifyGrab - * NotifyUngrab, and ignore NotifyWhileGrabbed - */ - if (xevent->xfocus.mode != NotifyWhileGrabbed) - toplevel->has_focus = TRUE; - break; - case NotifyPointer: - /* The X server sends NotifyPointer/NotifyGrab, - * but the pointer focus is ignored while a - * grab is in effect - */ - if (xevent->xfocus.mode != NotifyGrab && - xevent->xfocus.mode != NotifyUngrab) - toplevel->has_pointer_focus = TRUE; - break; - case NotifyInferior: - case NotifyPointerRoot: - case NotifyDetailNone: - break; - } - - if (HAS_FOCUS (toplevel) != had_focus) - generate_focus_event (window, TRUE); - } - break; - case FocusOut: - GDK_NOTE (EVENTS, - g_message ("focus out:\t\twindow: %ld, detail: %s, mode: %s", - xevent->xfocus.window, - notify_details[xevent->xfocus.detail], - notify_modes[xevent->xfocus.mode])); - - if (toplevel) - { - gboolean had_focus = HAS_FOCUS (toplevel); - - switch (xevent->xfocus.detail) - { - case NotifyAncestor: - case NotifyVirtual: - /* When the focus moves from the window or a descendent - * of the window to an ancestor of the window, *and* the - * pointer is inside the window, then we were previously - * receiving keystroke events in the has_focus_window - * case and are now receiving them in the - * has_pointer_focus case. - */ - if (toplevel->has_pointer && - xevent->xfocus.mode != NotifyGrab && - xevent->xfocus.mode != NotifyUngrab) - toplevel->has_pointer_focus = TRUE; - - /* fall through */ - case NotifyNonlinear: - case NotifyNonlinearVirtual: - if (xevent->xfocus.mode != NotifyGrab && - xevent->xfocus.mode != NotifyUngrab) - toplevel->has_focus_window = FALSE; - if (xevent->xfocus.mode != NotifyWhileGrabbed) - toplevel->has_focus = FALSE; - break; - case NotifyPointer: - if (xevent->xfocus.mode != NotifyGrab && - xevent->xfocus.mode != NotifyUngrab) - toplevel->has_pointer_focus = FALSE; - break; - case NotifyInferior: - case NotifyPointerRoot: - case NotifyDetailNone: - break; - } - - if (HAS_FOCUS (toplevel) != had_focus) - generate_focus_event (window, FALSE); - } - break; - -#if 0 - /* gdk_keyboard_grab() causes following events. These events confuse - * the XIM focus, so ignore them. - */ - if (xevent->xfocus.mode == NotifyGrab || - xevent->xfocus.mode == NotifyUngrab) - break; -#endif - - case KeymapNotify: - GDK_NOTE (EVENTS, - g_message ("keymap notify")); - - /* Not currently handled */ - return_val = FALSE; - break; - - case Expose: - GDK_NOTE (EVENTS, - g_message ("expose:\t\twindow: %ld %d x,y: %d %d w,h: %d %d%s", - xevent->xexpose.window, xevent->xexpose.count, - xevent->xexpose.x, xevent->xexpose.y, - xevent->xexpose.width, xevent->xexpose.height, - event->any.send_event ? " (send)" : "")); - - if (window_private == NULL) - { - return_val = FALSE; - break; - } - - { - GdkRectangle expose_rect; - - expose_rect.x = xevent->xexpose.x; - expose_rect.y = xevent->xexpose.y; - expose_rect.width = xevent->xexpose.width; - expose_rect.height = xevent->xexpose.height; - - _gdk_window_process_expose (window, xevent->xexpose.serial, &expose_rect); - return_val = FALSE; - } - - break; - - case GraphicsExpose: - { - GdkRectangle expose_rect; - - GDK_NOTE (EVENTS, - g_message ("graphics expose:\tdrawable: %ld", - xevent->xgraphicsexpose.drawable)); - - if (window_private == NULL) - { - return_val = FALSE; - break; - } - - expose_rect.x = xevent->xgraphicsexpose.x; - expose_rect.y = xevent->xgraphicsexpose.y; - expose_rect.width = xevent->xgraphicsexpose.width; - expose_rect.height = xevent->xgraphicsexpose.height; - - if (return_exposes) - { - event->expose.type = GDK_EXPOSE; - event->expose.area = expose_rect; - event->expose.region = gdk_region_rectangle (&expose_rect); - event->expose.window = window; - event->expose.count = xevent->xgraphicsexpose.count; - - return_val = TRUE; - } - else - { - _gdk_window_process_expose (window, xevent->xgraphicsexpose.serial, &expose_rect); - - return_val = FALSE; - } - - } - break; - - case NoExpose: - GDK_NOTE (EVENTS, - g_message ("no expose:\t\tdrawable: %ld", - xevent->xnoexpose.drawable)); - - event->no_expose.type = GDK_NO_EXPOSE; - event->no_expose.window = window; - - break; - - case VisibilityNotify: -#ifdef G_ENABLE_DEBUG - if (_gdk_debug_flags & GDK_DEBUG_EVENTS) - switch (xevent->xvisibility.state) - { - case VisibilityFullyObscured: - g_message ("visibility notify:\twindow: %ld none", - xevent->xvisibility.window); - break; - case VisibilityPartiallyObscured: - g_message ("visibility notify:\twindow: %ld partial", - xevent->xvisibility.window); - break; - case VisibilityUnobscured: - g_message ("visibility notify:\twindow: %ld full", - xevent->xvisibility.window); - break; - } -#endif /* G_ENABLE_DEBUG */ - - if (window_private == NULL) - { - return_val = FALSE; - break; - } - - event->visibility.type = GDK_VISIBILITY_NOTIFY; - event->visibility.window = window; - - switch (xevent->xvisibility.state) - { - case VisibilityFullyObscured: - event->visibility.state = GDK_VISIBILITY_FULLY_OBSCURED; - break; - - case VisibilityPartiallyObscured: - event->visibility.state = GDK_VISIBILITY_PARTIAL; - break; - - case VisibilityUnobscured: - event->visibility.state = GDK_VISIBILITY_UNOBSCURED; - break; - } - - break; - - case CreateNotify: - GDK_NOTE (EVENTS, - g_message ("create notify:\twindow: %ld x,y: %d %d w,h: %d %d b-w: %d parent: %ld ovr: %d", - xevent->xcreatewindow.window, - xevent->xcreatewindow.x, - xevent->xcreatewindow.y, - xevent->xcreatewindow.width, - xevent->xcreatewindow.height, - xevent->xcreatewindow.border_width, - xevent->xcreatewindow.parent, - xevent->xcreatewindow.override_redirect)); - /* not really handled */ - break; - - case DestroyNotify: - GDK_NOTE (EVENTS, - g_message ("destroy notify:\twindow: %ld", - xevent->xdestroywindow.window)); - - /* Ignore DestroyNotify from SubstructureNotifyMask */ - if (xevent->xdestroywindow.window == xevent->xdestroywindow.event) - { - event->any.type = GDK_DESTROY; - event->any.window = window; - - return_val = window_private && !GDK_WINDOW_DESTROYED (window); - - if (window && GDK_WINDOW_XID (window) != screen_x11->xroot_window) - gdk_window_destroy_notify (window); - } - else - return_val = FALSE; - - break; - - case UnmapNotify: - GDK_NOTE (EVENTS, - g_message ("unmap notify:\t\twindow: %ld", - xevent->xmap.window)); - - event->any.type = GDK_UNMAP; - event->any.window = window; - - /* If we are shown (not withdrawn) and get an unmap, it means we - * were iconified in the X sense. If we are withdrawn, and get - * an unmap, it means we hid the window ourselves, so we - * will have already flipped the iconified bit off. - */ - if (window) - { - if (GDK_WINDOW_IS_MAPPED (window)) - gdk_synthesize_window_state (window, - 0, - GDK_WINDOW_STATE_ICONIFIED); - - _gdk_xgrab_check_unmap (window, xevent->xany.serial); - } - - break; - - case MapNotify: - GDK_NOTE (EVENTS, - g_message ("map notify:\t\twindow: %ld", - xevent->xmap.window)); - - event->any.type = GDK_MAP; - event->any.window = window; - - /* Unset iconified if it was set */ - if (window && (((GdkWindowObject*)window)->state & GDK_WINDOW_STATE_ICONIFIED)) - gdk_synthesize_window_state (window, - GDK_WINDOW_STATE_ICONIFIED, - 0); - - break; - - case ReparentNotify: - GDK_NOTE (EVENTS, - g_message ("reparent notify:\twindow: %ld x,y: %d %d parent: %ld ovr: %d", - xevent->xreparent.window, - xevent->xreparent.x, - xevent->xreparent.y, - xevent->xreparent.parent, - xevent->xreparent.override_redirect)); - - /* Not currently handled */ - return_val = FALSE; - break; - - case ConfigureNotify: - GDK_NOTE (EVENTS, - g_message ("configure notify:\twindow: %ld x,y: %d %d w,h: %d %d b-w: %d above: %ld ovr: %d%s", - xevent->xconfigure.window, - xevent->xconfigure.x, - xevent->xconfigure.y, - xevent->xconfigure.width, - xevent->xconfigure.height, - xevent->xconfigure.border_width, - xevent->xconfigure.above, - xevent->xconfigure.override_redirect, - !window - ? " (discarding)" - : GDK_WINDOW_TYPE (window) == GDK_WINDOW_CHILD - ? " (discarding child)" - : xevent->xconfigure.event != xevent->xconfigure.window - ? " (discarding substructure)" - : "")); - if (window && GDK_WINDOW_TYPE (window) == GDK_WINDOW_ROOT) - { - window_private->width = xevent->xconfigure.width; - window_private->height = xevent->xconfigure.height; - - _gdk_window_update_size (window); - _gdk_x11_drawable_update_size (window_private->impl); - _gdk_x11_screen_size_changed (screen, xevent); - } - - if (window && - xevent->xconfigure.event == xevent->xconfigure.window && - !GDK_WINDOW_DESTROYED (window) && - window_private->input_window != NULL) - _gdk_input_configure_event (&xevent->xconfigure, window); - -#ifdef HAVE_XSYNC - if (toplevel && display_x11->use_sync && !XSyncValueIsZero (toplevel->pending_counter_value)) - { - toplevel->current_counter_value = toplevel->pending_counter_value; - XSyncIntToValue (&toplevel->pending_counter_value, 0); - } -#endif - - if (!window || - xevent->xconfigure.event != xevent->xconfigure.window || - GDK_WINDOW_TYPE (window) == GDK_WINDOW_CHILD || - GDK_WINDOW_TYPE (window) == GDK_WINDOW_ROOT) - return_val = FALSE; - else - { - event->configure.type = GDK_CONFIGURE; - event->configure.window = window; - event->configure.width = xevent->xconfigure.width; - event->configure.height = xevent->xconfigure.height; - - if (!xevent->xconfigure.send_event && - !xevent->xconfigure.override_redirect && - !GDK_WINDOW_DESTROYED (window)) - { - gint tx = 0; - gint ty = 0; - Window child_window = 0; - - gdk_error_trap_push (); - if (XTranslateCoordinates (GDK_DRAWABLE_XDISPLAY (window), - GDK_DRAWABLE_XID (window), - screen_x11->xroot_window, - 0, 0, - &tx, &ty, - &child_window)) - { - event->configure.x = tx; - event->configure.y = ty; - } - gdk_error_trap_pop (); - } - else - { - event->configure.x = xevent->xconfigure.x; - event->configure.y = xevent->xconfigure.y; - } - window_private->x = event->configure.x; - window_private->y = event->configure.y; - window_private->width = xevent->xconfigure.width; - window_private->height = xevent->xconfigure.height; - - _gdk_window_update_size (window); - _gdk_x11_drawable_update_size (window_private->impl); - - if (window_private->resize_count >= 1) - { - window_private->resize_count -= 1; - - if (window_private->resize_count == 0) - _gdk_moveresize_configure_done (display, window); - } - } - break; - - case PropertyNotify: - GDK_NOTE (EVENTS, - g_message ("property notify:\twindow: %ld, atom(%ld): %s%s%s", - xevent->xproperty.window, - xevent->xproperty.atom, - "\"", - gdk_x11_get_xatom_name_for_display (display, xevent->xproperty.atom), - "\"")); - - if (window_private == NULL) - { - return_val = FALSE; - break; - } - - /* We compare with the serial of the last time we mapped the - * window to avoid refetching properties that we set ourselves - */ - if (toplevel && - xevent->xproperty.serial >= toplevel->map_serial) - { - if (xevent->xproperty.atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE")) - gdk_check_wm_state_changed (window); - - if (xevent->xproperty.atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_DESKTOP")) - gdk_check_wm_desktop_changed (window); - } - - if (window_private->event_mask & GDK_PROPERTY_CHANGE_MASK) - { - event->property.type = GDK_PROPERTY_NOTIFY; - event->property.window = window; - event->property.atom = gdk_x11_xatom_to_atom_for_display (display, xevent->xproperty.atom); - event->property.time = xevent->xproperty.time; - event->property.state = xevent->xproperty.state; - } - else - return_val = FALSE; - - break; - - case SelectionClear: - GDK_NOTE (EVENTS, - g_message ("selection clear:\twindow: %ld", - xevent->xproperty.window)); - - if (_gdk_selection_filter_clear_event (&xevent->xselectionclear)) - { - event->selection.type = GDK_SELECTION_CLEAR; - event->selection.window = window; - event->selection.selection = gdk_x11_xatom_to_atom_for_display (display, xevent->xselectionclear.selection); - event->selection.time = xevent->xselectionclear.time; - } - else - return_val = FALSE; - - break; - - case SelectionRequest: - GDK_NOTE (EVENTS, - g_message ("selection request:\twindow: %ld", - xevent->xproperty.window)); - - event->selection.type = GDK_SELECTION_REQUEST; - event->selection.window = window; - event->selection.selection = gdk_x11_xatom_to_atom_for_display (display, xevent->xselectionrequest.selection); - event->selection.target = gdk_x11_xatom_to_atom_for_display (display, xevent->xselectionrequest.target); - event->selection.property = gdk_x11_xatom_to_atom_for_display (display, xevent->xselectionrequest.property); - event->selection.requestor = xevent->xselectionrequest.requestor; - event->selection.time = xevent->xselectionrequest.time; - - break; - - case SelectionNotify: - GDK_NOTE (EVENTS, - g_message ("selection notify:\twindow: %ld", - xevent->xproperty.window)); - - - event->selection.type = GDK_SELECTION_NOTIFY; - event->selection.window = window; - event->selection.selection = gdk_x11_xatom_to_atom_for_display (display, xevent->xselection.selection); - event->selection.target = gdk_x11_xatom_to_atom_for_display (display, xevent->xselection.target); - if (xevent->xselection.property == None) - event->selection.property = GDK_NONE; - else - event->selection.property = gdk_x11_xatom_to_atom_for_display (display, xevent->xselection.property); - event->selection.time = xevent->xselection.time; - - break; - - case ColormapNotify: - GDK_NOTE (EVENTS, - g_message ("colormap notify:\twindow: %ld", - xevent->xcolormap.window)); - - /* Not currently handled */ - return_val = FALSE; - break; - - case ClientMessage: - { - GList *tmp_list; - GdkFilterReturn result = GDK_FILTER_CONTINUE; - GdkAtom message_type = gdk_x11_xatom_to_atom_for_display (display, xevent->xclient.message_type); - - GDK_NOTE (EVENTS, - g_message ("client message:\twindow: %ld", - xevent->xclient.window)); - - tmp_list = display_x11->client_filters; - while (tmp_list) - { - GdkClientFilter *filter = tmp_list->data; - tmp_list = tmp_list->next; - - if (filter->type == message_type) - { - result = (*filter->function) (xevent, event, filter->data); - if (result != GDK_FILTER_CONTINUE) - break; - } - } - - switch (result) - { - case GDK_FILTER_REMOVE: - return_val = FALSE; - break; - case GDK_FILTER_TRANSLATE: - return_val = TRUE; - break; - case GDK_FILTER_CONTINUE: - /* Send unknown ClientMessage's on to Gtk for it to use */ - if (window_private == NULL) - { - return_val = FALSE; - } - else - { - event->client.type = GDK_CLIENT_EVENT; - event->client.window = window; - event->client.message_type = message_type; - event->client.data_format = xevent->xclient.format; - memcpy(&event->client.data, &xevent->xclient.data, - sizeof(event->client.data)); - } - break; - } - } - - break; - - case MappingNotify: - GDK_NOTE (EVENTS, - g_message ("mapping notify")); - - /* Let XLib know that there is a new keyboard mapping. - */ - XRefreshKeyboardMapping (&xevent->xmapping); - _gdk_keymap_keys_changed (display); - return_val = FALSE; - break; - - default: -#ifdef HAVE_XKB - if (xevent->type == display_x11->xkb_event_type) - { - XkbEvent *xkb_event = (XkbEvent *)xevent; - - switch (xkb_event->any.xkb_type) - { - case XkbNewKeyboardNotify: - case XkbMapNotify: - _gdk_keymap_keys_changed (display); - - return_val = FALSE; - break; - - case XkbStateNotify: - _gdk_keymap_state_changed (display, xevent); - break; - } - } - else -#endif -#ifdef HAVE_XFIXES - if (xevent->type - display_x11->xfixes_event_base == XFixesSelectionNotify) - { - XFixesSelectionNotifyEvent *selection_notify = (XFixesSelectionNotifyEvent *)xevent; - - _gdk_x11_screen_process_owner_change (screen, xevent); - - event->owner_change.type = GDK_OWNER_CHANGE; - event->owner_change.window = window; - event->owner_change.owner = selection_notify->owner; - event->owner_change.reason = selection_notify->subtype; - event->owner_change.selection = - gdk_x11_xatom_to_atom_for_display (display, - selection_notify->selection); - event->owner_change.time = selection_notify->timestamp; - event->owner_change.selection_time = selection_notify->selection_timestamp; - - return_val = TRUE; - } - else -#endif -#ifdef HAVE_RANDR - if (xevent->type - display_x11->xrandr_event_base == RRScreenChangeNotify || - xevent->type - display_x11->xrandr_event_base == RRNotify) - { - if (screen) - _gdk_x11_screen_size_changed (screen, xevent); - } - else -#endif -#if defined(HAVE_XCOMPOSITE) && defined (HAVE_XDAMAGE) && defined (HAVE_XFIXES) - if (display_x11->have_xdamage && window_private && window_private->composited && - xevent->type == display_x11->xdamage_event_base + XDamageNotify && - ((XDamageNotifyEvent *) xevent)->damage == window_impl->damage) - { - XDamageNotifyEvent *damage_event = (XDamageNotifyEvent *) xevent; - XserverRegion repair; - GdkRectangle rect; - - rect.x = window_private->x + damage_event->area.x; - rect.y = window_private->y + damage_event->area.y; - rect.width = damage_event->area.width; - rect.height = damage_event->area.height; - - repair = XFixesCreateRegion (display_x11->xdisplay, - &damage_event->area, 1); - XDamageSubtract (display_x11->xdisplay, - window_impl->damage, - repair, None); - XFixesDestroyRegion (display_x11->xdisplay, repair); - - if (window_private->parent != NULL) - _gdk_window_process_expose (GDK_WINDOW (window_private->parent), - damage_event->serial, &rect); - - return_val = TRUE; - } - else -#endif - { - /* something else - (e.g., a Xinput event) */ - - if (window_private && - !GDK_WINDOW_DESTROYED (window_private) && - window_private->input_window) - return_val = _gdk_input_other_event (event, xevent, window); - else - return_val = FALSE; - - break; - } - } - - done: - if (return_val) - { - if (event->any.window) - g_object_ref (event->any.window); - if (((event->any.type == GDK_ENTER_NOTIFY) || - (event->any.type == GDK_LEAVE_NOTIFY)) && - (event->crossing.subwindow != NULL)) - g_object_ref (event->crossing.subwindow); - } - else - { - /* Mark this event as having no resources to be freed */ - event->any.window = NULL; - event->any.type = GDK_NOTHING; - } - - if (window) - g_object_unref (window); - - return return_val; -} - -static GdkFilterReturn -gdk_wm_protocols_filter (GdkXEvent *xev, - GdkEvent *event, - gpointer data) -{ - XEvent *xevent = (XEvent *)xev; - GdkWindow *win = event->any.window; - GdkDisplay *display; - Atom atom; - - if (!win) - return GDK_FILTER_REMOVE; - - display = GDK_WINDOW_DISPLAY (win); - atom = (Atom)xevent->xclient.data.l[0]; - - if (atom == gdk_x11_get_xatom_by_name_for_display (display, "WM_DELETE_WINDOW")) - { - /* The delete window request specifies a window - * to delete. We don't actually destroy the - * window because "it is only a request". (The - * window might contain vital data that the - * program does not want destroyed). Instead - * the event is passed along to the program, - * which should then destroy the window. - */ - GDK_NOTE (EVENTS, - g_message ("delete window:\t\twindow: %ld", - xevent->xclient.window)); - - event->any.type = GDK_DELETE; - - gdk_x11_window_set_user_time (win, xevent->xclient.data.l[1]); - - return GDK_FILTER_TRANSLATE; - } - else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "WM_TAKE_FOCUS")) - { - GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (event->any.window); - GdkWindowObject *private = (GdkWindowObject *)win; - - /* There is no way of knowing reliably whether we are viewable; - * _gdk_x11_set_input_focus_safe() traps errors asynchronously. - */ - if (toplevel && private->accept_focus) - _gdk_x11_set_input_focus_safe (display, toplevel->focus_window, - RevertToParent, - xevent->xclient.data.l[1]); - - return GDK_FILTER_REMOVE; - } - else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_PING") && - !_gdk_x11_display_is_root_window (display, - xevent->xclient.window)) - { - XClientMessageEvent xclient = xevent->xclient; - - xclient.window = GDK_WINDOW_XROOTWIN (win); - XSendEvent (GDK_WINDOW_XDISPLAY (win), - xclient.window, - False, - SubstructureRedirectMask | SubstructureNotifyMask, (XEvent *)&xclient); - - return GDK_FILTER_REMOVE; - } - else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_SYNC_REQUEST") && - GDK_DISPLAY_X11 (display)->use_sync) - { - GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (event->any.window); - if (toplevel) - { -#ifdef HAVE_XSYNC - XSyncIntsToValue (&toplevel->pending_counter_value, - xevent->xclient.data.l[2], - xevent->xclient.data.l[3]); -#endif - } - return GDK_FILTER_REMOVE; - } - - return GDK_FILTER_CONTINUE; -} - -void -_gdk_events_queue (GdkDisplay *display) -{ - GList *node; - GdkEvent *event; - XEvent xevent; - Display *xdisplay = GDK_DISPLAY_XDISPLAY (display); - - while (!_gdk_event_queue_find_first(display) && XPending (xdisplay)) - { - XNextEvent (xdisplay, &xevent); - - switch (xevent.type) - { - case KeyPress: - case KeyRelease: - break; - default: - if (XFilterEvent (&xevent, None)) - continue; - } - - event = gdk_event_new (GDK_NOTHING); - - event->any.window = NULL; - event->any.send_event = xevent.xany.send_event ? TRUE : FALSE; - - ((GdkEventPrivate *)event)->flags |= GDK_EVENT_PENDING; - - node = _gdk_event_queue_append (display, event); - - if (gdk_event_translate (display, event, &xevent, FALSE)) - { - ((GdkEventPrivate *)event)->flags &= ~GDK_EVENT_PENDING; - _gdk_windowing_got_event (display, node, event, xevent.xany.serial); - } - else - { - _gdk_event_queue_remove_link (display, node); - g_list_free_1 (node); - gdk_event_free (event); - } - } -} - -static gboolean -gdk_event_prepare (GSource *source, - gint *timeout) -{ - GdkDisplay *display = ((GdkDisplaySource*)source)->display; - gboolean retval; - - GDK_THREADS_ENTER (); - - *timeout = -1; - retval = (_gdk_event_queue_find_first (display) != NULL || - gdk_check_xpending (display)); - - GDK_THREADS_LEAVE (); - - return retval; -} - -static gboolean -gdk_event_check (GSource *source) -{ - GdkDisplaySource *display_source = (GdkDisplaySource*)source; - gboolean retval; - - GDK_THREADS_ENTER (); - - if (display_source->event_poll_fd.revents & G_IO_IN) - retval = (_gdk_event_queue_find_first (display_source->display) != NULL || - gdk_check_xpending (display_source->display)); - else - retval = FALSE; - - GDK_THREADS_LEAVE (); - - return retval; -} - -static gboolean -gdk_event_dispatch (GSource *source, - GSourceFunc callback, - gpointer user_data) -{ - GdkDisplay *display = ((GdkDisplaySource*)source)->display; - GdkEvent *event; - - GDK_THREADS_ENTER (); - - _gdk_events_queue (display); - event = _gdk_event_unqueue (display); - - if (event) - { - if (_gdk_event_func) - (*_gdk_event_func) (event, _gdk_event_data); - - gdk_event_free (event); - } - - GDK_THREADS_LEAVE (); - - return TRUE; -} - -/** - * gdk_event_send_client_message_for_display: - * @display: the #GdkDisplay for the window where the message is to be sent. - * @event: the #GdkEvent to send, which should be a #GdkEventClient. - * @winid: the window to send the client message to. - * - * On X11, sends an X ClientMessage event to a given window. On - * Windows, sends a message registered with the name - * GDK_WIN32_CLIENT_MESSAGE. - * - * This could be used for communicating between different - * applications, though the amount of data is limited to 20 bytes on - * X11, and to just four bytes on Windows. - * - * Returns: non-zero on success. - * - * Since: 2.2 - */ -gboolean -gdk_event_send_client_message_for_display (GdkDisplay *display, - GdkEvent *event, - GdkNativeWindow winid) -{ - XEvent sev; - - g_return_val_if_fail(event != NULL, FALSE); - - /* Set up our event to send, with the exception of its target window */ - sev.xclient.type = ClientMessage; - sev.xclient.display = GDK_DISPLAY_XDISPLAY (display); - sev.xclient.format = event->client.data_format; - sev.xclient.window = winid; - memcpy(&sev.xclient.data, &event->client.data, sizeof (sev.xclient.data)); - sev.xclient.message_type = gdk_x11_atom_to_xatom_for_display (display, event->client.message_type); - - return _gdk_send_xevent (display, winid, False, NoEventMask, &sev); -} - - - -/* Sends a ClientMessage to all toplevel client windows */ -static gboolean -gdk_event_send_client_message_to_all_recurse (GdkDisplay *display, - XEvent *xev, - guint32 xid, - guint level) -{ - Atom type = None; - int format; - unsigned long nitems, after; - unsigned char *data; - Window *ret_children, ret_root, ret_parent; - unsigned int ret_nchildren; - gboolean send = FALSE; - gboolean found = FALSE; - gboolean result = FALSE; - int i; - - gdk_error_trap_push (); - - if (XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), xid, - gdk_x11_get_xatom_by_name_for_display (display, "WM_STATE"), - 0, 0, False, AnyPropertyType, - &type, &format, &nitems, &after, &data) != Success) - goto out; - - if (type) - { - send = TRUE; - XFree (data); - } - else - { - /* OK, we're all set, now let's find some windows to send this to */ - if (!XQueryTree (GDK_DISPLAY_XDISPLAY (display), xid, - &ret_root, &ret_parent, - &ret_children, &ret_nchildren)) - goto out; - - for(i = 0; i < ret_nchildren; i++) - if (gdk_event_send_client_message_to_all_recurse (display, xev, ret_children[i], level + 1)) - found = TRUE; - - XFree (ret_children); - } - - if (send || (!found && (level == 1))) - { - xev->xclient.window = xid; - _gdk_send_xevent (display, xid, False, NoEventMask, xev); - } - - result = send || found; - - out: - gdk_error_trap_pop (); - - return result; -} - -/** - * gdk_screen_broadcast_client_message: - * @screen: the #GdkScreen where the event will be broadcasted. - * @event: the #GdkEvent. - * - * On X11, sends an X ClientMessage event to all toplevel windows on - * @screen. - * - * Toplevel windows are determined by checking for the WM_STATE property, - * as described in the Inter-Client Communication Conventions Manual (ICCCM). - * If no windows are found with the WM_STATE property set, the message is - * sent to all children of the root window. - * - * On Windows, broadcasts a message registered with the name - * GDK_WIN32_CLIENT_MESSAGE to all top-level windows. The amount of - * data is limited to one long, i.e. four bytes. - * - * Since: 2.2 - */ - -void -gdk_screen_broadcast_client_message (GdkScreen *screen, - GdkEvent *event) -{ - XEvent sev; - GdkWindow *root_window; - - g_return_if_fail (event != NULL); - - root_window = gdk_screen_get_root_window (screen); - - /* Set up our event to send, with the exception of its target window */ - sev.xclient.type = ClientMessage; - sev.xclient.display = GDK_WINDOW_XDISPLAY (root_window); - sev.xclient.format = event->client.data_format; - memcpy(&sev.xclient.data, &event->client.data, sizeof (sev.xclient.data)); - sev.xclient.message_type = - gdk_x11_atom_to_xatom_for_display (GDK_WINDOW_DISPLAY (root_window), - event->client.message_type); - - gdk_event_send_client_message_to_all_recurse (gdk_screen_get_display (screen), - &sev, - GDK_WINDOW_XID (root_window), - 0); -} - -/* - *-------------------------------------------------------------- - * gdk_flush - * - * Flushes the Xlib output buffer and then waits - * until all requests have been received and processed - * by the X server. The only real use for this function - * is in dealing with XShm. - * - * Arguments: - * - * Results: - * - * Side effects: - * - *-------------------------------------------------------------- - */ - -void -gdk_flush (void) -{ - GSList *tmp_list = _gdk_displays; - - while (tmp_list) - { - XSync (GDK_DISPLAY_XDISPLAY (tmp_list->data), False); - tmp_list = tmp_list->next; - } -} - -static Bool -timestamp_predicate (Display *display, - XEvent *xevent, - XPointer arg) -{ - Window xwindow = GPOINTER_TO_UINT (arg); - GdkDisplay *gdk_display = gdk_x11_lookup_xdisplay (display); - - if (xevent->type == PropertyNotify && - xevent->xproperty.window == xwindow && - xevent->xproperty.atom == gdk_x11_get_xatom_by_name_for_display (gdk_display, - "GDK_TIMESTAMP_PROP")) - return True; - - return False; -} - -/** - * gdk_x11_get_server_time: - * @window: a #GdkWindow, used for communication with the server. - * The window must have GDK_PROPERTY_CHANGE_MASK in its - * events mask or a hang will result. - * - * Routine to get the current X server time stamp. - * - * Return value: the time stamp. - **/ -guint32 -gdk_x11_get_server_time (GdkWindow *window) -{ - Display *xdisplay; - Window xwindow; - guchar c = 'a'; - XEvent xevent; - Atom timestamp_prop_atom; - - g_return_val_if_fail (GDK_IS_WINDOW (window), 0); - g_return_val_if_fail (!GDK_WINDOW_DESTROYED (window), 0); - - xdisplay = GDK_WINDOW_XDISPLAY (window); - xwindow = GDK_WINDOW_XWINDOW (window); - timestamp_prop_atom = - gdk_x11_get_xatom_by_name_for_display (GDK_WINDOW_DISPLAY (window), - "GDK_TIMESTAMP_PROP"); - - XChangeProperty (xdisplay, xwindow, timestamp_prop_atom, - timestamp_prop_atom, - 8, PropModeReplace, &c, 1); - - XIfEvent (xdisplay, &xevent, - timestamp_predicate, GUINT_TO_POINTER(xwindow)); - - return xevent.xproperty.time; -} - -static void -fetch_net_wm_check_window (GdkScreen *screen) -{ - GdkScreenX11 *screen_x11; - GdkDisplay *display; - Atom type; - gint format; - gulong n_items; - gulong bytes_after; - guchar *data; - Window *xwindow; - GTimeVal tv; - gint error; - - screen_x11 = GDK_SCREEN_X11 (screen); - display = screen_x11->display; - - g_return_if_fail (GDK_DISPLAY_X11 (display)->trusted_client); - - g_get_current_time (&tv); - - if (ABS (tv.tv_sec - screen_x11->last_wmspec_check_time) < 15) - return; /* we've checked recently */ - - screen_x11->last_wmspec_check_time = tv.tv_sec; - - data = NULL; - XGetWindowProperty (screen_x11->xdisplay, screen_x11->xroot_window, - gdk_x11_get_xatom_by_name_for_display (display, "_NET_SUPPORTING_WM_CHECK"), - 0, G_MAXLONG, False, XA_WINDOW, &type, &format, - &n_items, &bytes_after, &data); - - if (type != XA_WINDOW) - { - if (data) - XFree (data); - return; - } - - xwindow = (Window *)data; - - if (screen_x11->wmspec_check_window == *xwindow) - { - XFree (xwindow); - return; - } - - gdk_error_trap_push (); - - /* Find out if this WM goes away, so we can reset everything. */ - XSelectInput (screen_x11->xdisplay, *xwindow, StructureNotifyMask); - gdk_display_sync (display); - - error = gdk_error_trap_pop (); - if (!error) - { - screen_x11->wmspec_check_window = *xwindow; - screen_x11->need_refetch_net_supported = TRUE; - screen_x11->need_refetch_wm_name = TRUE; - - /* Careful, reentrancy */ - _gdk_x11_screen_window_manager_changed (GDK_SCREEN (screen_x11)); - } - else if (error == BadWindow) - { - /* Leftover property, try again immediately, new wm may be starting up */ - screen_x11->last_wmspec_check_time = 0; - } - - XFree (xwindow); -} - -/** - * gdk_x11_screen_get_window_manager_name: - * @screen: a #GdkScreen - * - * Returns the name of the window manager for @screen. - * - * Return value: the name of the window manager screen @screen, or - * "unknown" if the window manager is unknown. The string is owned by GDK - * and should not be freed. - * - * Since: 2.2 - **/ -const char* -gdk_x11_screen_get_window_manager_name (GdkScreen *screen) -{ - GdkScreenX11 *screen_x11; - - screen_x11 = GDK_SCREEN_X11 (screen); - - if (!G_LIKELY (GDK_DISPLAY_X11 (screen_x11->display)->trusted_client)) - return screen_x11->window_manager_name; - - fetch_net_wm_check_window (screen); - - if (screen_x11->need_refetch_wm_name) - { - /* Get the name of the window manager */ - screen_x11->need_refetch_wm_name = FALSE; - - g_free (screen_x11->window_manager_name); - screen_x11->window_manager_name = g_strdup ("unknown"); - - if (screen_x11->wmspec_check_window != None) - { - Atom type; - gint format; - gulong n_items; - gulong bytes_after; - gchar *name; - - name = NULL; - - gdk_error_trap_push (); - - XGetWindowProperty (GDK_DISPLAY_XDISPLAY (screen_x11->display), - screen_x11->wmspec_check_window, - gdk_x11_get_xatom_by_name_for_display (screen_x11->display, - "_NET_WM_NAME"), - 0, G_MAXLONG, False, - gdk_x11_get_xatom_by_name_for_display (screen_x11->display, - "UTF8_STRING"), - &type, &format, - &n_items, &bytes_after, - (guchar **)&name); - - gdk_display_sync (screen_x11->display); - - gdk_error_trap_pop (); - - if (name != NULL) - { - g_free (screen_x11->window_manager_name); - screen_x11->window_manager_name = g_strdup (name); - XFree (name); - } - } - } - - return GDK_SCREEN_X11 (screen)->window_manager_name; -} - -typedef struct _NetWmSupportedAtoms NetWmSupportedAtoms; - -struct _NetWmSupportedAtoms -{ - Atom *atoms; - gulong n_atoms; -}; - -static void -cleanup_atoms(gpointer data) -{ - NetWmSupportedAtoms *supported_atoms = data; - if (supported_atoms->atoms) - XFree (supported_atoms->atoms); - g_free (supported_atoms); -} - -/** - * gdk_x11_screen_supports_net_wm_hint: - * @screen: the relevant #GdkScreen. - * @property: a property atom. - * - * This function is specific to the X11 backend of GDK, and indicates - * whether the window manager supports a certain hint from the - * Extended Window Manager Hints Specification. You can find this - * specification on - * http://www.freedesktop.org. - * - * When using this function, keep in mind that the window manager - * can change over time; so you shouldn't use this function in - * a way that impacts persistent application state. A common bug - * is that your application can start up before the window manager - * does when the user logs in, and before the window manager starts - * gdk_x11_screen_supports_net_wm_hint() will return %FALSE for every property. - * You can monitor the window_manager_changed signal on #GdkScreen to detect - * a window manager change. - * - * Return value: %TRUE if the window manager supports @property - * - * Since: 2.2 - **/ -gboolean -gdk_x11_screen_supports_net_wm_hint (GdkScreen *screen, - GdkAtom property) -{ - gulong i; - GdkScreenX11 *screen_x11; - NetWmSupportedAtoms *supported_atoms; - GdkDisplay *display; - - g_return_val_if_fail (GDK_IS_SCREEN (screen), FALSE); - - screen_x11 = GDK_SCREEN_X11 (screen); - display = screen_x11->display; - - if (!G_LIKELY (GDK_DISPLAY_X11 (display)->trusted_client)) - return FALSE; - - supported_atoms = g_object_get_data (G_OBJECT (screen), "gdk-net-wm-supported-atoms"); - if (!supported_atoms) - { - supported_atoms = g_new0 (NetWmSupportedAtoms, 1); - g_object_set_data_full (G_OBJECT (screen), "gdk-net-wm-supported-atoms", supported_atoms, cleanup_atoms); - } - - fetch_net_wm_check_window (screen); - - if (screen_x11->wmspec_check_window == None) - return FALSE; - - if (screen_x11->need_refetch_net_supported) - { - /* WM has changed since we last got the supported list, - * refetch it. - */ - Atom type; - gint format; - gulong bytes_after; - - screen_x11->need_refetch_net_supported = FALSE; - - if (supported_atoms->atoms) - XFree (supported_atoms->atoms); - - supported_atoms->atoms = NULL; - supported_atoms->n_atoms = 0; - - XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), screen_x11->xroot_window, - gdk_x11_get_xatom_by_name_for_display (display, "_NET_SUPPORTED"), - 0, G_MAXLONG, False, XA_ATOM, &type, &format, - &supported_atoms->n_atoms, &bytes_after, - (guchar **)&supported_atoms->atoms); - - if (type != XA_ATOM) - return FALSE; - } - - if (supported_atoms->atoms == NULL) - return FALSE; - - i = 0; - while (i < supported_atoms->n_atoms) - { - if (supported_atoms->atoms[i] == gdk_x11_atom_to_xatom_for_display (display, property)) - return TRUE; - - ++i; - } - - return FALSE; -} - -/** - * gdk_net_wm_supports: - * @property: a property atom. - * - * This function is specific to the X11 backend of GDK, and indicates - * whether the window manager for the default screen supports a certain - * hint from the Extended Window Manager Hints Specification. See - * gdk_x11_screen_supports_net_wm_hint() for complete details. - * - * Return value: %TRUE if the window manager supports @property - **/ -gboolean -gdk_net_wm_supports (GdkAtom property) -{ - return gdk_x11_screen_supports_net_wm_hint (gdk_screen_get_default (), property); -} - - -static void -gdk_xsettings_notify_cb (const char *name, - XSettingsAction action, - XSettingsSetting *setting, - void *data) -{ - GdkEvent new_event; - GdkScreen *screen = data; - GdkScreenX11 *screen_x11 = data; - int i; - - if (screen_x11->xsettings_in_init) - return; - - new_event.type = GDK_SETTING; - new_event.setting.window = gdk_screen_get_root_window (screen); - new_event.setting.send_event = FALSE; - new_event.setting.name = NULL; - - for (i = 0; i < GDK_SETTINGS_N_ELEMENTS() ; i++) - if (strcmp (GDK_SETTINGS_X_NAME (i), name) == 0) - { - new_event.setting.name = (char*) GDK_SETTINGS_GDK_NAME (i); - break; - } - - if (!new_event.setting.name) - return; - - switch (action) - { - case XSETTINGS_ACTION_NEW: - new_event.setting.action = GDK_SETTING_ACTION_NEW; - break; - case XSETTINGS_ACTION_CHANGED: - new_event.setting.action = GDK_SETTING_ACTION_CHANGED; - break; - case XSETTINGS_ACTION_DELETED: - new_event.setting.action = GDK_SETTING_ACTION_DELETED; - break; - } - - gdk_event_put (&new_event); -} - -static gboolean -check_transform (const gchar *xsettings_name, - GType src_type, - GType dest_type) -{ - if (!g_value_type_transformable (src_type, dest_type)) - { - g_warning ("Cannot transform xsetting %s of type %s to type %s\n", - xsettings_name, - g_type_name (src_type), - g_type_name (dest_type)); - return FALSE; - } - else - return TRUE; -} - -/** - * gdk_screen_get_setting: - * @screen: the #GdkScreen where the setting is located - * @name: the name of the setting - * @value: location to store the value of the setting - * - * Retrieves a desktop-wide setting such as double-click time - * for the #GdkScreen @screen. - * - * FIXME needs a list of valid settings here, or a link to - * more information. - * - * Returns: %TRUE if the setting existed and a value was stored - * in @value, %FALSE otherwise. - * - * Since: 2.2 - **/ -gboolean -gdk_screen_get_setting (GdkScreen *screen, - const gchar *name, - GValue *value) -{ - - const char *xsettings_name = NULL; - XSettingsResult result; - XSettingsSetting *setting = NULL; - GdkScreenX11 *screen_x11; - gboolean success = FALSE; - gint i; - GValue tmp_val = { 0, }; - - g_return_val_if_fail (GDK_IS_SCREEN (screen), FALSE); - - screen_x11 = GDK_SCREEN_X11 (screen); - - for (i = 0; i < GDK_SETTINGS_N_ELEMENTS(); i++) - if (strcmp (GDK_SETTINGS_GDK_NAME (i), name) == 0) - { - xsettings_name = GDK_SETTINGS_X_NAME (i); - break; - } - - if (!xsettings_name) - goto out; - - result = xsettings_client_get_setting (screen_x11->xsettings_client, - xsettings_name, &setting); - if (result != XSETTINGS_SUCCESS) - goto out; - - switch (setting->type) - { - case XSETTINGS_TYPE_INT: - if (check_transform (xsettings_name, G_TYPE_INT, G_VALUE_TYPE (value))) - { - g_value_init (&tmp_val, G_TYPE_INT); - g_value_set_int (&tmp_val, setting->data.v_int); - g_value_transform (&tmp_val, value); - - success = TRUE; - } - break; - case XSETTINGS_TYPE_STRING: - if (check_transform (xsettings_name, G_TYPE_STRING, G_VALUE_TYPE (value))) - { - g_value_init (&tmp_val, G_TYPE_STRING); - g_value_set_string (&tmp_val, setting->data.v_string); - g_value_transform (&tmp_val, value); - - success = TRUE; - } - break; - case XSETTINGS_TYPE_COLOR: - if (!check_transform (xsettings_name, GDK_TYPE_COLOR, G_VALUE_TYPE (value))) - { - GdkColor color; - - g_value_init (&tmp_val, GDK_TYPE_COLOR); - - color.pixel = 0; - color.red = setting->data.v_color.red; - color.green = setting->data.v_color.green; - color.blue = setting->data.v_color.blue; - - g_value_set_boxed (&tmp_val, &color); - - g_value_transform (&tmp_val, value); - - success = TRUE; - } - break; - } - - g_value_unset (&tmp_val); - - out: - if (setting) - xsettings_setting_free (setting); - - if (success) - return TRUE; - else - return _gdk_x11_get_xft_setting (screen, name, value); -} - -static GdkFilterReturn -gdk_xsettings_client_event_filter (GdkXEvent *xevent, - GdkEvent *event, - gpointer data) -{ - GdkScreenX11 *screen = data; - - if (xsettings_client_process_event (screen->xsettings_client, (XEvent *)xevent)) - return GDK_FILTER_REMOVE; - else - return GDK_FILTER_CONTINUE; -} - -static Bool -gdk_xsettings_watch_cb (Window window, - Bool is_start, - long mask, - void *cb_data) -{ - GdkWindow *gdkwin; - GdkScreen *screen = cb_data; - - gdkwin = gdk_window_lookup_for_display (gdk_screen_get_display (screen), window); - - if (is_start) - { - if (gdkwin) - g_object_ref (gdkwin); - else - { - gdkwin = gdk_window_foreign_new_for_display (gdk_screen_get_display (screen), window); - - /* gdk_window_foreign_new_for_display() can fail and return NULL if the - * window has already been destroyed. - */ - if (!gdkwin) - return False; - } - - gdk_window_add_filter (gdkwin, gdk_xsettings_client_event_filter, screen); - } - else - { - if (!gdkwin) - { - /* gdkwin should not be NULL here, since if starting the watch succeeded - * we have a reference on the window. It might mean that the caller didn't - * remove the watch when it got a DestroyNotify event. Or maybe the - * caller ignored the return value when starting the watch failed. - */ - g_warning ("gdk_xsettings_watch_cb(): Couldn't find window to unwatch"); - return False; - } - - gdk_window_remove_filter (gdkwin, gdk_xsettings_client_event_filter, screen); - g_object_unref (gdkwin); - } - - return True; -} - -void -_gdk_windowing_event_data_copy (const GdkEvent *src, - GdkEvent *dst) -{ -} - -void -_gdk_windowing_event_data_free (GdkEvent *event) -{ -} - -#define __GDK_EVENTS_X11_C__ -#include "gdkaliasdef.c" diff --git a/gdk/x11/gdkeventsource.c b/gdk/x11/gdkeventsource.c new file mode 100644 index 0000000000..53a15578e3 --- /dev/null +++ b/gdk/x11/gdkeventsource.c @@ -0,0 +1,432 @@ +/* GDK - The GIMP Drawing Kit + * Copyright (C) 2009 Carlos Garnacho + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include "gdkeventsource.h" +#include "gdkinternals.h" +#include "gdkx.h" +#include "gdkalias.h" + +static gboolean gdk_event_source_prepare (GSource *source, + gint *timeout); +static gboolean gdk_event_source_check (GSource *source); +static gboolean gdk_event_source_dispatch (GSource *source, + GSourceFunc callback, + gpointer user_data); +static void gdk_event_source_finalize (GSource *source); + +#define HAS_FOCUS(toplevel) \ + ((toplevel)->has_focus || (toplevel)->has_pointer_focus) + +struct _GdkEventSource +{ + GSource source; + + GdkDisplay *display; + GPollFD event_poll_fd; + GList *translators; +}; + +static GSourceFuncs event_funcs = { + gdk_event_source_prepare, + gdk_event_source_check, + gdk_event_source_dispatch, + gdk_event_source_finalize +}; + +static GList *event_sources = NULL; + +static gint +gdk_event_apply_filters (XEvent *xevent, + GdkEvent *event, + GList *filters) +{ + GList *tmp_list; + GdkFilterReturn result; + + tmp_list = filters; + + while (tmp_list) + { + GdkEventFilter *filter = (GdkEventFilter*) tmp_list->data; + + tmp_list = tmp_list->next; + result = filter->function (xevent, event, filter->data); + + if (result != GDK_FILTER_CONTINUE) + return result; + } + + return GDK_FILTER_CONTINUE; +} + +static GdkWindow * +gdk_event_source_get_filter_window (GdkEventSource *event_source, + XEvent *xevent) +{ + GdkWindow *window; + + window = gdk_window_lookup_for_display (event_source->display, + xevent->xany.window); + + if (window && !GDK_IS_WINDOW (window)) + window = NULL; + + return window; +} + +static void +handle_focus_change (GdkEventCrossing *event) +{ + GdkToplevelX11 *toplevel; + gboolean focus_in, had_focus; + + toplevel = _gdk_x11_window_get_toplevel (event->window); + focus_in = (event->type == GDK_ENTER_NOTIFY); + + if (!toplevel || event->detail == GDK_NOTIFY_INFERIOR) + return; + + toplevel->has_pointer = focus_in; + + if (!event->focus || toplevel->has_focus_window) + return; + + had_focus = HAS_FOCUS (toplevel); + toplevel->has_pointer_focus = focus_in; + + if (HAS_FOCUS (toplevel) != had_focus) + { + GdkEvent *focus_event; + + focus_event = gdk_event_new (GDK_FOCUS_CHANGE); + focus_event->focus_change.window = g_object_ref (event->window); + focus_event->focus_change.send_event = FALSE; + focus_event->focus_change.in = focus_in; + gdk_event_set_device (focus_event, gdk_event_get_device ((GdkEvent *) event)); + + gdk_event_put (focus_event); + gdk_event_free (focus_event); + } +} + +static GdkEvent * +gdk_event_source_translate_event (GdkEventSource *event_source, + XEvent *xevent) +{ + GdkEvent *event = gdk_event_new (GDK_NOTHING); + GList *list = event_source->translators; + GdkFilterReturn result; + GdkWindow *filter_window; + + /* Run default filters */ + if (_gdk_default_filters) + { + /* Apply global filters */ + + result = gdk_event_apply_filters (xevent, event, + _gdk_default_filters); + + if (result == GDK_FILTER_REMOVE) + { + gdk_event_free (event); + return NULL; + } + else if (result == GDK_FILTER_TRANSLATE) + return event; + } + + filter_window = gdk_event_source_get_filter_window (event_source, xevent); + + if (filter_window) + { + /* Apply per-window filters */ + GdkWindowObject *filter_private = (GdkWindowObject *) filter_window; + GdkFilterReturn result; + + event->any.window = g_object_ref (filter_window); + + if (filter_private->filters) + { + result = gdk_event_apply_filters (xevent, event, + filter_private->filters); + + if (result == GDK_FILTER_REMOVE) + { + gdk_event_free (event); + return NULL; + } + else if (result == GDK_FILTER_TRANSLATE) + return event; + } + } + + gdk_event_free (event); + event = NULL; + + while (list && !event) + { + GdkEventTranslator *translator = list->data; + + list = list->next; + event = gdk_event_translator_translate (translator, + event_source->display, + xevent); + } + + if (event && + (event->type == GDK_ENTER_NOTIFY || + event->type == GDK_LEAVE_NOTIFY) && + event->crossing.window != NULL) + { + /* Handle focusing (in the case where no window manager is running */ + handle_focus_change (&event->crossing); + } + + return event; +} + +static gboolean +gdk_check_xpending (GdkDisplay *display) +{ + return XPending (GDK_DISPLAY_XDISPLAY (display)); +} + +static gboolean +gdk_event_source_prepare (GSource *source, + gint *timeout) +{ + GdkDisplay *display = ((GdkEventSource*) source)->display; + gboolean retval; + + GDK_THREADS_ENTER (); + + *timeout = -1; + retval = (_gdk_event_queue_find_first (display) != NULL || + gdk_check_xpending (display)); + + GDK_THREADS_LEAVE (); + + return retval; +} + +static gboolean +gdk_event_source_check (GSource *source) +{ + GdkEventSource *event_source = (GdkEventSource*) source; + gboolean retval; + + GDK_THREADS_ENTER (); + + if (event_source->event_poll_fd.revents & G_IO_IN) + retval = (_gdk_event_queue_find_first (event_source->display) != NULL || + gdk_check_xpending (event_source->display)); + else + retval = FALSE; + + GDK_THREADS_LEAVE (); + + return retval; +} + +void +_gdk_events_queue (GdkDisplay *display) +{ + GdkEvent *event; + XEvent xevent; + Display *xdisplay = GDK_DISPLAY_XDISPLAY (display); + GdkEventSource *event_source; + GdkDisplayX11 *display_x11; + + display_x11 = GDK_DISPLAY_X11 (display); + event_source = (GdkEventSource *) display_x11->event_source; + + while (!_gdk_event_queue_find_first (display) && XPending (xdisplay)) + { + XNextEvent (xdisplay, &xevent); + + switch (xevent.type) + { + case KeyPress: + case KeyRelease: + break; + default: + if (XFilterEvent (&xevent, None)) + continue; + } + + event = gdk_event_source_translate_event (event_source, &xevent); + + if (event) + { + GList *node; + + node = _gdk_event_queue_append (display, event); + _gdk_windowing_got_event (display, node, event, xevent.xany.serial); + } + } +} + +static gboolean +gdk_event_source_dispatch (GSource *source, + GSourceFunc callback, + gpointer user_data) +{ + GdkDisplay *display = ((GdkEventSource*) source)->display; + GdkEvent *event; + + GDK_THREADS_ENTER (); + + event = gdk_display_get_event (display); + + if (event) + { + if (_gdk_event_func) + (*_gdk_event_func) (event, _gdk_event_data); + + gdk_event_free (event); + } + + GDK_THREADS_LEAVE (); + + return TRUE; +} + +static void +gdk_event_source_finalize (GSource *source) +{ + event_sources = g_list_remove (event_sources, source); +} + +GSource * +gdk_event_source_new (GdkDisplay *display) +{ + GSource *source; + GdkEventSource *event_source; + GdkDisplayX11 *display_x11; + int connection_number; + char *name; + + source = g_source_new (&event_funcs, sizeof (GdkEventSource)); + name = g_strdup_printf ("GDK X11 Event source (%s)", + gdk_display_get_name (display)); + g_source_set_name (source, name); + g_free (name); + event_source = (GdkEventSource *) source; + event_source->display = display; + + display_x11 = GDK_DISPLAY_X11 (display); + connection_number = ConnectionNumber (display_x11->xdisplay); + + event_source->event_poll_fd.fd = connection_number; + event_source->event_poll_fd.events = G_IO_IN; + g_source_add_poll (source, &event_source->event_poll_fd); + + g_source_set_priority (source, GDK_PRIORITY_EVENTS); + g_source_set_can_recurse (source, TRUE); + g_source_attach (source, NULL); + + event_sources = g_list_prepend (event_sources, source); + + return source; +} + +void +gdk_event_source_add_translator (GdkEventSource *source, + GdkEventTranslator *translator) +{ + g_return_if_fail (GDK_IS_EVENT_TRANSLATOR (translator)); + + source->translators = g_list_append (source->translators, translator); +} + +void +gdk_event_source_select_events (GdkEventSource *source, + Window window, + GdkEventMask event_mask, + unsigned int extra_x_mask) +{ + unsigned int xmask = extra_x_mask; + GList *list; + gint i; + + list = source->translators; + + while (list) + { + GdkEventTranslator *translator = list->data; + GdkEventMask translator_mask, mask; + + translator_mask = gdk_event_translator_get_handled_events (translator); + mask = event_mask & translator_mask; + + if (mask != 0) + { + gdk_event_translator_select_window_events (translator, window, mask); + event_mask &= ~mask; + } + + list = list->next; + } + + for (i = 0; i < _gdk_nenvent_masks; i++) + { + if (event_mask & (1 << (i + 1))) + xmask |= _gdk_event_mask_table[i]; + } + + XSelectInput (GDK_DISPLAY_XDISPLAY (source->display), window, xmask); +} + +/** + * gdk_events_pending: + * + * Checks if any events are ready to be processed for any display. + * + * Return value: %TRUE if any events are pending. + **/ +gboolean +gdk_events_pending (void) +{ + GList *tmp_list; + + for (tmp_list = event_sources; tmp_list; tmp_list = tmp_list->next) + { + GdkEventSource *tmp_source = tmp_list->data; + GdkDisplay *display = tmp_source->display; + + if (_gdk_event_queue_find_first (display)) + return TRUE; + } + + for (tmp_list = event_sources; tmp_list; tmp_list = tmp_list->next) + { + GdkEventSource *tmp_source = tmp_list->data; + GdkDisplay *display = tmp_source->display; + + if (gdk_check_xpending (display)) + return TRUE; + } + + return FALSE; +} + +#define __GDK_EVENT_SOURCE_C__ +#include "gdkaliasdef.c" diff --git a/gdk/x11/gdkeventsource.h b/gdk/x11/gdkeventsource.h new file mode 100644 index 0000000000..4fc0dbe7b4 --- /dev/null +++ b/gdk/x11/gdkeventsource.h @@ -0,0 +1,46 @@ +/* GDK - The GIMP Drawing Kit + * Copyright (C) 2009 Carlos Garnacho + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GDK_EVENT_SOURCE_H__ +#define __GDK_EVENT_SOURCE_H__ + +#include "gdkeventtranslator.h" +#include "gdkprivate-x11.h" + +G_BEGIN_DECLS + +typedef struct _GdkEventSource GdkEventSource; + +G_GNUC_INTERNAL +GSource * gdk_event_source_new (GdkDisplay *display); + +G_GNUC_INTERNAL +void gdk_event_source_add_translator (GdkEventSource *source, + GdkEventTranslator *translator); + +G_GNUC_INTERNAL +void gdk_event_source_select_events (GdkEventSource *source, + Window window, + GdkEventMask event_mask, + unsigned int extra_x_mask); + + +G_END_DECLS + +#endif /* __GDK_EVENT_SOURCE_H__ */ diff --git a/gdk/x11/gdkeventtranslator.c b/gdk/x11/gdkeventtranslator.c new file mode 100644 index 0000000000..753dfc890a --- /dev/null +++ b/gdk/x11/gdkeventtranslator.c @@ -0,0 +1,100 @@ +/* GDK - The GIMP Drawing Kit + * Copyright (C) 2009 Carlos Garnacho + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include "gdkeventtranslator.h" +#include "gdkalias.h" + +GType +gdk_event_translator_get_type (void) +{ + static GType translator_type = 0; + + if (G_UNLIKELY (!translator_type)) + { + translator_type = g_type_register_static_simple (G_TYPE_INTERFACE, + g_intern_static_string ("GdkEventTranslator"), + sizeof (GdkEventTranslatorIface), + NULL, 0, NULL, 0); + + g_type_interface_add_prerequisite (translator_type, G_TYPE_OBJECT); + } + + return translator_type; +} + +GdkEvent * +gdk_event_translator_translate (GdkEventTranslator *translator, + GdkDisplay *display, + XEvent *xevent) +{ + GdkEventTranslatorIface *iface; + GdkEvent *event; + + g_return_val_if_fail (GDK_IS_EVENT_TRANSLATOR (translator), NULL); + g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL); + + iface = GDK_EVENT_TRANSLATOR_GET_IFACE (translator); + + if (!iface->translate_event) + return NULL; + + event = gdk_event_new (GDK_NOTHING); + + if ((iface->translate_event) (translator, display, event, xevent)) + return event; + + gdk_event_free (event); + + return NULL; +} + +GdkEventMask +gdk_event_translator_get_handled_events (GdkEventTranslator *translator) +{ + GdkEventTranslatorIface *iface; + + g_return_val_if_fail (GDK_IS_EVENT_TRANSLATOR (translator), 0); + + iface = GDK_EVENT_TRANSLATOR_GET_IFACE (translator); + + if (iface->get_handled_events) + return iface->get_handled_events (translator); + + return 0; +} + +void +gdk_event_translator_select_window_events (GdkEventTranslator *translator, + Window window, + GdkEventMask event_mask) +{ + GdkEventTranslatorIface *iface; + + g_return_if_fail (GDK_IS_EVENT_TRANSLATOR (translator)); + + iface = GDK_EVENT_TRANSLATOR_GET_IFACE (translator); + + if (iface->select_window_events) + iface->select_window_events (translator, window, event_mask); +} + +#define __GDK_EVENT_TRANSLATOR_C__ +#include "gdkaliasdef.c" diff --git a/gdk/x11/gdkeventtranslator.h b/gdk/x11/gdkeventtranslator.h new file mode 100644 index 0000000000..62c99e3f5d --- /dev/null +++ b/gdk/x11/gdkeventtranslator.h @@ -0,0 +1,65 @@ +/* GDK - The GIMP Drawing Kit + * Copyright (C) 2009 Carlos Garnacho + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GDK_EVENT_TRANSLATOR_H__ +#define __GDK_EVENT_TRANSLATOR_H__ + +#include +#include +#include "gdkprivate-x11.h" + +G_BEGIN_DECLS + +#define GDK_TYPE_EVENT_TRANSLATOR (gdk_event_translator_get_type ()) +#define GDK_EVENT_TRANSLATOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_EVENT_TRANSLATOR, GdkEventTranslator)) +#define GDK_IS_EVENT_TRANSLATOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_EVENT_TRANSLATOR)) +#define GDK_EVENT_TRANSLATOR_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), GDK_TYPE_EVENT_TRANSLATOR, GdkEventTranslatorIface)) + +typedef struct _GdkEventTranslatorIface GdkEventTranslatorIface; +typedef struct _GdkEventTranslator GdkEventTranslator; /* Dummy typedef */ + +struct _GdkEventTranslatorIface +{ + GTypeInterface iface; + + /* VMethods */ + gboolean (* translate_event) (GdkEventTranslator *translator, + GdkDisplay *display, + GdkEvent *event, + XEvent *xevent); + + GdkEventMask (* get_handled_events) (GdkEventTranslator *translator); + void (* select_window_events) (GdkEventTranslator *translator, + Window window, + GdkEventMask event_mask); +}; + +GType gdk_event_translator_get_type (void) G_GNUC_CONST; + +GdkEvent * gdk_event_translator_translate (GdkEventTranslator *translator, + GdkDisplay *display, + XEvent *xevent); +GdkEventMask gdk_event_translator_get_handled_events (GdkEventTranslator *translator); +void gdk_event_translator_select_window_events (GdkEventTranslator *translator, + Window window, + GdkEventMask event_mask); + +G_END_DECLS + +#endif /* __GDK_EVENT_TRANSLATOR_H__ */ diff --git a/gdk/x11/gdkimage-x11.c b/gdk/x11/gdkimage-x11.c index 6bc1a79efd..1c217a0d2e 100644 --- a/gdk/x11/gdkimage-x11.c +++ b/gdk/x11/gdkimage-x11.c @@ -116,62 +116,6 @@ _gdk_image_exit (void) } } -/** - * gdk_image_new_bitmap: - * @visual: the #GdkVisual to use for the image. - * @data: the pixel data. - * @width: the width of the image in pixels. - * @height: the height of the image in pixels. - * - * Creates a new #GdkImage with a depth of 1 from the given data. - * THIS FUNCTION IS INCREDIBLY BROKEN. The passed-in data must - * be allocated by malloc() (NOT g_malloc()) and will be freed when the - * image is freed. - * - * Return value: a new #GdkImage. - **/ -GdkImage * -gdk_image_new_bitmap (GdkVisual *visual, - gpointer data, - gint width, - gint height) -{ - Visual *xvisual; - GdkImage *image; - GdkDisplay *display; - GdkImagePrivateX11 *private; - - image = g_object_new (gdk_image_get_type (), NULL); - private = PRIVATE_DATA (image); - private->screen = gdk_visual_get_screen (visual); - display = GDK_SCREEN_DISPLAY (private->screen); - - image->type = GDK_IMAGE_NORMAL; - image->visual = visual; - image->width = width; - image->height = height; - image->depth = 1; - image->bits_per_pixel = 1; - if (display->closed) - private->ximage = NULL; - else - { - xvisual = ((GdkVisualPrivate*) visual)->xvisual; - private->ximage = XCreateImage (GDK_SCREEN_XDISPLAY (private->screen), - xvisual, 1, XYBitmap, - 0, NULL, width, height, 8, 0); - private->ximage->data = data; - private->ximage->bitmap_bit_order = MSBFirst; - private->ximage->byte_order = MSBFirst; - } - - image->byte_order = MSBFirst; - image->mem = private->ximage->data; - image->bpl = private->ximage->bytes_per_line; - image->bpp = 1; - return image; -} - void _gdk_windowing_image_init (GdkDisplay *display) { diff --git a/gdk/x11/gdkinput-none.c b/gdk/x11/gdkinput-none.c deleted file mode 100644 index 4d21beff34..0000000000 --- a/gdk/x11/gdkinput-none.c +++ /dev/null @@ -1,126 +0,0 @@ -/* GDK - The GIMP Drawing Kit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include "config.h" -#include "gdkinputprivate.h" -#include "gdkdisplay-x11.h" -#include "gdkalias.h" - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -void -_gdk_input_init (GdkDisplay *display) -{ - GdkDisplayX11 *display_x11 = GDK_DISPLAY_X11 (display); - - _gdk_init_input_core (display); - - display_x11->input_devices = g_list_append (NULL, display->core_pointer); - display->ignore_core_events = FALSE; -} - -void -gdk_device_get_state (GdkDevice *device, - GdkWindow *window, - gdouble *axes, - GdkModifierType *mask) -{ - gint x_int, y_int; - - g_return_if_fail (device != NULL); - g_return_if_fail (GDK_IS_WINDOW (window)); - - gdk_window_get_pointer (window, &x_int, &y_int, mask); - - if (axes) - { - axes[0] = x_int; - axes[1] = y_int; - } -} - -gboolean -_gdk_device_get_history (GdkDevice *device, - GdkWindow *window, - guint32 start, - guint32 stop, - GdkTimeCoord ***events, - gint *n_events) -{ - g_warning ("gdk_device_get_history() called for invalid device"); - return FALSE; -} - -void -_gdk_input_select_events (GdkWindow *impl_window, - GdkDevicePrivate *gdkdev) -{ -} - -gboolean -_gdk_input_other_event (GdkEvent *event, - XEvent *xevent, - GdkWindow *window) -{ - return FALSE; -} - -void -_gdk_input_configure_event (XConfigureEvent *xevent, - GdkWindow *window) -{ -} - -void -_gdk_input_crossing_event (GdkWindow *window, - gboolean enter) -{ -} - -gint -_gdk_input_grab_pointer (GdkWindow * window, - GdkWindow *native_window, - gint owner_events, - GdkEventMask event_mask, - GdkWindow * confine_to, - guint32 time) -{ - return Success; -} - -void -_gdk_input_ungrab_pointer (GdkDisplay *display, - guint32 time) -{ -} - -gboolean -gdk_device_set_mode (GdkDevice *device, - GdkInputMode mode) -{ - return FALSE; -} - -#define __GDK_INPUT_NONE_C__ -#include "gdkaliasdef.c" diff --git a/gdk/x11/gdkinput-x11.c b/gdk/x11/gdkinput-x11.c deleted file mode 100644 index 767b0702c4..0000000000 --- a/gdk/x11/gdkinput-x11.c +++ /dev/null @@ -1,937 +0,0 @@ -/* GDK - The GIMP Drawing Kit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#include "config.h" -#include "gdkinputprivate.h" -#include "gdkinternals.h" -#include "gdkx.h" -#include "gdk.h" /* For gdk_error_trap_push()/pop() */ -#include "gdkdisplay-x11.h" -#include "gdkalias.h" - -#include - -/* Forward declarations */ -static GdkDevicePrivate *gdk_input_device_new (GdkDisplay *display, - XDeviceInfo *device, - gint include_core); -static void gdk_input_translate_coordinates (GdkDevicePrivate *gdkdev, - GdkWindow *window, - gint *axis_data, - gdouble *axis_out, - gdouble *x_out, - gdouble *y_out); -static void gdk_input_update_axes (GdkDevicePrivate *gdkdev, - gint axes_count, - gint first_axis, - gint *axis_data); -static guint gdk_input_translate_state (guint state, - guint device_state); - -GdkDevicePrivate * -_gdk_input_find_device (GdkDisplay *display, - guint32 id) -{ - GList *tmp_list = GDK_DISPLAY_X11 (display)->input_devices; - GdkDevicePrivate *gdkdev; - while (tmp_list) - { - gdkdev = (GdkDevicePrivate *)(tmp_list->data); - if (gdkdev->deviceid == id) - return gdkdev; - tmp_list = tmp_list->next; - } - return NULL; -} - -void -_gdk_input_get_root_relative_geometry (GdkWindow *window, - int *x_ret, int *y_ret) -{ - Window child; - gint x,y; - - XTranslateCoordinates (GDK_WINDOW_XDISPLAY (window), - GDK_WINDOW_XWINDOW (window), - GDK_WINDOW_XROOTWIN (window), - 0, 0, &x, &y, &child); - - if (x_ret) - *x_ret = x; - if (y_ret) - *y_ret = y; -} - -static GdkDevicePrivate * -gdk_input_device_new (GdkDisplay *display, - XDeviceInfo *device, - gint include_core) -{ - GdkDevicePrivate *gdkdev; - gchar *tmp_name; - XAnyClassPtr class; - gint i,j; - - gdkdev = g_object_new (GDK_TYPE_DEVICE, NULL); - - gdkdev->deviceid = device->id; - gdkdev->display = display; - - if (device->name[0]) - gdkdev->info.name = g_strdup (device->name); - else - /* XFree86 3.2 gives an empty name to the default core devices, - (fixed in 3.2A) */ - gdkdev->info.name = g_strdup ("pointer"); - - gdkdev->info.mode = GDK_MODE_DISABLED; - - /* Try to figure out what kind of device this is by its name - - could invite a very, very, long list... Lowercase name - for comparison purposes */ - - tmp_name = g_ascii_strdown (gdkdev->info.name, -1); - - if (strstr (tmp_name, "eraser")) - gdkdev->info.source = GDK_SOURCE_ERASER; - else if (strstr (tmp_name, "cursor")) - gdkdev->info.source = GDK_SOURCE_CURSOR; - else if (strstr (tmp_name, "wacom") || - strstr (tmp_name, "pen")) - gdkdev->info.source = GDK_SOURCE_PEN; - else - gdkdev->info.source = GDK_SOURCE_MOUSE; - - g_free(tmp_name); - - gdkdev->xdevice = NULL; - - /* step through the classes */ - - gdkdev->info.num_axes = 0; - gdkdev->info.num_keys = 0; - gdkdev->info.axes = NULL; - gdkdev->info.keys = NULL; - gdkdev->axes = 0; - gdkdev->info.has_cursor = 0; - gdkdev->needs_update = FALSE; - gdkdev->claimed = FALSE; - memset(gdkdev->button_state, 0, sizeof (gdkdev->button_state)); - gdkdev->button_count = 0; - - class = device->inputclassinfo; - for (i=0;inum_classes;i++) - { - switch (class->class) { - case ButtonClass: - break; - case KeyClass: - { - XKeyInfo *xki = (XKeyInfo *)class; - /* Hack to catch XFree86 3.3.1 bug. Other devices better - * not have exactly 25 keys... - */ - if ((xki->min_keycode == 8) && (xki->max_keycode == 32)) - { - gdkdev->info.num_keys = 32; - gdkdev->min_keycode = 1; - } - else - { - gdkdev->info.num_keys = xki->max_keycode - xki->min_keycode + 1; - gdkdev->min_keycode = xki->min_keycode; - } - gdkdev->info.keys = g_new (GdkDeviceKey, gdkdev->info.num_keys); - - for (j=0; jinfo.num_keys; j++) - { - gdkdev->info.keys[j].keyval = 0; - gdkdev->info.keys[j].modifiers = 0; - } - - break; - } - case ValuatorClass: - { - XValuatorInfo *xvi = (XValuatorInfo *)class; - gdkdev->info.num_axes = xvi->num_axes; - gdkdev->axes = g_new (GdkAxisInfo, xvi->num_axes); - gdkdev->axis_data = g_new0 (gint, xvi->num_axes); - gdkdev->info.axes = g_new0 (GdkDeviceAxis, xvi->num_axes); - for (j=0;jnum_axes;j++) - { - gdkdev->axes[j].resolution = - gdkdev->axes[j].xresolution = xvi->axes[j].resolution; - gdkdev->axes[j].min_value = - gdkdev->axes[j].xmin_value = xvi->axes[j].min_value; - gdkdev->axes[j].max_value = - gdkdev->axes[j].xmax_value = xvi->axes[j].max_value; - gdkdev->info.axes[j].use = GDK_AXIS_IGNORE; - } - j=0; - if (jnum_axes) - gdk_device_set_axis_use (&gdkdev->info, j++, GDK_AXIS_X); - if (jnum_axes) - gdk_device_set_axis_use (&gdkdev->info, j++, GDK_AXIS_Y); - if (jnum_axes) - gdk_device_set_axis_use (&gdkdev->info, j++, GDK_AXIS_PRESSURE); - if (jnum_axes) - gdk_device_set_axis_use (&gdkdev->info, j++, GDK_AXIS_XTILT); - if (jnum_axes) - gdk_device_set_axis_use (&gdkdev->info, j++, GDK_AXIS_YTILT); - if (jnum_axes) - gdk_device_set_axis_use (&gdkdev->info, j++, GDK_AXIS_WHEEL); - - break; - } - } - class = (XAnyClassPtr)(((char *)class) + class->length); - } - /* return NULL if no axes */ - if (!gdkdev->info.num_axes || !gdkdev->axes || - (!include_core && device->use == IsXPointer)) - goto error; - - if (device->use != IsXPointer) - { - gdk_error_trap_push (); - gdkdev->xdevice = XOpenDevice (GDK_DISPLAY_XDISPLAY (display), - gdkdev->deviceid); - - /* return NULL if device is not ready */ - if (gdk_error_trap_pop ()) - goto error; - } - - gdkdev->buttonpress_type = 0; - gdkdev->buttonrelease_type = 0; - gdkdev->keypress_type = 0; - gdkdev->keyrelease_type = 0; - gdkdev->motionnotify_type = 0; - gdkdev->proximityin_type = 0; - gdkdev->proximityout_type = 0; - gdkdev->changenotify_type = 0; - - return gdkdev; - - error: - - g_object_unref (gdkdev); - - return NULL; -} - -void -_gdk_input_common_find_events (GdkDevicePrivate *gdkdev, - gint mask, - XEventClass *classes, - int *num_classes) -{ - gint i; - XEventClass class; - - i = 0; - if (mask & GDK_BUTTON_PRESS_MASK) - { - DeviceButtonPress (gdkdev->xdevice, gdkdev->buttonpress_type, - class); - if (class != 0) - classes[i++] = class; - DeviceButtonPressGrab (gdkdev->xdevice, 0, class); - if (class != 0) - classes[i++] = class; - } - if (mask & GDK_BUTTON_RELEASE_MASK) - { - DeviceButtonRelease (gdkdev->xdevice, gdkdev->buttonrelease_type, - class); - if (class != 0) - classes[i++] = class; - } - if (mask & (GDK_POINTER_MOTION_MASK | - GDK_BUTTON1_MOTION_MASK | GDK_BUTTON2_MOTION_MASK | - GDK_BUTTON3_MOTION_MASK | GDK_BUTTON_MOTION_MASK)) - { - DeviceMotionNotify (gdkdev->xdevice, gdkdev->motionnotify_type, class); - if (class != 0) - classes[i++] = class; - DeviceStateNotify (gdkdev->xdevice, gdkdev->devicestatenotify_type, class); - if (class != 0) - classes[i++] = class; - } - if (mask & GDK_KEY_PRESS_MASK) - { - DeviceKeyPress (gdkdev->xdevice, gdkdev->keypress_type, class); - if (class != 0) - classes[i++] = class; - } - if (mask & GDK_KEY_RELEASE_MASK) - { - DeviceKeyRelease (gdkdev->xdevice, gdkdev->keyrelease_type, class); - if (class != 0) - classes[i++] = class; - } - if (mask & GDK_PROXIMITY_IN_MASK) - { - ProximityIn (gdkdev->xdevice, gdkdev->proximityin_type, class); - if (class != 0) - classes[i++] = class; - } - if (mask & GDK_PROXIMITY_OUT_MASK) - { - ProximityOut (gdkdev->xdevice, gdkdev->proximityout_type, class); - if (class != 0) - classes[i++] = class; - } - - *num_classes = i; -} - -void -_gdk_input_select_events (GdkWindow *impl_window, - GdkDevicePrivate *gdkdev) -{ - XEventClass classes[GDK_MAX_DEVICE_CLASSES]; - gint num_classes; - guint event_mask; - GdkWindowObject *w; - GdkInputWindow *iw; - GList *l; - - event_mask = 0; - iw = ((GdkWindowObject *)impl_window)->input_window; - - if (gdkdev->info.mode != GDK_MODE_DISABLED && - iw != NULL) - { - for (l = iw->windows; l != NULL; l = l->next) - { - w = l->data; - if (gdkdev->info.has_cursor || (w->extension_events & GDK_ALL_DEVICES_MASK)) - event_mask |= w->extension_events; - } - } - event_mask &= ~GDK_ALL_DEVICES_MASK; - - if (event_mask) - event_mask |= GDK_PROXIMITY_OUT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK; - - _gdk_input_common_find_events (gdkdev, event_mask, - classes, &num_classes); - XSelectExtensionEvent (GDK_WINDOW_XDISPLAY (impl_window), - GDK_WINDOW_XWINDOW (impl_window), - classes, num_classes); -} - -gint -_gdk_input_common_init (GdkDisplay *display, - gint include_core) -{ - XDeviceInfo *devices; - int num_devices, loop; - int ignore, event_base; - GdkDisplayX11 *display_x11 = GDK_DISPLAY_X11 (display); - - /* Init XInput extension */ - - display_x11->input_devices = NULL; - if (XQueryExtension (display_x11->xdisplay, "XInputExtension", - &ignore, &event_base, &ignore)) - { - gdk_x11_register_standard_event_type (display, - event_base, 15 /* Number of events */); - - devices = XListInputDevices(display_x11->xdisplay, &num_devices); - - for(loop=0; loopinput_devices = g_list_append(display_x11->input_devices, gdkdev); - } - XFreeDeviceList(devices); - } - - display_x11->input_devices = g_list_append (display_x11->input_devices, display->core_pointer); - - return TRUE; -} - -static void -gdk_input_update_axes (GdkDevicePrivate *gdkdev, - gint axes_count, - gint first_axis, - gint *axis_data) -{ - int i; - g_return_if_fail (first_axis >= 0 && first_axis + axes_count <= gdkdev->info.num_axes); - - for (i = 0; i < axes_count; i++) - gdkdev->axis_data[first_axis + i] = axis_data[i]; -} - -static void -gdk_input_translate_coordinates (GdkDevicePrivate *gdkdev, - GdkWindow *window, - gint *axis_data, - gdouble *axis_out, - gdouble *x_out, - gdouble *y_out) -{ - GdkWindowObject *priv, *impl_window; - - int i; - int x_axis = 0; - int y_axis = 0; - - double device_width, device_height, x_min, y_min; - double x_offset, y_offset, x_scale, y_scale; - - priv = (GdkWindowObject *) window; - impl_window = (GdkWindowObject *)_gdk_window_get_impl_window (window); - - for (i=0; iinfo.num_axes; i++) - { - switch (gdkdev->info.axes[i].use) - { - case GDK_AXIS_X: - x_axis = i; - break; - case GDK_AXIS_Y: - y_axis = i; - break; - default: - break; - } - } - - device_width = gdkdev->axes[x_axis].max_value - gdkdev->axes[x_axis].min_value; - if (device_width > 0) - { - x_min = gdkdev->axes[x_axis].min_value; - } - else - { - device_width = gdk_screen_get_width (gdk_drawable_get_screen (window)); - x_min = 0; - } - - device_height = gdkdev->axes[y_axis].max_value - gdkdev->axes[y_axis].min_value; - if (device_height > 0) - { - y_min = gdkdev->axes[y_axis].min_value; - } - else - { - device_height = gdk_screen_get_height (gdk_drawable_get_screen (window)); - y_min = 0; - } - - if (gdkdev->info.mode == GDK_MODE_SCREEN) - { - x_scale = gdk_screen_get_width (gdk_drawable_get_screen (window)) / device_width; - y_scale = gdk_screen_get_height (gdk_drawable_get_screen (window)) / device_height; - - x_offset = - impl_window->input_window->root_x - priv->abs_x; - y_offset = - impl_window->input_window->root_y - priv->abs_y; - } - else /* GDK_MODE_WINDOW */ - { - double x_resolution = gdkdev->axes[x_axis].resolution; - double y_resolution = gdkdev->axes[y_axis].resolution; - double device_aspect; - /* - * Some drivers incorrectly report the resolution of the device - * as zero (in partiular linuxwacom < 0.5.3 with usb tablets). - * This causes the device_aspect to become NaN and totally - * breaks windowed mode. If this is the case, the best we can - * do is to assume the resolution is non-zero is equal in both - * directions (which is true for many devices). The absolute - * value of the resolution doesn't matter since we only use the - * ratio. - */ - if ((x_resolution == 0) || (y_resolution == 0)) - { - x_resolution = 1; - y_resolution = 1; - } - device_aspect = (device_height*y_resolution) / - (device_width*x_resolution); - if (device_aspect * priv->width >= priv->height) - { - /* device taller than window */ - x_scale = priv->width / device_width; - y_scale = (x_scale * x_resolution) / y_resolution; - - x_offset = 0; - y_offset = -(device_height * y_scale - priv->height)/2; - } - else - { - /* window taller than device */ - y_scale = priv->height / device_height; - x_scale = (y_scale * y_resolution) / x_resolution; - - y_offset = 0; - x_offset = - (device_width * x_scale - priv->width)/2; - } - } - - for (i=0; iinfo.num_axes; i++) - { - switch (gdkdev->info.axes[i].use) - { - case GDK_AXIS_X: - axis_out[i] = x_offset + x_scale * (axis_data[x_axis] - x_min); - if (x_out) - *x_out = axis_out[i]; - break; - case GDK_AXIS_Y: - axis_out[i] = y_offset + y_scale * (axis_data[y_axis] - y_min); - if (y_out) - *y_out = axis_out[i]; - break; - default: - axis_out[i] = - (gdkdev->info.axes[i].max * (axis_data[i] - gdkdev->axes[i].min_value) + - gdkdev->info.axes[i].min * (gdkdev->axes[i].max_value - axis_data[i])) / - (gdkdev->axes[i].max_value - gdkdev->axes[i].min_value); - break; - } - } -} - -/* combine the state of the core device and the device state - * into one - for now we do this in a simple-minded manner - - * we just take the keyboard portion of the core device and - * the button portion (all of?) the device state. - * Any button remapping should go on here. - */ -static guint -gdk_input_translate_state(guint state, guint device_state) -{ - return device_state | (state & 0xFF); -} - - -gboolean -_gdk_input_common_other_event (GdkEvent *event, - XEvent *xevent, - GdkWindow *window, - GdkDevicePrivate *gdkdev) -{ - GdkWindowObject *priv, *impl_window; - GdkInputWindow *input_window; - - priv = (GdkWindowObject *) window; - impl_window = (GdkWindowObject *)_gdk_window_get_impl_window (window); - input_window = impl_window->input_window; - - if ((xevent->type == gdkdev->buttonpress_type) || - (xevent->type == gdkdev->buttonrelease_type)) - { - XDeviceButtonEvent *xdbe = (XDeviceButtonEvent *)(xevent); - - g_return_val_if_fail (xdbe->button < 256, FALSE); - if (xdbe->type == gdkdev->buttonpress_type) - { - event->button.type = GDK_BUTTON_PRESS; - if (!(gdkdev->button_state[xdbe->button/8] & 1 << (xdbe->button%8))) - { - gdkdev->button_state[xdbe->button/8] |= 1 << (xdbe->button%8); - gdkdev->button_count++; - } - } - else - { - event->button.type = GDK_BUTTON_RELEASE; - if (gdkdev->button_state[xdbe->button/8] & 1 << (xdbe->button%8)) - { - gdkdev->button_state[xdbe->button/8] &= ~(1 << (xdbe->button%8)); - gdkdev->button_count--; - } - } - event->button.device = &gdkdev->info; - event->button.window = window; - event->button.time = xdbe->time; - - event->button.axes = g_new (gdouble, gdkdev->info.num_axes); - gdk_input_update_axes (gdkdev, xdbe->axes_count, xdbe->first_axis, - xdbe->axis_data); - gdk_input_translate_coordinates (gdkdev, window, gdkdev->axis_data, - event->button.axes, - &event->button.x, &event->button.y); - event->button.x_root = event->button.x + priv->abs_x + input_window->root_x; - event->button.y_root = event->button.y + priv->abs_y + input_window->root_y; - event->button.state = gdk_input_translate_state (xdbe->state,xdbe->device_state); - event->button.button = xdbe->button; - - if (event->button.type == GDK_BUTTON_PRESS) - _gdk_event_button_generate (gdk_drawable_get_display (event->button.window), - event); - - GDK_NOTE (EVENTS, - g_print ("button %s:\t\twindow: %ld device: %ld x,y: %f %f button: %d\n", - (event->button.type == GDK_BUTTON_PRESS) ? "press" : "release", - xdbe->window, - xdbe->deviceid, - event->button.x, event->button.y, - xdbe->button)); - - /* Update the timestamp of the latest user interaction, if the event has - * a valid timestamp. - */ - if (gdk_event_get_time (event) != GDK_CURRENT_TIME) - gdk_x11_window_set_user_time (gdk_window_get_toplevel (window), - gdk_event_get_time (event)); - return TRUE; - } - - if ((xevent->type == gdkdev->keypress_type) || - (xevent->type == gdkdev->keyrelease_type)) - { - XDeviceKeyEvent *xdke = (XDeviceKeyEvent *)(xevent); - - GDK_NOTE (EVENTS, - g_print ("device key %s:\twindow: %ld device: %ld keycode: %d\n", - (event->key.type == GDK_KEY_PRESS) ? "press" : "release", - xdke->window, - xdke->deviceid, - xdke->keycode)); - - if (xdke->keycode < gdkdev->min_keycode || - xdke->keycode >= gdkdev->min_keycode + gdkdev->info.num_keys) - { - g_warning ("Invalid device key code received"); - return FALSE; - } - - event->key.keyval = gdkdev->info.keys[xdke->keycode - gdkdev->min_keycode].keyval; - - if (event->key.keyval == 0) - { - GDK_NOTE (EVENTS, - g_print ("\t\ttranslation - NONE\n")); - - return FALSE; - } - - event->key.type = (xdke->type == gdkdev->keypress_type) ? - GDK_KEY_PRESS : GDK_KEY_RELEASE; - - event->key.window = window; - event->key.time = xdke->time; - - event->key.state = gdk_input_translate_state(xdke->state, xdke->device_state) - | gdkdev->info.keys[xdke->keycode - gdkdev->min_keycode].modifiers; - - /* Add a string translation for the key event */ - if ((event->key.keyval >= 0x20) && (event->key.keyval <= 0xFF)) - { - event->key.length = 1; - event->key.string = g_new (gchar, 2); - event->key.string[0] = (gchar)event->key.keyval; - event->key.string[1] = 0; - } - else - { - event->key.length = 0; - event->key.string = g_new0 (gchar, 1); - } - - GDK_NOTE (EVENTS, - g_print ("\t\ttranslation - keyval: %d modifiers: %#x\n", - event->key.keyval, - event->key.state)); - - /* Update the timestamp of the latest user interaction, if the event has - * a valid timestamp. - */ - if (gdk_event_get_time (event) != GDK_CURRENT_TIME) - gdk_x11_window_set_user_time (gdk_window_get_toplevel (window), - gdk_event_get_time (event)); - return TRUE; - } - - if (xevent->type == gdkdev->motionnotify_type) - { - XDeviceMotionEvent *xdme = (XDeviceMotionEvent *)(xevent); - - event->motion.device = &gdkdev->info; - - event->motion.axes = g_new (gdouble, gdkdev->info.num_axes); - gdk_input_update_axes (gdkdev, xdme->axes_count, xdme->first_axis, xdme->axis_data); - gdk_input_translate_coordinates(gdkdev, window, gdkdev->axis_data, - event->motion.axes, - &event->motion.x,&event->motion.y); - event->motion.x_root = event->motion.x + priv->abs_x + input_window->root_x; - event->motion.y_root = event->motion.y + priv->abs_y + input_window->root_y; - - event->motion.type = GDK_MOTION_NOTIFY; - event->motion.window = window; - event->motion.time = xdme->time; - event->motion.state = gdk_input_translate_state(xdme->state, - xdme->device_state); - event->motion.is_hint = xdme->is_hint; - - GDK_NOTE (EVENTS, - g_print ("motion notify:\t\twindow: %ld device: %ld x,y: %f %f state %#4x hint: %s\n", - xdme->window, - xdme->deviceid, - event->motion.x, event->motion.y, - event->motion.state, - (xdme->is_hint) ? "true" : "false")); - - - /* Update the timestamp of the latest user interaction, if the event has - * a valid timestamp. - */ - if (gdk_event_get_time (event) != GDK_CURRENT_TIME) - gdk_x11_window_set_user_time (gdk_window_get_toplevel (window), - gdk_event_get_time (event)); - return TRUE; - } - - if (xevent->type == gdkdev->devicestatenotify_type) - { - int i; - XDeviceStateNotifyEvent *xdse = (XDeviceStateNotifyEvent *)(xevent); - XInputClass *input_class = (XInputClass *)xdse->data; - for (i=0; inum_classes; i++) - { - if (input_class->class == ValuatorClass) - gdk_input_update_axes (gdkdev, gdkdev->info.num_axes, 0, - ((XValuatorState *)input_class)->valuators); - input_class = (XInputClass *)(((char *)input_class)+input_class->length); - } - - GDK_NOTE (EVENTS, - g_print ("device state notify:\t\twindow: %ld device: %ld\n", - xdse->window, - xdse->deviceid)); - - return FALSE; - } - if (xevent->type == gdkdev->proximityin_type || - xevent->type == gdkdev->proximityout_type) - { - XProximityNotifyEvent *xpne = (XProximityNotifyEvent *)(xevent); - - event->proximity.device = &gdkdev->info; - event->proximity.type = (xevent->type == gdkdev->proximityin_type)? - GDK_PROXIMITY_IN:GDK_PROXIMITY_OUT; - event->proximity.window = window; - event->proximity.time = xpne->time; - - /* Update the timestamp of the latest user interaction, if the event has - * a valid timestamp. - */ - if (gdk_event_get_time (event) != GDK_CURRENT_TIME) - gdk_x11_window_set_user_time (gdk_window_get_toplevel (window), - gdk_event_get_time (event)); - return TRUE; - } - - return FALSE; /* wasn't one of our event types */ -} - -gboolean -_gdk_input_common_event_selected (GdkEvent *event, - GdkWindow *window, - GdkDevicePrivate *gdkdev) -{ - GdkWindowObject *priv = (GdkWindowObject *) window; - - switch (event->type) { - case GDK_BUTTON_PRESS: - return priv->extension_events & GDK_BUTTON_PRESS_MASK; - - case GDK_BUTTON_RELEASE: - return priv->extension_events & GDK_BUTTON_RELEASE_MASK; - - case GDK_KEY_PRESS: - return priv->extension_events & GDK_KEY_PRESS_MASK; - - case GDK_KEY_RELEASE: - return priv->extension_events & GDK_KEY_RELEASE_MASK; - - case GDK_MOTION_NOTIFY: - if (priv->extension_events & GDK_POINTER_MOTION_MASK) - return TRUE; - if (gdkdev->button_count && (priv->extension_events & GDK_BUTTON_MOTION_MASK)) - return TRUE; - - if ((gdkdev->button_state[0] & 1 << 1) && (priv->extension_events & GDK_BUTTON1_MOTION_MASK)) - return TRUE; - if ((gdkdev->button_state[0] & 1 << 2) && (priv->extension_events & GDK_BUTTON2_MOTION_MASK)) - return TRUE; - if ((gdkdev->button_state[0] & 1 << 3) && (priv->extension_events & GDK_BUTTON3_MOTION_MASK)) - return TRUE; - - return FALSE; - - case GDK_PROXIMITY_IN: - return priv->extension_events & GDK_PROXIMITY_IN_MASK; - - case GDK_PROXIMITY_OUT: - return priv->extension_events & GDK_PROXIMITY_OUT_MASK; - - default: - return FALSE; - } - - -} - - -gboolean -_gdk_device_get_history (GdkDevice *device, - GdkWindow *window, - guint32 start, - guint32 stop, - GdkTimeCoord ***events, - gint *n_events) -{ - GdkTimeCoord **coords; - XDeviceTimeCoord *device_coords; - GdkWindow *impl_window; - GdkDevicePrivate *gdkdev; - gint mode_return; - gint axis_count_return; - gint i; - - gdkdev = (GdkDevicePrivate *)device; - - impl_window = _gdk_window_get_impl_window (window); - - device_coords = XGetDeviceMotionEvents (GDK_WINDOW_XDISPLAY (impl_window), - gdkdev->xdevice, - start, stop, - n_events, &mode_return, - &axis_count_return); - - if (device_coords) - { - coords = _gdk_device_allocate_history (device, *n_events); - - for (i = 0; i < *n_events; i++) - { - coords[i]->time = device_coords[i].time; - - gdk_input_translate_coordinates (gdkdev, window, - device_coords[i].data, - coords[i]->axes, NULL, NULL); - } - - XFreeDeviceMotionEvents (device_coords); - - *events = coords; - - return TRUE; - } - else - return FALSE; -} - -/** - * gdk_device_get_state: - * @device: a #GdkDevice. - * @window: a #GdkWindow. - * @axes: an array of doubles to store the values of the axes of @device in, - * or %NULL. - * @mask: location to store the modifiers, or %NULL. - * - * Gets the current state of a device. - */ -void -gdk_device_get_state (GdkDevice *device, - GdkWindow *window, - gdouble *axes, - GdkModifierType *mask) -{ - gint i; - - g_return_if_fail (device != NULL); - g_return_if_fail (GDK_IS_WINDOW (window)); - - if (GDK_IS_CORE (device)) - { - gint x_int, y_int; - - gdk_window_get_pointer (window, &x_int, &y_int, mask); - - if (axes) - { - axes[0] = x_int; - axes[1] = y_int; - } - } - else - { - GdkDevicePrivate *gdkdev; - XDeviceState *state; - XInputClass *input_class; - - if (mask) - gdk_window_get_pointer (window, NULL, NULL, mask); - - gdkdev = (GdkDevicePrivate *)device; - - state = XQueryDeviceState (GDK_WINDOW_XDISPLAY (window), - gdkdev->xdevice); - input_class = state->data; - for (i=0; inum_classes; i++) - { - switch (input_class->class) - { - case ValuatorClass: - if (axes) - gdk_input_translate_coordinates (gdkdev, window, - ((XValuatorState *)input_class)->valuators, - axes, NULL, NULL); - break; - - case ButtonClass: - if (mask) - { - *mask &= 0xFF; - if (((XButtonState *)input_class)->num_buttons > 0) - *mask |= ((XButtonState *)input_class)->buttons[0] << 7; - /* GDK_BUTTON1_MASK = 1 << 8, and button n is stored - * in bit 1<<(n%8) in byte n/8. n = 1,2,... */ - } - break; - } - input_class = (XInputClass *)(((char *)input_class)+input_class->length); - } - XFreeDeviceState (state); - } -} - -#define __GDK_INPUT_X11_C__ -#include "gdkaliasdef.c" diff --git a/gdk/x11/gdkinput-xfree.c b/gdk/x11/gdkinput-xfree.c deleted file mode 100644 index bf63959f31..0000000000 --- a/gdk/x11/gdkinput-xfree.c +++ /dev/null @@ -1,422 +0,0 @@ -/* GDK - The GIMP Drawing Kit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include "config.h" -#include -#include "gdkinputprivate.h" -#include "gdkdisplay-x11.h" -#include "gdkalias.h" - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -/* forward declarations */ - -static void gdk_input_check_proximity (GdkDisplay *display); - -void -_gdk_input_init(GdkDisplay *display) -{ - _gdk_init_input_core (display); - display->ignore_core_events = FALSE; - _gdk_input_common_init (display, FALSE); -} - -gboolean -gdk_device_set_mode (GdkDevice *device, - GdkInputMode mode) -{ - GList *tmp_list; - GdkDevicePrivate *gdkdev; - GdkInputWindow *input_window; - GdkDisplayX11 *display_impl; - - if (GDK_IS_CORE (device)) - return FALSE; - - gdkdev = (GdkDevicePrivate *)device; - - if (device->mode == mode) - return TRUE; - - device->mode = mode; - - if (mode == GDK_MODE_WINDOW) - device->has_cursor = FALSE; - else if (mode == GDK_MODE_SCREEN) - device->has_cursor = TRUE; - - display_impl = GDK_DISPLAY_X11 (gdkdev->display); - for (tmp_list = display_impl->input_windows; tmp_list; tmp_list = tmp_list->next) - { - input_window = (GdkInputWindow *)tmp_list->data; - _gdk_input_select_events (input_window->impl_window, gdkdev); - } - - return TRUE; -} - -static void -gdk_input_check_proximity (GdkDisplay *display) -{ - GdkDisplayX11 *display_impl = GDK_DISPLAY_X11 (display); - GList *tmp_list = display_impl->input_devices; - gint new_proximity = 0; - - while (tmp_list && !new_proximity) - { - GdkDevicePrivate *gdkdev = (GdkDevicePrivate *)(tmp_list->data); - - if (gdkdev->info.mode != GDK_MODE_DISABLED - && !GDK_IS_CORE (gdkdev) - && gdkdev->xdevice) - { - XDeviceState *state = XQueryDeviceState(display_impl->xdisplay, - gdkdev->xdevice); - XInputClass *xic; - int i; - - xic = state->data; - for (i=0; inum_classes; i++) - { - if (xic->class == ValuatorClass) - { - XValuatorState *xvs = (XValuatorState *)xic; - if ((xvs->mode & ProximityState) == InProximity) - { - new_proximity = TRUE; - } - break; - } - xic = (XInputClass *)((char *)xic + xic->length); - } - - XFreeDeviceState (state); - } - tmp_list = tmp_list->next; - } - - display->ignore_core_events = new_proximity; -} - -void -_gdk_input_configure_event (XConfigureEvent *xevent, - GdkWindow *window) -{ - GdkWindowObject *priv = (GdkWindowObject *)window; - GdkInputWindow *input_window; - gint root_x, root_y; - - input_window = priv->input_window; - if (input_window != NULL) - { - _gdk_input_get_root_relative_geometry (window, &root_x, &root_y); - input_window->root_x = root_x; - input_window->root_y = root_y; - } -} - -void -_gdk_input_crossing_event (GdkWindow *window, - gboolean enter) -{ - GdkDisplay *display = GDK_WINDOW_DISPLAY (window); - GdkDisplayX11 *display_impl = GDK_DISPLAY_X11 (display); - GdkWindowObject *priv = (GdkWindowObject *)window; - GdkInputWindow *input_window; - gint root_x, root_y; - - if (enter) - { - gdk_input_check_proximity(display); - - input_window = priv->input_window; - if (input_window != NULL) - { - _gdk_input_get_root_relative_geometry (window, &root_x, &root_y); - input_window->root_x = root_x; - input_window->root_y = root_y; - } - } - else - display->ignore_core_events = FALSE; -} - -static GdkEventType -get_input_event_type (GdkDevicePrivate *gdkdev, - XEvent *xevent, - int *core_x, int *core_y) -{ - if (xevent->type == gdkdev->buttonpress_type) - { - XDeviceButtonEvent *xie = (XDeviceButtonEvent *)(xevent); - *core_x = xie->x; - *core_y = xie->y; - return GDK_BUTTON_PRESS; - } - - if (xevent->type == gdkdev->buttonrelease_type) - { - XDeviceButtonEvent *xie = (XDeviceButtonEvent *)(xevent); - *core_x = xie->x; - *core_y = xie->y; - return GDK_BUTTON_RELEASE; - } - - if (xevent->type == gdkdev->keypress_type) - { - XDeviceKeyEvent *xie = (XDeviceKeyEvent *)(xevent); - *core_x = xie->x; - *core_y = xie->y; - return GDK_KEY_PRESS; - } - - if (xevent->type == gdkdev->keyrelease_type) - { - XDeviceKeyEvent *xie = (XDeviceKeyEvent *)(xevent); - *core_x = xie->x; - *core_y = xie->y; - return GDK_KEY_RELEASE; - } - - if (xevent->type == gdkdev->motionnotify_type) - { - XDeviceMotionEvent *xie = (XDeviceMotionEvent *)(xevent); - *core_x = xie->x; - *core_y = xie->y; - return GDK_MOTION_NOTIFY; - } - - if (xevent->type == gdkdev->proximityin_type) - { - XProximityNotifyEvent *xie = (XProximityNotifyEvent *)(xevent); - *core_x = xie->x; - *core_y = xie->y; - return GDK_PROXIMITY_IN; - } - - if (xevent->type == gdkdev->proximityout_type) - { - XProximityNotifyEvent *xie = (XProximityNotifyEvent *)(xevent); - *core_x = xie->x; - *core_y = xie->y; - return GDK_PROXIMITY_OUT; - } - - *core_x = 0; - *core_y = 0; - return GDK_NOTHING; -} - - -gboolean -_gdk_input_other_event (GdkEvent *event, - XEvent *xevent, - GdkWindow *event_window) -{ - GdkWindow *window; - GdkWindowObject *priv; - GdkInputWindow *iw; - GdkDevicePrivate *gdkdev; - GdkEventType event_type; - int x, y; - GdkDisplay *display = GDK_WINDOW_DISPLAY (event_window); - GdkDisplayX11 *display_impl = GDK_DISPLAY_X11 (display); - - /* This is a sort of a hack, as there isn't any XDeviceAnyEvent - - but it's potentially faster than scanning through the types of - every device. If we were deceived, then it won't match any of - the types for the device anyways */ - gdkdev = _gdk_input_find_device (display, - ((XDeviceButtonEvent *)xevent)->deviceid); - if (!gdkdev) - return FALSE; /* we don't handle it - not an XInput event */ - - event_type = get_input_event_type (gdkdev, xevent, &x, &y); - if (event_type == GDK_NOTHING) - return FALSE; - - /* If we're not getting any event window its likely because we're outside the - window and there is no grab. We should still report according to the - implicit grab though. */ - iw = ((GdkWindowObject *)event_window)->input_window; - - if (iw->button_down_window) - window = iw->button_down_window; - else - window = _gdk_window_get_input_window_for_event (event_window, - event_type, - x, y, - xevent->xany.serial); - priv = (GdkWindowObject *)window; - if (window == NULL) - return FALSE; - - if (gdkdev->info.mode == GDK_MODE_DISABLED || - priv->extension_events == 0 || - !(gdkdev->info.has_cursor || (priv->extension_events & GDK_ALL_DEVICES_MASK))) - return FALSE; - - if (!display->ignore_core_events && priv->extension_events != 0) - gdk_input_check_proximity (GDK_WINDOW_DISPLAY (window)); - - if (!_gdk_input_common_other_event (event, xevent, window, gdkdev)) - return FALSE; - - if (event->type == GDK_BUTTON_PRESS) - iw->button_down_window = window; - if (event->type == GDK_BUTTON_RELEASE && !gdkdev->button_count) - iw->button_down_window = NULL; - - if (event->type == GDK_PROXIMITY_OUT && - display->ignore_core_events) - gdk_input_check_proximity (GDK_WINDOW_DISPLAY (window)); - - return _gdk_input_common_event_selected(event, window, gdkdev); -} - -gint -_gdk_input_grab_pointer (GdkWindow *window, - GdkWindow *native_window, /* This is the toplevel */ - gint owner_events, - GdkEventMask event_mask, - GdkWindow * confine_to, - guint32 time) -{ - GdkInputWindow *input_window; - GdkWindowObject *priv, *impl_window; - gboolean need_ungrab; - GdkDevicePrivate *gdkdev; - GList *tmp_list; - XEventClass event_classes[GDK_MAX_DEVICE_CLASSES]; - gint num_classes; - gint result; - GdkDisplayX11 *display_impl = GDK_DISPLAY_X11 (GDK_WINDOW_DISPLAY (window)); - - tmp_list = display_impl->input_windows; - need_ungrab = FALSE; - - while (tmp_list) - { - input_window = (GdkInputWindow *)tmp_list->data; - - if (input_window->grabbed) - { - input_window->grabbed = FALSE; - need_ungrab = TRUE; - break; - } - tmp_list = tmp_list->next; - } - - priv = (GdkWindowObject *)window; - impl_window = (GdkWindowObject *)_gdk_window_get_impl_window (window); - input_window = impl_window->input_window; - if (priv->extension_events) - { - g_assert (input_window != NULL); - input_window->grabbed = TRUE; - - tmp_list = display_impl->input_devices; - while (tmp_list) - { - gdkdev = (GdkDevicePrivate *)tmp_list->data; - if (!GDK_IS_CORE (gdkdev) && gdkdev->xdevice) - { - _gdk_input_common_find_events (gdkdev, event_mask, - event_classes, &num_classes); -#ifdef G_ENABLE_DEBUG - if (_gdk_debug_flags & GDK_DEBUG_NOGRABS) - result = GrabSuccess; - else -#endif - result = XGrabDevice (display_impl->xdisplay, gdkdev->xdevice, - GDK_WINDOW_XWINDOW (native_window), - owner_events, num_classes, event_classes, - GrabModeAsync, GrabModeAsync, time); - - /* FIXME: if failure occurs on something other than the first - device, things will be badly inconsistent */ - if (result != Success) - return result; - } - tmp_list = tmp_list->next; - } - } - else - { - tmp_list = display_impl->input_devices; - while (tmp_list) - { - gdkdev = (GdkDevicePrivate *)tmp_list->data; - if (!GDK_IS_CORE (gdkdev) && gdkdev->xdevice && - ((gdkdev->button_count != 0) || need_ungrab)) - { - XUngrabDevice (display_impl->xdisplay, gdkdev->xdevice, time); - memset (gdkdev->button_state, 0, sizeof (gdkdev->button_state)); - gdkdev->button_count = 0; - } - - tmp_list = tmp_list->next; - } - } - - return Success; -} - -void -_gdk_input_ungrab_pointer (GdkDisplay *display, - guint32 time) -{ - GdkInputWindow *input_window = NULL; /* Quiet GCC */ - GdkDevicePrivate *gdkdev; - GList *tmp_list; - GdkDisplayX11 *display_impl = GDK_DISPLAY_X11 (display); - - tmp_list = display_impl->input_windows; - while (tmp_list) - { - input_window = (GdkInputWindow *)tmp_list->data; - if (input_window->grabbed) - break; - tmp_list = tmp_list->next; - } - - if (tmp_list) /* we found a grabbed window */ - { - input_window->grabbed = FALSE; - - tmp_list = display_impl->input_devices; - while (tmp_list) - { - gdkdev = (GdkDevicePrivate *)tmp_list->data; - if (!GDK_IS_CORE (gdkdev) && gdkdev->xdevice) - XUngrabDevice( display_impl->xdisplay, gdkdev->xdevice, time); - - tmp_list = tmp_list->next; - } - } -} - -#define __GDK_INPUT_XFREE_C__ -#include "gdkaliasdef.c" diff --git a/gdk/x11/gdkinput.c b/gdk/x11/gdkinput.c index 72eb5ab0e8..c98c3f40f4 100644 --- a/gdk/x11/gdkinput.c +++ b/gdk/x11/gdkinput.c @@ -27,115 +27,23 @@ #include "config.h" #include -#include -#include -#include "gdkx.h" -#include "gdkinput.h" -#include "gdkprivate.h" -#include "gdkinputprivate.h" #include "gdkscreen-x11.h" #include "gdkdisplay-x11.h" +#include "gdkwindow.h" #include "gdkalias.h" -static GdkDeviceAxis gdk_input_core_axes[] = { - { GDK_AXIS_X, 0, 0 }, - { GDK_AXIS_Y, 0, 0 } +/* Addition used for extension_events mask */ +#define GDK_ALL_DEVICES_MASK (1<<30) + +struct _GdkInputWindow +{ + GList *windows; /* GdkWindow:s with extension_events set */ + + /* gdk window */ + GdkWindow *impl_window; /* an impl window */ }; -void -_gdk_init_input_core (GdkDisplay *display) -{ - GdkDevicePrivate *private; - - display->core_pointer = g_object_new (GDK_TYPE_DEVICE, NULL); - private = (GdkDevicePrivate *)display->core_pointer; - - display->core_pointer->name = "Core Pointer"; - display->core_pointer->source = GDK_SOURCE_MOUSE; - display->core_pointer->mode = GDK_MODE_SCREEN; - display->core_pointer->has_cursor = TRUE; - display->core_pointer->num_axes = 2; - display->core_pointer->axes = gdk_input_core_axes; - display->core_pointer->num_keys = 0; - display->core_pointer->keys = NULL; - - private->display = display; -} - -static void gdk_device_class_init (GdkDeviceClass *klass); -static void gdk_device_dispose (GObject *object); - -static gpointer gdk_device_parent_class = NULL; - -GType -gdk_device_get_type (void) -{ - static GType object_type = 0; - - if (!object_type) - { - const GTypeInfo object_info = - { - sizeof (GdkDeviceClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) gdk_device_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (GdkDevicePrivate), - 0, /* n_preallocs */ - (GInstanceInitFunc) NULL, - }; - - object_type = g_type_register_static (G_TYPE_OBJECT, - g_intern_static_string ("GdkDevice"), - &object_info, 0); - } - - return object_type; -} - -static void -gdk_device_class_init (GdkDeviceClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - - gdk_device_parent_class = g_type_class_peek_parent (klass); - - object_class->dispose = gdk_device_dispose; -} - -static void -gdk_device_dispose (GObject *object) -{ - GdkDevicePrivate *gdkdev = (GdkDevicePrivate *) object; - - if (gdkdev->display && !GDK_IS_CORE (gdkdev)) - { -#ifndef XINPUT_NONE - if (gdkdev->xdevice) - { - XCloseDevice (GDK_DISPLAY_XDISPLAY (gdkdev->display), gdkdev->xdevice); - gdkdev->xdevice = NULL; - } - g_free (gdkdev->axes); - g_free (gdkdev->axis_data); - gdkdev->axes = NULL; - gdkdev->axis_data = NULL; -#endif /* !XINPUT_NONE */ - - g_free (gdkdev->info.name); - g_free (gdkdev->info.keys); - g_free (gdkdev->info.axes); - - gdkdev->info.name = NULL; - gdkdev->info.keys = NULL; - gdkdev->info.axes = NULL; - } - - G_OBJECT_CLASS (gdk_device_parent_class)->dispose (object); -} /** * gdk_devices_list: @@ -144,6 +52,8 @@ gdk_device_dispose (GObject *object) * The list is statically allocated and should not be freed. * * Return value: a list of #GdkDevice + * + * Deprecated: 3.0: Use gdk_device_manager_list_devices() instead. **/ GList * gdk_devices_list (void) @@ -151,225 +61,48 @@ gdk_devices_list (void) return gdk_display_list_devices (gdk_display_get_default ()); } -/** - * gdk_display_list_devices: - * @display: a #GdkDisplay - * - * Returns the list of available input devices attached to @display. - * The list is statically allocated and should not be freed. - * - * Return value: a list of #GdkDevice - * - * Since: 2.2 - **/ -GList * -gdk_display_list_devices (GdkDisplay *display) +static void +_gdk_input_select_device_events (GdkWindow *impl_window, + GdkDevice *device) { - g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL); + guint event_mask; + GdkWindowObject *w; + GdkInputWindow *iw; + GdkInputMode mode; + gboolean has_cursor; + GdkDeviceType type; + GList *l; - return GDK_DISPLAY_X11 (display)->input_devices; -} + event_mask = 0; + iw = ((GdkWindowObject *)impl_window)->input_window; -void -gdk_device_set_source (GdkDevice *device, - GdkInputSource source) -{ - g_return_if_fail (device != NULL); + g_object_get (device, + "type", &type, + "input-mode", &mode, + "has-cursor", &has_cursor, + NULL); - device->source = source; -} + if (iw == NULL || + mode == GDK_MODE_DISABLED || + type == GDK_DEVICE_TYPE_MASTER) + return; -void -gdk_device_set_key (GdkDevice *device, - guint index, - guint keyval, - GdkModifierType modifiers) -{ - g_return_if_fail (device != NULL); - g_return_if_fail (index < device->num_keys); - - device->keys[index].keyval = keyval; - device->keys[index].modifiers = modifiers; -} - -void -gdk_device_set_axis_use (GdkDevice *device, - guint index, - GdkAxisUse use) -{ - g_return_if_fail (device != NULL); - g_return_if_fail (index < device->num_axes); - - device->axes[index].use = use; - - switch (use) + for (l = iw->windows; l != NULL; l = l->next) { - case GDK_AXIS_X: - case GDK_AXIS_Y: - device->axes[index].min = 0.; - device->axes[index].max = 0.; - break; - case GDK_AXIS_XTILT: - case GDK_AXIS_YTILT: - device->axes[index].min = -1.; - device->axes[index].max = 1; - break; - default: - device->axes[index].min = 0.; - device->axes[index].max = 1; - break; + w = l->data; + + if (has_cursor || (w->extension_events & GDK_ALL_DEVICES_MASK)) + { + event_mask = w->extension_events; + + if (event_mask) + event_mask |= GDK_PROXIMITY_OUT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK; + + gdk_window_set_device_events ((GdkWindow *) w, device, event_mask); + } } } -static gboolean -impl_coord_in_window (GdkWindow *window, - int impl_x, - int impl_y) -{ - GdkWindowObject *priv = (GdkWindowObject *)window; - - if (impl_x < priv->abs_x || - impl_x > priv->abs_x + priv->width) - return FALSE; - if (impl_y < priv->abs_y || - impl_y > priv->abs_y + priv->height) - return FALSE; - return TRUE; -} - -/** - * gdk_device_get_history: - * @device: a #GdkDevice - * @window: the window with respect to which which the event coordinates will be reported - * @start: starting timestamp for range of events to return - * @stop: ending timestamp for the range of events to return - * @events: (array length=n_events) (out) (transfer none): location to store a newly-allocated array of #GdkTimeCoord, or %NULL - * @n_events: location to store the length of @events, or %NULL - * - * Obtains the motion history for a device; given a starting and - * ending timestamp, return all events in the motion history for - * the device in the given range of time. Some windowing systems - * do not support motion history, in which case, %FALSE will - * be returned. (This is not distinguishable from the case where - * motion history is supported and no events were found.) - * - * Return value: %TRUE if the windowing system supports motion history and - * at least one event was found. - **/ -gboolean -gdk_device_get_history (GdkDevice *device, - GdkWindow *window, - guint32 start, - guint32 stop, - GdkTimeCoord ***events, - gint *n_events) -{ - GdkTimeCoord **coords = NULL; - GdkWindow *impl_window; - gboolean result = FALSE; - int tmp_n_events = 0; - - g_return_val_if_fail (GDK_WINDOW_IS_X11 (window), FALSE); - - impl_window = _gdk_window_get_impl_window (window); - - if (GDK_WINDOW_DESTROYED (window)) - /* Nothing */ ; - else if (GDK_IS_CORE (device)) - { - XTimeCoord *xcoords; - - xcoords = XGetMotionEvents (GDK_DRAWABLE_XDISPLAY (window), - GDK_DRAWABLE_XID (impl_window), - start, stop, &tmp_n_events); - if (xcoords) - { - GdkWindowObject *priv = (GdkWindowObject *)window; - int i, j; - - coords = _gdk_device_allocate_history (device, tmp_n_events); - j = 0; - - for (i = 0; i < tmp_n_events; i++) - { - if (impl_coord_in_window (window, xcoords[i].x, xcoords[i].y)) - { - coords[j]->time = xcoords[i].time; - coords[j]->axes[0] = xcoords[i].x - priv->abs_x; - coords[j]->axes[1] = xcoords[i].y - priv->abs_y; - j++; - } - } - - XFree (xcoords); - - /* free the events we allocated too much */ - for (i = j; i < tmp_n_events; i++) - { - g_free (coords[i]); - coords[i] = NULL; - } - - tmp_n_events = j; - - if (tmp_n_events > 0) - { - result = TRUE; - } - else - { - gdk_device_free_history (coords, tmp_n_events); - coords = NULL; - } - } - } - else - result = _gdk_device_get_history (device, window, start, stop, &coords, &tmp_n_events); - - if (n_events) - *n_events = tmp_n_events; - - if (events) - *events = coords; - else if (coords) - gdk_device_free_history (coords, tmp_n_events); - - return result; -} - -GdkTimeCoord ** -_gdk_device_allocate_history (GdkDevice *device, - gint n_events) -{ - GdkTimeCoord **result = g_new (GdkTimeCoord *, n_events); - gint i; - - for (i=0; inum_axes)); - - return result; -} - -/** - * gdk_device_free_history: - * @events: (inout) (transfer none): an array of #GdkTimeCoord. - * @n_events: the length of the array. - * - * Frees an array of #GdkTimeCoord that was returned by gdk_device_get_history(). - */ -void -gdk_device_free_history (GdkTimeCoord **events, - gint n_events) -{ - gint i; - - for (i=0; iextension_events = 0; } +/** + * gdk_input_set_extension_events: + * @window: a #GdkWindow. + * @mask: the event mask + * @mode: the type of extension events that are desired. + * + * Turns extension events on or off for a particular window, + * and specifies the event mask for extension events. + * + * Deprecated: 3.0: Use gdk_window_set_device_events() instead. + **/ void -gdk_input_set_extension_events (GdkWindow *window, gint mask, - GdkExtensionMode mode) +gdk_input_set_extension_events (GdkWindow *window, + gint mask, + GdkExtensionMode mode) { GdkWindowObject *window_private; GdkWindowObject *impl_window; @@ -440,15 +185,8 @@ gdk_input_set_extension_events (GdkWindow *window, gint mask, iw->impl_window = (GdkWindow *)impl_window; iw->windows = NULL; - iw->grabbed = FALSE; display_x11->input_windows = g_list_append (display_x11->input_windows, iw); - -#ifndef XINPUT_NONE - /* we might not receive ConfigureNotify so get the root_relative_geometry - * now, just in case */ - _gdk_input_get_root_relative_geometry (window, &iw->root_x, &iw->root_y); -#endif /* !XINPUT_NONE */ impl_window->input_window = iw; } @@ -464,10 +202,8 @@ gdk_input_set_extension_events (GdkWindow *window, gint mask, #ifndef XINPUT_NONE for (tmp_list = display_x11->input_devices; tmp_list; tmp_list = tmp_list->next) { - GdkDevicePrivate *gdkdev = tmp_list->data; - - if (!GDK_IS_CORE (gdkdev)) - _gdk_input_select_events ((GdkWindow *)impl_window, gdkdev); + GdkDevice *dev = tmp_list->data; + _gdk_input_select_device_events (GDK_WINDOW (impl_window), dev); } #endif /* !XINPUT_NONE */ } @@ -478,40 +214,20 @@ _gdk_input_window_destroy (GdkWindow *window) unset_extension_events (window); } -/** - * gdk_device_get_axis: - * @device: a #GdkDevice - * @axes: pointer to an array of axes - * @use: the use to look for - * @value: location to store the found value. - * - * Interprets an array of double as axis values for a given device, - * and locates the value in the array for a given axis use. - * - * Return value: %TRUE if the given axis use was found, otherwise %FALSE - **/ -gboolean -gdk_device_get_axis (GdkDevice *device, - gdouble *axes, - GdkAxisUse use, - gdouble *value) +void +_gdk_input_check_extension_events (GdkDevice *device) { - gint i; + GdkDisplayX11 *display_impl; + GdkInputWindow *input_window; + GList *tmp_list; - g_return_val_if_fail (device != NULL, FALSE); + display_impl = GDK_DISPLAY_X11 (gdk_device_get_display (device)); - if (axes == NULL) - return FALSE; - - for (i=0; inum_axes; i++) - if (device->axes[i].use == use) - { - if (value) - *value = axes[i]; - return TRUE; - } - - return FALSE; + for (tmp_list = display_impl->input_windows; tmp_list; tmp_list = tmp_list->next) + { + input_window = tmp_list->data; + _gdk_input_select_device_events (input_window->impl_window, device); + } } #define __GDK_INPUT_C__ diff --git a/gdk/x11/gdkinputprivate.h b/gdk/x11/gdkinputprivate.h deleted file mode 100644 index 1b89230fcf..0000000000 --- a/gdk/x11/gdkinputprivate.h +++ /dev/null @@ -1,189 +0,0 @@ -/* GDK - The GIMP Drawing Kit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#ifndef __GDK_INPUTPRIVATE_H__ -#define __GDK_INPUTPRIVATE_H__ - -#include "config.h" -#include "gdkinput.h" -#include "gdkevents.h" -#include "gdkx.h" - -#include - -#ifndef XINPUT_NONE -#include -#endif - - -typedef struct _GdkAxisInfo GdkAxisInfo; -typedef struct _GdkDevicePrivate GdkDevicePrivate; - -/* information about a device axis */ -struct _GdkAxisInfo -{ - /* reported x resolution */ - gint xresolution; - - /* reported x minimum/maximum values */ - gint xmin_value, xmax_value; - - /* calibrated resolution (for aspect ration) - only relative values - between axes used */ - gint resolution; - - /* calibrated minimum/maximum values */ - gint min_value, max_value; -}; - -#define GDK_INPUT_NUM_EVENTC 6 - -struct _GdkDevicePrivate -{ - GdkDevice info; - - guint32 deviceid; - - GdkDisplay *display; - - -#ifndef XINPUT_NONE - /* information about the axes */ - GdkAxisInfo *axes; - gint *axis_data; - - /* Information about XInput device */ - XDevice *xdevice; - - /* minimum key code for device */ - gint min_keycode; - - int buttonpress_type, buttonrelease_type, keypress_type, - keyrelease_type, motionnotify_type, proximityin_type, - proximityout_type, changenotify_type, devicestatenotify_type; - - /* true if we need to select a different set of events, but - can't because this is the core pointer */ - gint needs_update; - - /* Mask of buttons (used for button grabs) */ - char button_state[32]; - gint button_count; - - /* true if we've claimed the device as active. (used only for XINPUT_GXI) */ - gint claimed; -#endif /* !XINPUT_NONE */ -}; - -struct _GdkDeviceClass -{ - GObjectClass parent_class; -}; - -/* Addition used for extension_events mask */ -#define GDK_ALL_DEVICES_MASK (1<<30) - -struct _GdkInputWindow -{ - GList *windows; /* GdkWindow:s with extension_events set */ - - /* gdk window */ - GdkWindow *impl_window; /* an impl window */ - GdkWindow *button_down_window; - - /* position relative to root window */ - gint root_x; - gint root_y; - - /* Is there a pointer grab for this window ? */ - gint grabbed; -}; - -/* Global data */ - -#define GDK_IS_CORE(d) (((GdkDevice *)(d)) == ((GdkDevicePrivate *)(d))->display->core_pointer) - -/* Function declarations */ - -GdkInputWindow *_gdk_input_window_find (GdkWindow *window); -void _gdk_input_window_destroy (GdkWindow *window); -GdkTimeCoord ** _gdk_device_allocate_history (GdkDevice *device, - gint n_events); -void _gdk_init_input_core (GdkDisplay *display); - -/* The following functions are provided by each implementation - * (xfree, gxi, and none) - */ -void _gdk_input_configure_event (XConfigureEvent *xevent, - GdkWindow *window); -void _gdk_input_crossing_event (GdkWindow *window, - gboolean enter); -gboolean _gdk_input_other_event (GdkEvent *event, - XEvent *xevent, - GdkWindow *window); -gint _gdk_input_grab_pointer (GdkWindow *window, - GdkWindow *native_window, - gint owner_events, - GdkEventMask event_mask, - GdkWindow *confine_to, - guint32 time); -void _gdk_input_ungrab_pointer (GdkDisplay *display, - guint32 time); -gboolean _gdk_device_get_history (GdkDevice *device, - GdkWindow *window, - guint32 start, - guint32 stop, - GdkTimeCoord ***events, - gint *n_events); - -#ifndef XINPUT_NONE - -#define GDK_MAX_DEVICE_CLASSES 13 - -gint _gdk_input_common_init (GdkDisplay *display, - gint include_core); -GdkDevicePrivate * _gdk_input_find_device (GdkDisplay *display, - guint32 id); -void _gdk_input_get_root_relative_geometry(GdkWindow *window, - int *x_ret, - int *y_ret); -void _gdk_input_common_find_events (GdkDevicePrivate *gdkdev, - gint mask, - XEventClass *classes, - int *num_classes); -void _gdk_input_select_events (GdkWindow *impl_window, - GdkDevicePrivate *gdkdev); -gint _gdk_input_common_other_event (GdkEvent *event, - XEvent *xevent, - GdkWindow *window, - GdkDevicePrivate *gdkdev); -gboolean _gdk_input_common_event_selected (GdkEvent *event, - GdkWindow *window, - GdkDevicePrivate *gdkdev); - -#endif /* !XINPUT_NONE */ - -#endif /* __GDK_INPUTPRIVATE_H__ */ diff --git a/gdk/x11/gdkmain-x11.c b/gdk/x11/gdkmain-x11.c index f12c7094b8..d876fd4db7 100644 --- a/gdk/x11/gdkmain-x11.c +++ b/gdk/x11/gdkmain-x11.c @@ -47,11 +47,13 @@ #include "gdkasync.h" #include "gdkdisplay-x11.h" #include "gdkinternals.h" +#include "gdkprivate-x11.h" #include "gdkintl.h" #include "gdkregion-generic.h" -#include "gdkinputprivate.h" #include "gdkalias.h" +#include + typedef struct _GdkPredicate GdkPredicate; typedef struct _GdkErrorTrap GdkErrorTrap; @@ -105,19 +107,8 @@ _gdk_windowing_init (void) _gdk_selection_property = gdk_atom_intern_static_string ("GDK_SELECTION"); } -void -gdk_set_use_xshm (gboolean use_xshm) -{ -} - -gboolean -gdk_get_use_xshm (void) -{ - return GDK_DISPLAY_X11 (gdk_display_get_default ())->use_xshm; -} - -static GdkGrabStatus -gdk_x11_convert_grab_status (gint status) +GdkGrabStatus +_gdk_x11_convert_grab_status (gint status) { switch (status) { @@ -143,171 +134,46 @@ has_pointer_grab_callback (GdkDisplay *display, gpointer data, gulong serial) { - _gdk_display_pointer_grab_update (display, serial); + GdkDevice *device = data; + + _gdk_display_device_grab_update (display, device, serial); } GdkGrabStatus -_gdk_windowing_pointer_grab (GdkWindow *window, - GdkWindow *native, - gboolean owner_events, - GdkEventMask event_mask, - GdkWindow *confine_to, - GdkCursor *cursor, - guint32 time) +_gdk_windowing_device_grab (GdkDevice *device, + GdkWindow *window, + GdkWindow *native, + gboolean owner_events, + GdkEventMask event_mask, + GdkWindow *confine_to, + GdkCursor *cursor, + guint32 time) { - gint return_val; - GdkCursorPrivate *cursor_private; - GdkDisplayX11 *display_x11; - guint xevent_mask; - Window xwindow; - Window xconfine_to; - Cursor xcursor; - int i; - - if (confine_to) - confine_to = _gdk_window_get_impl_window (confine_to); - - display_x11 = GDK_DISPLAY_X11 (GDK_WINDOW_DISPLAY (native)); - - cursor_private = (GdkCursorPrivate*) cursor; - - xwindow = GDK_WINDOW_XID (native); - - if (!confine_to || GDK_WINDOW_DESTROYED (confine_to)) - xconfine_to = None; - else - xconfine_to = GDK_WINDOW_XID (confine_to); - - if (!cursor) - xcursor = None; - else - { - _gdk_x11_cursor_update_theme (cursor); - xcursor = cursor_private->xcursor; - } - - xevent_mask = 0; - for (i = 0; i < _gdk_nenvent_masks; i++) - { - if (event_mask & (1 << (i + 1))) - xevent_mask |= _gdk_event_mask_table[i]; - } - - /* We don't want to set a native motion hint mask, as we're emulating motion - * hints. If we set a native one we just wouldn't get any events. - */ - xevent_mask &= ~PointerMotionHintMask; - - return_val = _gdk_input_grab_pointer (window, - native, - owner_events, - event_mask, - confine_to, - time); - - if (return_val == GrabSuccess || - G_UNLIKELY (!display_x11->trusted_client && return_val == AlreadyGrabbed)) - { - if (!GDK_WINDOW_DESTROYED (native)) - { -#ifdef G_ENABLE_DEBUG - if (_gdk_debug_flags & GDK_DEBUG_NOGRABS) - return_val = GrabSuccess; - else -#endif - return_val = XGrabPointer (GDK_WINDOW_XDISPLAY (native), - xwindow, - owner_events, - xevent_mask, - GrabModeAsync, GrabModeAsync, - xconfine_to, - xcursor, - time); - } - else - return_val = AlreadyGrabbed; - } - - if (return_val == GrabSuccess) - _gdk_x11_roundtrip_async (GDK_DISPLAY_OBJECT (display_x11), - has_pointer_grab_callback, - NULL); - - return gdk_x11_convert_grab_status (return_val); -} - -/* - *-------------------------------------------------------------- - * gdk_keyboard_grab - * - * Grabs the keyboard to a specific window - * - * Arguments: - * "window" is the window which will receive the grab - * "owner_events" specifies whether events will be reported as is, - * or relative to "window" - * "time" specifies the time - * - * Results: - * - * Side effects: - * requires a corresponding call to gdk_keyboard_ungrab - * - *-------------------------------------------------------------- - */ - -GdkGrabStatus -gdk_keyboard_grab (GdkWindow * window, - gboolean owner_events, - guint32 time) -{ - gint return_val; - unsigned long serial; GdkDisplay *display; - GdkDisplayX11 *display_x11; - GdkWindow *native; + GdkGrabStatus status = GDK_GRAB_SUCCESS; - g_return_val_if_fail (window != NULL, 0); - g_return_val_if_fail (GDK_IS_WINDOW (window), 0); + if (!window || GDK_WINDOW_DESTROYED (window)) + return GDK_GRAB_NOT_VIEWABLE; - native = gdk_window_get_toplevel (window); + display = gdk_device_get_display (device); - /* TODO: What do we do for offscreens and children? We need to proxy the grab somehow */ - if (!GDK_IS_WINDOW_IMPL_X11 (GDK_WINDOW_OBJECT (native)->impl)) - return GDK_GRAB_SUCCESS; - - display = GDK_WINDOW_DISPLAY (native); - display_x11 = GDK_DISPLAY_X11 (display); - - serial = NextRequest (GDK_WINDOW_XDISPLAY (native)); - - if (!GDK_WINDOW_DESTROYED (native)) - { #ifdef G_ENABLE_DEBUG - if (_gdk_debug_flags & GDK_DEBUG_NOGRABS) - return_val = GrabSuccess; - else -#endif - return_val = XGrabKeyboard (GDK_WINDOW_XDISPLAY (native), - GDK_WINDOW_XID (native), - owner_events, - GrabModeAsync, GrabModeAsync, - time); - if (G_UNLIKELY (!display_x11->trusted_client && - return_val == AlreadyGrabbed)) - /* we can't grab the keyboard, but we can do a GTK-local grab */ - return_val = GrabSuccess; - } + if (_gdk_debug_flags & GDK_DEBUG_NOGRABS) + status = GrabSuccess; else - return_val = AlreadyGrabbed; - - if (return_val == GrabSuccess) - _gdk_display_set_has_keyboard_grab (display, - window, native, - owner_events, - serial, time); - - return gdk_x11_convert_grab_status (return_val); +#endif + status = GDK_DEVICE_GET_CLASS (device)->grab (device, + native, + owner_events, + event_mask, + confine_to, + cursor, + time); + if (status == GDK_GRAB_SUCCESS) + _gdk_x11_roundtrip_async (display, + has_pointer_grab_callback, + device); + return status; } /** @@ -325,21 +191,21 @@ _gdk_xgrab_check_unmap (GdkWindow *window, gulong serial) { GdkDisplay *display = gdk_drawable_get_display (window); + GdkDeviceManager *device_manager; + GList *devices, *d; - _gdk_display_end_pointer_grab (display, serial, window, TRUE); + device_manager = gdk_display_get_device_manager (display); - if (display->keyboard_grab.window && - serial >= display->keyboard_grab.serial) - { - GdkWindowObject *private = GDK_WINDOW_OBJECT (window); - GdkWindowObject *tmp = GDK_WINDOW_OBJECT (display->keyboard_grab.window); + /* Get all devices */ + devices = gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_MASTER); + devices = g_list_concat (devices, gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_SLAVE)); + devices = g_list_concat (devices, gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_FLOATING)); - while (tmp && tmp != private) - tmp = tmp->parent; + /* End all grabs on the newly hidden window */ + for (d = devices; d; d = d->next) + _gdk_display_end_device_grab (display, d->data, serial, window, TRUE); - if (tmp) - _gdk_display_unset_has_keyboard_grab (display, TRUE); - } + g_list_free (devices); } /** @@ -353,25 +219,35 @@ void _gdk_xgrab_check_destroy (GdkWindow *window) { GdkDisplay *display = gdk_drawable_get_display (window); - GdkPointerGrabInfo *grab; + GdkDeviceManager *device_manager; + GdkDeviceGrabInfo *grab; + GList *devices, *d; - /* Make sure there is no lasting grab in this native - window */ - grab = _gdk_display_get_last_pointer_grab (display); - if (grab && grab->native_window == window) + device_manager = gdk_display_get_device_manager (display); + + /* Get all devices */ + devices = gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_MASTER); + devices = g_list_concat (devices, gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_SLAVE)); + devices = g_list_concat (devices, gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_FLOATING)); + + for (d = devices; d; d = d->next) { - /* We don't know the actual serial to end, but it - doesn't really matter as this only happens - after we get told of the destroy from the - server so we know its ended in the server, - just make sure its ended. */ - grab->serial_end = grab->serial_start; - grab->implicit_ungrab = TRUE; + /* Make sure there is no lasting grab in this native window */ + grab = _gdk_display_get_last_device_grab (display, d->data); + + if (grab && grab->native_window == window) + { + /* We don't know the actual serial to end, but it + doesn't really matter as this only happens + after we get told of the destroy from the + server so we know its ended in the server, + just make sure its ended. */ + grab->serial_end = grab->serial_start; + grab->implicit_ungrab = TRUE; + } } - - if (window == display->keyboard_grab.native_window && - display->keyboard_grab.window != NULL) - _gdk_display_unset_has_keyboard_grab (display, TRUE); + + g_list_free (devices); } void @@ -734,5 +610,16 @@ gdk_x11_get_default_xdisplay (void) return GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()); } +void +_gdk_windowing_event_data_copy (const GdkEvent *src, + GdkEvent *dst) +{ +} + +void +_gdk_windowing_event_data_free (GdkEvent *event) +{ +} + #define __GDK_MAIN_X11_C__ #include "gdkaliasdef.c" diff --git a/gdk/x11/gdkprivate-x11.h b/gdk/x11/gdkprivate-x11.h index 05c033ac76..00cde1b6e2 100644 --- a/gdk/x11/gdkprivate-x11.h +++ b/gdk/x11/gdkprivate-x11.h @@ -177,8 +177,7 @@ void _gdk_x11_precache_atoms (GdkDisplay *display, const gchar * const *atom_names, gint n_atoms); -void _gdk_x11_events_init_screen (GdkScreen *screen); -void _gdk_x11_events_uninit_screen (GdkScreen *screen); +void _gdk_screen_x11_events_init (GdkScreen *screen); void _gdk_events_init (GdkDisplay *display); void _gdk_events_uninit (GdkDisplay *display); @@ -186,7 +185,6 @@ void _gdk_windowing_window_init (GdkScreen *screen); void _gdk_visual_init (GdkScreen *screen); void _gdk_dnd_init (GdkDisplay *display); void _gdk_windowing_image_init (GdkDisplay *display); -void _gdk_input_init (GdkDisplay *display); PangoRenderer *_gdk_x11_renderer_get (GdkDrawable *drawable, GdkGC *gc); @@ -198,6 +196,9 @@ gboolean _gdk_x11_get_xft_setting (GdkScreen *screen, const gchar *name, GValue *value); +GdkGrabStatus _gdk_x11_convert_grab_status (gint status); + + extern GdkDrawableClass _gdk_x11_drawable_class; extern gboolean _gdk_use_xshm; extern const int _gdk_nenvent_masks; diff --git a/gdk/x11/gdkscreen-x11.c b/gdk/x11/gdkscreen-x11.c index 3d9d4c7413..469661c8e1 100644 --- a/gdk/x11/gdkscreen-x11.c +++ b/gdk/x11/gdkscreen-x11.c @@ -51,6 +51,8 @@ #include #endif +#include "gdksettings.c" + static void gdk_screen_x11_dispose (GObject *object); static void gdk_screen_x11_finalize (GObject *object); static void init_randr_support (GdkScreen *screen); @@ -66,6 +68,14 @@ static guint signals[LAST_SIGNAL] = { 0 }; G_DEFINE_TYPE (GdkScreenX11, _gdk_screen_x11, GDK_TYPE_SCREEN) +typedef struct _NetWmSupportedAtoms NetWmSupportedAtoms; + +struct _NetWmSupportedAtoms +{ + Atom *atoms; + gulong n_atoms; +}; + struct _GdkX11Monitor { GdkRectangle geometry; @@ -292,12 +302,24 @@ gdk_screen_set_default_colormap (GdkScreen *screen, g_object_unref (old_colormap); } +static void +_gdk_screen_x11_events_uninit (GdkScreen *screen) +{ + GdkScreenX11 *screen_x11 = GDK_SCREEN_X11 (screen); + + if (screen_x11->xsettings_client) + { + xsettings_client_destroy (screen_x11->xsettings_client); + screen_x11->xsettings_client = NULL; + } +} + static void gdk_screen_x11_dispose (GObject *object) { GdkScreenX11 *screen_x11 = GDK_SCREEN_X11 (object); - _gdk_x11_events_uninit_screen (GDK_SCREEN (object)); + _gdk_screen_x11_events_uninit (GDK_SCREEN (object)); if (screen_x11->default_colormap) { @@ -733,6 +755,7 @@ free_monitors (GdkX11Monitor *monitors, g_free (monitors); } +#ifdef HAVE_RANDR static int monitor_compare_function (GdkX11Monitor *monitor1, GdkX11Monitor *monitor2) @@ -757,6 +780,7 @@ monitor_compare_function (GdkX11Monitor *monitor1, return 0; } +#endif static gboolean init_randr13 (GdkScreen *screen) @@ -768,6 +792,7 @@ init_randr13 (GdkScreen *screen) Display *dpy = GDK_SCREEN_XDISPLAY (screen); XRRScreenResources *resources; RROutput primary_output; + RROutput first_output = None; int i; GArray *monitors; gboolean randr12_compat = FALSE; @@ -822,6 +847,9 @@ init_randr13 (GdkScreen *screen) XRRFreeOutputInfo (output); } + if (resources->noutput > 0) + first_output = resources->outputs[0]; + XRRFreeScreenResources (resources); /* non RandR 1.2 X driver doesn't return any usable multihead data */ @@ -848,12 +876,22 @@ init_randr13 (GdkScreen *screen) for (i = 0; i < screen_x11->n_monitors; ++i) { if (screen_x11->monitors[i].output == primary_output) - screen_x11->primary_monitor = i; + { + screen_x11->primary_monitor = i; + break; + } /* No RandR1.3+ available or no primary set, fall back to prefer LVDS as primary if present */ if (primary_output == None && g_ascii_strncasecmp (screen_x11->monitors[i].output_name, "LVDS", 4) == 0) - screen_x11->primary_monitor = i; + { + screen_x11->primary_monitor = i; + break; + } + + /* No primary specified and no LVDS found */ + if (screen_x11->monitors[i].output == first_output) + screen_x11->primary_monitor = i; } return screen_x11->n_monitors > 0; @@ -1168,7 +1206,9 @@ _gdk_x11_screen_size_changed (GdkScreen *screen, XEvent *event) { gint width, height; +#ifdef HAVE_RANDR GdkDisplayX11 *display_x11; +#endif width = gdk_screen_get_width (screen); height = gdk_screen_get_height (screen); @@ -1188,7 +1228,7 @@ _gdk_x11_screen_size_changed (GdkScreen *screen, { XConfigureEvent *rcevent = (XConfigureEvent *) event; Screen *xscreen = gdk_x11_screen_get_xscreen (screen); - + xscreen->width = rcevent->width; xscreen->height = rcevent->height; } @@ -1440,5 +1480,637 @@ gdk_screen_get_window_stack (GdkScreen *screen) return ret; } +/* Sends a ClientMessage to all toplevel client windows */ +static gboolean +gdk_event_send_client_message_to_all_recurse (GdkDisplay *display, + XEvent *xev, + guint32 xid, + guint level) +{ + Atom type = None; + int format; + unsigned long nitems, after; + unsigned char *data; + Window *ret_children, ret_root, ret_parent; + unsigned int ret_nchildren; + gboolean send = FALSE; + gboolean found = FALSE; + gboolean result = FALSE; + int i; + + gdk_error_trap_push (); + + if (XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), xid, + gdk_x11_get_xatom_by_name_for_display (display, "WM_STATE"), + 0, 0, False, AnyPropertyType, + &type, &format, &nitems, &after, &data) != Success) + goto out; + + if (type) + { + send = TRUE; + XFree (data); + } + else + { + /* OK, we're all set, now let's find some windows to send this to */ + if (!XQueryTree (GDK_DISPLAY_XDISPLAY (display), xid, + &ret_root, &ret_parent, + &ret_children, &ret_nchildren)) + goto out; + + for(i = 0; i < ret_nchildren; i++) + if (gdk_event_send_client_message_to_all_recurse (display, xev, ret_children[i], level + 1)) + found = TRUE; + + XFree (ret_children); + } + + if (send || (!found && (level == 1))) + { + xev->xclient.window = xid; + _gdk_send_xevent (display, xid, False, NoEventMask, xev); + } + + result = send || found; + + out: + gdk_error_trap_pop (); + + return result; +} + +/** + * gdk_screen_broadcast_client_message: + * @screen: the #GdkScreen where the event will be broadcasted. + * @event: the #GdkEvent. + * + * On X11, sends an X ClientMessage event to all toplevel windows on + * @screen. + * + * Toplevel windows are determined by checking for the WM_STATE property, + * as described in the Inter-Client Communication Conventions Manual (ICCCM). + * If no windows are found with the WM_STATE property set, the message is + * sent to all children of the root window. + * + * On Windows, broadcasts a message registered with the name + * GDK_WIN32_CLIENT_MESSAGE to all top-level windows. The amount of + * data is limited to one long, i.e. four bytes. + * + * Since: 2.2 + */ + +void +gdk_screen_broadcast_client_message (GdkScreen *screen, + GdkEvent *event) +{ + XEvent sev; + GdkWindow *root_window; + + g_return_if_fail (event != NULL); + + root_window = gdk_screen_get_root_window (screen); + + /* Set up our event to send, with the exception of its target window */ + sev.xclient.type = ClientMessage; + sev.xclient.display = GDK_WINDOW_XDISPLAY (root_window); + sev.xclient.format = event->client.data_format; + memcpy(&sev.xclient.data, &event->client.data, sizeof (sev.xclient.data)); + sev.xclient.message_type = + gdk_x11_atom_to_xatom_for_display (GDK_WINDOW_DISPLAY (root_window), + event->client.message_type); + + gdk_event_send_client_message_to_all_recurse (gdk_screen_get_display (screen), + &sev, + GDK_WINDOW_XID (root_window), + 0); +} + +static gboolean +check_transform (const gchar *xsettings_name, + GType src_type, + GType dest_type) +{ + if (!g_value_type_transformable (src_type, dest_type)) + { + g_warning ("Cannot transform xsetting %s of type %s to type %s\n", + xsettings_name, + g_type_name (src_type), + g_type_name (dest_type)); + return FALSE; + } + else + return TRUE; +} + +/** + * gdk_screen_get_setting: + * @screen: the #GdkScreen where the setting is located + * @name: the name of the setting + * @value: location to store the value of the setting + * + * Retrieves a desktop-wide setting such as double-click time + * for the #GdkScreen @screen. + * + * FIXME needs a list of valid settings here, or a link to + * more information. + * + * Returns: %TRUE if the setting existed and a value was stored + * in @value, %FALSE otherwise. + * + * Since: 2.2 + **/ +gboolean +gdk_screen_get_setting (GdkScreen *screen, + const gchar *name, + GValue *value) +{ + + const char *xsettings_name = NULL; + XSettingsResult result; + XSettingsSetting *setting = NULL; + GdkScreenX11 *screen_x11; + gboolean success = FALSE; + gint i; + GValue tmp_val = { 0, }; + + g_return_val_if_fail (GDK_IS_SCREEN (screen), FALSE); + + screen_x11 = GDK_SCREEN_X11 (screen); + + for (i = 0; i < GDK_SETTINGS_N_ELEMENTS(); i++) + if (strcmp (GDK_SETTINGS_GDK_NAME (i), name) == 0) + { + xsettings_name = GDK_SETTINGS_X_NAME (i); + break; + } + + if (!xsettings_name) + goto out; + + result = xsettings_client_get_setting (screen_x11->xsettings_client, + xsettings_name, &setting); + if (result != XSETTINGS_SUCCESS) + goto out; + + switch (setting->type) + { + case XSETTINGS_TYPE_INT: + if (check_transform (xsettings_name, G_TYPE_INT, G_VALUE_TYPE (value))) + { + g_value_init (&tmp_val, G_TYPE_INT); + g_value_set_int (&tmp_val, setting->data.v_int); + g_value_transform (&tmp_val, value); + + success = TRUE; + } + break; + case XSETTINGS_TYPE_STRING: + if (check_transform (xsettings_name, G_TYPE_STRING, G_VALUE_TYPE (value))) + { + g_value_init (&tmp_val, G_TYPE_STRING); + g_value_set_string (&tmp_val, setting->data.v_string); + g_value_transform (&tmp_val, value); + + success = TRUE; + } + break; + case XSETTINGS_TYPE_COLOR: + if (!check_transform (xsettings_name, GDK_TYPE_COLOR, G_VALUE_TYPE (value))) + { + GdkColor color; + + g_value_init (&tmp_val, GDK_TYPE_COLOR); + + color.pixel = 0; + color.red = setting->data.v_color.red; + color.green = setting->data.v_color.green; + color.blue = setting->data.v_color.blue; + + g_value_set_boxed (&tmp_val, &color); + + g_value_transform (&tmp_val, value); + + success = TRUE; + } + break; + } + + g_value_unset (&tmp_val); + + out: + if (setting) + xsettings_setting_free (setting); + + if (success) + return TRUE; + else + return _gdk_x11_get_xft_setting (screen, name, value); +} + +static void +cleanup_atoms(gpointer data) +{ + NetWmSupportedAtoms *supported_atoms = data; + if (supported_atoms->atoms) + XFree (supported_atoms->atoms); + g_free (supported_atoms); +} + +static void +fetch_net_wm_check_window (GdkScreen *screen) +{ + GdkScreenX11 *screen_x11; + GdkDisplay *display; + Atom type; + gint format; + gulong n_items; + gulong bytes_after; + guchar *data; + Window *xwindow; + GTimeVal tv; + gint error; + + screen_x11 = GDK_SCREEN_X11 (screen); + display = screen_x11->display; + + g_return_if_fail (GDK_DISPLAY_X11 (display)->trusted_client); + + g_get_current_time (&tv); + + if (ABS (tv.tv_sec - screen_x11->last_wmspec_check_time) < 15) + return; /* we've checked recently */ + + screen_x11->last_wmspec_check_time = tv.tv_sec; + + data = NULL; + XGetWindowProperty (screen_x11->xdisplay, screen_x11->xroot_window, + gdk_x11_get_xatom_by_name_for_display (display, "_NET_SUPPORTING_WM_CHECK"), + 0, G_MAXLONG, False, XA_WINDOW, &type, &format, + &n_items, &bytes_after, &data); + + if (type != XA_WINDOW) + { + if (data) + XFree (data); + return; + } + + xwindow = (Window *)data; + + if (screen_x11->wmspec_check_window == *xwindow) + { + XFree (xwindow); + return; + } + + gdk_error_trap_push (); + + /* Find out if this WM goes away, so we can reset everything. */ + XSelectInput (screen_x11->xdisplay, *xwindow, StructureNotifyMask); + gdk_display_sync (display); + + error = gdk_error_trap_pop (); + if (!error) + { + screen_x11->wmspec_check_window = *xwindow; + screen_x11->need_refetch_net_supported = TRUE; + screen_x11->need_refetch_wm_name = TRUE; + + /* Careful, reentrancy */ + _gdk_x11_screen_window_manager_changed (GDK_SCREEN (screen_x11)); + } + else if (error == BadWindow) + { + /* Leftover property, try again immediately, new wm may be starting up */ + screen_x11->last_wmspec_check_time = 0; + } + + XFree (xwindow); +} + +/** + * gdk_x11_screen_supports_net_wm_hint: + * @screen: the relevant #GdkScreen. + * @property: a property atom. + * + * This function is specific to the X11 backend of GDK, and indicates + * whether the window manager supports a certain hint from the + * Extended Window Manager Hints Specification. You can find this + * specification on + * http://www.freedesktop.org. + * + * When using this function, keep in mind that the window manager + * can change over time; so you shouldn't use this function in + * a way that impacts persistent application state. A common bug + * is that your application can start up before the window manager + * does when the user logs in, and before the window manager starts + * gdk_x11_screen_supports_net_wm_hint() will return %FALSE for every property. + * You can monitor the window_manager_changed signal on #GdkScreen to detect + * a window manager change. + * + * Return value: %TRUE if the window manager supports @property + * + * Since: 2.2 + **/ +gboolean +gdk_x11_screen_supports_net_wm_hint (GdkScreen *screen, + GdkAtom property) +{ + gulong i; + GdkScreenX11 *screen_x11; + NetWmSupportedAtoms *supported_atoms; + GdkDisplay *display; + + g_return_val_if_fail (GDK_IS_SCREEN (screen), FALSE); + + screen_x11 = GDK_SCREEN_X11 (screen); + display = screen_x11->display; + + if (!G_LIKELY (GDK_DISPLAY_X11 (display)->trusted_client)) + return FALSE; + + supported_atoms = g_object_get_data (G_OBJECT (screen), "gdk-net-wm-supported-atoms"); + if (!supported_atoms) + { + supported_atoms = g_new0 (NetWmSupportedAtoms, 1); + g_object_set_data_full (G_OBJECT (screen), "gdk-net-wm-supported-atoms", supported_atoms, cleanup_atoms); + } + + fetch_net_wm_check_window (screen); + + if (screen_x11->wmspec_check_window == None) + return FALSE; + + if (screen_x11->need_refetch_net_supported) + { + /* WM has changed since we last got the supported list, + * refetch it. + */ + Atom type; + gint format; + gulong bytes_after; + + screen_x11->need_refetch_net_supported = FALSE; + + if (supported_atoms->atoms) + XFree (supported_atoms->atoms); + + supported_atoms->atoms = NULL; + supported_atoms->n_atoms = 0; + + XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), screen_x11->xroot_window, + gdk_x11_get_xatom_by_name_for_display (display, "_NET_SUPPORTED"), + 0, G_MAXLONG, False, XA_ATOM, &type, &format, + &supported_atoms->n_atoms, &bytes_after, + (guchar **)&supported_atoms->atoms); + + if (type != XA_ATOM) + return FALSE; + } + + if (supported_atoms->atoms == NULL) + return FALSE; + + i = 0; + while (i < supported_atoms->n_atoms) + { + if (supported_atoms->atoms[i] == gdk_x11_atom_to_xatom_for_display (display, property)) + return TRUE; + + ++i; + } + + return FALSE; +} + +/** + * gdk_net_wm_supports: + * @property: a property atom. + * + * This function is specific to the X11 backend of GDK, and indicates + * whether the window manager for the default screen supports a certain + * hint from the Extended Window Manager Hints Specification. See + * gdk_x11_screen_supports_net_wm_hint() for complete details. + * + * Return value: %TRUE if the window manager supports @property + **/ +gboolean +gdk_net_wm_supports (GdkAtom property) +{ + return gdk_x11_screen_supports_net_wm_hint (gdk_screen_get_default (), property); +} + +static void +refcounted_grab_server (Display *xdisplay) +{ + GdkDisplay *display = gdk_x11_lookup_xdisplay (xdisplay); + + gdk_x11_display_grab (display); +} + +static void +refcounted_ungrab_server (Display *xdisplay) +{ + GdkDisplay *display = gdk_x11_lookup_xdisplay (xdisplay); + + gdk_x11_display_ungrab (display); +} + +static GdkFilterReturn +gdk_xsettings_client_event_filter (GdkXEvent *xevent, + GdkEvent *event, + gpointer data) +{ + GdkScreenX11 *screen = data; + + if (xsettings_client_process_event (screen->xsettings_client, (XEvent *)xevent)) + return GDK_FILTER_REMOVE; + else + return GDK_FILTER_CONTINUE; +} + +static Bool +gdk_xsettings_watch_cb (Window window, + Bool is_start, + long mask, + void *cb_data) +{ + GdkWindow *gdkwin; + GdkScreen *screen = cb_data; + + gdkwin = gdk_window_lookup_for_display (gdk_screen_get_display (screen), window); + + if (is_start) + { + if (gdkwin) + g_object_ref (gdkwin); + else + { + gdkwin = gdk_window_foreign_new_for_display (gdk_screen_get_display (screen), window); + + /* gdk_window_foreign_new_for_display() can fail and return NULL if the + * window has already been destroyed. + */ + if (!gdkwin) + return False; + } + + gdk_window_add_filter (gdkwin, gdk_xsettings_client_event_filter, screen); + } + else + { + if (!gdkwin) + { + /* gdkwin should not be NULL here, since if starting the watch succeeded + * we have a reference on the window. It might mean that the caller didn't + * remove the watch when it got a DestroyNotify event. Or maybe the + * caller ignored the return value when starting the watch failed. + */ + g_warning ("gdk_xsettings_watch_cb(): Couldn't find window to unwatch"); + return False; + } + + gdk_window_remove_filter (gdkwin, gdk_xsettings_client_event_filter, screen); + g_object_unref (gdkwin); + } + + return True; +} + +static void +gdk_xsettings_notify_cb (const char *name, + XSettingsAction action, + XSettingsSetting *setting, + void *data) +{ + GdkEvent new_event; + GdkScreen *screen = data; + GdkScreenX11 *screen_x11 = data; + int i; + + if (screen_x11->xsettings_in_init) + return; + + new_event.type = GDK_SETTING; + new_event.setting.window = gdk_screen_get_root_window (screen); + new_event.setting.send_event = FALSE; + new_event.setting.name = NULL; + + for (i = 0; i < GDK_SETTINGS_N_ELEMENTS() ; i++) + if (strcmp (GDK_SETTINGS_X_NAME (i), name) == 0) + { + new_event.setting.name = (char*) GDK_SETTINGS_GDK_NAME (i); + break; + } + + if (!new_event.setting.name) + return; + + switch (action) + { + case XSETTINGS_ACTION_NEW: + new_event.setting.action = GDK_SETTING_ACTION_NEW; + break; + case XSETTINGS_ACTION_CHANGED: + new_event.setting.action = GDK_SETTING_ACTION_CHANGED; + break; + case XSETTINGS_ACTION_DELETED: + new_event.setting.action = GDK_SETTING_ACTION_DELETED; + break; + } + + gdk_event_put (&new_event); +} + +void +_gdk_screen_x11_events_init (GdkScreen *screen) +{ + GdkScreenX11 *screen_x11 = GDK_SCREEN_X11 (screen); + + /* Keep a flag to avoid extra notifies that we don't need + */ + screen_x11->xsettings_in_init = TRUE; + screen_x11->xsettings_client = xsettings_client_new_with_grab_funcs (screen_x11->xdisplay, + screen_x11->screen_num, + gdk_xsettings_notify_cb, + gdk_xsettings_watch_cb, + screen, + refcounted_grab_server, + refcounted_ungrab_server); + screen_x11->xsettings_in_init = FALSE; +} + +/** + * gdk_x11_screen_get_window_manager_name: + * @screen: a #GdkScreen + * + * Returns the name of the window manager for @screen. + * + * Return value: the name of the window manager screen @screen, or + * "unknown" if the window manager is unknown. The string is owned by GDK + * and should not be freed. + * + * Since: 2.2 + **/ +const char* +gdk_x11_screen_get_window_manager_name (GdkScreen *screen) +{ + GdkScreenX11 *screen_x11; + + screen_x11 = GDK_SCREEN_X11 (screen); + + if (!G_LIKELY (GDK_DISPLAY_X11 (screen_x11->display)->trusted_client)) + return screen_x11->window_manager_name; + + fetch_net_wm_check_window (screen); + + if (screen_x11->need_refetch_wm_name) + { + /* Get the name of the window manager */ + screen_x11->need_refetch_wm_name = FALSE; + + g_free (screen_x11->window_manager_name); + screen_x11->window_manager_name = g_strdup ("unknown"); + + if (screen_x11->wmspec_check_window != None) + { + Atom type; + gint format; + gulong n_items; + gulong bytes_after; + gchar *name; + + name = NULL; + + gdk_error_trap_push (); + + XGetWindowProperty (GDK_DISPLAY_XDISPLAY (screen_x11->display), + screen_x11->wmspec_check_window, + gdk_x11_get_xatom_by_name_for_display (screen_x11->display, + "_NET_WM_NAME"), + 0, G_MAXLONG, False, + gdk_x11_get_xatom_by_name_for_display (screen_x11->display, + "UTF8_STRING"), + &type, &format, + &n_items, &bytes_after, + (guchar **)&name); + + gdk_display_sync (screen_x11->display); + + gdk_error_trap_pop (); + + if (name != NULL) + { + g_free (screen_x11->window_manager_name); + screen_x11->window_manager_name = g_strdup (name); + XFree (name); + } + } + } + + return GDK_SCREEN_X11 (screen)->window_manager_name; +} + #define __GDK_SCREEN_X11_C__ #include "gdkaliasdef.c" diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c index 183779bbb7..7c6c2c3e24 100644 --- a/gdk/x11/gdkwindow-x11.c +++ b/gdk/x11/gdkwindow-x11.c @@ -39,17 +39,19 @@ #include #include "gdk.h" +#include "gdkx.h" #include "gdkwindow.h" #include "gdkwindowimpl.h" #include "gdkasync.h" -#include "gdkinputprivate.h" #include "gdkdisplay-x11.h" #include "gdkprivate-x11.h" #include "gdkregion.h" #include "gdkinternals.h" #include "MwmUtil.h" #include "gdkwindow-x11.h" +#include "gdkdeviceprivate.h" +#include "gdkeventsource.h" #include "gdkalias.h" #include @@ -146,6 +148,8 @@ static void gdk_window_impl_x11_init (GdkWindowImplX11 *impl) { impl->toplevel_window_type = -1; + impl->device_cursor = g_hash_table_new_full (NULL, NULL, NULL, + (GDestroyNotify) gdk_cursor_unref); } GdkToplevelX11 * @@ -210,6 +214,8 @@ gdk_window_impl_x11_finalize (GObject *object) if (window_impl->cursor) gdk_cursor_unref (window_impl->cursor); + g_hash_table_destroy (window_impl->device_cursor); + G_OBJECT_CLASS (gdk_window_impl_x11_parent_class)->finalize (object); } @@ -510,18 +516,31 @@ check_leader_window_title (GdkDisplay *display) } static Window -create_focus_window (Display *xdisplay, - XID parent) +create_focus_window (GdkDisplay *display, + XID parent) { - Window focus_window = XCreateSimpleWindow (xdisplay, parent, - -1, -1, 1, 1, 0, - 0, 0); - + GdkDisplayX11 *display_x11; + GdkEventMask event_mask; + Display *xdisplay; + Window focus_window; + + xdisplay = GDK_DISPLAY_XDISPLAY (display); + display_x11 = GDK_DISPLAY_X11 (display); + + focus_window = XCreateSimpleWindow (xdisplay, parent, + -1, -1, 1, 1, 0, + 0, 0); + /* FIXME: probably better to actually track the requested event mask for the toplevel */ - XSelectInput (xdisplay, focus_window, - KeyPressMask | KeyReleaseMask | FocusChangeMask); - + event_mask = (GDK_KEY_PRESS_MASK | + GDK_KEY_RELEASE_MASK | + GDK_FOCUS_CHANGE_MASK); + + gdk_event_source_select_events ((GdkEventSource *) display_x11->event_source, + focus_window, + event_mask, 0); + XMapWindow (xdisplay, focus_window); return focus_window; @@ -570,6 +589,7 @@ setup_toplevel_window (GdkWindow *window, { GdkWindowObject *obj = (GdkWindowObject *)window; GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (window); + GdkDisplay *display = gdk_drawable_get_display (window); Display *xdisplay = GDK_WINDOW_XDISPLAY (window); XID xid = GDK_WINDOW_XID (window); XID xparent = GDK_WINDOW_XID (parent); @@ -588,7 +608,7 @@ setup_toplevel_window (GdkWindow *window, /* The focus window is off the visible area, and serves to receive key * press events so they don't get sent to child windows. */ - toplevel->focus_window = create_focus_window (xdisplay, xid); + toplevel->focus_window = create_focus_window (display, xid); _gdk_xid_table_insert (screen_x11->display, &toplevel->focus_window, window); } @@ -649,6 +669,7 @@ _gdk_window_impl_new (GdkWindow *window, GdkWindowImplX11 *impl; GdkDrawableImplX11 *draw_impl; GdkScreenX11 *screen_x11; + GdkDisplayX11 *display_x11; Window xparent; Visual *xvisual; @@ -661,12 +682,12 @@ _gdk_window_impl_new (GdkWindow *window, unsigned int class; const char *title; - int i; private = (GdkWindowObject *) window; screen_x11 = GDK_SCREEN_X11 (screen); xparent = GDK_WINDOW_XID (real_parent); + display_x11 = GDK_DISPLAY_X11 (GDK_SCREEN_DISPLAY (screen)); impl = g_object_new (_gdk_window_impl_get_type (), NULL); private->impl = (GdkDrawable *)impl; @@ -680,15 +701,6 @@ _gdk_window_impl_new (GdkWindow *window, xvisual = ((GdkVisualPrivate*) visual)->xvisual; - xattributes.event_mask = StructureNotifyMask | PropertyChangeMask; - for (i = 0; i < _gdk_nenvent_masks; i++) - { - if (event_mask & (1 << (i + 1))) - xattributes.event_mask |= _gdk_event_mask_table[i]; - } - if (xattributes.event_mask) - xattributes_mask |= CWEventMask; - if (attributes_mask & GDK_WA_NOREDIR) { xattributes.override_redirect = @@ -834,6 +846,10 @@ _gdk_window_impl_new (GdkWindow *window, if (attributes_mask & GDK_WA_TYPE_HINT) gdk_window_set_type_hint (window, attributes->type_hint); + + gdk_event_source_select_events ((GdkEventSource *) display_x11->event_source, + GDK_WINDOW_XWINDOW (window), event_mask, + StructureNotifyMask | PropertyChangeMask); } static GdkEventMask @@ -1874,72 +1890,6 @@ gdk_window_focus (GdkWindow *window, } } -/** - * gdk_window_set_hints: - * @window: a #GdkWindow - * @x: ignored field, does not matter - * @y: ignored field, does not matter - * @min_width: minimum width hint - * @min_height: minimum height hint - * @max_width: max width hint - * @max_height: max height hint - * @flags: logical OR of GDK_HINT_POS, GDK_HINT_MIN_SIZE, and/or GDK_HINT_MAX_SIZE - * - * This function is broken and useless and you should ignore it. - * If using GTK+, use functions such as gtk_window_resize(), gtk_window_set_size_request(), - * gtk_window_move(), gtk_window_parse_geometry(), and gtk_window_set_geometry_hints(), - * depending on what you're trying to do. - * - * If using GDK directly, use gdk_window_set_geometry_hints(). - * - **/ -void -gdk_window_set_hints (GdkWindow *window, - gint x, - gint y, - gint min_width, - gint min_height, - gint max_width, - gint max_height, - gint flags) -{ - XSizeHints size_hints; - - if (GDK_WINDOW_DESTROYED (window) || - !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) - return; - - size_hints.flags = 0; - - if (flags & GDK_HINT_POS) - { - size_hints.flags |= PPosition; - size_hints.x = x; - size_hints.y = y; - } - - if (flags & GDK_HINT_MIN_SIZE) - { - size_hints.flags |= PMinSize; - size_hints.min_width = min_width; - size_hints.min_height = min_height; - } - - if (flags & GDK_HINT_MAX_SIZE) - { - size_hints.flags |= PMaxSize; - size_hints.max_width = max_width; - size_hints.max_height = max_height; - } - - /* FIXME: Would it be better to delete this property if - * flags == 0? It would save space on the server - */ - XSetWMNormalHints (GDK_WINDOW_XDISPLAY (window), - GDK_WINDOW_XID (window), - &size_hints); -} - /** * gdk_window_set_type_hint: * @window: A toplevel #GdkWindow @@ -2710,41 +2660,30 @@ gdk_window_x11_set_back_pixmap (GdkWindow *window, } static void -gdk_window_x11_set_cursor (GdkWindow *window, - GdkCursor *cursor) +gdk_window_x11_set_device_cursor (GdkWindow *window, + GdkDevice *device, + GdkCursor *cursor) { GdkWindowObject *private; GdkWindowImplX11 *impl; - GdkCursorPrivate *cursor_private; - Cursor xcursor; - - private = (GdkWindowObject *)window; - impl = GDK_WINDOW_IMPL_X11 (private->impl); - cursor_private = (GdkCursorPrivate*) cursor; - if (impl->cursor) - { - gdk_cursor_unref (impl->cursor); - impl->cursor = NULL; - } + g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_DEVICE (device)); + + private = (GdkWindowObject *) window; + impl = GDK_WINDOW_IMPL_X11 (private->impl); if (!cursor) - xcursor = None; + g_hash_table_remove (impl->device_cursor, device); else { _gdk_x11_cursor_update_theme (cursor); - xcursor = cursor_private->xcursor; + g_hash_table_replace (impl->device_cursor, + device, gdk_cursor_ref (cursor)); } - + if (!GDK_WINDOW_DESTROYED (window)) - { - XDefineCursor (GDK_WINDOW_XDISPLAY (window), - GDK_WINDOW_XID (window), - xcursor); - - if (cursor) - impl->cursor = gdk_cursor_ref (cursor); - } + GDK_DEVICE_GET_CLASS (device)->set_window_cursor (device, window, cursor); } GdkCursor * @@ -3071,106 +3010,112 @@ gdk_window_get_frame_extents (GdkWindow *window, } void -_gdk_windowing_get_pointer (GdkDisplay *display, - GdkScreen **screen, - gint *x, - gint *y, - GdkModifierType *mask) +_gdk_windowing_get_device_state (GdkDisplay *display, + GdkDevice *device, + GdkScreen **screen, + gint *x, + gint *y, + GdkModifierType *mask) { GdkScreen *default_screen; - Display *xdisplay; - Window xwindow; - Window root = None; - Window child; - int rootx, rooty; - int winx; - int winy; - unsigned int xmask; if (display->closed) return; default_screen = gdk_display_get_default_screen (display); - xdisplay = GDK_SCREEN_XDISPLAY (default_screen); - xwindow = GDK_SCREEN_XROOTWIN (default_screen); - - if (G_LIKELY (GDK_DISPLAY_X11 (display)->trusted_client)) + + if (G_LIKELY (GDK_DISPLAY_X11 (display)->trusted_client)) { - XQueryPointer (xdisplay, xwindow, - &root, &child, &rootx, &rooty, &winx, &winy, &xmask); - } - else + GdkWindow *root; + + GDK_DEVICE_GET_CLASS (device)->query_state (device, + gdk_screen_get_root_window (default_screen), + &root, NULL, + x, y, + NULL, NULL, + mask); + *screen = gdk_drawable_get_screen (root); + } + else { XSetWindowAttributes attributes; - Window w; - - w = XCreateWindow (xdisplay, xwindow, 0, 0, 1, 1, 0, - CopyFromParent, InputOnly, CopyFromParent, + Display *xdisplay; + Window xwindow, w, root, child; + int rootx, rooty, winx, winy; + unsigned int xmask; + + /* FIXME: untrusted clients not multidevice-safe */ + + xdisplay = GDK_SCREEN_XDISPLAY (default_screen); + xwindow = GDK_SCREEN_XROOTWIN (default_screen); + + w = XCreateWindow (xdisplay, xwindow, 0, 0, 1, 1, 0, + CopyFromParent, InputOnly, CopyFromParent, 0, &attributes); - XQueryPointer (xdisplay, w, + XQueryPointer (xdisplay, w, &root, &child, &rootx, &rooty, &winx, &winy, &xmask); XDestroyWindow (xdisplay, w); + + if (root != None) + { + GdkWindow *gdk_root = gdk_window_lookup_for_display (display, root); + *screen = gdk_drawable_get_screen (gdk_root); + } + + *x = rootx; + *y = rooty; + *mask = xmask; } - - if (root != None) - { - GdkWindow *gdk_root = gdk_window_lookup_for_display (display, root); - *screen = gdk_drawable_get_screen (gdk_root); - } - - *x = rootx; - *y = rooty; - *mask = xmask; } static gboolean -gdk_window_x11_get_pointer (GdkWindow *window, - gint *x, - gint *y, - GdkModifierType *mask) +gdk_window_x11_get_device_state (GdkWindow *window, + GdkDevice *device, + gint *x, + gint *y, + GdkModifierType *mask) { GdkDisplay *display = GDK_WINDOW_DISPLAY (window); gboolean return_val; - Window root; - Window child; - int rootx, rooty; - int winx = 0; - int winy = 0; - unsigned int xmask = 0; g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), FALSE); - return_val = TRUE; + if (!GDK_WINDOW_DESTROYED (window)) { if (G_LIKELY (GDK_DISPLAY_X11 (display)->trusted_client)) { - if (XQueryPointer (GDK_WINDOW_XDISPLAY (window), - GDK_WINDOW_XID (window), - &root, &child, &rootx, &rooty, &winx, &winy, &xmask)) - { - if (child) - return_val = gdk_window_lookup_for_display (GDK_WINDOW_DISPLAY (window), child) != NULL; - } + GdkWindow *child; + + GDK_DEVICE_GET_CLASS (device)->query_state (device, window, + NULL, &child, + NULL, NULL, + x, y, mask); + return_val = (child != NULL); } else { GdkScreen *screen; int originx, originy; - _gdk_windowing_get_pointer (gdk_drawable_get_display (window), &screen, - &rootx, &rooty, &xmask); + int rootx, rooty; + int winx = 0; + int winy = 0; + unsigned int xmask = 0; + + _gdk_windowing_get_device_state (gdk_drawable_get_display (window), device, + &screen, &rootx, &rooty, &xmask); gdk_window_get_origin (window, &originx, &originy); winx = rootx - originx; winy = rooty - originy; + + *x = winx; + *y = winy; + *mask = xmask; } } - *x = winx; - *y = winy; - *mask = xmask; - return return_val; } @@ -3194,6 +3139,8 @@ gdk_window_x11_get_pointer (GdkWindow *window, * for the color picker in the #GtkColorSelectionDialog. * * Since: 2.8 + * + * Deprecated: 3.0: Use gdk_display_warp_device() instead. */ void gdk_display_warp_pointer (GdkDisplay *display, @@ -3201,37 +3148,64 @@ gdk_display_warp_pointer (GdkDisplay *display, gint x, gint y) { - Display *xdisplay; - Window dest; + GdkDevice *device; - xdisplay = GDK_DISPLAY_XDISPLAY (display); - dest = GDK_WINDOW_XWINDOW (gdk_screen_get_root_window (screen)); + g_return_if_fail (GDK_IS_DISPLAY (display)); + g_return_if_fail (GDK_IS_SCREEN (screen)); - XWarpPointer (xdisplay, None, dest, 0, 0, 0, 0, x, y); + device = display->core_pointer; + GDK_DEVICE_GET_CLASS (device)->warp (device, screen, x, y); +} + +/** + * gdk_display_warp_device: + * @display: a #GdkDisplay. + * @device: a #GdkDevice. + * @screen: the screen of @display to warp @device to. + * @x: the X coordinate of the destination. + * @y: the Y coordinate of the destination. + * + * Warps @device in @display to the point @x,@y on + * the screen @screen, unless the device is confined + * to a window by a grab, in which case it will be moved + * as far as allowed by the grab. Warping the pointer + * creates events as if the user had moved the mouse + * instantaneously to the destination. + * + * Note that the pointer should normally be under the + * control of the user. This function was added to cover + * some rare use cases like keyboard navigation support + * for the color picker in the #GtkColorSelectionDialog. + * + * Since: 3.0 + **/ +void +gdk_display_warp_device (GdkDisplay *display, + GdkDevice *device, + GdkScreen *screen, + gint x, + gint y) +{ + g_return_if_fail (GDK_IS_DISPLAY (display)); + g_return_if_fail (GDK_IS_DEVICE (device)); + g_return_if_fail (GDK_IS_SCREEN (screen)); + g_return_if_fail (display == gdk_device_get_display (device)); + + GDK_DEVICE_GET_CLASS (device)->warp (device, screen, x, y); } GdkWindow* -_gdk_windowing_window_at_pointer (GdkDisplay *display, - gint *win_x, - gint *win_y, - GdkModifierType *mask, - gboolean get_toplevel) +_gdk_windowing_window_at_device_position (GdkDisplay *display, + GdkDevice *device, + gint *win_x, + gint *win_y, + GdkModifierType *mask, + gboolean get_toplevel) { GdkWindow *window; GdkScreen *screen; - Window root; - Window xwindow; - Window child; - Window xwindow_last = 0; - Display *xdisplay; - int rootx = -1, rooty = -1; - int winx, winy; - unsigned int xmask; screen = gdk_display_get_default_screen (display); - - xwindow = GDK_SCREEN_XROOTWIN (screen); - xdisplay = GDK_SCREEN_XDISPLAY (screen); /* This function really only works if the mouse pointer is held still * during its operation. If it moves from one leaf window to another @@ -3239,35 +3213,24 @@ _gdk_windowing_window_at_pointer (GdkDisplay *display, * and the result. */ gdk_x11_display_grab (display); - if (G_LIKELY (GDK_DISPLAY_X11 (display)->trusted_client)) - { - XQueryPointer (xdisplay, xwindow, - &root, &child, &rootx, &rooty, &winx, &winy, &xmask); - if (root == xwindow) - xwindow = child; - else - xwindow = root; - - while (xwindow) - { - xwindow_last = xwindow; - XQueryPointer (xdisplay, xwindow, - &root, &xwindow, &rootx, &rooty, &winx, &winy, &xmask); - if (get_toplevel && xwindow_last != root && - (window = gdk_window_lookup_for_display (display, xwindow_last)) != NULL && - GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN) - { - xwindow = xwindow_last; - break; - } - } - } - else + if (G_LIKELY (GDK_DISPLAY_X11 (display)->trusted_client)) + window = GDK_DEVICE_GET_CLASS (device)->window_at_position (device, win_x, win_y, mask, get_toplevel); + else { gint i, screens, width, height; GList *toplevels, *list; - Window pointer_window; - + Window pointer_window, root, xwindow, child; + Window xwindow_last = 0; + Display *xdisplay; + int rootx = -1, rooty = -1; + int winx, winy; + unsigned int xmask; + + /* FIXME: untrusted clients case not multidevice-safe */ + + xwindow = GDK_SCREEN_XROOTWIN (screen); + xdisplay = GDK_SCREEN_XDISPLAY (screen); + pointer_window = None; screens = gdk_display_get_n_screens (display); for (i = 0; i < screens; ++i) { @@ -3328,16 +3291,17 @@ _gdk_windowing_window_at_pointer (GdkDisplay *display, GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN) break; } + + window = gdk_window_lookup_for_display (display, xwindow_last); + + *win_x = window ? winx : -1; + *win_y = window ? winy : -1; + if (mask) + *mask = xmask; } - + gdk_x11_display_ungrab (display); - window = gdk_window_lookup_for_display (display, xwindow_last); - *win_x = window ? winx : -1; - *win_y = window ? winy : -1; - if (mask) - *mask = xmask; - return window; } @@ -3368,21 +3332,18 @@ gdk_window_x11_set_events (GdkWindow *window, GdkEventMask event_mask) { long xevent_mask = 0; - int i; if (!GDK_WINDOW_DESTROYED (window)) { + GdkDisplayX11 *display_x11; + if (GDK_WINDOW_XID (window) != GDK_WINDOW_XROOTWIN (window)) xevent_mask = StructureNotifyMask | PropertyChangeMask; - for (i = 0; i < _gdk_nenvent_masks; i++) - { - if (event_mask & (1 << (i + 1))) - xevent_mask |= _gdk_event_mask_table[i]; - } - - XSelectInput (GDK_WINDOW_XDISPLAY (window), - GDK_WINDOW_XID (window), - xevent_mask); + + display_x11 = GDK_DISPLAY_X11 (gdk_drawable_get_display (window)); + gdk_event_source_select_events ((GdkEventSource *) display_x11->event_source, + GDK_WINDOW_XWINDOW (window), event_mask, + xevent_mask); } } @@ -4519,8 +4480,10 @@ gdk_window_set_decorations (GdkWindow *window, * @window: The toplevel #GdkWindow to get the decorations from * @decorations: The window decorations will be written here * - * Returns the decorations set on the GdkWindow with #gdk_window_set_decorations - * Returns: TRUE if the window has decorations set, FALSE otherwise. + * Returns the decorations set on the GdkWindow with + * gdk_window_set_decorations(). + * + * Returns: %TRUE if the window has decorations set, %FALSE otherwise. **/ gboolean gdk_window_get_decorations(GdkWindow *window, @@ -4646,7 +4609,7 @@ _gdk_windowing_get_shape_for_mask (GdkBitmap *mask) display = gdk_drawable_get_display (GDK_DRAWABLE (mask)); window = XCreateSimpleWindow (GDK_DISPLAY_XDISPLAY (display), - GDK_SCREEN_XROOTWIN (gdk_display_get_default_screen (display)), + GDK_SCREEN_XROOTWIN (gdk_drawable_get_screen (mask)), -1, -1, 1, 1, 0, 0, 0); XShapeCombineMask (GDK_DISPLAY_XDISPLAY (display), @@ -5590,10 +5553,10 @@ gdk_window_impl_iface_init (GdkWindowImplIface *iface) iface->set_back_pixmap = gdk_window_x11_set_back_pixmap; iface->reparent = gdk_window_x11_reparent; iface->clear_region = gdk_window_x11_clear_region; - iface->set_cursor = gdk_window_x11_set_cursor; + iface->set_device_cursor = gdk_window_x11_set_device_cursor; iface->get_geometry = gdk_window_x11_get_geometry; iface->get_root_coords = gdk_window_x11_get_root_coords; - iface->get_pointer = gdk_window_x11_get_pointer; + iface->get_device_state = gdk_window_x11_get_device_state; iface->get_deskrelative_origin = gdk_window_x11_get_deskrelative_origin; iface->shape_combine_region = gdk_window_x11_shape_combine_region; iface->input_shape_combine_region = gdk_window_x11_input_shape_combine_region; @@ -5601,10 +5564,63 @@ gdk_window_impl_iface_init (GdkWindowImplIface *iface) iface->queue_antiexpose = _gdk_x11_window_queue_antiexpose; iface->queue_translation = _gdk_x11_window_queue_translation; iface->destroy = _gdk_x11_window_destroy; - iface->input_window_destroy = _gdk_input_window_destroy; - iface->input_window_crossing = _gdk_input_crossing_event; iface->supports_native_bg = TRUE; } +static Bool +timestamp_predicate (Display *display, + XEvent *xevent, + XPointer arg) +{ + Window xwindow = GPOINTER_TO_UINT (arg); + GdkDisplay *gdk_display = gdk_x11_lookup_xdisplay (display); + + if (xevent->type == PropertyNotify && + xevent->xproperty.window == xwindow && + xevent->xproperty.atom == gdk_x11_get_xatom_by_name_for_display (gdk_display, + "GDK_TIMESTAMP_PROP")) + return True; + + return False; +} + +/** + * gdk_x11_get_server_time: + * @window: a #GdkWindow, used for communication with the server. + * The window must have GDK_PROPERTY_CHANGE_MASK in its + * events mask or a hang will result. + * + * Routine to get the current X server time stamp. + * + * Return value: the time stamp. + **/ +guint32 +gdk_x11_get_server_time (GdkWindow *window) +{ + Display *xdisplay; + Window xwindow; + guchar c = 'a'; + XEvent xevent; + Atom timestamp_prop_atom; + + g_return_val_if_fail (GDK_IS_WINDOW (window), 0); + g_return_val_if_fail (!GDK_WINDOW_DESTROYED (window), 0); + + xdisplay = GDK_WINDOW_XDISPLAY (window); + xwindow = GDK_WINDOW_XWINDOW (window); + timestamp_prop_atom = + gdk_x11_get_xatom_by_name_for_display (GDK_WINDOW_DISPLAY (window), + "GDK_TIMESTAMP_PROP"); + + XChangeProperty (xdisplay, xwindow, timestamp_prop_atom, + timestamp_prop_atom, + 8, PropModeReplace, &c, 1); + + XIfEvent (xdisplay, &xevent, + timestamp_predicate, GUINT_TO_POINTER(xwindow)); + + return xevent.xproperty.time; +} + #define __GDK_WINDOW_X11_C__ #include "gdkaliasdef.c" diff --git a/gdk/x11/gdkwindow-x11.h b/gdk/x11/gdkwindow-x11.h index 9a7f2aed35..762f1044a2 100644 --- a/gdk/x11/gdkwindow-x11.h +++ b/gdk/x11/gdkwindow-x11.h @@ -60,6 +60,8 @@ struct _GdkWindowImplX11 GdkToplevelX11 *toplevel; /* Toplevel-specific information */ GdkCursor *cursor; + GHashTable *device_cursor; + gint8 toplevel_window_type; guint no_bg : 1; /* Set when the window background is temporarily * unset during resizing and scaling */ diff --git a/gdk/x11/gdkx.h b/gdk/x11/gdkx.h index d8aa42c843..c56d462996 100644 --- a/gdk/x11/gdkx.h +++ b/gdk/x11/gdkx.h @@ -129,11 +129,6 @@ GdkVisual* gdk_x11_screen_lookup_visual (GdkScreen *screen, GdkVisual* gdkx_visual_get (VisualID xvisualid); #endif -#ifdef GDK_ENABLE_BROKEN -/* XXX: An X Colormap is useless unless we also have the visual. */ -GdkColormap* gdkx_colormap_get (Colormap xcolormap); -#endif - GdkColormap *gdk_x11_colormap_foreign_new (GdkVisual *visual, Colormap xcolormap); diff --git a/gtk+-2.0-uninstalled.pc.in b/gtk+-3.0-uninstalled.pc.in similarity index 84% rename from gtk+-2.0-uninstalled.pc.in rename to gtk+-3.0-uninstalled.pc.in index d89c856da6..238ad6ff9e 100644 --- a/gtk+-2.0-uninstalled.pc.in +++ b/gtk+-3.0-uninstalled.pc.in @@ -5,6 +5,6 @@ gtk_binary_version=@GTK_BINARY_VERSION@ Name: GTK+ Uninstalled Description: GTK+ Graphical UI Library (${target} target), Not Installed Version: @VERSION@ -Requires: gdk-${target}-2.0-uninstalled @GTK_PACKAGES@ +Requires: gdk-${target}-@GTK_API_VERSION@-uninstalled @GTK_PACKAGES@ Libs: ${pc_top_builddir}/${pcfiledir}/gtk/libgtk-${target}-@GTK_API_VERSION@.la @GTK_EXTRA_LIBS@ Cflags: -I${pc_top_builddir}/${pcfiledir}/@srcdir@ -I${pc_top_builddir}/${pcfiledir} @GTK_EXTRA_CFLAGS@ diff --git a/gtk+-2.0.pc.in b/gtk+-3.0.pc.in similarity index 72% rename from gtk+-2.0.pc.in rename to gtk+-3.0.pc.in index 46853e1078..c159af1260 100644 --- a/gtk+-2.0.pc.in +++ b/gtk+-3.0.pc.in @@ -10,6 +10,6 @@ gtk_host=@host@ Name: GTK+ Description: GTK+ Graphical UI Library (${target} target) Version: @VERSION@ -Requires: gdk-${target}-2.0 @GTK_PACKAGES@ +Requires: gdk-${target}-@GTK_API_VERSION@ @GTK_PACKAGES@ Libs: -L${libdir} -lgtk-${target}-@GTK_API_VERSION@ @GTK_EXTRA_LIBS@ -Cflags: -I${includedir}/gtk-2.0 @GTK_EXTRA_CFLAGS@ +Cflags: -I${includedir}/gtk-@GTK_API_VERSION@ @GTK_EXTRA_CFLAGS@ diff --git a/gtk+-unix-print-2.0.pc.in b/gtk+-unix-print-3.0.pc.in similarity index 66% rename from gtk+-unix-print-2.0.pc.in rename to gtk+-unix-print-3.0.pc.in index a0fe8f0339..5b8462a209 100644 --- a/gtk+-unix-print-2.0.pc.in +++ b/gtk+-unix-print-3.0.pc.in @@ -10,5 +10,5 @@ gtk_host=@host@ Name: GTK+ Description: GTK+ Unix print support Version: @VERSION@ -Requires: gtk+-${target}-2.0 @GTK_PACKAGES@ -Cflags: -I${includedir}/gtk-unix-print-2.0 +Requires: gtk+-${target}-@GTK_API_VERSION@ @GTK_PACKAGES@ +Cflags: -I${includedir}/gtk-@GTK_API_VERSION@/unix-print diff --git a/gtk-zip.sh.in b/gtk-zip.sh.in index 68db202074..5bf2ecff71 100755 --- a/gtk-zip.sh.in +++ b/gtk-zip.sh.in @@ -4,6 +4,10 @@ ZIP=/tmp/gtk+-@GTK_VERSION@.zip DEVZIP=/tmp/gtk+-dev-@GTK_VERSION@.zip + +SHORTAPIVERSION=`echo @GTK_API_VERSION@ | tr -d '.'` +APIVERSIONMAJOR=`echo @GTK_API_VERSION@ | sed -e 's/\..*//'` + cd @prefix@ mkdir -p share/doc/gtk+-@GTK_VERSION@ @@ -14,37 +18,37 @@ cp -p @abs_srcdir@/COPYING share/doc/gtk+-dev-@GTK_VERSION@ rm $ZIP zip $ZIP -@ < xgen-gmh \ - && $(GLIB_GENMARSHAL) --prefix=gtk_marshal $(srcdir)/gtkmarshal.list --header >> xgen-gmh \ - && echo "#endif /* GTK_DISABLE_DEPRECATED */" >> xgen-gmh \ - && (cmp -s xgen-gmh gtkmarshal.h || cp xgen-gmh gtkmarshal.h) \ - && rm -f xgen-gmh \ - && echo timestamp > $(@F) -gtkmarshal.c: @REBUILD@ gtkmarshal.list - (echo "#include \"gtkmarshal.h\""; \ - echo "#include \"gtkalias.h\""; \ - $(GLIB_GENMARSHAL) --prefix=gtk_marshal $(srcdir)/gtkmarshal.list --body; \ - echo "#define __gtk_marshal_MARSHAL_C__"; \ - echo "#include \"gtkaliasdef.c\"") >> xgen-gmc \ - && cp xgen-gmc gtkmarshal.c \ - && rm -f xgen-gmc - gtktypebuiltins.h: stamp-gtktypebuiltins.h @true stamp-gtktypebuiltins.h: @REBUILD@ $(gtk_public_h_sources) gtktypebuiltins.h.template @@ -897,48 +832,48 @@ gtktestutils.c: gtktypefuncs.c # target platform: lib_LTLIBRARIES = $(gtktargetlib) -gtkincludedir = $(includedir)/gtk-2.0/gtk +gtkincludedir = $(includedir)/gtk-3.0/gtk gtkinclude_HEADERS = $(gtk_public_h_sources) $(gtk_semi_private_h_sources) $(gtk_built_public_sources) gtkversion.h -gtkunixprintincludedir = $(includedir)/gtk-unix-print-2.0/gtk +gtkunixprintincludedir = $(includedir)/gtk-3.0/unix-print/gtk gtkunixprintinclude_HEADERS = $(gtk_unix_print_public_h_sources) -libgtk_x11_2_0_la_SOURCES = $(gtk_c_sources) -libgtk_win32_2_0_la_SOURCES = $(gtk_c_sources) -libgtk_quartz_2_0_la_SOURCES = $(gtk_c_sources) -libgtk_directfb_2_0_la_SOURCES = $(gtk_c_sources) +libgtk_x11_3_0_la_SOURCES = $(gtk_c_sources) +libgtk_win32_3_0_la_SOURCES = $(gtk_c_sources) +libgtk_quartz_3_0_la_SOURCES = $(gtk_c_sources) +libgtk_directfb_3_0_la_SOURCES = $(gtk_c_sources) -libgtk_x11_2_0_la_LDFLAGS = $(libtool_opts) -libgtk_win32_2_0_la_LDFLAGS = $(libtool_opts) -Wl,-luuid -libgtk_quartz_2_0_la_LDFLAGS = $(libtool_opts) -libgtk_directfb_2_0_la_LDFLAGS = $(libtool_opts) +libgtk_x11_3_0_la_LDFLAGS = $(libtool_opts) +libgtk_win32_3_0_la_LDFLAGS = $(libtool_opts) -Wl,-luuid +libgtk_quartz_3_0_la_LDFLAGS = $(libtool_opts) +libgtk_directfb_3_0_la_LDFLAGS = $(libtool_opts) -libgtk_x11_2_0_la_LIBADD = $(libadd) -libgtk_win32_2_0_la_LIBADD = $(libadd) -lole32 -lgdi32 -lcomdlg32 -lwinspool -lcomctl32 -libgtk_quartz_2_0_la_LIBADD = $(libadd) -libgtk_directfb_2_0_la_LIBADD = $(libadd) +libgtk_x11_3_0_la_LIBADD = $(libadd) +libgtk_win32_3_0_la_LIBADD = $(libadd) -lole32 -lgdi32 -lcomdlg32 -lwinspool -lcomctl32 +libgtk_quartz_3_0_la_LIBADD = $(libadd) +libgtk_directfb_3_0_la_LIBADD = $(libadd) -libgtk_x11_2_0_la_DEPENDENCIES = $(deps) -libgtk_win32_2_0_la_DEPENDENCIES = $(gtk_def) $(gtk_win32_res) $(deps) -libgtk_quartz_2_0_la_DEPENDENCIES = $(deps) -libgtk_directfb_2_0_la_DEPENDENCIES = $(deps) +libgtk_x11_3_0_la_DEPENDENCIES = $(deps) +libgtk_win32_3_0_la_DEPENDENCIES = $(gtk_def) $(gtk_win32_res) $(deps) +libgtk_quartz_3_0_la_DEPENDENCIES = $(deps) +libgtk_directfb_3_0_la_DEPENDENCIES = $(deps) if USE_WIN32 libgtk_target_ldflags = $(gtk_win32_res_ldflag) $(gtk_win32_symbols) endif -EXTRA_LTLIBRARIES = libgtk-x11-2.0.la libgtk-win32-2.0.la libgtk-quartz-2.0.la libgtk-directfb-2.0.la +EXTRA_LTLIBRARIES = libgtk-x11-3.0.la libgtk-win32-3.0.la libgtk-quartz-3.0.la libgtk-directfb-3.0.la -install-exec-hook: +install-exec-hook: if DISABLE_EXPLICIT_DEPS $(SHELL) $(top_srcdir)/sanitize-la.sh $(DESTDIR)$(libdir)/$(gtktargetlib) endif if USE_QUARTZ install-mac-key-theme: - $(mkinstalldirs) $(DESTDIR)$(datadir)/themes/Mac/gtk-2.0-key - $(INSTALL_DATA) $(srcdir)/gtkrc.key.mac $(DESTDIR)$(datadir)/themes/Mac/gtk-2.0-key/gtkrc + $(mkinstalldirs) $(DESTDIR)$(datadir)/themes/Mac/gtk-3.0-key + $(INSTALL_DATA) $(srcdir)/gtkrc.key.mac $(DESTDIR)$(datadir)/themes/Mac/gtk-3.0-key/gtkrc uninstall-mac-key-theme: - rm -f $(DESTDIR)$(datadir)/themes/Mac/gtk-2.0-key/gtkrc + rm -f $(DESTDIR)$(datadir)/themes/Mac/gtk-3.0-key/gtkrc else install-mac-key-theme: uninstall-mac-key-theme: @@ -958,17 +893,17 @@ dist-hook: ../build/win32/vs9/gtk.vcproj # Install a RC file for the default GTK+ theme, and key themes install-data-local: install-ms-lib install-def-file install-mac-key-theme - $(mkinstalldirs) $(DESTDIR)$(datadir)/themes/Raleigh/gtk-2.0 - $(INSTALL_DATA) $(srcdir)/gtkrc.default $(DESTDIR)$(datadir)/themes/Raleigh/gtk-2.0/gtkrc - $(mkinstalldirs) $(DESTDIR)$(datadir)/themes/Default/gtk-2.0-key - $(INSTALL_DATA) $(srcdir)/gtkrc.key.default $(DESTDIR)$(datadir)/themes/Default/gtk-2.0-key/gtkrc - $(mkinstalldirs) $(DESTDIR)$(datadir)/themes/Emacs/gtk-2.0-key - $(INSTALL_DATA) $(srcdir)/gtkrc.key.emacs $(DESTDIR)$(datadir)/themes/Emacs/gtk-2.0-key/gtkrc + $(mkinstalldirs) $(DESTDIR)$(datadir)/themes/Raleigh/gtk-3.0 + $(INSTALL_DATA) $(srcdir)/gtkrc.default $(DESTDIR)$(datadir)/themes/Raleigh/gtk-3.0/gtkrc + $(mkinstalldirs) $(DESTDIR)$(datadir)/themes/Default/gtk-3.0-key + $(INSTALL_DATA) $(srcdir)/gtkrc.key.default $(DESTDIR)$(datadir)/themes/Default/gtk-3.0-key/gtkrc + $(mkinstalldirs) $(DESTDIR)$(datadir)/themes/Emacs/gtk-3.0-key + $(INSTALL_DATA) $(srcdir)/gtkrc.key.emacs $(DESTDIR)$(datadir)/themes/Emacs/gtk-3.0-key/gtkrc uninstall-local: uninstall-ms-lib uninstall-def-file uninstall-mac-key-theme - rm -f $(DESTDIR)$(datadir)/themes/Raleigh/gtk-2.0/gtkrc - rm -f $(DESTDIR)$(datadir)/themes/Default/gtk-2.0-key/gtkrc - rm -f $(DESTDIR)$(datadir)/themes/Emacs/gtk-2.0-key/gtkrc + rm -f $(DESTDIR)$(datadir)/themes/Raleigh/gtk-3.0/gtkrc + rm -f $(DESTDIR)$(datadir)/themes/Default/gtk-3.0-key/gtkrc + rm -f $(DESTDIR)$(datadir)/themes/Emacs/gtk-3.0-key/gtkrc # if srcdir!=builddir, clean out maintainer-clean files from builddir # this allows dist to pass. @@ -979,7 +914,7 @@ distclean-local: DEPS = $(gtktargetlib) $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la $(top_builddir)/gdk/$(gdktargetlib) -TEST_DEPS = $(DEPS) gtk.immodules +TEST_DEPS = $(DEPS) immodules.cache LDADDS = \ $(gtktargetlib) \ @@ -994,17 +929,17 @@ introspection_files = \ gtktypebuiltins.h \ gtktypebuiltins.c -Gtk-2.0.gir: $(INTROSPECTION_SCANNER) $(gtktargetlib) $(top_builddir)/gdk/Gdk-2.0.gir Makefile -Gtk_2_0_gir_SCANNERFLAGS = --strip-prefix=Gtk -Gtk_2_0_gir_INCLUDES = Atk-1.0 Gdk-2.0 -Gtk_2_0_gir_CFLAGS = \ +Gtk-3.0.gir: $(INTROSPECTION_SCANNER) $(gtktargetlib) $(top_builddir)/gdk/Gdk-3.0.gir Makefile +Gtk_3_0_gir_SCANNERFLAGS = --strip-prefix=Gtk +Gtk_3_0_gir_INCLUDES = Atk-1.0 Gdk-3.0 +Gtk_3_0_gir_CFLAGS = \ $(INCLUDES) \ -UGDK_DISABLE_DEPRECATED \ -UGTK_DISABLE_DEPRECATED \ -DGTK_TEXT_USE_INTERNAL_UNSUPPORTED_API -Gtk_2_0_gir_LIBS = $(gtktargetlib) -Gtk_2_0_gir_FILES = $(addprefix $(srcdir)/, $(introspection_files)) -INTROSPECTION_GIRS += Gtk-2.0.gir +Gtk_3_0_gir_LIBS = $(gtktargetlib) +Gtk_3_0_gir_FILES = $(addprefix $(srcdir)/, $(introspection_files)) +INTROSPECTION_GIRS += Gtk-3.0.gir girdir = $(datadir)/gir-1.0 dist_gir_DATA = $(INTROSPECTION_GIRS) @@ -1019,10 +954,10 @@ endif # Installed tools # bin_PROGRAMS = \ - gtk-query-immodules-2.0 \ - gtk-update-icon-cache + gtk-query-immodules-3.0 \ + gtk-update-icon-cache-3.0 -bin_SCRIPTS = gtk-builder-convert +bin_SCRIPTS = gtk-builder-convert-3.0 if OS_WIN32 @@ -1057,17 +992,17 @@ gtk-update-icon-cache.exe.manifest: endif -gtk_query_immodules_2_0_DEPENDENCIES = $(DEPS) -gtk_query_immodules_2_0_LDADD = $(LDADDS) +gtk_query_immodules_3_0_DEPENDENCIES = $(DEPS) +gtk_query_immodules_3_0_LDADD = $(LDADDS) -gtk_query_immodules_2_0_SOURCES = queryimmodules.c +gtk_query_immodules_3_0_SOURCES = queryimmodules.c -gtk_update_icon_cache_LDADD = \ +gtk_update_icon_cache_3_0_LDADD = \ $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la \ $(GDK_PIXBUF_DEP_LIBS) -gtk_update_icon_cache_SOURCES = \ +gtk_update_icon_cache_3_0_SOURCES = \ updateiconcache.c .PHONY: files test test-debug @@ -1373,12 +1308,12 @@ if CROSS_COMPILING gtk_update_icon_cache_program = $(GTK_UPDATE_ICON_CACHE) else gtk_update_icon_cache_program = \ - GDK_PIXBUF_MODULE_FILE=$(top_builddir)/gdk-pixbuf/gdk-pixbuf.loaders \ - ./gtk-update-icon-cache + GDK_PIXBUF_MODULE_FILE=$(top_builddir)/gdk-pixbuf/loaders.cache \ + ./gtk-update-icon-cache-3.0 endif gtkbuiltincache.h: @REBUILD@ stamp-icons - $(MAKE) $(AM_MAKEFLAGS) gtk-update-icon-cache$(EXEEXT) $(GTK_UPDATE_ICON_CACHE_MANIFEST) + $(MAKE) $(AM_MAKEFLAGS) gtk-update-icon-cache-3.0$(EXEEXT) $(GTK_UPDATE_ICON_CACHE_MANIFEST) $(gtk_update_icon_cache_program) --force --ignore-theme-index \ --source builtin_icons stock-icons > gtkbuiltincache.h.tmp && \ mv gtkbuiltincache.h.tmp gtkbuiltincache.h @@ -1393,7 +1328,7 @@ EXTRA_DIST += \ tree_minus.xpm \ tree_plus.xpm \ gtk.def \ - gtk-builder-convert \ + gtk-builder-convert-3.0 \ gtk-win32.rc \ gtk-win32.rc.in \ gtkwin32embed.h \ diff --git a/gtk/abicheck.sh b/gtk/abicheck.sh index f657d465cf..da4663c5de 100755 --- a/gtk/abicheck.sh +++ b/gtk/abicheck.sh @@ -1,5 +1,5 @@ #! /bin/sh cpp -DINCLUDE_VARIABLES -P -DG_OS_UNIX -DGTK_WINDOWING_X11 -DALL_FILES ${srcdir:-.}/gtk.symbols | sed -e '/^$/d' -e 's/ G_GNUC.*$//' -e 's/ PRIVATE//' | sort > expected-abi -nm -D -g --defined-only .libs/libgtk-x11-2.0.so | cut -d ' ' -f 3 | sort > actual-abi +nm -D -g --defined-only .libs/libgtk-x11-3.0.so | cut -d ' ' -f 3 | egrep -v '^(__bss_start|_edata|_end)' | sort > actual-abi diff -u expected-abi actual-abi && rm -f expected-abi actual-abi diff --git a/gtk/gtk-builder-convert b/gtk/gtk-builder-convert-3.0 similarity index 99% rename from gtk/gtk-builder-convert rename to gtk/gtk-builder-convert-3.0 index a641b3385d..4cae240a66 100755 --- a/gtk/gtk-builder-convert +++ b/gtk/gtk-builder-convert-3.0 @@ -21,7 +21,7 @@ # TODO: # Toolbars -"""Usage: gtk-builder-convert [OPTION] [INPUT] [OUTPUT] +"""Usage: gtk-builder-convert-3.0 [OPTION] [INPUT] [OUTPUT] Converts Glade files into XML files which can be loaded with GtkBuilder. The [INPUT] file is @@ -32,7 +32,7 @@ The [INPUT] file is When OUTPUT is -, write to standard output. Examples: - gtk-builder-convert preference.glade preferences.ui + gtk-builder-convert-3.0 preference.glade preferences.ui Report bugs to http://bugzilla.gnome.org/.""" @@ -258,7 +258,7 @@ class GtkBuilderConverter(object): for node in objects: self._convert(node.getAttribute("class"), node) if self._get_object(node.getAttribute('id')) is not None: - print "WARNING: duplicate id \"" + node.getAttribute('id') + "\"" + print "WARNING: duplicate id \"" + node.getAttribute('id') + "\"" self.objects[node.getAttribute('id')] = node # Convert Gazpachos UI tag diff --git a/gtk/gtk.h b/gtk/gtk.h index bbeabaea77..120555b41a 100644 --- a/gtk/gtk.h +++ b/gtk/gtk.h @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -83,6 +84,7 @@ #include #include #include +#include #include #include #include @@ -217,31 +219,6 @@ #include #include -/* Broken */ -#include -#include -#include - -/* Deprecated */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #undef __GTK_H_INSIDE__ #endif /* __GTK_H__ */ diff --git a/gtk/gtk.symbols b/gtk/gtk.symbols index 5301ebfae3..3bb79644a6 100644 --- a/gtk/gtk.symbols +++ b/gtk/gtk.symbols @@ -33,10 +33,6 @@ gtk_about_dialog_get_documenters gtk_about_dialog_get_license gtk_about_dialog_get_logo gtk_about_dialog_get_logo_icon_name -#ifndef GTK_DISABLE_DEPRECATED -gtk_about_dialog_get_name -gtk_about_dialog_set_name -#endif gtk_about_dialog_get_program_name gtk_about_dialog_set_program_name gtk_about_dialog_get_translator_credits @@ -146,21 +142,12 @@ gtk_accessible_get_widget #if IN_FILE(__GTK_ACTION_C__) gtk_action_activate gtk_action_block_activate -#ifndef GTK_DISABLE_DEPRECATED -gtk_action_block_activate_from -#endif gtk_action_connect_accelerator -#ifndef GTK_DISABLE_DEPRECATED -gtk_action_connect_proxy -#endif gtk_action_create_icon gtk_action_create_menu_item gtk_action_create_tool_item gtk_action_create_menu gtk_action_disconnect_accelerator -#ifndef GTK_DISABLE_DEPRECATED -gtk_action_disconnect_proxy -#endif gtk_action_get_always_show_image gtk_action_get_accel_closure gtk_action_get_accel_path @@ -168,9 +155,6 @@ gtk_action_get_gicon gtk_action_get_label gtk_action_get_name gtk_action_get_proxies -#ifndef GTK_DISABLE_DEPRECATED -gtk_widget_get_action -#endif gtk_action_get_icon_name gtk_action_get_is_important gtk_action_get_sensitive @@ -199,9 +183,6 @@ gtk_action_set_visible gtk_action_set_visible_horizontal gtk_action_set_visible_vertical gtk_action_unblock_activate -#ifndef GTK_DISABLE_DEPRECATED -gtk_action_unblock_activate_from -#endif #endif #endif @@ -276,6 +257,17 @@ gtk_alignment_set_padding #endif #endif +#if IN_HEADER(__GTK_APPLICATION_H__) +#if IN_FILE(__GTK_APPLICATION_C__) +gtk_application_get_type G_GNUC_CONST +gtk_application_new +gtk_application_set_action_group +gtk_application_get_window +gtk_application_add_window +gtk_application_run +gtk_application_quit +#endif +#endif #if IN_HEADER(__GTK_ASSISTANT_H__) #if IN_FILE(__GTK_ASSISTANT_C__) @@ -302,6 +294,7 @@ gtk_assistant_get_page_complete gtk_assistant_add_action_widget gtk_assistant_remove_action_widget gtk_assistant_update_buttons_state +gtk_assistant_commit #endif #endif @@ -313,13 +306,11 @@ gtk_spin_button_update_policy_get_type G_GNUC_CONST gtk_notebook_tab_get_type G_GNUC_CONST gtk_number_up_layout_get_type G_GNUC_CONST gtk_anchor_type_get_type G_GNUC_CONST -gtk_arg_flags_get_type G_GNUC_CONST gtk_arrow_type_get_type G_GNUC_CONST gtk_arrow_placement_get_type G_GNUC_CONST gtk_assistant_page_type_get_type G_GNUC_CONST gtk_attach_options_get_type G_GNUC_CONST gtk_builder_error_get_type G_GNUC_CONST -gtk_button_action_get_type G_GNUC_CONST gtk_buttons_type_get_type G_GNUC_CONST gtk_calendar_display_options_get_type G_GNUC_CONST gtk_cell_renderer_mode_get_type G_GNUC_CONST @@ -330,7 +321,6 @@ gtk_debug_flag_get_type G_GNUC_CONST gtk_delete_type_get_type G_GNUC_CONST gtk_dest_defaults_get_type G_GNUC_CONST gtk_drag_result_get_type G_GNUC_CONST -gtk_clist_drag_pos_get_type G_GNUC_CONST gtk_dialog_flags_get_type G_GNUC_CONST gtk_direction_type_get_type G_GNUC_CONST gtk_entry_icon_position_get_type G_GNUC_CONST @@ -348,18 +338,11 @@ gtk_window_position_get_type G_GNUC_CONST gtk_tree_view_column_sizing_get_type G_GNUC_CONST gtk_tree_view_drop_position_get_type G_GNUC_CONST gtk_button_box_style_get_type G_GNUC_CONST -gtk_cell_type_get_type G_GNUC_CONST -gtk_ctree_expander_style_get_type G_GNUC_CONST -gtk_ctree_expansion_type_get_type G_GNUC_CONST -gtk_ctree_line_style_get_type G_GNUC_CONST -gtk_ctree_pos_get_type G_GNUC_CONST -gtk_curve_type_get_type G_GNUC_CONST gtk_icon_lookup_flags_get_type G_GNUC_CONST gtk_image_type_get_type G_GNUC_CONST gtk_im_preedit_style_get_type G_GNUC_CONST gtk_im_status_style_get_type G_GNUC_CONST gtk_justification_get_type G_GNUC_CONST -gtk_match_type_get_type G_GNUC_CONST gtk_menu_direction_type_get_type G_GNUC_CONST gtk_message_type_get_type G_GNUC_CONST gtk_metric_type_get_type G_GNUC_CONST @@ -376,7 +359,6 @@ gtk_path_priority_type_get_type G_GNUC_CONST gtk_path_type_get_type G_GNUC_CONST gtk_policy_type_get_type G_GNUC_CONST gtk_position_type_get_type G_GNUC_CONST -gtk_preview_type_get_type G_GNUC_CONST gtk_print_duplex_get_type G_GNUC_CONST gtk_print_error_get_type G_GNUC_CONST gtk_recent_filter_flags_get_type G_GNUC_CONST @@ -397,8 +379,6 @@ gtk_scroll_step_get_type G_GNUC_CONST gtk_scroll_type_get_type G_GNUC_CONST gtk_selection_mode_get_type G_GNUC_CONST gtk_shadow_type_get_type G_GNUC_CONST -gtk_side_type_get_type G_GNUC_CONST -gtk_signal_run_type_get_type G_GNUC_CONST gtk_size_group_mode_get_type G_GNUC_CONST gtk_sort_type_get_type G_GNUC_CONST gtk_spin_type_get_type G_GNUC_CONST @@ -412,7 +392,6 @@ gtk_text_search_flags_get_type G_GNUC_CONST gtk_text_window_type_get_type G_GNUC_CONST gtk_tool_palette_drag_targets_get_type G_GNUC_CONST gtk_tree_model_flags_get_type G_GNUC_CONST -gtk_tree_view_mode_get_type G_GNUC_CONST gtk_tree_view_grid_lines_get_type G_GNUC_CONST gtk_update_type_get_type G_GNUC_CONST gtk_visibility_get_type G_GNUC_CONST @@ -421,7 +400,6 @@ gtk_accel_flags_get_type G_GNUC_CONST gtk_icon_size_get_type G_GNUC_CONST gtk_file_chooser_error_get_type G_GNUC_CONST gtk_icon_theme_error_get_type G_GNUC_CONST -gtk_toolbar_child_type_get_type G_GNUC_CONST gtk_toolbar_space_style_get_type G_GNUC_CONST gtk_toolbar_style_get_type G_GNUC_CONST #endif @@ -445,10 +423,6 @@ gtk_aspect_frame_set #if IN_HEADER(__GTK_BINDINGS_H__) #if IN_FILE(__GTK_BINDINGS_C__) -#ifndef GTK_DISABLE_DEPRECATED -gtk_binding_entry_clear -gtk_binding_parse_binding -#endif gtk_binding_entry_skip gtk_binding_entry_add_signal gtk_binding_entry_add_signall @@ -472,15 +446,12 @@ gtk_bin_get_type G_GNUC_CONST #if IN_HEADER(__GTK_BOX_H__) #if IN_FILE(__GTK_BOX_C__) +gtk_box_new gtk_box_get_homogeneous gtk_box_get_spacing gtk_box_get_type G_GNUC_CONST gtk_box_pack_end gtk_box_pack_start -#ifndef GTK_DISABLE_DEPRECATED -gtk_box_pack_end_defaults -gtk_box_pack_start_defaults -#endif gtk_box_query_child_packing gtk_box_reorder_child gtk_box_set_child_packing @@ -528,12 +499,7 @@ gtk_builder_value_from_string_type #if IN_HEADER(__GTK_BUTTON_BOX_H__) #if IN_FILE(__GTK_BUTTON_BOX_C__) -#ifndef GTK_DISABLE_DEPRECATED -gtk_button_box_set_child_size -gtk_button_box_set_child_ipadding -gtk_button_box_get_child_ipadding -gtk_button_box_get_child_size -#endif +gtk_button_box_new gtk_button_box_get_child_secondary gtk_button_box_get_layout gtk_button_box_get_type G_GNUC_CONST @@ -581,11 +547,6 @@ gtk_button_set_use_underline #if IN_HEADER(__GTK_CALENDAR_H__) #if IN_FILE(__GTK_CALENDAR_C__) -#ifndef GTK_DISABLE_DEPRECATED -gtk_calendar_display_options -gtk_calendar_freeze -gtk_calendar_thaw -#endif gtk_calendar_clear_marks gtk_calendar_get_date gtk_calendar_get_detail_height_rows @@ -631,9 +592,6 @@ gtk_cell_layout_set_cell_data_func #if IN_HEADER(__GTK_CELL_RENDERER_H__) #if IN_FILE(__GTK_CELL_RENDERER_C__) gtk_cell_renderer_activate -#ifndef GTK_DISABLE_DEPRECATED -gtk_cell_renderer_editing_canceled -#endif gtk_cell_renderer_get_alignment gtk_cell_renderer_get_fixed_size gtk_cell_renderer_get_padding @@ -717,9 +675,6 @@ gtk_cell_renderer_toggle_set_radio #if IN_HEADER(__GTK_CELL_VIEW_H__) #if IN_FILE(__GTK_CELL_VIEW_C__) -#ifndef GTK_DISABLE_DEPRECATED -gtk_cell_view_get_cell_renderers -#endif gtk_cell_view_get_displayed_row gtk_cell_view_get_model gtk_cell_view_get_size_of_row @@ -755,9 +710,6 @@ gtk_check_menu_item_new_with_mnemonic gtk_check_menu_item_set_active gtk_check_menu_item_set_draw_as_radio gtk_check_menu_item_set_inconsistent -#ifndef GTK_DISABLE_DEPRECATED -gtk_check_menu_item_set_show_toggle -#endif gtk_check_menu_item_toggled #endif #endif @@ -796,87 +748,6 @@ gtk_clipboard_wait_is_target_available #endif #endif -#if IN_HEADER(__GTK_CLIST_H__) -#if IN_FILE(__GTK_CLIST_C__) -#ifndef GTK_DISABLE_DEPRECATED -gtk_clist_append -gtk_clist_clear -gtk_clist_columns_autosize -gtk_clist_column_title_active -gtk_clist_column_title_passive -gtk_clist_column_titles_active -gtk_clist_column_titles_hide -gtk_clist_column_titles_passive -gtk_clist_column_titles_show -gtk_clist_find_row_from_data -gtk_clist_freeze -gtk_clist_get_cell_style -gtk_clist_get_cell_type -gtk_clist_get_column_title -gtk_clist_get_column_widget -gtk_clist_get_hadjustment -gtk_clist_get_pixmap -gtk_clist_get_pixtext -gtk_clist_get_row_data -gtk_clist_get_row_style -gtk_clist_get_selectable -gtk_clist_get_selection_info -gtk_clist_get_text -gtk_clist_get_type G_GNUC_CONST -gtk_clist_get_vadjustment -gtk_clist_insert -gtk_clist_moveto -gtk_clist_new -gtk_clist_new_with_titles -gtk_clist_optimal_column_width -gtk_clist_prepend -gtk_clist_remove -gtk_clist_row_is_visible -gtk_clist_row_move -gtk_clist_select_all -gtk_clist_select_row -gtk_clist_set_auto_sort -gtk_clist_set_background -gtk_clist_set_button_actions -gtk_clist_set_cell_style -gtk_clist_set_column_auto_resize -gtk_clist_set_column_justification -gtk_clist_set_column_max_width -gtk_clist_set_column_min_width -gtk_clist_set_column_resizeable -gtk_clist_set_column_title -gtk_clist_set_column_visibility -gtk_clist_set_column_widget -gtk_clist_set_column_width -gtk_clist_set_compare_func -gtk_clist_set_foreground -gtk_clist_set_hadjustment -gtk_clist_set_pixmap -gtk_clist_set_pixtext -gtk_clist_set_reorderable -gtk_clist_set_row_data -gtk_clist_set_row_data_full -gtk_clist_set_row_height -gtk_clist_set_row_style -gtk_clist_set_selectable -gtk_clist_set_selection_mode -gtk_clist_set_shadow_type -gtk_clist_set_shift -gtk_clist_set_sort_column -gtk_clist_set_sort_type -gtk_clist_set_text -gtk_clist_set_use_drag_icons -gtk_clist_set_vadjustment -gtk_clist_sort -gtk_clist_swap_rows -gtk_clist_thaw -gtk_clist_undo_selection -gtk_clist_unselect_all -gtk_clist_unselect_row -#endif -#endif -#endif - #if IN_HEADER(__GTK_COLOR_BUTTON_H__) #if IN_FILE(__GTK_COLOR_BUTTON_C__) gtk_color_button_get_alpha @@ -906,12 +777,6 @@ gtk_color_selection_is_adjusting gtk_color_selection_new gtk_color_selection_palette_from_string gtk_color_selection_palette_to_string -#ifndef GTK_DISABLE_DEPRECATED -gtk_color_selection_set_change_palette_hook -gtk_color_selection_set_color -gtk_color_selection_get_color -gtk_color_selection_set_update_policy -#endif gtk_color_selection_set_change_palette_with_screen_hook gtk_color_selection_set_current_alpha gtk_color_selection_set_current_color @@ -953,6 +818,7 @@ gtk_combo_box_new_text gtk_combo_box_new_with_model gtk_combo_box_popdown gtk_combo_box_popup +gtk_combo_box_popup_for_device gtk_combo_box_prepend_text gtk_combo_box_remove_text gtk_combo_box_set_active @@ -980,22 +846,6 @@ gtk_combo_box_entry_set_text_column #endif #endif -#if IN_HEADER(__GTK_SMART_COMBO_H__) -#if IN_FILE(__GTK_SMART_COMBO_C__) -#ifndef GTK_DISABLE_DEPRECATED -gtk_combo_disable_activate -gtk_combo_get_type G_GNUC_CONST -gtk_combo_new -gtk_combo_set_case_sensitive -gtk_combo_set_item_string -gtk_combo_set_popdown_strings -gtk_combo_set_use_arrows -gtk_combo_set_use_arrows_always -gtk_combo_set_value_in_list -#endif -#endif -#endif - #if IN_HEADER(__GTK_CONTAINER_H__) #if IN_FILE(__GTK_CONTAINER_C__) gtk_container_add @@ -1013,9 +863,6 @@ gtk_container_class_install_child_property gtk_container_class_list_child_properties gtk_container_forall gtk_container_foreach -#ifndef GTK_DISABLE_DEPRECATED -gtk_container_foreach_full -#endif gtk_container_get_border_width gtk_container_get_children gtk_container_get_focus_chain @@ -1038,96 +885,6 @@ gtk_container_unset_focus_chain #endif #endif -#if IN_HEADER(__GTK_CTREE_H__) -#if IN_FILE(__GTK_CTREE_C__) -#ifndef GTK_DISABLE_DEPRECATED -gtk_ctree_collapse -gtk_ctree_collapse_recursive -gtk_ctree_collapse_to_depth -gtk_ctree_expand -gtk_ctree_expand_recursive -gtk_ctree_expand_to_depth -gtk_ctree_export_to_gnode -gtk_ctree_find -gtk_ctree_find_all_by_row_data -gtk_ctree_find_all_by_row_data_custom -gtk_ctree_find_by_row_data -gtk_ctree_find_by_row_data_custom -gtk_ctree_find_node_ptr -gtk_ctree_get_node_info -gtk_ctree_get_type G_GNUC_CONST -gtk_ctree_insert_gnode -gtk_ctree_insert_node -gtk_ctree_is_ancestor -gtk_ctree_is_hot_spot -gtk_ctree_is_viewable -gtk_ctree_last -gtk_ctree_move -gtk_ctree_new -gtk_ctree_new_with_titles -gtk_ctree_node_get_cell_style -gtk_ctree_node_get_cell_type -gtk_ctree_node_get_pixmap -gtk_ctree_node_get_pixtext -gtk_ctree_node_get_row_data -gtk_ctree_node_get_row_style -gtk_ctree_node_get_selectable -gtk_ctree_node_get_text -gtk_ctree_node_get_type G_GNUC_CONST -gtk_ctree_node_is_visible -gtk_ctree_node_moveto -gtk_ctree_node_nth -gtk_ctree_node_set_background -gtk_ctree_node_set_cell_style -gtk_ctree_node_set_foreground -gtk_ctree_node_set_pixmap -gtk_ctree_node_set_pixtext -gtk_ctree_node_set_row_data -gtk_ctree_node_set_row_data_full -gtk_ctree_node_set_row_style -gtk_ctree_node_set_selectable -gtk_ctree_node_set_shift -gtk_ctree_node_set_text -gtk_ctree_post_recursive -gtk_ctree_post_recursive_to_depth -gtk_ctree_pre_recursive -gtk_ctree_pre_recursive_to_depth -gtk_ctree_real_select_recursive -gtk_ctree_remove_node -gtk_ctree_select -gtk_ctree_select_recursive -gtk_ctree_set_drag_compare_func -gtk_ctree_set_expander_style -gtk_ctree_set_indent -gtk_ctree_set_line_style -gtk_ctree_set_node_info -gtk_ctree_set_show_stub -gtk_ctree_set_spacing -gtk_ctree_sort_node -gtk_ctree_sort_recursive -gtk_ctree_toggle_expansion -gtk_ctree_toggle_expansion_recursive -gtk_ctree_unselect -gtk_ctree_unselect_recursive -#endif -#endif -#endif - -#if IN_HEADER(__GTK_CURVE_H__) -#if IN_FILE(__GTK_CURVE_C__) -#ifndef GTK_DISABLE_DEPRECATED -gtk_curve_get_type G_GNUC_CONST -gtk_curve_get_vector -gtk_curve_new -gtk_curve_reset -gtk_curve_set_curve_type -gtk_curve_set_gamma -gtk_curve_set_range -gtk_curve_set_vector -#endif -#endif -#endif - #if IN_HEADER(__GTK_WINDOW_DECORATE_H__) #if IN_FILE(__GTK_WINDOW_DECORATE_C__) #ifndef GTK_DISABLE_DEPRECATED @@ -1182,9 +939,6 @@ gtk_drag_finish gtk_drag_get_data gtk_drag_get_source_widget gtk_drag_highlight -#ifndef GTK_DISABLE_DEPRECATED -gtk_drag_set_default_icon -#endif gtk_drag_set_icon_default gtk_drag_set_icon_name gtk_drag_set_icon_pixbuf @@ -1228,9 +982,6 @@ gtk_status_icon_get_icon_name gtk_status_icon_get_gicon gtk_status_icon_get_size gtk_status_icon_set_screen -#ifndef GTK_DISABLE_DEPRECATED -gtk_status_icon_set_tooltip -#endif gtk_status_icon_set_tooltip_text gtk_status_icon_get_tooltip_text gtk_status_icon_set_tooltip_markup @@ -1253,34 +1004,6 @@ gtk_status_icon_set_name #if IN_HEADER(__GTK_STYLE_H__) #if IN_FILE(__GTK_STYLE_C__) -#ifndef GTK_DISABLE_DEPRECATED -gtk_draw_arrow -gtk_draw_box -gtk_draw_box_gap -gtk_draw_check -gtk_draw_diamond -gtk_draw_expander -gtk_draw_extension -gtk_draw_flat_box -gtk_draw_focus -gtk_draw_handle -gtk_draw_hline -gtk_draw_layout -gtk_draw_option -gtk_draw_polygon -gtk_draw_resize_grip -gtk_draw_shadow -gtk_draw_shadow_gap -gtk_draw_slider -gtk_draw_string -gtk_draw_tab -gtk_draw_vline -gtk_style_set_font -gtk_style_get_font -gtk_style_ref -gtk_style_unref -gtk_paint_string -#endif gtk_paint_arrow gtk_paint_box gtk_paint_box_gap @@ -1327,9 +1050,6 @@ gtk_style_get #if IN_FILE(__GTK_DRAWING_AREA_C__) gtk_drawing_area_get_type G_GNUC_CONST gtk_drawing_area_new -#ifndef GTK_DISABLE_DEPRECATED -gtk_drawing_area_size -#endif #endif #endif @@ -1386,10 +1106,12 @@ gtk_entry_get_type G_GNUC_CONST gtk_entry_get_visibility gtk_entry_get_width_chars gtk_entry_get_text_window +gtk_entry_im_context_filter_keypress gtk_entry_layout_index_to_text_index gtk_entry_new gtk_entry_new_with_buffer gtk_entry_progress_pulse +gtk_entry_reset_im_context gtk_entry_set_activates_default gtk_entry_set_alignment gtk_entry_set_buffer @@ -1416,14 +1138,6 @@ gtk_entry_set_visibility gtk_entry_set_width_chars gtk_entry_text_index_to_layout_index gtk_entry_unset_invisible_char -#ifndef GTK_DISABLE_DEPRECATED -gtk_entry_append_text -gtk_entry_new_with_max_length -gtk_entry_prepend_text -gtk_entry_select_region -gtk_entry_set_editable -gtk_entry_set_position -#endif #endif #endif @@ -1506,6 +1220,18 @@ gtk_expander_set_use_underline #endif #endif +#if IN_HEADER(__GTK_EXTENDED_LAYOUT_H__) +#if IN_FILE(__GTK_EXTENDED_LAYOUT_C__) +gtk_extended_layout_get_type G_GNUC_CONST +gtk_extended_layout_get_desired_height +gtk_extended_layout_get_desired_size +gtk_extended_layout_get_desired_width +gtk_extended_layout_get_height_for_width +gtk_extended_layout_get_width_for_height +gtk_extended_layout_is_height_for_width +#endif +#endif + #if IN_HEADER(__GTK_FILE_CHOOSER_H__) #if IN_FILE(__GTK_FILE_CHOOSER_C__) gtk_file_chooser_add_filter @@ -1630,9 +1356,6 @@ gtk_file_chooser_unselect_uri #if IN_FILE(__GTK_FILE_CHOOSER_DIALOG_C__) gtk_file_chooser_dialog_get_type G_GNUC_CONST gtk_file_chooser_dialog_new -#ifndef GTK_DISABLE_DEPRECATED -gtk_file_chooser_dialog_new_with_backend -#endif #endif #endif @@ -1640,9 +1363,6 @@ gtk_file_chooser_dialog_new_with_backend #if IN_FILE(__GTK_FILE_CHOOSER_WIDGET_C__) gtk_file_chooser_widget_get_type G_GNUC_CONST gtk_file_chooser_widget_new -#ifndef GTK_DISABLE_DEPRECATED -gtk_file_chooser_widget_new_with_backend -#endif #endif #endif @@ -1652,9 +1372,6 @@ gtk_file_chooser_button_get_title gtk_file_chooser_button_get_type G_GNUC_CONST gtk_file_chooser_button_get_width_chars gtk_file_chooser_button_new -#ifndef GTK_DISABLE_DEPRECATED -gtk_file_chooser_button_new_with_backend -#endif gtk_file_chooser_button_new_with_dialog gtk_file_chooser_button_set_title gtk_file_chooser_button_set_width_chars @@ -1678,48 +1395,12 @@ gtk_file_filter_set_name #endif #endif -#if IN_HEADER(__GTK_FILESEL_H__) -#if IN_FILE(__GTK_FILESEL_C__) -#ifndef GTK_DISABLE_DEPRECATED -gtk_file_selection_complete -#ifndef _WIN64 -gtk_file_selection_get_filename PRIVATE -#endif -#ifdef G_OS_WIN32 -gtk_file_selection_get_filename_utf8 -#endif -#ifndef _WIN64 -gtk_file_selection_get_selections PRIVATE -#endif -#ifdef G_OS_WIN32 -gtk_file_selection_get_selections_utf8 -#endif -gtk_file_selection_get_select_multiple -gtk_file_selection_get_type G_GNUC_CONST -gtk_file_selection_hide_fileop_buttons -gtk_file_selection_new -#ifndef _WIN64 -gtk_file_selection_set_filename PRIVATE -#endif -#ifdef G_OS_WIN32 -gtk_file_selection_set_filename_utf8 -#endif -gtk_file_selection_set_select_multiple -gtk_file_selection_show_fileop_buttons -#endif -#endif -#endif - #if IN_HEADER(__GTK_FIXED_H__) #if IN_FILE(__GTK_FIXED_C__) gtk_fixed_get_type G_GNUC_CONST gtk_fixed_move gtk_fixed_new gtk_fixed_put -#ifndef GTK_DISABLE_DEPRECATED -gtk_fixed_set_has_window -gtk_fixed_get_has_window -#endif #endif #endif @@ -1753,11 +1434,6 @@ gtk_font_selection_dialog_get_type G_GNUC_CONST gtk_font_selection_dialog_new gtk_font_selection_dialog_set_font_name gtk_font_selection_dialog_set_preview_text -#ifndef GTK_DISABLE_DEPRECATED -gtk_font_selection_dialog_get_apply_button -gtk_font_selection_get_font -gtk_font_selection_dialog_get_font -#endif gtk_font_selection_get_face gtk_font_selection_get_face_list gtk_font_selection_get_family @@ -1790,15 +1466,6 @@ gtk_frame_set_shadow_type #endif #endif -#if IN_HEADER(__GTK_GAMMA_CURVE_H__) -#if IN_FILE(__GTK_GAMMA_CURVE_C__) -#ifndef GTK_DISABLE_DEPRECATED -gtk_gamma_curve_get_type G_GNUC_CONST -gtk_gamma_curve_new -#endif -#endif -#endif - #if IN_HEADER(__GTK_GC_H__) #if IN_FILE(__GTK_GC_C__) gtk_gc_get @@ -1831,12 +1498,6 @@ gtk_hbox_new #if IN_FILE(__GTK_HBUTTON_BOX_C__) gtk_hbutton_box_new gtk_hbutton_box_get_type G_GNUC_CONST -#ifndef GTK_DISABLE_DEPRECATED -gtk_hbutton_box_get_layout_default -gtk_hbutton_box_get_spacing_default -gtk_hbutton_box_set_layout_default -gtk_hbutton_box_set_spacing_default -#endif #endif #endif @@ -1967,6 +1628,7 @@ gtk_icon_info_get_filename_utf8 #endif gtk_icon_info_get_type G_GNUC_CONST gtk_icon_info_load_icon +gtk_icon_info_load_symbolic gtk_icon_info_set_raw_coordinates gtk_icon_theme_add_builtin_icon #ifndef _WIN64 @@ -2074,15 +1736,13 @@ gtk_icon_view_set_tooltip_cell gtk_icon_view_get_tooltip_context gtk_icon_view_set_tooltip_column gtk_icon_view_get_tooltip_column +gtk_icon_view_get_item_row +gtk_icon_view_get_item_column #endif #endif #if IN_HEADER(__GTK_IMAGE_H__) #if IN_FILE(__GTK_IMAGE_C__) -#ifndef GTK_DISABLE_DEPRECATED -gtk_image_get -gtk_image_set -#endif gtk_image_clear gtk_image_get_animation gtk_image_get_icon_name @@ -2199,43 +1859,8 @@ gtk_item_toggle #endif #endif -#if IN_HEADER(__GTK_ITEM_FACTORY_H__) -#if IN_FILE(__GTK_ITEM_FACTORY_C__) -#ifndef GTK_DISABLE_DEPRECATED -gtk_item_factories_path_delete -gtk_item_factory_add_foreign -gtk_item_factory_construct -gtk_item_factory_create_item -gtk_item_factory_create_items -gtk_item_factory_create_items_ac -gtk_item_factory_create_menu_entries -gtk_item_factory_delete_entries -gtk_item_factory_delete_entry -gtk_item_factory_delete_item -gtk_item_factory_from_path -gtk_item_factory_from_widget -gtk_item_factory_get_item -gtk_item_factory_get_item_by_action -gtk_item_factory_get_type G_GNUC_CONST -gtk_item_factory_get_widget -gtk_item_factory_get_widget_by_action -gtk_item_factory_new -gtk_item_factory_path_from_widget -gtk_item_factory_popup -gtk_item_factory_popup_data -gtk_item_factory_popup_data_from_widget -gtk_item_factory_popup_with_data -gtk_item_factory_set_translate_func -#endif -#endif -#endif - #if IN_HEADER(__GTK_LABEL_H__) #if IN_FILE(__GTK_LABEL_C__) -#ifndef GTK_DISABLE_DEPRECATED -gtk_label_get -gtk_label_parse_uline -#endif gtk_label_get_angle gtk_label_get_attributes gtk_label_get_ellipsize @@ -2297,10 +1922,6 @@ gtk_layout_put gtk_layout_set_hadjustment gtk_layout_set_size gtk_layout_set_vadjustment -#ifndef GTK_DISABLE_DEPRECATED -gtk_layout_freeze -gtk_layout_thaw -#endif #endif #endif @@ -2317,51 +1938,6 @@ gtk_link_button_set_visited #endif #endif -#if IN_HEADER(__GTK_LIST_H__) -#if IN_FILE(__GTK_LIST_C__) -#ifndef GTK_DISABLE_DEPRECATED -gtk_list_append_items -gtk_list_child_position -gtk_list_clear_items -gtk_list_end_drag_selection -gtk_list_end_selection -gtk_list_extend_selection -gtk_list_get_type G_GNUC_CONST -gtk_list_insert_items -gtk_list_new -gtk_list_prepend_items -gtk_list_remove_items -gtk_list_remove_items_no_unref -gtk_list_scroll_horizontal -gtk_list_scroll_vertical -gtk_list_select_all -gtk_list_select_child -gtk_list_select_item -gtk_list_set_selection_mode -gtk_list_start_selection -gtk_list_toggle_add_mode -gtk_list_toggle_focus_row -gtk_list_toggle_row -gtk_list_undo_selection -gtk_list_unselect_all -gtk_list_unselect_child -gtk_list_unselect_item -#endif -#endif -#endif - -#if IN_HEADER(__GTK_LIST_ITEM_H__) -#if IN_FILE(__GTK_LIST_ITEM_C__) -#ifndef GTK_DISABLE_DEPRECATED -gtk_list_item_deselect -gtk_list_item_get_type G_GNUC_CONST -gtk_list_item_new -gtk_list_item_new_with_label -gtk_list_item_select -#endif -#endif -#endif - #if IN_HEADER(__GTK_LIST_STORE_H__) #if IN_FILE(__GTK_LIST_STORE_C__) gtk_list_store_append @@ -2393,21 +1969,9 @@ gtk_list_store_swap #if IN_FILE(__GTK_MAIN_C__) gtk_get_option_group gtk_get_current_event +gtk_get_current_event_device gtk_get_current_event_state gtk_get_current_event_time -#ifndef GTK_DISABLE_DEPRECATED -gtk_exit -gtk_idle_add -gtk_idle_add_full -gtk_idle_add_priority -gtk_idle_remove -gtk_idle_remove_by_data -gtk_timeout_add -gtk_timeout_add_full -gtk_timeout_remove -gtk_input_add_full -gtk_input_remove -#endif gtk_false G_GNUC_CONST gtk_true G_GNUC_CONST gtk_events_pending @@ -2419,6 +1983,8 @@ gtk_get_event_widget gtk_grab_add gtk_grab_get_current gtk_grab_remove +gtk_device_grab_add +gtk_device_grab_remove gtk_propagate_event gtk_quit_add gtk_quit_add_destroy @@ -2447,48 +2013,6 @@ gtk_main_quit #endif #endif -#if IN_HEADER(__GTK_INPUTDIALOG_H__) -#if IN_FILE(__GTK_INPUTDIALOG_C__) -#ifndef GTK_DISABLE_DEPRECATED -gtk_input_dialog_get_type G_GNUC_CONST -gtk_input_dialog_new -#endif -#endif -#endif - -#if IN_HEADER(__gtk_marshal_MARSHAL_H__) -#if IN_FILE(__gtk_marshal_MARSHAL_C__) -#ifndef GTK_DISABLE_DEPRECATED -gtk_marshal_BOOLEAN__POINTER -gtk_marshal_BOOLEAN__POINTER_INT_INT -gtk_marshal_BOOLEAN__POINTER_INT_INT_UINT -gtk_marshal_BOOLEAN__POINTER_POINTER_INT_INT -gtk_marshal_BOOLEAN__POINTER_STRING_STRING_POINTER -gtk_marshal_BOOLEAN__VOID -gtk_marshal_ENUM__ENUM -gtk_marshal_INT__POINTER -gtk_marshal_INT__POINTER_CHAR_CHAR -gtk_marshal_VOID__ENUM_FLOAT -gtk_marshal_VOID__ENUM_FLOAT_BOOLEAN -gtk_marshal_VOID__INT_INT -gtk_marshal_VOID__INT_INT_POINTER -gtk_marshal_VOID__POINTER_INT -gtk_marshal_VOID__POINTER_INT_INT_POINTER_UINT_UINT -gtk_marshal_VOID__POINTER_POINTER -gtk_marshal_VOID__POINTER_POINTER_POINTER -gtk_marshal_VOID__POINTER_POINTER_UINT_UINT -gtk_marshal_VOID__POINTER_STRING_STRING -gtk_marshal_VOID__POINTER_UINT -gtk_marshal_VOID__POINTER_UINT_ENUM -gtk_marshal_VOID__POINTER_UINT_UINT -gtk_marshal_VOID__STRING_INT_POINTER -gtk_marshal_VOID__UINT_POINTER_UINT_ENUM_ENUM_POINTER -gtk_marshal_VOID__UINT_POINTER_UINT_UINT_ENUM -gtk_marshal_VOID__UINT_STRING -#endif -#endif -#endif - #if IN_HEADER(__GTK_MENU_BAR_H__) #if IN_FILE(__GTK_MENU_BAR_C__) gtk_menu_bar_get_type G_GNUC_CONST @@ -2518,6 +2042,7 @@ gtk_menu_get_type G_GNUC_CONST gtk_menu_new gtk_menu_popdown gtk_menu_popup +gtk_menu_popup_for_device gtk_menu_reorder_child gtk_menu_reposition gtk_menu_set_accel_group @@ -2552,9 +2077,6 @@ gtk_menu_item_set_submenu gtk_menu_item_set_use_underline gtk_menu_item_toggle_size_allocate gtk_menu_item_toggle_size_request -#ifndef GTK_DISABLE_DEPRECATED -gtk_menu_item_remove_submenu -#endif #endif #endif @@ -2581,9 +2103,6 @@ gtk_menu_tool_button_get_menu gtk_menu_tool_button_get_type G_GNUC_CONST gtk_menu_tool_button_new gtk_menu_tool_button_new_from_stock -#ifndef GTK_DISABLE_DEPRECATED -gtk_menu_tool_button_set_arrow_tooltip -#endif gtk_menu_tool_button_set_arrow_tooltip_markup gtk_menu_tool_button_set_arrow_tooltip_text gtk_menu_tool_button_set_menu @@ -2657,12 +2176,6 @@ gtk_notebook_query_tab_label_packing gtk_notebook_remove_page gtk_notebook_reorder_child gtk_notebook_set_current_page -#ifndef GTK_DISABLE_DEPRECATED -gtk_notebook_set_homogeneous_tabs -gtk_notebook_set_tab_border -gtk_notebook_set_tab_hborder -gtk_notebook_set_tab_vborder -#endif gtk_notebook_set_menu_label gtk_notebook_set_menu_label_text gtk_notebook_set_scrollable @@ -2675,10 +2188,6 @@ gtk_notebook_set_tab_label_packing gtk_notebook_set_tab_label_text gtk_notebook_set_tab_pos gtk_notebook_set_window_creation_hook -#ifndef GTK_DISABLE_DEPRECATED -gtk_notebook_get_group_id -gtk_notebook_set_group_id -#endif gtk_notebook_get_group gtk_notebook_set_group gtk_notebook_get_tab_reorderable @@ -2692,29 +2201,6 @@ gtk_notebook_set_action_widget #if IN_HEADER(__GTK_OBJECT_H__) #if IN_FILE(__GTK_OBJECT_C__) -#ifndef GTK_DISABLE_DEPRECATED -gtk_object_add_arg_type -gtk_object_get G_GNUC_NULL_TERMINATED -gtk_object_set G_GNUC_NULL_TERMINATED -gtk_object_get_data -gtk_object_get_data_by_id -gtk_object_get_user_data -gtk_object_new -gtk_object_remove_data -gtk_object_remove_data_by_id -gtk_object_remove_no_notify -gtk_object_remove_no_notify_by_id -gtk_object_ref -gtk_object_unref -gtk_object_weakref -gtk_object_weakunref -gtk_object_set_data -gtk_object_set_data_by_id -gtk_object_set_data_by_id_full -gtk_object_set_data_full -gtk_object_set_user_data -gtk_object_sink -#endif gtk_object_destroy gtk_object_get_type G_GNUC_CONST #endif @@ -2737,28 +2223,9 @@ gtk_orientable_set_orientation #endif #endif -#if IN_HEADER(__GTK_OLD_EDITABLE_H__) -#if IN_FILE(__GTK_OLD_EDITABLE_C__) -gtk_old_editable_changed -gtk_old_editable_claim_selection -gtk_old_editable_get_type G_GNUC_CONST -#endif -#endif - -#if IN_HEADER(__GTK_OPTION_MENU_H__) -#if IN_FILE(__GTK_OPTION_MENU_C__) -gtk_option_menu_get_history -gtk_option_menu_get_menu -gtk_option_menu_get_type G_GNUC_CONST -gtk_option_menu_new -gtk_option_menu_remove_menu -gtk_option_menu_set_history -gtk_option_menu_set_menu -#endif -#endif - #if IN_HEADER(__GTK_PANED_H__) #if IN_FILE(__GTK_PANED_C__) +gtk_paned_new gtk_paned_add1 gtk_paned_add2 gtk_paned_get_child1 @@ -2769,9 +2236,6 @@ gtk_paned_get_type G_GNUC_CONST gtk_paned_pack1 gtk_paned_pack2 gtk_paned_set_position -#ifndef GTK_DISABLE_DEPRECATED -gtk_paned_compute_position -#endif #endif #endif @@ -2781,18 +2245,6 @@ gtk_path_bar_get_type G_GNUC_CONST #endif #endif -#if IN_HEADER(__GTK_PIXMAP_H__) -#if IN_FILE(__GTK_PIXMAP_C__) -#ifndef GTK_DISABLE_DEPRECATED -gtk_pixmap_get -gtk_pixmap_get_type G_GNUC_CONST -gtk_pixmap_new -gtk_pixmap_set -gtk_pixmap_set_build_insensitive -#endif -#endif -#endif - #if IN_HEADER(__GTK_PLUG_H__) #if IN_FILE(__GTK_PLUG_C__) gtk_plug_construct @@ -2806,29 +2258,6 @@ gtk_plug_new_for_display #endif #endif -#if IN_HEADER(__GTK_PREVIEW_H__) -#if IN_FILE(__GTK_PREVIEW_C__) -#ifndef GTK_DISABLE_DEPRECATED -gtk_preview_draw_row -gtk_preview_get_cmap -gtk_preview_get_info -gtk_preview_get_type G_GNUC_CONST -gtk_preview_get_visual -gtk_preview_new -gtk_preview_put -gtk_preview_reset -gtk_preview_set_color_cube -gtk_preview_set_dither -gtk_preview_set_expand -gtk_preview_set_gamma -gtk_preview_set_install_cmap -gtk_preview_set_reserved -gtk_preview_size -gtk_preview_uninit -#endif -#endif -#endif - #if IN_HEADER(__GTK_PAGE_SETUP_H__) #if IN_FILE(__GTK_PAGE_SETUP_C__) gtk_page_setup_get_type G_GNUC_CONST @@ -3249,32 +2678,6 @@ gtk_print_win32_devnames_from_printer_name #endif #endif -#if IN_HEADER(__GTK_PROGRESS_BAR_H__) -#if IN_FILE(__GTK_PROGRESS_BAR_C__) -gtk_progress_bar_get_fraction -gtk_progress_bar_get_orientation -gtk_progress_bar_get_pulse_step -gtk_progress_bar_get_text -gtk_progress_bar_get_ellipsize -gtk_progress_bar_get_type G_GNUC_CONST -gtk_progress_bar_new -#ifndef GTK_DISABLE_DEPRECATED -gtk_progress_bar_new_with_adjustment -gtk_progress_bar_set_bar_style -gtk_progress_bar_set_discrete_blocks -gtk_progress_bar_set_activity_blocks -gtk_progress_bar_set_activity_step -gtk_progress_bar_update -#endif -gtk_progress_bar_pulse -gtk_progress_bar_set_fraction -gtk_progress_bar_set_orientation -gtk_progress_bar_set_pulse_step -gtk_progress_bar_set_text -gtk_progress_bar_set_ellipsize -#endif -#endif - #if IN_HEADER(__GTK_PROGRESS_H__) #if IN_FILE(__GTK_PROGRESS_C__) #ifndef GTK_DISABLE_DEPRECATED @@ -3283,7 +2686,7 @@ gtk_progress_get_current_percentage gtk_progress_get_current_text gtk_progress_get_percentage_from_value gtk_progress_get_text_from_value -gtk_progress_get_type G_GNUC_CONST +gtk_progress_get_type gtk_progress_get_value gtk_progress_set_activity_mode gtk_progress_set_adjustment @@ -3296,6 +2699,24 @@ gtk_progress_set_value #endif #endif +#if IN_HEADER(__GTK_PROGRESS_BAR_H__) +#if IN_FILE(__GTK_PROGRESS_BAR_C__) +gtk_progress_bar_get_fraction +gtk_progress_bar_get_orientation +gtk_progress_bar_get_pulse_step +gtk_progress_bar_get_text +gtk_progress_bar_get_ellipsize +gtk_progress_bar_get_type G_GNUC_CONST +gtk_progress_bar_new +gtk_progress_bar_pulse +gtk_progress_bar_set_fraction +gtk_progress_bar_set_orientation +gtk_progress_bar_set_pulse_step +gtk_progress_bar_set_text +gtk_progress_bar_set_ellipsize +#endif +#endif + #if IN_HEADER(__GTK_RADIO_ACTION_H__) #if IN_FILE(__GTK_RADIO_ACTION_C__) gtk_radio_action_get_current_value @@ -3304,6 +2725,7 @@ gtk_radio_action_get_type G_GNUC_CONST gtk_radio_action_new gtk_radio_action_set_current_value gtk_radio_action_set_group +gtk_radio_action_join_group #endif #endif @@ -3383,11 +2805,6 @@ gtk_range_set_value #if IN_HEADER(__GTK_RC_H__) #if IN_FILE(__GTK_RC_C__) -#ifndef GTK_DISABLE_DEPRECATED -gtk_rc_add_class_style -gtk_rc_add_widget_class_style -gtk_rc_add_widget_name_style -#endif #ifndef _WIN64 gtk_rc_add_default_file PRIVATE #endif @@ -3427,10 +2844,6 @@ gtk_rc_set_default_files_utf8 gtk_rc_style_copy gtk_rc_style_get_type G_GNUC_CONST gtk_rc_style_new -#ifndef GTK_DISABLE_DEPRECATED -gtk_rc_style_ref -gtk_rc_style_unref -#endif #endif #endif @@ -3460,10 +2873,6 @@ gtk_recent_chooser_set_limit gtk_recent_chooser_get_limit gtk_recent_chooser_set_show_tips gtk_recent_chooser_get_show_tips -#ifndef GTK_DISABLE_DEPRECATED -gtk_recent_chooser_set_show_numbers -gtk_recent_chooser_get_show_numbers -#endif gtk_recent_chooser_set_sort_type gtk_recent_chooser_get_sort_type gtk_recent_chooser_set_sort_func @@ -3537,10 +2946,6 @@ gtk_recent_manager_get_type G_GNUC_CONST gtk_recent_manager_new gtk_recent_manager_get_items gtk_recent_manager_get_default -#ifndef GTK_DISABLE_DEPRECATED -gtk_recent_manager_get_for_screen -gtk_recent_manager_set_screen -#endif gtk_recent_manager_add_item gtk_recent_manager_add_full gtk_recent_manager_remove_item @@ -3617,6 +3022,7 @@ gtk_text_buffer_unregister_serialize_format #if IN_HEADER(__GTK_RULER_H__) #if IN_FILE(__GTK_RULER_C__) +gtk_ruler_new gtk_ruler_draw_pos gtk_ruler_draw_ticks gtk_ruler_get_metric @@ -3629,6 +3035,8 @@ gtk_ruler_set_range #if IN_HEADER(__GTK_SCALE_H__) #if IN_FILE(__GTK_SCALE_C__) +gtk_scale_new +gtk_scale_new_with_range gtk_scale_get_digits gtk_scale_get_draw_value gtk_scale_get_layout @@ -3652,10 +3060,6 @@ gtk_scale_button_set_icons gtk_scale_button_set_value gtk_scale_button_get_adjustment gtk_scale_button_set_adjustment -#ifndef GTK_DISABLE_DEPRECATED -gtk_scale_button_get_orientation -gtk_scale_button_set_orientation -#endif gtk_scale_button_get_plus_button gtk_scale_button_get_minus_button gtk_scale_button_get_popup @@ -3665,6 +3069,7 @@ gtk_scale_button_get_popup #if IN_HEADER(__GTK_SCROLLBAR_H__) #if IN_FILE(__GTK_SCROLLBAR_C__) gtk_scrollbar_get_type G_GNUC_CONST +gtk_scrollbar_new #endif #endif @@ -3693,7 +3098,6 @@ gtk_scrolled_window_unset_placement #if IN_FILE(__GTK_SELECTION_C__) gtk_selection_add_target gtk_selection_add_targets -gtk_selection_clear gtk_selection_clear_targets gtk_selection_convert gtk_selection_data_copy @@ -3745,6 +3149,7 @@ gtk_target_table_free #if IN_HEADER(__GTK_SEPARATOR_H__) #if IN_FILE(__GTK_SEPARATOR_C__) gtk_separator_get_type G_GNUC_CONST +gtk_separator_new #endif #endif @@ -3783,24 +3188,6 @@ gtk_rc_property_parse_requisition #endif #endif -#if IN_HEADER(__GTK_SIGNAL_H__) -#if IN_FILE(__GTK_SIGNAL_C__) -#ifndef GTK_DISABLE_DEPRECATED -gtk_signal_compat_matched -gtk_signal_connect_full -gtk_signal_connect_object_while_alive -gtk_signal_connect_while_alive -gtk_signal_emit -gtk_signal_emit_by_name -gtk_signal_emit_stop_by_name -gtk_signal_emitv -gtk_signal_emitv_by_name -gtk_signal_new -gtk_signal_newv -#endif -#endif -#endif - #if IN_HEADER(__GTK_SIZE_GROUP_H__) #if IN_FILE(__GTK_SIZE_GROUP_C__) gtk_size_group_add_widget @@ -3828,9 +3215,6 @@ gtk_socket_get_id gtk_socket_get_plug_window gtk_socket_get_type G_GNUC_CONST gtk_socket_new -#ifndef GTK_DISABLE_DEPRECATED -gtk_socket_steal -#endif #endif #endif @@ -3883,6 +3267,7 @@ gtk_statusbar_new gtk_statusbar_pop gtk_statusbar_push gtk_statusbar_remove +gtk_statusbar_remove_all gtk_statusbar_set_has_resize_grip #endif #endif @@ -3954,25 +3339,6 @@ gtk_text_tag_table_remove #endif #endif -#if IN_HEADER(__GTK_TEXT_H__) -#if IN_FILE(__GTK_TEXT_C__) -gtk_text_backward_delete -gtk_text_forward_delete -gtk_text_freeze -gtk_text_get_length -gtk_text_get_point -gtk_text_get_type G_GNUC_CONST -gtk_text_insert -gtk_text_new -gtk_text_set_adjustments -gtk_text_set_editable -gtk_text_set_line_wrap -gtk_text_set_point -gtk_text_set_word_wrap -gtk_text_thaw -#endif -#endif - #if IN_HEADER(__GTK_TEXT_BUFFER_H__) #if IN_FILE(__GTK_TEXT_BUFFER_C__) gtk_text_buffer_add_selection_clipboard @@ -4254,6 +3620,7 @@ gtk_text_view_get_buffer gtk_text_view_get_cursor_visible gtk_text_view_get_default_attributes gtk_text_view_get_editable +gtk_text_view_get_hadjustment gtk_text_view_get_indent gtk_text_view_get_iter_at_location gtk_text_view_get_iter_at_position @@ -4269,16 +3636,19 @@ gtk_text_view_get_pixels_inside_wrap gtk_text_view_get_right_margin gtk_text_view_get_tabs gtk_text_view_get_type G_GNUC_CONST +gtk_text_view_get_vadjustment gtk_text_view_get_visible_rect gtk_text_view_get_window gtk_text_view_get_window_type gtk_text_view_get_wrap_mode +gtk_text_view_im_context_filter_keypress gtk_text_view_move_child gtk_text_view_move_mark_onscreen gtk_text_view_move_visually gtk_text_view_new gtk_text_view_new_with_buffer gtk_text_view_place_cursor_onscreen +gtk_text_view_reset_im_context gtk_text_view_scroll_mark_onscreen gtk_text_view_scroll_to_iter gtk_text_view_scroll_to_mark @@ -4310,17 +3680,6 @@ gtk_theme_engine_get_type G_GNUC_CONST #endif #endif -#if IN_HEADER(__GTK_TIPS_QUERY_H__) -#if IN_FILE(__GTK_TIPS_QUERY_C__) -gtk_tips_query_get_type G_GNUC_CONST -gtk_tips_query_new -gtk_tips_query_set_caller -gtk_tips_query_set_labels -gtk_tips_query_start_query -gtk_tips_query_stop_query -#endif -#endif - #if IN_HEADER(__GTK_TOGGLE_ACTION_H__) #if IN_FILE(__GTK_TOGGLE_ACTION_C__) gtk_toggle_action_get_active @@ -4361,50 +3720,22 @@ gtk_toggle_tool_button_set_active #if IN_HEADER(__GTK_TOOLBAR_H__) #if IN_FILE(__GTK_TOOLBAR_C__) -#ifndef GTK_DISABLE_DEPRECATED -gtk_toolbar_append_element -gtk_toolbar_set_icon_size -gtk_toolbar_unset_icon_size -gtk_toolbar_append_item -gtk_toolbar_prepend_element -gtk_toolbar_prepend_item -gtk_toolbar_insert_element -gtk_toolbar_insert_item -gtk_toolbar_insert_space -gtk_toolbar_insert_stock -gtk_toolbar_append_space -gtk_toolbar_prepend_space -gtk_toolbar_remove_space -gtk_toolbar_append_widget -gtk_toolbar_insert_widget -gtk_toolbar_prepend_widget -#endif gtk_toolbar_get_drop_index gtk_toolbar_get_icon_size gtk_toolbar_get_item_index gtk_toolbar_get_n_items gtk_toolbar_get_nth_item -#ifndef GTK_DISABLE_DEPRECATED -gtk_toolbar_get_orientation -#endif gtk_toolbar_get_relief_style gtk_toolbar_get_show_arrow gtk_toolbar_get_style -#ifndef GTK_DISABLE_DEPRECATED -gtk_toolbar_get_tooltips -#endif gtk_toolbar_get_type G_GNUC_CONST gtk_toolbar_insert gtk_toolbar_new gtk_toolbar_set_drop_highlight_item -#ifndef GTK_DISABLE_DEPRECATED -gtk_toolbar_set_orientation -#endif +gtk_toolbar_set_icon_size gtk_toolbar_set_show_arrow gtk_toolbar_set_style -#ifndef GTK_DISABLE_DEPRECATED -gtk_toolbar_set_tooltips -#endif +gtk_toolbar_unset_icon_size gtk_toolbar_unset_style #endif #endif @@ -4469,9 +3800,6 @@ gtk_tool_item_set_expand gtk_tool_item_set_homogeneous gtk_tool_item_set_is_important gtk_tool_item_set_proxy_menu_item -#ifndef GTK_DISABLE_DEPRECATED -gtk_tool_item_set_tooltip -#endif gtk_tool_item_set_tooltip_markup gtk_tool_item_set_tooltip_text gtk_tool_item_set_use_drag_window @@ -4547,22 +3875,6 @@ gtk_tooltip_trigger_tooltip_query #endif #endif -#if IN_HEADER(__GTK_TOOLTIPS_H__) -#if IN_FILE(__GTK_TOOLTIPS_C__) -#ifndef GTK_DISABLE_DEPRECATED -gtk_tooltips_data_get -gtk_tooltips_disable -gtk_tooltips_enable -gtk_tooltips_force_window -gtk_tooltips_get_info_from_tip_window -gtk_tooltips_get_type G_GNUC_CONST -gtk_tooltips_new -gtk_tooltips_set_delay -gtk_tooltips_set_tip -#endif -#endif -#endif - #if IN_HEADER(__GTK_TRAY_ICON_H__) #if IN_FILE(__GTK_TRAY_ICON_X11_C__) #ifndef G_OS_WIN32 @@ -4571,27 +3883,6 @@ gtk_tray_icon_get_type G_GNUC_CONST #endif #endif -#if IN_HEADER(__GTK_TREE_H__) -#if IN_FILE(__GTK_TREE_C__) -gtk_tree_append -gtk_tree_child_position -gtk_tree_clear_items -gtk_tree_get_type G_GNUC_CONST -gtk_tree_insert -gtk_tree_prepend -gtk_tree_remove_item -gtk_tree_remove_items -gtk_tree_select_child -gtk_tree_select_item -gtk_tree_set_selection_mode -gtk_tree_set_view_lines -gtk_tree_set_view_mode -gtk_tree_unselect_child -gtk_tree_unselect_item -gtk_tree_new -#endif -#endif - #if IN_HEADER(__GTK_TREE_DND_H__) #if IN_FILE(__GTK_TREE_DND_C__) gtk_tree_drag_dest_drag_data_received @@ -4606,20 +3897,6 @@ gtk_tree_set_row_drag_data #endif #endif -#if IN_HEADER(__GTK_TREE_ITEM_H__) -#if IN_FILE(__GTK_TREE_ITEM_C__) -gtk_tree_item_collapse -gtk_tree_item_deselect -gtk_tree_item_expand -gtk_tree_item_get_type G_GNUC_CONST -gtk_tree_item_new -gtk_tree_item_new_with_label -gtk_tree_item_remove_subtree -gtk_tree_item_select -gtk_tree_item_set_subtree -#endif -#endif - #if IN_HEADER(__GTK_TREE_MODEL_H__) #if IN_FILE(__GTK_TREE_MODEL_C__) gtk_tree_iter_copy @@ -4658,6 +3935,7 @@ gtk_tree_path_down gtk_tree_path_free gtk_tree_path_get_depth gtk_tree_path_get_indices +gtk_tree_path_get_indices_with_depth gtk_tree_path_get_type G_GNUC_CONST gtk_tree_path_is_ancestor gtk_tree_path_is_descendant @@ -4795,9 +4073,6 @@ gtk_tree_view_column_clear_attributes gtk_tree_view_column_clicked gtk_tree_view_column_focus_cell gtk_tree_view_column_get_alignment -#ifndef GTK_DISABLE_DEPRECATED -gtk_tree_view_column_get_cell_renderers -#endif gtk_tree_view_column_get_clickable gtk_tree_view_column_get_expand gtk_tree_view_column_get_fixed_width @@ -4939,14 +4214,8 @@ gtk_tree_view_set_tooltip_row gtk_tree_view_set_tooltip_cell gtk_tree_view_set_tooltip_column gtk_tree_view_set_vadjustment -#ifndef GTK_DISABLE_DEPRECATED -gtk_tree_view_tree_to_widget_coords -#endif gtk_tree_view_unset_rows_drag_dest gtk_tree_view_unset_rows_drag_source -#ifndef GTK_DISABLE_DEPRECATED -gtk_tree_view_widget_to_tree_coords -#endif gtk_tree_view_columns_autosize #endif #endif @@ -4954,16 +4223,6 @@ gtk_tree_view_columns_autosize #if IN_HEADER(__GTK_TYPE_UTILS_H__) #if IN_FILE(__GTK_TYPE_UTILS_C__) gtk_identifier_get_type G_GNUC_CONST -#ifndef GTK_DISABLE_DEPRECATED -gtk_type_enum_find_value -gtk_type_enum_get_values -gtk_type_flags_find_value -gtk_type_flags_get_values -gtk_type_init -gtk_type_new -gtk_type_unique -gtk_type_class -#endif #endif #endif @@ -5004,12 +4263,6 @@ gtk_vbox_new #if IN_HEADER(__GTK_VBBOX_H__) #if IN_FILE(__GTK_VBBOX_C__) -#ifndef GTK_DISABLE_DEPRECATED -gtk_vbutton_box_get_layout_default -gtk_vbutton_box_get_spacing_default -gtk_vbutton_box_set_layout_default -gtk_vbutton_box_set_spacing_default -#endif gtk_vbutton_box_get_type G_GNUC_CONST gtk_vbutton_box_new #endif @@ -5081,6 +4334,7 @@ gtk_widget_activate gtk_widget_is_composited gtk_widget_add_accelerator gtk_widget_add_events +gtk_widget_add_device_events gtk_widget_add_mnemonic_label gtk_widget_can_activate_accel gtk_widget_child_focus @@ -5115,6 +4369,7 @@ gtk_widget_get_direction gtk_widget_get_display gtk_widget_get_double_buffered gtk_widget_get_events +gtk_widget_get_device_events gtk_widget_get_extension_events gtk_widget_get_has_tooltip gtk_widget_get_modifier_style @@ -5169,22 +4424,13 @@ gtk_widget_modify_cursor gtk_widget_modify_font gtk_widget_modify_style gtk_widget_modify_text +gtk_widget_modify_symbolic_color gtk_widget_new gtk_widget_path gtk_widget_pop_colormap gtk_widget_pop_composite_child gtk_widget_push_colormap gtk_widget_push_composite_child -#ifndef GTK_DISABLE_DEPRECATED -gtk_widget_draw -gtk_widget_queue_clear -gtk_widget_queue_clear_area -gtk_widget_set -gtk_widget_set_uposition -gtk_widget_set_usize -gtk_widget_ref -gtk_widget_unref -#endif gtk_widget_queue_draw gtk_widget_queue_draw_area gtk_widget_queue_resize @@ -5198,6 +4444,7 @@ gtk_widget_reparent gtk_widget_reset_rc_styles gtk_widget_reset_shapes gtk_widget_send_expose +gtk_widget_send_focus_change gtk_widget_set_accel_path gtk_widget_set_allocation gtk_widget_set_app_paintable @@ -5209,6 +4456,7 @@ gtk_widget_set_default_direction gtk_widget_set_direction gtk_widget_set_double_buffered gtk_widget_set_events +gtk_widget_set_device_events gtk_widget_set_extension_events gtk_widget_set_has_tooltip gtk_widget_set_name @@ -5255,6 +4503,9 @@ gtk_widget_set_realized gtk_widget_get_realized gtk_widget_set_mapped gtk_widget_get_mapped +gtk_widget_get_support_multidevice +gtk_widget_set_support_multidevice +gtk_widget_device_is_shadowed #endif #endif @@ -5308,6 +4559,8 @@ gtk_window_group_get_type G_GNUC_CONST gtk_window_group_new gtk_window_group_remove_window gtk_window_group_list_windows +gtk_window_group_get_current_device_grab +gtk_window_has_group gtk_window_has_toplevel_focus gtk_window_iconify gtk_window_is_active @@ -5364,9 +4617,6 @@ gtk_window_set_mnemonics_visible gtk_window_set_modal gtk_window_set_opacity gtk_window_get_opacity -#ifndef GTK_DISABLE_DEPRECATED -gtk_window_set_policy -#endif gtk_window_set_position gtk_window_set_resizable gtk_window_set_role diff --git a/gtk/gtkaboutdialog.c b/gtk/gtkaboutdialog.c index affb9466ee..6b17f1c2ec 100644 --- a/gtk/gtkaboutdialog.c +++ b/gtk/gtkaboutdialog.c @@ -121,8 +121,7 @@ static GdkColor default_link_color = { 0, 0, 0, 0xeeee }; static GdkColor default_visited_link_color = { 0, 0x5555, 0x1a1a, 0x8b8b }; -typedef struct _GtkAboutDialogPrivate GtkAboutDialogPrivate; -struct _GtkAboutDialogPrivate +struct _GtkAboutDialogPrivate { gchar *name; gchar *version; @@ -195,9 +194,10 @@ static void follow_if_link (GtkAboutDialog GtkTextView *text_view, GtkTextIter *iter); static void set_cursor_if_appropriate (GtkAboutDialog *about, - GtkTextView *text_view, - gint x, - gint y); + GtkTextView *text_view, + GdkDevice *device, + gint x, + gint y); static void display_credits_dialog (GtkWidget *button, gpointer data); static void display_license_dialog (GtkWidget *button, @@ -548,10 +548,11 @@ gtk_about_dialog_init (GtkAboutDialog *about) GtkDialog *dialog = GTK_DIALOG (about); GtkAboutDialogPrivate *priv; GtkWidget *vbox, *hbox, *button, *close_button, *image; + GtkWidget *content_area, *action_area; /* Data */ priv = GTK_ABOUT_DIALOG_GET_PRIVATE (about); - about->private_data = priv; + about->priv = priv; priv->name = NULL; priv->version = NULL; @@ -570,17 +571,20 @@ gtk_about_dialog_init (GtkAboutDialog *about) priv->hovering_over_link = FALSE; priv->wrap_license = FALSE; + content_area = gtk_dialog_get_content_area (dialog); + action_area = gtk_dialog_get_action_area (dialog); + gtk_dialog_set_has_separator (dialog, FALSE); gtk_container_set_border_width (GTK_CONTAINER (dialog), 5); - gtk_box_set_spacing (GTK_BOX (dialog->vbox), 2); /* 2 * 5 + 2 = 12 */ - gtk_container_set_border_width (GTK_CONTAINER (dialog->action_area), 5); + gtk_box_set_spacing (GTK_BOX (content_area), 2); /* 2 * 5 + 2 = 12 */ + gtk_container_set_border_width (GTK_CONTAINER (action_area), 5); /* Widgets */ gtk_widget_push_composite_child (); vbox = gtk_vbox_new (FALSE, 8); gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); - gtk_box_pack_start (GTK_BOX (dialog->vbox), vbox, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0); priv->logo_image = gtk_image_new (); gtk_box_pack_start (GTK_BOX (vbox), priv->logo_image, FALSE, FALSE, 0); @@ -627,9 +631,9 @@ gtk_about_dialog_init (GtkAboutDialog *about) image = gtk_image_new_from_stock (GTK_STOCK_ABOUT, GTK_ICON_SIZE_BUTTON); gtk_button_set_image (GTK_BUTTON (button), image); gtk_widget_set_no_show_all (button, TRUE); - gtk_box_pack_end (GTK_BOX (GTK_DIALOG (about)->action_area), - button, FALSE, TRUE, 0); - gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (GTK_DIALOG (about)->action_area), button, TRUE); + gtk_box_pack_end (GTK_BOX (action_area), + button, FALSE, TRUE, 0); + gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (action_area), button, TRUE); g_signal_connect (button, "clicked", G_CALLBACK (display_credits_dialog), about); priv->credits_button = button; @@ -639,9 +643,9 @@ gtk_about_dialog_init (GtkAboutDialog *about) button = gtk_button_new_from_stock (_("_License")); gtk_widget_set_can_default (button, TRUE); gtk_widget_set_no_show_all (button, TRUE); - gtk_box_pack_end (GTK_BOX (GTK_DIALOG (about)->action_area), - button, FALSE, TRUE, 0); - gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (GTK_DIALOG (about)->action_area), button, TRUE); + gtk_box_pack_end (GTK_BOX (action_area), + button, FALSE, TRUE, 0); + gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (action_area), button, TRUE); g_signal_connect (button, "clicked", G_CALLBACK (display_license_dialog), about); priv->license_button = button; @@ -663,7 +667,7 @@ static void gtk_about_dialog_finalize (GObject *object) { GtkAboutDialog *about = GTK_ABOUT_DIALOG (object); - GtkAboutDialogPrivate *priv = (GtkAboutDialogPrivate *)about->private_data; + GtkAboutDialogPrivate *priv = about->priv; g_free (priv->name); g_free (priv->version); @@ -694,7 +698,7 @@ gtk_about_dialog_set_property (GObject *object, GParamSpec *pspec) { GtkAboutDialog *about = GTK_ABOUT_DIALOG (object); - GtkAboutDialogPrivate *priv = (GtkAboutDialogPrivate *)about->private_data; + GtkAboutDialogPrivate *priv = about->priv; switch (prop_id) { @@ -753,9 +757,9 @@ gtk_about_dialog_get_property (GObject *object, GParamSpec *pspec) { GtkAboutDialog *about = GTK_ABOUT_DIALOG (object); - GtkAboutDialogPrivate *priv = (GtkAboutDialogPrivate *)about->private_data; - - switch (prop_id) + GtkAboutDialogPrivate *priv = about->priv; + + switch (prop_id) { case PROP_NAME: g_value_set_string (value, priv->name); @@ -819,7 +823,7 @@ gtk_about_dialog_get_property (GObject *object, static void update_website (GtkAboutDialog *about) { - GtkAboutDialogPrivate *priv = (GtkAboutDialogPrivate *)about->private_data; + GtkAboutDialogPrivate *priv = about->priv; gtk_widget_show (priv->website_label); @@ -864,25 +868,6 @@ gtk_about_dialog_show (GtkWidget *widget) GTK_WIDGET_CLASS (gtk_about_dialog_parent_class)->show (widget); } -/** - * gtk_about_dialog_get_name: - * @about: a #GtkAboutDialog - * - * Returns the program name displayed in the about dialog. - * - * Return value: The program name. The string is owned by the about - * dialog and must not be modified. - * - * Since: 2.6 - * - * Deprecated: 2.12: Use gtk_about_dialog_get_program_name() instead. - */ -G_CONST_RETURN gchar * -gtk_about_dialog_get_name (GtkAboutDialog *about) -{ - return gtk_about_dialog_get_program_name (about); -} - /** * gtk_about_dialog_get_program_name: * @about: a #GtkAboutDialog @@ -901,7 +886,7 @@ gtk_about_dialog_get_program_name (GtkAboutDialog *about) g_return_val_if_fail (GTK_IS_ABOUT_DIALOG (about), NULL); - priv = (GtkAboutDialogPrivate *)about->private_data; + priv = about->priv; return priv->name; } @@ -912,7 +897,7 @@ update_name_version (GtkAboutDialog *about) GtkAboutDialogPrivate *priv; gchar *title_string, *name_string; - priv = (GtkAboutDialogPrivate *)about->private_data; + priv = about->priv; title_string = g_strdup_printf (_("About %s"), priv->name); gtk_window_set_title (GTK_WINDOW (about), title_string); @@ -930,25 +915,6 @@ update_name_version (GtkAboutDialog *about) g_free (name_string); } -/** - * gtk_about_dialog_set_name: - * @about: a #GtkAboutDialog - * @name: (allow-none): the program name - * - * Sets the name to display in the about dialog. - * If this is not set, it defaults to g_get_application_name(). - * - * Since: 2.6 - * - * Deprecated: 2.12: Use gtk_about_dialog_set_program_name() instead. - */ -void -gtk_about_dialog_set_name (GtkAboutDialog *about, - const gchar *name) -{ - gtk_about_dialog_set_program_name (about, name); -} - /** * gtk_about_dialog_set_program_name: * @about: a #GtkAboutDialog @@ -968,7 +934,8 @@ gtk_about_dialog_set_program_name (GtkAboutDialog *about, g_return_if_fail (GTK_IS_ABOUT_DIALOG (about)); - priv = (GtkAboutDialogPrivate *)about->private_data; + priv = about->priv; + tmp = priv->name; priv->name = g_strdup (name ? name : g_get_application_name ()); g_free (tmp); @@ -993,13 +960,9 @@ gtk_about_dialog_set_program_name (GtkAboutDialog *about, G_CONST_RETURN gchar * gtk_about_dialog_get_version (GtkAboutDialog *about) { - GtkAboutDialogPrivate *priv; - g_return_val_if_fail (GTK_IS_ABOUT_DIALOG (about), NULL); - priv = (GtkAboutDialogPrivate *)about->private_data; - - return priv->version; + return about->priv->version; } /** @@ -1020,7 +983,7 @@ gtk_about_dialog_set_version (GtkAboutDialog *about, g_return_if_fail (GTK_IS_ABOUT_DIALOG (about)); - priv = (GtkAboutDialogPrivate *)about->private_data; + priv = about->priv; tmp = priv->version; priv->version = g_strdup (version); @@ -1045,13 +1008,9 @@ gtk_about_dialog_set_version (GtkAboutDialog *about, G_CONST_RETURN gchar * gtk_about_dialog_get_copyright (GtkAboutDialog *about) { - GtkAboutDialogPrivate *priv; - g_return_val_if_fail (GTK_IS_ABOUT_DIALOG (about), NULL); - priv = (GtkAboutDialogPrivate *)about->private_data; - - return priv->copyright; + return about->priv->copyright; } /** @@ -1073,7 +1032,7 @@ gtk_about_dialog_set_copyright (GtkAboutDialog *about, g_return_if_fail (GTK_IS_ABOUT_DIALOG (about)); - priv = (GtkAboutDialogPrivate *)about->private_data; + priv = about->priv; tmp = priv->copyright; priv->copyright = g_strdup (copyright); @@ -1108,13 +1067,9 @@ gtk_about_dialog_set_copyright (GtkAboutDialog *about, G_CONST_RETURN gchar * gtk_about_dialog_get_comments (GtkAboutDialog *about) { - GtkAboutDialogPrivate *priv; - g_return_val_if_fail (GTK_IS_ABOUT_DIALOG (about), NULL); - priv = (GtkAboutDialogPrivate *)about->private_data; - - return priv->comments; + return about->priv->comments; } /** @@ -1136,7 +1091,7 @@ gtk_about_dialog_set_comments (GtkAboutDialog *about, g_return_if_fail (GTK_IS_ABOUT_DIALOG (about)); - priv = (GtkAboutDialogPrivate *)about->private_data; + priv = about->priv; tmp = priv->comments; if (comments) @@ -1169,13 +1124,9 @@ gtk_about_dialog_set_comments (GtkAboutDialog *about, G_CONST_RETURN gchar * gtk_about_dialog_get_license (GtkAboutDialog *about) { - GtkAboutDialogPrivate *priv; - g_return_val_if_fail (GTK_IS_ABOUT_DIALOG (about), NULL); - priv = (GtkAboutDialogPrivate *)about->private_data; - - return priv->license; + return about->priv->license; } /** @@ -1198,7 +1149,7 @@ gtk_about_dialog_set_license (GtkAboutDialog *about, g_return_if_fail (GTK_IS_ABOUT_DIALOG (about)); - priv = (GtkAboutDialogPrivate *)about->private_data; + priv = about->priv; tmp = priv->license; if (license) @@ -1230,13 +1181,9 @@ gtk_about_dialog_set_license (GtkAboutDialog *about, gboolean gtk_about_dialog_get_wrap_license (GtkAboutDialog *about) { - GtkAboutDialogPrivate *priv; - g_return_val_if_fail (GTK_IS_ABOUT_DIALOG (about), FALSE); - priv = (GtkAboutDialogPrivate *)about->private_data; - - return priv->wrap_license; + return about->priv->wrap_license; } /** @@ -1257,7 +1204,7 @@ gtk_about_dialog_set_wrap_license (GtkAboutDialog *about, g_return_if_fail (GTK_IS_ABOUT_DIALOG (about)); - priv = (GtkAboutDialogPrivate *)about->private_data; + priv = about->priv; wrap_license = wrap_license != FALSE; @@ -1287,7 +1234,7 @@ gtk_about_dialog_get_website (GtkAboutDialog *about) g_return_val_if_fail (GTK_IS_ABOUT_DIALOG (about), NULL); - priv = (GtkAboutDialogPrivate *)about->private_data; + priv = about->priv; return priv->website_url; } @@ -1313,7 +1260,7 @@ gtk_about_dialog_set_website (GtkAboutDialog *about, g_return_if_fail (GTK_IS_ABOUT_DIALOG (about)); - priv = (GtkAboutDialogPrivate *)about->private_data; + priv = about->priv; tmp = priv->website_url; priv->website_url = g_strdup (website); @@ -1342,7 +1289,7 @@ gtk_about_dialog_get_website_label (GtkAboutDialog *about) g_return_val_if_fail (GTK_IS_ABOUT_DIALOG (about), NULL); - priv = (GtkAboutDialogPrivate *)about->private_data; + priv = about->priv; return priv->website_text; } @@ -1366,7 +1313,7 @@ gtk_about_dialog_set_website_label (GtkAboutDialog *about, g_return_if_fail (GTK_IS_ABOUT_DIALOG (about)); - priv = (GtkAboutDialogPrivate *)about->private_data; + priv = about->priv; tmp = priv->website_text; priv->website_text = g_strdup (website_label); @@ -1397,7 +1344,7 @@ gtk_about_dialog_get_authors (GtkAboutDialog *about) g_return_val_if_fail (GTK_IS_ABOUT_DIALOG (about), NULL); - priv = (GtkAboutDialogPrivate *)about->private_data; + priv = about->priv; return (const gchar * const *) priv->authors; } @@ -1405,7 +1352,7 @@ gtk_about_dialog_get_authors (GtkAboutDialog *about) static void update_credits_button_visibility (GtkAboutDialog *about) { - GtkAboutDialogPrivate *priv = about->private_data; + GtkAboutDialogPrivate *priv = about->priv; gboolean show; show = priv->authors != NULL || @@ -1439,7 +1386,7 @@ gtk_about_dialog_set_authors (GtkAboutDialog *about, g_return_if_fail (GTK_IS_ABOUT_DIALOG (about)); - priv = (GtkAboutDialogPrivate *)about->private_data; + priv = about->priv; tmp = priv->authors; priv->authors = g_strdupv ((gchar **)authors); @@ -1470,7 +1417,7 @@ gtk_about_dialog_get_documenters (GtkAboutDialog *about) g_return_val_if_fail (GTK_IS_ABOUT_DIALOG (about), NULL); - priv = (GtkAboutDialogPrivate *)about->private_data; + priv = about->priv; return (const gchar * const *)priv->documenters; } @@ -1494,7 +1441,7 @@ gtk_about_dialog_set_documenters (GtkAboutDialog *about, g_return_if_fail (GTK_IS_ABOUT_DIALOG (about)); - priv = (GtkAboutDialogPrivate *)about->private_data; + priv = about->priv; tmp = priv->documenters; priv->documenters = g_strdupv ((gchar **)documenters); @@ -1525,7 +1472,7 @@ gtk_about_dialog_get_artists (GtkAboutDialog *about) g_return_val_if_fail (GTK_IS_ABOUT_DIALOG (about), NULL); - priv = (GtkAboutDialogPrivate *)about->private_data; + priv = about->priv; return (const gchar * const *)priv->artists; } @@ -1549,7 +1496,7 @@ gtk_about_dialog_set_artists (GtkAboutDialog *about, g_return_if_fail (GTK_IS_ABOUT_DIALOG (about)); - priv = (GtkAboutDialogPrivate *)about->private_data; + priv = about->priv; tmp = priv->artists; priv->artists = g_strdupv ((gchar **)artists); @@ -1575,13 +1522,9 @@ gtk_about_dialog_set_artists (GtkAboutDialog *about, G_CONST_RETURN gchar * gtk_about_dialog_get_translator_credits (GtkAboutDialog *about) { - GtkAboutDialogPrivate *priv; - g_return_val_if_fail (GTK_IS_ABOUT_DIALOG (about), NULL); - priv = (GtkAboutDialogPrivate *)about->private_data; - - return priv->translator_credits; + return about->priv->translator_credits; } /** @@ -1615,7 +1558,7 @@ gtk_about_dialog_set_translator_credits (GtkAboutDialog *about, g_return_if_fail (GTK_IS_ABOUT_DIALOG (about)); - priv = (GtkAboutDialogPrivate *)about->private_data; + priv = about->priv; tmp = priv->translator_credits; priv->translator_credits = g_strdup (translator_credits); @@ -1645,7 +1588,7 @@ gtk_about_dialog_get_logo (GtkAboutDialog *about) g_return_val_if_fail (GTK_IS_ABOUT_DIALOG (about), NULL); - priv = (GtkAboutDialogPrivate *)about->private_data; + priv = about->priv; if (gtk_image_get_storage_type (GTK_IMAGE (priv->logo_image)) == GTK_IMAGE_PIXBUF) return gtk_image_get_pixbuf (GTK_IMAGE (priv->logo_image)); @@ -1690,7 +1633,7 @@ gtk_about_dialog_set_logo (GtkAboutDialog *about, g_return_if_fail (GTK_IS_ABOUT_DIALOG (about)); - priv = (GtkAboutDialogPrivate *)about->private_data; + priv = about->priv; g_object_freeze_notify (G_OBJECT (about)); @@ -1740,7 +1683,7 @@ gtk_about_dialog_get_logo_icon_name (GtkAboutDialog *about) g_return_val_if_fail (GTK_IS_ABOUT_DIALOG (about), NULL); - priv = (GtkAboutDialogPrivate *)about->private_data; + priv = about->priv; if (gtk_image_get_storage_type (GTK_IMAGE (priv->logo_image)) == GTK_IMAGE_ICON_NAME) gtk_image_get_icon_name (GTK_IMAGE (priv->logo_image), &icon_name, NULL); @@ -1767,7 +1710,7 @@ gtk_about_dialog_set_logo_icon_name (GtkAboutDialog *about, g_return_if_fail (GTK_IS_ABOUT_DIALOG (about)); - priv = (GtkAboutDialogPrivate *)about->private_data; + priv = about->priv; g_object_freeze_notify (G_OBJECT (about)); @@ -1787,7 +1730,7 @@ follow_if_link (GtkAboutDialog *about, GtkTextIter *iter) { GSList *tags = NULL, *tagp = NULL; - GtkAboutDialogPrivate *priv = (GtkAboutDialogPrivate *)about->private_data; + GtkAboutDialogPrivate *priv = about->priv; gchar *url = NULL; GtkAboutDialogActivateLinkFunc email_hook, url_hook; gpointer email_hook_data, url_hook_data; @@ -1924,11 +1867,12 @@ text_view_event_after (GtkWidget *text_view, static void set_cursor_if_appropriate (GtkAboutDialog *about, - GtkTextView *text_view, - gint x, - gint y) + GtkTextView *text_view, + GdkDevice *device, + gint x, + gint y) { - GtkAboutDialogPrivate *priv = (GtkAboutDialogPrivate *)about->private_data; + GtkAboutDialogPrivate *priv = about->priv; GSList *tags = NULL, *tagp = NULL; GtkTextIter iter; gboolean hovering_over_link = FALSE; @@ -1954,9 +1898,9 @@ set_cursor_if_appropriate (GtkAboutDialog *about, priv->hovering_over_link = hovering_over_link; if (hovering_over_link) - gdk_window_set_cursor (gtk_text_view_get_window (text_view, GTK_TEXT_WINDOW_TEXT), priv->hand_cursor); + gdk_window_set_device_cursor (gtk_text_view_get_window (text_view, GTK_TEXT_WINDOW_TEXT), device, priv->hand_cursor); else - gdk_window_set_cursor (gtk_text_view_get_window (text_view, GTK_TEXT_WINDOW_TEXT), priv->regular_cursor); + gdk_window_set_device_cursor (gtk_text_view_get_window (text_view, GTK_TEXT_WINDOW_TEXT), device, priv->regular_cursor); } if (tags) @@ -1974,7 +1918,7 @@ text_view_motion_notify_event (GtkWidget *text_view, GTK_TEXT_WINDOW_WIDGET, event->x, event->y, &x, &y); - set_cursor_if_appropriate (about, GTK_TEXT_VIEW (text_view), x, y); + set_cursor_if_appropriate (about, GTK_TEXT_VIEW (text_view), event->device, x, y); gdk_event_request_motions (event); @@ -1987,15 +1931,27 @@ text_view_visibility_notify_event (GtkWidget *text_view, GdkEventVisibility *event, GtkAboutDialog *about) { + GdkDeviceManager *device_manager; + GdkDisplay *display; + GList *devices, *d; gint wx, wy, bx, by; - gdk_window_get_pointer (text_view->window, &wx, &wy, NULL); + display = gdk_drawable_get_display (event->window); + device_manager = gdk_display_get_device_manager (display); + devices = gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_MASTER); - gtk_text_view_window_to_buffer_coords (GTK_TEXT_VIEW (text_view), - GTK_TEXT_WINDOW_WIDGET, - wx, wy, &bx, &by); + for (d = devices; d; d = d->next) + { + GdkDevice *dev = d->data; - set_cursor_if_appropriate (about, GTK_TEXT_VIEW (text_view), bx, by); + gdk_window_get_device_position (text_view->window, dev, &wx, &wy, NULL); + + gtk_text_view_window_to_buffer_coords (GTK_TEXT_VIEW (text_view), + GTK_TEXT_WINDOW_WIDGET, + wx, wy, &bx, &by); + + set_cursor_if_appropriate (about, GTK_TEXT_VIEW (text_view), dev, bx, by); + } return FALSE; } @@ -2017,7 +1973,8 @@ text_view_new (GtkAboutDialog *about, GdkColor color; GdkColor link_color; GdkColor visited_link_color; - GtkAboutDialogPrivate *priv = (GtkAboutDialogPrivate *)about->private_data; + + GtkAboutDialogPrivate *priv = about->priv; linkify_email = (!activate_email_hook_set || activate_email_hook != NULL); linkify_urls = (!activate_url_hook_set || activate_url_hook != NULL); @@ -2173,9 +2130,11 @@ display_credits_dialog (GtkWidget *button, gpointer data) { GtkAboutDialog *about = (GtkAboutDialog *)data; - GtkAboutDialogPrivate *priv = (GtkAboutDialogPrivate *)about->private_data; + GtkAboutDialogPrivate *priv = about->priv; GtkWidget *dialog, *notebook; GtkDialog *credits_dialog; + GtkWidget *content_area; + GtkWidget *action_area; if (priv->credits_dialog != NULL) { @@ -2189,10 +2148,14 @@ display_credits_dialog (GtkWidget *button, GTK_STOCK_CLOSE, GTK_RESPONSE_CANCEL, NULL); credits_dialog = GTK_DIALOG (dialog); + + content_area = gtk_dialog_get_content_area (credits_dialog); + action_area = gtk_dialog_get_action_area (credits_dialog); + gtk_dialog_set_has_separator (credits_dialog, FALSE); gtk_container_set_border_width (GTK_CONTAINER (credits_dialog), 5); - gtk_box_set_spacing (GTK_BOX (credits_dialog->vbox), 2); /* 2 * 5 + 2 = 12 */ - gtk_container_set_border_width (GTK_CONTAINER (credits_dialog->action_area), 5); + gtk_box_set_spacing (GTK_BOX (content_area), 2); /* 2 * 5 + 2 = 12 */ + gtk_container_set_border_width (GTK_CONTAINER (action_area), 5); priv->credits_dialog = dialog; gtk_window_set_default_size (GTK_WINDOW (dialog), 360, 260); @@ -2209,7 +2172,7 @@ display_credits_dialog (GtkWidget *button, notebook = gtk_notebook_new (); gtk_container_set_border_width (GTK_CONTAINER (notebook), 5); - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), notebook, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (content_area), notebook, TRUE, TRUE, 0); if (priv->authors != NULL) add_credits_page (about, dialog, notebook, _("Written by"), priv->authors); @@ -2249,9 +2212,11 @@ display_license_dialog (GtkWidget *button, gpointer data) { GtkAboutDialog *about = (GtkAboutDialog *)data; - GtkAboutDialogPrivate *priv = (GtkAboutDialogPrivate *)about->private_data; + GtkAboutDialogPrivate *priv = about->priv; GtkWidget *dialog, *view, *sw; - GtkDialog *licence_dialog; + GtkDialog *license_dialog; + GtkWidget *content_area; + GtkWidget *action_area; gchar *strings[2]; if (priv->license_dialog != NULL) @@ -2261,19 +2226,23 @@ display_license_dialog (GtkWidget *button, } dialog = gtk_dialog_new_with_buttons (_("License"), - GTK_WINDOW (about), - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_STOCK_CLOSE, GTK_RESPONSE_CANCEL, - NULL); - licence_dialog = GTK_DIALOG (dialog); - gtk_dialog_set_has_separator (licence_dialog, FALSE); - gtk_container_set_border_width (GTK_CONTAINER (licence_dialog), 5); - gtk_box_set_spacing (GTK_BOX (licence_dialog->vbox), 2); /* 2 * 5 + 2 = 12 */ - gtk_container_set_border_width (GTK_CONTAINER (licence_dialog->action_area), 5); + GTK_WINDOW (about), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_STOCK_CLOSE, GTK_RESPONSE_CANCEL, + NULL); + license_dialog = GTK_DIALOG (dialog); + + content_area = gtk_dialog_get_content_area (license_dialog); + action_area = gtk_dialog_get_action_area (license_dialog); + + gtk_dialog_set_has_separator (license_dialog, FALSE); + gtk_container_set_border_width (GTK_CONTAINER (license_dialog), 5); + gtk_box_set_spacing (GTK_BOX (content_area), 2); /* 2 * 5 + 2 = 12 */ + gtk_container_set_border_width (GTK_CONTAINER (action_area), 5); priv->license_dialog = dialog; gtk_window_set_default_size (GTK_WINDOW (dialog), 420, 320); - gtk_dialog_set_default_response (licence_dialog, GTK_RESPONSE_CANCEL); + gtk_dialog_set_default_response (license_dialog, GTK_RESPONSE_CANCEL); gtk_window_set_modal (GTK_WINDOW (dialog), gtk_window_get_modal (GTK_WINDOW (about))); @@ -2292,7 +2261,7 @@ display_license_dialog (GtkWidget *button, GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); g_signal_connect (sw, "map", G_CALLBACK (set_policy), NULL); - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), sw, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (content_area), sw, TRUE, TRUE, 0); strings[0] = priv->license; strings[1] = NULL; @@ -2396,7 +2365,7 @@ gtk_about_dialog_set_url_hook (GtkAboutDialogActivateLinkFunc func, static void close_cb (GtkAboutDialog *about) { - GtkAboutDialogPrivate *priv = (GtkAboutDialogPrivate *)about->private_data; + GtkAboutDialogPrivate *priv = about->priv; if (priv->license_dialog != NULL) { diff --git a/gtk/gtkaboutdialog.h b/gtk/gtkaboutdialog.h index efb50b1cf0..5bcd67c662 100644 --- a/gtk/gtkaboutdialog.h +++ b/gtk/gtkaboutdialog.h @@ -22,7 +22,7 @@ Author: Anders Carlsson */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -42,6 +42,7 @@ G_BEGIN_DECLS typedef struct _GtkAboutDialog GtkAboutDialog; typedef struct _GtkAboutDialogClass GtkAboutDialogClass; +typedef struct _GtkAboutDialogPrivate GtkAboutDialogPrivate; /** * GtkAboutDialog: @@ -54,7 +55,7 @@ struct _GtkAboutDialog GtkDialog parent_instance; /*< private >*/ - gpointer GSEAL (private_data); + GtkAboutDialogPrivate *priv; }; struct _GtkAboutDialogClass @@ -73,12 +74,6 @@ GtkWidget *gtk_about_dialog_new (void); void gtk_show_about_dialog (GtkWindow *parent, const gchar *first_property_name, ...) G_GNUC_NULL_TERMINATED; - -#ifndef GTK_DISABLE_DEPRECATED -G_CONST_RETURN gchar *gtk_about_dialog_get_name (GtkAboutDialog *about); -void gtk_about_dialog_set_name (GtkAboutDialog *about, - const gchar *name); -#endif /* GTK_DISABLE_DEPRECATED */ G_CONST_RETURN gchar *gtk_about_dialog_get_program_name (GtkAboutDialog *about); void gtk_about_dialog_set_program_name (GtkAboutDialog *about, const gchar *name); diff --git a/gtk/gtkaccelgroup.c b/gtk/gtkaccelgroup.c index 9dbab6f586..b920f8ea73 100644 --- a/gtk/gtkaccelgroup.c +++ b/gtk/gtkaccelgroup.c @@ -29,6 +29,7 @@ #include #include "gtkaccelgroup.h" +#include "gtkaccelgroupprivate.h" #include "gtkaccellabel.h" /* For _gtk_accel_label_class_get_accelerator_label */ #include "gtkaccelmap.h" #include "gtkintl.h" @@ -62,6 +63,7 @@ * and mnemonics, of course. */ +#define GTK_ACCEL_GROUP_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GTK_TYPE_ACCEL_GROUP, GtkAccelGroupPrivate)) /* --- prototypes --- */ static void gtk_accel_group_finalize (GObject *object); @@ -171,6 +173,8 @@ gtk_accel_group_class_init (GtkAccelGroupClass *class) G_TYPE_UINT, GDK_TYPE_MODIFIER_TYPE, G_TYPE_CLOSURE); + + g_type_class_add_private (object_class, sizeof (GtkAccelGroupPrivate)); } static void @@ -179,9 +183,9 @@ gtk_accel_group_finalize (GObject *object) GtkAccelGroup *accel_group = GTK_ACCEL_GROUP (object); guint i; - for (i = 0; i < accel_group->n_accels; i++) + for (i = 0; i < accel_group->priv->n_accels; i++) { - GtkAccelGroupEntry *entry = &accel_group->priv_accels[i]; + GtkAccelGroupEntry *entry = &accel_group->priv->priv_accels[i]; if (entry->accel_path_quark) { @@ -195,7 +199,7 @@ gtk_accel_group_finalize (GObject *object) g_closure_unref (entry->closure); } - g_free (accel_group->priv_accels); + g_free (accel_group->priv->priv_accels); G_OBJECT_CLASS (gtk_accel_group_parent_class)->finalize (object); } @@ -211,10 +215,10 @@ gtk_accel_group_get_property (GObject *object, switch (param_id) { case PROP_IS_LOCKED: - g_value_set_boolean (value, accel_group->lock_count > 0); + g_value_set_boolean (value, accel_group->priv->lock_count > 0); break; case PROP_MODIFIER_MASK: - g_value_set_flags (value, accel_group->modifier_mask); + g_value_set_flags (value, accel_group->priv->modifier_mask); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); @@ -225,11 +229,15 @@ gtk_accel_group_get_property (GObject *object, static void gtk_accel_group_init (GtkAccelGroup *accel_group) { - accel_group->lock_count = 0; - accel_group->modifier_mask = gtk_accelerator_get_default_mod_mask (); - accel_group->acceleratables = NULL; - accel_group->n_accels = 0; - accel_group->priv_accels = NULL; + GtkAccelGroupPrivate *priv = GTK_ACCEL_GROUP_GET_PRIVATE (accel_group); + + priv->lock_count = 0; + priv->modifier_mask = gtk_accelerator_get_default_mod_mask (); + priv->acceleratables = NULL; + priv->n_accels = 0; + priv->priv_accels = NULL; + + accel_group->priv = priv; } /** @@ -261,7 +269,7 @@ gtk_accel_group_get_is_locked (GtkAccelGroup *accel_group) { g_return_val_if_fail (GTK_IS_ACCEL_GROUP (accel_group), FALSE); - return accel_group->lock_count > 0; + return accel_group->priv->lock_count > 0; } /** @@ -280,7 +288,7 @@ gtk_accel_group_get_modifier_mask (GtkAccelGroup *accel_group) { g_return_val_if_fail (GTK_IS_ACCEL_GROUP (accel_group), 0); - return accel_group->modifier_mask; + return accel_group->priv->modifier_mask; } static void @@ -294,7 +302,7 @@ accel_group_weak_ref_detach (GSList *free_list, GtkAccelGroup *accel_group; accel_group = slist->data; - accel_group->acceleratables = g_slist_remove (accel_group->acceleratables, stale_object); + accel_group->priv->acceleratables = g_slist_remove (accel_group->priv->acceleratables, stale_object); g_object_unref (accel_group); } g_slist_free (free_list); @@ -309,10 +317,10 @@ _gtk_accel_group_attach (GtkAccelGroup *accel_group, g_return_if_fail (GTK_IS_ACCEL_GROUP (accel_group)); g_return_if_fail (G_IS_OBJECT (object)); - g_return_if_fail (g_slist_find (accel_group->acceleratables, object) == NULL); + g_return_if_fail (g_slist_find (accel_group->priv->acceleratables, object) == NULL); g_object_ref (accel_group); - accel_group->acceleratables = g_slist_prepend (accel_group->acceleratables, object); + accel_group->priv->acceleratables = g_slist_prepend (accel_group->priv->acceleratables, object); slist = g_object_get_qdata (object, quark_acceleratable_groups); if (slist) g_object_weak_unref (object, @@ -333,9 +341,9 @@ _gtk_accel_group_detach (GtkAccelGroup *accel_group, g_return_if_fail (GTK_IS_ACCEL_GROUP (accel_group)); g_return_if_fail (G_IS_OBJECT (object)); - g_return_if_fail (g_slist_find (accel_group->acceleratables, object) != NULL); + g_return_if_fail (g_slist_find (accel_group->priv->acceleratables, object) != NULL); - accel_group->acceleratables = g_slist_remove (accel_group->acceleratables, object); + accel_group->priv->acceleratables = g_slist_remove (accel_group->priv->acceleratables, object); slist = g_object_get_qdata (object, quark_acceleratable_groups); g_object_weak_unref (object, (GWeakNotify) accel_group_weak_ref_detach, @@ -389,12 +397,12 @@ gtk_accel_group_find (GtkAccelGroup *accel_group, g_return_val_if_fail (find_func != NULL, NULL); g_object_ref (accel_group); - for (i = 0; i < accel_group->n_accels; i++) - if (find_func (&accel_group->priv_accels[i].key, - accel_group->priv_accels[i].closure, + for (i = 0; i < accel_group->priv->n_accels; i++) + if (find_func (&accel_group->priv->priv_accels[i].key, + accel_group->priv->priv_accels[i].closure, data)) { - key = &accel_group->priv_accels[i].key; + key = &accel_group->priv->priv_accels[i].key; break; } g_object_unref (accel_group); @@ -421,9 +429,9 @@ gtk_accel_group_lock (GtkAccelGroup *accel_group) { g_return_if_fail (GTK_IS_ACCEL_GROUP (accel_group)); - accel_group->lock_count += 1; + accel_group->priv->lock_count += 1; - if (accel_group->lock_count == 1) { + if (accel_group->priv->lock_count == 1) { /* State change from unlocked to locked */ g_object_notify (G_OBJECT (accel_group), "is-locked"); } @@ -439,11 +447,11 @@ void gtk_accel_group_unlock (GtkAccelGroup *accel_group) { g_return_if_fail (GTK_IS_ACCEL_GROUP (accel_group)); - g_return_if_fail (accel_group->lock_count > 0); + g_return_if_fail (accel_group->priv->lock_count > 0); - accel_group->lock_count -= 1; + accel_group->priv->lock_count -= 1; - if (accel_group->lock_count < 1) { + if (accel_group->priv->lock_count < 1) { /* State change from locked to unlocked */ g_object_notify (G_OBJECT (accel_group), "is-locked"); } @@ -479,25 +487,25 @@ quick_accel_add (GtkAccelGroup *accel_group, GClosure *closure, GQuark path_quark) { - guint pos, i = accel_group->n_accels++; + guint pos, i = accel_group->priv->n_accels++; GtkAccelGroupEntry key; /* find position */ key.key.accel_key = accel_key; key.key.accel_mods = accel_mods; for (pos = 0; pos < i; pos++) - if (bsearch_compare_accels (&key, accel_group->priv_accels + pos) < 0) + if (bsearch_compare_accels (&key, accel_group->priv->priv_accels + pos) < 0) break; /* insert at position, ref closure */ - accel_group->priv_accels = g_renew (GtkAccelGroupEntry, accel_group->priv_accels, accel_group->n_accels); - g_memmove (accel_group->priv_accels + pos + 1, accel_group->priv_accels + pos, - (i - pos) * sizeof (accel_group->priv_accels[0])); - accel_group->priv_accels[pos].key.accel_key = accel_key; - accel_group->priv_accels[pos].key.accel_mods = accel_mods; - accel_group->priv_accels[pos].key.accel_flags = accel_flags; - accel_group->priv_accels[pos].closure = g_closure_ref (closure); - accel_group->priv_accels[pos].accel_path_quark = path_quark; + accel_group->priv->priv_accels = g_renew (GtkAccelGroupEntry, accel_group->priv->priv_accels, accel_group->priv->n_accels); + g_memmove (accel_group->priv->priv_accels + pos + 1, accel_group->priv->priv_accels + pos, + (i - pos) * sizeof (accel_group->priv->priv_accels[0])); + accel_group->priv->priv_accels[pos].key.accel_key = accel_key; + accel_group->priv->priv_accels[pos].key.accel_mods = accel_mods; + accel_group->priv->priv_accels[pos].key.accel_flags = accel_flags; + accel_group->priv->priv_accels[pos].closure = g_closure_ref (closure); + accel_group->priv->priv_accels[pos].accel_path_quark = path_quark; g_closure_sink (closure); /* handle closure invalidation and reverse lookups */ @@ -528,7 +536,7 @@ quick_accel_remove (GtkAccelGroup *accel_group, guint pos) { GQuark accel_quark = 0; - GtkAccelGroupEntry *entry = accel_group->priv_accels + pos; + GtkAccelGroupEntry *entry = accel_group->priv->priv_accels + pos; guint accel_key = entry->key.accel_key; GdkModifierType accel_mods = entry->key.accel_mods; GClosure *closure = entry->closure; @@ -554,9 +562,9 @@ quick_accel_remove (GtkAccelGroup *accel_group, _gtk_accel_map_remove_group (g_quark_to_string (entry->accel_path_quark), accel_group); /* physically remove */ - accel_group->n_accels -= 1; + accel_group->priv->n_accels -= 1; g_memmove (entry, entry + 1, - (accel_group->n_accels - pos) * sizeof (accel_group->priv_accels[0])); + (accel_group->priv->n_accels - pos) * sizeof (accel_group->priv->priv_accels[0])); /* and notify */ if (accel_quark) @@ -577,24 +585,24 @@ quick_accel_find (GtkAccelGroup *accel_group, *count_p = 0; - if (!accel_group->n_accels) + if (!accel_group->priv->n_accels) return NULL; key.key.accel_key = accel_key; key.key.accel_mods = accel_mods; - entry = bsearch (&key, accel_group->priv_accels, accel_group->n_accels, - sizeof (accel_group->priv_accels[0]), bsearch_compare_accels); + entry = bsearch (&key, accel_group->priv->priv_accels, accel_group->priv->n_accels, + sizeof (accel_group->priv->priv_accels[0]), bsearch_compare_accels); if (!entry) return NULL; /* step back to the first member */ - for (; entry > accel_group->priv_accels; entry--) + for (; entry > accel_group->priv->priv_accels; entry--) if (entry[-1].key.accel_key != accel_key || entry[-1].key.accel_mods != accel_mods) break; /* count equal members */ - for (; entry + *count_p < accel_group->priv_accels + accel_group->n_accels; (*count_p)++) + for (; entry + *count_p < accel_group->priv->priv_accels + accel_group->priv->n_accels; (*count_p)++) if (entry[*count_p].key.accel_key != accel_key || entry[*count_p].key.accel_mods != accel_mods) break; @@ -708,8 +716,8 @@ gtk_accel_group_disconnect (GtkAccelGroup *accel_group, g_return_val_if_fail (GTK_IS_ACCEL_GROUP (accel_group), FALSE); - for (i = 0; i < accel_group->n_accels; i++) - if (accel_group->priv_accels[i].closure == closure || !closure) + for (i = 0; i < accel_group->priv->n_accels; i++) + if (accel_group->priv->priv_accels[i].closure == closure) { g_object_ref (accel_group); quick_accel_remove (accel_group, i); @@ -778,10 +786,10 @@ _gtk_accel_group_reconnect (GtkAccelGroup *accel_group, g_object_ref (accel_group); - for (i = 0; i < accel_group->n_accels; i++) - if (accel_group->priv_accels[i].accel_path_quark == accel_path_quark) + for (i = 0; i < accel_group->priv->n_accels; i++) + if (accel_group->priv->priv_accels[i].accel_path_quark == accel_path_quark) { - GClosure *closure = g_closure_ref (accel_group->priv_accels[i].closure); + GClosure *closure = g_closure_ref (accel_group->priv->priv_accels[i].closure); clist = g_slist_prepend (clist, closure); } @@ -799,6 +807,14 @@ _gtk_accel_group_reconnect (GtkAccelGroup *accel_group, g_object_unref (accel_group); } +GSList* +_gtk_accel_group_get_accelerables (GtkAccelGroup *accel_group) +{ + g_return_val_if_fail (GTK_IS_ACCEL_GROUP (accel_group), NULL); + + return accel_group->priv->acceleratables; +} + /** * gtk_accel_group_query: * @accel_group: the accelerator group to query diff --git a/gtk/gtkaccelgroup.h b/gtk/gtkaccelgroup.h index b1e874491e..b00b039202 100644 --- a/gtk/gtkaccelgroup.h +++ b/gtk/gtkaccelgroup.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -57,10 +57,11 @@ typedef enum /* --- typedefs & structures --- */ -typedef struct _GtkAccelGroup GtkAccelGroup; -typedef struct _GtkAccelGroupClass GtkAccelGroupClass; -typedef struct _GtkAccelKey GtkAccelKey; -typedef struct _GtkAccelGroupEntry GtkAccelGroupEntry; +typedef struct _GtkAccelGroup GtkAccelGroup; +typedef struct _GtkAccelGroupClass GtkAccelGroupClass; +typedef struct _GtkAccelGroupPrivate GtkAccelGroupPrivate; +typedef struct _GtkAccelKey GtkAccelKey; +typedef struct _GtkAccelGroupEntry GtkAccelGroupEntry; typedef gboolean (*GtkAccelGroupActivate) (GtkAccelGroup *accel_group, GObject *acceleratable, guint keyval, @@ -85,13 +86,8 @@ typedef gboolean (*GtkAccelGroupFindFunc) (GtkAccelKey *key, */ struct _GtkAccelGroup { - GObject parent; - - guint GSEAL (lock_count); - GdkModifierType GSEAL (modifier_mask); - GSList *GSEAL (acceleratables); - guint GSEAL (n_accels); - GtkAccelGroupEntry *GSEAL (priv_accels); + GObject parent; + GtkAccelGroupPrivate *priv; }; struct _GtkAccelGroupClass @@ -183,6 +179,7 @@ GtkAccelGroupEntry* gtk_accel_group_query (GtkAccelGroup *accel_group, void _gtk_accel_group_reconnect (GtkAccelGroup *accel_group, GQuark accel_path_quark); +GSList* _gtk_accel_group_get_accelerables (GtkAccelGroup *accel_group); struct _GtkAccelGroupEntry { @@ -192,24 +189,6 @@ struct _GtkAccelGroupEntry }; -#ifndef GTK_DISABLE_DEPRECATED -/** - * gtk_accel_group_ref: - * - * Deprecated equivalent of g_object_ref(). - * - * Returns: the accel group that was passed in - */ -#define gtk_accel_group_ref g_object_ref - -/** - * gtk_accel_group_unref: - * - * Deprecated equivalent of g_object_unref(). - */ -#define gtk_accel_group_unref g_object_unref -#endif /* GTK_DISABLE_DEPRECATED */ - G_END_DECLS diff --git a/gtk/gtkaccelgroupprivate.h b/gtk/gtkaccelgroupprivate.h new file mode 100644 index 0000000000..af42d13b3f --- /dev/null +++ b/gtk/gtkaccelgroupprivate.h @@ -0,0 +1,36 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* GTK - The GIMP Toolkit + * Copyright (C) Javier Jardón + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GTK_ACCEL_GROUP_PRIVATE_H__ +#define __GTK_ACCEL_GROUP_PRIVATE_H__ + + +#define GTK_ACCEL_GROUP_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GTK_TYPE_ACCEL_GROUP, GtkAccelGroupPrivate)) + +struct _GtkAccelGroupPrivate +{ + guint lock_count; + GdkModifierType modifier_mask; + GSList *acceleratables; + guint n_accels; + GtkAccelGroupEntry *priv_accels; +}; + +#endif /* __GTK_ACCEL_GROUP_PRIVATE_H__ */ diff --git a/gtk/gtkaccellabel.c b/gtk/gtkaccellabel.c index da982bddf0..c02be06cc5 100644 --- a/gtk/gtkaccellabel.c +++ b/gtk/gtkaccellabel.c @@ -99,6 +99,16 @@ enum { PROP_ACCEL_WIDGET }; +struct _GtkAccelLabelPrivate +{ + guint accel_padding; /* should be style property? */ + GtkWidget *accel_widget; /* done*/ + GClosure *accel_closure; /* has set function */ + GtkAccelGroup *accel_group; /* set by set_accel_closure() */ + gchar *accel_string; /* has set function */ + guint16 accel_string_width; /* seems to be private */ +}; + static void gtk_accel_label_set_property (GObject *object, guint prop_id, const GValue *value, @@ -115,6 +125,7 @@ static gboolean gtk_accel_label_expose_event (GtkWidget *widget, GdkEventExpose *event); static const gchar *gtk_accel_label_get_string (GtkAccelLabel *accel_label); +#define GTK_ACCEL_LABEL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GTK_TYPE_ACCEL_LABEL, GtkAccelLabelPrivate)) G_DEFINE_TYPE (GtkAccelLabel, gtk_accel_label, GTK_TYPE_LABEL) @@ -186,6 +197,8 @@ gtk_accel_label_class_init (GtkAccelLabelClass *class) P_("The widget to be monitored for accelerator changes"), GTK_TYPE_WIDGET, GTK_PARAM_READWRITE)); + + g_type_class_add_private (gobject_class, sizeof (GtkAccelLabelPrivate)); } static void @@ -225,10 +238,10 @@ gtk_accel_label_get_property (GObject *object, switch (prop_id) { case PROP_ACCEL_CLOSURE: - g_value_set_boxed (value, accel_label->accel_closure); + g_value_set_boxed (value, accel_label->priv->accel_closure); break; case PROP_ACCEL_WIDGET: - g_value_set_object (value, accel_label->accel_widget); + g_value_set_object (value, accel_label->priv->accel_widget); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); @@ -239,11 +252,15 @@ gtk_accel_label_get_property (GObject *object, static void gtk_accel_label_init (GtkAccelLabel *accel_label) { - accel_label->accel_padding = 3; - accel_label->accel_widget = NULL; - accel_label->accel_closure = NULL; - accel_label->accel_group = NULL; - accel_label->accel_string = NULL; + GtkAccelLabelPrivate *priv = GTK_ACCEL_LABEL_GET_PRIVATE (accel_label); + + priv->accel_padding = 3; + priv->accel_widget = NULL; + priv->accel_closure = NULL; + priv->accel_group = NULL; + priv->accel_string = NULL; + + accel_label->priv = priv; } /** @@ -284,8 +301,8 @@ gtk_accel_label_finalize (GObject *object) { GtkAccelLabel *accel_label = GTK_ACCEL_LABEL (object); - g_free (accel_label->accel_string); - + g_free (accel_label->priv->accel_string); + G_OBJECT_CLASS (gtk_accel_label_parent_class)->finalize (object); } @@ -303,7 +320,7 @@ gtk_accel_label_get_accel_widget (GtkAccelLabel *accel_label) { g_return_val_if_fail (GTK_IS_ACCEL_LABEL (accel_label), NULL); - return accel_label->accel_widget; + return accel_label->priv->accel_widget; } /** @@ -320,9 +337,9 @@ guint gtk_accel_label_get_accel_width (GtkAccelLabel *accel_label) { g_return_val_if_fail (GTK_IS_ACCEL_LABEL (accel_label), 0); - - return (accel_label->accel_string_width + - (accel_label->accel_string_width ? accel_label->accel_padding : 0)); + + return (accel_label->priv->accel_string_width + + (accel_label->priv->accel_string_width ? accel_label->priv->accel_padding : 0)); } static void @@ -337,8 +354,8 @@ gtk_accel_label_size_request (GtkWidget *widget, layout = gtk_widget_create_pango_layout (widget, gtk_accel_label_get_string (accel_label)); pango_layout_get_pixel_size (layout, &width, NULL); - accel_label->accel_string_width = width; - + accel_label->priv->accel_string_width = width; + g_object_unref (layout); } @@ -365,13 +382,17 @@ gtk_accel_label_expose_event (GtkWidget *widget, direction = gtk_widget_get_direction (widget); - if (gtk_widget_is_drawable (widget)) + if (gtk_widget_is_drawable (widget)) { guint ac_width; - + GtkAllocation allocation; + GtkRequisition requisition; + ac_width = gtk_accel_label_get_accel_width (accel_label); - - if (widget->allocation.width >= widget->requisition.width + ac_width) + gtk_widget_get_allocation (widget, &allocation); + gtk_widget_size_request (widget, &requisition); + + if (allocation.width >= requisition.width + ac_width) { PangoLayout *label_layout; PangoLayout *accel_layout; @@ -379,12 +400,13 @@ gtk_accel_label_expose_event (GtkWidget *widget, gint x; gint y; - + gint xpad; + label_layout = gtk_label_get_layout (GTK_LABEL (accel_label)); if (direction == GTK_TEXT_DIR_RTL) - widget->allocation.x += ac_width; - widget->allocation.width -= ac_width; + allocation.x += ac_width; + allocation.width -= ac_width; if (gtk_label_get_ellipsize (label)) pango_layout_set_width (label_layout, pango_layout_get_width (label_layout) @@ -393,17 +415,19 @@ gtk_accel_label_expose_event (GtkWidget *widget, if (GTK_WIDGET_CLASS (gtk_accel_label_parent_class)->expose_event) GTK_WIDGET_CLASS (gtk_accel_label_parent_class)->expose_event (widget, event); if (direction == GTK_TEXT_DIR_RTL) - widget->allocation.x -= ac_width; - widget->allocation.width += ac_width; + allocation.x -= ac_width; + allocation.width += ac_width; if (gtk_label_get_ellipsize (label)) pango_layout_set_width (label_layout, pango_layout_get_width (label_layout) + ac_width * PANGO_SCALE); - + + gtk_misc_get_padding (misc, &xpad, NULL); + if (direction == GTK_TEXT_DIR_RTL) - x = widget->allocation.x + misc->xpad; + x = allocation.x + xpad; else - x = widget->allocation.x + widget->allocation.width - misc->xpad - ac_width; + x = allocation.x + allocation.width - xpad - ac_width; gtk_label_get_layout_offsets (GTK_LABEL (accel_label), NULL, &y); @@ -411,8 +435,8 @@ gtk_accel_label_expose_event (GtkWidget *widget, y += get_first_baseline (label_layout) - get_first_baseline (accel_layout); - gtk_paint_layout (widget->style, - widget->window, + gtk_paint_layout (gtk_widget_get_style (widget), + gtk_widget_get_window (widget), gtk_widget_get_state (widget), FALSE, &event->area, @@ -440,9 +464,9 @@ refetch_widget_accel_closure (GtkAccelLabel *accel_label) GList *clist, *list; g_return_if_fail (GTK_IS_ACCEL_LABEL (accel_label)); - g_return_if_fail (GTK_IS_WIDGET (accel_label->accel_widget)); + g_return_if_fail (GTK_IS_WIDGET (accel_label->priv->accel_widget)); - clist = gtk_widget_list_accel_closures (accel_label->accel_widget); + clist = gtk_widget_list_accel_closures (accel_label->priv->accel_widget); for (list = clist; list; list = list->next) { /* we just take the first closure used */ @@ -468,21 +492,21 @@ gtk_accel_label_set_accel_widget (GtkAccelLabel *accel_label, if (accel_widget) g_return_if_fail (GTK_IS_WIDGET (accel_widget)); - if (accel_widget != accel_label->accel_widget) + if (accel_widget != accel_label->priv->accel_widget) { - if (accel_label->accel_widget) + if (accel_label->priv->accel_widget) { gtk_accel_label_set_accel_closure (accel_label, NULL); - g_signal_handlers_disconnect_by_func (accel_label->accel_widget, + g_signal_handlers_disconnect_by_func (accel_label->priv->accel_widget, refetch_widget_accel_closure, accel_label); - g_object_unref (accel_label->accel_widget); + g_object_unref (accel_label->priv->accel_widget); } - accel_label->accel_widget = accel_widget; - if (accel_label->accel_widget) + accel_label->priv->accel_widget = accel_widget; + if (accel_label->priv->accel_widget) { - g_object_ref (accel_label->accel_widget); - g_signal_connect_object (accel_label->accel_widget, "accel-closures-changed", + g_object_ref (accel_label->priv->accel_widget); + g_signal_connect_object (accel_label->priv->accel_widget, "accel-closures-changed", G_CALLBACK (refetch_widget_accel_closure), accel_label, G_CONNECT_SWAPPED); refetch_widget_accel_closure (accel_label); @@ -494,10 +518,10 @@ gtk_accel_label_set_accel_widget (GtkAccelLabel *accel_label, static void gtk_accel_label_reset (GtkAccelLabel *accel_label) { - if (accel_label->accel_string) + if (accel_label->priv->accel_string) { - g_free (accel_label->accel_string); - accel_label->accel_string = NULL; + g_free (accel_label->priv->accel_string); + accel_label->priv->accel_string = NULL; } gtk_widget_queue_resize (GTK_WIDGET (accel_label)); @@ -510,7 +534,7 @@ check_accel_changed (GtkAccelGroup *accel_group, GClosure *accel_closure, GtkAccelLabel *accel_label) { - if (accel_closure == accel_label->accel_closure) + if (accel_closure == accel_label->priv->accel_closure) gtk_accel_label_reset (accel_label); } @@ -530,22 +554,22 @@ gtk_accel_label_set_accel_closure (GtkAccelLabel *accel_label, if (accel_closure) g_return_if_fail (gtk_accel_group_from_accel_closure (accel_closure) != NULL); - if (accel_closure != accel_label->accel_closure) + if (accel_closure != accel_label->priv->accel_closure) { - if (accel_label->accel_closure) + if (accel_label->priv->accel_closure) { - g_signal_handlers_disconnect_by_func (accel_label->accel_group, + g_signal_handlers_disconnect_by_func (accel_label->priv->accel_group, check_accel_changed, accel_label); - accel_label->accel_group = NULL; - g_closure_unref (accel_label->accel_closure); + accel_label->priv->accel_group = NULL; + g_closure_unref (accel_label->priv->accel_closure); } - accel_label->accel_closure = accel_closure; - if (accel_label->accel_closure) + accel_label->priv->accel_closure = accel_closure; + if (accel_label->priv->accel_closure) { - g_closure_ref (accel_label->accel_closure); - accel_label->accel_group = gtk_accel_group_from_accel_closure (accel_closure); - g_signal_connect_object (accel_label->accel_group, "accel-changed", + g_closure_ref (accel_label->priv->accel_closure); + accel_label->priv->accel_group = gtk_accel_group_from_accel_closure (accel_closure); + g_signal_connect_object (accel_label->priv->accel_group, "accel-changed", G_CALLBACK (check_accel_changed), accel_label, 0); } @@ -565,10 +589,10 @@ find_accel (GtkAccelKey *key, static const gchar * gtk_accel_label_get_string (GtkAccelLabel *accel_label) { - if (!accel_label->accel_string) + if (!accel_label->priv->accel_string) gtk_accel_label_refetch (accel_label); - return accel_label->accel_string; + return accel_label->priv->accel_string; } /* Underscores in key names are better displayed as spaces @@ -838,19 +862,19 @@ gtk_accel_label_refetch (GtkAccelLabel *accel_label) g_return_val_if_fail (GTK_IS_ACCEL_LABEL (accel_label), FALSE); - if (accel_label->accel_string) + if (accel_label->priv->accel_string) { - g_free (accel_label->accel_string); - accel_label->accel_string = NULL; + g_free (accel_label->priv->accel_string); + accel_label->priv->accel_string = NULL; } g_object_get (gtk_widget_get_settings (GTK_WIDGET (accel_label)), "gtk-enable-accels", &enable_accels, NULL); - if (enable_accels && accel_label->accel_closure) + if (enable_accels && accel_label->priv->accel_closure) { - GtkAccelKey *key = gtk_accel_group_find (accel_label->accel_group, find_accel, accel_label->accel_closure); + GtkAccelKey *key = gtk_accel_group_find (accel_label->priv->accel_group, find_accel, accel_label->priv->accel_closure); if (key && key->accel_flags & GTK_ACCEL_VISIBLE) { @@ -861,15 +885,15 @@ gtk_accel_label_refetch (GtkAccelLabel *accel_label) tmp = _gtk_accel_label_class_get_accelerator_label (klass, key->accel_key, key->accel_mods); - accel_label->accel_string = g_strconcat (" ", tmp, NULL); + accel_label->priv->accel_string = g_strconcat (" ", tmp, NULL); g_free (tmp); } - if (!accel_label->accel_string) - accel_label->accel_string = g_strdup ("-/-"); + if (!accel_label->priv->accel_string) + accel_label->priv->accel_string = g_strdup ("-/-"); } - if (!accel_label->accel_string) - accel_label->accel_string = g_strdup (""); + if (!accel_label->priv->accel_string) + accel_label->priv->accel_string = g_strdup (""); gtk_widget_queue_resize (GTK_WIDGET (accel_label)); diff --git a/gtk/gtkaccellabel.h b/gtk/gtkaccellabel.h index 9ae54b2f8f..3ad0a37c7a 100644 --- a/gtk/gtkaccellabel.h +++ b/gtk/gtkaccellabel.h @@ -27,7 +27,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -48,8 +48,9 @@ G_BEGIN_DECLS #define GTK_ACCEL_LABEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ACCEL_LABEL, GtkAccelLabelClass)) -typedef struct _GtkAccelLabel GtkAccelLabel; -typedef struct _GtkAccelLabelClass GtkAccelLabelClass; +typedef struct _GtkAccelLabel GtkAccelLabel; +typedef struct _GtkAccelLabelClass GtkAccelLabelClass; +typedef struct _GtkAccelLabelPrivate GtkAccelLabelPrivate; /** * GtkAccelLabel: @@ -60,14 +61,7 @@ typedef struct _GtkAccelLabelClass GtkAccelLabelClass; struct _GtkAccelLabel { GtkLabel label; - - guint GSEAL (gtk_reserved); - guint GSEAL (accel_padding); /* should be style property? */ - GtkWidget *GSEAL (accel_widget); /* done*/ - GClosure *GSEAL (accel_closure); /* has set function */ - GtkAccelGroup *GSEAL (accel_group); /* set by set_accel_closure() */ - gchar *GSEAL (accel_string); /* has set function */ - guint16 GSEAL (accel_string_width); /* seems to be private */ + GtkAccelLabelPrivate *priv; }; struct _GtkAccelLabelClass @@ -90,9 +84,6 @@ struct _GtkAccelLabelClass void (*_gtk_reserved4) (void); }; -#ifndef GTK_DISABLE_DEPRECATED -#define gtk_accel_label_accelerator_width gtk_accel_label_get_accel_width -#endif /* GTK_DISABLE_DEPRECATED */ GType gtk_accel_label_get_type (void) G_GNUC_CONST; GtkWidget* gtk_accel_label_new (const gchar *string); diff --git a/gtk/gtkaccelmap.c b/gtk/gtkaccelmap.c index b9f41ff61e..31028688f4 100644 --- a/gtk/gtkaccelmap.c +++ b/gtk/gtkaccelmap.c @@ -319,7 +319,7 @@ internal_change_entry (const gchar *accel_path, { GtkAccelGroup *group = slist->data; - for (node = group->acceleratables; node; node = node->next) + for (node = _gtk_accel_group_get_accelerables (group); node; node = node->next) g_hash_table_insert (window_hm, node->data, node->data); } g_slist_free (group_list); @@ -367,7 +367,7 @@ internal_change_entry (const gchar *accel_path, for (i = 0; i < n; i++) { seen_accel = TRUE; - removable = !group->lock_count && !(ag_entry[i].key.accel_flags & GTK_ACCEL_LOCKED); + removable = !gtk_accel_group_get_is_locked (group) && !(ag_entry[i].key.accel_flags & GTK_ACCEL_LOCKED); if (!removable) goto break_loop_step5; if (ag_entry[i].accel_path_quark) diff --git a/gtk/gtkaccelmap.h b/gtk/gtkaccelmap.h index 208704920b..0a3937ac1b 100644 --- a/gtk/gtkaccelmap.h +++ b/gtk/gtkaccelmap.h @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkaccessible.h b/gtk/gtkaccessible.h index a9d21bcdd6..e7703c5abe 100644 --- a/gtk/gtkaccessible.h +++ b/gtk/gtkaccessible.h @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkaction.c b/gtk/gtkaction.c index 6c552cc4ae..d9440d38dd 100644 --- a/gtk/gtkaction.c +++ b/gtk/gtkaction.c @@ -28,6 +28,50 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ +/** + * SECTION:gtkaction + * @Short_description: An action which can be triggered by a menu or toolbar item + * @Title: GtkAction + * @See_also: #GtkActionGroup, #GtkUIManager, #GtkActivatable + * + * Actions represent operations that the user can be perform, along with + * some information how it should be presented in the interface. Each action + * provides methods to create icons, menu items and toolbar items + * representing itself. + * + * As well as the callback that is called when the action gets activated, + * the following also gets associated with the action: + * + * a name (not translated, for path lookup) + * a label (translated, for display) + * an accelerator + * whether label indicates a stock id + * a tooltip (optional, translated) + * a toolbar label (optional, shorter than label) + * + * The action will also have some state information: + * + * visible (shown/hidden) + * sensitive (enabled/disabled) + * + * Apart from regular actions, there are toggle + * actions, which can be toggled between two states and radio actions, of which only one in a group + * can be in the "active" state. Other actions can be implemented as #GtkAction + * subclasses. + * + * Each action can have one or more proxy widgets. To act as an action proxy, + * widget needs to implement #GtkActivatable interface. Proxies mirror the state + * of the action and should change when the action's state changes. Properties + * that are always mirrored by proxies are #GtkAction:sensitive and + * #GtkAction:visible. #GtkAction:gicon, #GtkAction:icon-name, #GtkAction:label, + * #GtkAction:short-label and #GtkAction:stock-id properties are only mirorred + * if proxy widget has #GtkActivatable:use-action-appearance property set to + * %TRUE. + * + * When the proxy is activated, it should activate its action. + */ + #include "config.h" #include "gtkaction.h" @@ -920,64 +964,12 @@ _gtk_action_remove_from_proxy_list (GtkAction *action, GTK_ACTION_GET_CLASS (action)->disconnect_proxy (action, proxy); } -/** - * gtk_action_connect_proxy: - * @action: the action object - * @proxy: the proxy widget - * - * Connects a widget to an action object as a proxy. Synchronises - * various properties of the action with the widget (such as label - * text, icon, tooltip, etc), and attaches a callback so that the - * action gets activated when the proxy widget does. - * - * If the widget is already connected to an action, it is disconnected - * first. - * - * Since: 2.4 - * - * Deprecated: 2.16: Use gtk_activatable_set_related_action() instead. - */ -void -gtk_action_connect_proxy (GtkAction *action, - GtkWidget *proxy) -{ - g_return_if_fail (GTK_IS_ACTION (action)); - g_return_if_fail (GTK_IS_WIDGET (proxy)); - g_return_if_fail (GTK_IS_ACTIVATABLE (proxy)); - - gtk_activatable_set_use_action_appearance (GTK_ACTIVATABLE (proxy), TRUE); - - gtk_activatable_set_related_action (GTK_ACTIVATABLE (proxy), action); -} - -/** - * gtk_action_disconnect_proxy: - * @action: the action object - * @proxy: the proxy widget - * - * Disconnects a proxy widget from an action. - * Does not destroy the widget, however. - * - * Since: 2.4 - * - * Deprecated: 2.16: Use gtk_activatable_set_related_action() instead. - */ -void -gtk_action_disconnect_proxy (GtkAction *action, - GtkWidget *proxy) -{ - g_return_if_fail (GTK_IS_ACTION (action)); - g_return_if_fail (GTK_IS_WIDGET (proxy)); - - gtk_activatable_set_related_action (GTK_ACTIVATABLE (proxy), NULL); -} - /** * gtk_action_get_proxies: * @action: the action object * * Returns the proxy widgets for an action. - * See also gtk_widget_get_action(). + * See also gtk_activatable_get_related_action(). * * Return value: (element-type GtkWidget) (transfer none): a #GSList of proxy widgets. The list is owned by GTK+ * and must not be modified. @@ -992,32 +984,6 @@ gtk_action_get_proxies (GtkAction *action) return action->private_data->proxies; } - -/** - * gtk_widget_get_action: - * @widget: a #GtkWidget - * - * Returns the #GtkAction that @widget is a proxy for. - * See also gtk_action_get_proxies(). - * - * Returns: the action that a widget is a proxy for, or - * %NULL, if it is not attached to an action. - * - * Since: 2.10 - * - * Deprecated: 2.16: Use gtk_activatable_get_related_action() instead. - */ -GtkAction* -gtk_widget_get_action (GtkWidget *widget) -{ - g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); - - if (GTK_IS_ACTIVATABLE (widget)) - return gtk_activatable_get_related_action (GTK_ACTIVATABLE (widget)); - - return NULL; -} - /** * gtk_action_get_name: * @action: the action object @@ -1656,62 +1622,6 @@ gtk_action_get_gicon (GtkAction *action) return action->private_data->gicon; } -/** - * gtk_action_block_activate_from: - * @action: the action object - * @proxy: a proxy widget - * - * Disables calls to the gtk_action_activate() - * function by signals on the given proxy widget. This is used to - * break notification loops for things like check or radio actions. - * - * This function is intended for use by action implementations. - * - * Since: 2.4 - * - * Deprecated: 2.16: activatables are now responsible for activating the - * action directly so this doesnt apply anymore. - */ -void -gtk_action_block_activate_from (GtkAction *action, - GtkWidget *proxy) -{ - g_return_if_fail (GTK_IS_ACTION (action)); - - g_signal_handlers_block_by_func (proxy, G_CALLBACK (gtk_action_activate), - action); - - gtk_action_block_activate (action); -} - -/** - * gtk_action_unblock_activate_from: - * @action: the action object - * @proxy: a proxy widget - * - * Re-enables calls to the gtk_action_activate() - * function by signals on the given proxy widget. This undoes the - * blocking done by gtk_action_block_activate_from(). - * - * This function is intended for use by action implementations. - * - * Since: 2.4 - * - * Deprecated: 2.16: activatables are now responsible for activating the - * action directly so this doesnt apply anymore. - */ -void -gtk_action_unblock_activate_from (GtkAction *action, - GtkWidget *proxy) -{ - g_return_if_fail (GTK_IS_ACTION (action)); - - g_signal_handlers_unblock_by_func (proxy, G_CALLBACK (gtk_action_activate), - action); - - gtk_action_unblock_activate (action); -} - static void closure_accel_activate (GClosure *closure, GValue *return_value, diff --git a/gtk/gtkaction.h b/gtk/gtkaction.h index 08e051af93..999c38f6e8 100644 --- a/gtk/gtkaction.h +++ b/gtk/gtkaction.h @@ -28,7 +28,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -110,18 +110,6 @@ void gtk_action_connect_accelerator (GtkAction *action); void gtk_action_disconnect_accelerator (GtkAction *action); G_CONST_RETURN gchar *gtk_action_get_accel_path (GtkAction *action); GClosure *gtk_action_get_accel_closure (GtkAction *action); - -#ifndef GTK_DISABLE_DEPRECATED -GtkAction *gtk_widget_get_action (GtkWidget *widget); -void gtk_action_connect_proxy (GtkAction *action, - GtkWidget *proxy); -void gtk_action_disconnect_proxy (GtkAction *action, - GtkWidget *proxy); -void gtk_action_block_activate_from (GtkAction *action, - GtkWidget *proxy); -void gtk_action_unblock_activate_from (GtkAction *action, - GtkWidget *proxy); -#endif /* GTK_DISABLE_DEPRECATED */ void gtk_action_block_activate (GtkAction *action); void gtk_action_unblock_activate (GtkAction *action); diff --git a/gtk/gtkactiongroup.c b/gtk/gtkactiongroup.c index a8003803c1..cab79ee2d1 100644 --- a/gtk/gtkactiongroup.c +++ b/gtk/gtkactiongroup.c @@ -731,7 +731,7 @@ gtk_action_group_set_visible (GtkActionGroup *action_group, * * Looks up an action in the action group by name. * - * Returns: (transfer-none): the action, or %NULL if no action by that name exists + * Returns: (transfer none): the action, or %NULL if no action by that name exists * * Since: 2.4 */ diff --git a/gtk/gtkactiongroup.h b/gtk/gtkactiongroup.h index 1d8b388b1f..30d7542741 100644 --- a/gtk/gtkactiongroup.h +++ b/gtk/gtkactiongroup.h @@ -28,7 +28,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkactivatable.h b/gtk/gtkactivatable.h index 45d1decd46..705bfa4e80 100644 --- a/gtk/gtkactivatable.h +++ b/gtk/gtkactivatable.h @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkadjustment.c b/gtk/gtkadjustment.c index 49f5008ec2..dd1b3f609d 100644 --- a/gtk/gtkadjustment.c +++ b/gtk/gtkadjustment.c @@ -359,7 +359,11 @@ gtk_adjustment_set_value (GtkAdjustment *adjustment, { g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment)); - value = CLAMP (value, adjustment->lower, adjustment->upper); + /* don't use CLAMP() so we don't end up below lower if upper - page_size + * is smaller than lower + */ + value = MIN (value, adjustment->upper - adjustment->page_size); + value = MAX (value, adjustment->lower); if (value != adjustment->value) { diff --git a/gtk/gtkadjustment.h b/gtk/gtkadjustment.h index f5ead22509..39a6f86293 100644 --- a/gtk/gtkadjustment.h +++ b/gtk/gtkadjustment.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkalignment.c b/gtk/gtkalignment.c index 2552c57567..5d986e2a70 100644 --- a/gtk/gtkalignment.c +++ b/gtk/gtkalignment.c @@ -24,8 +24,28 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ +/** + * SECTION:gtkalignment + * @Short_description: A widget which controls the alignment and size of its child + * @Title: GtkAlignment + * + * The #GtkAlignment widget controls the alignment and size of its child widget. + * It has four settings: xscale, yscale, xalign, and yalign. + * + * The scale settings are used to specify how much the child widget should + * expand to fill the space allocated to the #GtkAlignment. + * The values can range from 0 (meaning the child doesn't expand at all) to + * 1 (meaning the child expands to fill all of the available space). + * + * The align settings are used to place the child widget within the available + * area. The values range from 0 (top or left) to 1 (bottom or right). + * Of course, if the scale settings are both set to 1, the alignment settings + * have no effect. + */ + #include "config.h" #include "gtkalignment.h" +#include "gtkextendedlayout.h" #include "gtkprivate.h" #include "gtkintl.h" #include "gtkalias.h" @@ -54,8 +74,6 @@ struct _GtkAlignmentPrivate guint padding_right; }; -static void gtk_alignment_size_request (GtkWidget *widget, - GtkRequisition *requisition); static void gtk_alignment_size_allocate (GtkWidget *widget, GtkAllocation *allocation); static void gtk_alignment_set_property (GObject *object, @@ -67,7 +85,17 @@ static void gtk_alignment_get_property (GObject *object, GValue *value, GParamSpec *pspec); -G_DEFINE_TYPE (GtkAlignment, gtk_alignment, GTK_TYPE_BIN) +static void gtk_alignment_extended_layout_init (GtkExtendedLayoutIface *iface); +static void gtk_alignment_get_desired_width (GtkExtendedLayout *layout, + gint *minimum_size, + gint *natural_size); +static void gtk_alignment_get_desired_height (GtkExtendedLayout *layout, + gint *minimum_size, + gint *natural_size); + +G_DEFINE_TYPE_WITH_CODE (GtkAlignment, gtk_alignment, GTK_TYPE_BIN, + G_IMPLEMENT_INTERFACE (GTK_TYPE_EXTENDED_LAYOUT, + gtk_alignment_extended_layout_init)) static void gtk_alignment_class_init (GtkAlignmentClass *class) @@ -81,7 +109,6 @@ gtk_alignment_class_init (GtkAlignmentClass *class) gobject_class->set_property = gtk_alignment_set_property; gobject_class->get_property = gtk_alignment_get_property; - widget_class->size_request = gtk_alignment_size_request; widget_class->size_allocate = gtk_alignment_size_allocate; g_object_class_install_property (gobject_class, @@ -215,6 +242,24 @@ gtk_alignment_init (GtkAlignment *alignment) priv->padding_right = 0; } +/** + * gtk_alignment_new: + * @xalign: the horizontal alignment of the child widget, from 0 (left) to 1 + * (right). + * @yalign: the vertical alignment of the child widget, from 0 (top) to 1 + * (bottom). + * @xscale: the amount that the child widget expands horizontally to fill up + * unused space, from 0 to 1. + * A value of 0 indicates that the child widget should never expand. + * A value of 1 indicates that the child widget will expand to fill all of the + * space allocated for the #GtkAlignment. + * @yscale: the amount that the child widget expands vertically to fill up + * unused space, from 0 to 1. The values are similar to @xscale. + * + * Creates a new #GtkAlignment. + * + * Returns: the new #GtkAlignment. + */ GtkWidget* gtk_alignment_new (gfloat xalign, gfloat yalign, @@ -359,6 +404,23 @@ gtk_alignment_get_property (GObject *object, } } +/** + * gtk_alignment_set: + * @alignment: a #GtkAlignment. + * @xalign: the horizontal alignment of the child widget, from 0 (left) to 1 + * (right). + * @yalign: the vertical alignment of the child widget, from 0 (top) to 1 + * (bottom). + * @xscale: the amount that the child widget expands horizontally to fill up + * unused space, from 0 to 1. + * A value of 0 indicates that the child widget should never expand. + * A value of 1 indicates that the child widget will expand to fill all of the + * space allocated for the #GtkAlignment. + * @yscale: the amount that the child widget expands vertically to fill up + * unused space, from 0 to 1. The values are similar to @xscale. + * + * Sets the #GtkAlignment values. + */ void gtk_alignment_set (GtkAlignment *alignment, gfloat xalign, @@ -408,34 +470,6 @@ gtk_alignment_set (GtkAlignment *alignment, } -static void -gtk_alignment_size_request (GtkWidget *widget, - GtkRequisition *requisition) -{ - GtkBin *bin; - GtkAlignmentPrivate *priv; - - bin = GTK_BIN (widget); - priv = GTK_ALIGNMENT_GET_PRIVATE (widget); - - requisition->width = GTK_CONTAINER (widget)->border_width * 2; - requisition->height = GTK_CONTAINER (widget)->border_width * 2; - - if (bin->child && gtk_widget_get_visible (bin->child)) - { - GtkRequisition child_requisition; - - gtk_widget_size_request (bin->child, &child_requisition); - - requisition->width += child_requisition.width; - requisition->height += child_requisition.height; - - /* Request extra space for the padding: */ - requisition->width += (priv->padding_left + priv->padding_right); - requisition->height += (priv->padding_top + priv->padding_bottom); - } -} - static void gtk_alignment_size_allocate (GtkWidget *widget, GtkAllocation *allocation) @@ -443,7 +477,6 @@ gtk_alignment_size_allocate (GtkWidget *widget, GtkAlignment *alignment; GtkBin *bin; GtkAllocation child_allocation; - GtkRequisition child_requisition; gint width, height; gint border_width; gint padding_horizontal, padding_vertical; @@ -458,7 +491,10 @@ gtk_alignment_size_allocate (GtkWidget *widget, if (bin->child && gtk_widget_get_visible (bin->child)) { - gtk_widget_get_child_requisition (bin->child, &child_requisition); + GtkExtendedLayout *layout = GTK_EXTENDED_LAYOUT (bin->child); + gint child_nat_width; + gint child_nat_height; + gint child_width, child_height; border_width = GTK_CONTAINER (alignment)->border_width; @@ -468,16 +504,37 @@ gtk_alignment_size_allocate (GtkWidget *widget, width = MAX (1, allocation->width - padding_horizontal - 2 * border_width); height = MAX (1, allocation->height - padding_vertical - 2 * border_width); - - if (width > child_requisition.width) - child_allocation.width = (child_requisition.width * + + if (gtk_extended_layout_is_height_for_width (layout)) + { + gtk_extended_layout_get_desired_width (layout, NULL, &child_nat_width); + + child_width = MIN (width, child_nat_width); + + gtk_extended_layout_get_height_for_width (layout, child_width, NULL, &child_nat_height); + + child_height = MIN (height, child_nat_height); + } + else + { + gtk_extended_layout_get_desired_height (layout, NULL, &child_nat_height); + + child_height = MIN (height, child_nat_height); + + gtk_extended_layout_get_width_for_height (layout, child_height, NULL, &child_nat_width); + + child_width = MIN (width, child_nat_width); + } + + if (width > child_width) + child_allocation.width = (child_width * (1.0 - alignment->xscale) + width * alignment->xscale); else child_allocation.width = width; - - if (height > child_requisition.height) - child_allocation.height = (child_requisition.height * + + if (height > child_height) + child_allocation.height = (child_height * (1.0 - alignment->yscale) + height * alignment->yscale); else @@ -494,6 +551,75 @@ gtk_alignment_size_allocate (GtkWidget *widget, } } + +static void +gtk_alignment_extended_layout_init (GtkExtendedLayoutIface *iface) +{ + iface->get_desired_width = gtk_alignment_get_desired_width; + iface->get_desired_height = gtk_alignment_get_desired_height; +} + +static void +gtk_alignment_get_desired_size (GtkExtendedLayout *layout, + GtkOrientation orientation, + gint *minimum_size, + gint *natural_size) +{ + GtkWidget *child; + GtkAlignmentPrivate *priv; + gint minimum, natural; + + priv = GTK_ALIGNMENT_GET_PRIVATE (layout); + + natural = minimum = GTK_CONTAINER (layout)->border_width * 2; + + if ((child = gtk_bin_get_child (GTK_BIN (layout))) && gtk_widget_get_visible (child)) + { + gint child_min, child_nat; + + /* Request extra space for the padding: */ + if (orientation == GTK_ORIENTATION_HORIZONTAL) + { + minimum += (priv->padding_left + priv->padding_right); + gtk_extended_layout_get_desired_width (GTK_EXTENDED_LAYOUT (child), + &child_min, &child_nat); + } + else + { + minimum += (priv->padding_top + priv->padding_bottom); + gtk_extended_layout_get_desired_height (GTK_EXTENDED_LAYOUT (child), + &child_min, &child_nat); + } + + natural = minimum; + + minimum += child_min; + natural += child_nat; + } + + if (minimum_size) + *minimum_size = minimum; + + if (natural_size) + *natural_size = natural; +} + +static void +gtk_alignment_get_desired_width (GtkExtendedLayout *layout, + gint *minimum_size, + gint *natural_size) +{ + gtk_alignment_get_desired_size (layout, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size); +} + +static void +gtk_alignment_get_desired_height (GtkExtendedLayout *layout, + gint *minimum_size, + gint *natural_size) +{ + gtk_alignment_get_desired_size (layout, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size); +} + /** * gtk_alignment_set_padding: * @alignment: a #GtkAlignment diff --git a/gtk/gtkalignment.h b/gtk/gtkalignment.h index 4fad3027e3..9a37191d93 100644 --- a/gtk/gtkalignment.h +++ b/gtk/gtkalignment.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkapplication.c b/gtk/gtkapplication.c new file mode 100644 index 0000000000..6be15a82b1 --- /dev/null +++ b/gtk/gtkapplication.c @@ -0,0 +1,529 @@ +/* GTK - The GIMP Toolkit + * + * Copyright (C) 2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Colin Walters + */ + +/* + * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS + * file for a list of people on the GTK+ Team. See the ChangeLog + * files for a list of changes. These files are distributed with + * GTK+ at ftp://ftp.gtk.org/pub/gtk/. + */ + +#include "config.h" + +#include +#include + +#include "gtkapplication.h" +#include "gtkmain.h" +#include "gtkintl.h" +#include "gtkprivate.h" + +#include "gtkalias.h" + +#include +#ifdef GDK_WINDOWING_X11 +#include +#endif + +/** + * SECTION:gtkapplication + * @title: GtkApplication + * @short_description: Application class + * + * #GtkApplication is a class that handles many important aspects + * of a GTK+ application in a convenient fashion, without enforcing + * a one-size-fits-all application model. + * + * Currently, GtkApplication handles application uniqueness, provides + * some basic scriptability by exporting 'actions', implements some + * standard actions itself (such as 'Quit') and provides a main window + * whose life-cycle is automatically tied to the life-cycle of your + * application. + * + * A simple application + * + * + * FIXME: MISSING XINCLUDE CONTENT + * + * + * + */ +enum +{ + PROP_0, + PROP_WINDOW +}; + +enum +{ + ACTIVATED, + + LAST_SIGNAL +}; + +static guint gtk_application_signals[LAST_SIGNAL] = { 0 }; + +struct _GtkApplicationPrivate +{ + GtkActionGroup *main_actions; + + GtkWindow *default_window; + GSList *windows; +}; + +G_DEFINE_TYPE (GtkApplication, gtk_application, G_TYPE_APPLICATION) + +static gboolean +gtk_application_default_quit (GApplication *application, + guint timestamp) +{ + gtk_main_quit (); + return TRUE; +} + +static void +gtk_application_default_run (GApplication *application) +{ + gtk_main (); +} + +static void +gtk_application_default_prepare_activation (GApplication *application, + GVariant *arguments, + GVariant *platform_data) +{ + GVariantIter iter; + gchar *key; + GVariant *value; + + g_variant_iter_init (&iter, platform_data); + while (g_variant_iter_next (&iter, "{&sv}", &key, &value)) + { + if (strcmp (key, "startup-notification-id") == 0 && + g_variant_is_of_type (value, G_VARIANT_TYPE_STRING)) + gdk_notify_startup_complete_with_id (g_variant_get_string (value, NULL)); + g_variant_unref (value); + } + + g_signal_emit (G_OBJECT (application), gtk_application_signals[ACTIVATED], 0, arguments); +} + +static void +gtk_application_default_activated (GApplication *application, + GVariant *arguments) +{ + GtkApplication *app = GTK_APPLICATION (application); + + /* TODO: should we raise the last focused window instead ? */ + if (app->priv->default_window != NULL) + gtk_window_present (app->priv->default_window); +} + +static void +gtk_application_default_action (GApplication *application, + const gchar *action_name, + guint timestamp) +{ + GtkApplication *app = GTK_APPLICATION (application); + GtkAction *action; + + action = gtk_action_group_get_action (app->priv->main_actions, action_name); + if (action) + { + /* TODO set timestamp */ + gtk_action_activate (action); + } +} + +static GVariant * +gtk_application_format_activation_data (void) +{ + const gchar *startup_id = NULL; + GdkDisplay *display = gdk_display_get_default (); + GVariantBuilder builder; + + g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); + + /* try and get the startup notification id from GDK, the environment + * or, if everything else failed, fake one. + */ +#ifdef GDK_WINDOWING_X11 + startup_id = gdk_x11_display_get_startup_notification_id (display); +#endif /* GDK_WINDOWING_X11 */ + + if (startup_id) + g_variant_builder_add (&builder, "{sv}", "startup-notification-id", + g_variant_new ("s", startup_id)); + return g_variant_builder_end (&builder); +} + +/** + * gtk_application_new: + * @argc: (allow-none) (inout): System argument count + * @argv: (allow-none) (inout): System argument vector + * @appid: System-dependent application identifier + * + * Create a new #GtkApplication, or if one has already been initialized + * in this process, return the existing instance. This function will as + * a side effect initialize the display system; see gtk_init(). + * + * For the behavior if this application is running in another process, + * see g_application_new(). + * + * Returns: (transfer full): A newly-referenced #GtkApplication + * + * Since: 3.0 + */ +GtkApplication* +gtk_application_new (gint *argc, + gchar ***argv, + const gchar *appid) +{ + GtkApplication *app; + gint argc_for_app; + gchar **argv_for_app; + GVariant *platform_data; + + gtk_init (argc, argv); + + if (argc) + argc_for_app = *argc; + else + argc_for_app = 0; + if (argv) + argv_for_app = *argv; + else + argv_for_app = NULL; + + app = g_object_new (GTK_TYPE_APPLICATION, "application-id", appid, NULL); + + platform_data = gtk_application_format_activation_data (); + g_application_register_with_data (G_APPLICATION (app), argc_for_app, argv_for_app, + platform_data); + g_variant_unref (platform_data); + + return app; +} + +static void +on_action_sensitive (GtkAction *action, + GParamSpec *pspec, + GtkApplication *app) +{ + g_application_set_action_enabled (G_APPLICATION (app), + gtk_action_get_name (action), + gtk_action_get_sensitive (action)); +} + +/** + * gtk_application_set_action_group: + * @app: A #GtkApplication + * @group: A #GtkActionGroup + * + * Set @group as this application's global action group. + * This will ensure the operating system interface uses + * these actions as follows: + * + * + * In GNOME 2 this exposes the actions for scripting. + * In GNOME 3, this function populates the application menu. + * In Windows prior to version 7, this function does nothing. + * In Windows 7, this function adds "Tasks" to the Jump List. + * In Mac OS X, this function extends the Dock menu. + * + * + * It is an error to call this function more than once. + * + * Since: 3.0 + */ +void +gtk_application_set_action_group (GtkApplication *app, + GtkActionGroup *group) +{ + GList *actions, *iter; + + g_return_if_fail (GTK_IS_APPLICATION (app)); + g_return_if_fail (app->priv->main_actions == NULL); + + app->priv->main_actions = g_object_ref (group); + actions = gtk_action_group_list_actions (group); + for (iter = actions; iter; iter = iter->next) + { + GtkAction *action = iter->data; + g_application_add_action (G_APPLICATION (app), + gtk_action_get_name (action), + gtk_action_get_tooltip (action)); + g_signal_connect (action, "notify::sensitive", + G_CALLBACK (on_action_sensitive), app); + } + g_list_free (actions); +} + +static gboolean +gtk_application_on_window_destroy (GtkWidget *window, + gpointer user_data) +{ + GtkApplication *app = GTK_APPLICATION (user_data); + + app->priv->windows = g_slist_remove (app->priv->windows, window); + + if (app->priv->windows == NULL) + gtk_application_quit (app); + + return FALSE; +} + +static gchar *default_title; + +/** + * gtk_application_add_window: + * @app: a #GtkApplication + * @window: a toplevel window to add to @app + * + * Adds a window to the #GtkApplication. + * + * If the user closes all of the windows added to @app, the default + * behaviour is to call gtk_application_quit(). + * + * If your application uses only a single toplevel window, you can + * use gtk_application_get_window(). + * + * Since: 3.0 + */ +void +gtk_application_add_window (GtkApplication *app, + GtkWindow *window) +{ + app->priv->windows = g_slist_prepend (app->priv->windows, window); + + if (gtk_window_get_title (window) == NULL && default_title != NULL) + gtk_window_set_title (window, default_title); + + g_signal_connect (window, "destroy", + G_CALLBACK (gtk_application_on_window_destroy), app); +} + +/** + * gtk_application_get_window: + * @app: a #GtkApplication + * + * A simple #GtkApplication has a "default window". This window should + * act as the primary user interaction point with your application. + * The window returned by this function is of type #GTK_WINDOW_TYPE_TOPLEVEL + * and its properties such as "title" and "icon-name" will be initialized + * as appropriate for the platform. + * + * If the user closes this window, and your application hasn't created + * any other windows, the default action will be to call gtk_application_quit(). + * + * If your application has more than one toplevel window (e.g. an + * single-document-interface application with multiple open documents), + * or if you are constructing your toplevel windows yourself (e.g. using + * #GtkBuilder), use gtk_application_add_window() instead. + * + * Returns: (transfer none): The default #GtkWindow for this application + * + * Since: 3.0 + */ +GtkWindow * +gtk_application_get_window (GtkApplication *app) +{ + if (app->priv->default_window != NULL) + return app->priv->default_window; + + app->priv->default_window = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL)); + g_object_ref_sink (app->priv->default_window); + + gtk_application_add_window (app, app->priv->default_window); + + return app->priv->default_window; +} + +/** + * gtk_application_run: + * @app: a #GtkApplication + * + * Runs the main loop; see g_application_run(). + * The default implementation for #GtkApplication uses gtk_main(). + * + * Since: 3.0 + */ +void +gtk_application_run (GtkApplication *app) +{ + g_application_run (G_APPLICATION (app)); +} + +/** + * gtk_application_quit: + * @app: a #GtkApplication + * + * Request the application exit. + * By default, this method will exit the main loop; see gtk_main_quit(). + * + * Since: 3.0 + */ +void +gtk_application_quit (GtkApplication *app) +{ + g_application_quit (G_APPLICATION (app), gtk_get_current_event_time ()); +} + +static void +gtk_application_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GtkApplication *app = GTK_APPLICATION (object); + + switch (prop_id) + { + case PROP_WINDOW: + g_value_set_object (value, gtk_application_get_window (app)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + } +} + +static void +gtk_application_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GtkApplication *app = GTK_APPLICATION (object); + + g_assert (app != NULL); + + switch (prop_id) + { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + } +} + +static void +setup_default_window_decorations (void) +{ + const gchar *pid; + const gchar *filename; + GKeyFile *keyfile; + gchar *title; + gchar *icon_name; + + pid = g_getenv ("GIO_LAUNCHED_DESKTOP_FILE_PID"); + filename = g_getenv ("GIO_LAUNCHED_DESKTOP_FILE"); + + keyfile = g_key_file_new (); + + if (pid != NULL && filename != NULL && atoi (pid) == getpid () && + g_key_file_load_from_file (keyfile, filename, 0, NULL)) + { + title = g_key_file_get_locale_string (keyfile, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_NAME, NULL, NULL); + icon_name = g_key_file_get_string (keyfile, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_ICON, NULL); + + if (default_title == NULL) + default_title = title; + + if (gtk_window_get_default_icon_name () == NULL) + gtk_window_set_default_icon_name (icon_name); + + g_free (icon_name); + } + + g_key_file_free (keyfile); +} + +static void +gtk_application_init (GtkApplication *application) +{ + application->priv = G_TYPE_INSTANCE_GET_PRIVATE (application, GTK_TYPE_APPLICATION, GtkApplicationPrivate); + + setup_default_window_decorations (); +} + + +static GObject* +gtk_application_constructor (GType type, + guint n_construct_properties, + GObjectConstructParam *construct_params) +{ + GObject *object; + + /* Last ditch effort here */ + gtk_init (0, NULL); + + object = (* G_OBJECT_CLASS (gtk_application_parent_class)->constructor) (type, + n_construct_properties, + construct_params); + + return object; +} + +static void +gtk_application_class_init (GtkApplicationClass *klass) +{ + GObjectClass *gobject_class; + GApplicationClass *application_class; + + gobject_class = G_OBJECT_CLASS (klass); + application_class = G_APPLICATION_CLASS (klass); + + gobject_class->constructor = gtk_application_constructor; + gobject_class->get_property = gtk_application_get_property; + gobject_class->set_property = gtk_application_set_property; + + application_class->run = gtk_application_default_run; + application_class->quit = gtk_application_default_quit; + application_class->action = gtk_application_default_action; + application_class->prepare_activation = gtk_application_default_prepare_activation; + + klass->activated = gtk_application_default_activated; + + /** + * GtkApplication::activated: + * @arguments: A #GVariant with the signature "aay" + * + * This signal is emitted when a non-primary process for a given + * application is invoked while your application is running; for + * example, when a file browser launches your program to open a + * file. The raw operating system arguments are passed in the + * variant @arguments. + */ + + gtk_application_signals[ACTIVATED] = + g_signal_new (g_intern_static_string ("activated"), + G_OBJECT_CLASS_TYPE (klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkApplicationClass, activated), + NULL, NULL, + g_cclosure_marshal_VOID__BOXED, + G_TYPE_NONE, 1, + G_TYPE_VARIANT); + + g_type_class_add_private (gobject_class, sizeof (GtkApplicationPrivate)); +} + +#define __GTK_APPLICATION_C__ +#include "gtkaliasdef.c" diff --git a/gtk/gtkapplication.h b/gtk/gtkapplication.h new file mode 100644 index 0000000000..6581bcd923 --- /dev/null +++ b/gtk/gtkapplication.h @@ -0,0 +1,100 @@ +/* GTK - The GIMP Toolkit + * + * Copyright (C) 2010 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Colin Walters + */ + +/* + * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS + * file for a list of people on the GTK+ Team. See the ChangeLog + * files for a list of changes. These files are distributed with + * GTK+ at ftp://ftp.gtk.org/pub/gtk/. + */ + +#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __GTK_APPLICATION_H__ +#define __GTK_APPLICATION_H__ + +#include +#include +#include +#include + +G_BEGIN_DECLS + +#define GTK_TYPE_APPLICATION (gtk_application_get_type ()) +#define GTK_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_APPLICATION, GtkApplication)) +#define GTK_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_APPLICATION, GtkApplicationClass)) +#define GTK_IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_APPLICATION)) +#define GTK_IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_APPLICATION)) +#define GTK_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_APPLICATION, GtkApplicationClass)) + +typedef struct _GtkApplication GtkApplication; +typedef struct _GtkApplicationClass GtkApplicationClass; +typedef struct _GtkApplicationPrivate GtkApplicationPrivate; + +struct _GtkApplication +{ + GApplication parent; + + /*< private >*/ + + GtkApplicationPrivate *priv; +}; + +struct _GtkApplicationClass +{ + GApplicationClass parent_class; + + /*< vfuncs >*/ + void (* activated) (GApplication *application, + GVariant *args); + + /* Padding for future expansion */ + void (*_gtk_reserved1) (void); + void (*_gtk_reserved2) (void); + void (*_gtk_reserved3) (void); + void (*_gtk_reserved4) (void); + void (*_gtk_reserved5) (void); + void (*_gtk_reserved6) (void); + void (*_gtk_reserved7) (void); + void (*_gtk_reserved8) (void); + void (*_gtk_reserved9) (void); + void (*_gtk_reserved10) (void); +}; + +GType gtk_application_get_type (void) G_GNUC_CONST; +GtkApplication* gtk_application_new (gint *argc, + gchar ***argv, + const gchar *appid); +void gtk_application_set_action_group (GtkApplication *app, + GtkActionGroup *group); +GtkWindow * gtk_application_get_window (GtkApplication *app); +void gtk_application_add_window (GtkApplication *app, + GtkWindow *window); +void gtk_application_run (GtkApplication *app); +void gtk_application_quit (GtkApplication *app); + +G_END_DECLS + +#endif /* __GTK_APPLICATION_H__ */ + diff --git a/gtk/gtkarrow.c b/gtk/gtkarrow.c index 5a432d5cf8..b69c297966 100644 --- a/gtk/gtkarrow.c +++ b/gtk/gtkarrow.c @@ -24,6 +24,26 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ +/** + * SECTION:gtkarrow + * @Short_description: Displays an arrow + * @Title: GtkArrow + * @See_also: gtk_paint_arrow() + * + * GtkArrow should be used to draw simple arrows that need to point in + * one of the four cardinal directions (up, down, left, or right). The + * style of the arrow can be one of shadow in, shadow out, etched in, or + * etched out. Note that these directions and style types may be + * ammended in versions of GTK+ to come. + * + * GtkArrow will fill any space alloted to it, but since it is inherited + * from #GtkMisc, it can be padded and/or aligned, to fill exactly the + * space the programmer desires. + * + * Arrows are created with a call to gtk_arrow_new(). The direction or + * style of an arrow can be changed after creation by using gtk_arrow_set(). + */ + #include "config.h" #include #include "gtkarrow.h" @@ -155,6 +175,15 @@ gtk_arrow_init (GtkArrow *arrow) arrow->shadow_type = GTK_SHADOW_OUT; } +/** + * gtk_arrow_new: + * @arrow_type: a valid #GtkArrowType. + * @shadow_type: a valid #GtkShadowType. + * + * Creates a new #GtkArrow widget. + * + * Returns: the new #GtkArrow widget. + */ GtkWidget* gtk_arrow_new (GtkArrowType arrow_type, GtkShadowType shadow_type) @@ -169,6 +198,14 @@ gtk_arrow_new (GtkArrowType arrow_type, return GTK_WIDGET (arrow); } +/** + * gtk_arrow_set: + * @arrow: a widget of type #GtkArrow. + * @arrow_type: a valid #GtkArrowType. + * @shadow_type: a valid #GtkShadowType. + * + * Sets the direction and style of the #GtkArrow, @arrow. + */ void gtk_arrow_set (GtkArrow *arrow, GtkArrowType arrow_type, diff --git a/gtk/gtkarrow.h b/gtk/gtkarrow.h index 010e3ef227..3140d588e6 100644 --- a/gtk/gtkarrow.h +++ b/gtk/gtkarrow.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkaspectframe.c b/gtk/gtkaspectframe.c index db0a839454..beedd19c2c 100644 --- a/gtk/gtkaspectframe.c +++ b/gtk/gtkaspectframe.c @@ -29,6 +29,20 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ +/** + * SECTION:gtkaspectframe + * @Short_description: A frame that constrains its child to a particular aspect ratio + * @Title: GtkAspectFrame + * + * The #GtkAspectFrame is useful when you want + * pack a widget so that it can resize but always retains + * the same aspect ratio. For instance, one might be + * drawing a small preview of a larger image. #GtkAspectFrame + * derives from #GtkFrame, so it can draw a label and + * a frame around the child. The frame will be + * "shrink-wrapped" to the size of the child. + */ + #include "config.h" #include "gtkaspectframe.h" #include "gtkprivate.h" @@ -185,6 +199,23 @@ gtk_aspect_frame_get_property (GObject *object, } } +/** + * gtk_aspect_frame_new: + * @label: Label text. + * @xalign: Horizontal alignment of the child within the allocation of + * the #GtkAspectFrame. This ranges from 0.0 (left aligned) + * to 1.0 (right aligned) + * @yalign: Vertical alignment of the child within the allocation of + * the #GtkAspectFrame. This ranges from 0.0 (left aligned) + * to 1.0 (right aligned) + * @ratio: The desired aspect ratio. + * @obey_child: If %TRUE, @ratio is ignored, and the aspect + * ratio is taken from the requistion of the child. + * + * Create a new #GtkAspectFrame. + * + * Returns: the new #GtkAspectFrame. + */ GtkWidget* gtk_aspect_frame_new (const gchar *label, gfloat xalign, @@ -206,6 +237,21 @@ gtk_aspect_frame_new (const gchar *label, return GTK_WIDGET (aspect_frame); } +/** + * gtk_aspect_frame_set: + * @aspect_frame: a #GtkAspectFrame + * @xalign: Horizontal alignment of the child within the allocation of + * the #GtkAspectFrame. This ranges from 0.0 (left aligned) + * to 1.0 (right aligned) + * @yalign: Vertical alignment of the child within the allocation of + * the #GtkAspectFrame. This ranges from 0.0 (left aligned) + * to 1.0 (right aligned) + * @ratio: The desired aspect ratio. + * @obey_child: If %TRUE, @ratio is ignored, and the aspect + * ratio is taken from the requistion of the child. + * + * Set parameters for an existing #GtkAspectFrame. + */ void gtk_aspect_frame_set (GtkAspectFrame *aspect_frame, gfloat xalign, diff --git a/gtk/gtkaspectframe.h b/gtk/gtkaspectframe.h index d78ee87e3c..bb98f62ba4 100644 --- a/gtk/gtkaspectframe.h +++ b/gtk/gtkaspectframe.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkassistant.c b/gtk/gtkassistant.c index 1e2c3ce432..3c18378cef 100644 --- a/gtk/gtkassistant.c +++ b/gtk/gtkassistant.c @@ -23,6 +23,28 @@ * Boston, MA 02111-1307, USA. */ +/** + * SECTION:gtkassistant + * @Short_description: A widget used to guide users through multi-step operations + * @Title: GtkAssistant + * + * A #GtkAssistant is a widget used to represent a generally complex + * operation splitted in several steps, guiding the user through its pages + * and controlling the page flow to collect the necessary data. + * + * + * GtkAssistant as GtkBuildable + * + * The GtkAssistant implementation of the GtkBuildable interface exposes the + * @action_area as internal children with the name "action_area". + * + * To add pages to an assistant in GtkBuilder, simply add it as a + * <child> to the GtkAssistant object, and set its child properties + * as necessary. + * + * + */ + #include "config.h" #include @@ -81,6 +103,8 @@ struct _GtkAssistantPrivate GtkAssistantPageFunc forward_function; gpointer forward_function_data; GDestroyNotify forward_data_destroy; + + guint committed : 1; }; static void gtk_assistant_class_init (GtkAssistantClass *class); @@ -237,7 +261,7 @@ gtk_assistant_class_init (GtkAssistantClass *class) /** * GtkAssistant::apply: - * @assistant: the @GtkAssistant + * @assistant: the #GtkAssistant * * The ::apply signal is emitted when the apply button is clicked. The default * behavior of the #GtkAssistant is to switch to the page after the current @@ -245,7 +269,7 @@ gtk_assistant_class_init (GtkAssistantClass *class) * * A handler for the ::apply signal should carry out the actions for which * the wizard has collected data. If the action takes a long time to complete, - * you might consider to put a page of type %GTK_ASSISTANT_PAGE_PROGRESS + * you might consider putting a page of type %GTK_ASSISTANT_PAGE_PROGRESS * after the confirmation page and handle this operation within the * #GtkAssistant::prepare signal of the progress page. * @@ -450,6 +474,23 @@ compute_last_button_state (GtkAssistant *assistant) gtk_widget_hide (assistant->last); } +static void +compute_progress_state (GtkAssistant *assistant) +{ + GtkAssistantPrivate *priv = assistant->priv; + gint page_num, n_pages; + + n_pages = gtk_assistant_get_n_pages (assistant); + page_num = gtk_assistant_get_current_page (assistant); + + page_num = (priv->forward_function) (page_num, priv->forward_function_data); + + if (page_num >= 0 && page_num < n_pages) + gtk_widget_show (assistant->forward); + else + gtk_widget_hide (assistant->forward); +} + static void set_assistant_header_image (GtkAssistant *assistant) { @@ -487,7 +528,6 @@ set_assistant_buttons_state (GtkAssistant *assistant) gtk_widget_set_sensitive (assistant->cancel, TRUE); gtk_widget_set_sensitive (assistant->forward, priv->current_page->complete); gtk_widget_grab_default (assistant->forward); - gtk_widget_show (assistant->cancel); gtk_widget_show (assistant->forward); gtk_widget_hide (assistant->back); gtk_widget_hide (assistant->apply); @@ -499,7 +539,6 @@ set_assistant_buttons_state (GtkAssistant *assistant) gtk_widget_set_sensitive (assistant->back, TRUE); gtk_widget_set_sensitive (assistant->apply, priv->current_page->complete); gtk_widget_grab_default (assistant->apply); - gtk_widget_show (assistant->cancel); gtk_widget_show (assistant->back); gtk_widget_show (assistant->apply); gtk_widget_hide (assistant->forward); @@ -511,7 +550,6 @@ set_assistant_buttons_state (GtkAssistant *assistant) gtk_widget_set_sensitive (assistant->back, TRUE); gtk_widget_set_sensitive (assistant->forward, priv->current_page->complete); gtk_widget_grab_default (assistant->forward); - gtk_widget_show (assistant->cancel); gtk_widget_show (assistant->back); gtk_widget_show (assistant->forward); gtk_widget_hide (assistant->apply); @@ -522,7 +560,6 @@ set_assistant_buttons_state (GtkAssistant *assistant) gtk_widget_set_sensitive (assistant->close, priv->current_page->complete); gtk_widget_grab_default (assistant->close); gtk_widget_show (assistant->close); - gtk_widget_hide (assistant->cancel); gtk_widget_hide (assistant->back); gtk_widget_hide (assistant->forward); gtk_widget_hide (assistant->apply); @@ -533,17 +570,23 @@ set_assistant_buttons_state (GtkAssistant *assistant) gtk_widget_set_sensitive (assistant->back, priv->current_page->complete); gtk_widget_set_sensitive (assistant->forward, priv->current_page->complete); gtk_widget_grab_default (assistant->forward); - gtk_widget_show (assistant->cancel); gtk_widget_show (assistant->back); - gtk_widget_show (assistant->forward); gtk_widget_hide (assistant->apply); gtk_widget_hide (assistant->close); gtk_widget_hide (assistant->last); + compute_progress_state (assistant); break; default: g_assert_not_reached (); } + if (priv->committed) + gtk_widget_hide (assistant->cancel); + else if (priv->current_page->type == GTK_ASSISTANT_PAGE_SUMMARY) + gtk_widget_hide (assistant->cancel); + else + gtk_widget_show (assistant->cancel); + /* this is quite general, we don't want to * go back if it's the first page */ if (!priv->visited_pages) @@ -1145,13 +1188,14 @@ gtk_assistant_size_request (GtkWidget *widget, requisition->height = height; } + static void gtk_assistant_size_allocate (GtkWidget *widget, GtkAllocation *allocation) { GtkAssistant *assistant = GTK_ASSISTANT (widget); GtkAssistantPrivate *priv = assistant->priv; - GtkRequisition header_requisition; + GtkRequisition header_requisition, action_requisition, sidebar_requisition; GtkAllocation child_allocation, header_allocation; gint header_padding, content_padding; gboolean rtl; @@ -1178,24 +1222,28 @@ gtk_assistant_size_allocate (GtkWidget *widget, gtk_widget_size_allocate (priv->header_image, &header_allocation); /* Action area */ + gtk_widget_get_child_requisition (priv->action_area, &action_requisition); + child_allocation.x = GTK_CONTAINER (widget)->border_width; child_allocation.y = allocation->height - - GTK_CONTAINER (widget)->border_width - priv->action_area->requisition.height; + GTK_CONTAINER (widget)->border_width - action_requisition.height; child_allocation.width = allocation->width - 2 * GTK_CONTAINER (widget)->border_width; - child_allocation.height = priv->action_area->requisition.height; + child_allocation.height = action_requisition.height; gtk_widget_size_allocate (priv->action_area, &child_allocation); /* Sidebar */ + gtk_widget_get_child_requisition (priv->sidebar_image, &sidebar_requisition); + if (rtl) child_allocation.x = allocation->width - - GTK_CONTAINER (widget)->border_width - priv->sidebar_image->requisition.width; + GTK_CONTAINER (widget)->border_width - sidebar_requisition.width; else child_allocation.x = GTK_CONTAINER (widget)->border_width; child_allocation.y = GTK_CONTAINER (widget)->border_width + priv->header_image->allocation.height + 2 * header_padding; - child_allocation.width = priv->sidebar_image->requisition.width; + child_allocation.width = sidebar_requisition.width; child_allocation.height = allocation->height - 2 * GTK_CONTAINER (widget)->border_width - priv->header_image->allocation.height - 2 * header_padding - priv->action_area->allocation.height; @@ -2237,6 +2285,35 @@ gtk_assistant_update_buttons_state (GtkAssistant *assistant) set_assistant_buttons_state (assistant); } +/** + * gtk_assistant_commit: + * @assistant: a #GtkAssistant + * + * Erases the visited page history so the back button is not + * shown on the current page, and removes the cancel button + * from subsequent pages. + * + * Use this when the information provided up to the current + * page is hereafter deemed permanent and cannot be modified + * or undone. For example, showing a progress page to track + * a long-running, unreversible operation after the user has + * clicked apply on a confirmation page. + * + * Since: 2.22 + **/ +void +gtk_assistant_commit (GtkAssistant *assistant) +{ + g_return_if_fail (GTK_IS_ASSISTANT (assistant)); + + g_slist_free (assistant->priv->visited_pages); + assistant->priv->visited_pages = NULL; + + assistant->priv->committed = TRUE; + + set_assistant_buttons_state (assistant); +} + /* accessible implementation */ diff --git a/gtk/gtkassistant.h b/gtk/gtkassistant.h index b39afef43b..8b7297fa7f 100644 --- a/gtk/gtkassistant.h +++ b/gtk/gtkassistant.h @@ -23,7 +23,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -41,6 +41,25 @@ G_BEGIN_DECLS #define GTK_IS_ASSISTANT_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GTK_TYPE_ASSISTANT)) #define GTK_ASSISTANT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GTK_TYPE_ASSISTANT, GtkAssistantClass)) +/** + * GtkAssistantPageType: + * @GTK_ASSISTANT_PAGE_CONTENT: The page has regular contents. + * @GTK_ASSISTANT_PAGE_INTRO: The page contains an introduction to the + * assistant task. + * @GTK_ASSISTANT_PAGE_CONFIRM: The page lets the user confirm or deny the + * changes. + * @GTK_ASSISTANT_PAGE_SUMMARY: The page informs the user of the changes + * done. + * @GTK_ASSISTANT_PAGE_PROGRESS: Used for tasks that take a long time to + * complete, blocks the assistant until the page is marked as complete. + * + * An enum for determining the page role inside the #GtkAssistant. It's + * used to handle buttons sensitivity and visibility. + * + * Note that an assistant needs to end its page flow with a page of type + * %GTK_ASSISTANT_PAGE_CONFIRM, %GTK_ASSISTANT_PAGE_SUMMARY or + * %GTK_ASSISTANT_PAGE_PROGRESS to be correct. + */ typedef enum { GTK_ASSISTANT_PAGE_CONTENT, @@ -86,6 +105,18 @@ struct _GtkAssistantClass void (*_gtk_reserved5) (void); }; +/** + * GtkAssistantPageFunc: + * @current_page: The page number used to calculate the next page. + * @data: user data. + * + * A function used by gtk_assistant_set_forward_page_func() to know which + * is the next page given a current one. It's called both for computing the + * next page when the user presses the "forward" button and for handling + * the behavior of the "last" button. + * + * Returns: The next page number. + */ typedef gint (*GtkAssistantPageFunc) (gint current_page, gpointer data); GType gtk_assistant_get_type (void) G_GNUC_CONST; @@ -138,6 +169,7 @@ void gtk_assistant_remove_action_widget (GtkAssistant GtkWidget *child); void gtk_assistant_update_buttons_state (GtkAssistant *assistant); +void gtk_assistant_commit (GtkAssistant *assistant); G_END_DECLS diff --git a/gtk/gtkbbox.c b/gtk/gtkbbox.c index 5760509f1b..91822148dd 100644 --- a/gtk/gtkbbox.c +++ b/gtk/gtkbbox.c @@ -24,6 +24,34 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ +/** + * SECTION:gtkbbox + * @Short_description: Base class for GtkHButtonBox and GtkVButtonBox + * @Title: GtkButtonBox + * @See_also: #GtkVButtonBox, #GtkHButtonBox + * + * The primary purpose of this class is to keep track of the various properties + * of #GtkHButtonBox and #GtkVButtonBox widgets. + * + * gtk_button_box_get_child_size() retrieves the minimum width and height + * for widgets in a given button box. + * + * The internal padding of buttons can be retrieved and changed per button box + * using gtk_button_box_get_child_ipadding() and + * gtk_button_box_set_child_ipadding() respectively. + * + * gtk_button_box_get_spacing() and gtk_button_box_set_spacing() retrieve and + * change default number of pixels between buttons, respectively. + * + * gtk_button_box_get_layout() and gtk_button_box_set_layout() retrieve and + * alter the method used to spread the buttons in a button box across the + * container, respectively. + * + * The main purpose of GtkButtonBox is to make sure the children have all the + * same size. Therefore it ignores the homogeneous property which it inherited + * from GtkBox, and always behaves as if homogeneous was %TRUE. + */ + #include "config.h" #include "gtkbbox.h" #include "gtkhbbox.h" @@ -71,7 +99,7 @@ static void gtk_button_box_get_child_property (GtkContainer *container, #define DEFAULT_CHILD_IPAD_X 4 #define DEFAULT_CHILD_IPAD_Y 0 -G_DEFINE_ABSTRACT_TYPE (GtkButtonBox, gtk_button_box, GTK_TYPE_BOX) +G_DEFINE_TYPE (GtkButtonBox, gtk_button_box, GTK_TYPE_BOX) static void gtk_button_box_class_init (GtkButtonBoxClass *class) @@ -234,28 +262,13 @@ gtk_button_box_get_child_property (GtkContainer *container, } } -/* set per widget values for spacing, child size and child internal padding */ - -void -gtk_button_box_set_child_size (GtkButtonBox *widget, - gint width, gint height) -{ - g_return_if_fail (GTK_IS_BUTTON_BOX (widget)); - - widget->child_min_width = width; - widget->child_min_height = height; -} - -void -gtk_button_box_set_child_ipadding (GtkButtonBox *widget, - gint ipad_x, gint ipad_y) -{ - g_return_if_fail (GTK_IS_BUTTON_BOX (widget)); - - widget->child_ipad_x = ipad_x; - widget->child_ipad_y = ipad_y; -} - +/** + * gtk_button_box_set_layout: + * @widget: a #GtkButtonBox + * @layout_style: the new layout style + * + * Changes the way buttons are arranged in their container. + */ void gtk_button_box_set_layout (GtkButtonBox *widget, GtkButtonBoxStyle layout_style) @@ -272,33 +285,14 @@ gtk_button_box_set_layout (GtkButtonBox *widget, } } - -/* get per widget values for spacing, child size and child internal padding */ - -void -gtk_button_box_get_child_size (GtkButtonBox *widget, - gint *width, gint *height) -{ - g_return_if_fail (GTK_IS_BUTTON_BOX (widget)); - g_return_if_fail (width != NULL); - g_return_if_fail (height != NULL); - - *width = widget->child_min_width; - *height = widget->child_min_height; -} - -void -gtk_button_box_get_child_ipadding (GtkButtonBox *widget, - gint* ipad_x, gint *ipad_y) -{ - g_return_if_fail (GTK_IS_BUTTON_BOX (widget)); - g_return_if_fail (ipad_x != NULL); - g_return_if_fail (ipad_y != NULL); - - *ipad_x = widget->child_ipad_x; - *ipad_y = widget->child_ipad_y; -} - +/** + * gtk_button_box_get_layout: + * @widget: a #GtkButtonBox + * + * Retrieves the method being used to arrange the buttons in a button box. + * + * Returns: the method used to layout buttons in @widget. + */ GtkButtonBoxStyle gtk_button_box_get_layout (GtkButtonBox *widget) { @@ -819,5 +813,23 @@ gtk_button_box_size_allocate (GtkWidget *widget, } } +/** + * gtk_button_box_new: + * @orientation: the box' orientation. + * + * Creates a new #GtkButtonBox. + * + * Return value: a new #GtkButtonBox. + * + * Since: 3.0 + */ +GtkWidget * +gtk_button_box_new (GtkOrientation orientation) +{ + return g_object_new (GTK_TYPE_BUTTON_BOX, + "orientation", orientation, + NULL); +} + #define __GTK_BUTTON_BOX_C__ #include "gtkaliasdef.c" diff --git a/gtk/gtkbbox.h b/gtk/gtkbbox.h index f0666a210f..72f8458142 100644 --- a/gtk/gtkbbox.h +++ b/gtk/gtkbbox.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -65,8 +65,8 @@ struct _GtkButtonBoxClass }; -GType gtk_button_box_get_type (void) G_GNUC_CONST; - +GType gtk_button_box_get_type (void) G_GNUC_CONST; +GtkWidget * gtk_button_box_new (GtkOrientation orientation); GtkButtonBoxStyle gtk_button_box_get_layout (GtkButtonBox *widget); void gtk_button_box_set_layout (GtkButtonBox *widget, GtkButtonBoxStyle layout_style); @@ -76,24 +76,6 @@ void gtk_button_box_set_child_secondary (GtkButtonBox *widget, GtkWidget *child, gboolean is_secondary); -#ifndef GTK_DISABLE_DEPRECATED -#define gtk_button_box_set_spacing(b,s) gtk_box_set_spacing (GTK_BOX (b), s) -#define gtk_button_box_get_spacing(b) gtk_box_get_spacing (GTK_BOX (b)) - -void gtk_button_box_set_child_size (GtkButtonBox *widget, - gint min_width, - gint min_height); -void gtk_button_box_set_child_ipadding (GtkButtonBox *widget, - gint ipad_x, - gint ipad_y); -void gtk_button_box_get_child_size (GtkButtonBox *widget, - gint *min_width, - gint *min_height); -void gtk_button_box_get_child_ipadding (GtkButtonBox *widget, - gint *ipad_x, - gint *ipad_y); -#endif - /* Internal method - do not use. */ void _gtk_button_box_child_requisition (GtkWidget *widget, int *nvis_children, diff --git a/gtk/gtkbin.c b/gtk/gtkbin.c index 16f13794ee..25ccb60661 100644 --- a/gtk/gtkbin.c +++ b/gtk/gtkbin.c @@ -24,8 +24,22 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ +/** + * SECTION:gtkbin + * @Short_description: A container with just one child + * @Title: GtkBin + * + * The #GtkBin widget is a container with just one child. + * It is not very useful itself, but it is useful for deriving subclasses, + * since it provides common code needed for handling a single child widget. + * + * Many GTK+ widgets are subclasses of #GtkBin, including #GtkWindow, + * #GtkButton, #GtkFrame, #GtkHandleBox or #GtkScrolledWindow. + */ + #include "config.h" #include "gtkbin.h" +#include "gtkextendedlayout.h" #include "gtkintl.h" #include "gtkalias.h" @@ -40,7 +54,22 @@ static void gtk_bin_forall (GtkContainer *container, static GType gtk_bin_child_type (GtkContainer *container); -G_DEFINE_ABSTRACT_TYPE (GtkBin, gtk_bin, GTK_TYPE_CONTAINER) +static void gtk_bin_extended_layout_init (GtkExtendedLayoutIface *iface); +static gboolean gtk_bin_is_height_for_width (GtkExtendedLayout *layout); +static void gtk_bin_get_width_for_height (GtkExtendedLayout *layout, + gint height, + gint *minimum_width, + gint *natural_width); +static void gtk_bin_get_height_for_width (GtkExtendedLayout *layout, + gint width, + gint *minimum_height, + gint *natural_height); + +static GtkExtendedLayoutIface *parent_extended_layout_iface; + +G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GtkBin, gtk_bin, GTK_TYPE_CONTAINER, + G_IMPLEMENT_INTERFACE (GTK_TYPE_EXTENDED_LAYOUT, + gtk_bin_extended_layout_init)) static void gtk_bin_class_init (GtkBinClass *class) @@ -128,6 +157,109 @@ gtk_bin_forall (GtkContainer *container, (* callback) (bin->child, callback_data); } + +/* GtkBin widgets define the padding and borders independantly so + * we cannot provide a generic get_desired_size() for the same reason + * we never implemented size_request() here. + * + * But for cases where the GtkBin class's padding is constant and + * does not vary based on allocation (most cases), we can at least + * deduce a common code path for the get_width_for_height()/get_height_for_width() + * cases by using the delta of the base size requsts. + */ +static void +gtk_bin_extended_layout_init (GtkExtendedLayoutIface *iface) +{ + parent_extended_layout_iface = g_type_interface_peek_parent (iface); + + iface->is_height_for_width = gtk_bin_is_height_for_width; + iface->get_width_for_height = gtk_bin_get_width_for_height; + iface->get_height_for_width = gtk_bin_get_height_for_width; +} + +static gboolean +gtk_bin_is_height_for_width (GtkExtendedLayout *layout) +{ + GtkBin *bin = GTK_BIN (layout); + + if (bin->child) + return gtk_extended_layout_is_height_for_width (GTK_EXTENDED_LAYOUT (bin->child)); + + return TRUE; +} + +static void +get_child_padding_delta (GtkBin *bin, + gint *delta_h, + gint *delta_v) +{ + gint hmin, vmin, child_hmin, child_vmin; + + gtk_extended_layout_get_desired_width (GTK_EXTENDED_LAYOUT (bin), &hmin, NULL); + gtk_extended_layout_get_desired_height (GTK_EXTENDED_LAYOUT (bin), &vmin, NULL); + + gtk_extended_layout_get_desired_width (GTK_EXTENDED_LAYOUT (bin->child), &child_hmin, NULL); + gtk_extended_layout_get_desired_height (GTK_EXTENDED_LAYOUT (bin->child), &child_vmin, NULL); + + *delta_h = hmin - child_hmin; + *delta_v = vmin - child_vmin; +} + +static void +gtk_bin_get_width_for_height (GtkExtendedLayout *layout, + gint height, + gint *minimum_width, + gint *natural_width) +{ + GtkBin *bin = GTK_BIN (layout); + gint hdelta, vdelta, child_min, child_nat; + + if (bin->child) + { + get_child_padding_delta (bin, &hdelta, &vdelta); + + gtk_extended_layout_get_width_for_height (GTK_EXTENDED_LAYOUT (bin->child), + height - vdelta, + &child_min, &child_nat); + + if (minimum_width) + *minimum_width = child_min + hdelta; + + if (natural_width) + *natural_width = child_nat + hdelta; + } + else + GTK_EXTENDED_LAYOUT_GET_IFACE (layout)->get_desired_width (layout, minimum_width, natural_width); +} + +static void +gtk_bin_get_height_for_width (GtkExtendedLayout *layout, + gint width, + gint *minimum_height, + gint *natural_height) +{ + GtkBin *bin = GTK_BIN (layout); + gint hdelta, vdelta, child_min, child_nat; + + if (bin->child) + { + get_child_padding_delta (bin, &hdelta, &vdelta); + + gtk_extended_layout_get_height_for_width (GTK_EXTENDED_LAYOUT (bin->child), + width - hdelta, + &child_min, &child_nat); + + if (minimum_height) + *minimum_height = child_min + vdelta; + + if (natural_height) + *natural_height = child_nat + vdelta; + } + else + GTK_EXTENDED_LAYOUT_GET_IFACE (layout)->get_desired_height (layout, minimum_height, natural_height); +} + + /** * gtk_bin_get_child: * @bin: a #GtkBin diff --git a/gtk/gtkbin.h b/gtk/gtkbin.h index b80e111833..7db2a5ae4a 100644 --- a/gtk/gtkbin.h +++ b/gtk/gtkbin.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkbindings.c b/gtk/gtkbindings.c index db5d83a722..c75e220587 100644 --- a/gtk/gtkbindings.c +++ b/gtk/gtkbindings.c @@ -706,37 +706,6 @@ gtk_binding_entry_clear_internal (GtkBindingSet *binding_set, entry = binding_entry_new (binding_set, keyval, modifiers); } -/** - * gtk_binding_entry_add: - * @binding_set: #a GtkBindingSet to clear an entry of - * @keyval: key value of binding to clear - * @modifiers: key modifier of binding to clear - * - * Adds a binding entry. - * - * Deprecated: 2.12: Use gtk_binding_entry_add_signal() instead. - */ - -/** - * gtk_binding_entry_clear: - * @binding_set: binding set to clear an entry of - * @keyval: key value of binding to clear - * @modifiers: key modifier of binding to clear - * - * Clears a binding entry. - * - * Deprecated: 2.12: Use gtk_binding_entry_remove() instead. - */ -void -gtk_binding_entry_clear (GtkBindingSet *binding_set, - guint keyval, - GdkModifierType modifiers) -{ - g_return_if_fail (binding_set != NULL); - - gtk_binding_entry_clear_internal (binding_set, keyval, modifiers); -} - /** * gtk_binding_entry_skip: * @binding_set: a #GtkBindingSet to skip an entry of @@ -1588,22 +1557,6 @@ gtk_binding_parse_bind (GScanner *scanner, return G_TOKEN_NONE; } -/** - * gtk_binding_parse_binding: - * @scanner: GtkRC scanner - * - * Parse a binding entry from a gtkrc file. - * - * Return value: expected token upon errors, %G_TOKEN_NONE on success. - * - * Deprecated: 2.12: There should be no need to call this function outside GTK+. - */ -guint -gtk_binding_parse_binding (GScanner *scanner) -{ - return _gtk_binding_parse_binding (scanner); -} - guint _gtk_binding_parse_binding (GScanner *scanner) { diff --git a/gtk/gtkbindings.h b/gtk/gtkbindings.h index 0ff74230c4..904eb3e8c1 100644 --- a/gtk/gtkbindings.h +++ b/gtk/gtkbindings.h @@ -27,7 +27,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -111,14 +111,6 @@ gboolean gtk_binding_set_activate (GtkBindingSet *binding_set, GdkModifierType modifiers, GtkObject *object); -#ifndef GTK_DISABLE_DEPRECATED -#define gtk_binding_entry_add gtk_binding_entry_clear -void gtk_binding_entry_clear (GtkBindingSet *binding_set, - guint keyval, - GdkModifierType modifiers); -guint gtk_binding_parse_binding (GScanner *scanner); -#endif /* GTK_DISABLE_DEPRECATED */ - void gtk_binding_entry_skip (GtkBindingSet *binding_set, guint keyval, GdkModifierType modifiers); diff --git a/gtk/gtkbox.c b/gtk/gtkbox.c index 1ebcbcf8e4..3c56196094 100644 --- a/gtk/gtkbox.c +++ b/gtk/gtkbox.c @@ -24,10 +24,65 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ +/** + * SECTION:gtkbox + * @Short_description: Base class for box containers + * @Title: GtkBox + * @See_also:i #GtkHBox, #GtkVBox, #GtkFrame, #GtkTable, #GtkLayout + * + * GtkBox is an widget which encapsulates functionality for a + * particular kind of container, one that organizes a variable number of + * widgets into a rectangular area. GtkBox has a number of derived + * classes, e.g. #GtkHBox and #GtkVBox. + * + * The rectangular area of a GtkBox is organized into either a single row + * or a single column of child widgets depending upon whether the box is + * of type #GtkHBox or #GtkVBox, respectively. Thus, all children of a + * GtkBox are allocated one dimension in common, which is the height of a + * row, or the width of a column. + * + * GtkBox uses a notion of packing. Packing + * refers to adding widgets with reference to a particular position in a + * #GtkContainer. For a GtkBox, there are two reference positions: the + * start and the end of the box. + * For a #GtkVBox, the start is defined as the top of the box and the end is + * defined as the bottom. For a #GtkHBox the start is defined as the + * left side and the end is defined as the right side. + * + * Use repeated calls to gtk_box_pack_start() to pack widgets into a + * GtkBox from start to end. Use gtk_box_pack_end() to add widgets from + * end to start. You may intersperse these calls and add widgets from + * both ends of the same GtkBox. + * + * Use gtk_box_pack_start_defaults() or gtk_box_pack_end_defaults() + * to pack widgets into a GtkBox if you do not need to specify the + * #GtkBox:expand, #GtkBox:fill, or #GtkBox:padding child properties + * for the child to be added. + * + * Because GtkBox is a #GtkContainer, you may also use + * gtk_container_add() to insert widgets into the box, and they will be + * packed as if with gtk_box_pack_start_defaults(). Use + * gtk_container_remove() to remove widgets from the GtkBox. + * + * Use gtk_box_set_homogeneous() to specify whether or not all children + * of the GtkBox are forced to get the same amount of space. + * + * Use gtk_box_set_spacing() to determine how much space will be + * minimally placed between all children in the GtkBox. + * + * Use gtk_box_reorder_child() to move a GtkBox child to a different + * place in the box. + * + * Use gtk_box_set_child_packing() to reset the #GtkBox:expand, + * #GtkBox:fill and #GtkBox:padding child properties. + * Use gtk_box_query_child_packing() to query these fields. + */ + #include "config.h" #include "gtkbox.h" #include "gtkorientable.h" +#include "gtkextendedlayout.h" #include "gtkprivate.h" #include "gtkintl.h" #include "gtkalias.h" @@ -60,6 +115,23 @@ struct _GtkBoxPrivate #define GTK_BOX_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_BOX, GtkBoxPrivate)) +typedef struct _GtkBoxDesiredSizes GtkBoxDesiredSizes; +typedef struct _GtkBoxSpreading GtkBoxSpreading; + +struct _GtkBoxDesiredSizes +{ + gint minimum_size; + gint natural_size; +}; + +struct _GtkBoxSpreading +{ + GtkBoxChild *child; + gint index; +}; + +static void gtk_box_size_allocate (GtkWidget *widget, + GtkAllocation *allocation); static void gtk_box_set_property (GObject *object, guint prop_id, @@ -70,11 +142,6 @@ static void gtk_box_get_property (GObject *object, GValue *value, GParamSpec *pspec); -static void gtk_box_size_request (GtkWidget *widget, - GtkRequisition *requisition); -static void gtk_box_size_allocate (GtkWidget *widget, - GtkAllocation *allocation); - static void gtk_box_add (GtkContainer *container, GtkWidget *widget); static void gtk_box_remove (GtkContainer *container, @@ -96,9 +163,30 @@ static void gtk_box_get_child_property (GtkContainer *container, static GType gtk_box_child_type (GtkContainer *container); -G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GtkBox, gtk_box, GTK_TYPE_CONTAINER, - G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE, - NULL)); +static void gtk_box_extended_layout_init (GtkExtendedLayoutIface *iface); +static gboolean gtk_box_is_height_for_width (GtkExtendedLayout *layout); +static void gtk_box_get_desired_width (GtkExtendedLayout *layout, + gint *minimum_size, + gint *natural_size); +static void gtk_box_get_desired_height (GtkExtendedLayout *layout, + gint *minimum_size, + gint *natural_size); +static void gtk_box_get_width_for_height (GtkExtendedLayout *layout, + gint height, + gint *minimum_width, + gint *natural_width); +static void gtk_box_get_height_for_width (GtkExtendedLayout *layout, + gint width, + gint *minimum_height, + gint *natural_height); + +static GtkExtendedLayoutIface *parent_extended_layout_iface; + +G_DEFINE_TYPE_WITH_CODE (GtkBox, gtk_box, GTK_TYPE_CONTAINER, + G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE, + NULL) + G_IMPLEMENT_INTERFACE (GTK_TYPE_EXTENDED_LAYOUT, + gtk_box_extended_layout_init)); static void gtk_box_class_init (GtkBoxClass *class) @@ -110,7 +198,6 @@ gtk_box_class_init (GtkBoxClass *class) object_class->set_property = gtk_box_set_property; object_class->get_property = gtk_box_get_property; - widget_class->size_request = gtk_box_size_request; widget_class->size_allocate = gtk_box_size_allocate; container_class->add = gtk_box_add; @@ -251,79 +338,50 @@ gtk_box_get_property (GObject *object, } } + static void -gtk_box_size_request (GtkWidget *widget, - GtkRequisition *requisition) +count_expand_children (GtkBox *box, gint *visible_children, gint *expand_children) { - GtkBox *box = GTK_BOX (widget); - GtkBoxPrivate *private = GTK_BOX_GET_PRIVATE (box); + GList *children; GtkBoxChild *child; - GList *children; - gint nvis_children; - gint width; - gint height; - requisition->width = 0; - requisition->height = 0; - nvis_children = 0; + *visible_children = *expand_children = 0; - children = box->children; - while (children) + for (children = box->children; children; children = children->next) { child = children->data; - children = children->next; if (gtk_widget_get_visible (child->widget)) { - GtkRequisition child_requisition; - - gtk_widget_size_request (child->widget, &child_requisition); - - if (box->homogeneous) - { - width = child_requisition.width + child->padding * 2; - height = child_requisition.height + child->padding * 2; - - if (private->orientation == GTK_ORIENTATION_HORIZONTAL) - requisition->width = MAX (requisition->width, width); - else - requisition->height = MAX (requisition->height, height); - } - else - { - if (private->orientation == GTK_ORIENTATION_HORIZONTAL) - requisition->width += child_requisition.width + child->padding * 2; - else - requisition->height += child_requisition.height + child->padding * 2; - } - - if (private->orientation == GTK_ORIENTATION_HORIZONTAL) - requisition->height = MAX (requisition->height, child_requisition.height); - else - requisition->width = MAX (requisition->width, child_requisition.width); - - nvis_children += 1; + *visible_children += 1; + if (child->expand) + *expand_children += 1; } } +} - if (nvis_children > 0) - { - if (box->homogeneous) - { - if (private->orientation == GTK_ORIENTATION_HORIZONTAL) - requisition->width *= nvis_children; - else - requisition->height *= nvis_children; - } +static gint +gtk_box_compare_gap (gconstpointer p1, + gconstpointer p2, + gpointer data) +{ + GtkBoxDesiredSizes *sizes = data; + const GtkBoxSpreading *c1 = p1; + const GtkBoxSpreading *c2 = p2; - if (private->orientation == GTK_ORIENTATION_HORIZONTAL) - requisition->width += (nvis_children - 1) * box->spacing; - else - requisition->height += (nvis_children - 1) * box->spacing; - } + const gint d1 = MAX (sizes[c1->index].natural_size - + sizes[c1->index].minimum_size, + 0); + const gint d2 = MAX (sizes[c2->index].natural_size - + sizes[c2->index].minimum_size, + 0); - requisition->width += GTK_CONTAINER (box)->border_width * 2; - requisition->height += GTK_CONTAINER (box)->border_width * 2; + gint delta = (d2 - d1); + + if (0 == delta) + delta = (c2->index - c1->index); + + return delta; } static void @@ -334,269 +392,268 @@ gtk_box_size_allocate (GtkWidget *widget, GtkBoxPrivate *private = GTK_BOX_GET_PRIVATE (box); GtkBoxChild *child; GList *children; - GtkAllocation child_allocation; - gint nvis_children = 0; - gint nexpand_children = 0; - gint child_width = 0; - gint child_height = 0; - gint width = 0; - gint height = 0; - gint extra = 0; - gint x = 0; - gint y = 0; - GtkTextDirection direction; + gint nvis_children; + gint nexpand_children; widget->allocation = *allocation; - direction = gtk_widget_get_direction (widget); - - for (children = box->children; children; children = children->next) - { - child = children->data; - - if (gtk_widget_get_visible (child->widget)) - { - nvis_children += 1; - if (child->expand) - nexpand_children += 1; - } - } + count_expand_children (box, &nvis_children, &nexpand_children); if (nvis_children > 0) { - if (box->homogeneous) - { - if (private->orientation == GTK_ORIENTATION_HORIZONTAL) - { - width = (allocation->width - - GTK_CONTAINER (box)->border_width * 2 - - (nvis_children - 1) * box->spacing); - extra = width / nvis_children; - } - else - { - height = (allocation->height - - GTK_CONTAINER (box)->border_width * 2 - - (nvis_children - 1) * box->spacing); - extra = height / nvis_children; - } - } - else if (nexpand_children > 0) - { - if (private->orientation == GTK_ORIENTATION_HORIZONTAL) - { - width = (gint) allocation->width - (gint) widget->requisition.width; - extra = width / nexpand_children; - } - else - { - height = (gint) allocation->height - (gint) widget->requisition.height; - extra = height / nexpand_children; - } - } + gint border_width = GTK_CONTAINER (box)->border_width; + GtkTextDirection direction = gtk_widget_get_direction (widget); + GtkAllocation child_allocation; + GtkBoxSpreading *spreading = g_newa (GtkBoxSpreading, nvis_children); + GtkBoxDesiredSizes *sizes = g_newa (GtkBoxDesiredSizes, nvis_children); + + GtkPackType packing; + + gint size; + gint extra; + gint x = 0, y = 0, i; + gint child_size; if (private->orientation == GTK_ORIENTATION_HORIZONTAL) - { - x = allocation->x + GTK_CONTAINER (box)->border_width; - child_allocation.y = allocation->y + GTK_CONTAINER (box)->border_width; - child_allocation.height = MAX (1, (gint) allocation->height - (gint) GTK_CONTAINER (box)->border_width * 2); - } + size = allocation->width - border_width * 2 - (nvis_children - 1) * box->spacing; else - { - y = allocation->y + GTK_CONTAINER (box)->border_width; - child_allocation.x = allocation->x + GTK_CONTAINER (box)->border_width; - child_allocation.width = MAX (1, (gint) allocation->width - (gint) GTK_CONTAINER (box)->border_width * 2); - } + size = allocation->height - border_width * 2 - (nvis_children - 1) * box->spacing; + /* Retrieve desired size for visible children */ + i = 0; children = box->children; while (children) { child = children->data; children = children->next; - if ((child->pack == GTK_PACK_START) && gtk_widget_get_visible (child->widget)) + if (gtk_widget_get_visible (child->widget)) { - if (box->homogeneous) - { - if (nvis_children == 1) - { - child_width = width; - child_height = height; - } - else - { - child_width = extra; - child_height = extra; - } - - nvis_children -= 1; - width -= extra; - height -= extra; - } + if (private->orientation == GTK_ORIENTATION_HORIZONTAL) + gtk_extended_layout_get_width_for_height (GTK_EXTENDED_LAYOUT (child->widget), + allocation->height, + &sizes[i].minimum_size, + &sizes[i].natural_size); else - { - GtkRequisition child_requisition; + gtk_extended_layout_get_height_for_width (GTK_EXTENDED_LAYOUT (child->widget), + allocation->width, + &sizes[i].minimum_size, + &sizes[i].natural_size); + + + /* Assert the api is working properly */ + if (sizes[i].minimum_size < 0) + g_error ("GtkBox child %s minimum %s: %d < 0 for %s %d", + gtk_widget_get_name (GTK_WIDGET (child->widget)), + (private->orientation == GTK_ORIENTATION_HORIZONTAL) ? "width" : "height", + sizes[i].minimum_size, + (private->orientation == GTK_ORIENTATION_HORIZONTAL) ? "height" : "width", + (private->orientation == GTK_ORIENTATION_HORIZONTAL) ? allocation->height : allocation->width); - gtk_widget_get_child_requisition (child->widget, &child_requisition); - - child_width = child_requisition.width + child->padding * 2; - child_height = child_requisition.height + child->padding * 2; - - if (child->expand) - { - if (nexpand_children == 1) - { - child_width += width; - child_height += height; - } - else - { - child_width += extra; - child_height += extra; - } - - nexpand_children -= 1; - width -= extra; - height -= extra; - } - } - - if (child->fill) - { - if (private->orientation == GTK_ORIENTATION_HORIZONTAL) - { - child_allocation.width = MAX (1, (gint) child_width - (gint) child->padding * 2); - child_allocation.x = x + child->padding; - } - else - { - child_allocation.height = MAX (1, child_height - (gint)child->padding * 2); - child_allocation.y = y + child->padding; - } - } - else - { - GtkRequisition child_requisition; - - gtk_widget_get_child_requisition (child->widget, &child_requisition); - if (private->orientation == GTK_ORIENTATION_HORIZONTAL) - { - child_allocation.width = child_requisition.width; - child_allocation.x = x + (child_width - child_allocation.width) / 2; - } - else - { - child_allocation.height = child_requisition.height; - child_allocation.y = y + (child_height - child_allocation.height) / 2; - } - } - - if (direction == GTK_TEXT_DIR_RTL && - private->orientation == GTK_ORIENTATION_HORIZONTAL) - { - child_allocation.x = allocation->x + allocation->width - (child_allocation.x - allocation->x) - child_allocation.width; - } - - gtk_widget_size_allocate (child->widget, &child_allocation); - - x += child_width + box->spacing; - y += child_height + box->spacing; + if (sizes[i].natural_size < sizes[i].minimum_size) + g_error ("GtkBox child %s natural %s: %d < minimum %d for %s %d", + gtk_widget_get_name (GTK_WIDGET (child->widget)), + (private->orientation == GTK_ORIENTATION_HORIZONTAL) ? "width" : "height", + sizes[i].natural_size, + sizes[i].minimum_size, + (private->orientation == GTK_ORIENTATION_HORIZONTAL) ? "height" : "width", + (private->orientation == GTK_ORIENTATION_HORIZONTAL) ? allocation->height : allocation->width); + + size -= sizes[i].minimum_size; + size -= child->padding * 2; + + spreading[i].index = i; + spreading[i].child = child; + + i += 1; } } - x = allocation->x + allocation->width - GTK_CONTAINER (box)->border_width; - y = allocation->y + allocation->height - GTK_CONTAINER (box)->border_width; - - children = box->children; - while (children) + if (box->homogeneous) + { + /* If were homogenous we still need to run the above loop to get the minimum sizes + * for children that are not going to fill + */ + if (private->orientation == GTK_ORIENTATION_HORIZONTAL) + size = allocation->width - border_width * 2 - (nvis_children - 1) * box->spacing; + else + size = allocation->height - border_width * 2 - (nvis_children - 1) * box->spacing; + + extra = size / nvis_children; + } + else { - child = children->data; - children = children->next; - if ((child->pack == GTK_PACK_END) && gtk_widget_get_visible (child->widget)) + /* Distribute the container's extra space c_gap. We want to assign + * this space such that the sum of extra space assigned to children + * (c^i_gap) is equal to c_cap. The case that there's not enough + * space for all children to take their natural size needs some + * attention. The goals we want to achieve are: + * + * a) Maximize number of children taking their natural size. + * b) The allocated size of children should be a continuous + * function of c_gap. That is, increasing the container size by + * one pixel should never make drastic changes in the distribution. + * c) If child i takes its natural size and child j doesn't, + * child j should have received at least as much gap as child i. + * + * The following code distributes the additional space by following + * this rules. + */ + + /* Sort descending by gap and position. */ + + g_qsort_with_data (spreading, + nvis_children, sizeof (GtkBoxSpreading), + gtk_box_compare_gap, sizes); + + /* Distribute available space. + * This master piece of a loop was conceived by Behdad Esfahbod. + */ + for (i = nvis_children - 1; i >= 0; --i) + { + /* Divide remaining space by number of remaining children. + * Sort order and reducing remaining space by assigned space + * ensures that space is distributed equally. + */ + gint glue = (size + i) / (i + 1); + gint gap = sizes[spreading[i].index].natural_size + - sizes[spreading[i].index].minimum_size; + + extra = MIN (glue, gap); + sizes[spreading[i].index].minimum_size += extra; + + size -= extra; + } + + /* Calculate space which hasn't distributed yet, + * and is available for expanding children. + */ + if (nexpand_children > 0) + extra = size / nexpand_children; + else + extra = 0; + } + + /* Allocate child positions. */ + + for (packing = GTK_PACK_START; packing <= GTK_PACK_END; ++packing) + { + if (private->orientation == GTK_ORIENTATION_HORIZONTAL) + { + child_allocation.y = allocation->y + border_width; + child_allocation.height = MAX (1, allocation->height - border_width * 2); + if (packing == GTK_PACK_START) + x = allocation->x + border_width; + else + x = allocation->x + allocation->width - border_width; + } + else + { + child_allocation.x = allocation->x + border_width; + child_allocation.width = MAX (1, allocation->width - border_width * 2); + if (packing == GTK_PACK_START) + y = allocation->y + border_width; + else + y = allocation->y + allocation->height - border_width; + } + + i = 0; + children = box->children; + while (children) { - GtkRequisition child_requisition; + child = children->data; + children = children->next; - gtk_widget_get_child_requisition (child->widget, &child_requisition); - - if (box->homogeneous) - { - if (nvis_children == 1) + if (gtk_widget_get_visible (child->widget)) + { + if (child->pack == packing) { - child_width = width; - child_height = height; - } - else - { - child_width = extra; - child_height = extra; - } + /* Assign the child's size. */ + if (box->homogeneous) + { + if (nvis_children == 1) + child_size = size; + else + child_size = extra; - nvis_children -= 1; - width -= extra; - height -= extra; - } - else - { - child_width = child_requisition.width + child->padding * 2; - child_height = child_requisition.height + child->padding * 2; + nvis_children -= 1; + size -= extra; + } + else + { + child_size = sizes[i].minimum_size + child->padding * 2; - if (child->expand) - { - if (nexpand_children == 1) + if (child->expand) + { + if (nexpand_children == 1) + child_size += size; + else + child_size += extra; + + nexpand_children -= 1; + size -= extra; + } + } + + /* Assign the child's position. */ + if (private->orientation == GTK_ORIENTATION_HORIZONTAL) { - child_width += width; - child_height += height; - } - else - { - child_width += extra; - child_height += extra; + if (child->fill) + { + child_allocation.width = MAX (1, child_size - child->padding * 2); + child_allocation.x = x + child->padding; + } + else + { + child_allocation.width = sizes[i].minimum_size; + child_allocation.x = x + (child_size - child_allocation.width) / 2; + } + + if (packing == GTK_PACK_START) + { + x += child_size + box->spacing; + } + else + { + x -= child_size + box->spacing; + + child_allocation.x -= child_size; + } + + if (direction == GTK_TEXT_DIR_RTL) + child_allocation.x = allocation->x + allocation->width - (child_allocation.x - allocation->x) - child_allocation.width; + } + else /* (private->orientation == GTK_ORIENTATION_VERTICAL) */ + { + if (child->fill) + { + child_allocation.height = MAX (1, child_size - child->padding * 2); + child_allocation.y = y + child->padding; + } + else + { + child_allocation.height = sizes[i].minimum_size; + child_allocation.y = y + (child_size - child_allocation.height) / 2; + } - nexpand_children -= 1; - width -= extra; - height -= extra; + if (packing == GTK_PACK_START) + { + y += child_size + box->spacing; + } + else + { + y -= child_size + box->spacing; + + child_allocation.y -= child_size; + } + } + gtk_widget_size_allocate (child->widget, &child_allocation); } - } - if (child->fill) - { - if (private->orientation == GTK_ORIENTATION_HORIZONTAL) - { - child_allocation.width = MAX (1, (gint)child_width - (gint)child->padding * 2); - child_allocation.x = x + child->padding - child_width; - } - else - { - child_allocation.height = MAX (1, child_height - (gint)child->padding * 2); - child_allocation.y = y + child->padding - child_height; - } + i += 1; } - else - { - if (private->orientation == GTK_ORIENTATION_HORIZONTAL) - { - child_allocation.width = child_requisition.width; - child_allocation.x = x + (child_width - child_allocation.width) / 2 - child_width; - } - else - { - child_allocation.height = child_requisition.height; - child_allocation.y = y + (child_height - child_allocation.height) / 2 - child_height; - } - } - - if (direction == GTK_TEXT_DIR_RTL && - private->orientation == GTK_ORIENTATION_HORIZONTAL) - { - child_allocation.x = allocation->x + allocation->width - (child_allocation.x - allocation->x) - child_allocation.width; - } - - gtk_widget_size_allocate (child->widget, &child_allocation); - - x -= (child_width + box->spacing); - y -= (child_height + box->spacing); } } } @@ -762,22 +819,445 @@ gtk_box_pack (GtkBox *box, gtk_widget_thaw_child_notify (child); } + +static void +gtk_box_extended_layout_init (GtkExtendedLayoutIface *iface) +{ + parent_extended_layout_iface = g_type_interface_peek_parent (iface); + + iface->is_height_for_width = gtk_box_is_height_for_width; + iface->get_desired_width = gtk_box_get_desired_width; + iface->get_desired_height = gtk_box_get_desired_height; + iface->get_height_for_width = gtk_box_get_height_for_width; + iface->get_width_for_height = gtk_box_get_width_for_height; +} + +static gboolean +gtk_box_is_height_for_width (GtkExtendedLayout *layout) +{ + GtkBoxPrivate *private = GTK_BOX_GET_PRIVATE (layout); + + return (private->orientation == GTK_ORIENTATION_VERTICAL); +} + +static void +gtk_box_get_desired_size (GtkExtendedLayout *layout, + GtkOrientation orientation, + gint *minimum_size, + gint *natural_size) +{ + GtkBox *box; + GtkBoxPrivate *private; + GList *children; + gint nvis_children; + gint border_width; + gint minimum, natural; + + box = GTK_BOX (layout); + private = GTK_BOX_GET_PRIVATE (box); + border_width = GTK_CONTAINER (box)->border_width; + + minimum = natural = 0; + + nvis_children = 0; + + for (children = box->children; children; children = children->next) + { + GtkBoxChild *child = children->data; + + if (gtk_widget_get_visible (child->widget)) + { + gint child_minimum, child_natural; + + if (orientation == GTK_ORIENTATION_HORIZONTAL) + gtk_extended_layout_get_desired_width (GTK_EXTENDED_LAYOUT (child->widget), + &child_minimum, &child_natural); + else + gtk_extended_layout_get_desired_height (GTK_EXTENDED_LAYOUT (child->widget), + &child_minimum, &child_natural); + + if (private->orientation == orientation) + { + if (box->homogeneous) + { + gint largest; + + largest = child_minimum + child->padding * 2; + minimum = MAX (minimum, largest); + + largest = child_natural + child->padding * 2; + natural = MAX (natural, largest); + } + else + { + minimum += child_minimum + child->padding * 2; + natural += child_natural + child->padding * 2; + } + } + else + { + /* The biggest mins and naturals in the opposing orientation */ + minimum = MAX (minimum, child_minimum); + natural = MAX (natural, child_natural); + } + + nvis_children += 1; + } + } + + if (nvis_children > 0 && private->orientation == orientation) + { + if (box->homogeneous) + { + minimum *= nvis_children; + natural *= nvis_children; + } + minimum += (nvis_children - 1) * box->spacing; + natural += (nvis_children - 1) * box->spacing; + } + + minimum += border_width * 2; + natural += border_width * 2; + + if (minimum_size) + *minimum_size = minimum; + + if (natural_size) + *natural_size = natural; +} + +static void +gtk_box_get_desired_width (GtkExtendedLayout *layout, + gint *minimum_size, + gint *natural_size) +{ + gtk_box_get_desired_size (layout, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size); +} + +static void +gtk_box_get_desired_height (GtkExtendedLayout *layout, + gint *minimum_size, + gint *natural_size) +{ + gtk_box_get_desired_size (layout, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size); +} + +static void +gtk_box_compute_size_for_opposing_orientation (GtkBox *box, + gint avail_size, + gint *minimum_size, + gint *natural_size) +{ + GtkBoxPrivate *private = GTK_BOX_GET_PRIVATE (box); + GtkBoxChild *child; + GList *children; + gint nvis_children; + gint nexpand_children; + gint computed_minimum = 0, computed_natural = 0; + gint border_width = GTK_CONTAINER (box)->border_width; + + count_expand_children (box, &nvis_children, &nexpand_children); + + if (nvis_children > 0) + { + GtkBoxSpreading *spreading = g_newa (GtkBoxSpreading, nvis_children); + GtkBoxDesiredSizes *sizes = g_newa (GtkBoxDesiredSizes, nvis_children); + GtkPackType packing; + gint size; + gint extra, i; + gint child_size, child_minimum, child_natural; + + size = avail_size - border_width * 2 - (nvis_children - 1) * box->spacing; + + /* Retrieve desired size for visible children */ + for (i = 0, children = box->children; children; children = children->next) + { + child = children->data; + + if (gtk_widget_get_visible (child->widget)) + { + if (private->orientation == GTK_ORIENTATION_HORIZONTAL) + gtk_extended_layout_get_desired_width (GTK_EXTENDED_LAYOUT (child->widget), + &sizes[i].minimum_size, + &sizes[i].natural_size); + else + gtk_extended_layout_get_desired_height (GTK_EXTENDED_LAYOUT (child->widget), + &sizes[i].minimum_size, + &sizes[i].natural_size); + + /* Assert the api is working properly */ + if (sizes[i].minimum_size < 0) + g_error ("GtkBox child %s minimum %s: %d < 0", + gtk_widget_get_name (GTK_WIDGET (child->widget)), + (private->orientation == GTK_ORIENTATION_HORIZONTAL) ? "width" : "height", + sizes[i].minimum_size); + + if (sizes[i].natural_size < sizes[i].minimum_size) + g_error ("GtkBox child %s natural %s: %d < minimum %d", + gtk_widget_get_name (GTK_WIDGET (child->widget)), + (private->orientation == GTK_ORIENTATION_HORIZONTAL) ? "width" : "height", + sizes[i].natural_size, + sizes[i].minimum_size); + + size -= sizes[i].minimum_size; + size -= child->padding * 2; + + spreading[i].index = i; + spreading[i].child = child; + + i += 1; + } + } + + if (box->homogeneous) + { + /* If were homogenous we still need to run the above loop to get the minimum sizes + * for children that are not going to fill + */ + size = avail_size - border_width * 2 - (nvis_children - 1) * box->spacing; + extra = size / nvis_children; + } + else + { + + /* Distribute the container's extra space c_gap. We want to assign + * this space such that the sum of extra space assigned to children + * (c^i_gap) is equal to c_cap. The case that there's not enough + * space for all children to take their natural size needs some + * attention. The goals we want to achieve are: + * + * a) Maximize number of children taking their natural size. + * b) The allocated size of children should be a continuous + * function of c_gap. That is, increasing the container size by + * one pixel should never make drastic changes in the distribution. + * c) If child i takes its natural size and child j doesn't, + * child j should have received at least as much gap as child i. + * + * The following code distributes the additional space by following + * this rules. + */ + + /* Sort descending by gap and position. */ + + g_qsort_with_data (spreading, + nvis_children, sizeof (GtkBoxSpreading), + gtk_box_compare_gap, sizes); + + /* Distribute available space. + * This master piece of a loop was conceived by Behdad Esfahbod. + */ + for (i = nvis_children - 1; i >= 0; --i) + { + /* Divide remaining space by number of remaining children. + * Sort order and reducing remaining space by assigned space + * ensures that space is distributed equally. + */ + gint glue = (size + i) / (i + 1); + gint gap = sizes[spreading[i].index].natural_size + - sizes[spreading[i].index].minimum_size; + + extra = MIN (glue, gap); + sizes[spreading[i].index].minimum_size += extra; + + size -= extra; + } + + /* Calculate space which hasn't distributed yet, + * and is available for expanding children. + */ + if (nexpand_children > 0) + extra = size / nexpand_children; + else + extra = 0; + } + + /* Allocate child positions. */ + for (packing = GTK_PACK_START; packing <= GTK_PACK_END; ++packing) + { + for (i = 0, children = box->children; children; children = children->next) + { + child = children->data; + + if (gtk_widget_get_visible (child->widget)) + { + if (child->pack == packing) + { + /* Assign the child's size. */ + if (box->homogeneous) + { + if (nvis_children == 1) + child_size = size; + else + child_size = extra; + + nvis_children -= 1; + size -= extra; + } + else + { + child_size = sizes[i].minimum_size + child->padding * 2; + + if (child->expand) + { + if (nexpand_children == 1) + child_size += size; + else + child_size += extra; + + nexpand_children -= 1; + size -= extra; + } + } + + if (child->fill) + { + child_size = MAX (1, child_size - child->padding * 2); + } + else + { + child_size = sizes[i].minimum_size; + } + + + /* Assign the child's position. */ + if (private->orientation == GTK_ORIENTATION_HORIZONTAL) + gtk_extended_layout_get_height_for_width (GTK_EXTENDED_LAYOUT (child->widget), + child_size, &child_minimum, &child_natural); + else /* (private->orientation == GTK_ORIENTATION_VERTICAL) */ + gtk_extended_layout_get_width_for_height (GTK_EXTENDED_LAYOUT (child->widget), + child_size, &child_minimum, &child_natural); + + + computed_minimum = MAX (computed_minimum, child_minimum); + computed_natural = MAX (computed_natural, child_natural); + } + i += 1; + } + } + } + } + + computed_minimum += border_width * 2; + computed_natural += border_width * 2; + + if (minimum_size) + *minimum_size = computed_minimum; + if (natural_size) + *natural_size = computed_natural; +} + +static void +gtk_box_compute_size_for_orientation (GtkBox *box, + gint avail_size, + gint *minimum_size, + gint *natural_size) +{ + GtkBoxPrivate *private = GTK_BOX_GET_PRIVATE (box); + GList *children; + gint nvis_children = 0; + gint required_size = 0, required_natural = 0, child_size, child_natural; + gint largest_child = 0, largest_natural = 0; + + avail_size -= GTK_CONTAINER (box)->border_width * 2; + + for (children = box->children; children != NULL; + children = children->next, nvis_children++) + { + GtkBoxChild *child = children->data; + + if (gtk_widget_get_visible (child->widget)) + { + + if (private->orientation == GTK_ORIENTATION_HORIZONTAL) + gtk_extended_layout_get_width_for_height (GTK_EXTENDED_LAYOUT (child->widget), + avail_size, &child_size, &child_natural); + else + gtk_extended_layout_get_height_for_width (GTK_EXTENDED_LAYOUT (child->widget), + avail_size, &child_size, &child_natural); + + + child_size += child->padding * 2; + child_natural += child->padding * 2; + + if (child_size > largest_child) + largest_child = child_size; + + if (child_natural > largest_natural) + largest_natural = child_natural; + + required_size += child_size; + required_natural += child_natural; + } + } + + if (nvis_children > 0) + { + if (box->homogeneous) + { + required_size = largest_child * nvis_children; + required_natural = largest_natural * nvis_children; + } + + required_size += (nvis_children - 1) * box->spacing; + required_natural += (nvis_children - 1) * box->spacing; + } + + required_size += GTK_CONTAINER (box)->border_width * 2; + required_natural += GTK_CONTAINER (box)->border_width * 2; + + if (minimum_size) + *minimum_size = required_size; + + if (natural_size) + *natural_size = required_natural; +} + +static void +gtk_box_get_width_for_height (GtkExtendedLayout *layout, + gint height, + gint *minimum_width, + gint *natural_width) +{ + GtkBox *box = GTK_BOX (layout); + GtkBoxPrivate *private = GTK_BOX_GET_PRIVATE (layout); + + if (private->orientation == GTK_ORIENTATION_VERTICAL) + gtk_box_compute_size_for_opposing_orientation (box, height, minimum_width, natural_width); + else + gtk_box_compute_size_for_orientation (box, height, minimum_width, natural_width); +} + +static void +gtk_box_get_height_for_width (GtkExtendedLayout *layout, + gint width, + gint *minimum_height, + gint *natural_height) +{ + GtkBox *box = GTK_BOX (layout); + GtkBoxPrivate *private = GTK_BOX_GET_PRIVATE (layout); + + if (private->orientation == GTK_ORIENTATION_HORIZONTAL) + gtk_box_compute_size_for_opposing_orientation (box, width, minimum_height, natural_height); + else + gtk_box_compute_size_for_orientation (box, width, minimum_height, natural_height); +} + /** * gtk_box_new: * @orientation: the box' orientation. * @homogeneous: %TRUE if all children are to be given equal space allocations. * @spacing: the number of pixels to place by default between children. * - * Creates a new #GtkHBox. + * Creates a new #GtkBox. * - * Return value: a new #GtkHBox. + * Return value: a new #GtkBox. * - * Since: 2.16 + * Since: 3.0 **/ GtkWidget* -_gtk_box_new (GtkOrientation orientation, - gboolean homogeneous, - gint spacing) +gtk_box_new (GtkOrientation orientation, + gboolean homogeneous, + gint spacing) { return g_object_new (GTK_TYPE_BOX, "orientation", orientation, @@ -850,50 +1330,6 @@ gtk_box_pack_end (GtkBox *box, gtk_box_pack (box, child, expand, fill, padding, GTK_PACK_END); } -/** - * gtk_box_pack_start_defaults: - * @box: a #GtkBox - * @widget: the #GtkWidget to be added to @box - * - * Adds @widget to @box, packed with reference to the start of @box. - * The child is packed after any other child packed with reference - * to the start of @box. - * - * Parameters for how to pack the child @widget, #GtkBox:expand, - * #GtkBox:fill and #GtkBox:padding, are given their default - * values, %TRUE, %TRUE, and 0, respectively. - * - * Deprecated: 2.14: Use gtk_box_pack_start() - */ -void -gtk_box_pack_start_defaults (GtkBox *box, - GtkWidget *child) -{ - gtk_box_pack_start (box, child, TRUE, TRUE, 0); -} - -/** - * gtk_box_pack_end_defaults: - * @box: a #GtkBox - * @widget: the #GtkWidget to be added to @box - * - * Adds @widget to @box, packed with reference to the end of @box. - * The child is packed after any other child packed with reference - * to the start of @box. - * - * Parameters for how to pack the child @widget, #GtkBox:expand, - * #GtkBox:fill and #GtkBox:padding, are given their default - * values, %TRUE, %TRUE, and 0, respectively. - * - * Deprecated: 2.14: Use gtk_box_pack_end() - */ -void -gtk_box_pack_end_defaults (GtkBox *box, - GtkWidget *child) -{ - gtk_box_pack_end (box, child, TRUE, TRUE, 0); -} - /** * gtk_box_set_homogeneous: * @box: a #GtkBox diff --git a/gtk/gtkbox.h b/gtk/gtkbox.h index 914683b48e..0d0cfb07a8 100644 --- a/gtk/gtkbox.h +++ b/gtk/gtkbox.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -48,7 +48,6 @@ G_BEGIN_DECLS typedef struct _GtkBox GtkBox; typedef struct _GtkBoxClass GtkBoxClass; -typedef struct _GtkBoxChild GtkBoxChild; struct _GtkBox { @@ -65,6 +64,32 @@ struct _GtkBoxClass GtkContainerClass parent_class; }; +/** + * GtkBoxChild: + * @widget: the child widget, packed into the GtkBox. + * @padding: the number of extra pixels to put between this child and its + * neighbors, set when packed, zero by default. + * @expand: flag indicates whether extra space should be given to this child. + * Any extra space given to the parent GtkBox is divided up among all children + * with this attribute set to %TRUE; set when packed, %TRUE by default. + * @fill: flag indicates whether any extra space given to this child due to its + * @expand attribute being set is actually allocated to the child, rather than + * being used as padding around the widget; set when packed, %TRUE by default. + * @pack: one of #GtkPackType indicating whether the child is packed with + * reference to the start (top/left) or end (bottom/right) of the GtkBox. + * @is_secondary: %TRUE if the child is secondary + * + * The #GtkBoxChild holds a child widget of #GtkBox and describes how the child + * is to be packed into the #GtkBox. All fields of this #GtkBoxChild should be + * considered read-only and they should never be set directly by an application. + * Use gtk_box_query_child_packing() and gtk_box_set_child_packing() to query + * and set the #GtkBoxChild.padding, #GtkBoxChild.expand, #GtkBoxChild.fill and + * #GtkBoxChild.pack fields. + * + * Deprecated: 2.22: Use gtk_container_get_children() instead. + */ +#if !defined (GTK_DISABLE_DEPRECATED) || defined (GTK_COMPILATION) +typedef struct _GtkBoxChild GtkBoxChild; struct _GtkBoxChild { GtkWidget *widget; @@ -74,10 +99,10 @@ struct _GtkBoxChild guint pack : 1; guint is_secondary : 1; }; - +#endif GType gtk_box_get_type (void) G_GNUC_CONST; -GtkWidget* _gtk_box_new (GtkOrientation orientation, +GtkWidget* gtk_box_new (GtkOrientation orientation, gboolean homogeneous, gint spacing); @@ -92,13 +117,6 @@ void gtk_box_pack_end (GtkBox *box, gboolean fill, guint padding); -#ifndef GTK_DISABLE_DEPRECATED -void gtk_box_pack_start_defaults (GtkBox *box, - GtkWidget *widget); -void gtk_box_pack_end_defaults (GtkBox *box, - GtkWidget *widget); -#endif - void gtk_box_set_homogeneous (GtkBox *box, gboolean homogeneous); gboolean gtk_box_get_homogeneous (GtkBox *box); diff --git a/gtk/gtkbuildable.c b/gtk/gtkbuildable.c index 299e5b47a8..12fc07791d 100644 --- a/gtk/gtkbuildable.c +++ b/gtk/gtkbuildable.c @@ -18,6 +18,25 @@ * Boston, MA 02111-1307, USA. */ +/** + * SECTION:gtkbuildable + * @Short_description: Interface for objects that can be built by GtkBuilder + * @Title: GtkBuildable + * + * GtkBuildable allows objects to extend and customize thier deserialization + * from GtkBuilder UI descriptions. + * The interface includes methods for setting names and properties of objects, + * parsing custom tags and constructing child objects. + * + * The GtkBuildable interface is implemented by all widgets and + * many of the non-widget objects that are provided by GTK+. The + * main user of this interface is #GtkBuilder, there should be + * very little need for applications to call any + * gtk_buildable_... functions. + * + * An object only needs to implement this interface if it needs + * to extend the #GtkBuilder format or run any extra routines at deserialization time + */ #include "config.h" #include "gtkbuildable.h" diff --git a/gtk/gtkbuildable.h b/gtk/gtkbuildable.h index bff876d0cb..50ed14cd1d 100644 --- a/gtk/gtkbuildable.h +++ b/gtk/gtkbuildable.h @@ -18,7 +18,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -40,6 +40,55 @@ G_BEGIN_DECLS typedef struct _GtkBuildable GtkBuildable; /* Dummy typedef */ typedef struct _GtkBuildableIface GtkBuildableIface; +/** + * GtkBuildableIface: + * @g_iface: the parent class + * @set_name: Stores the name attribute given in the GtkBuilder UI definition. + * #GtkWidget stores the name as object data. Implement this method if your + * object has some notion of "name" and it makes sense to map the XML name + * attribute to it. + * @get_name: The getter corresponding to @set_name. Implement this + * if you implement @set_name. + * @add_child: Adds a child. The @type parameter can be used to + * differentiate the kind of child. #GtkContainer implements this + * to add add a child widget to the container, #GtkNotebook uses + * the @type to distinguish between page labels (of type "page-label") + * and normal children. + * @set_buildable_property: Sets a property of a buildable object. + * It is normally not necessary to implement this, g_object_set_property() + * is used by default. #GtkWindow implements this to delay showing itself + * (i.e. setting the #GtkWidget:visible property) until the whole interface + * is created. + * @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. 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. + * #GtkWidget implements this to parse keyboard accelerators specified + * in <accelerator> elements. #GtkContainer implements it to map + * properties defined via <packing> elements to child properties. + * Note that @user_data must be freed in @custom_tag_end or @custom_finished. + * @custom_tag_end: Called for the end tag of each custom element that is + * handled by the buildable (see @custom_tag_start). + * @custom_finished: Called for each custom tag handled by the buildable + * when the builder finishes parsing (see @custom_tag_start) + * @parser_finished: Called when a builder finishes the parsing + * of a UI definition. It is normally not necessary to implement this, + * unless you need to perform special cleanup actions. #GtkWindow sets + * the #GtkWidget:visible property here. + * @get_internal_child: Returns an internal child of a buildable. + * #GtkDialog implements this to give access to its @vbox, making + * it possible to add children to the vbox in a UI definition. + * Implement this if the buildable has internal children that may + * need to be accessed from a UI definition. + * + * The GtkBuildableIface interface contains method that are + * necessary to allow #GtkBuilder to construct an object from + * a GtkBuilder UI definition. + */ struct _GtkBuildableIface { GTypeInterface g_iface; diff --git a/gtk/gtkbuilder.c b/gtk/gtkbuilder.c index 35f0271ccd..c6d3b0814f 100644 --- a/gtk/gtkbuilder.c +++ b/gtk/gtkbuilder.c @@ -20,6 +20,224 @@ * Boston, MA 02111-1307, USA. */ +/** + * SECTION:gtkbuilder + * @Short_description: Build an interface from an XML UI definition + * @Title: GtkBuilder + * + * A GtkBuilder is an auxiliary object that reads textual descriptions + * of a user interface and instantiates the described objects. To pass a + * description to a GtkBuilder, call gtk_builder_add_from_file() or + * gtk_builder_add_from_string(). These functions can be called multiple + * times; the builder merges the content of all descriptions. + * + * A GtkBuilder holds a reference to all objects that it has constructed + * and drops these references when it is finalized. This finalization can + * cause the destruction of non-widget objects or widgets which are not + * contained in a toplevel window. For toplevel windows constructed by a + * builder, it is the responsibility of the user to call gtk_widget_destroy() + * to get rid of them and all the widgets they contain. + * + * The functions gtk_builder_get_object() and gtk_builder_get_objects() + * can be used to access the widgets in the interface by the names assigned + * to them inside the UI description. Toplevel windows returned by these + * functions will stay around until the user explicitly destroys them + * with gtk_widget_destroy(). Other widgets will either be part of a + * larger hierarchy constructed by the builder (in which case you should + * not have to worry about their lifecycle), or without a parent, in which + * case they have to be added to some container to make use of them. + * Non-widget objects need to be reffed with g_object_ref() to keep them + * beyond the lifespan of the builder. + * + * The function gtk_builder_connect_signals() and variants thereof can be + * used to connect handlers to the named signals in the description. + * + * + * GtkBuilder UI Definitions + * + * GtkBuilder parses textual descriptions of user interfaces which are specified + * in an XML format which can be roughly described by the DTD below. We refer to + * these descriptions as GtkBuilder UI definitions or + * just UI definitions if the context is clear. Do not + * confuse GtkBuilder UI Definitions with + * GtkUIManager UI Definitions, which are more + * limited in scope. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * ]]> + * + * The toplevel element is <interface>. It optionally takes a "domain" + * attribute, which will make the builder look for translated strings using + * dgettext() in the domain specified. This can also be done by calling + * gtk_builder_set_translation_domain() on the builder. Objects are described by + * <object> elements, which can contain <property> elements to set + * properties, <signal> elements which connect signals to handlers, and + * <child> elements, which describe child objects (most often widgets + * inside a container, but also e.g. actions in an action group, or columns in a + * tree model). A <child> element contains an <object> element which + * describes the child object. The target toolkit version(s) are described by + * <requires> elements, the "lib" attribute specifies the widget library + * in question (currently the only supported value is "gtk+") and the "version" + * attribute specifies the target version in the form + * "<major>.<minor>". The builder will error out if the version + * requirements are not met. + * + * Typically, the specific kind of object represented by an <object> + * element is specified by the "class" attribute. If the type has not been + * loaded yet, GTK+ tries to find the _get_type() from the + * class name by applying heuristics. This works in most cases, but if + * necessary, it is possible to specify the name of the + * _get_type() explictly with the "type-func" attribute. + * As a special case, GtkBuilder allows to use an object that has been + * constructed by a #GtkUIManager in another part of the UI definition by + * specifying the id of the #GtkUIManager in the "constructor" attribute and the + * name of the object in the "id" attribute. + * + * Objects must be given a name with the "id" attribute, which allows the + * application to retrieve them from the builder with gtk_builder_get_object(). + * An id is also necessary to use the object as property value in other parts of + * the UI definition. + * + * + * Prior to 2.20, GtkBuilder was setting the "name" property of constructed widgets to the + * "id" attribute. In GTK+ 2.20 or newer, you have to use gtk_buildable_get_name() instead + * of gtk_widget_get_name() to obtain the "id", or set the "name" property in your UI + * definition. + * + * + * Setting properties of objects is pretty straightforward with the + * <property> element: the "name" attribute specifies the name of the + * property, and the content of the element specifies the value. If the + * "translatable" attribute is set to a true value, GTK+ uses gettext() (or + * dgettext() if the builder has a translation domain set) to find a translation + * for the value. This happens before the value is parsed, so it can be used for + * properties of any type, but it is probably most useful for string properties. + * It is also possible to specify a context to disambiguate short strings, and + * comments which may help the translators. + * + * GtkBuilder can parse textual representations for the most common property + * types: characters, strings, integers, floating-point numbers, booleans + * (strings like "TRUE", "t", "yes", "y", "1" are interpreted as %TRUE, strings + * like "FALSE, "f", "no", "n", "0" are interpreted as %FALSE), enumerations + * (can be specified by their name, nick or integer value), flags (can be + * specified by their name, nick, integer value, optionally combined with "|", + * e.g. "GTK_VISIBLE|GTK_REALIZED") and colors (in a format understood by + * gdk_color_parse()). Objects can be referred to by their name. Pixbufs can be + * specified as a filename of an image file to load. In general, GtkBuilder + * allows forward references to objects — an object doesn't have to be + * constructed before it can be referred to. The exception to this rule is that + * an object has to be constructed before it can be used as the value of a + * construct-only property. + * + * Signal handlers are set up with the <signal> element. The "name" + * attribute specifies the name of the signal, and the "handler" attribute + * specifies the function to connect to the signal. By default, GTK+ tries to + * find the handler using g_module_symbol(), but this can be changed by passing + * a custom #GtkBuilderConnectFunc to gtk_builder_connect_signals_full(). The + * remaining attributes, "after", "swapped" and "object", have the same meaning + * as the corresponding parameters of the g_signal_connect_object() or + * g_signal_connect_data() functions. A "last_modification_time" attribute + * is also allowed, but it does not have a meaning to the builder. + * + * Sometimes it is necessary to refer to widgets which have implicitly been + * constructed by GTK+ as part of a composite widget, to set properties on them + * or to add further children (e.g. the @vbox of a #GtkDialog). This can be + * achieved by setting the "internal-child" propery of the <child> element + * to a true value. Note that GtkBuilder still requires an <object> + * element for the internal child, even if it has already been constructed. + * + * A number of widgets have different places where a child can be added (e.g. + * tabs vs. page content in notebooks). This can be reflected in a UI definition + * by specifying the "type" attribute on a <child>. The possible values + * for the "type" attribute are described in the sections describing the + * widget-specific portions of UI definitions. + * + * + * A GtkBuilder UI Definition + * + * + * + * + * 10 + * + * + * 20 + * + * + * gtk-ok + * TRUE + * + * + * + * + * + * + * + * + * + * ]]> + * + * + * Beyond this general structure, several object classes define their own XML + * DTD fragments for filling in the ANY placeholders in the DTD above. Note that + * a custom element in a <child> element gets parsed by the custom tag + * handler of the parent object, while a custom element in an <object> + * element gets parsed by the custom tag handler of the object. + * + * These XML fragments are explained in the documentation of the respective + * objects, see + * GtkWidget, + * GtkLabel, + * GtkWindow, + * GtkContainer, + * GtkDialog, + * GtkCellLayout, + * GtkColorSelectionDialog, + * GtkFontSelectionDialog, + * GtkComboBoxEntry, + * GtkExpander, + * GtkFrame, + * GtkListStore, + * GtkTreeStore, + * GtkNotebook, + * GtkSizeGroup, + * GtkTreeView, + * GtkUIManager, + * GtkActionGroup. + * GtkMenuItem, + * GtkAssistant, + * GtkScale. + * + * + */ + #include "config.h" #include /* errno */ #include /* strtol, strtoul */ diff --git a/gtk/gtkbuilder.h b/gtk/gtkbuilder.h index 0f9224e0e7..bb711e27ab 100644 --- a/gtk/gtkbuilder.h +++ b/gtk/gtkbuilder.h @@ -18,7 +18,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -43,6 +43,29 @@ typedef struct _GtkBuilder GtkBuilder; typedef struct _GtkBuilderClass GtkBuilderClass; typedef struct _GtkBuilderPrivate GtkBuilderPrivate; +/** + * GtkBuilderError: + * @GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION: A type-func attribute didn't name + * a function that returns a #GType. + * @GTK_BUILDER_ERROR_UNHANDLED_TAG: The input contained a tag that #GtkBuilder + * can't handle. + * @GTK_BUILDER_ERROR_MISSING_ATTRIBUTE: An attribute that is required by + * #GtkBuilder was missing. + * @GTK_BUILDER_ERROR_INVALID_ATTRIBUTE: #GtkBuilder found an attribute that + * it doesn't understand. + * @GTK_BUILDER_ERROR_INVALID_TAG: #GtkBuilder found a tag that + * it doesn't understand. + * @GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE: A required property value was + * missing. + * @GTK_BUILDER_ERROR_INVALID_VALUE: #GtkBuilder couldn't parse + * some attribute value. + * @GTK_BUILDER_ERROR_VERSION_MISMATCH: The input file requires a newer version + * of GTK+. + * @GTK_BUILDER_ERROR_DUPLICATE_ID: An object id occurred twice. + * + * Error codes that identify various errors that can occur while using + * #GtkBuilder. + */ typedef enum { GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION, @@ -135,6 +158,14 @@ gboolean gtk_builder_value_from_string_type (GtkBuilder *builder, GValue *value, GError **error); +/** + * GTK_BUILDER_WARN_INVALID_CHILD_TYPE: + * @object: the #GtkBuildable on which the warning ocurred + * @type: the unexpected type value + * + * This macro should be used to emit a warning about and unexpected @type value + * in a #GtkBuildable add_child implementation. + */ #define GTK_BUILDER_WARN_INVALID_CHILD_TYPE(object, type) \ g_warning ("'%s' is not a valid child type of '%s'", type, g_type_name (G_OBJECT_TYPE (object))) diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c index 805c165631..29a3e28280 100644 --- a/gtk/gtkbutton.c +++ b/gtk/gtkbutton.c @@ -37,6 +37,7 @@ #include "gtkstock.h" #include "gtkiconfactory.h" #include "gtkactivatable.h" +#include "gtkextendedlayout.h" #include "gtkprivate.h" #include "gtkintl.h" #include "gtkalias.h" @@ -87,9 +88,9 @@ struct _GtkButtonPrivate GtkWidget *image; guint align_set : 1; guint image_is_stock : 1; - guint has_grab : 1; guint use_action_appearance : 1; guint32 grab_time; + GdkDevice *grab_keyboard; GtkPositionType image_position; GtkAction *action; }; @@ -111,8 +112,6 @@ static void gtk_button_unrealize (GtkWidget * widget); static void gtk_button_map (GtkWidget * widget); static void gtk_button_unmap (GtkWidget * widget); static void gtk_button_style_set (GtkWidget * widget, GtkStyle * prev_style); -static void gtk_button_size_request (GtkWidget * widget, - GtkRequisition * requisition); static void gtk_button_size_allocate (GtkWidget * widget, GtkAllocation * allocation); static gint gtk_button_expose (GtkWidget * widget, GdkEventExpose * event); @@ -148,7 +147,7 @@ static void gtk_button_grab_notify (GtkWidget *widget, gboolean was_grabbed); -static void gtk_button_activatable_interface_init (GtkActivatableIface *iface); +static void gtk_button_activatable_interface_init(GtkActivatableIface *iface); static void gtk_button_update (GtkActivatable *activatable, GtkAction *action, const gchar *property_name); @@ -159,11 +158,21 @@ static void gtk_button_set_related_action (GtkButton *button, static void gtk_button_set_use_action_appearance (GtkButton *button, gboolean use_appearance); +static void gtk_button_extended_layout_init (GtkExtendedLayoutIface *iface); +static void gtk_button_get_desired_width (GtkExtendedLayout *layout, + gint *minimum_size, + gint *natural_size); +static void gtk_button_get_desired_height (GtkExtendedLayout *layout, + gint *minimum_size, + gint *natural_size); + static guint button_signals[LAST_SIGNAL] = { 0 }; G_DEFINE_TYPE_WITH_CODE (GtkButton, gtk_button, GTK_TYPE_BIN, G_IMPLEMENT_INTERFACE (GTK_TYPE_ACTIVATABLE, - gtk_button_activatable_interface_init)) + gtk_button_activatable_interface_init) + G_IMPLEMENT_INTERFACE (GTK_TYPE_EXTENDED_LAYOUT, + gtk_button_extended_layout_init)) static void gtk_button_class_init (GtkButtonClass *klass) @@ -191,7 +200,6 @@ gtk_button_class_init (GtkButtonClass *klass) widget_class->map = gtk_button_map; widget_class->unmap = gtk_button_unmap; widget_class->style_set = gtk_button_style_set; - widget_class->size_request = gtk_button_size_request; widget_class->size_allocate = gtk_button_size_allocate; widget_class->expose_event = gtk_button_expose; widget_class->button_press_event = gtk_button_button_press; @@ -1331,49 +1339,6 @@ gtk_button_get_props (GtkButton *button, if (interior_focus) gtk_widget_style_get (widget, "interior-focus", interior_focus, NULL); } - -static void -gtk_button_size_request (GtkWidget *widget, - GtkRequisition *requisition) -{ - GtkButton *button = GTK_BUTTON (widget); - GtkBorder default_border; - GtkBorder inner_border; - gint focus_width; - gint focus_pad; - - gtk_button_get_props (button, &default_border, NULL, &inner_border, NULL); - gtk_widget_style_get (GTK_WIDGET (widget), - "focus-line-width", &focus_width, - "focus-padding", &focus_pad, - NULL); - - requisition->width = ((GTK_CONTAINER (widget)->border_width + - GTK_WIDGET (widget)->style->xthickness) * 2 + - inner_border.left + inner_border.right); - requisition->height = ((GTK_CONTAINER (widget)->border_width + - GTK_WIDGET (widget)->style->ythickness) * 2 + - inner_border.top + inner_border.bottom); - - if (gtk_widget_get_can_default (widget)) - { - requisition->width += default_border.left + default_border.right; - requisition->height += default_border.top + default_border.bottom; - } - - if (GTK_BIN (button)->child && gtk_widget_get_visible (GTK_BIN (button)->child)) - { - GtkRequisition child_requisition; - - gtk_widget_size_request (GTK_BIN (button)->child, &child_requisition); - - requisition->width += child_requisition.width; - requisition->height += child_requisition.height; - } - - requisition->width += 2 * (focus_width + focus_pad); - requisition->height += 2 * (focus_width + focus_pad); -} static void gtk_button_size_allocate (GtkWidget *widget, @@ -1752,22 +1717,28 @@ gtk_real_button_activate (GtkButton *button) { GtkWidget *widget = GTK_WIDGET (button); GtkButtonPrivate *priv; + GdkDevice *device; guint32 time; priv = GTK_BUTTON_GET_PRIVATE (button); + device = gtk_get_current_event_device (); + + g_return_if_fail (device && device->source == GDK_SOURCE_KEYBOARD); if (gtk_widget_get_realized (widget) && !button->activate_timeout) { time = gtk_get_current_event_time (); - if (gdk_keyboard_grab (button->event_window, TRUE, time) == - GDK_GRAB_SUCCESS) - { - priv->has_grab = TRUE; + + if (gdk_device_grab (device, button->event_window, + GDK_OWNERSHIP_WINDOW, TRUE, + GDK_KEY_PRESS | GDK_KEY_RELEASE, + NULL, time) == GDK_GRAB_SUCCESS) + { + gtk_device_grab_add (widget, device, TRUE); + priv->grab_keyboard = device; priv->grab_time = time; } - gtk_grab_add (widget); - button->activate_timeout = gdk_threads_add_timeout (ACTIVATE_TIMEOUT, button_activate_timeout, button); @@ -1789,12 +1760,12 @@ gtk_button_finish_activate (GtkButton *button, g_source_remove (button->activate_timeout); button->activate_timeout = 0; - if (priv->has_grab) + if (priv->grab_keyboard) { - gdk_display_keyboard_ungrab (gtk_widget_get_display (widget), - priv->grab_time); + gdk_device_ungrab (priv->grab_keyboard, priv->grab_time); + gtk_device_grab_remove (widget, priv->grab_keyboard); + priv->grab_keyboard = NULL; } - gtk_grab_remove (widget); button->button_down = FALSE; @@ -1805,6 +1776,95 @@ gtk_button_finish_activate (GtkButton *button, gtk_button_clicked (button); } + +static void +gtk_button_extended_layout_init (GtkExtendedLayoutIface *iface) +{ + iface->get_desired_width = gtk_button_get_desired_width; + iface->get_desired_height = gtk_button_get_desired_height; +} + +static void +gtk_button_get_desired_size (GtkExtendedLayout *layout, + GtkOrientation orientation, + gint *minimum_size, + gint *natural_size) +{ + GtkButton *button = GTK_BUTTON (layout); + GtkWidget *child; + GtkBorder default_border; + GtkBorder inner_border; + gint focus_width; + gint focus_pad; + gint minimum, natural; + + gtk_button_get_props (button, &default_border, NULL, &inner_border, NULL); + gtk_widget_style_get (GTK_WIDGET (layout), + "focus-line-width", &focus_width, + "focus-padding", &focus_pad, + NULL); + + if (orientation == GTK_ORIENTATION_HORIZONTAL) + { + minimum = ((GTK_CONTAINER (layout)->border_width + + GTK_WIDGET (layout)->style->xthickness) * 2 + + inner_border.left + inner_border.right); + + if (gtk_widget_get_can_default (GTK_WIDGET (layout))) + minimum += default_border.left + default_border.right; + } + else + { + minimum = ((GTK_CONTAINER (layout)->border_width + + GTK_WIDGET (layout)->style->ythickness) * 2 + + inner_border.top + inner_border.bottom); + + if (gtk_widget_get_can_default (GTK_WIDGET (layout))) + minimum += default_border.top + default_border.bottom; + } + + minimum += 2 * (focus_width + focus_pad); + natural = minimum; + + if ((child = gtk_bin_get_child (GTK_BIN (button))) && + gtk_widget_get_visible (child)) + { + gint child_min, child_nat; + + if (orientation == GTK_ORIENTATION_HORIZONTAL) + gtk_extended_layout_get_desired_width (GTK_EXTENDED_LAYOUT (child), + &child_min, &child_nat); + else + gtk_extended_layout_get_desired_height (GTK_EXTENDED_LAYOUT (child), + &child_min, &child_nat); + + minimum += child_min; + natural += child_nat; + } + + if (minimum_size) + *minimum_size = minimum; + + if (natural_size) + *natural_size = natural; +} + +static void +gtk_button_get_desired_width (GtkExtendedLayout *layout, + gint *minimum_size, + gint *natural_size) +{ + gtk_button_get_desired_size (layout, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size); +} + +static void +gtk_button_get_desired_height (GtkExtendedLayout *layout, + gint *minimum_size, + gint *natural_size) +{ + gtk_button_get_desired_size (layout, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size); +} + /** * gtk_button_set_label: * @button: a #GtkButton @@ -2195,8 +2255,14 @@ gtk_button_grab_notify (GtkWidget *widget, gboolean was_grabbed) { GtkButton *button = GTK_BUTTON (widget); + GtkButtonPrivate *priv = GTK_BUTTON_GET_PRIVATE (button); gboolean save_in; + if (button->activate_timeout && + priv->grab_keyboard && + gtk_widget_device_is_shadowed (widget, priv->grab_keyboard)) + gtk_button_finish_activate (button, FALSE); + if (!was_grabbed) { save_in = button->in_button; diff --git a/gtk/gtkbutton.h b/gtk/gtkbutton.h index 7a67ddcf91..4ed4d301fc 100644 --- a/gtk/gtkbutton.h +++ b/gtk/gtkbutton.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c index 80f67d3266..355327ff17 100644 --- a/gtk/gtkcalendar.c +++ b/gtk/gtkcalendar.c @@ -3499,22 +3499,6 @@ gtk_calendar_new (void) return g_object_new (GTK_TYPE_CALENDAR, NULL); } -/** - * gtk_calendar_display_options: - * @calendar: a #GtkCalendar. - * @flags: the display options to set. - * - * Sets display options (whether to display the heading and the month headings). - * - * Deprecated: 2.4: Use gtk_calendar_set_display_options() instead - **/ -void -gtk_calendar_display_options (GtkCalendar *calendar, - GtkCalendarDisplayOptions flags) -{ - gtk_calendar_set_display_options (calendar, flags); -} - /** * gtk_calendar_get_display_options: * @calendar: a #GtkCalendar @@ -3983,35 +3967,5 @@ gtk_calendar_get_detail_height_rows (GtkCalendar *calendar) return GTK_CALENDAR_GET_PRIVATE (calendar)->detail_height_rows; } -/** - * gtk_calendar_freeze: - * @calendar: a #GtkCalendar - * - * Does nothing. Previously locked the display of the calendar until - * it was thawed with gtk_calendar_thaw(). - * - * Deprecated: 2.8: - **/ -void -gtk_calendar_freeze (GtkCalendar *calendar) -{ - g_return_if_fail (GTK_IS_CALENDAR (calendar)); -} - -/** - * gtk_calendar_thaw: - * @calendar: a #GtkCalendar - * - * Does nothing. Previously defrosted a calendar; all the changes made - * since the last gtk_calendar_freeze() were displayed. - * - * Deprecated: 2.8: - **/ -void -gtk_calendar_thaw (GtkCalendar *calendar) -{ - g_return_if_fail (GTK_IS_CALENDAR (calendar)); -} - #define __GTK_CALENDAR_C__ #include "gtkaliasdef.c" diff --git a/gtk/gtkcalendar.h b/gtk/gtkcalendar.h index 9648d25be1..a18745bd0d 100644 --- a/gtk/gtkcalendar.h +++ b/gtk/gtkcalendar.h @@ -26,7 +26,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -36,9 +36,6 @@ #include -/* Not needed, retained for compatibility -Yosh */ -#include - G_BEGIN_DECLS @@ -176,11 +173,6 @@ void gtk_calendar_set_display_options (GtkCalendar *calendar, GtkCalendarDisplayOptions flags); GtkCalendarDisplayOptions gtk_calendar_get_display_options (GtkCalendar *calendar); -#ifndef GTK_DISABLE_DEPRECATED -void gtk_calendar_display_options (GtkCalendar *calendar, - GtkCalendarDisplayOptions flags); -#endif - void gtk_calendar_get_date (GtkCalendar *calendar, guint *year, guint *month, @@ -199,11 +191,6 @@ void gtk_calendar_set_detail_height_rows (GtkCalendar *calendar, gint gtk_calendar_get_detail_width_chars (GtkCalendar *calendar); gint gtk_calendar_get_detail_height_rows (GtkCalendar *calendar); -#ifndef GTK_DISABLE_DEPRECATED -void gtk_calendar_freeze (GtkCalendar *calendar); -void gtk_calendar_thaw (GtkCalendar *calendar); -#endif - G_END_DECLS #endif /* __GTK_CALENDAR_H__ */ diff --git a/gtk/gtkcelleditable.h b/gtk/gtkcelleditable.h index 74d6949ae0..603e120ada 100644 --- a/gtk/gtkcelleditable.h +++ b/gtk/gtkcelleditable.h @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkcelllayout.h b/gtk/gtkcelllayout.h index b3d8d06090..04e4745ee9 100644 --- a/gtk/gtkcelllayout.h +++ b/gtk/gtkcelllayout.h @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkcellrenderer.c b/gtk/gtkcellrenderer.c index b55b0985ae..6093719044 100644 --- a/gtk/gtkcellrenderer.c +++ b/gtk/gtkcellrenderer.c @@ -939,28 +939,6 @@ gtk_cell_renderer_get_sensitive (GtkCellRenderer *cell) return cell->sensitive; } -/** - * gtk_cell_renderer_editing_canceled: - * @cell: A #GtkCellRenderer - * - * Causes the cell renderer to emit the #GtkCellRenderer::editing-canceled - * signal. - * - * This function is for use only by implementations of cell renderers that - * need to notify the client program that an editing process was canceled - * and the changes were not committed. - * - * Since: 2.4 - * Deprecated: 2.6: Use gtk_cell_renderer_stop_editing() instead - **/ -void -gtk_cell_renderer_editing_canceled (GtkCellRenderer *cell) -{ - g_return_if_fail (GTK_IS_CELL_RENDERER (cell)); - - gtk_cell_renderer_stop_editing (cell, TRUE); -} - /** * gtk_cell_renderer_stop_editing: * @cell: A #GtkCellRenderer diff --git a/gtk/gtkcellrenderer.h b/gtk/gtkcellrenderer.h index aece202ae9..d16f3d4160 100644 --- a/gtk/gtkcellrenderer.h +++ b/gtk/gtkcellrenderer.h @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -183,11 +183,8 @@ void gtk_cell_renderer_set_sensitive (GtkCellRenderer *cell, gboolean gtk_cell_renderer_get_sensitive (GtkCellRenderer *cell); /* For use by cell renderer implementations only */ -#ifndef GTK_DISABLE_DEPRECATED -void gtk_cell_renderer_editing_canceled (GtkCellRenderer *cell); -#endif -void gtk_cell_renderer_stop_editing (GtkCellRenderer *cell, - gboolean canceled); +void gtk_cell_renderer_stop_editing (GtkCellRenderer *cell, + gboolean canceled); G_END_DECLS diff --git a/gtk/gtkcellrendereraccel.c b/gtk/gtkcellrendereraccel.c index dedbfdae64..9dfd2c2a8a 100644 --- a/gtk/gtkcellrendereraccel.c +++ b/gtk/gtkcellrendereraccel.c @@ -30,6 +30,8 @@ #include "gtkalias.h" +#define GTK_CELL_RENDERER_ACCEL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GTK_TYPE_CELL_RENDERER_ACCEL, GtkCellRendererAccelPrivate)) + static void gtk_cell_renderer_accel_get_property (GObject *object, guint param_id, GValue *value, @@ -72,6 +74,14 @@ enum { PROP_ACCEL_MODE }; +typedef struct GtkCellRendererAccelPrivate GtkCellRendererAccelPrivate; + +struct GtkCellRendererAccelPrivate +{ + GdkDevice *grab_keyboard; + GdkDevice *grab_pointer; +}; + static guint signals[LAST_SIGNAL] = { 0 }; G_DEFINE_TYPE (GtkCellRendererAccel, gtk_cell_renderer_accel, GTK_TYPE_CELL_RENDERER_TEXT) @@ -213,6 +223,8 @@ gtk_cell_renderer_accel_class_init (GtkCellRendererAccelClass *cell_accel_class) g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); + + g_type_class_add_private (object_class, sizeof (GtkCellRendererAccelPrivate)); } @@ -405,6 +417,7 @@ grab_key_callback (GtkWidget *widget, GdkEventKey *event, GtkCellRendererAccel *accel) { + GtkCellRendererAccelPrivate *priv; GdkModifierType accel_mods = 0; guint accel_key; gchar *path; @@ -413,6 +426,7 @@ grab_key_callback (GtkWidget *widget, GdkModifierType consumed_modifiers; GdkDisplay *display; + priv = GTK_CELL_RENDERER_ACCEL_GET_PRIVATE (accel); display = gtk_widget_get_display (widget); if (event->is_modifier) @@ -471,9 +485,9 @@ grab_key_callback (GtkWidget *widget, edited = TRUE; out: - gtk_grab_remove (accel->grab_widget); - gdk_display_keyboard_ungrab (display, event->time); - gdk_display_pointer_ungrab (display, event->time); + gtk_device_grab_remove (accel->grab_widget, priv->grab_pointer); + gdk_device_ungrab (priv->grab_keyboard, event->time); + gdk_device_ungrab (priv->grab_pointer, event->time); path = g_strdup (g_object_get_data (G_OBJECT (accel->edit_widget), "gtk-cell-renderer-text")); @@ -481,7 +495,9 @@ grab_key_callback (GtkWidget *widget, gtk_cell_editable_remove_widget (GTK_CELL_EDITABLE (accel->edit_widget)); accel->edit_widget = NULL; accel->grab_widget = NULL; - + priv->grab_keyboard = NULL; + priv->grab_pointer = NULL; + if (edited) g_signal_emit (accel, signals[ACCEL_EDITED], 0, path, accel_key, accel_mods, event->hardware_keycode); @@ -497,11 +513,16 @@ static void ungrab_stuff (GtkWidget *widget, GtkCellRendererAccel *accel) { - GdkDisplay *display = gtk_widget_get_display (widget); + GtkCellRendererAccelPrivate *priv; - gtk_grab_remove (accel->grab_widget); - gdk_display_keyboard_ungrab (display, GDK_CURRENT_TIME); - gdk_display_pointer_ungrab (display, GDK_CURRENT_TIME); + priv = GTK_CELL_RENDERER_ACCEL_GET_PRIVATE (accel); + + gtk_device_grab_remove (accel->grab_widget, priv->grab_pointer); + gdk_device_ungrab (priv->grab_keyboard, GDK_CURRENT_TIME); + gdk_device_ungrab (priv->grab_pointer, GDK_CURRENT_TIME); + + priv->grab_keyboard = NULL; + priv->grab_pointer = NULL; g_signal_handlers_disconnect_by_func (G_OBJECT (accel->grab_widget), G_CALLBACK (grab_key_callback), @@ -548,34 +569,62 @@ gtk_cell_renderer_accel_start_editing (GtkCellRenderer *cell, GdkRectangle *cell_area, GtkCellRendererState flags) { + GtkCellRendererAccelPrivate *priv; GtkCellRendererText *celltext; GtkCellRendererAccel *accel; GtkWidget *label; GtkWidget *eventbox; - + GdkDevice *device, *keyb, *pointer; + guint32 time; + celltext = GTK_CELL_RENDERER_TEXT (cell); accel = GTK_CELL_RENDERER_ACCEL (cell); + priv = GTK_CELL_RENDERER_ACCEL_GET_PRIVATE (cell); /* If the cell isn't editable we return NULL. */ if (celltext->editable == FALSE) return NULL; g_return_val_if_fail (widget->window != NULL, NULL); - - if (gdk_keyboard_grab (widget->window, FALSE, - gdk_event_get_time (event)) != GDK_GRAB_SUCCESS) + + if (event) + device = gdk_event_get_device (event); + else + device = gtk_get_current_event_device (); + + if (!device) return NULL; - if (gdk_pointer_grab (widget->window, FALSE, - GDK_BUTTON_PRESS_MASK, - NULL, NULL, - gdk_event_get_time (event)) != GDK_GRAB_SUCCESS) + if (device->source == GDK_SOURCE_KEYBOARD) { - gdk_display_keyboard_ungrab (gtk_widget_get_display (widget), - gdk_event_get_time (event)); + keyb = device; + pointer = gdk_device_get_associated_device (device); + } + else + { + pointer = device; + keyb = gdk_device_get_associated_device (device); + } + + time = gdk_event_get_time (event); + + if (gdk_device_grab (keyb, widget->window, + GDK_OWNERSHIP_WINDOW, FALSE, + GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK, + NULL, time) != GDK_GRAB_SUCCESS) + return NULL; + + if (gdk_device_grab (pointer, widget->window, + GDK_OWNERSHIP_WINDOW, FALSE, + GDK_BUTTON_PRESS_MASK, + NULL, time) != GDK_GRAB_SUCCESS) + { + gdk_device_ungrab (keyb, time); return NULL; } - + + priv->grab_keyboard = keyb; + priv->grab_pointer = pointer; accel->grab_widget = widget; g_signal_connect (G_OBJECT (widget), "key-press-event", @@ -609,7 +658,7 @@ gtk_cell_renderer_accel_start_editing (GtkCellRenderer *cell, gtk_widget_show_all (accel->edit_widget); - gtk_grab_add (accel->grab_widget); + gtk_device_grab_add (accel->grab_widget, pointer, TRUE); g_signal_connect (G_OBJECT (accel->edit_widget), "unrealize", G_CALLBACK (ungrab_stuff), accel); diff --git a/gtk/gtkcellrendereraccel.h b/gtk/gtkcellrendereraccel.h index 7ca2c60a7e..562f7f3634 100644 --- a/gtk/gtkcellrendereraccel.h +++ b/gtk/gtkcellrendereraccel.h @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkcellrenderercombo.h b/gtk/gtkcellrenderercombo.h index 379c6e649e..49b63206e1 100644 --- a/gtk/gtkcellrenderercombo.h +++ b/gtk/gtkcellrenderercombo.h @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkcellrendererpixbuf.c b/gtk/gtkcellrendererpixbuf.c index f689784bcc..bde1d809e3 100644 --- a/gtk/gtkcellrendererpixbuf.c +++ b/gtk/gtkcellrendererpixbuf.c @@ -497,6 +497,7 @@ gtk_cell_renderer_pixbuf_create_themed_pixbuf (GtkCellRendererPixbuf *cellpixbuf GtkIconTheme *icon_theme; GtkSettings *settings; gint width, height; + GtkIconInfo *info; priv = GTK_CELL_RENDERER_PIXBUF_GET_PRIVATE (cellpixbuf); @@ -519,29 +520,140 @@ gtk_cell_renderer_pixbuf_create_themed_pixbuf (GtkCellRendererPixbuf *cellpixbuf } if (priv->icon_name) - cellpixbuf->pixbuf = gtk_icon_theme_load_icon (icon_theme, - priv->icon_name, - MIN (width, height), - GTK_ICON_LOOKUP_USE_BUILTIN, - NULL); + info = gtk_icon_theme_lookup_icon (icon_theme, + priv->icon_name, + MIN (width, height), + GTK_ICON_LOOKUP_USE_BUILTIN); else if (priv->gicon) - { - GtkIconInfo *info; + info = gtk_icon_theme_lookup_by_gicon (icon_theme, + priv->gicon, + MIN (width, height), + GTK_ICON_LOOKUP_USE_BUILTIN); + else + info = NULL; - info = gtk_icon_theme_lookup_by_gicon (icon_theme, - priv->gicon, - MIN (width, height), - GTK_ICON_LOOKUP_USE_BUILTIN); - if (info) - { - cellpixbuf->pixbuf = gtk_icon_info_load_icon (info, NULL); - gtk_icon_info_free (info); - } + if (info) + { + GdkColor error_color, warning_color, success_color; + GdkColor *error_ptr, *warning_ptr, *success_ptr; + GtkStyle *style; + + style = gtk_widget_get_style (GTK_WIDGET (widget)); + if (!gtk_style_lookup_color (style, "error_color", &error_color)) + error_ptr = NULL; + else + error_ptr = &error_color; + if (!gtk_style_lookup_color (style, "warning_color", &warning_color)) + warning_ptr = NULL; + else + warning_ptr = &warning_color; + if (!gtk_style_lookup_color (style, "success_color", &success_color)) + success_ptr = NULL; + else + success_ptr = &success_color; + + cellpixbuf->pixbuf = gtk_icon_info_load_symbolic (info, + &style->fg[GTK_STATE_NORMAL], + success_ptr, + warning_ptr, + error_ptr, + NULL, + NULL); + gtk_icon_info_free (info); } g_object_notify (G_OBJECT (cellpixbuf), "pixbuf"); } +static GdkPixbuf * +create_symbolic_pixbuf (GtkCellRendererPixbuf *cellpixbuf, + GtkWidget *widget, + GdkColor *fg) +{ + GtkCellRendererPixbufPrivate *priv; + GdkScreen *screen; + GtkIconTheme *icon_theme; + GtkSettings *settings; + gint width, height; + GtkIconInfo *info; + GdkPixbuf *pixbuf; + + priv = GTK_CELL_RENDERER_PIXBUF_GET_PRIVATE (cellpixbuf); + + /* Not a named symbolic icon? */ + if (priv->icon_name) { + if (!g_str_has_suffix (priv->icon_name, "-symbolic")) + return NULL; + } else if (priv->gicon) { + const gchar * const *names; + if (!G_IS_THEMED_ICON (priv->gicon)) + return NULL; + names = g_themed_icon_get_names (G_THEMED_ICON (priv->gicon)); + if (names == NULL || !g_str_has_suffix (names[0], "-symbolic")) + return NULL; + } else { + return NULL; + } + + screen = gtk_widget_get_screen (GTK_WIDGET (widget)); + icon_theme = gtk_icon_theme_get_for_screen (screen); + settings = gtk_settings_get_for_screen (screen); + + if (!gtk_icon_size_lookup_for_settings (settings, + priv->stock_size, + &width, &height)) + { + g_warning ("Invalid icon size %u\n", priv->stock_size); + width = height = 24; + } + + + if (priv->icon_name) + info = gtk_icon_theme_lookup_icon (icon_theme, + priv->icon_name, + MIN (width, height), + GTK_ICON_LOOKUP_USE_BUILTIN); + else if (priv->gicon) + info = gtk_icon_theme_lookup_by_gicon (icon_theme, + priv->gicon, + MIN (width, height), + GTK_ICON_LOOKUP_USE_BUILTIN); + else + return NULL; + + if (info) + { + GdkColor error_color, warning_color, success_color; + GdkColor *error_ptr, *warning_ptr, *success_ptr; + GtkStyle *style; + + style = gtk_widget_get_style (GTK_WIDGET (widget)); + if (!gtk_style_lookup_color (style, "error_color", &error_color)) + error_ptr = NULL; + else + error_ptr = &error_color; + if (!gtk_style_lookup_color (style, "warning_color", &warning_color)) + warning_ptr = NULL; + else + warning_ptr = &warning_color; + if (!gtk_style_lookup_color (style, "success_color", &success_color)) + success_ptr = NULL; + else + success_ptr = &success_color; + + pixbuf = gtk_icon_info_load_symbolic (info, + fg, + success_ptr, + warning_ptr, + error_ptr, + NULL, + NULL); + gtk_icon_info_free (info); + return pixbuf; + } + return NULL; +} + static GdkPixbuf * create_colorized_pixbuf (GdkPixbuf *src, GdkColor *new_color) @@ -678,6 +790,7 @@ gtk_cell_renderer_pixbuf_render (GtkCellRenderer *cell, GdkPixbuf *pixbuf; GdkPixbuf *invisible = NULL; GdkPixbuf *colorized = NULL; + GdkPixbuf *symbolic = NULL; GdkRectangle pix_rect; GdkRectangle draw_rect; cairo_t *cr; @@ -755,10 +868,15 @@ gtk_cell_renderer_pixbuf_render (GtkCellRenderer *cell, else state = GTK_STATE_PRELIGHT; - colorized = create_colorized_pixbuf (pixbuf, - &widget->style->base[state]); + symbolic = create_symbolic_pixbuf (cellpixbuf, widget, &widget->style->fg[state]); + if (!symbolic) { + colorized = create_colorized_pixbuf (pixbuf, + &widget->style->base[state]); - pixbuf = colorized; + pixbuf = colorized; + } else { + pixbuf = symbolic; + } } cr = gdk_cairo_create (window); @@ -774,6 +892,9 @@ gtk_cell_renderer_pixbuf_render (GtkCellRenderer *cell, if (colorized) g_object_unref (colorized); + + if (symbolic) + g_object_unref (symbolic); } #define __GTK_CELL_RENDERER_PIXBUF_C__ diff --git a/gtk/gtkcellrendererpixbuf.h b/gtk/gtkcellrendererpixbuf.h index 33b92d03e9..8043c2d63e 100644 --- a/gtk/gtkcellrendererpixbuf.h +++ b/gtk/gtkcellrendererpixbuf.h @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkcellrendererprogress.h b/gtk/gtkcellrendererprogress.h index fa5569f95a..1a1eec6421 100644 --- a/gtk/gtkcellrendererprogress.h +++ b/gtk/gtkcellrendererprogress.h @@ -25,7 +25,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkcellrendererspin.h b/gtk/gtkcellrendererspin.h index b9f0bb1a6a..5daccdac2c 100644 --- a/gtk/gtkcellrendererspin.h +++ b/gtk/gtkcellrendererspin.h @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkcellrenderertext.h b/gtk/gtkcellrenderertext.h index fb96219e54..5397927e1a 100644 --- a/gtk/gtkcellrenderertext.h +++ b/gtk/gtkcellrenderertext.h @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkcellrenderertoggle.h b/gtk/gtkcellrenderertoggle.h index cf6a3c2f3d..59a2ec571b 100644 --- a/gtk/gtkcellrenderertoggle.h +++ b/gtk/gtkcellrenderertoggle.h @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkcellview.c b/gtk/gtkcellview.c index 0dd98b0a76..a2692114f4 100644 --- a/gtk/gtkcellview.c +++ b/gtk/gtkcellview.c @@ -1064,26 +1064,6 @@ gtk_cell_view_cell_layout_get_cells (GtkCellLayout *layout) return g_list_reverse (retval); } -/** - * gtk_cell_view_get_cell_renderers: - * @cell_view: a #GtkCellView - * - * Returns the cell renderers which have been added to @cell_view. - * - * Return value: a list of cell renderers. The list, but not the - * renderers has been newly allocated and should be freed with - * g_list_free() when no longer needed. - * - * Since: 2.6 - * - * Deprecated: 2.18: use gtk_cell_layout_get_cells() instead. - **/ -GList * -gtk_cell_view_get_cell_renderers (GtkCellView *cell_view) -{ - return gtk_cell_view_cell_layout_get_cells (GTK_CELL_LAYOUT (cell_view)); -} - static gboolean gtk_cell_view_buildable_custom_tag_start (GtkBuildable *buildable, GtkBuilder *builder, diff --git a/gtk/gtkcellview.h b/gtk/gtkcellview.h index 73de84e191..06305f9a29 100644 --- a/gtk/gtkcellview.h +++ b/gtk/gtkcellview.h @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -72,9 +72,6 @@ gboolean gtk_cell_view_get_size_of_row (GtkCellView *cell_v void gtk_cell_view_set_background_color (GtkCellView *cell_view, const GdkColor *color); -#ifndef GTK_DISABLE_DEPRECATED -GList *gtk_cell_view_get_cell_renderers (GtkCellView *cell_view); -#endif G_END_DECLS diff --git a/gtk/gtkcheckbutton.h b/gtk/gtkcheckbutton.h index 54c6dcfa39..90e65c2ec8 100644 --- a/gtk/gtkcheckbutton.h +++ b/gtk/gtkcheckbutton.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkcheckmenuitem.c b/gtk/gtkcheckmenuitem.c index 8c77d618e4..754382f00e 100644 --- a/gtk/gtkcheckmenuitem.c +++ b/gtk/gtkcheckmenuitem.c @@ -282,17 +282,6 @@ gtk_check_menu_item_toggle_size_request (GtkMenuItem *menu_item, *requisition = indicator_size + toggle_spacing; } -void -gtk_check_menu_item_set_show_toggle (GtkCheckMenuItem *menu_item, - gboolean always) -{ - g_return_if_fail (GTK_IS_CHECK_MENU_ITEM (menu_item)); - -#if 0 - menu_item->always_show_toggle = always != FALSE; -#endif -} - void gtk_check_menu_item_toggled (GtkCheckMenuItem *check_menu_item) { diff --git a/gtk/gtkcheckmenuitem.h b/gtk/gtkcheckmenuitem.h index b6f2e9adfe..bf5230cf89 100644 --- a/gtk/gtkcheckmenuitem.h +++ b/gtk/gtkcheckmenuitem.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -91,12 +91,6 @@ void gtk_check_menu_item_set_draw_as_radio (GtkCheckMenuItem *check_menu_i gboolean gtk_check_menu_item_get_draw_as_radio (GtkCheckMenuItem *check_menu_item); -#ifndef GTK_DISABLE_DEPRECATED -void gtk_check_menu_item_set_show_toggle (GtkCheckMenuItem *menu_item, - gboolean always); -#define gtk_check_menu_item_set_state gtk_check_menu_item_set_active -#endif - G_END_DECLS #endif /* __GTK_CHECK_MENU_ITEM_H__ */ diff --git a/gtk/gtkclipboard.c b/gtk/gtkclipboard.c index ddfc709d54..7e3c7ac506 100644 --- a/gtk/gtkclipboard.c +++ b/gtk/gtkclipboard.c @@ -1927,8 +1927,9 @@ gtk_clipboard_store_timeout (GtkClipboard *clipboard) /** * gtk_clipboard_set_can_store: * @clipboard: a #GtkClipboard - * @targets: array containing information about which forms should be stored - * or %NULL to indicate that all forms should be stored. + * @targets: (allow-none): array containing information about which forms + * should be stored or %NULL to indicate that all forms should + * be stored. * @n_targets: number of elements in @targets * * Hints that the clipboard data should be stored somewhere when the diff --git a/gtk/gtkclipboard.h b/gtk/gtkclipboard.h index 742c9b359b..f0e5514a09 100644 --- a/gtk/gtkclipboard.h +++ b/gtk/gtkclipboard.h @@ -19,7 +19,7 @@ * Global clipboard abstraction. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkclist.c b/gtk/gtkclist.c deleted file mode 100644 index eb37434f72..0000000000 --- a/gtk/gtkclist.c +++ /dev/null @@ -1,7806 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball, Josh MacDonald, - * Copyright (C) 1997-1998 Jay Painter - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#include "config.h" - -#include -#include - -#undef GTK_DISABLE_DEPRECATED -#define __GTK_CLIST_C__ - -#include - -#include "gtkmain.h" -#include "gtkobject.h" -#include "gtkctree.h" -#include "gtkclist.h" -#include "gtkbindings.h" -#include "gtkdnd.h" -#include "gtkmarshalers.h" -#include "gtkintl.h" - -#include "gtkalias.h" - -/* length of button_actions array */ -#define MAX_BUTTON 5 - -/* the width of the column resize windows */ -#define DRAG_WIDTH 6 - -/* minimum allowed width of a column */ -#define COLUMN_MIN_WIDTH 5 - -/* this defigns the base grid spacing */ -#define CELL_SPACING 1 - -/* added the horizontal space at the beginning and end of a row*/ -#define COLUMN_INSET 3 - -/* used for auto-scrolling */ -#define SCROLL_TIME 100 - -/* gives the top pixel of the given row in context of - * the clist's voffset */ -#define ROW_TOP_YPIXEL(clist, row) (((clist)->row_height * (row)) + \ - (((row) + 1) * CELL_SPACING) + \ - (clist)->voffset) - -/* returns the row index from a y pixel location in the - * context of the clist's voffset */ -#define ROW_FROM_YPIXEL(clist, y) (((y) - (clist)->voffset) / \ - ((clist)->row_height + CELL_SPACING)) - -/* gives the left pixel of the given column in context of - * the clist's hoffset */ -#define COLUMN_LEFT_XPIXEL(clist, colnum) ((clist)->column[(colnum)].area.x + \ - (clist)->hoffset) - -/* returns the column index from a x pixel location in the - * context of the clist's hoffset */ -static inline gint -COLUMN_FROM_XPIXEL (GtkCList * clist, - gint x) -{ - gint i, cx; - - for (i = 0; i < clist->columns; i++) - if (clist->column[i].visible) - { - cx = clist->column[i].area.x + clist->hoffset; - - if (x >= (cx - (COLUMN_INSET + CELL_SPACING)) && - x <= (cx + clist->column[i].area.width + COLUMN_INSET)) - return i; - } - - /* no match */ - return -1; -} - -/* returns the top pixel of the given row in the context of - * the list height */ -#define ROW_TOP(clist, row) (((clist)->row_height + CELL_SPACING) * (row)) - -/* returns the left pixel of the given column in the context of - * the list width */ -#define COLUMN_LEFT(clist, colnum) ((clist)->column[(colnum)].area.x) - -/* returns the total height of the list */ -#define LIST_HEIGHT(clist) (((clist)->row_height * ((clist)->rows)) + \ - (CELL_SPACING * ((clist)->rows + 1))) - - -/* returns the total width of the list */ -static inline gint -LIST_WIDTH (GtkCList * clist) -{ - gint last_column; - - for (last_column = clist->columns - 1; - last_column >= 0 && !clist->column[last_column].visible; last_column--); - - if (last_column >= 0) - return (clist->column[last_column].area.x + - clist->column[last_column].area.width + - COLUMN_INSET + CELL_SPACING); - return 0; -} - -/* returns the GList item for the nth row */ -#define ROW_ELEMENT(clist, row) (((row) == (clist)->rows - 1) ? \ - (clist)->row_list_end : \ - g_list_nth ((clist)->row_list, (row))) - - -/* redraw the list if it's not frozen */ -#define CLIST_UNFROZEN(clist) (((GtkCList*) (clist))->freeze_count == 0) -#define CLIST_REFRESH(clist) G_STMT_START { \ - if (CLIST_UNFROZEN (clist)) \ - GTK_CLIST_GET_CLASS (clist)->refresh ((GtkCList*) (clist)); \ -} G_STMT_END - - -/* Signals */ -enum { - SELECT_ROW, - UNSELECT_ROW, - ROW_MOVE, - CLICK_COLUMN, - RESIZE_COLUMN, - TOGGLE_FOCUS_ROW, - SELECT_ALL, - UNSELECT_ALL, - UNDO_SELECTION, - START_SELECTION, - END_SELECTION, - TOGGLE_ADD_MODE, - EXTEND_SELECTION, - SCROLL_VERTICAL, - SCROLL_HORIZONTAL, - ABORT_COLUMN_RESIZE, - LAST_SIGNAL -}; - -enum { - SYNC_REMOVE, - SYNC_INSERT -}; - -enum { - ARG_0, - ARG_N_COLUMNS, - ARG_SHADOW_TYPE, - ARG_SELECTION_MODE, - ARG_ROW_HEIGHT, - ARG_TITLES_ACTIVE, - ARG_REORDERABLE, - ARG_USE_DRAG_ICONS, - ARG_SORT_TYPE -}; - -/* GtkCList Methods */ -static void gtk_clist_class_init (GtkCListClass *klass); -static void gtk_clist_init (GtkCList *clist); -static GObject* gtk_clist_constructor (GType type, - guint n_construct_properties, - GObjectConstructParam *construct_params); - -/* GtkObject Methods */ -static void gtk_clist_destroy (GtkObject *object); -static void gtk_clist_finalize (GObject *object); -static void gtk_clist_set_arg (GtkObject *object, - GtkArg *arg, - guint arg_id); -static void gtk_clist_get_arg (GtkObject *object, - GtkArg *arg, - guint arg_id); - -/* GtkWidget Methods */ -static void gtk_clist_set_scroll_adjustments (GtkCList *clist, - GtkAdjustment *hadjustment, - GtkAdjustment *vadjustment); -static void gtk_clist_realize (GtkWidget *widget); -static void gtk_clist_unrealize (GtkWidget *widget); -static void gtk_clist_map (GtkWidget *widget); -static void gtk_clist_unmap (GtkWidget *widget); -static gint gtk_clist_expose (GtkWidget *widget, - GdkEventExpose *event); -static gint gtk_clist_button_press (GtkWidget *widget, - GdkEventButton *event); -static gint gtk_clist_button_release (GtkWidget *widget, - GdkEventButton *event); -static gint gtk_clist_motion (GtkWidget *widget, - GdkEventMotion *event); -static void gtk_clist_size_request (GtkWidget *widget, - GtkRequisition *requisition); -static void gtk_clist_size_allocate (GtkWidget *widget, - GtkAllocation *allocation); -static void gtk_clist_draw_focus (GtkWidget *widget); -static gint gtk_clist_focus_in (GtkWidget *widget, - GdkEventFocus *event); -static gint gtk_clist_focus_out (GtkWidget *widget, - GdkEventFocus *event); -static gint gtk_clist_focus (GtkWidget *widget, - GtkDirectionType direction); -static void gtk_clist_set_focus_child (GtkContainer *container, - GtkWidget *child); -static void gtk_clist_style_set (GtkWidget *widget, - GtkStyle *previous_style); -static void gtk_clist_drag_begin (GtkWidget *widget, - GdkDragContext *context); -static gint gtk_clist_drag_motion (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - guint time); -static void gtk_clist_drag_leave (GtkWidget *widget, - GdkDragContext *context, - guint time); -static void gtk_clist_drag_end (GtkWidget *widget, - GdkDragContext *context); -static gboolean gtk_clist_drag_drop (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - guint time); -static void gtk_clist_drag_data_get (GtkWidget *widget, - GdkDragContext *context, - GtkSelectionData *selection_data, - guint info, - guint time); -static void gtk_clist_drag_data_received (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - GtkSelectionData *selection_data, - guint info, - guint time); - -/* GtkContainer Methods */ -static void gtk_clist_forall (GtkContainer *container, - gboolean include_internals, - GtkCallback callback, - gpointer callback_data); - -/* Selection */ -static void toggle_row (GtkCList *clist, - gint row, - gint column, - GdkEvent *event); -static void real_select_row (GtkCList *clist, - gint row, - gint column, - GdkEvent *event); -static void real_unselect_row (GtkCList *clist, - gint row, - gint column, - GdkEvent *event); -static void update_extended_selection (GtkCList *clist, - gint row); -static GList *selection_find (GtkCList *clist, - gint row_number, - GList *row_list_element); -static void real_select_all (GtkCList *clist); -static void real_unselect_all (GtkCList *clist); -static void move_vertical (GtkCList *clist, - gint row, - gfloat align); -static void move_horizontal (GtkCList *clist, - gint diff); -static void real_undo_selection (GtkCList *clist); -static void fake_unselect_all (GtkCList *clist, - gint row); -static void fake_toggle_row (GtkCList *clist, - gint row); -static void resync_selection (GtkCList *clist, - GdkEvent *event); -static void sync_selection (GtkCList *clist, - gint row, - gint mode); -static void set_anchor (GtkCList *clist, - gboolean add_mode, - gint anchor, - gint undo_anchor); -static void start_selection (GtkCList *clist); -static void end_selection (GtkCList *clist); -static void toggle_add_mode (GtkCList *clist); -static void toggle_focus_row (GtkCList *clist); -static void extend_selection (GtkCList *clist, - GtkScrollType scroll_type, - gfloat position, - gboolean auto_start_selection); -static gint get_selection_info (GtkCList *clist, - gint x, - gint y, - gint *row, - gint *column); - -/* Scrolling */ -static void move_focus_row (GtkCList *clist, - GtkScrollType scroll_type, - gfloat position); -static void scroll_horizontal (GtkCList *clist, - GtkScrollType scroll_type, - gfloat position); -static void scroll_vertical (GtkCList *clist, - GtkScrollType scroll_type, - gfloat position); -static void move_horizontal (GtkCList *clist, - gint diff); -static void move_vertical (GtkCList *clist, - gint row, - gfloat align); -static gint horizontal_timeout (GtkCList *clist); -static gint vertical_timeout (GtkCList *clist); -static void remove_grab (GtkCList *clist); - - -/* Resize Columns */ -static void draw_xor_line (GtkCList *clist); -static gint new_column_width (GtkCList *clist, - gint column, - gint *x); -static void column_auto_resize (GtkCList *clist, - GtkCListRow *clist_row, - gint column, - gint old_width); -static void real_resize_column (GtkCList *clist, - gint column, - gint width); -static void abort_column_resize (GtkCList *clist); -static void cell_size_request (GtkCList *clist, - GtkCListRow *clist_row, - gint column, - GtkRequisition *requisition); - -/* Buttons */ -static void column_button_create (GtkCList *clist, - gint column); -static void column_button_clicked (GtkWidget *widget, - gpointer data); - -/* Adjustments */ -static void adjust_adjustments (GtkCList *clist, - gboolean block_resize); -static void vadjustment_changed (GtkAdjustment *adjustment, - gpointer data); -static void vadjustment_value_changed (GtkAdjustment *adjustment, - gpointer data); -static void hadjustment_changed (GtkAdjustment *adjustment, - gpointer data); -static void hadjustment_value_changed (GtkAdjustment *adjustment, - gpointer data); - -/* Drawing */ -static void get_cell_style (GtkCList *clist, - GtkCListRow *clist_row, - gint state, - gint column, - GtkStyle **style, - GdkGC **fg_gc, - GdkGC **bg_gc); -static gint draw_cell_pixmap (GdkWindow *window, - GdkRectangle *clip_rectangle, - GdkGC *fg_gc, - GdkPixmap *pixmap, - GdkBitmap *mask, - gint x, - gint y, - gint width, - gint height); -static void draw_row (GtkCList *clist, - GdkRectangle *area, - gint row, - GtkCListRow *clist_row); -static void draw_rows (GtkCList *clist, - GdkRectangle *area); -static void clist_refresh (GtkCList *clist); -static void draw_drag_highlight (GtkCList *clist, - GtkCListRow *dest_row, - gint dest_row_number, - GtkCListDragPos drag_pos); - -/* Size Allocation / Requisition */ -static void size_allocate_title_buttons (GtkCList *clist); -static void size_allocate_columns (GtkCList *clist, - gboolean block_resize); -static gint list_requisition_width (GtkCList *clist); - -/* Memory Allocation/Distruction Routines */ -static GtkCListColumn *columns_new (GtkCList *clist); -static void column_title_new (GtkCList *clist, - gint column, - const gchar *title); -static void columns_delete (GtkCList *clist); -static GtkCListRow *row_new (GtkCList *clist); -static void row_delete (GtkCList *clist, - GtkCListRow *clist_row); -static void set_cell_contents (GtkCList *clist, - GtkCListRow *clist_row, - gint column, - GtkCellType type, - const gchar *text, - guint8 spacing, - GdkPixmap *pixmap, - GdkBitmap *mask); -static gint real_insert_row (GtkCList *clist, - gint row, - gchar *text[]); -static void real_remove_row (GtkCList *clist, - gint row); -static void real_clear (GtkCList *clist); - -/* Sorting */ -static gint default_compare (GtkCList *clist, - gconstpointer row1, - gconstpointer row2); -static void real_sort_list (GtkCList *clist); -static GList *gtk_clist_merge (GtkCList *clist, - GList *a, - GList *b); -static GList *gtk_clist_mergesort (GtkCList *clist, - GList *list, - gint num); -/* Misc */ -static gboolean title_focus_in (GtkCList *clist, - gint dir); -static gboolean title_focus_move (GtkCList *clist, - gint dir); - -static void real_row_move (GtkCList *clist, - gint source_row, - gint dest_row); -static gint column_title_passive_func (GtkWidget *widget, - GdkEvent *event, - gpointer data); -static void drag_dest_cell (GtkCList *clist, - gint x, - gint y, - GtkCListDestInfo *dest_info); - - - -static GtkContainerClass *parent_class = NULL; -static guint clist_signals[LAST_SIGNAL] = {0}; - -static const GtkTargetEntry clist_target_table = { "gtk-clist-drag-reorder", 0, 0}; - -GtkType -gtk_clist_get_type (void) -{ - static GtkType clist_type = 0; - - if (!clist_type) - { - static const GtkTypeInfo clist_info = - { - "GtkCList", - sizeof (GtkCList), - sizeof (GtkCListClass), - (GtkClassInitFunc) gtk_clist_class_init, - (GtkObjectInitFunc) gtk_clist_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, - }; - - I_("GtkCList"); - clist_type = gtk_type_unique (GTK_TYPE_CONTAINER, &clist_info); - } - - return clist_type; -} - -static void -gtk_clist_class_init (GtkCListClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - GtkObjectClass *object_class; - GtkWidgetClass *widget_class; - GtkContainerClass *container_class; - GtkBindingSet *binding_set; - - gobject_class->constructor = gtk_clist_constructor; - - object_class = (GtkObjectClass *) klass; - widget_class = (GtkWidgetClass *) klass; - container_class = (GtkContainerClass *) klass; - - parent_class = gtk_type_class (GTK_TYPE_CONTAINER); - - gobject_class->finalize = gtk_clist_finalize; - - object_class->set_arg = gtk_clist_set_arg; - object_class->get_arg = gtk_clist_get_arg; - object_class->destroy = gtk_clist_destroy; - - - widget_class->realize = gtk_clist_realize; - widget_class->unrealize = gtk_clist_unrealize; - widget_class->map = gtk_clist_map; - widget_class->unmap = gtk_clist_unmap; - widget_class->button_press_event = gtk_clist_button_press; - widget_class->button_release_event = gtk_clist_button_release; - widget_class->motion_notify_event = gtk_clist_motion; - widget_class->expose_event = gtk_clist_expose; - widget_class->size_request = gtk_clist_size_request; - widget_class->size_allocate = gtk_clist_size_allocate; - widget_class->focus_in_event = gtk_clist_focus_in; - widget_class->focus_out_event = gtk_clist_focus_out; - widget_class->style_set = gtk_clist_style_set; - widget_class->drag_begin = gtk_clist_drag_begin; - widget_class->drag_end = gtk_clist_drag_end; - widget_class->drag_motion = gtk_clist_drag_motion; - widget_class->drag_leave = gtk_clist_drag_leave; - widget_class->drag_drop = gtk_clist_drag_drop; - widget_class->drag_data_get = gtk_clist_drag_data_get; - widget_class->drag_data_received = gtk_clist_drag_data_received; - widget_class->focus = gtk_clist_focus; - - /* container_class->add = NULL; use the default GtkContainerClass warning */ - /* container_class->remove=NULL; use the default GtkContainerClass warning */ - - container_class->forall = gtk_clist_forall; - container_class->set_focus_child = gtk_clist_set_focus_child; - - klass->set_scroll_adjustments = gtk_clist_set_scroll_adjustments; - klass->refresh = clist_refresh; - klass->select_row = real_select_row; - klass->unselect_row = real_unselect_row; - klass->row_move = real_row_move; - klass->undo_selection = real_undo_selection; - klass->resync_selection = resync_selection; - klass->selection_find = selection_find; - klass->click_column = NULL; - klass->resize_column = real_resize_column; - klass->draw_row = draw_row; - klass->draw_drag_highlight = draw_drag_highlight; - klass->insert_row = real_insert_row; - klass->remove_row = real_remove_row; - klass->clear = real_clear; - klass->sort_list = real_sort_list; - klass->select_all = real_select_all; - klass->unselect_all = real_unselect_all; - klass->fake_unselect_all = fake_unselect_all; - klass->scroll_horizontal = scroll_horizontal; - klass->scroll_vertical = scroll_vertical; - klass->extend_selection = extend_selection; - klass->toggle_focus_row = toggle_focus_row; - klass->toggle_add_mode = toggle_add_mode; - klass->start_selection = start_selection; - klass->end_selection = end_selection; - klass->abort_column_resize = abort_column_resize; - klass->set_cell_contents = set_cell_contents; - klass->cell_size_request = cell_size_request; - - gtk_object_add_arg_type ("GtkCList::n-columns", - GTK_TYPE_UINT, - GTK_ARG_READWRITE | GTK_ARG_CONSTRUCT_ONLY | G_PARAM_STATIC_NAME, - ARG_N_COLUMNS); - gtk_object_add_arg_type ("GtkCList::shadow-type", - GTK_TYPE_SHADOW_TYPE, - GTK_ARG_READWRITE | G_PARAM_STATIC_NAME, - ARG_SHADOW_TYPE); - gtk_object_add_arg_type ("GtkCList::selection-mode", - GTK_TYPE_SELECTION_MODE, - GTK_ARG_READWRITE | G_PARAM_STATIC_NAME, - ARG_SELECTION_MODE); - gtk_object_add_arg_type ("GtkCList::row-height", - GTK_TYPE_UINT, - GTK_ARG_READWRITE | G_PARAM_STATIC_NAME, - ARG_ROW_HEIGHT); - gtk_object_add_arg_type ("GtkCList::reorderable", - GTK_TYPE_BOOL, - GTK_ARG_READWRITE | G_PARAM_STATIC_NAME, - ARG_REORDERABLE); - gtk_object_add_arg_type ("GtkCList::titles-active", - GTK_TYPE_BOOL, - GTK_ARG_READWRITE | G_PARAM_STATIC_NAME, - ARG_TITLES_ACTIVE); - gtk_object_add_arg_type ("GtkCList::use-drag-icons", - GTK_TYPE_BOOL, - GTK_ARG_READWRITE | G_PARAM_STATIC_NAME, - ARG_USE_DRAG_ICONS); - gtk_object_add_arg_type ("GtkCList::sort-type", - GTK_TYPE_SORT_TYPE, - GTK_ARG_READWRITE | G_PARAM_STATIC_NAME, - ARG_SORT_TYPE); - - widget_class->set_scroll_adjustments_signal = - gtk_signal_new (I_("set-scroll-adjustments"), - GTK_RUN_LAST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkCListClass, set_scroll_adjustments), - _gtk_marshal_VOID__OBJECT_OBJECT, - GTK_TYPE_NONE, 2, GTK_TYPE_ADJUSTMENT, GTK_TYPE_ADJUSTMENT); - - clist_signals[SELECT_ROW] = - gtk_signal_new (I_("select-row"), - GTK_RUN_FIRST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkCListClass, select_row), - _gtk_marshal_VOID__INT_INT_BOXED, - GTK_TYPE_NONE, 3, - GTK_TYPE_INT, - GTK_TYPE_INT, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); - clist_signals[UNSELECT_ROW] = - gtk_signal_new (I_("unselect-row"), - GTK_RUN_FIRST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkCListClass, unselect_row), - _gtk_marshal_VOID__INT_INT_BOXED, - GTK_TYPE_NONE, 3, GTK_TYPE_INT, - GTK_TYPE_INT, GDK_TYPE_EVENT); - clist_signals[ROW_MOVE] = - gtk_signal_new (I_("row-move"), - GTK_RUN_LAST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkCListClass, row_move), - _gtk_marshal_VOID__INT_INT, - GTK_TYPE_NONE, 2, GTK_TYPE_INT, GTK_TYPE_INT); - clist_signals[CLICK_COLUMN] = - gtk_signal_new (I_("click-column"), - GTK_RUN_FIRST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkCListClass, click_column), - _gtk_marshal_VOID__INT, - GTK_TYPE_NONE, 1, GTK_TYPE_INT); - clist_signals[RESIZE_COLUMN] = - gtk_signal_new (I_("resize-column"), - GTK_RUN_LAST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkCListClass, resize_column), - _gtk_marshal_VOID__INT_INT, - GTK_TYPE_NONE, 2, GTK_TYPE_INT, GTK_TYPE_INT); - - clist_signals[TOGGLE_FOCUS_ROW] = - gtk_signal_new (I_("toggle-focus-row"), - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkCListClass, toggle_focus_row), - _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); - clist_signals[SELECT_ALL] = - gtk_signal_new (I_("select-all"), - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkCListClass, select_all), - _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); - clist_signals[UNSELECT_ALL] = - gtk_signal_new (I_("unselect-all"), - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkCListClass, unselect_all), - _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); - clist_signals[UNDO_SELECTION] = - gtk_signal_new (I_("undo-selection"), - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkCListClass, undo_selection), - _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); - clist_signals[START_SELECTION] = - gtk_signal_new (I_("start-selection"), - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkCListClass, start_selection), - _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); - clist_signals[END_SELECTION] = - gtk_signal_new (I_("end-selection"), - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkCListClass, end_selection), - _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); - clist_signals[TOGGLE_ADD_MODE] = - gtk_signal_new (I_("toggle-add-mode"), - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkCListClass, toggle_add_mode), - _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); - clist_signals[EXTEND_SELECTION] = - gtk_signal_new (I_("extend-selection"), - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkCListClass, extend_selection), - _gtk_marshal_VOID__ENUM_FLOAT_BOOLEAN, - GTK_TYPE_NONE, 3, - GTK_TYPE_SCROLL_TYPE, GTK_TYPE_FLOAT, GTK_TYPE_BOOL); - clist_signals[SCROLL_VERTICAL] = - gtk_signal_new (I_("scroll-vertical"), - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkCListClass, scroll_vertical), - _gtk_marshal_VOID__ENUM_FLOAT, - GTK_TYPE_NONE, 2, GTK_TYPE_SCROLL_TYPE, GTK_TYPE_FLOAT); - clist_signals[SCROLL_HORIZONTAL] = - gtk_signal_new (I_("scroll-horizontal"), - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkCListClass, scroll_horizontal), - _gtk_marshal_VOID__ENUM_FLOAT, - GTK_TYPE_NONE, 2, GTK_TYPE_SCROLL_TYPE, GTK_TYPE_FLOAT); - clist_signals[ABORT_COLUMN_RESIZE] = - gtk_signal_new (I_("abort-column-resize"), - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkCListClass, abort_column_resize), - _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); - - binding_set = gtk_binding_set_by_class (klass); - gtk_binding_entry_add_signal (binding_set, GDK_Up, 0, - "scroll-vertical", 2, - GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD, - GTK_TYPE_FLOAT, 0.0); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Up, 0, - "scroll-vertical", 2, - GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD, - GTK_TYPE_FLOAT, 0.0); - gtk_binding_entry_add_signal (binding_set, GDK_Down, 0, - "scroll-vertical", 2, - GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD, - GTK_TYPE_FLOAT, 0.0); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Down, 0, - "scroll-vertical", 2, - GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD, - GTK_TYPE_FLOAT, 0.0); - gtk_binding_entry_add_signal (binding_set, GDK_Page_Up, 0, - "scroll-vertical", 2, - GTK_TYPE_ENUM, GTK_SCROLL_PAGE_BACKWARD, - GTK_TYPE_FLOAT, 0.0); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Page_Up, 0, - "scroll-vertical", 2, - GTK_TYPE_ENUM, GTK_SCROLL_PAGE_BACKWARD, - GTK_TYPE_FLOAT, 0.0); - gtk_binding_entry_add_signal (binding_set, GDK_Page_Down, 0, - "scroll-vertical", 2, - GTK_TYPE_ENUM, GTK_SCROLL_PAGE_FORWARD, - GTK_TYPE_FLOAT, 0.0); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Page_Down, 0, - "scroll-vertical", 2, - GTK_TYPE_ENUM, GTK_SCROLL_PAGE_FORWARD, - GTK_TYPE_FLOAT, 0.0); - gtk_binding_entry_add_signal (binding_set, GDK_Home, GDK_CONTROL_MASK, - "scroll-vertical", 2, - GTK_TYPE_ENUM, GTK_SCROLL_JUMP, - GTK_TYPE_FLOAT, 0.0); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Home, GDK_CONTROL_MASK, - "scroll-vertical", 2, - GTK_TYPE_ENUM, GTK_SCROLL_JUMP, - GTK_TYPE_FLOAT, 0.0); - gtk_binding_entry_add_signal (binding_set, GDK_End, GDK_CONTROL_MASK, - "scroll-vertical", 2, - GTK_TYPE_ENUM, GTK_SCROLL_JUMP, - GTK_TYPE_FLOAT, 1.0); - gtk_binding_entry_add_signal (binding_set, GDK_KP_End, GDK_CONTROL_MASK, - "scroll-vertical", 2, - GTK_TYPE_ENUM, GTK_SCROLL_JUMP, - GTK_TYPE_FLOAT, 1.0); - - gtk_binding_entry_add_signal (binding_set, GDK_Up, GDK_SHIFT_MASK, - "extend-selection", 3, - GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD, - GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Up, GDK_SHIFT_MASK, - "extend-selection", 3, - GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD, - GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_Down, GDK_SHIFT_MASK, - "extend-selection", 3, - GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD, - GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Down, GDK_SHIFT_MASK, - "extend-selection", 3, - GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD, - GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_Page_Up, GDK_SHIFT_MASK, - "extend-selection", 3, - GTK_TYPE_ENUM, GTK_SCROLL_PAGE_BACKWARD, - GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Page_Up, GDK_SHIFT_MASK, - "extend-selection", 3, - GTK_TYPE_ENUM, GTK_SCROLL_PAGE_BACKWARD, - GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_Page_Down, GDK_SHIFT_MASK, - "extend-selection", 3, - GTK_TYPE_ENUM, GTK_SCROLL_PAGE_FORWARD, - GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Page_Down, GDK_SHIFT_MASK, - "extend-selection", 3, - GTK_TYPE_ENUM, GTK_SCROLL_PAGE_FORWARD, - GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_Home, - GDK_SHIFT_MASK | GDK_CONTROL_MASK, - "extend-selection", 3, - GTK_TYPE_ENUM, GTK_SCROLL_JUMP, - GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Home, - GDK_SHIFT_MASK | GDK_CONTROL_MASK, - "extend-selection", 3, - GTK_TYPE_ENUM, GTK_SCROLL_JUMP, - GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_End, - GDK_SHIFT_MASK | GDK_CONTROL_MASK, - "extend-selection", 3, - GTK_TYPE_ENUM, GTK_SCROLL_JUMP, - GTK_TYPE_FLOAT, 1.0, GTK_TYPE_BOOL, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_KP_End, - GDK_SHIFT_MASK | GDK_CONTROL_MASK, - "extend-selection", 3, - GTK_TYPE_ENUM, GTK_SCROLL_JUMP, - GTK_TYPE_FLOAT, 1.0, GTK_TYPE_BOOL, TRUE); - - - gtk_binding_entry_add_signal (binding_set, GDK_Left, 0, - "scroll-horizontal", 2, - GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD, - GTK_TYPE_FLOAT, 0.0); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Left, 0, - "scroll-horizontal", 2, - GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD, - GTK_TYPE_FLOAT, 0.0); - - gtk_binding_entry_add_signal (binding_set, GDK_Right, 0, - "scroll-horizontal", 2, - GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD, - GTK_TYPE_FLOAT, 0.0); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Right, 0, - "scroll-horizontal", 2, - GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD, - GTK_TYPE_FLOAT, 0.0); - - gtk_binding_entry_add_signal (binding_set, GDK_Home, 0, - "scroll-horizontal", 2, - GTK_TYPE_ENUM, GTK_SCROLL_JUMP, - GTK_TYPE_FLOAT, 0.0); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Home, 0, - "scroll-horizontal", 2, - GTK_TYPE_ENUM, GTK_SCROLL_JUMP, - GTK_TYPE_FLOAT, 0.0); - - gtk_binding_entry_add_signal (binding_set, GDK_End, 0, - "scroll-horizontal", 2, - GTK_TYPE_ENUM, GTK_SCROLL_JUMP, - GTK_TYPE_FLOAT, 1.0); - - gtk_binding_entry_add_signal (binding_set, GDK_KP_End, 0, - "scroll-horizontal", 2, - GTK_TYPE_ENUM, GTK_SCROLL_JUMP, - GTK_TYPE_FLOAT, 1.0); - - gtk_binding_entry_add_signal (binding_set, GDK_Escape, 0, - "undo-selection", 0); - gtk_binding_entry_add_signal (binding_set, GDK_Escape, 0, - "abort-column-resize", 0); - gtk_binding_entry_add_signal (binding_set, GDK_space, 0, - "toggle-focus-row", 0); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Space, 0, - "toggle-focus-row", 0); - gtk_binding_entry_add_signal (binding_set, GDK_space, GDK_CONTROL_MASK, - "toggle-add-mode", 0); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Space, GDK_CONTROL_MASK, - "toggle-add-mode", 0); - gtk_binding_entry_add_signal (binding_set, GDK_slash, GDK_CONTROL_MASK, - "select-all", 0); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Divide, GDK_CONTROL_MASK, - "select-all", 0); - gtk_binding_entry_add_signal (binding_set, '\\', GDK_CONTROL_MASK, - "unselect-all", 0); - gtk_binding_entry_add_signal (binding_set, GDK_Shift_L, - GDK_RELEASE_MASK | GDK_SHIFT_MASK, - "end-selection", 0); - gtk_binding_entry_add_signal (binding_set, GDK_Shift_R, - GDK_RELEASE_MASK | GDK_SHIFT_MASK, - "end-selection", 0); - gtk_binding_entry_add_signal (binding_set, GDK_Shift_L, - GDK_RELEASE_MASK | GDK_SHIFT_MASK | - GDK_CONTROL_MASK, - "end-selection", 0); - gtk_binding_entry_add_signal (binding_set, GDK_Shift_R, - GDK_RELEASE_MASK | GDK_SHIFT_MASK | - GDK_CONTROL_MASK, - "end-selection", 0); -} - -static void -gtk_clist_set_arg (GtkObject *object, - GtkArg *arg, - guint arg_id) -{ - GtkCList *clist; - - clist = GTK_CLIST (object); - - switch (arg_id) - { - case ARG_N_COLUMNS: /* only set at construction time */ - clist->columns = MAX (1, GTK_VALUE_UINT (*arg)); - break; - case ARG_SHADOW_TYPE: - gtk_clist_set_shadow_type (clist, GTK_VALUE_ENUM (*arg)); - break; - case ARG_SELECTION_MODE: - gtk_clist_set_selection_mode (clist, GTK_VALUE_ENUM (*arg)); - break; - case ARG_ROW_HEIGHT: - gtk_clist_set_row_height (clist, GTK_VALUE_UINT (*arg)); - break; - case ARG_REORDERABLE: - gtk_clist_set_reorderable (clist, GTK_VALUE_BOOL (*arg)); - break; - case ARG_TITLES_ACTIVE: - if (GTK_VALUE_BOOL (*arg)) - gtk_clist_column_titles_active (clist); - else - gtk_clist_column_titles_passive (clist); - break; - case ARG_USE_DRAG_ICONS: - gtk_clist_set_use_drag_icons (clist, GTK_VALUE_BOOL (*arg)); - break; - case ARG_SORT_TYPE: - gtk_clist_set_sort_type (clist, GTK_VALUE_ENUM (*arg)); - break; - } -} - -static void -gtk_clist_get_arg (GtkObject *object, - GtkArg *arg, - guint arg_id) -{ - GtkCList *clist; - - clist = GTK_CLIST (object); - - switch (arg_id) - { - guint i; - - case ARG_N_COLUMNS: - GTK_VALUE_UINT (*arg) = clist->columns; - break; - case ARG_SHADOW_TYPE: - GTK_VALUE_ENUM (*arg) = clist->shadow_type; - break; - case ARG_SELECTION_MODE: - GTK_VALUE_ENUM (*arg) = clist->selection_mode; - break; - case ARG_ROW_HEIGHT: - GTK_VALUE_UINT (*arg) = GTK_CLIST_ROW_HEIGHT_SET(clist) ? clist->row_height : 0; - break; - case ARG_REORDERABLE: - GTK_VALUE_BOOL (*arg) = GTK_CLIST_REORDERABLE (clist); - break; - case ARG_TITLES_ACTIVE: - GTK_VALUE_BOOL (*arg) = TRUE; - for (i = 0; i < clist->columns; i++) - if (clist->column[i].button && - !gtk_widget_get_sensitive (clist->column[i].button)) - { - GTK_VALUE_BOOL (*arg) = FALSE; - break; - } - break; - case ARG_USE_DRAG_ICONS: - GTK_VALUE_BOOL (*arg) = GTK_CLIST_USE_DRAG_ICONS (clist); - break; - case ARG_SORT_TYPE: - GTK_VALUE_ENUM (*arg) = clist->sort_type; - break; - default: - arg->type = GTK_TYPE_INVALID; - break; - } -} - -static void -gtk_clist_init (GtkCList *clist) -{ - clist->flags = 0; - - gtk_widget_set_has_window (GTK_WIDGET (clist), TRUE); - gtk_widget_set_can_focus (GTK_WIDGET (clist), TRUE); - GTK_CLIST_SET_FLAG (clist, CLIST_DRAW_DRAG_LINE); - GTK_CLIST_SET_FLAG (clist, CLIST_USE_DRAG_ICONS); - - clist->freeze_count = 0; - - clist->rows = 0; - clist->row_height = 0; - clist->row_list = NULL; - clist->row_list_end = NULL; - - clist->columns = 0; - - clist->title_window = NULL; - clist->column_title_area.x = 0; - clist->column_title_area.y = 0; - clist->column_title_area.width = 1; - clist->column_title_area.height = 1; - - clist->clist_window = NULL; - clist->clist_window_width = 1; - clist->clist_window_height = 1; - - clist->hoffset = 0; - clist->voffset = 0; - - clist->shadow_type = GTK_SHADOW_IN; - clist->vadjustment = NULL; - clist->hadjustment = NULL; - - clist->button_actions[0] = GTK_BUTTON_SELECTS | GTK_BUTTON_DRAGS; - clist->button_actions[1] = GTK_BUTTON_IGNORED; - clist->button_actions[2] = GTK_BUTTON_IGNORED; - clist->button_actions[3] = GTK_BUTTON_IGNORED; - clist->button_actions[4] = GTK_BUTTON_IGNORED; - - clist->cursor_drag = NULL; - clist->xor_gc = NULL; - clist->fg_gc = NULL; - clist->bg_gc = NULL; - clist->x_drag = 0; - - clist->selection_mode = GTK_SELECTION_SINGLE; - clist->selection = NULL; - clist->selection_end = NULL; - clist->undo_selection = NULL; - clist->undo_unselection = NULL; - - clist->focus_row = -1; - clist->focus_header_column = -1; - clist->undo_anchor = -1; - - clist->anchor = -1; - clist->anchor_state = GTK_STATE_SELECTED; - clist->drag_pos = -1; - clist->htimer = 0; - clist->vtimer = 0; - - clist->click_cell.row = -1; - clist->click_cell.column = -1; - - clist->compare = default_compare; - clist->sort_type = GTK_SORT_ASCENDING; - clist->sort_column = 0; - - clist->drag_highlight_row = -1; -} - -/* Constructor */ -static GObject* -gtk_clist_constructor (GType type, - guint n_construct_properties, - GObjectConstructParam *construct_properties) -{ - GObject *object = G_OBJECT_CLASS (parent_class)->constructor (type, - n_construct_properties, - construct_properties); - GtkCList *clist = GTK_CLIST (object); - - /* allocate memory for columns */ - clist->column = columns_new (clist); - - /* there needs to be at least one column button - * because there is alot of code that will break if it - * isn't there - */ - column_button_create (clist, 0); - - return object; -} - -/* GTKCLIST PUBLIC INTERFACE - * gtk_clist_new - * gtk_clist_new_with_titles - * gtk_clist_set_hadjustment - * gtk_clist_set_vadjustment - * gtk_clist_get_hadjustment - * gtk_clist_get_vadjustment - * gtk_clist_set_shadow_type - * gtk_clist_set_selection_mode - * gtk_clist_freeze - * gtk_clist_thaw - */ -GtkWidget* -gtk_clist_new (gint columns) -{ - return gtk_clist_new_with_titles (columns, NULL); -} - -GtkWidget* -gtk_clist_new_with_titles (gint columns, - gchar *titles[]) -{ - GtkCList *clist; - - clist = g_object_new (GTK_TYPE_CLIST, - "n_columns", columns, - NULL); - if (titles) - { - guint i; - - for (i = 0; i < clist->columns; i++) - gtk_clist_set_column_title (clist, i, titles[i]); - gtk_clist_column_titles_show (clist); - } - else - gtk_clist_column_titles_hide (clist); - - return GTK_WIDGET (clist); -} - -void -gtk_clist_set_hadjustment (GtkCList *clist, - GtkAdjustment *adjustment) -{ - GtkAdjustment *old_adjustment; - - g_return_if_fail (GTK_IS_CLIST (clist)); - if (adjustment) - g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment)); - - if (clist->hadjustment == adjustment) - return; - - old_adjustment = clist->hadjustment; - - if (clist->hadjustment) - { - gtk_signal_disconnect_by_data (GTK_OBJECT (clist->hadjustment), clist); - g_object_unref (clist->hadjustment); - } - - clist->hadjustment = adjustment; - - if (clist->hadjustment) - { - g_object_ref_sink (clist->hadjustment); - - gtk_signal_connect (GTK_OBJECT (clist->hadjustment), "changed", - G_CALLBACK (hadjustment_changed), - (gpointer) clist); - gtk_signal_connect (GTK_OBJECT (clist->hadjustment), "value-changed", - G_CALLBACK (hadjustment_value_changed), - (gpointer) clist); - } - - if (!clist->hadjustment || !old_adjustment) - gtk_widget_queue_resize (GTK_WIDGET (clist)); -} - -GtkAdjustment * -gtk_clist_get_hadjustment (GtkCList *clist) -{ - g_return_val_if_fail (GTK_IS_CLIST (clist), NULL); - - return clist->hadjustment; -} - -void -gtk_clist_set_vadjustment (GtkCList *clist, - GtkAdjustment *adjustment) -{ - GtkAdjustment *old_adjustment; - - g_return_if_fail (GTK_IS_CLIST (clist)); - if (adjustment) - g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment)); - - if (clist->vadjustment == adjustment) - return; - - old_adjustment = clist->vadjustment; - - if (clist->vadjustment) - { - gtk_signal_disconnect_by_data (GTK_OBJECT (clist->vadjustment), clist); - g_object_unref (clist->vadjustment); - } - - clist->vadjustment = adjustment; - - if (clist->vadjustment) - { - g_object_ref_sink (clist->vadjustment); - - gtk_signal_connect (GTK_OBJECT (clist->vadjustment), "changed", - G_CALLBACK (vadjustment_changed), - (gpointer) clist); - gtk_signal_connect (GTK_OBJECT (clist->vadjustment), "value-changed", - G_CALLBACK (vadjustment_value_changed), - (gpointer) clist); - } - - if (!clist->vadjustment || !old_adjustment) - gtk_widget_queue_resize (GTK_WIDGET (clist)); -} - -GtkAdjustment * -gtk_clist_get_vadjustment (GtkCList *clist) -{ - g_return_val_if_fail (GTK_IS_CLIST (clist), NULL); - - return clist->vadjustment; -} - -static void -gtk_clist_set_scroll_adjustments (GtkCList *clist, - GtkAdjustment *hadjustment, - GtkAdjustment *vadjustment) -{ - if (clist->hadjustment != hadjustment) - gtk_clist_set_hadjustment (clist, hadjustment); - if (clist->vadjustment != vadjustment) - gtk_clist_set_vadjustment (clist, vadjustment); -} - -void -gtk_clist_set_shadow_type (GtkCList *clist, - GtkShadowType type) -{ - g_return_if_fail (GTK_IS_CLIST (clist)); - - clist->shadow_type = type; - - if (gtk_widget_get_visible (GTK_WIDGET (clist))) - gtk_widget_queue_resize (GTK_WIDGET (clist)); -} - -void -gtk_clist_set_selection_mode (GtkCList *clist, - GtkSelectionMode mode) -{ - g_return_if_fail (GTK_IS_CLIST (clist)); - g_return_if_fail (mode != GTK_SELECTION_NONE); - - if (mode == clist->selection_mode) - return; - - clist->selection_mode = mode; - clist->anchor = -1; - clist->anchor_state = GTK_STATE_SELECTED; - clist->drag_pos = -1; - clist->undo_anchor = clist->focus_row; - - g_list_free (clist->undo_selection); - g_list_free (clist->undo_unselection); - clist->undo_selection = NULL; - clist->undo_unselection = NULL; - - switch (mode) - { - case GTK_SELECTION_MULTIPLE: - return; - case GTK_SELECTION_BROWSE: - case GTK_SELECTION_SINGLE: - gtk_clist_unselect_all (clist); - break; - default: - /* Someone set it by hand */ - g_assert_not_reached (); - } -} - -void -gtk_clist_freeze (GtkCList *clist) -{ - g_return_if_fail (GTK_IS_CLIST (clist)); - - clist->freeze_count++; -} - -void -gtk_clist_thaw (GtkCList *clist) -{ - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (clist->freeze_count) - { - clist->freeze_count--; - CLIST_REFRESH (clist); - } -} - -/* PUBLIC COLUMN FUNCTIONS - * gtk_clist_column_titles_show - * gtk_clist_column_titles_hide - * gtk_clist_column_title_active - * gtk_clist_column_title_passive - * gtk_clist_column_titles_active - * gtk_clist_column_titles_passive - * gtk_clist_set_column_title - * gtk_clist_get_column_title - * gtk_clist_set_column_widget - * gtk_clist_set_column_justification - * gtk_clist_set_column_visibility - * gtk_clist_set_column_resizeable - * gtk_clist_set_column_auto_resize - * gtk_clist_optimal_column_width - * gtk_clist_set_column_width - * gtk_clist_set_column_min_width - * gtk_clist_set_column_max_width - */ -void -gtk_clist_column_titles_show (GtkCList *clist) -{ - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (!GTK_CLIST_SHOW_TITLES(clist)) - { - GTK_CLIST_SET_FLAG (clist, CLIST_SHOW_TITLES); - if (clist->title_window) - gdk_window_show (clist->title_window); - gtk_widget_queue_resize (GTK_WIDGET (clist)); - } -} - -void -gtk_clist_column_titles_hide (GtkCList *clist) -{ - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (GTK_CLIST_SHOW_TITLES(clist)) - { - GTK_CLIST_UNSET_FLAG (clist, CLIST_SHOW_TITLES); - if (clist->title_window) - gdk_window_hide (clist->title_window); - gtk_widget_queue_resize (GTK_WIDGET (clist)); - } -} - -void -gtk_clist_column_title_active (GtkCList *clist, - gint column) -{ - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (column < 0 || column >= clist->columns) - return; - if (!clist->column[column].button || !clist->column[column].button_passive) - return; - - clist->column[column].button_passive = FALSE; - - gtk_signal_disconnect_by_func (GTK_OBJECT (clist->column[column].button), - G_CALLBACK (column_title_passive_func), - NULL); - - gtk_widget_set_can_focus (clist->column[column].button, TRUE); - if (gtk_widget_get_visible (GTK_WIDGET (clist))) - gtk_widget_queue_draw (clist->column[column].button); -} - -void -gtk_clist_column_title_passive (GtkCList *clist, - gint column) -{ - GtkButton *button; - - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (column < 0 || column >= clist->columns) - return; - if (!clist->column[column].button || clist->column[column].button_passive) - return; - - button = GTK_BUTTON (clist->column[column].button); - - clist->column[column].button_passive = TRUE; - - if (button->button_down) - g_signal_emit_by_name (button, "released"); - if (button->in_button) - g_signal_emit_by_name (button, "leave"); - - gtk_signal_connect (GTK_OBJECT (clist->column[column].button), "event", - G_CALLBACK (column_title_passive_func), - NULL); - - gtk_widget_set_can_focus (clist->column[column].button, FALSE); - if (gtk_widget_get_visible (GTK_WIDGET (clist))) - gtk_widget_queue_draw (clist->column[column].button); -} - -void -gtk_clist_column_titles_active (GtkCList *clist) -{ - gint i; - - g_return_if_fail (GTK_IS_CLIST (clist)); - - for (i = 0; i < clist->columns; i++) - gtk_clist_column_title_active (clist, i); -} - -void -gtk_clist_column_titles_passive (GtkCList *clist) -{ - gint i; - - g_return_if_fail (GTK_IS_CLIST (clist)); - - for (i = 0; i < clist->columns; i++) - gtk_clist_column_title_passive (clist, i); -} - -void -gtk_clist_set_column_title (GtkCList *clist, - gint column, - const gchar *title) -{ - gint new_button = 0; - GtkWidget *old_widget; - GtkWidget *alignment = NULL; - GtkWidget *label; - - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (column < 0 || column >= clist->columns) - return; - - /* if the column button doesn't currently exist, - * it has to be created first */ - if (!clist->column[column].button) - { - column_button_create (clist, column); - new_button = 1; - } - - column_title_new (clist, column, title); - - /* remove and destroy the old widget */ - old_widget = GTK_BIN (clist->column[column].button)->child; - if (old_widget) - gtk_container_remove (GTK_CONTAINER (clist->column[column].button), old_widget); - - /* create new alignment based no column justification */ - switch (clist->column[column].justification) - { - case GTK_JUSTIFY_LEFT: - alignment = gtk_alignment_new (0.0, 0.5, 0.0, 0.0); - break; - - case GTK_JUSTIFY_RIGHT: - alignment = gtk_alignment_new (1.0, 0.5, 0.0, 0.0); - break; - - case GTK_JUSTIFY_CENTER: - alignment = gtk_alignment_new (0.5, 0.5, 0.0, 0.0); - break; - - case GTK_JUSTIFY_FILL: - alignment = gtk_alignment_new (0.5, 0.5, 0.0, 0.0); - break; - } - - gtk_widget_push_composite_child (); - label = gtk_label_new (clist->column[column].title); - gtk_widget_pop_composite_child (); - gtk_container_add (GTK_CONTAINER (alignment), label); - gtk_container_add (GTK_CONTAINER (clist->column[column].button), alignment); - gtk_widget_show (label); - gtk_widget_show (alignment); - - /* if this button didn't previously exist, then the - * column button positions have to be re-computed */ - if (gtk_widget_get_visible (GTK_WIDGET (clist)) && new_button) - size_allocate_title_buttons (clist); -} - -gchar * -gtk_clist_get_column_title (GtkCList *clist, - gint column) -{ - g_return_val_if_fail (GTK_IS_CLIST (clist), NULL); - - if (column < 0 || column >= clist->columns) - return NULL; - - return clist->column[column].title; -} - -void -gtk_clist_set_column_widget (GtkCList *clist, - gint column, - GtkWidget *widget) -{ - gint new_button = 0; - GtkWidget *old_widget; - - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (column < 0 || column >= clist->columns) - return; - - /* if the column button doesn't currently exist, - * it has to be created first */ - if (!clist->column[column].button) - { - column_button_create (clist, column); - new_button = 1; - } - - column_title_new (clist, column, NULL); - - /* remove and destroy the old widget */ - old_widget = GTK_BIN (clist->column[column].button)->child; - if (old_widget) - gtk_container_remove (GTK_CONTAINER (clist->column[column].button), - old_widget); - - /* add and show the widget */ - if (widget) - { - gtk_container_add (GTK_CONTAINER (clist->column[column].button), widget); - gtk_widget_show (widget); - } - - /* if this button didn't previously exist, then the - * column button positions have to be re-computed */ - if (gtk_widget_get_visible (GTK_WIDGET (clist)) && new_button) - size_allocate_title_buttons (clist); -} - -GtkWidget * -gtk_clist_get_column_widget (GtkCList *clist, - gint column) -{ - g_return_val_if_fail (GTK_IS_CLIST (clist), NULL); - - if (column < 0 || column >= clist->columns) - return NULL; - - if (clist->column[column].button) - return GTK_BIN (clist->column[column].button)->child; - - return NULL; -} - -void -gtk_clist_set_column_justification (GtkCList *clist, - gint column, - GtkJustification justification) -{ - GtkWidget *alignment; - - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (column < 0 || column >= clist->columns) - return; - - clist->column[column].justification = justification; - - /* change the alinment of the button title if it's not a - * custom widget */ - if (clist->column[column].title) - { - alignment = GTK_BIN (clist->column[column].button)->child; - - switch (clist->column[column].justification) - { - case GTK_JUSTIFY_LEFT: - gtk_alignment_set (GTK_ALIGNMENT (alignment), 0.0, 0.5, 0.0, 0.0); - break; - - case GTK_JUSTIFY_RIGHT: - gtk_alignment_set (GTK_ALIGNMENT (alignment), 1.0, 0.5, 0.0, 0.0); - break; - - case GTK_JUSTIFY_CENTER: - gtk_alignment_set (GTK_ALIGNMENT (alignment), 0.5, 0.5, 0.0, 0.0); - break; - - case GTK_JUSTIFY_FILL: - gtk_alignment_set (GTK_ALIGNMENT (alignment), 0.5, 0.5, 0.0, 0.0); - break; - - default: - break; - } - } - - if (CLIST_UNFROZEN (clist)) - draw_rows (clist, NULL); -} - -void -gtk_clist_set_column_visibility (GtkCList *clist, - gint column, - gboolean visible) -{ - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (column < 0 || column >= clist->columns) - return; - if (clist->column[column].visible == visible) - return; - - /* don't hide last visible column */ - if (!visible) - { - gint i; - gint vis_columns = 0; - - for (i = 0, vis_columns = 0; i < clist->columns && vis_columns < 2; i++) - if (clist->column[i].visible) - vis_columns++; - - if (vis_columns < 2) - return; - } - - clist->column[column].visible = visible; - - if (clist->column[column].button) - { - if (visible) - gtk_widget_show (clist->column[column].button); - else - gtk_widget_hide (clist->column[column].button); - } - - gtk_widget_queue_resize (GTK_WIDGET(clist)); -} - -void -gtk_clist_set_column_resizeable (GtkCList *clist, - gint column, - gboolean resizeable) -{ - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (column < 0 || column >= clist->columns) - return; - if (clist->column[column].resizeable == resizeable) - return; - - clist->column[column].resizeable = resizeable; - if (resizeable) - clist->column[column].auto_resize = FALSE; - - if (gtk_widget_get_visible (GTK_WIDGET (clist))) - size_allocate_title_buttons (clist); -} - -void -gtk_clist_set_column_auto_resize (GtkCList *clist, - gint column, - gboolean auto_resize) -{ - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (column < 0 || column >= clist->columns) - return; - if (clist->column[column].auto_resize == auto_resize) - return; - - clist->column[column].auto_resize = auto_resize; - if (auto_resize) - { - clist->column[column].resizeable = FALSE; - if (!GTK_CLIST_AUTO_RESIZE_BLOCKED (clist)) - { - gint width; - - width = gtk_clist_optimal_column_width (clist, column); - gtk_clist_set_column_width (clist, column, width); - } - } - - if (gtk_widget_get_visible (GTK_WIDGET (clist))) - size_allocate_title_buttons (clist); -} - -gint -gtk_clist_columns_autosize (GtkCList *clist) -{ - gint i; - gint width; - - g_return_val_if_fail (GTK_IS_CLIST (clist), 0); - - gtk_clist_freeze (clist); - width = 0; - for (i = 0; i < clist->columns; i++) - { - gtk_clist_set_column_width (clist, i, - gtk_clist_optimal_column_width (clist, i)); - - width += clist->column[i].width; - } - - gtk_clist_thaw (clist); - return width; -} - -gint -gtk_clist_optimal_column_width (GtkCList *clist, - gint column) -{ - GtkRequisition requisition; - GList *list; - gint width; - - g_return_val_if_fail (GTK_CLIST (clist), 0); - - if (column < 0 || column >= clist->columns) - return 0; - - if (GTK_CLIST_SHOW_TITLES(clist) && clist->column[column].button) - width = (clist->column[column].button->requisition.width) -#if 0 - (CELL_SPACING + (2 * COLUMN_INSET))) -#endif - ; - else - width = 0; - - for (list = clist->row_list; list; list = list->next) - { - GTK_CLIST_GET_CLASS (clist)->cell_size_request - (clist, GTK_CLIST_ROW (list), column, &requisition); - width = MAX (width, requisition.width); - } - - return width; -} - -void -gtk_clist_set_column_width (GtkCList *clist, - gint column, - gint width) -{ - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (column < 0 || column >= clist->columns) - return; - - gtk_signal_emit (GTK_OBJECT (clist), clist_signals[RESIZE_COLUMN], - column, width); -} - -void -gtk_clist_set_column_min_width (GtkCList *clist, - gint column, - gint min_width) -{ - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (column < 0 || column >= clist->columns) - return; - if (clist->column[column].min_width == min_width) - return; - - if (clist->column[column].max_width >= 0 && - clist->column[column].max_width < min_width) - clist->column[column].min_width = clist->column[column].max_width; - else - clist->column[column].min_width = min_width; - - if (clist->column[column].area.width < clist->column[column].min_width) - gtk_clist_set_column_width (clist, column,clist->column[column].min_width); -} - -void -gtk_clist_set_column_max_width (GtkCList *clist, - gint column, - gint max_width) -{ - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (column < 0 || column >= clist->columns) - return; - if (clist->column[column].max_width == max_width) - return; - - if (clist->column[column].min_width >= 0 && max_width >= 0 && - clist->column[column].min_width > max_width) - clist->column[column].max_width = clist->column[column].min_width; - else - clist->column[column].max_width = max_width; - - if (clist->column[column].area.width > clist->column[column].max_width) - gtk_clist_set_column_width (clist, column,clist->column[column].max_width); -} - -/* PRIVATE COLUMN FUNCTIONS - * column_auto_resize - * real_resize_column - * abort_column_resize - * size_allocate_title_buttons - * size_allocate_columns - * list_requisition_width - * new_column_width - * column_button_create - * column_button_clicked - * column_title_passive_func - */ -static void -column_auto_resize (GtkCList *clist, - GtkCListRow *clist_row, - gint column, - gint old_width) -{ - /* resize column if needed for auto_resize */ - GtkRequisition requisition; - - if (!clist->column[column].auto_resize || - GTK_CLIST_AUTO_RESIZE_BLOCKED (clist)) - return; - - if (clist_row) - GTK_CLIST_GET_CLASS (clist)->cell_size_request (clist, clist_row, - column, &requisition); - else - requisition.width = 0; - - if (requisition.width > clist->column[column].width) - gtk_clist_set_column_width (clist, column, requisition.width); - else if (requisition.width < old_width && - old_width == clist->column[column].width) - { - GList *list; - gint new_width = 0; - - /* run a "gtk_clist_optimal_column_width" but break, if - * the column doesn't shrink */ - if (GTK_CLIST_SHOW_TITLES(clist) && clist->column[column].button) - new_width = (clist->column[column].button->requisition.width - - (CELL_SPACING + (2 * COLUMN_INSET))); - else - new_width = 0; - - for (list = clist->row_list; list; list = list->next) - { - GTK_CLIST_GET_CLASS (clist)->cell_size_request - (clist, GTK_CLIST_ROW (list), column, &requisition); - new_width = MAX (new_width, requisition.width); - if (new_width == clist->column[column].width) - break; - } - if (new_width < clist->column[column].width) - gtk_clist_set_column_width - (clist, column, MAX (new_width, clist->column[column].min_width)); - } -} - -static void -real_resize_column (GtkCList *clist, - gint column, - gint width) -{ - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (column < 0 || column >= clist->columns) - return; - - if (width < MAX (COLUMN_MIN_WIDTH, clist->column[column].min_width)) - width = MAX (COLUMN_MIN_WIDTH, clist->column[column].min_width); - if (clist->column[column].max_width >= 0 && - width > clist->column[column].max_width) - width = clist->column[column].max_width; - - clist->column[column].width = width; - clist->column[column].width_set = TRUE; - - /* FIXME: this is quite expensive to do if the widget hasn't - * been size_allocated yet, and pointless. Should - * a flag be kept - */ - size_allocate_columns (clist, TRUE); - size_allocate_title_buttons (clist); - - CLIST_REFRESH (clist); -} - -static void -abort_column_resize (GtkCList *clist) -{ - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (!GTK_CLIST_IN_DRAG(clist)) - return; - - GTK_CLIST_UNSET_FLAG (clist, CLIST_IN_DRAG); - gtk_grab_remove (GTK_WIDGET (clist)); - gdk_display_pointer_ungrab (gtk_widget_get_display (GTK_WIDGET (clist)), - GDK_CURRENT_TIME); - clist->drag_pos = -1; - - if (clist->x_drag >= 0 && clist->x_drag <= clist->clist_window_width - 1) - draw_xor_line (clist); - - if (GTK_CLIST_ADD_MODE(clist)) - { - gint8 dashes[] = { 4, 4 }; - - gdk_gc_set_line_attributes (clist->xor_gc, 1, GDK_LINE_ON_OFF_DASH, 0,0); - gdk_gc_set_dashes (clist->xor_gc, 0, dashes, G_N_ELEMENTS (dashes)); - } -} - -static void -size_allocate_title_buttons (GtkCList *clist) -{ - GtkAllocation button_allocation; - gint last_column; - gint last_button = 0; - gint i; - - if (!gtk_widget_get_realized (GTK_WIDGET (clist))) - return; - - button_allocation.x = clist->hoffset; - button_allocation.y = 0; - button_allocation.width = 0; - button_allocation.height = clist->column_title_area.height; - - /* find last visible column */ - for (last_column = clist->columns - 1; last_column >= 0; last_column--) - if (clist->column[last_column].visible) - break; - - for (i = 0; i < last_column; i++) - { - if (!clist->column[i].visible) - { - last_button = i + 1; - gdk_window_hide (clist->column[i].window); - continue; - } - - button_allocation.width += (clist->column[i].area.width + - CELL_SPACING + 2 * COLUMN_INSET); - - if (!clist->column[i + 1].button) - { - gdk_window_hide (clist->column[i].window); - continue; - } - - gtk_widget_size_allocate (clist->column[last_button].button, - &button_allocation); - button_allocation.x += button_allocation.width; - button_allocation.width = 0; - - if (clist->column[last_button].resizeable) - { - gdk_window_show (clist->column[last_button].window); - gdk_window_move_resize (clist->column[last_button].window, - button_allocation.x - (DRAG_WIDTH / 2), - 0, DRAG_WIDTH, - clist->column_title_area.height); - } - else - gdk_window_hide (clist->column[last_button].window); - - last_button = i + 1; - } - - button_allocation.width += (clist->column[last_column].area.width + - 2 * (CELL_SPACING + COLUMN_INSET)); - gtk_widget_size_allocate (clist->column[last_button].button, - &button_allocation); - - if (clist->column[last_button].resizeable) - { - button_allocation.x += button_allocation.width; - - gdk_window_show (clist->column[last_button].window); - gdk_window_move_resize (clist->column[last_button].window, - button_allocation.x - (DRAG_WIDTH / 2), - 0, DRAG_WIDTH, clist->column_title_area.height); - } - else - gdk_window_hide (clist->column[last_button].window); -} - -static void -size_allocate_columns (GtkCList *clist, - gboolean block_resize) -{ - gint xoffset = CELL_SPACING + COLUMN_INSET; - gint last_column; - gint i; - - /* find last visible column and calculate correct column width */ - for (last_column = clist->columns - 1; - last_column >= 0 && !clist->column[last_column].visible; last_column--); - - if (last_column < 0) - return; - - for (i = 0; i <= last_column; i++) - { - if (!clist->column[i].visible) - continue; - clist->column[i].area.x = xoffset; - if (clist->column[i].width_set) - { - if (!block_resize && GTK_CLIST_SHOW_TITLES(clist) && - clist->column[i].auto_resize && clist->column[i].button) - { - gint width; - - width = (clist->column[i].button->requisition.width - - (CELL_SPACING + (2 * COLUMN_INSET))); - - if (width > clist->column[i].width) - gtk_clist_set_column_width (clist, i, width); - } - - clist->column[i].area.width = clist->column[i].width; - xoffset += clist->column[i].width + CELL_SPACING + (2* COLUMN_INSET); - } - else if (GTK_CLIST_SHOW_TITLES(clist) && clist->column[i].button) - { - clist->column[i].area.width = - clist->column[i].button->requisition.width - - (CELL_SPACING + (2 * COLUMN_INSET)); - xoffset += clist->column[i].button->requisition.width; - } - } - - clist->column[last_column].area.width = clist->column[last_column].area.width - + MAX (0, clist->clist_window_width + COLUMN_INSET - xoffset); -} - -static gint -list_requisition_width (GtkCList *clist) -{ - gint width = CELL_SPACING; - gint i; - - for (i = clist->columns - 1; i >= 0; i--) - { - if (!clist->column[i].visible) - continue; - - if (clist->column[i].width_set) - width += clist->column[i].width + CELL_SPACING + (2 * COLUMN_INSET); - else if (GTK_CLIST_SHOW_TITLES(clist) && clist->column[i].button) - width += clist->column[i].button->requisition.width; - } - - return width; -} - -/* this function returns the new width of the column being resized given - * the column and x position of the cursor; the x cursor position is passed - * in as a pointer and automagicly corrected if it's beyond min/max limits */ -static gint -new_column_width (GtkCList *clist, - gint column, - gint *x) -{ - gint xthickness = GTK_WIDGET (clist)->style->xthickness; - gint width; - gint cx; - gint dx; - gint last_column; - - /* first translate the x position from widget->window - * to clist->clist_window */ - cx = *x - xthickness; - - for (last_column = clist->columns - 1; - last_column >= 0 && !clist->column[last_column].visible; last_column--); - - /* calculate new column width making sure it doesn't end up - * less than the minimum width */ - dx = (COLUMN_LEFT_XPIXEL (clist, column) + COLUMN_INSET + - (column < last_column) * CELL_SPACING); - width = cx - dx; - - if (width < MAX (COLUMN_MIN_WIDTH, clist->column[column].min_width)) - { - width = MAX (COLUMN_MIN_WIDTH, clist->column[column].min_width); - cx = dx + width; - *x = cx + xthickness; - } - else if (clist->column[column].max_width >= COLUMN_MIN_WIDTH && - width > clist->column[column].max_width) - { - width = clist->column[column].max_width; - cx = dx + clist->column[column].max_width; - *x = cx + xthickness; - } - - if (cx < 0 || cx > clist->clist_window_width) - *x = -1; - - return width; -} - -static void -column_button_create (GtkCList *clist, - gint column) -{ - GtkWidget *button; - - gtk_widget_push_composite_child (); - button = clist->column[column].button = gtk_button_new (); - gtk_widget_pop_composite_child (); - - if (gtk_widget_get_realized (GTK_WIDGET (clist)) && clist->title_window) - gtk_widget_set_parent_window (clist->column[column].button, - clist->title_window); - gtk_widget_set_parent (button, GTK_WIDGET (clist)); - - gtk_signal_connect (GTK_OBJECT (button), "clicked", - G_CALLBACK (column_button_clicked), - (gpointer) clist); - gtk_widget_show (button); -} - -static void -column_button_clicked (GtkWidget *widget, - gpointer data) -{ - gint i; - GtkCList *clist; - - g_return_if_fail (widget != NULL); - g_return_if_fail (GTK_IS_CLIST (data)); - - clist = GTK_CLIST (data); - - /* find the column who's button was pressed */ - for (i = 0; i < clist->columns; i++) - if (clist->column[i].button == widget) - break; - - gtk_signal_emit (GTK_OBJECT (clist), clist_signals[CLICK_COLUMN], i); -} - -static gint -column_title_passive_func (GtkWidget *widget, - GdkEvent *event, - gpointer data) -{ - g_return_val_if_fail (event != NULL, FALSE); - - switch (event->type) - { - case GDK_MOTION_NOTIFY: - case GDK_BUTTON_PRESS: - case GDK_2BUTTON_PRESS: - case GDK_3BUTTON_PRESS: - case GDK_BUTTON_RELEASE: - case GDK_ENTER_NOTIFY: - case GDK_LEAVE_NOTIFY: - return TRUE; - default: - break; - } - return FALSE; -} - - -/* PUBLIC CELL FUNCTIONS - * gtk_clist_get_cell_type - * gtk_clist_set_text - * gtk_clist_get_text - * gtk_clist_set_pixmap - * gtk_clist_get_pixmap - * gtk_clist_set_pixtext - * gtk_clist_get_pixtext - * gtk_clist_set_shift - */ -GtkCellType -gtk_clist_get_cell_type (GtkCList *clist, - gint row, - gint column) -{ - GtkCListRow *clist_row; - - g_return_val_if_fail (GTK_IS_CLIST (clist), -1); - - if (row < 0 || row >= clist->rows) - return -1; - if (column < 0 || column >= clist->columns) - return -1; - - clist_row = ROW_ELEMENT (clist, row)->data; - - return clist_row->cell[column].type; -} - -void -gtk_clist_set_text (GtkCList *clist, - gint row, - gint column, - const gchar *text) -{ - GtkCListRow *clist_row; - - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (row < 0 || row >= clist->rows) - return; - if (column < 0 || column >= clist->columns) - return; - - clist_row = ROW_ELEMENT (clist, row)->data; - - /* if text is null, then the cell is empty */ - GTK_CLIST_GET_CLASS (clist)->set_cell_contents - (clist, clist_row, column, GTK_CELL_TEXT, text, 0, NULL, NULL); - - /* redraw the list if it's not frozen */ - if (CLIST_UNFROZEN (clist)) - { - if (gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE) - GTK_CLIST_GET_CLASS (clist)->draw_row (clist, NULL, row, clist_row); - } -} - -gint -gtk_clist_get_text (GtkCList *clist, - gint row, - gint column, - gchar **text) -{ - GtkCListRow *clist_row; - - g_return_val_if_fail (GTK_IS_CLIST (clist), 0); - - if (row < 0 || row >= clist->rows) - return 0; - if (column < 0 || column >= clist->columns) - return 0; - - clist_row = ROW_ELEMENT (clist, row)->data; - - if (clist_row->cell[column].type != GTK_CELL_TEXT) - return 0; - - if (text) - *text = GTK_CELL_TEXT (clist_row->cell[column])->text; - - return 1; -} - -/** - * gtk_clist_set_pixmap: - * @mask: (allow-none): - */ -void -gtk_clist_set_pixmap (GtkCList *clist, - gint row, - gint column, - GdkPixmap *pixmap, - GdkBitmap *mask) -{ - GtkCListRow *clist_row; - - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (row < 0 || row >= clist->rows) - return; - if (column < 0 || column >= clist->columns) - return; - - clist_row = ROW_ELEMENT (clist, row)->data; - - g_object_ref (pixmap); - - if (mask) g_object_ref (mask); - - GTK_CLIST_GET_CLASS (clist)->set_cell_contents - (clist, clist_row, column, GTK_CELL_PIXMAP, NULL, 0, pixmap, mask); - - /* redraw the list if it's not frozen */ - if (CLIST_UNFROZEN (clist)) - { - if (gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE) - GTK_CLIST_GET_CLASS (clist)->draw_row (clist, NULL, row, clist_row); - } -} - -gint -gtk_clist_get_pixmap (GtkCList *clist, - gint row, - gint column, - GdkPixmap **pixmap, - GdkBitmap **mask) -{ - GtkCListRow *clist_row; - - g_return_val_if_fail (GTK_IS_CLIST (clist), 0); - - if (row < 0 || row >= clist->rows) - return 0; - if (column < 0 || column >= clist->columns) - return 0; - - clist_row = ROW_ELEMENT (clist, row)->data; - - if (clist_row->cell[column].type != GTK_CELL_PIXMAP) - return 0; - - if (pixmap) - { - *pixmap = GTK_CELL_PIXMAP (clist_row->cell[column])->pixmap; - /* mask can be NULL */ - *mask = GTK_CELL_PIXMAP (clist_row->cell[column])->mask; - } - - return 1; -} - -void -gtk_clist_set_pixtext (GtkCList *clist, - gint row, - gint column, - const gchar *text, - guint8 spacing, - GdkPixmap *pixmap, - GdkBitmap *mask) -{ - GtkCListRow *clist_row; - - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (row < 0 || row >= clist->rows) - return; - if (column < 0 || column >= clist->columns) - return; - - clist_row = ROW_ELEMENT (clist, row)->data; - - g_object_ref (pixmap); - if (mask) g_object_ref (mask); - GTK_CLIST_GET_CLASS (clist)->set_cell_contents - (clist, clist_row, column, GTK_CELL_PIXTEXT, text, spacing, pixmap, mask); - - /* redraw the list if it's not frozen */ - if (CLIST_UNFROZEN (clist)) - { - if (gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE) - GTK_CLIST_GET_CLASS (clist)->draw_row (clist, NULL, row, clist_row); - } -} - -gint -gtk_clist_get_pixtext (GtkCList *clist, - gint row, - gint column, - gchar **text, - guint8 *spacing, - GdkPixmap **pixmap, - GdkBitmap **mask) -{ - GtkCListRow *clist_row; - - g_return_val_if_fail (GTK_IS_CLIST (clist), 0); - - if (row < 0 || row >= clist->rows) - return 0; - if (column < 0 || column >= clist->columns) - return 0; - - clist_row = ROW_ELEMENT (clist, row)->data; - - if (clist_row->cell[column].type != GTK_CELL_PIXTEXT) - return 0; - - if (text) - *text = GTK_CELL_PIXTEXT (clist_row->cell[column])->text; - if (spacing) - *spacing = GTK_CELL_PIXTEXT (clist_row->cell[column])->spacing; - if (pixmap) - *pixmap = GTK_CELL_PIXTEXT (clist_row->cell[column])->pixmap; - - /* mask can be NULL */ - if (mask) - *mask = GTK_CELL_PIXTEXT (clist_row->cell[column])->mask; - - return 1; -} - -void -gtk_clist_set_shift (GtkCList *clist, - gint row, - gint column, - gint vertical, - gint horizontal) -{ - GtkRequisition requisition = { 0 }; - GtkCListRow *clist_row; - - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (row < 0 || row >= clist->rows) - return; - if (column < 0 || column >= clist->columns) - return; - - clist_row = ROW_ELEMENT (clist, row)->data; - - if (clist->column[column].auto_resize && - !GTK_CLIST_AUTO_RESIZE_BLOCKED (clist)) - GTK_CLIST_GET_CLASS (clist)->cell_size_request (clist, clist_row, - column, &requisition); - - clist_row->cell[column].vertical = vertical; - clist_row->cell[column].horizontal = horizontal; - - column_auto_resize (clist, clist_row, column, requisition.width); - - if (CLIST_UNFROZEN (clist) && gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE) - GTK_CLIST_GET_CLASS (clist)->draw_row (clist, NULL, row, clist_row); -} - -/* PRIVATE CELL FUNCTIONS - * set_cell_contents - * cell_size_request - */ -static void -set_cell_contents (GtkCList *clist, - GtkCListRow *clist_row, - gint column, - GtkCellType type, - const gchar *text, - guint8 spacing, - GdkPixmap *pixmap, - GdkBitmap *mask) -{ - GtkRequisition requisition; - gchar *old_text = NULL; - GdkPixmap *old_pixmap = NULL; - GdkBitmap *old_mask = NULL; - - g_return_if_fail (GTK_IS_CLIST (clist)); - g_return_if_fail (clist_row != NULL); - - if (clist->column[column].auto_resize && - !GTK_CLIST_AUTO_RESIZE_BLOCKED (clist)) - GTK_CLIST_GET_CLASS (clist)->cell_size_request (clist, clist_row, - column, &requisition); - - switch (clist_row->cell[column].type) - { - case GTK_CELL_EMPTY: - break; - case GTK_CELL_TEXT: - old_text = GTK_CELL_TEXT (clist_row->cell[column])->text; - break; - case GTK_CELL_PIXMAP: - old_pixmap = GTK_CELL_PIXMAP (clist_row->cell[column])->pixmap; - old_mask = GTK_CELL_PIXMAP (clist_row->cell[column])->mask; - break; - case GTK_CELL_PIXTEXT: - old_text = GTK_CELL_PIXTEXT (clist_row->cell[column])->text; - old_pixmap = GTK_CELL_PIXTEXT (clist_row->cell[column])->pixmap; - old_mask = GTK_CELL_PIXTEXT (clist_row->cell[column])->mask; - break; - case GTK_CELL_WIDGET: - /* unimplemented */ - break; - default: - break; - } - - clist_row->cell[column].type = GTK_CELL_EMPTY; - - /* Note that pixmap and mask were already ref'ed by the caller - */ - switch (type) - { - case GTK_CELL_TEXT: - if (text) - { - clist_row->cell[column].type = GTK_CELL_TEXT; - GTK_CELL_TEXT (clist_row->cell[column])->text = g_strdup (text); - } - break; - case GTK_CELL_PIXMAP: - if (pixmap) - { - clist_row->cell[column].type = GTK_CELL_PIXMAP; - GTK_CELL_PIXMAP (clist_row->cell[column])->pixmap = pixmap; - /* We set the mask even if it is NULL */ - GTK_CELL_PIXMAP (clist_row->cell[column])->mask = mask; - } - break; - case GTK_CELL_PIXTEXT: - if (text && pixmap) - { - clist_row->cell[column].type = GTK_CELL_PIXTEXT; - GTK_CELL_PIXTEXT (clist_row->cell[column])->text = g_strdup (text); - GTK_CELL_PIXTEXT (clist_row->cell[column])->spacing = spacing; - GTK_CELL_PIXTEXT (clist_row->cell[column])->pixmap = pixmap; - GTK_CELL_PIXTEXT (clist_row->cell[column])->mask = mask; - } - break; - default: - break; - } - - if (clist->column[column].auto_resize && - !GTK_CLIST_AUTO_RESIZE_BLOCKED (clist)) - column_auto_resize (clist, clist_row, column, requisition.width); - - g_free (old_text); - if (old_pixmap) - g_object_unref (old_pixmap); - if (old_mask) - g_object_unref (old_mask); -} - -PangoLayout * -_gtk_clist_create_cell_layout (GtkCList *clist, - GtkCListRow *clist_row, - gint column) -{ - PangoLayout *layout; - GtkStyle *style; - GtkCell *cell; - gchar *text; - - get_cell_style (clist, clist_row, GTK_STATE_NORMAL, column, &style, - NULL, NULL); - - - cell = &clist_row->cell[column]; - switch (cell->type) - { - case GTK_CELL_TEXT: - case GTK_CELL_PIXTEXT: - text = ((cell->type == GTK_CELL_PIXTEXT) ? - GTK_CELL_PIXTEXT (*cell)->text : - GTK_CELL_TEXT (*cell)->text); - - if (!text) - return NULL; - - layout = gtk_widget_create_pango_layout (GTK_WIDGET (clist), - ((cell->type == GTK_CELL_PIXTEXT) ? - GTK_CELL_PIXTEXT (*cell)->text : - GTK_CELL_TEXT (*cell)->text)); - pango_layout_set_font_description (layout, style->font_desc); - - return layout; - - default: - return NULL; - } -} - -static void -cell_size_request (GtkCList *clist, - GtkCListRow *clist_row, - gint column, - GtkRequisition *requisition) -{ - gint width; - gint height; - PangoLayout *layout; - PangoRectangle logical_rect; - - g_return_if_fail (GTK_IS_CLIST (clist)); - g_return_if_fail (requisition != NULL); - - layout = _gtk_clist_create_cell_layout (clist, clist_row, column); - if (layout) - { - pango_layout_get_pixel_extents (layout, NULL, &logical_rect); - - requisition->width = logical_rect.width; - requisition->height = logical_rect.height; - - g_object_unref (layout); - } - else - { - requisition->width = 0; - requisition->height = 0; - } - - if (layout && clist_row->cell[column].type == GTK_CELL_PIXTEXT) - requisition->width += GTK_CELL_PIXTEXT (clist_row->cell[column])->spacing; - - switch (clist_row->cell[column].type) - { - case GTK_CELL_PIXTEXT: - gdk_drawable_get_size (GTK_CELL_PIXTEXT (clist_row->cell[column])->pixmap, - &width, &height); - requisition->width += width; - requisition->height = MAX (requisition->height, height); - break; - case GTK_CELL_PIXMAP: - gdk_drawable_get_size (GTK_CELL_PIXMAP (clist_row->cell[column])->pixmap, - &width, &height); - requisition->width += width; - requisition->height = MAX (requisition->height, height); - break; - - default: - break; - } - - requisition->width += clist_row->cell[column].horizontal; - requisition->height += clist_row->cell[column].vertical; -} - -/* PUBLIC INSERT/REMOVE ROW FUNCTIONS - * gtk_clist_prepend - * gtk_clist_append - * gtk_clist_insert - * gtk_clist_remove - * gtk_clist_clear - */ -gint -gtk_clist_prepend (GtkCList *clist, - gchar *text[]) -{ - g_return_val_if_fail (GTK_IS_CLIST (clist), -1); - g_return_val_if_fail (text != NULL, -1); - - return GTK_CLIST_GET_CLASS (clist)->insert_row (clist, 0, text); -} - -gint -gtk_clist_append (GtkCList *clist, - gchar *text[]) -{ - g_return_val_if_fail (GTK_IS_CLIST (clist), -1); - g_return_val_if_fail (text != NULL, -1); - - return GTK_CLIST_GET_CLASS (clist)->insert_row (clist, clist->rows, text); -} - -gint -gtk_clist_insert (GtkCList *clist, - gint row, - gchar *text[]) -{ - g_return_val_if_fail (GTK_IS_CLIST (clist), -1); - g_return_val_if_fail (text != NULL, -1); - - if (row < 0 || row > clist->rows) - row = clist->rows; - - return GTK_CLIST_GET_CLASS (clist)->insert_row (clist, row, text); -} - -void -gtk_clist_remove (GtkCList *clist, - gint row) -{ - GTK_CLIST_GET_CLASS (clist)->remove_row (clist, row); -} - -void -gtk_clist_clear (GtkCList *clist) -{ - g_return_if_fail (GTK_IS_CLIST (clist)); - - GTK_CLIST_GET_CLASS (clist)->clear (clist); -} - -/* PRIVATE INSERT/REMOVE ROW FUNCTIONS - * real_insert_row - * real_remove_row - * real_clear - * real_row_move - */ -static gint -real_insert_row (GtkCList *clist, - gint row, - gchar *text[]) -{ - gint i; - GtkCListRow *clist_row; - - g_return_val_if_fail (GTK_IS_CLIST (clist), -1); - g_return_val_if_fail (text != NULL, -1); - - /* return if out of bounds */ - if (row < 0 || row > clist->rows) - return -1; - - /* create the row */ - clist_row = row_new (clist); - - /* set the text in the row's columns */ - for (i = 0; i < clist->columns; i++) - if (text[i]) - GTK_CLIST_GET_CLASS (clist)->set_cell_contents - (clist, clist_row, i, GTK_CELL_TEXT, text[i], 0, NULL ,NULL); - - if (!clist->rows) - { - clist->row_list = g_list_append (clist->row_list, clist_row); - clist->row_list_end = clist->row_list; - } - else - { - if (GTK_CLIST_AUTO_SORT(clist)) /* override insertion pos */ - { - GList *work; - - row = 0; - work = clist->row_list; - - if (clist->sort_type == GTK_SORT_ASCENDING) - { - while (row < clist->rows && - clist->compare (clist, clist_row, - GTK_CLIST_ROW (work)) > 0) - { - row++; - work = work->next; - } - } - else - { - while (row < clist->rows && - clist->compare (clist, clist_row, - GTK_CLIST_ROW (work)) < 0) - { - row++; - work = work->next; - } - } - } - - /* reset the row end pointer if we're inserting at the end of the list */ - if (row == clist->rows) - clist->row_list_end = (g_list_append (clist->row_list_end, - clist_row))->next; - else - clist->row_list = g_list_insert (clist->row_list, clist_row, row); - - } - clist->rows++; - - if (row < ROW_FROM_YPIXEL (clist, 0)) - clist->voffset -= (clist->row_height + CELL_SPACING); - - /* syncronize the selection list */ - sync_selection (clist, row, SYNC_INSERT); - - if (clist->rows == 1) - { - clist->focus_row = 0; - if (clist->selection_mode == GTK_SELECTION_BROWSE) - gtk_clist_select_row (clist, 0, -1); - } - - /* redraw the list if it isn't frozen */ - if (CLIST_UNFROZEN (clist)) - { - adjust_adjustments (clist, FALSE); - - if (gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE) - draw_rows (clist, NULL); - } - - return row; -} - -static void -real_remove_row (GtkCList *clist, - gint row) -{ - gint was_visible; - GList *list; - GtkCListRow *clist_row; - - g_return_if_fail (GTK_IS_CLIST (clist)); - - /* return if out of bounds */ - if (row < 0 || row > (clist->rows - 1)) - return; - - was_visible = (gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE); - - /* get the row we're going to delete */ - list = ROW_ELEMENT (clist, row); - g_assert (list != NULL); - clist_row = list->data; - - /* if we're removing a selected row, we have to make sure - * it's properly unselected, and then sync up the clist->selected - * list to reflect the deincrimented indexies of rows after the - * removal */ - if (clist_row->state == GTK_STATE_SELECTED) - gtk_signal_emit (GTK_OBJECT (clist), clist_signals[UNSELECT_ROW], - row, -1, NULL); - - sync_selection (clist, row, SYNC_REMOVE); - - /* reset the row end pointer if we're removing at the end of the list */ - clist->rows--; - if (clist->row_list == list) - clist->row_list = g_list_next (list); - if (clist->row_list_end == list) - clist->row_list_end = g_list_previous (list); - list = g_list_remove (list, clist_row); - - if (row < ROW_FROM_YPIXEL (clist, 0)) - clist->voffset += clist->row_height + CELL_SPACING; - - if (clist->selection_mode == GTK_SELECTION_BROWSE && !clist->selection && - clist->focus_row >= 0) - gtk_signal_emit (GTK_OBJECT (clist), clist_signals[SELECT_ROW], - clist->focus_row, -1, NULL); - - /* toast the row */ - row_delete (clist, clist_row); - - /* redraw the row if it isn't frozen */ - if (CLIST_UNFROZEN (clist)) - { - adjust_adjustments (clist, FALSE); - - if (was_visible) - draw_rows (clist, NULL); - } -} - -static void -real_clear (GtkCList *clist) -{ - GList *list; - GList *free_list; - gint i; - - g_return_if_fail (GTK_IS_CLIST (clist)); - - /* free up the selection list */ - g_list_free (clist->selection); - g_list_free (clist->undo_selection); - g_list_free (clist->undo_unselection); - - clist->selection = NULL; - clist->selection_end = NULL; - clist->undo_selection = NULL; - clist->undo_unselection = NULL; - clist->voffset = 0; - clist->focus_row = -1; - clist->anchor = -1; - clist->undo_anchor = -1; - clist->anchor_state = GTK_STATE_SELECTED; - clist->drag_pos = -1; - - /* remove all the rows */ - GTK_CLIST_SET_FLAG (clist, CLIST_AUTO_RESIZE_BLOCKED); - free_list = clist->row_list; - clist->row_list = NULL; - clist->row_list_end = NULL; - clist->rows = 0; - for (list = free_list; list; list = list->next) - row_delete (clist, GTK_CLIST_ROW (list)); - g_list_free (free_list); - GTK_CLIST_UNSET_FLAG (clist, CLIST_AUTO_RESIZE_BLOCKED); - for (i = 0; i < clist->columns; i++) - if (clist->column[i].auto_resize) - { - if (GTK_CLIST_SHOW_TITLES(clist) && clist->column[i].button) - gtk_clist_set_column_width - (clist, i, (clist->column[i].button->requisition.width - - (CELL_SPACING + (2 * COLUMN_INSET)))); - else - gtk_clist_set_column_width (clist, i, 0); - } - /* zero-out the scrollbars */ - if (clist->vadjustment) - { - gtk_adjustment_set_value (clist->vadjustment, 0.0); - CLIST_REFRESH (clist); - } - else - gtk_widget_queue_resize (GTK_WIDGET (clist)); -} - -static void -real_row_move (GtkCList *clist, - gint source_row, - gint dest_row) -{ - GtkCListRow *clist_row; - GList *list; - gint first, last; - gint d; - - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (GTK_CLIST_AUTO_SORT(clist)) - return; - - if (source_row < 0 || source_row >= clist->rows || - dest_row < 0 || dest_row >= clist->rows || - source_row == dest_row) - return; - - gtk_clist_freeze (clist); - - /* unlink source row */ - clist_row = ROW_ELEMENT (clist, source_row)->data; - if (source_row == clist->rows - 1) - clist->row_list_end = clist->row_list_end->prev; - clist->row_list = g_list_remove (clist->row_list, clist_row); - clist->rows--; - - /* relink source row */ - clist->row_list = g_list_insert (clist->row_list, clist_row, dest_row); - if (dest_row == clist->rows) - clist->row_list_end = clist->row_list_end->next; - clist->rows++; - - /* sync selection */ - if (source_row > dest_row) - { - first = dest_row; - last = source_row; - d = 1; - } - else - { - first = source_row; - last = dest_row; - d = -1; - } - - for (list = clist->selection; list; list = list->next) - { - if (list->data == GINT_TO_POINTER (source_row)) - list->data = GINT_TO_POINTER (dest_row); - else if (first <= GPOINTER_TO_INT (list->data) && - last >= GPOINTER_TO_INT (list->data)) - list->data = GINT_TO_POINTER (GPOINTER_TO_INT (list->data) + d); - } - - if (clist->focus_row == source_row) - clist->focus_row = dest_row; - else if (clist->focus_row > first) - clist->focus_row += d; - - gtk_clist_thaw (clist); -} - -/* PUBLIC ROW FUNCTIONS - * gtk_clist_moveto - * gtk_clist_set_row_height - * gtk_clist_set_row_data - * gtk_clist_set_row_data_full - * gtk_clist_get_row_data - * gtk_clist_find_row_from_data - * gtk_clist_swap_rows - * gtk_clist_row_move - * gtk_clist_row_is_visible - * gtk_clist_set_foreground - * gtk_clist_set_background - */ -void -gtk_clist_moveto (GtkCList *clist, - gint row, - gint column, - gfloat row_align, - gfloat col_align) -{ - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (row < -1 || row >= clist->rows) - return; - if (column < -1 || column >= clist->columns) - return; - - row_align = CLAMP (row_align, 0, 1); - col_align = CLAMP (col_align, 0, 1); - - /* adjust horizontal scrollbar */ - if (clist->hadjustment && column >= 0) - { - gint x; - - x = (COLUMN_LEFT (clist, column) - CELL_SPACING - COLUMN_INSET - - (col_align * (clist->clist_window_width - 2 * COLUMN_INSET - - CELL_SPACING - clist->column[column].area.width))); - if (x < 0) - gtk_adjustment_set_value (clist->hadjustment, 0.0); - else if (x > LIST_WIDTH (clist) - clist->clist_window_width) - gtk_adjustment_set_value - (clist->hadjustment, LIST_WIDTH (clist) - clist->clist_window_width); - else - gtk_adjustment_set_value (clist->hadjustment, x); - } - - /* adjust vertical scrollbar */ - if (clist->vadjustment && row >= 0) - move_vertical (clist, row, row_align); -} - -void -gtk_clist_set_row_height (GtkCList *clist, - guint height) -{ - GtkWidget *widget; - - g_return_if_fail (GTK_IS_CLIST (clist)); - - widget = GTK_WIDGET (clist); - - if (height > 0) - { - clist->row_height = height; - GTK_CLIST_SET_FLAG (clist, CLIST_ROW_HEIGHT_SET); - } - else - { - GTK_CLIST_UNSET_FLAG (clist, CLIST_ROW_HEIGHT_SET); - clist->row_height = 0; - } - - if (widget->style->font_desc) - { - PangoContext *context = gtk_widget_get_pango_context (widget); - PangoFontMetrics *metrics; - - metrics = pango_context_get_metrics (context, - widget->style->font_desc, - pango_context_get_language (context)); - - if (!GTK_CLIST_ROW_HEIGHT_SET(clist)) - { - clist->row_height = (pango_font_metrics_get_ascent (metrics) + - pango_font_metrics_get_descent (metrics)); - clist->row_height = PANGO_PIXELS (clist->row_height); - } - - pango_font_metrics_unref (metrics); - } - - CLIST_REFRESH (clist); -} - -void -gtk_clist_set_row_data (GtkCList *clist, - gint row, - gpointer data) -{ - gtk_clist_set_row_data_full (clist, row, data, NULL); -} - -void -gtk_clist_set_row_data_full (GtkCList *clist, - gint row, - gpointer data, - GDestroyNotify destroy) -{ - GtkCListRow *clist_row; - - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (row < 0 || row > (clist->rows - 1)) - return; - - clist_row = ROW_ELEMENT (clist, row)->data; - - if (clist_row->destroy) - clist_row->destroy (clist_row->data); - - clist_row->data = data; - clist_row->destroy = destroy; -} - -gpointer -gtk_clist_get_row_data (GtkCList *clist, - gint row) -{ - GtkCListRow *clist_row; - - g_return_val_if_fail (GTK_IS_CLIST (clist), NULL); - - if (row < 0 || row > (clist->rows - 1)) - return NULL; - - clist_row = ROW_ELEMENT (clist, row)->data; - return clist_row->data; -} - -gint -gtk_clist_find_row_from_data (GtkCList *clist, - gpointer data) -{ - GList *list; - gint n; - - g_return_val_if_fail (GTK_IS_CLIST (clist), -1); - - for (n = 0, list = clist->row_list; list; n++, list = list->next) - if (GTK_CLIST_ROW (list)->data == data) - return n; - - return -1; -} - -void -gtk_clist_swap_rows (GtkCList *clist, - gint row1, - gint row2) -{ - gint first, last; - - g_return_if_fail (GTK_IS_CLIST (clist)); - g_return_if_fail (row1 != row2); - - if (GTK_CLIST_AUTO_SORT(clist)) - return; - - gtk_clist_freeze (clist); - - first = MIN (row1, row2); - last = MAX (row1, row2); - - gtk_clist_row_move (clist, last, first); - gtk_clist_row_move (clist, first + 1, last); - - gtk_clist_thaw (clist); -} - -void -gtk_clist_row_move (GtkCList *clist, - gint source_row, - gint dest_row) -{ - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (GTK_CLIST_AUTO_SORT(clist)) - return; - - if (source_row < 0 || source_row >= clist->rows || - dest_row < 0 || dest_row >= clist->rows || - source_row == dest_row) - return; - - gtk_signal_emit (GTK_OBJECT (clist), clist_signals[ROW_MOVE], - source_row, dest_row); -} - -GtkVisibility -gtk_clist_row_is_visible (GtkCList *clist, - gint row) -{ - gint top; - - g_return_val_if_fail (GTK_IS_CLIST (clist), 0); - - if (row < 0 || row >= clist->rows) - return GTK_VISIBILITY_NONE; - - if (clist->row_height == 0) - return GTK_VISIBILITY_NONE; - - if (row < ROW_FROM_YPIXEL (clist, 0)) - return GTK_VISIBILITY_NONE; - - if (row > ROW_FROM_YPIXEL (clist, clist->clist_window_height)) - return GTK_VISIBILITY_NONE; - - top = ROW_TOP_YPIXEL (clist, row); - - if ((top < 0) - || ((top + clist->row_height) >= clist->clist_window_height)) - return GTK_VISIBILITY_PARTIAL; - - return GTK_VISIBILITY_FULL; -} - -void -gtk_clist_set_foreground (GtkCList *clist, - gint row, - const GdkColor *color) -{ - GtkCListRow *clist_row; - - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (row < 0 || row >= clist->rows) - return; - - clist_row = ROW_ELEMENT (clist, row)->data; - - if (color) - { - clist_row->foreground = *color; - clist_row->fg_set = TRUE; - if (gtk_widget_get_realized (GTK_WIDGET (clist))) - gdk_colormap_alloc_color (gtk_widget_get_colormap (GTK_WIDGET (clist)), - &clist_row->foreground, FALSE, TRUE); - } - else - clist_row->fg_set = FALSE; - - if (CLIST_UNFROZEN (clist) && gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE) - GTK_CLIST_GET_CLASS (clist)->draw_row (clist, NULL, row, clist_row); -} - -void -gtk_clist_set_background (GtkCList *clist, - gint row, - const GdkColor *color) -{ - GtkCListRow *clist_row; - - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (row < 0 || row >= clist->rows) - return; - - clist_row = ROW_ELEMENT (clist, row)->data; - - if (color) - { - clist_row->background = *color; - clist_row->bg_set = TRUE; - if (gtk_widget_get_realized (GTK_WIDGET (clist))) - gdk_colormap_alloc_color (gtk_widget_get_colormap (GTK_WIDGET (clist)), - &clist_row->background, FALSE, TRUE); - } - else - clist_row->bg_set = FALSE; - - if (CLIST_UNFROZEN (clist) - && (gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE)) - GTK_CLIST_GET_CLASS (clist)->draw_row (clist, NULL, row, clist_row); -} - -/* PUBLIC ROW/CELL STYLE FUNCTIONS - * gtk_clist_set_cell_style - * gtk_clist_get_cell_style - * gtk_clist_set_row_style - * gtk_clist_get_row_style - */ -void -gtk_clist_set_cell_style (GtkCList *clist, - gint row, - gint column, - GtkStyle *style) -{ - GtkRequisition requisition = { 0 }; - GtkCListRow *clist_row; - - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (row < 0 || row >= clist->rows) - return; - if (column < 0 || column >= clist->columns) - return; - - clist_row = ROW_ELEMENT (clist, row)->data; - - if (clist_row->cell[column].style == style) - return; - - if (clist->column[column].auto_resize && - !GTK_CLIST_AUTO_RESIZE_BLOCKED (clist)) - GTK_CLIST_GET_CLASS (clist)->cell_size_request (clist, clist_row, - column, &requisition); - - if (clist_row->cell[column].style) - { - if (gtk_widget_get_realized (GTK_WIDGET (clist))) - gtk_style_detach (clist_row->cell[column].style); - g_object_unref (clist_row->cell[column].style); - } - - clist_row->cell[column].style = style; - - if (clist_row->cell[column].style) - { - g_object_ref (clist_row->cell[column].style); - - if (gtk_widget_get_realized (GTK_WIDGET (clist))) - clist_row->cell[column].style = - gtk_style_attach (clist_row->cell[column].style, - clist->clist_window); - } - - column_auto_resize (clist, clist_row, column, requisition.width); - - /* redraw the list if it's not frozen */ - if (CLIST_UNFROZEN (clist)) - { - if (gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE) - GTK_CLIST_GET_CLASS (clist)->draw_row (clist, NULL, row, clist_row); - } -} - -GtkStyle * -gtk_clist_get_cell_style (GtkCList *clist, - gint row, - gint column) -{ - GtkCListRow *clist_row; - - g_return_val_if_fail (GTK_IS_CLIST (clist), NULL); - - if (row < 0 || row >= clist->rows || column < 0 || column >= clist->columns) - return NULL; - - clist_row = ROW_ELEMENT (clist, row)->data; - - return clist_row->cell[column].style; -} - -void -gtk_clist_set_row_style (GtkCList *clist, - gint row, - GtkStyle *style) -{ - GtkRequisition requisition; - GtkCListRow *clist_row; - gint *old_width; - gint i; - - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (row < 0 || row >= clist->rows) - return; - - clist_row = ROW_ELEMENT (clist, row)->data; - - if (clist_row->style == style) - return; - - old_width = g_new (gint, clist->columns); - - if (!GTK_CLIST_AUTO_RESIZE_BLOCKED (clist)) - { - for (i = 0; i < clist->columns; i++) - if (clist->column[i].auto_resize) - { - GTK_CLIST_GET_CLASS (clist)->cell_size_request (clist, clist_row, - i, &requisition); - old_width[i] = requisition.width; - } - } - - if (clist_row->style) - { - if (gtk_widget_get_realized (GTK_WIDGET (clist))) - gtk_style_detach (clist_row->style); - g_object_unref (clist_row->style); - } - - clist_row->style = style; - - if (clist_row->style) - { - g_object_ref (clist_row->style); - - if (gtk_widget_get_realized (GTK_WIDGET (clist))) - clist_row->style = gtk_style_attach (clist_row->style, - clist->clist_window); - } - - if (GTK_CLIST_AUTO_RESIZE_BLOCKED (clist)) - for (i = 0; i < clist->columns; i++) - column_auto_resize (clist, clist_row, i, old_width[i]); - - g_free (old_width); - - /* redraw the list if it's not frozen */ - if (CLIST_UNFROZEN (clist)) - { - if (gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE) - GTK_CLIST_GET_CLASS (clist)->draw_row (clist, NULL, row, clist_row); - } -} - -GtkStyle * -gtk_clist_get_row_style (GtkCList *clist, - gint row) -{ - GtkCListRow *clist_row; - - g_return_val_if_fail (GTK_IS_CLIST (clist), NULL); - - if (row < 0 || row >= clist->rows) - return NULL; - - clist_row = ROW_ELEMENT (clist, row)->data; - - return clist_row->style; -} - -/* PUBLIC SELECTION FUNCTIONS - * gtk_clist_set_selectable - * gtk_clist_get_selectable - * gtk_clist_select_row - * gtk_clist_unselect_row - * gtk_clist_select_all - * gtk_clist_unselect_all - * gtk_clist_undo_selection - */ -void -gtk_clist_set_selectable (GtkCList *clist, - gint row, - gboolean selectable) -{ - GtkCListRow *clist_row; - - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (row < 0 || row >= clist->rows) - return; - - clist_row = ROW_ELEMENT (clist, row)->data; - - if (selectable == clist_row->selectable) - return; - - clist_row->selectable = selectable; - - if (!selectable && clist_row->state == GTK_STATE_SELECTED) - { - if (clist->anchor >= 0 && - clist->selection_mode == GTK_SELECTION_MULTIPLE) - { - clist->drag_button = 0; - remove_grab (clist); - GTK_CLIST_GET_CLASS (clist)->resync_selection (clist, NULL); - } - gtk_signal_emit (GTK_OBJECT (clist), clist_signals[UNSELECT_ROW], - row, -1, NULL); - } -} - -gboolean -gtk_clist_get_selectable (GtkCList *clist, - gint row) -{ - g_return_val_if_fail (GTK_IS_CLIST (clist), FALSE); - - if (row < 0 || row >= clist->rows) - return FALSE; - - return GTK_CLIST_ROW (ROW_ELEMENT (clist, row))->selectable; -} - -void -gtk_clist_select_row (GtkCList *clist, - gint row, - gint column) -{ - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (row < 0 || row >= clist->rows) - return; - if (column < -1 || column >= clist->columns) - return; - - gtk_signal_emit (GTK_OBJECT (clist), clist_signals[SELECT_ROW], - row, column, NULL); -} - -void -gtk_clist_unselect_row (GtkCList *clist, - gint row, - gint column) -{ - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (row < 0 || row >= clist->rows) - return; - if (column < -1 || column >= clist->columns) - return; - - gtk_signal_emit (GTK_OBJECT (clist), clist_signals[UNSELECT_ROW], - row, column, NULL); -} - -void -gtk_clist_select_all (GtkCList *clist) -{ - g_return_if_fail (GTK_IS_CLIST (clist)); - - GTK_CLIST_GET_CLASS (clist)->select_all (clist); -} - -void -gtk_clist_unselect_all (GtkCList *clist) -{ - g_return_if_fail (GTK_IS_CLIST (clist)); - - GTK_CLIST_GET_CLASS (clist)->unselect_all (clist); -} - -void -gtk_clist_undo_selection (GtkCList *clist) -{ - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (clist->selection_mode == GTK_SELECTION_MULTIPLE && - (clist->undo_selection || clist->undo_unselection)) - gtk_signal_emit (GTK_OBJECT (clist), clist_signals[UNDO_SELECTION]); -} - -/* PRIVATE SELECTION FUNCTIONS - * selection_find - * toggle_row - * fake_toggle_row - * toggle_focus_row - * toggle_add_mode - * real_select_row - * real_unselect_row - * real_select_all - * real_unselect_all - * fake_unselect_all - * real_undo_selection - * set_anchor - * resync_selection - * update_extended_selection - * start_selection - * end_selection - * extend_selection - * sync_selection - */ -static GList * -selection_find (GtkCList *clist, - gint row_number, - GList *row_list_element) -{ - return g_list_find (clist->selection, GINT_TO_POINTER (row_number)); -} - -static void -toggle_row (GtkCList *clist, - gint row, - gint column, - GdkEvent *event) -{ - GtkCListRow *clist_row; - - switch (clist->selection_mode) - { - case GTK_SELECTION_MULTIPLE: - case GTK_SELECTION_SINGLE: - clist_row = ROW_ELEMENT (clist, row)->data; - - if (!clist_row) - return; - - if (clist_row->state == GTK_STATE_SELECTED) - { - gtk_signal_emit (GTK_OBJECT (clist), clist_signals[UNSELECT_ROW], - row, column, event); - return; - } - case GTK_SELECTION_BROWSE: - gtk_signal_emit (GTK_OBJECT (clist), clist_signals[SELECT_ROW], - row, column, event); - break; - default: - g_assert_not_reached (); - } -} - -static void -fake_toggle_row (GtkCList *clist, - gint row) -{ - GList *work; - - work = ROW_ELEMENT (clist, row); - - if (!work || !GTK_CLIST_ROW (work)->selectable) - return; - - if (GTK_CLIST_ROW (work)->state == GTK_STATE_NORMAL) - clist->anchor_state = GTK_CLIST_ROW (work)->state = GTK_STATE_SELECTED; - else - clist->anchor_state = GTK_CLIST_ROW (work)->state = GTK_STATE_NORMAL; - - if (CLIST_UNFROZEN (clist) && - gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE) - GTK_CLIST_GET_CLASS (clist)->draw_row (clist, NULL, row, - GTK_CLIST_ROW (work)); -} - -static gboolean -clist_has_grab (GtkCList *clist) -{ - return (GTK_WIDGET_HAS_GRAB (clist) && - gdk_display_pointer_is_grabbed (gtk_widget_get_display (GTK_WIDGET (clist)))); -} - -static void -toggle_focus_row (GtkCList *clist) -{ - g_return_if_fail (clist != 0); - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (clist_has_grab (clist) || - clist->focus_row < 0 || clist->focus_row >= clist->rows) - return; - - switch (clist->selection_mode) - { - case GTK_SELECTION_SINGLE: - toggle_row (clist, clist->focus_row, 0, NULL); - break; - case GTK_SELECTION_MULTIPLE: - g_list_free (clist->undo_selection); - g_list_free (clist->undo_unselection); - clist->undo_selection = NULL; - clist->undo_unselection = NULL; - - clist->anchor = clist->focus_row; - clist->drag_pos = clist->focus_row; - clist->undo_anchor = clist->focus_row; - - if (GTK_CLIST_ADD_MODE(clist)) - fake_toggle_row (clist, clist->focus_row); - else - GTK_CLIST_GET_CLASS (clist)->fake_unselect_all (clist,clist->focus_row); - - GTK_CLIST_GET_CLASS (clist)->resync_selection (clist, NULL); - break; - default: - break; - } -} - -static void -toggle_add_mode (GtkCList *clist) -{ - g_return_if_fail (clist != 0); - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (clist_has_grab (clist) || - clist->selection_mode != GTK_SELECTION_MULTIPLE) - return; - - gtk_clist_draw_focus (GTK_WIDGET (clist)); - if (!GTK_CLIST_ADD_MODE(clist)) - { - gint8 dashes[] = { 4, 4 }; - - GTK_CLIST_SET_FLAG (clist, CLIST_ADD_MODE); - gdk_gc_set_line_attributes (clist->xor_gc, 1, - GDK_LINE_ON_OFF_DASH, 0, 0); - gdk_gc_set_dashes (clist->xor_gc, 0, dashes, G_N_ELEMENTS (dashes)); - } - else - { - GTK_CLIST_UNSET_FLAG (clist, CLIST_ADD_MODE); - gdk_gc_set_line_attributes (clist->xor_gc, 1, GDK_LINE_SOLID, 0, 0); - clist->anchor_state = GTK_STATE_SELECTED; - } - gtk_clist_draw_focus (GTK_WIDGET (clist)); -} - -static void -real_select_row (GtkCList *clist, - gint row, - gint column, - GdkEvent *event) -{ - GtkCListRow *clist_row; - GList *list; - gint sel_row; - gboolean row_selected; - - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (row < 0 || row > (clist->rows - 1)) - return; - - switch (clist->selection_mode) - { - case GTK_SELECTION_SINGLE: - case GTK_SELECTION_BROWSE: - - row_selected = FALSE; - list = clist->selection; - - while (list) - { - sel_row = GPOINTER_TO_INT (list->data); - list = list->next; - - if (row == sel_row) - row_selected = TRUE; - else - gtk_signal_emit (GTK_OBJECT (clist), clist_signals[UNSELECT_ROW], - sel_row, column, event); - } - - if (row_selected) - return; - - default: - break; - } - - clist_row = ROW_ELEMENT (clist, row)->data; - - if (clist_row->state != GTK_STATE_NORMAL || !clist_row->selectable) - return; - - clist_row->state = GTK_STATE_SELECTED; - if (!clist->selection) - { - clist->selection = g_list_append (clist->selection, - GINT_TO_POINTER (row)); - clist->selection_end = clist->selection; - } - else - clist->selection_end = - g_list_append (clist->selection_end, GINT_TO_POINTER (row))->next; - - if (CLIST_UNFROZEN (clist) - && (gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE)) - GTK_CLIST_GET_CLASS (clist)->draw_row (clist, NULL, row, clist_row); -} - -static void -real_unselect_row (GtkCList *clist, - gint row, - gint column, - GdkEvent *event) -{ - GtkCListRow *clist_row; - - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (row < 0 || row > (clist->rows - 1)) - return; - - clist_row = ROW_ELEMENT (clist, row)->data; - - if (clist_row->state == GTK_STATE_SELECTED) - { - clist_row->state = GTK_STATE_NORMAL; - - if (clist->selection_end && - clist->selection_end->data == GINT_TO_POINTER (row)) - clist->selection_end = clist->selection_end->prev; - - clist->selection = g_list_remove (clist->selection, - GINT_TO_POINTER (row)); - - if (CLIST_UNFROZEN (clist) - && (gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE)) - GTK_CLIST_GET_CLASS (clist)->draw_row (clist, NULL, row, clist_row); - } -} - -static void -real_select_all (GtkCList *clist) -{ - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (clist_has_grab (clist)) - return; - - switch (clist->selection_mode) - { - case GTK_SELECTION_SINGLE: - case GTK_SELECTION_BROWSE: - return; - - case GTK_SELECTION_MULTIPLE: - g_list_free (clist->undo_selection); - g_list_free (clist->undo_unselection); - clist->undo_selection = NULL; - clist->undo_unselection = NULL; - - if (clist->rows && - ((GtkCListRow *) (clist->row_list->data))->state != - GTK_STATE_SELECTED) - fake_toggle_row (clist, 0); - - clist->anchor_state = GTK_STATE_SELECTED; - clist->anchor = 0; - clist->drag_pos = 0; - clist->undo_anchor = clist->focus_row; - update_extended_selection (clist, clist->rows); - GTK_CLIST_GET_CLASS (clist)->resync_selection (clist, NULL); - return; - default: - g_assert_not_reached (); - } -} - -static void -real_unselect_all (GtkCList *clist) -{ - GList *list; - gint i; - - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (clist_has_grab (clist)) - return; - - switch (clist->selection_mode) - { - case GTK_SELECTION_BROWSE: - if (clist->focus_row >= 0) - { - gtk_signal_emit (GTK_OBJECT (clist), - clist_signals[SELECT_ROW], - clist->focus_row, -1, NULL); - return; - } - break; - case GTK_SELECTION_MULTIPLE: - g_list_free (clist->undo_selection); - g_list_free (clist->undo_unselection); - clist->undo_selection = NULL; - clist->undo_unselection = NULL; - - clist->anchor = -1; - clist->drag_pos = -1; - clist->undo_anchor = clist->focus_row; - break; - default: - break; - } - - list = clist->selection; - while (list) - { - i = GPOINTER_TO_INT (list->data); - list = list->next; - gtk_signal_emit (GTK_OBJECT (clist), - clist_signals[UNSELECT_ROW], i, -1, NULL); - } -} - -static void -fake_unselect_all (GtkCList *clist, - gint row) -{ - GList *list; - GList *work; - gint i; - - if (row >= 0 && (work = ROW_ELEMENT (clist, row))) - { - if (GTK_CLIST_ROW (work)->state == GTK_STATE_NORMAL && - GTK_CLIST_ROW (work)->selectable) - { - GTK_CLIST_ROW (work)->state = GTK_STATE_SELECTED; - - if (CLIST_UNFROZEN (clist) && - gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE) - GTK_CLIST_GET_CLASS (clist)->draw_row (clist, NULL, row, - GTK_CLIST_ROW (work)); - } - } - - clist->undo_selection = clist->selection; - clist->selection = NULL; - clist->selection_end = NULL; - - for (list = clist->undo_selection; list; list = list->next) - { - if ((i = GPOINTER_TO_INT (list->data)) == row || - !(work = g_list_nth (clist->row_list, i))) - continue; - - GTK_CLIST_ROW (work)->state = GTK_STATE_NORMAL; - if (CLIST_UNFROZEN (clist) && - gtk_clist_row_is_visible (clist, i) != GTK_VISIBILITY_NONE) - GTK_CLIST_GET_CLASS (clist)->draw_row (clist, NULL, i, - GTK_CLIST_ROW (work)); - } -} - -static void -real_undo_selection (GtkCList *clist) -{ - GList *work; - - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (clist_has_grab (clist) || - clist->selection_mode != GTK_SELECTION_MULTIPLE) - return; - - GTK_CLIST_GET_CLASS (clist)->resync_selection (clist, NULL); - - if (!(clist->undo_selection || clist->undo_unselection)) - { - gtk_clist_unselect_all (clist); - return; - } - - for (work = clist->undo_selection; work; work = work->next) - gtk_signal_emit (GTK_OBJECT (clist), clist_signals[SELECT_ROW], - GPOINTER_TO_INT (work->data), -1, NULL); - - for (work = clist->undo_unselection; work; work = work->next) - { - /* g_print ("unselect %d\n",GPOINTER_TO_INT (work->data)); */ - gtk_signal_emit (GTK_OBJECT (clist), clist_signals[UNSELECT_ROW], - GPOINTER_TO_INT (work->data), -1, NULL); - } - - if (gtk_widget_has_focus (GTK_WIDGET (clist)) && clist->focus_row != clist->undo_anchor) - { - gtk_clist_draw_focus (GTK_WIDGET (clist)); - clist->focus_row = clist->undo_anchor; - gtk_clist_draw_focus (GTK_WIDGET (clist)); - } - else - clist->focus_row = clist->undo_anchor; - - clist->undo_anchor = -1; - - g_list_free (clist->undo_selection); - g_list_free (clist->undo_unselection); - clist->undo_selection = NULL; - clist->undo_unselection = NULL; - - if (ROW_TOP_YPIXEL (clist, clist->focus_row) + clist->row_height > - clist->clist_window_height) - gtk_clist_moveto (clist, clist->focus_row, -1, 1, 0); - else if (ROW_TOP_YPIXEL (clist, clist->focus_row) < 0) - gtk_clist_moveto (clist, clist->focus_row, -1, 0, 0); -} - -static void -set_anchor (GtkCList *clist, - gboolean add_mode, - gint anchor, - gint undo_anchor) -{ - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (clist->selection_mode != GTK_SELECTION_MULTIPLE || clist->anchor >= 0) - return; - - g_list_free (clist->undo_selection); - g_list_free (clist->undo_unselection); - clist->undo_selection = NULL; - clist->undo_unselection = NULL; - - if (add_mode) - fake_toggle_row (clist, anchor); - else - { - GTK_CLIST_GET_CLASS (clist)->fake_unselect_all (clist, anchor); - clist->anchor_state = GTK_STATE_SELECTED; - } - - clist->anchor = anchor; - clist->drag_pos = anchor; - clist->undo_anchor = undo_anchor; -} - -static void -resync_selection (GtkCList *clist, - GdkEvent *event) -{ - gint i; - gint e; - gint row; - GList *list; - GtkCListRow *clist_row; - - if (clist->selection_mode != GTK_SELECTION_MULTIPLE) - return; - - if (clist->anchor < 0 || clist->drag_pos < 0) - return; - - gtk_clist_freeze (clist); - - i = MIN (clist->anchor, clist->drag_pos); - e = MAX (clist->anchor, clist->drag_pos); - - if (clist->undo_selection) - { - list = clist->selection; - clist->selection = clist->undo_selection; - clist->selection_end = g_list_last (clist->selection); - clist->undo_selection = list; - list = clist->selection; - while (list) - { - row = GPOINTER_TO_INT (list->data); - list = list->next; - if (row < i || row > e) - { - clist_row = g_list_nth (clist->row_list, row)->data; - if (clist_row->selectable) - { - clist_row->state = GTK_STATE_SELECTED; - gtk_signal_emit (GTK_OBJECT (clist), - clist_signals[UNSELECT_ROW], - row, -1, event); - clist->undo_selection = g_list_prepend - (clist->undo_selection, GINT_TO_POINTER (row)); - } - } - } - } - - if (clist->anchor < clist->drag_pos) - { - for (list = g_list_nth (clist->row_list, i); i <= e; - i++, list = list->next) - if (GTK_CLIST_ROW (list)->selectable) - { - if (g_list_find (clist->selection, GINT_TO_POINTER(i))) - { - if (GTK_CLIST_ROW (list)->state == GTK_STATE_NORMAL) - { - GTK_CLIST_ROW (list)->state = GTK_STATE_SELECTED; - gtk_signal_emit (GTK_OBJECT (clist), - clist_signals[UNSELECT_ROW], - i, -1, event); - clist->undo_selection = - g_list_prepend (clist->undo_selection, - GINT_TO_POINTER (i)); - } - } - else if (GTK_CLIST_ROW (list)->state == GTK_STATE_SELECTED) - { - GTK_CLIST_ROW (list)->state = GTK_STATE_NORMAL; - clist->undo_unselection = - g_list_prepend (clist->undo_unselection, - GINT_TO_POINTER (i)); - } - } - } - else - { - for (list = g_list_nth (clist->row_list, e); i <= e; - e--, list = list->prev) - if (GTK_CLIST_ROW (list)->selectable) - { - if (g_list_find (clist->selection, GINT_TO_POINTER(e))) - { - if (GTK_CLIST_ROW (list)->state == GTK_STATE_NORMAL) - { - GTK_CLIST_ROW (list)->state = GTK_STATE_SELECTED; - gtk_signal_emit (GTK_OBJECT (clist), - clist_signals[UNSELECT_ROW], - e, -1, event); - clist->undo_selection = - g_list_prepend (clist->undo_selection, - GINT_TO_POINTER (e)); - } - } - else if (GTK_CLIST_ROW (list)->state == GTK_STATE_SELECTED) - { - GTK_CLIST_ROW (list)->state = GTK_STATE_NORMAL; - clist->undo_unselection = - g_list_prepend (clist->undo_unselection, - GINT_TO_POINTER (e)); - } - } - } - - clist->undo_unselection = g_list_reverse (clist->undo_unselection); - for (list = clist->undo_unselection; list; list = list->next) - gtk_signal_emit (GTK_OBJECT (clist), clist_signals[SELECT_ROW], - GPOINTER_TO_INT (list->data), -1, event); - - clist->anchor = -1; - clist->drag_pos = -1; - - gtk_clist_thaw (clist); -} - -static void -update_extended_selection (GtkCList *clist, - gint row) -{ - gint i; - GList *list; - GdkRectangle area; - gint s1 = -1; - gint s2 = -1; - gint e1 = -1; - gint e2 = -1; - gint y1 = clist->clist_window_height; - gint y2 = clist->clist_window_height; - gint h1 = 0; - gint h2 = 0; - gint top; - - if (clist->selection_mode != GTK_SELECTION_MULTIPLE || clist->anchor == -1) - return; - - if (row < 0) - row = 0; - if (row >= clist->rows) - row = clist->rows - 1; - - /* extending downwards */ - if (row > clist->drag_pos && clist->anchor <= clist->drag_pos) - { - s2 = clist->drag_pos + 1; - e2 = row; - } - /* extending upwards */ - else if (row < clist->drag_pos && clist->anchor >= clist->drag_pos) - { - s2 = row; - e2 = clist->drag_pos - 1; - } - else if (row < clist->drag_pos && clist->anchor < clist->drag_pos) - { - e1 = clist->drag_pos; - /* row and drag_pos on different sides of anchor : - take back the selection between anchor and drag_pos, - select between anchor and row */ - if (row < clist->anchor) - { - s1 = clist->anchor + 1; - s2 = row; - e2 = clist->anchor - 1; - } - /* take back the selection between anchor and drag_pos */ - else - s1 = row + 1; - } - else if (row > clist->drag_pos && clist->anchor > clist->drag_pos) - { - s1 = clist->drag_pos; - /* row and drag_pos on different sides of anchor : - take back the selection between anchor and drag_pos, - select between anchor and row */ - if (row > clist->anchor) - { - e1 = clist->anchor - 1; - s2 = clist->anchor + 1; - e2 = row; - } - /* take back the selection between anchor and drag_pos */ - else - e1 = row - 1; - } - - clist->drag_pos = row; - - area.x = 0; - area.width = clist->clist_window_width; - - /* restore the elements between s1 and e1 */ - if (s1 >= 0) - { - for (i = s1, list = g_list_nth (clist->row_list, i); i <= e1; - i++, list = list->next) - if (GTK_CLIST_ROW (list)->selectable) - { - if (GTK_CLIST_GET_CLASS (clist)->selection_find (clist, i, list)) - GTK_CLIST_ROW (list)->state = GTK_STATE_SELECTED; - else - GTK_CLIST_ROW (list)->state = GTK_STATE_NORMAL; - } - - top = ROW_TOP_YPIXEL (clist, clist->focus_row); - - if (top + clist->row_height <= 0) - { - area.y = 0; - area.height = ROW_TOP_YPIXEL (clist, e1) + clist->row_height; - draw_rows (clist, &area); - gtk_clist_moveto (clist, clist->focus_row, -1, 0, 0); - } - else if (top >= clist->clist_window_height) - { - area.y = ROW_TOP_YPIXEL (clist, s1) - 1; - area.height = clist->clist_window_height - area.y; - draw_rows (clist, &area); - gtk_clist_moveto (clist, clist->focus_row, -1, 1, 0); - } - else if (top < 0) - gtk_clist_moveto (clist, clist->focus_row, -1, 0, 0); - else if (top + clist->row_height > clist->clist_window_height) - gtk_clist_moveto (clist, clist->focus_row, -1, 1, 0); - - y1 = ROW_TOP_YPIXEL (clist, s1) - 1; - h1 = (e1 - s1 + 1) * (clist->row_height + CELL_SPACING); - } - - /* extend the selection between s2 and e2 */ - if (s2 >= 0) - { - for (i = s2, list = g_list_nth (clist->row_list, i); i <= e2; - i++, list = list->next) - if (GTK_CLIST_ROW (list)->selectable && - GTK_CLIST_ROW (list)->state != clist->anchor_state) - GTK_CLIST_ROW (list)->state = clist->anchor_state; - - top = ROW_TOP_YPIXEL (clist, clist->focus_row); - - if (top + clist->row_height <= 0) - { - area.y = 0; - area.height = ROW_TOP_YPIXEL (clist, e2) + clist->row_height; - draw_rows (clist, &area); - gtk_clist_moveto (clist, clist->focus_row, -1, 0, 0); - } - else if (top >= clist->clist_window_height) - { - area.y = ROW_TOP_YPIXEL (clist, s2) - 1; - area.height = clist->clist_window_height - area.y; - draw_rows (clist, &area); - gtk_clist_moveto (clist, clist->focus_row, -1, 1, 0); - } - else if (top < 0) - gtk_clist_moveto (clist, clist->focus_row, -1, 0, 0); - else if (top + clist->row_height > clist->clist_window_height) - gtk_clist_moveto (clist, clist->focus_row, -1, 1, 0); - - y2 = ROW_TOP_YPIXEL (clist, s2) - 1; - h2 = (e2 - s2 + 1) * (clist->row_height + CELL_SPACING); - } - - area.y = MAX (0, MIN (y1, y2)); - if (area.y > clist->clist_window_height) - area.y = 0; - area.height = MIN (clist->clist_window_height, h1 + h2); - if (s1 >= 0 && s2 >= 0) - area.height += (clist->row_height + CELL_SPACING); - draw_rows (clist, &area); -} - -static void -start_selection (GtkCList *clist) -{ - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (clist_has_grab (clist)) - return; - - set_anchor (clist, GTK_CLIST_ADD_MODE(clist), clist->focus_row, - clist->focus_row); -} - -static void -end_selection (GtkCList *clist) -{ - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (gdk_display_pointer_is_grabbed (gtk_widget_get_display (GTK_WIDGET (clist))) && - gtk_widget_has_focus (GTK_WIDGET (clist))) - return; - - GTK_CLIST_GET_CLASS (clist)->resync_selection (clist, NULL); -} - -static void -extend_selection (GtkCList *clist, - GtkScrollType scroll_type, - gfloat position, - gboolean auto_start_selection) -{ - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (clist_has_grab (clist) || - clist->selection_mode != GTK_SELECTION_MULTIPLE) - return; - - if (auto_start_selection) - set_anchor (clist, GTK_CLIST_ADD_MODE(clist), clist->focus_row, - clist->focus_row); - else if (clist->anchor == -1) - return; - - move_focus_row (clist, scroll_type, position); - - if (ROW_TOP_YPIXEL (clist, clist->focus_row) + clist->row_height > - clist->clist_window_height) - gtk_clist_moveto (clist, clist->focus_row, -1, 1, 0); - else if (ROW_TOP_YPIXEL (clist, clist->focus_row) < 0) - gtk_clist_moveto (clist, clist->focus_row, -1, 0, 0); - - update_extended_selection (clist, clist->focus_row); -} - -static void -sync_selection (GtkCList *clist, - gint row, - gint mode) -{ - GList *list; - gint d; - - if (mode == SYNC_INSERT) - d = 1; - else - d = -1; - - if (clist->focus_row >= row) - { - if (d > 0 || clist->focus_row > row) - clist->focus_row += d; - if (clist->focus_row == -1 && clist->rows >= 1) - clist->focus_row = 0; - else if (d < 0 && clist->focus_row >= clist->rows - 1) - clist->focus_row = clist->rows - 2; - else if (clist->focus_row >= clist->rows) /* Paranoia */ - clist->focus_row = clist->rows - 1; - } - - GTK_CLIST_GET_CLASS (clist)->resync_selection (clist, NULL); - - g_list_free (clist->undo_selection); - g_list_free (clist->undo_unselection); - clist->undo_selection = NULL; - clist->undo_unselection = NULL; - - clist->anchor = -1; - clist->drag_pos = -1; - clist->undo_anchor = clist->focus_row; - - list = clist->selection; - - while (list) - { - if (GPOINTER_TO_INT (list->data) >= row) - list->data = ((gchar*) list->data) + d; - list = list->next; - } -} - -/* GTKOBJECT - * gtk_clist_destroy - * gtk_clist_finalize - */ -static void -gtk_clist_destroy (GtkObject *object) -{ - gint i; - GtkCList *clist; - - g_return_if_fail (GTK_IS_CLIST (object)); - - clist = GTK_CLIST (object); - - /* freeze the list */ - clist->freeze_count++; - - /* get rid of all the rows */ - gtk_clist_clear (clist); - - /* Since we don't have a _remove method, unparent the children - * instead of destroying them so the focus will be unset properly. - * (For other containers, the _remove method takes care of the - * unparent) The destroy will happen when the refcount drops - * to zero. - */ - - /* unref adjustments */ - if (clist->hadjustment) - { - gtk_signal_disconnect_by_data (GTK_OBJECT (clist->hadjustment), clist); - g_object_unref (clist->hadjustment); - clist->hadjustment = NULL; - } - if (clist->vadjustment) - { - gtk_signal_disconnect_by_data (GTK_OBJECT (clist->vadjustment), clist); - g_object_unref (clist->vadjustment); - clist->vadjustment = NULL; - } - - remove_grab (clist); - - /* destroy the column buttons */ - for (i = 0; i < clist->columns; i++) - if (clist->column[i].button) - { - gtk_widget_unparent (clist->column[i].button); - clist->column[i].button = NULL; - } - - GTK_OBJECT_CLASS (parent_class)->destroy (object); -} - -static void -gtk_clist_finalize (GObject *object) -{ - GtkCList *clist; - - g_return_if_fail (GTK_IS_CLIST (object)); - - clist = GTK_CLIST (object); - - columns_delete (clist); - - G_OBJECT_CLASS (parent_class)->finalize (object); -} - -/* GTKWIDGET - * gtk_clist_realize - * gtk_clist_unrealize - * gtk_clist_map - * gtk_clist_unmap - * gtk_clist_expose - * gtk_clist_style_set - * gtk_clist_button_press - * gtk_clist_button_release - * gtk_clist_motion - * gtk_clist_size_request - * gtk_clist_size_allocate - */ -static void -gtk_clist_realize (GtkWidget *widget) -{ - GtkCList *clist; - GdkWindowAttr attributes; - GdkGCValues values; - GtkCListRow *clist_row; - GList *list; - gint attributes_mask; - gint border_width; - gint i; - gint j; - - g_return_if_fail (GTK_IS_CLIST (widget)); - - clist = GTK_CLIST (widget); - - gtk_widget_set_realized (widget, TRUE); - - border_width = GTK_CONTAINER (widget)->border_width; - - attributes.window_type = GDK_WINDOW_CHILD; - attributes.x = widget->allocation.x + border_width; - attributes.y = widget->allocation.y + border_width; - attributes.width = widget->allocation.width - border_width * 2; - attributes.height = widget->allocation.height - border_width * 2; - attributes.wclass = GDK_INPUT_OUTPUT; - attributes.visual = gtk_widget_get_visual (widget); - attributes.colormap = gtk_widget_get_colormap (widget); - attributes.event_mask = gtk_widget_get_events (widget); - attributes.event_mask |= (GDK_EXPOSURE_MASK | - GDK_BUTTON_PRESS_MASK | - GDK_BUTTON_RELEASE_MASK | - GDK_KEY_RELEASE_MASK); - attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP; - - /* main window */ - widget->window = gdk_window_new (gtk_widget_get_parent_window (widget), - &attributes, attributes_mask); - gdk_window_set_user_data (widget->window, clist); - - widget->style = gtk_style_attach (widget->style, widget->window); - - gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL); - - /* column-title window */ - - attributes.x = clist->column_title_area.x; - attributes.y = clist->column_title_area.y; - attributes.width = clist->column_title_area.width; - attributes.height = clist->column_title_area.height; - - clist->title_window = gdk_window_new (widget->window, &attributes, - attributes_mask); - gdk_window_set_user_data (clist->title_window, clist); - - gtk_style_set_background (widget->style, clist->title_window, - GTK_STATE_NORMAL); - gdk_window_show (clist->title_window); - - /* set things up so column buttons are drawn in title window */ - for (i = 0; i < clist->columns; i++) - if (clist->column[i].button) - gtk_widget_set_parent_window (clist->column[i].button, - clist->title_window); - - /* clist-window */ - attributes.x = (clist->internal_allocation.x + - widget->style->xthickness); - attributes.y = (clist->internal_allocation.y + - widget->style->ythickness + - clist->column_title_area.height); - attributes.width = clist->clist_window_width; - attributes.height = clist->clist_window_height; - - clist->clist_window = gdk_window_new (widget->window, &attributes, - attributes_mask); - gdk_window_set_user_data (clist->clist_window, clist); - - gdk_window_set_background (clist->clist_window, - &widget->style->base[GTK_STATE_NORMAL]); - gdk_window_show (clist->clist_window); - gdk_drawable_get_size (clist->clist_window, &clist->clist_window_width, - &clist->clist_window_height); - - /* create resize windows */ - attributes.wclass = GDK_INPUT_ONLY; - attributes.event_mask = (GDK_BUTTON_PRESS_MASK | - GDK_BUTTON_RELEASE_MASK | - GDK_POINTER_MOTION_MASK | - GDK_POINTER_MOTION_HINT_MASK); - attributes_mask = GDK_WA_CURSOR; - attributes.cursor = gdk_cursor_new_for_display (gtk_widget_get_display (widget), - GDK_SB_H_DOUBLE_ARROW); - clist->cursor_drag = attributes.cursor; - - attributes.x = LIST_WIDTH (clist) + 1; - attributes.y = 0; - attributes.width = 0; - attributes.height = 0; - - for (i = 0; i < clist->columns; i++) - { - clist->column[i].window = gdk_window_new (clist->title_window, - &attributes, attributes_mask); - gdk_window_set_user_data (clist->column[i].window, clist); - } - - /* This is slightly less efficient than creating them with the - * right size to begin with, but easier - */ - size_allocate_title_buttons (clist); - - /* GCs */ - clist->fg_gc = gdk_gc_new (widget->window); - clist->bg_gc = gdk_gc_new (widget->window); - - /* We'll use this gc to do scrolling as well */ - gdk_gc_set_exposures (clist->fg_gc, TRUE); - - values.foreground = (widget->style->white.pixel==0 ? - widget->style->black:widget->style->white); - values.function = GDK_XOR; - values.subwindow_mode = GDK_INCLUDE_INFERIORS; - clist->xor_gc = gdk_gc_new_with_values (widget->window, - &values, - GDK_GC_FOREGROUND | - GDK_GC_FUNCTION | - GDK_GC_SUBWINDOW); - - /* attach optional row/cell styles, allocate foreground/background colors */ - list = clist->row_list; - for (i = 0; i < clist->rows; i++) - { - clist_row = list->data; - list = list->next; - - if (clist_row->style) - clist_row->style = gtk_style_attach (clist_row->style, - clist->clist_window); - - if (clist_row->fg_set || clist_row->bg_set) - { - GdkColormap *colormap; - - colormap = gtk_widget_get_colormap (widget); - if (clist_row->fg_set) - gdk_colormap_alloc_color (colormap, &clist_row->foreground, - FALSE, TRUE); - if (clist_row->bg_set) - gdk_colormap_alloc_color (colormap, &clist_row->background, - FALSE, TRUE); - } - - for (j = 0; j < clist->columns; j++) - if (clist_row->cell[j].style) - clist_row->cell[j].style = - gtk_style_attach (clist_row->cell[j].style, clist->clist_window); - } -} - -static void -gtk_clist_unrealize (GtkWidget *widget) -{ - gint i; - GtkCList *clist; - - g_return_if_fail (GTK_IS_CLIST (widget)); - - clist = GTK_CLIST (widget); - - /* freeze the list */ - clist->freeze_count++; - - if (gtk_widget_get_mapped (widget)) - gtk_clist_unmap (widget); - - gtk_widget_set_mapped (widget, FALSE); - - /* detach optional row/cell styles */ - if (gtk_widget_get_realized (widget)) - { - GtkCListRow *clist_row; - GList *list; - gint j; - - list = clist->row_list; - for (i = 0; i < clist->rows; i++) - { - clist_row = list->data; - list = list->next; - - if (clist_row->style) - gtk_style_detach (clist_row->style); - for (j = 0; j < clist->columns; j++) - if (clist_row->cell[j].style) - gtk_style_detach (clist_row->cell[j].style); - } - } - - gdk_cursor_unref (clist->cursor_drag); - g_object_unref (clist->xor_gc); - g_object_unref (clist->fg_gc); - g_object_unref (clist->bg_gc); - - for (i = 0; i < clist->columns; i++) - { - if (clist->column[i].button) - gtk_widget_unrealize (clist->column[i].button); - if (clist->column[i].window) - { - gdk_window_set_user_data (clist->column[i].window, NULL); - gdk_window_destroy (clist->column[i].window); - clist->column[i].window = NULL; - } - } - - gdk_window_set_user_data (clist->clist_window, NULL); - gdk_window_destroy (clist->clist_window); - clist->clist_window = NULL; - - gdk_window_set_user_data (clist->title_window, NULL); - gdk_window_destroy (clist->title_window); - clist->title_window = NULL; - - clist->cursor_drag = NULL; - clist->xor_gc = NULL; - clist->fg_gc = NULL; - clist->bg_gc = NULL; - - GTK_WIDGET_CLASS (parent_class)->unrealize (widget); -} - -static void -gtk_clist_map (GtkWidget *widget) -{ - gint i; - GtkCList *clist; - - g_return_if_fail (GTK_IS_CLIST (widget)); - - clist = GTK_CLIST (widget); - - if (!gtk_widget_get_mapped (widget)) - { - gtk_widget_set_mapped (widget, TRUE); - - /* map column buttons */ - for (i = 0; i < clist->columns; i++) - { - if (clist->column[i].button && - gtk_widget_get_visible (clist->column[i].button) && - !gtk_widget_get_mapped (clist->column[i].button)) - gtk_widget_map (clist->column[i].button); - } - - for (i = 0; i < clist->columns; i++) - if (clist->column[i].window && clist->column[i].button) - { - gdk_window_raise (clist->column[i].window); - gdk_window_show (clist->column[i].window); - } - - gdk_window_show (clist->title_window); - gdk_window_show (clist->clist_window); - gdk_window_show (widget->window); - - /* unfreeze the list */ - clist->freeze_count = 0; - } -} - -static void -gtk_clist_unmap (GtkWidget *widget) -{ - gint i; - GtkCList *clist; - - g_return_if_fail (GTK_IS_CLIST (widget)); - - clist = GTK_CLIST (widget); - - if (gtk_widget_get_mapped (widget)) - { - gtk_widget_set_mapped (widget, FALSE); - - if (clist_has_grab (clist)) - { - remove_grab (clist); - - GTK_CLIST_GET_CLASS (widget)->resync_selection (clist, NULL); - - clist->click_cell.row = -1; - clist->click_cell.column = -1; - clist->drag_button = 0; - - if (GTK_CLIST_IN_DRAG(clist)) - { - gpointer drag_data; - - GTK_CLIST_UNSET_FLAG (clist, CLIST_IN_DRAG); - drag_data = gtk_object_get_data (GTK_OBJECT (clist), - "gtk-site-data"); - if (drag_data) - gtk_signal_handler_unblock_by_data (GTK_OBJECT (clist), - drag_data); - } - } - - for (i = 0; i < clist->columns; i++) - if (clist->column[i].window) - gdk_window_hide (clist->column[i].window); - - gdk_window_hide (clist->clist_window); - gdk_window_hide (clist->title_window); - gdk_window_hide (widget->window); - - /* unmap column buttons */ - for (i = 0; i < clist->columns; i++) - if (clist->column[i].button && - gtk_widget_get_mapped (clist->column[i].button)) - gtk_widget_unmap (clist->column[i].button); - - /* freeze the list */ - clist->freeze_count++; - } -} - -static gint -gtk_clist_expose (GtkWidget *widget, - GdkEventExpose *event) -{ - GtkCList *clist; - - g_return_val_if_fail (GTK_IS_CLIST (widget), FALSE); - g_return_val_if_fail (event != NULL, FALSE); - - if (GTK_WIDGET_DRAWABLE (widget)) - { - clist = GTK_CLIST (widget); - - /* draw border */ - if (event->window == widget->window) - gtk_draw_shadow (widget->style, widget->window, - GTK_STATE_NORMAL, clist->shadow_type, - 0, 0, - clist->clist_window_width + - (2 * widget->style->xthickness), - clist->clist_window_height + - (2 * widget->style->ythickness) + - clist->column_title_area.height); - - /* exposure events on the list */ - if (event->window == clist->clist_window) - draw_rows (clist, &event->area); - - if (event->window == clist->clist_window && - clist->drag_highlight_row >= 0) - GTK_CLIST_GET_CLASS (clist)->draw_drag_highlight - (clist, g_list_nth (clist->row_list, - clist->drag_highlight_row)->data, - clist->drag_highlight_row, clist->drag_highlight_pos); - - if (event->window == clist->title_window) - { - gint i; - - for (i = 0; i < clist->columns; i++) - { - if (clist->column[i].button) - gtk_container_propagate_expose (GTK_CONTAINER (clist), - clist->column[i].button, - event); - } - } - } - - return FALSE; -} - -static void -gtk_clist_style_set (GtkWidget *widget, - GtkStyle *previous_style) -{ - GtkCList *clist = GTK_CLIST (widget); - - GTK_WIDGET_CLASS (parent_class)->style_set (widget, previous_style); - - if (gtk_widget_get_realized (widget)) - { - gtk_style_set_background (widget->style, widget->window, widget->state); - gtk_style_set_background (widget->style, clist->title_window, GTK_STATE_SELECTED); - gdk_window_set_background (clist->clist_window, &widget->style->base[GTK_STATE_NORMAL]); - } - - /* Fill in data after widget has correct style */ - - /* text properties */ - if (!GTK_CLIST_ROW_HEIGHT_SET(clist)) - /* Reset clist->row_height */ - gtk_clist_set_row_height (clist, 0); - - /* Column widths */ - if (!GTK_CLIST_AUTO_RESIZE_BLOCKED (clist)) - { - gint width; - gint i; - - for (i = 0; i < clist->columns; i++) - if (clist->column[i].auto_resize) - { - width = gtk_clist_optimal_column_width (clist, i); - if (width != clist->column[i].width) - gtk_clist_set_column_width (clist, i, width); - } - } -} - -static gint -gtk_clist_button_press (GtkWidget *widget, - GdkEventButton *event) -{ - gint i; - GtkCList *clist; - gint x; - gint y; - gint row; - gint column; - gint button_actions; - - g_return_val_if_fail (GTK_IS_CLIST (widget), FALSE); - g_return_val_if_fail (event != NULL, FALSE); - - clist = GTK_CLIST (widget); - - button_actions = clist->button_actions[event->button - 1]; - - if (button_actions == GTK_BUTTON_IGNORED) - return FALSE; - - /* selections on the list */ - if (event->window == clist->clist_window) - { - x = event->x; - y = event->y; - - if (get_selection_info (clist, x, y, &row, &column)) - { - gint old_row = clist->focus_row; - - if (clist->focus_row == -1) - old_row = row; - - if (event->type == GDK_BUTTON_PRESS) - { - GdkEventMask mask = ((1 << (4 + event->button)) | - GDK_POINTER_MOTION_HINT_MASK | - GDK_BUTTON_RELEASE_MASK); - - if (gdk_pointer_grab (clist->clist_window, FALSE, mask, - NULL, NULL, event->time)) - return FALSE; - gtk_grab_add (widget); - - clist->click_cell.row = row; - clist->click_cell.column = column; - clist->drag_button = event->button; - } - else - { - clist->click_cell.row = -1; - clist->click_cell.column = -1; - - clist->drag_button = 0; - remove_grab (clist); - } - - if (button_actions & GTK_BUTTON_SELECTS) - { - if (GTK_CLIST_ADD_MODE(clist)) - { - GTK_CLIST_UNSET_FLAG (clist, CLIST_ADD_MODE); - if (gtk_widget_has_focus (widget)) - { - gtk_clist_draw_focus (widget); - gdk_gc_set_line_attributes (clist->xor_gc, 1, - GDK_LINE_SOLID, 0, 0); - clist->focus_row = row; - gtk_clist_draw_focus (widget); - } - else - { - gdk_gc_set_line_attributes (clist->xor_gc, 1, - GDK_LINE_SOLID, 0, 0); - clist->focus_row = row; - } - } - else if (row != clist->focus_row) - { - if (gtk_widget_has_focus (widget)) - { - gtk_clist_draw_focus (widget); - clist->focus_row = row; - gtk_clist_draw_focus (widget); - } - else - clist->focus_row = row; - } - } - - if (!gtk_widget_has_focus (widget)) - gtk_widget_grab_focus (widget); - - if (button_actions & GTK_BUTTON_SELECTS) - { - switch (clist->selection_mode) - { - case GTK_SELECTION_SINGLE: - if (event->type != GDK_BUTTON_PRESS) - { - gtk_signal_emit (GTK_OBJECT (clist), - clist_signals[SELECT_ROW], - row, column, event); - clist->anchor = -1; - } - else - clist->anchor = row; - break; - case GTK_SELECTION_BROWSE: - gtk_signal_emit (GTK_OBJECT (clist), - clist_signals[SELECT_ROW], - row, column, event); - break; - case GTK_SELECTION_MULTIPLE: - if (event->type != GDK_BUTTON_PRESS) - { - if (clist->anchor != -1) - { - update_extended_selection (clist, clist->focus_row); - GTK_CLIST_GET_CLASS (clist)->resync_selection - (clist, (GdkEvent *) event); - } - gtk_signal_emit (GTK_OBJECT (clist), - clist_signals[SELECT_ROW], - row, column, event); - break; - } - - if (event->state & GDK_CONTROL_MASK) - { - if (event->state & GDK_SHIFT_MASK) - { - if (clist->anchor < 0) - { - g_list_free (clist->undo_selection); - g_list_free (clist->undo_unselection); - clist->undo_selection = NULL; - clist->undo_unselection = NULL; - clist->anchor = old_row; - clist->drag_pos = old_row; - clist->undo_anchor = old_row; - } - update_extended_selection (clist, clist->focus_row); - } - else - { - if (clist->anchor == -1) - set_anchor (clist, TRUE, row, old_row); - else - update_extended_selection (clist, - clist->focus_row); - } - break; - } - - if (event->state & GDK_SHIFT_MASK) - { - set_anchor (clist, FALSE, old_row, old_row); - update_extended_selection (clist, clist->focus_row); - break; - } - - if (clist->anchor == -1) - set_anchor (clist, FALSE, row, old_row); - else - update_extended_selection (clist, clist->focus_row); - break; - default: - break; - } - } - } - return TRUE; - } - - /* press on resize windows */ - for (i = 0; i < clist->columns; i++) - if (clist->column[i].resizeable && clist->column[i].window && - event->window == clist->column[i].window) - { - gpointer drag_data; - - if (gdk_pointer_grab (clist->column[i].window, FALSE, - GDK_POINTER_MOTION_HINT_MASK | - GDK_BUTTON1_MOTION_MASK | - GDK_BUTTON_RELEASE_MASK, - NULL, NULL, event->time)) - return FALSE; - - gtk_grab_add (widget); - GTK_CLIST_SET_FLAG (clist, CLIST_IN_DRAG); - - /* block attached dnd signal handler */ - drag_data = gtk_object_get_data (GTK_OBJECT (clist), "gtk-site-data"); - if (drag_data) - gtk_signal_handler_block_by_data (GTK_OBJECT (clist), drag_data); - - if (!gtk_widget_has_focus (widget)) - gtk_widget_grab_focus (widget); - - clist->drag_pos = i; - clist->x_drag = (COLUMN_LEFT_XPIXEL(clist, i) + COLUMN_INSET + - clist->column[i].area.width + CELL_SPACING); - - if (GTK_CLIST_ADD_MODE(clist)) - gdk_gc_set_line_attributes (clist->xor_gc, 1, GDK_LINE_SOLID, 0, 0); - draw_xor_line (clist); - - return TRUE; - } - - return FALSE; -} - -static gint -gtk_clist_button_release (GtkWidget *widget, - GdkEventButton *event) -{ - GtkCList *clist; - gint button_actions; - - g_return_val_if_fail (GTK_IS_CLIST (widget), FALSE); - g_return_val_if_fail (event != NULL, FALSE); - - clist = GTK_CLIST (widget); - - button_actions = clist->button_actions[event->button - 1]; - if (button_actions == GTK_BUTTON_IGNORED) - return FALSE; - - /* release on resize windows */ - if (GTK_CLIST_IN_DRAG(clist)) - { - gpointer drag_data; - gint width; - gint x; - gint i; - - i = clist->drag_pos; - clist->drag_pos = -1; - - /* unblock attached dnd signal handler */ - drag_data = gtk_object_get_data (GTK_OBJECT (clist), "gtk-site-data"); - if (drag_data) - gtk_signal_handler_unblock_by_data (GTK_OBJECT (clist), drag_data); - - GTK_CLIST_UNSET_FLAG (clist, CLIST_IN_DRAG); - gtk_widget_get_pointer (widget, &x, NULL); - gtk_grab_remove (widget); - gdk_display_pointer_ungrab (gtk_widget_get_display (widget), event->time); - - if (clist->x_drag >= 0) - draw_xor_line (clist); - - if (GTK_CLIST_ADD_MODE(clist)) - { - gint8 dashes[] = { 4, 4 }; - - gdk_gc_set_line_attributes (clist->xor_gc, 1, - GDK_LINE_ON_OFF_DASH, 0, 0); - gdk_gc_set_dashes (clist->xor_gc, 0, dashes, G_N_ELEMENTS (dashes)); - } - - width = new_column_width (clist, i, &x); - gtk_clist_set_column_width (clist, i, width); - - return TRUE; - } - - if (clist->drag_button == event->button) - { - gint row; - gint column; - - clist->drag_button = 0; - clist->click_cell.row = -1; - clist->click_cell.column = -1; - - remove_grab (clist); - - if (button_actions & GTK_BUTTON_SELECTS) - { - switch (clist->selection_mode) - { - case GTK_SELECTION_MULTIPLE: - if (!(event->state & GDK_SHIFT_MASK) || - !GTK_WIDGET_CAN_FOCUS (widget) || - event->x < 0 || event->x >= clist->clist_window_width || - event->y < 0 || event->y >= clist->clist_window_height) - GTK_CLIST_GET_CLASS (clist)->resync_selection - (clist, (GdkEvent *) event); - break; - case GTK_SELECTION_SINGLE: - if (get_selection_info (clist, event->x, event->y, - &row, &column)) - { - if (row >= 0 && row < clist->rows && clist->anchor == row) - toggle_row (clist, row, column, (GdkEvent *) event); - } - clist->anchor = -1; - break; - default: - break; - } - } - - return TRUE; - } - - return FALSE; -} - -static gint -gtk_clist_motion (GtkWidget *widget, - GdkEventMotion *event) -{ - GtkCList *clist; - gint x; - gint y; - gint row; - gint new_width; - gint button_actions = 0; - - g_return_val_if_fail (GTK_IS_CLIST (widget), FALSE); - - clist = GTK_CLIST (widget); - if (!clist_has_grab (clist)) - return FALSE; - - if (clist->drag_button > 0) - button_actions = clist->button_actions[clist->drag_button - 1]; - - if (GTK_CLIST_IN_DRAG(clist)) - { - if (event->is_hint || event->window != widget->window) - gtk_widget_get_pointer (widget, &x, NULL); - else - x = event->x; - - new_width = new_column_width (clist, clist->drag_pos, &x); - if (x != clist->x_drag) - { - /* x_drag < 0 indicates that the xor line is already invisible */ - if (clist->x_drag >= 0) - draw_xor_line (clist); - - clist->x_drag = x; - - if (clist->x_drag >= 0) - draw_xor_line (clist); - } - - if (new_width <= MAX (COLUMN_MIN_WIDTH + 1, - clist->column[clist->drag_pos].min_width + 1)) - { - if (COLUMN_LEFT_XPIXEL (clist, clist->drag_pos) < 0 && x < 0) - gtk_clist_moveto (clist, -1, clist->drag_pos, 0, 0); - return FALSE; - } - if (clist->column[clist->drag_pos].max_width >= COLUMN_MIN_WIDTH && - new_width >= clist->column[clist->drag_pos].max_width) - { - if (COLUMN_LEFT_XPIXEL (clist, clist->drag_pos) + new_width > - clist->clist_window_width && x < 0) - move_horizontal (clist, - COLUMN_LEFT_XPIXEL (clist, clist->drag_pos) + - new_width - clist->clist_window_width + - COLUMN_INSET + CELL_SPACING); - return FALSE; - } - } - - if (event->is_hint || event->window != clist->clist_window) - gdk_window_get_pointer (clist->clist_window, &x, &y, NULL); - else - { - x = event->x; - y = event->y; - } - - if (GTK_CLIST_REORDERABLE(clist) && button_actions & GTK_BUTTON_DRAGS) - { - /* delayed drag start */ - if (event->window == clist->clist_window && - clist->click_cell.row >= 0 && clist->click_cell.column >= 0 && - (y < 0 || y >= clist->clist_window_height || - x < 0 || x >= clist->clist_window_width || - y < ROW_TOP_YPIXEL (clist, clist->click_cell.row) || - y >= (ROW_TOP_YPIXEL (clist, clist->click_cell.row) + - clist->row_height) || - x < COLUMN_LEFT_XPIXEL (clist, clist->click_cell.column) || - x >= (COLUMN_LEFT_XPIXEL(clist, clist->click_cell.column) + - clist->column[clist->click_cell.column].area.width))) - { - GtkTargetList *target_list; - - target_list = gtk_target_list_new (&clist_target_table, 1); - gtk_drag_begin (widget, target_list, GDK_ACTION_MOVE, - clist->drag_button, (GdkEvent *)event); - - } - return TRUE; - } - - /* horizontal autoscrolling */ - if (clist->hadjustment && LIST_WIDTH (clist) > clist->clist_window_width && - (x < 0 || x >= clist->clist_window_width)) - { - if (clist->htimer) - return FALSE; - - clist->htimer = gdk_threads_add_timeout - (SCROLL_TIME, (GSourceFunc) horizontal_timeout, clist); - - if (!((x < 0 && clist->hadjustment->value == 0) || - (x >= clist->clist_window_width && - clist->hadjustment->value == - LIST_WIDTH (clist) - clist->clist_window_width))) - { - if (x < 0) - move_horizontal (clist, -1 + (x/2)); - else - move_horizontal (clist, 1 + (x - clist->clist_window_width) / 2); - } - } - - if (GTK_CLIST_IN_DRAG(clist)) - return FALSE; - - /* vertical autoscrolling */ - row = ROW_FROM_YPIXEL (clist, y); - - /* don't scroll on last pixel row if it's a cell spacing */ - if (y == clist->clist_window_height - 1 && - y == ROW_TOP_YPIXEL (clist, row-1) + clist->row_height) - return FALSE; - - if (LIST_HEIGHT (clist) > clist->clist_window_height && - (y < 0 || y >= clist->clist_window_height)) - { - if (clist->vtimer) - return FALSE; - - clist->vtimer = gdk_threads_add_timeout (SCROLL_TIME, - (GSourceFunc) vertical_timeout, clist); - - if (clist->drag_button && - ((y < 0 && clist->focus_row == 0) || - (y >= clist->clist_window_height && - clist->focus_row == clist->rows - 1))) - return FALSE; - } - - row = CLAMP (row, 0, clist->rows - 1); - - if (button_actions & GTK_BUTTON_SELECTS & - !gtk_object_get_data (GTK_OBJECT (widget), "gtk-site-data")) - { - if (row == clist->focus_row) - return FALSE; - - gtk_clist_draw_focus (widget); - clist->focus_row = row; - gtk_clist_draw_focus (widget); - - switch (clist->selection_mode) - { - case GTK_SELECTION_BROWSE: - gtk_signal_emit (GTK_OBJECT (clist), clist_signals[SELECT_ROW], - clist->focus_row, -1, event); - break; - case GTK_SELECTION_MULTIPLE: - update_extended_selection (clist, clist->focus_row); - break; - default: - break; - } - } - - if (ROW_TOP_YPIXEL(clist, row) < 0) - move_vertical (clist, row, 0); - else if (ROW_TOP_YPIXEL(clist, row) + clist->row_height > - clist->clist_window_height) - move_vertical (clist, row, 1); - - return FALSE; -} - -static void -gtk_clist_size_request (GtkWidget *widget, - GtkRequisition *requisition) -{ - GtkCList *clist; - gint i; - - g_return_if_fail (GTK_IS_CLIST (widget)); - g_return_if_fail (requisition != NULL); - - clist = GTK_CLIST (widget); - - requisition->width = 0; - requisition->height = 0; - - /* compute the size of the column title (title) area */ - clist->column_title_area.height = 0; - if (GTK_CLIST_SHOW_TITLES(clist)) - for (i = 0; i < clist->columns; i++) - if (clist->column[i].button) - { - GtkRequisition child_requisition; - - gtk_widget_size_request (clist->column[i].button, - &child_requisition); - clist->column_title_area.height = - MAX (clist->column_title_area.height, - child_requisition.height); - } - - requisition->width += (widget->style->xthickness + - GTK_CONTAINER (widget)->border_width) * 2; - requisition->height += (clist->column_title_area.height + - (widget->style->ythickness + - GTK_CONTAINER (widget)->border_width) * 2); - - /* if (!clist->hadjustment) */ - requisition->width += list_requisition_width (clist); - /* if (!clist->vadjustment) */ - requisition->height += LIST_HEIGHT (clist); -} - -static void -gtk_clist_size_allocate (GtkWidget *widget, - GtkAllocation *allocation) -{ - GtkCList *clist; - GtkAllocation clist_allocation; - gint border_width; - - g_return_if_fail (GTK_IS_CLIST (widget)); - g_return_if_fail (allocation != NULL); - - clist = GTK_CLIST (widget); - widget->allocation = *allocation; - border_width = GTK_CONTAINER (widget)->border_width; - - if (gtk_widget_get_realized (widget)) - { - gdk_window_move_resize (widget->window, - allocation->x + border_width, - allocation->y + border_width, - allocation->width - border_width * 2, - allocation->height - border_width * 2); - } - - /* use internal allocation structure for all the math - * because it's easier than always subtracting the container - * border width */ - clist->internal_allocation.x = 0; - clist->internal_allocation.y = 0; - clist->internal_allocation.width = MAX (1, (gint)allocation->width - - border_width * 2); - clist->internal_allocation.height = MAX (1, (gint)allocation->height - - border_width * 2); - - /* allocate clist window assuming no scrollbars */ - clist_allocation.x = (clist->internal_allocation.x + - widget->style->xthickness); - clist_allocation.y = (clist->internal_allocation.y + - widget->style->ythickness + - clist->column_title_area.height); - clist_allocation.width = MAX (1, (gint)clist->internal_allocation.width - - (2 * (gint)widget->style->xthickness)); - clist_allocation.height = MAX (1, (gint)clist->internal_allocation.height - - (2 * (gint)widget->style->ythickness) - - (gint)clist->column_title_area.height); - - clist->clist_window_width = clist_allocation.width; - clist->clist_window_height = clist_allocation.height; - - if (gtk_widget_get_realized (widget)) - { - gdk_window_move_resize (clist->clist_window, - clist_allocation.x, - clist_allocation.y, - clist_allocation.width, - clist_allocation.height); - } - - /* position the window which holds the column title buttons */ - clist->column_title_area.x = widget->style->xthickness; - clist->column_title_area.y = widget->style->ythickness; - clist->column_title_area.width = clist_allocation.width; - - if (gtk_widget_get_realized (widget)) - { - gdk_window_move_resize (clist->title_window, - clist->column_title_area.x, - clist->column_title_area.y, - clist->column_title_area.width, - clist->column_title_area.height); - } - - /* column button allocation */ - size_allocate_columns (clist, FALSE); - size_allocate_title_buttons (clist); - - adjust_adjustments (clist, TRUE); -} - -/* GTKCONTAINER - * gtk_clist_forall - */ -static void -gtk_clist_forall (GtkContainer *container, - gboolean include_internals, - GtkCallback callback, - gpointer callback_data) -{ - GtkCList *clist; - guint i; - - g_return_if_fail (GTK_IS_CLIST (container)); - g_return_if_fail (callback != NULL); - - if (!include_internals) - return; - - clist = GTK_CLIST (container); - - /* callback for the column buttons */ - for (i = 0; i < clist->columns; i++) - if (clist->column[i].button) - (*callback) (clist->column[i].button, callback_data); -} - -/* PRIVATE DRAWING FUNCTIONS - * get_cell_style - * draw_cell_pixmap - * draw_row - * draw_rows - * draw_xor_line - * clist_refresh - */ -static void -get_cell_style (GtkCList *clist, - GtkCListRow *clist_row, - gint state, - gint column, - GtkStyle **style, - GdkGC **fg_gc, - GdkGC **bg_gc) -{ - gint fg_state; - - if ((state == GTK_STATE_NORMAL) && - (GTK_WIDGET (clist)->state == GTK_STATE_INSENSITIVE)) - fg_state = GTK_STATE_INSENSITIVE; - else - fg_state = state; - - if (clist_row->cell[column].style) - { - if (style) - *style = clist_row->cell[column].style; - if (fg_gc) - *fg_gc = clist_row->cell[column].style->fg_gc[fg_state]; - if (bg_gc) { - if (state == GTK_STATE_SELECTED) - *bg_gc = clist_row->cell[column].style->bg_gc[state]; - else - *bg_gc = clist_row->cell[column].style->base_gc[state]; - } - } - else if (clist_row->style) - { - if (style) - *style = clist_row->style; - if (fg_gc) - *fg_gc = clist_row->style->fg_gc[fg_state]; - if (bg_gc) { - if (state == GTK_STATE_SELECTED) - *bg_gc = clist_row->style->bg_gc[state]; - else - *bg_gc = clist_row->style->base_gc[state]; - } - } - else - { - if (style) - *style = GTK_WIDGET (clist)->style; - if (fg_gc) - *fg_gc = GTK_WIDGET (clist)->style->fg_gc[fg_state]; - if (bg_gc) { - if (state == GTK_STATE_SELECTED) - *bg_gc = GTK_WIDGET (clist)->style->bg_gc[state]; - else - *bg_gc = GTK_WIDGET (clist)->style->base_gc[state]; - } - - if (state != GTK_STATE_SELECTED) - { - if (fg_gc && clist_row->fg_set) - *fg_gc = clist->fg_gc; - if (bg_gc && clist_row->bg_set) - *bg_gc = clist->bg_gc; - } - } -} - -static gint -draw_cell_pixmap (GdkWindow *window, - GdkRectangle *clip_rectangle, - GdkGC *fg_gc, - GdkPixmap *pixmap, - GdkBitmap *mask, - gint x, - gint y, - gint width, - gint height) -{ - gint xsrc = 0; - gint ysrc = 0; - - if (mask) - { - gdk_gc_set_clip_mask (fg_gc, mask); - gdk_gc_set_clip_origin (fg_gc, x, y); - } - - if (x < clip_rectangle->x) - { - xsrc = clip_rectangle->x - x; - width -= xsrc; - x = clip_rectangle->x; - } - if (x + width > clip_rectangle->x + clip_rectangle->width) - width = clip_rectangle->x + clip_rectangle->width - x; - - if (y < clip_rectangle->y) - { - ysrc = clip_rectangle->y - y; - height -= ysrc; - y = clip_rectangle->y; - } - if (y + height > clip_rectangle->y + clip_rectangle->height) - height = clip_rectangle->y + clip_rectangle->height - y; - - gdk_draw_drawable (window, fg_gc, pixmap, xsrc, ysrc, x, y, width, height); - gdk_gc_set_clip_origin (fg_gc, 0, 0); - if (mask) - gdk_gc_set_clip_mask (fg_gc, NULL); - - return x + MAX (width, 0); -} - -static void -draw_row (GtkCList *clist, - GdkRectangle *area, - gint row, - GtkCListRow *clist_row) -{ - GtkWidget *widget; - GdkRectangle *rect; - GdkRectangle row_rectangle; - GdkRectangle cell_rectangle; - GdkRectangle clip_rectangle; - GdkRectangle intersect_rectangle; - gint last_column; - gint state; - gint i; - - g_return_if_fail (clist != NULL); - - /* bail now if we arn't drawable yet */ - if (!GTK_WIDGET_DRAWABLE (clist) || row < 0 || row >= clist->rows) - return; - - widget = GTK_WIDGET (clist); - - /* if the function is passed the pointer to the row instead of null, - * it avoids this expensive lookup */ - if (!clist_row) - clist_row = ROW_ELEMENT (clist, row)->data; - - /* rectangle of the entire row */ - row_rectangle.x = 0; - row_rectangle.y = ROW_TOP_YPIXEL (clist, row); - row_rectangle.width = clist->clist_window_width; - row_rectangle.height = clist->row_height; - - /* rectangle of the cell spacing above the row */ - cell_rectangle.x = 0; - cell_rectangle.y = row_rectangle.y - CELL_SPACING; - cell_rectangle.width = row_rectangle.width; - cell_rectangle.height = CELL_SPACING; - - /* rectangle used to clip drawing operations, its y and height - * positions only need to be set once, so we set them once here. - * the x and width are set withing the drawing loop below once per - * column */ - clip_rectangle.y = row_rectangle.y; - clip_rectangle.height = row_rectangle.height; - - if (clist_row->state == GTK_STATE_NORMAL) - { - if (clist_row->fg_set) - gdk_gc_set_foreground (clist->fg_gc, &clist_row->foreground); - if (clist_row->bg_set) - gdk_gc_set_foreground (clist->bg_gc, &clist_row->background); - } - - state = clist_row->state; - - /* draw the cell borders and background */ - if (area) - { - rect = &intersect_rectangle; - if (gdk_rectangle_intersect (area, &cell_rectangle, - &intersect_rectangle)) - gdk_draw_rectangle (clist->clist_window, - widget->style->base_gc[GTK_STATE_NORMAL], - TRUE, - intersect_rectangle.x, - intersect_rectangle.y, - intersect_rectangle.width, - intersect_rectangle.height); - - /* the last row has to clear its bottom cell spacing too */ - if (clist_row == clist->row_list_end->data) - { - cell_rectangle.y += clist->row_height + CELL_SPACING; - - if (gdk_rectangle_intersect (area, &cell_rectangle, - &intersect_rectangle)) - gdk_draw_rectangle (clist->clist_window, - widget->style->base_gc[GTK_STATE_NORMAL], - TRUE, - intersect_rectangle.x, - intersect_rectangle.y, - intersect_rectangle.width, - intersect_rectangle.height); - } - - if (!gdk_rectangle_intersect (area, &row_rectangle,&intersect_rectangle)) - return; - - } - else - { - rect = &clip_rectangle; - gdk_draw_rectangle (clist->clist_window, - widget->style->base_gc[GTK_STATE_NORMAL], - TRUE, - cell_rectangle.x, - cell_rectangle.y, - cell_rectangle.width, - cell_rectangle.height); - - /* the last row has to clear its bottom cell spacing too */ - if (clist_row == clist->row_list_end->data) - { - cell_rectangle.y += clist->row_height + CELL_SPACING; - - gdk_draw_rectangle (clist->clist_window, - widget->style->base_gc[GTK_STATE_NORMAL], - TRUE, - cell_rectangle.x, - cell_rectangle.y, - cell_rectangle.width, - cell_rectangle.height); - } - } - - for (last_column = clist->columns - 1; - last_column >= 0 && !clist->column[last_column].visible; last_column--) - ; - - /* iterate and draw all the columns (row cells) and draw their contents */ - for (i = 0; i < clist->columns; i++) - { - GtkStyle *style; - GdkGC *fg_gc; - GdkGC *bg_gc; - PangoLayout *layout; - PangoRectangle logical_rect; - - gint width; - gint height; - gint pixmap_width; - gint offset = 0; - - if (!clist->column[i].visible) - continue; - - get_cell_style (clist, clist_row, state, i, &style, &fg_gc, &bg_gc); - - clip_rectangle.x = clist->column[i].area.x + clist->hoffset; - clip_rectangle.width = clist->column[i].area.width; - - /* calculate clipping region clipping region */ - clip_rectangle.x -= COLUMN_INSET + CELL_SPACING; - clip_rectangle.width += (2 * COLUMN_INSET + CELL_SPACING + - (i == last_column) * CELL_SPACING); - - if (area && !gdk_rectangle_intersect (area, &clip_rectangle, - &intersect_rectangle)) - continue; - - gdk_draw_rectangle (clist->clist_window, bg_gc, TRUE, - rect->x, rect->y, rect->width, rect->height); - - clip_rectangle.x += COLUMN_INSET + CELL_SPACING; - clip_rectangle.width -= (2 * COLUMN_INSET + CELL_SPACING + - (i == last_column) * CELL_SPACING); - - - /* calculate real width for column justification */ - - layout = _gtk_clist_create_cell_layout (clist, clist_row, i); - if (layout) - { - pango_layout_get_pixel_extents (layout, NULL, &logical_rect); - width = logical_rect.width; - } - else - width = 0; - - pixmap_width = 0; - offset = 0; - switch (clist_row->cell[i].type) - { - case GTK_CELL_PIXMAP: - gdk_drawable_get_size (GTK_CELL_PIXMAP (clist_row->cell[i])->pixmap, - &pixmap_width, &height); - width += pixmap_width; - break; - case GTK_CELL_PIXTEXT: - gdk_drawable_get_size (GTK_CELL_PIXTEXT (clist_row->cell[i])->pixmap, - &pixmap_width, &height); - width += pixmap_width + GTK_CELL_PIXTEXT (clist_row->cell[i])->spacing; - break; - default: - break; - } - - switch (clist->column[i].justification) - { - case GTK_JUSTIFY_LEFT: - offset = clip_rectangle.x + clist_row->cell[i].horizontal; - break; - case GTK_JUSTIFY_RIGHT: - offset = (clip_rectangle.x + clist_row->cell[i].horizontal + - clip_rectangle.width - width); - break; - case GTK_JUSTIFY_CENTER: - case GTK_JUSTIFY_FILL: - offset = (clip_rectangle.x + clist_row->cell[i].horizontal + - (clip_rectangle.width / 2) - (width / 2)); - break; - }; - - /* Draw Text and/or Pixmap */ - switch (clist_row->cell[i].type) - { - case GTK_CELL_PIXMAP: - draw_cell_pixmap (clist->clist_window, &clip_rectangle, fg_gc, - GTK_CELL_PIXMAP (clist_row->cell[i])->pixmap, - GTK_CELL_PIXMAP (clist_row->cell[i])->mask, - offset, - clip_rectangle.y + clist_row->cell[i].vertical + - (clip_rectangle.height - height) / 2, - pixmap_width, height); - break; - case GTK_CELL_PIXTEXT: - offset = - draw_cell_pixmap (clist->clist_window, &clip_rectangle, fg_gc, - GTK_CELL_PIXTEXT (clist_row->cell[i])->pixmap, - GTK_CELL_PIXTEXT (clist_row->cell[i])->mask, - offset, - clip_rectangle.y + clist_row->cell[i].vertical+ - (clip_rectangle.height - height) / 2, - pixmap_width, height); - offset += GTK_CELL_PIXTEXT (clist_row->cell[i])->spacing; - - /* Fall through */ - case GTK_CELL_TEXT: - if (layout) - { - gint row_center_offset = (clist->row_height - logical_rect.height - 1) / 2; - - gdk_gc_set_clip_rectangle (fg_gc, &clip_rectangle); - gdk_draw_layout (clist->clist_window, fg_gc, - offset, - row_rectangle.y + row_center_offset + clist_row->cell[i].vertical, - layout); - g_object_unref (layout); - gdk_gc_set_clip_rectangle (fg_gc, NULL); - } - break; - default: - break; - } - } - - /* draw focus rectangle */ - if (clist->focus_row == row && - GTK_WIDGET_CAN_FOCUS (widget) && gtk_widget_has_focus (widget)) - { - if (!area) - gdk_draw_rectangle (clist->clist_window, clist->xor_gc, FALSE, - row_rectangle.x, row_rectangle.y, - row_rectangle.width - 1, row_rectangle.height - 1); - else if (gdk_rectangle_intersect (area, &row_rectangle, - &intersect_rectangle)) - { - gdk_gc_set_clip_rectangle (clist->xor_gc, &intersect_rectangle); - gdk_draw_rectangle (clist->clist_window, clist->xor_gc, FALSE, - row_rectangle.x, row_rectangle.y, - row_rectangle.width - 1, - row_rectangle.height - 1); - gdk_gc_set_clip_rectangle (clist->xor_gc, NULL); - } - } -} - -static void -draw_rows (GtkCList *clist, - GdkRectangle *area) -{ - GList *list; - GtkCListRow *clist_row; - gint i; - gint first_row; - gint last_row; - - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (clist->row_height == 0 || - !GTK_WIDGET_DRAWABLE (clist)) - return; - - if (area) - { - first_row = ROW_FROM_YPIXEL (clist, area->y); - last_row = ROW_FROM_YPIXEL (clist, area->y + area->height); - } - else - { - first_row = ROW_FROM_YPIXEL (clist, 0); - last_row = ROW_FROM_YPIXEL (clist, clist->clist_window_height); - } - - /* this is a small special case which exposes the bottom cell line - * on the last row -- it might go away if I change the wall the cell - * spacings are drawn - */ - if (clist->rows == first_row) - first_row--; - - list = ROW_ELEMENT (clist, first_row); - i = first_row; - while (list) - { - clist_row = list->data; - list = list->next; - - if (i > last_row) - return; - - GTK_CLIST_GET_CLASS (clist)->draw_row (clist, area, i, clist_row); - i++; - } - - if (!area) - { - int w, h, y; - gdk_drawable_get_size (GDK_DRAWABLE (clist->clist_window), &w, &h); - y = ROW_TOP_YPIXEL (clist, i); - gdk_window_clear_area (clist->clist_window, - 0, y, - w, h - y); - } -} - -static void -draw_xor_line (GtkCList *clist) -{ - GtkWidget *widget; - - g_return_if_fail (clist != NULL); - - widget = GTK_WIDGET (clist); - - gdk_draw_line (widget->window, clist->xor_gc, - clist->x_drag, - widget->style->ythickness, - clist->x_drag, - clist->column_title_area.height + - clist->clist_window_height + 1); -} - -static void -clist_refresh (GtkCList *clist) -{ - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (CLIST_UNFROZEN (clist)) - { - adjust_adjustments (clist, FALSE); - draw_rows (clist, NULL); - } -} - -/* get cell from coordinates - * get_selection_info - * gtk_clist_get_selection_info - */ -static gint -get_selection_info (GtkCList *clist, - gint x, - gint y, - gint *row, - gint *column) -{ - gint trow, tcol; - - g_return_val_if_fail (GTK_IS_CLIST (clist), 0); - - /* bounds checking, return false if the user clicked - * on a blank area */ - trow = ROW_FROM_YPIXEL (clist, y); - if (trow >= clist->rows) - return 0; - - if (row) - *row = trow; - - tcol = COLUMN_FROM_XPIXEL (clist, x); - if (tcol >= clist->columns) - return 0; - - if (column) - *column = tcol; - - return 1; -} - -gint -gtk_clist_get_selection_info (GtkCList *clist, - gint x, - gint y, - gint *row, - gint *column) -{ - g_return_val_if_fail (GTK_IS_CLIST (clist), 0); - return get_selection_info (clist, x, y, row, column); -} - -/* PRIVATE ADJUSTMENT FUNCTIONS - * adjust_adjustments - * vadjustment_changed - * hadjustment_changed - * vadjustment_value_changed - * hadjustment_value_changed - * check_exposures - */ -static void -adjust_adjustments (GtkCList *clist, - gboolean block_resize) -{ - if (clist->vadjustment) - { - clist->vadjustment->page_size = clist->clist_window_height; - clist->vadjustment->step_increment = clist->row_height; - clist->vadjustment->page_increment = - MAX (clist->vadjustment->page_size - clist->vadjustment->step_increment, - clist->vadjustment->page_size / 2); - clist->vadjustment->lower = 0; - clist->vadjustment->upper = LIST_HEIGHT (clist); - - if (clist->clist_window_height - clist->voffset > LIST_HEIGHT (clist) || - (clist->voffset + (gint)clist->vadjustment->value) != 0) - { - clist->vadjustment->value = MAX (0, (LIST_HEIGHT (clist) - - clist->clist_window_height)); - gtk_signal_emit_by_name (GTK_OBJECT (clist->vadjustment), - "value-changed"); - } - gtk_signal_emit_by_name (GTK_OBJECT (clist->vadjustment), "changed"); - } - - if (clist->hadjustment) - { - clist->hadjustment->page_size = clist->clist_window_width; - clist->hadjustment->step_increment = 10; - clist->hadjustment->page_increment = - MAX (clist->hadjustment->page_size - clist->hadjustment->step_increment, - clist->hadjustment->page_size / 2); - clist->hadjustment->lower = 0; - clist->hadjustment->upper = LIST_WIDTH (clist); - - if (clist->clist_window_width - clist->hoffset > LIST_WIDTH (clist) || - (clist->hoffset + (gint)clist->hadjustment->value) != 0) - { - clist->hadjustment->value = MAX (0, (LIST_WIDTH (clist) - - clist->clist_window_width)); - gtk_signal_emit_by_name (GTK_OBJECT (clist->hadjustment), - "value-changed"); - } - gtk_signal_emit_by_name (GTK_OBJECT (clist->hadjustment), "changed"); - } - - if (!block_resize && (!clist->vadjustment || !clist->hadjustment)) - { - GtkWidget *widget; - GtkRequisition requisition; - - widget = GTK_WIDGET (clist); - gtk_widget_size_request (widget, &requisition); - - if ((!clist->hadjustment && - requisition.width != widget->allocation.width) || - (!clist->vadjustment && - requisition.height != widget->allocation.height)) - gtk_widget_queue_resize (widget); - } -} - -static void -vadjustment_changed (GtkAdjustment *adjustment, - gpointer data) -{ - GtkCList *clist; - - g_return_if_fail (adjustment != NULL); - g_return_if_fail (data != NULL); - - clist = GTK_CLIST (data); -} - -static void -hadjustment_changed (GtkAdjustment *adjustment, - gpointer data) -{ - GtkCList *clist; - - g_return_if_fail (adjustment != NULL); - g_return_if_fail (data != NULL); - - clist = GTK_CLIST (data); -} - -static void -vadjustment_value_changed (GtkAdjustment *adjustment, - gpointer data) -{ - GtkCList *clist; - gint dy, value; - - g_return_if_fail (adjustment != NULL); - g_return_if_fail (GTK_IS_CLIST (data)); - - clist = GTK_CLIST (data); - - if (adjustment != clist->vadjustment) - return; - - value = -adjustment->value; - dy = value - clist->voffset; - clist->voffset = value; - - if (GTK_WIDGET_DRAWABLE (clist)) - { - gdk_window_scroll (clist->clist_window, 0, dy); - gdk_window_process_updates (clist->clist_window, FALSE); - } - - return; -} - -typedef struct -{ - GdkWindow *window; - gint dx; -} ScrollData; - -/* The window to which widget->window is relative */ -#define ALLOCATION_WINDOW(widget) \ - (!gtk_widget_get_has_window (widget) ? \ - (widget)->window : \ - gdk_window_get_parent ((widget)->window)) - -static void -adjust_allocation_recurse (GtkWidget *widget, - gpointer data) -{ - ScrollData *scroll_data = data; - - if (!gtk_widget_get_realized (widget)) - { - if (gtk_widget_get_visible (widget)) - { - GdkRectangle tmp_rectangle = widget->allocation; - tmp_rectangle.x += scroll_data->dx; - - gtk_widget_size_allocate (widget, &tmp_rectangle); - } - } - else - { - if (ALLOCATION_WINDOW (widget) == scroll_data->window) - { - widget->allocation.x += scroll_data->dx; - - if (GTK_IS_CONTAINER (widget)) - gtk_container_forall (GTK_CONTAINER (widget), - adjust_allocation_recurse, - data); - } - } -} - -static void -adjust_allocation (GtkWidget *widget, - gint dx) -{ - ScrollData scroll_data; - - if (gtk_widget_get_realized (widget)) - scroll_data.window = ALLOCATION_WINDOW (widget); - else - scroll_data.window = NULL; - - scroll_data.dx = dx; - - adjust_allocation_recurse (widget, &scroll_data); -} - -static void -hadjustment_value_changed (GtkAdjustment *adjustment, - gpointer data) -{ - GtkCList *clist; - GtkContainer *container; - GdkRectangle area; - gint i; - gint y = 0; - gint value; - gint dx; - - g_return_if_fail (adjustment != NULL); - g_return_if_fail (GTK_IS_CLIST (data)); - - clist = GTK_CLIST (data); - container = GTK_CONTAINER (data); - - if (adjustment != clist->hadjustment) - return; - - value = adjustment->value; - - dx = -value - clist->hoffset; - - if (gtk_widget_get_realized (GTK_WIDGET (clist))) - gdk_window_scroll (clist->title_window, dx, 0); - - /* adjust the column button's allocations */ - for (i = 0; i < clist->columns; i++) - if (clist->column[i].button) - adjust_allocation (clist->column[i].button, dx); - - clist->hoffset = -value; - - if (GTK_WIDGET_DRAWABLE (clist)) - { - if (GTK_WIDGET_CAN_FOCUS(clist) && gtk_widget_has_focus (GTK_WIDGET (clist)) && - !container->focus_child && GTK_CLIST_ADD_MODE(clist)) - { - y = ROW_TOP_YPIXEL (clist, clist->focus_row); - - gdk_draw_rectangle (clist->clist_window, clist->xor_gc, FALSE, 0, y, - clist->clist_window_width - 1, - clist->row_height - 1); - } - - gdk_window_scroll (clist->clist_window, dx, 0); - gdk_window_process_updates (clist->clist_window, FALSE); - - if (GTK_WIDGET_CAN_FOCUS(clist) && gtk_widget_has_focus (GTK_WIDGET (clist)) && - !container->focus_child) - { - if (GTK_CLIST_ADD_MODE(clist)) - { - gint focus_row; - - focus_row = clist->focus_row; - clist->focus_row = -1; - draw_rows (clist, &area); - clist->focus_row = focus_row; - - gdk_draw_rectangle (clist->clist_window, clist->xor_gc, - FALSE, 0, y, clist->clist_window_width - 1, - clist->row_height - 1); - return; - } - else if (ABS(dx) < clist->clist_window_width - 1) - { - gint x0; - gint x1; - - if (dx > 0) - { - x0 = clist->clist_window_width - 1; - x1 = dx; - } - else - { - x0 = 0; - x1 = clist->clist_window_width - 1 + dx; - } - - y = ROW_TOP_YPIXEL (clist, clist->focus_row); - gdk_draw_line (clist->clist_window, clist->xor_gc, - x0, y + 1, x0, y + clist->row_height - 2); - gdk_draw_line (clist->clist_window, clist->xor_gc, - x1, y + 1, x1, y + clist->row_height - 2); - } - } - } -} - -/* PRIVATE - * Memory Allocation/Distruction Routines for GtkCList stuctures - * - * functions: - * columns_new - * column_title_new - * columns_delete - * row_new - * row_delete - */ -static GtkCListColumn * -columns_new (GtkCList *clist) -{ - GtkCListColumn *column; - gint i; - - column = g_new (GtkCListColumn, clist->columns); - - for (i = 0; i < clist->columns; i++) - { - column[i].area.x = 0; - column[i].area.y = 0; - column[i].area.width = 0; - column[i].area.height = 0; - column[i].title = NULL; - column[i].button = NULL; - column[i].window = NULL; - column[i].width = 0; - column[i].min_width = -1; - column[i].max_width = -1; - column[i].visible = TRUE; - column[i].width_set = FALSE; - column[i].resizeable = TRUE; - column[i].auto_resize = FALSE; - column[i].button_passive = FALSE; - column[i].justification = GTK_JUSTIFY_LEFT; - } - - return column; -} - -static void -column_title_new (GtkCList *clist, - gint column, - const gchar *title) -{ - g_free (clist->column[column].title); - - clist->column[column].title = g_strdup (title); -} - -static void -columns_delete (GtkCList *clist) -{ - gint i; - - for (i = 0; i < clist->columns; i++) - g_free (clist->column[i].title); - - g_free (clist->column); -} - -static GtkCListRow * -row_new (GtkCList *clist) -{ - int i; - GtkCListRow *clist_row; - - clist_row = g_slice_new (GtkCListRow); - clist_row->cell = g_slice_alloc (sizeof (GtkCell) * clist->columns); - - for (i = 0; i < clist->columns; i++) - { - clist_row->cell[i].type = GTK_CELL_EMPTY; - clist_row->cell[i].vertical = 0; - clist_row->cell[i].horizontal = 0; - clist_row->cell[i].style = NULL; - } - - clist_row->fg_set = FALSE; - clist_row->bg_set = FALSE; - clist_row->style = NULL; - clist_row->selectable = TRUE; - clist_row->state = GTK_STATE_NORMAL; - clist_row->data = NULL; - clist_row->destroy = NULL; - - return clist_row; -} - -static void -row_delete (GtkCList *clist, - GtkCListRow *clist_row) -{ - gint i; - - for (i = 0; i < clist->columns; i++) - { - GTK_CLIST_GET_CLASS (clist)->set_cell_contents - (clist, clist_row, i, GTK_CELL_EMPTY, NULL, 0, NULL, NULL); - if (clist_row->cell[i].style) - { - if (gtk_widget_get_realized (GTK_WIDGET (clist))) - gtk_style_detach (clist_row->cell[i].style); - g_object_unref (clist_row->cell[i].style); - } - } - - if (clist_row->style) - { - if (gtk_widget_get_realized (GTK_WIDGET (clist))) - gtk_style_detach (clist_row->style); - g_object_unref (clist_row->style); - } - - if (clist_row->destroy) - clist_row->destroy (clist_row->data); - - g_slice_free1 (sizeof (GtkCell) * clist->columns, clist_row->cell); - g_slice_free (GtkCListRow, clist_row); -} - -/* FOCUS FUNCTIONS - * gtk_clist_focus_content_area - * gtk_clist_focus - * gtk_clist_draw_focus - * gtk_clist_focus_in - * gtk_clist_focus_out - * title_focus - */ -static void -gtk_clist_focus_content_area (GtkCList *clist) -{ - if (clist->focus_row < 0) - { - clist->focus_row = 0; - - if ((clist->selection_mode == GTK_SELECTION_BROWSE || - clist->selection_mode == GTK_SELECTION_MULTIPLE) && - !clist->selection) - gtk_signal_emit (GTK_OBJECT (clist), - clist_signals[SELECT_ROW], - clist->focus_row, -1, NULL); - } - gtk_widget_grab_focus (GTK_WIDGET (clist)); -} - -static gboolean -gtk_clist_focus (GtkWidget *widget, - GtkDirectionType direction) -{ - GtkCList *clist = GTK_CLIST (widget); - GtkWidget *focus_child; - gboolean is_current_focus; - - if (!gtk_widget_is_sensitive (widget)) - return FALSE; - - focus_child = GTK_CONTAINER (widget)->focus_child; - - is_current_focus = gtk_widget_is_focus (GTK_WIDGET (clist)); - - if (focus_child && - gtk_widget_child_focus (focus_child, direction)) - return TRUE; - - switch (direction) - { - case GTK_DIR_LEFT: - case GTK_DIR_RIGHT: - if (focus_child) - { - if (title_focus_move (clist, direction)) - return TRUE; - } - else if (!is_current_focus) - { - gtk_clist_focus_content_area (clist); - return TRUE; - } - break; - case GTK_DIR_DOWN: - case GTK_DIR_TAB_FORWARD: - if (!focus_child && !is_current_focus) - { - if (title_focus_in (clist, direction)) - return TRUE; - } - - if (!is_current_focus && clist->rows) - { - gtk_clist_focus_content_area (clist); - return TRUE; - } - break; - case GTK_DIR_UP: - case GTK_DIR_TAB_BACKWARD: - if (!focus_child && is_current_focus) - { - if (title_focus_in (clist, direction)) - return TRUE; - } - - if (!is_current_focus && !focus_child && clist->rows) - { - gtk_clist_focus_content_area (clist); - return TRUE; - } - break; - default: - break; - } - - return FALSE; -} - -static void -gtk_clist_set_focus_child (GtkContainer *container, - GtkWidget *child) -{ - GtkCList *clist = GTK_CLIST (container); - gint i; - - for (i = 0; i < clist->columns; i++) - if (clist->column[i].button == child) - clist->focus_header_column = i; - - parent_class->set_focus_child (container, child); -} - -static void -gtk_clist_draw_focus (GtkWidget *widget) -{ - GtkCList *clist; - - g_return_if_fail (GTK_IS_CLIST (widget)); - - if (!GTK_WIDGET_DRAWABLE (widget) || !GTK_WIDGET_CAN_FOCUS (widget)) - return; - - clist = GTK_CLIST (widget); - if (clist->focus_row >= 0) - gdk_draw_rectangle (clist->clist_window, clist->xor_gc, FALSE, - 0, ROW_TOP_YPIXEL(clist, clist->focus_row), - clist->clist_window_width - 1, - clist->row_height - 1); -} - -static gint -gtk_clist_focus_in (GtkWidget *widget, - GdkEventFocus *event) -{ - GtkCList *clist = GTK_CLIST (widget); - - if (clist->selection_mode == GTK_SELECTION_BROWSE && - clist->selection == NULL && clist->focus_row > -1) - { - GList *list; - - list = g_list_nth (clist->row_list, clist->focus_row); - if (list && GTK_CLIST_ROW (list)->selectable) - gtk_signal_emit (GTK_OBJECT (clist), clist_signals[SELECT_ROW], - clist->focus_row, -1, event); - else - gtk_clist_draw_focus (widget); - } - else - gtk_clist_draw_focus (widget); - - return FALSE; -} - -static gint -gtk_clist_focus_out (GtkWidget *widget, - GdkEventFocus *event) -{ - GtkCList *clist = GTK_CLIST (widget); - - gtk_clist_draw_focus (widget); - - GTK_CLIST_GET_CLASS (widget)->resync_selection (clist, (GdkEvent *) event); - - return FALSE; -} - -static gboolean -focus_column (GtkCList *clist, gint column, gint dir) -{ - GtkWidget *child = clist->column[column].button; - - if (gtk_widget_child_focus (child, dir)) - { - return TRUE; - } - else if (GTK_WIDGET_CAN_FOCUS (child)) - { - gtk_widget_grab_focus (child); - return TRUE; - } - - return FALSE; -} - -/* Focus moved onto the headers. Focus first focusable and visible child. - * (FIXME: focus the last focused child if visible) - */ -static gboolean -title_focus_in (GtkCList *clist, gint dir) -{ - gint i; - gint left, right; - - if (!GTK_CLIST_SHOW_TITLES (clist)) - return FALSE; - - /* Check last focused column */ - if (clist->focus_header_column != -1) - { - i = clist->focus_header_column; - - left = COLUMN_LEFT_XPIXEL (clist, i); - right = left + clist->column[i].area.width; - - if (left >= 0 && right <= clist->clist_window_width) - { - if (focus_column (clist, i, dir)) - return TRUE; - } - } - - /* Check fully visible columns */ - for (i = 0 ; i < clist->columns ; i++) - { - left = COLUMN_LEFT_XPIXEL (clist, i); - right = left + clist->column[i].area.width; - - if (left >= 0 && right <= clist->clist_window_width) - { - if (focus_column (clist, i, dir)) - return TRUE; - } - } - - /* Check partially visible columns */ - for (i = 0 ; i < clist->columns ; i++) - { - left = COLUMN_LEFT_XPIXEL (clist, i); - right = left + clist->column[i].area.width; - - if ((left < 0 && right > 0) || - (left < clist->clist_window_width && right > clist->clist_window_width)) - { - if (focus_column (clist, i, dir)) - return TRUE; - } - } - - return FALSE; -} - -/* Move the focus right or left within the title buttons, scrolling - * as necessary to keep the focused child visible. - */ -static gboolean -title_focus_move (GtkCList *clist, - gint dir) -{ - GtkWidget *focus_child; - gboolean return_val = FALSE; - gint d = 0; - gint i = -1; - gint j; - - if (!GTK_CLIST_SHOW_TITLES(clist)) - return FALSE; - - focus_child = GTK_CONTAINER (clist)->focus_child; - g_assert (focus_child); - - /* Movement direction within headers - */ - switch (dir) - { - case GTK_DIR_RIGHT: - d = 1; - break; - case GTK_DIR_LEFT: - d = -1; - break; - } - - for (i = 0; i < clist->columns; i++) - if (clist->column[i].button == focus_child) - break; - - g_assert (i != -1); /* Have a starting column */ - - j = i + d; - while (!return_val && j >= 0 && j < clist->columns) - { - if (clist->column[j].button && - gtk_widget_get_visible (clist->column[j].button)) - { - if (focus_column (clist, j, dir)) - { - return_val = TRUE; - break; - } - } - j += d; - } - - /* If we didn't find it, wrap around and keep looking - */ - if (!return_val) - { - j = d > 0 ? 0 : clist->columns - 1; - - while (!return_val && j != i) - { - if (clist->column[j].button && - gtk_widget_get_visible (clist->column[j].button)) - { - if (focus_column (clist, j, dir)) - { - return_val = TRUE; - break; - } - } - j += d; - } - } - - /* Scroll horizontally so focused column is visible - */ - if (return_val) - { - if (COLUMN_LEFT_XPIXEL (clist, j) < CELL_SPACING + COLUMN_INSET) - gtk_clist_moveto (clist, -1, j, 0, 0); - else if (COLUMN_LEFT_XPIXEL(clist, j) + clist->column[j].area.width > - clist->clist_window_width) - { - gint last_column; - - for (last_column = clist->columns - 1; - last_column >= 0 && !clist->column[last_column].visible; last_column--); - - if (j == last_column) - gtk_clist_moveto (clist, -1, j, 0, 0); - else - gtk_clist_moveto (clist, -1, j, 0, 1); - } - } - return TRUE; /* Even if we didn't find a new one, we can keep the - * focus in the same place. - */ -} - -/* PRIVATE SCROLLING FUNCTIONS - * move_focus_row - * scroll_horizontal - * scroll_vertical - * move_horizontal - * move_vertical - * horizontal_timeout - * vertical_timeout - * remove_grab - */ -static void -move_focus_row (GtkCList *clist, - GtkScrollType scroll_type, - gfloat position) -{ - GtkWidget *widget; - - g_return_if_fail (clist != 0); - g_return_if_fail (GTK_IS_CLIST (clist)); - - widget = GTK_WIDGET (clist); - - switch (scroll_type) - { - case GTK_SCROLL_STEP_UP: - case GTK_SCROLL_STEP_BACKWARD: - if (clist->focus_row <= 0) - return; - gtk_clist_draw_focus (widget); - clist->focus_row--; - gtk_clist_draw_focus (widget); - break; - - case GTK_SCROLL_STEP_DOWN: - case GTK_SCROLL_STEP_FORWARD: - if (clist->focus_row >= clist->rows - 1) - return; - gtk_clist_draw_focus (widget); - clist->focus_row++; - gtk_clist_draw_focus (widget); - break; - case GTK_SCROLL_PAGE_UP: - case GTK_SCROLL_PAGE_BACKWARD: - if (clist->focus_row <= 0) - return; - gtk_clist_draw_focus (widget); - clist->focus_row = MAX (0, clist->focus_row - - (2 * clist->clist_window_height - - clist->row_height - CELL_SPACING) / - (2 * (clist->row_height + CELL_SPACING))); - gtk_clist_draw_focus (widget); - break; - case GTK_SCROLL_PAGE_DOWN: - case GTK_SCROLL_PAGE_FORWARD: - if (clist->focus_row >= clist->rows - 1) - return; - gtk_clist_draw_focus (widget); - clist->focus_row = MIN (clist->rows - 1, clist->focus_row + - (2 * clist->clist_window_height - - clist->row_height - CELL_SPACING) / - (2 * (clist->row_height + CELL_SPACING))); - gtk_clist_draw_focus (widget); - break; - case GTK_SCROLL_JUMP: - if (position >= 0 && position <= 1) - { - gtk_clist_draw_focus (widget); - clist->focus_row = position * (clist->rows - 1); - gtk_clist_draw_focus (widget); - } - break; - default: - break; - } -} - -static void -scroll_horizontal (GtkCList *clist, - GtkScrollType scroll_type, - gfloat position) -{ - gint column = 0; - gint last_column; - - g_return_if_fail (clist != 0); - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (clist_has_grab (clist)) - return; - - for (last_column = clist->columns - 1; - last_column >= 0 && !clist->column[last_column].visible; last_column--) - ; - - switch (scroll_type) - { - case GTK_SCROLL_STEP_BACKWARD: - column = COLUMN_FROM_XPIXEL (clist, 0); - if (COLUMN_LEFT_XPIXEL (clist, column) - CELL_SPACING - COLUMN_INSET >= 0 - && column > 0) - column--; - break; - case GTK_SCROLL_STEP_FORWARD: - column = COLUMN_FROM_XPIXEL (clist, clist->clist_window_width); - if (column < 0) - return; - if (COLUMN_LEFT_XPIXEL (clist, column) + - clist->column[column].area.width + - CELL_SPACING + COLUMN_INSET - 1 <= clist->clist_window_width && - column < last_column) - column++; - break; - case GTK_SCROLL_PAGE_BACKWARD: - case GTK_SCROLL_PAGE_FORWARD: - return; - case GTK_SCROLL_JUMP: - if (position >= 0 && position <= 1) - { - gint vis_columns = 0; - gint i; - - for (i = 0; i <= last_column; i++) - if (clist->column[i].visible) - vis_columns++; - - column = position * vis_columns; - - for (i = 0; i <= last_column && column > 0; i++) - if (clist->column[i].visible) - column--; - - column = i; - } - else - return; - break; - default: - break; - } - - if (COLUMN_LEFT_XPIXEL (clist, column) < CELL_SPACING + COLUMN_INSET) - gtk_clist_moveto (clist, -1, column, 0, 0); - else if (COLUMN_LEFT_XPIXEL (clist, column) + CELL_SPACING + COLUMN_INSET - 1 - + clist->column[column].area.width > clist->clist_window_width) - { - if (column == last_column) - gtk_clist_moveto (clist, -1, column, 0, 0); - else - gtk_clist_moveto (clist, -1, column, 0, 1); - } -} - -static void -scroll_vertical (GtkCList *clist, - GtkScrollType scroll_type, - gfloat position) -{ - gint old_focus_row; - - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (clist_has_grab (clist)) - return; - - switch (clist->selection_mode) - { - case GTK_SELECTION_MULTIPLE: - if (clist->anchor >= 0) - return; - case GTK_SELECTION_BROWSE: - - old_focus_row = clist->focus_row; - move_focus_row (clist, scroll_type, position); - - if (old_focus_row != clist->focus_row) - { - if (clist->selection_mode == GTK_SELECTION_BROWSE) - gtk_signal_emit (GTK_OBJECT (clist), clist_signals[UNSELECT_ROW], - old_focus_row, -1, NULL); - else if (!GTK_CLIST_ADD_MODE(clist)) - { - gtk_clist_unselect_all (clist); - clist->undo_anchor = old_focus_row; - } - } - - switch (gtk_clist_row_is_visible (clist, clist->focus_row)) - { - case GTK_VISIBILITY_NONE: - if (old_focus_row != clist->focus_row && - !(clist->selection_mode == GTK_SELECTION_MULTIPLE && - GTK_CLIST_ADD_MODE(clist))) - gtk_signal_emit (GTK_OBJECT (clist), clist_signals[SELECT_ROW], - clist->focus_row, -1, NULL); - switch (scroll_type) - { - case GTK_SCROLL_PAGE_UP: - case GTK_SCROLL_STEP_UP: - case GTK_SCROLL_STEP_BACKWARD: - case GTK_SCROLL_PAGE_BACKWARD: - gtk_clist_moveto (clist, clist->focus_row, -1, 0, 0); - break; - case GTK_SCROLL_PAGE_DOWN: - case GTK_SCROLL_STEP_DOWN: - case GTK_SCROLL_STEP_FORWARD: - case GTK_SCROLL_PAGE_FORWARD: - gtk_clist_moveto (clist, clist->focus_row, -1, 1, 0); - break; - case GTK_SCROLL_JUMP: - gtk_clist_moveto (clist, clist->focus_row, -1, 0.5, 0); - break; - default: - break; - } - break; - case GTK_VISIBILITY_PARTIAL: - switch (scroll_type) - { - case GTK_SCROLL_STEP_BACKWARD: - case GTK_SCROLL_PAGE_BACKWARD: - gtk_clist_moveto (clist, clist->focus_row, -1, 0, 0); - break; - case GTK_SCROLL_STEP_FORWARD: - case GTK_SCROLL_PAGE_FORWARD: - gtk_clist_moveto (clist, clist->focus_row, -1, 1, 0); - break; - case GTK_SCROLL_JUMP: - gtk_clist_moveto (clist, clist->focus_row, -1, 0.5, 0); - break; - default: - break; - } - default: - if (old_focus_row != clist->focus_row && - !(clist->selection_mode == GTK_SELECTION_MULTIPLE && - GTK_CLIST_ADD_MODE(clist))) - gtk_signal_emit (GTK_OBJECT (clist), clist_signals[SELECT_ROW], - clist->focus_row, -1, NULL); - break; - } - break; - default: - move_focus_row (clist, scroll_type, position); - - if (ROW_TOP_YPIXEL (clist, clist->focus_row) + clist->row_height > - clist->clist_window_height) - gtk_clist_moveto (clist, clist->focus_row, -1, 1, 0); - else if (ROW_TOP_YPIXEL (clist, clist->focus_row) < 0) - gtk_clist_moveto (clist, clist->focus_row, -1, 0, 0); - break; - } -} - -static void -move_horizontal (GtkCList *clist, - gint diff) -{ - gdouble value; - - if (!clist->hadjustment) - return; - - value = CLAMP (clist->hadjustment->value + diff, 0.0, - clist->hadjustment->upper - clist->hadjustment->page_size); - gtk_adjustment_set_value (clist->hadjustment, value); -} - -static void -move_vertical (GtkCList *clist, - gint row, - gfloat align) -{ - gdouble value; - - if (!clist->vadjustment) - return; - - value = (ROW_TOP_YPIXEL (clist, row) - clist->voffset - - align * (clist->clist_window_height - clist->row_height) + - (2 * align - 1) * CELL_SPACING); - - if (value + clist->vadjustment->page_size > clist->vadjustment->upper) - value = clist->vadjustment->upper - clist->vadjustment->page_size; - - gtk_adjustment_set_value (clist->vadjustment, value); -} - -static void -do_fake_motion (GtkWidget *widget) -{ - GdkEvent *event = gdk_event_new (GDK_MOTION_NOTIFY); - - event->motion.send_event = TRUE; - - gtk_clist_motion (widget, (GdkEventMotion *)event); - gdk_event_free (event); -} - -static gint -horizontal_timeout (GtkCList *clist) -{ - clist->htimer = 0; - do_fake_motion (GTK_WIDGET (clist)); - - return FALSE; -} - -static gint -vertical_timeout (GtkCList *clist) -{ - clist->vtimer = 0; - do_fake_motion (GTK_WIDGET (clist)); - - return FALSE; -} - -static void -remove_grab (GtkCList *clist) -{ - GtkWidget *widget = GTK_WIDGET (clist); - - if (GTK_WIDGET_HAS_GRAB (clist)) - { - GdkDisplay *display = gtk_widget_get_display (widget); - - gtk_grab_remove (widget); - if (gdk_display_pointer_is_grabbed (display)) - gdk_display_pointer_ungrab (display, GDK_CURRENT_TIME); - } - - if (clist->htimer) - { - g_source_remove (clist->htimer); - clist->htimer = 0; - } - - if (clist->vtimer) - { - g_source_remove (clist->vtimer); - clist->vtimer = 0; - } -} - -/* PUBLIC SORTING FUNCTIONS - * gtk_clist_sort - * gtk_clist_set_compare_func - * gtk_clist_set_auto_sort - * gtk_clist_set_sort_type - * gtk_clist_set_sort_column - */ -void -gtk_clist_sort (GtkCList *clist) -{ - g_return_if_fail (GTK_IS_CLIST (clist)); - - GTK_CLIST_GET_CLASS (clist)->sort_list (clist); -} - -void -gtk_clist_set_compare_func (GtkCList *clist, - GtkCListCompareFunc cmp_func) -{ - g_return_if_fail (GTK_IS_CLIST (clist)); - - clist->compare = (cmp_func) ? cmp_func : default_compare; -} - -void -gtk_clist_set_auto_sort (GtkCList *clist, - gboolean auto_sort) -{ - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (GTK_CLIST_AUTO_SORT(clist) && !auto_sort) - GTK_CLIST_UNSET_FLAG (clist, CLIST_AUTO_SORT); - else if (!GTK_CLIST_AUTO_SORT(clist) && auto_sort) - { - GTK_CLIST_SET_FLAG (clist, CLIST_AUTO_SORT); - gtk_clist_sort (clist); - } -} - -void -gtk_clist_set_sort_type (GtkCList *clist, - GtkSortType sort_type) -{ - g_return_if_fail (GTK_IS_CLIST (clist)); - - clist->sort_type = sort_type; -} - -void -gtk_clist_set_sort_column (GtkCList *clist, - gint column) -{ - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (column < 0 || column >= clist->columns) - return; - - clist->sort_column = column; -} - -/* PRIVATE SORTING FUNCTIONS - * default_compare - * real_sort_list - * gtk_clist_merge - * gtk_clist_mergesort - */ -static gint -default_compare (GtkCList *clist, - gconstpointer ptr1, - gconstpointer ptr2) -{ - char *text1 = NULL; - char *text2 = NULL; - - GtkCListRow *row1 = (GtkCListRow *) ptr1; - GtkCListRow *row2 = (GtkCListRow *) ptr2; - - switch (row1->cell[clist->sort_column].type) - { - case GTK_CELL_TEXT: - text1 = GTK_CELL_TEXT (row1->cell[clist->sort_column])->text; - break; - case GTK_CELL_PIXTEXT: - text1 = GTK_CELL_PIXTEXT (row1->cell[clist->sort_column])->text; - break; - default: - break; - } - - switch (row2->cell[clist->sort_column].type) - { - case GTK_CELL_TEXT: - text2 = GTK_CELL_TEXT (row2->cell[clist->sort_column])->text; - break; - case GTK_CELL_PIXTEXT: - text2 = GTK_CELL_PIXTEXT (row2->cell[clist->sort_column])->text; - break; - default: - break; - } - - if (!text2) - return (text1 != NULL); - - if (!text1) - return -1; - - return strcmp (text1, text2); -} - -static void -real_sort_list (GtkCList *clist) -{ - GList *list; - GList *work; - gint i; - - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (clist->rows <= 1) - return; - - if (clist_has_grab (clist)) - return; - - gtk_clist_freeze (clist); - - if (clist->anchor != -1 && clist->selection_mode == GTK_SELECTION_MULTIPLE) - { - GTK_CLIST_GET_CLASS (clist)->resync_selection (clist, NULL); - g_list_free (clist->undo_selection); - g_list_free (clist->undo_unselection); - clist->undo_selection = NULL; - clist->undo_unselection = NULL; - } - - clist->row_list = gtk_clist_mergesort (clist, clist->row_list, clist->rows); - - work = clist->selection; - - for (i = 0, list = clist->row_list; i < clist->rows; i++, list = list->next) - { - if (GTK_CLIST_ROW (list)->state == GTK_STATE_SELECTED) - { - work->data = GINT_TO_POINTER (i); - work = work->next; - } - - if (i == clist->rows - 1) - clist->row_list_end = list; - } - - gtk_clist_thaw (clist); -} - -static GList * -gtk_clist_merge (GtkCList *clist, - GList *a, /* first list to merge */ - GList *b) /* second list to merge */ -{ - GList z = { 0 }; /* auxiliary node */ - GList *c; - gint cmp; - - c = &z; - - while (a || b) - { - if (a && !b) - { - c->next = a; - a->prev = c; - c = a; - a = a->next; - break; - } - else if (!a && b) - { - c->next = b; - b->prev = c; - c = b; - b = b->next; - break; - } - else /* a && b */ - { - cmp = clist->compare (clist, GTK_CLIST_ROW (a), GTK_CLIST_ROW (b)); - if ((cmp >= 0 && clist->sort_type == GTK_SORT_DESCENDING) || - (cmp <= 0 && clist->sort_type == GTK_SORT_ASCENDING) || - (a && !b)) - { - c->next = a; - a->prev = c; - c = a; - a = a->next; - } - else - { - c->next = b; - b->prev = c; - c = b; - b = b->next; - } - } - } - - z.next->prev = NULL; - return z.next; -} - -static GList * -gtk_clist_mergesort (GtkCList *clist, - GList *list, /* the list to sort */ - gint num) /* the list's length */ -{ - GList *half; - gint i; - - if (num <= 1) - { - return list; - } - else - { - /* move "half" to the middle */ - half = list; - for (i = 0; i < num / 2; i++) - half = half->next; - - /* cut the list in two */ - half->prev->next = NULL; - half->prev = NULL; - - /* recursively sort both lists */ - return gtk_clist_merge (clist, - gtk_clist_mergesort (clist, list, num / 2), - gtk_clist_mergesort (clist, half, num - num / 2)); - } -} - -/************************/ - -static void -drag_source_info_destroy (gpointer data) -{ - GtkCListCellInfo *info = data; - - g_free (info); -} - -static void -drag_dest_info_destroy (gpointer data) -{ - GtkCListDestInfo *info = data; - - g_free (info); -} - -static void -drag_dest_cell (GtkCList *clist, - gint x, - gint y, - GtkCListDestInfo *dest_info) -{ - GtkWidget *widget; - - widget = GTK_WIDGET (clist); - - dest_info->insert_pos = GTK_CLIST_DRAG_NONE; - - y -= (GTK_CONTAINER (clist)->border_width + - widget->style->ythickness + - clist->column_title_area.height); - - dest_info->cell.row = ROW_FROM_YPIXEL (clist, y); - if (dest_info->cell.row >= clist->rows) - { - dest_info->cell.row = clist->rows - 1; - y = ROW_TOP_YPIXEL (clist, dest_info->cell.row) + clist->row_height; - } - if (dest_info->cell.row < -1) - dest_info->cell.row = -1; - - x -= GTK_CONTAINER (widget)->border_width + widget->style->xthickness; - - dest_info->cell.column = COLUMN_FROM_XPIXEL (clist, x); - - if (dest_info->cell.row >= 0) - { - gint y_delta; - gint h = 0; - - y_delta = y - ROW_TOP_YPIXEL (clist, dest_info->cell.row); - - if (GTK_CLIST_DRAW_DRAG_RECT(clist)) - { - dest_info->insert_pos = GTK_CLIST_DRAG_INTO; - h = clist->row_height / 4; - } - else if (GTK_CLIST_DRAW_DRAG_LINE(clist)) - { - dest_info->insert_pos = GTK_CLIST_DRAG_BEFORE; - h = clist->row_height / 2; - } - - if (GTK_CLIST_DRAW_DRAG_LINE(clist)) - { - if (y_delta < h) - dest_info->insert_pos = GTK_CLIST_DRAG_BEFORE; - else if (clist->row_height - y_delta < h) - dest_info->insert_pos = GTK_CLIST_DRAG_AFTER; - } - } -} - -static void -gtk_clist_drag_begin (GtkWidget *widget, - GdkDragContext *context) -{ - GtkCList *clist; - GtkCListCellInfo *info; - - g_return_if_fail (GTK_IS_CLIST (widget)); - g_return_if_fail (context != NULL); - - clist = GTK_CLIST (widget); - - clist->drag_button = 0; - remove_grab (clist); - - switch (clist->selection_mode) - { - case GTK_SELECTION_MULTIPLE: - update_extended_selection (clist, clist->focus_row); - GTK_CLIST_GET_CLASS (clist)->resync_selection (clist, NULL); - break; - case GTK_SELECTION_SINGLE: - clist->anchor = -1; - case GTK_SELECTION_BROWSE: - break; - default: - g_assert_not_reached (); - } - - info = g_dataset_get_data (context, "gtk-clist-drag-source"); - - if (!info) - { - info = g_new (GtkCListCellInfo, 1); - - if (clist->click_cell.row < 0) - clist->click_cell.row = 0; - else if (clist->click_cell.row >= clist->rows) - clist->click_cell.row = clist->rows - 1; - info->row = clist->click_cell.row; - info->column = clist->click_cell.column; - - g_dataset_set_data_full (context, "gtk-clist-drag-source", info, - drag_source_info_destroy); - } - - if (GTK_CLIST_USE_DRAG_ICONS (clist)) - gtk_drag_set_icon_default (context); -} - -static void -gtk_clist_drag_end (GtkWidget *widget, - GdkDragContext *context) -{ - GtkCList *clist; - - g_return_if_fail (GTK_IS_CLIST (widget)); - g_return_if_fail (context != NULL); - - clist = GTK_CLIST (widget); - - clist->click_cell.row = -1; - clist->click_cell.column = -1; -} - -static void -gtk_clist_drag_leave (GtkWidget *widget, - GdkDragContext *context, - guint time) -{ - GtkCList *clist; - GtkCListDestInfo *dest_info; - - g_return_if_fail (GTK_IS_CLIST (widget)); - g_return_if_fail (context != NULL); - - clist = GTK_CLIST (widget); - - dest_info = g_dataset_get_data (context, "gtk-clist-drag-dest"); - - if (dest_info) - { - if (dest_info->cell.row >= 0 && - GTK_CLIST_REORDERABLE(clist) && - gtk_drag_get_source_widget (context) == widget) - { - GList *list; - GdkAtom atom = gdk_atom_intern_static_string ("gtk-clist-drag-reorder"); - - list = context->targets; - while (list) - { - if (atom == GDK_POINTER_TO_ATOM (list->data)) - { - GTK_CLIST_GET_CLASS (clist)->draw_drag_highlight - (clist, - g_list_nth (clist->row_list, dest_info->cell.row)->data, - dest_info->cell.row, dest_info->insert_pos); - clist->drag_highlight_row = -1; - break; - } - list = list->next; - } - } - g_dataset_remove_data (context, "gtk-clist-drag-dest"); - } -} - -static gint -gtk_clist_drag_motion (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - guint time) -{ - GtkCList *clist; - GtkCListDestInfo new_info; - GtkCListDestInfo *dest_info; - - g_return_val_if_fail (GTK_IS_CLIST (widget), FALSE); - - clist = GTK_CLIST (widget); - - dest_info = g_dataset_get_data (context, "gtk-clist-drag-dest"); - - if (!dest_info) - { - dest_info = g_new (GtkCListDestInfo, 1); - - dest_info->insert_pos = GTK_CLIST_DRAG_NONE; - dest_info->cell.row = -1; - dest_info->cell.column = -1; - - g_dataset_set_data_full (context, "gtk-clist-drag-dest", dest_info, - drag_dest_info_destroy); - } - - drag_dest_cell (clist, x, y, &new_info); - - if (GTK_CLIST_REORDERABLE (clist)) - { - GList *list; - GdkAtom atom = gdk_atom_intern_static_string ("gtk-clist-drag-reorder"); - - list = context->targets; - while (list) - { - if (atom == GDK_POINTER_TO_ATOM (list->data)) - break; - list = list->next; - } - - if (list) - { - if (gtk_drag_get_source_widget (context) != widget || - new_info.insert_pos == GTK_CLIST_DRAG_NONE || - new_info.cell.row == clist->click_cell.row || - (new_info.cell.row == clist->click_cell.row - 1 && - new_info.insert_pos == GTK_CLIST_DRAG_AFTER) || - (new_info.cell.row == clist->click_cell.row + 1 && - new_info.insert_pos == GTK_CLIST_DRAG_BEFORE)) - { - if (dest_info->cell.row < 0) - { - gdk_drag_status (context, GDK_ACTION_DEFAULT, time); - return FALSE; - } - return TRUE; - } - - if (new_info.cell.row != dest_info->cell.row || - (new_info.cell.row == dest_info->cell.row && - dest_info->insert_pos != new_info.insert_pos)) - { - if (dest_info->cell.row >= 0) - GTK_CLIST_GET_CLASS (clist)->draw_drag_highlight - (clist, g_list_nth (clist->row_list, - dest_info->cell.row)->data, - dest_info->cell.row, dest_info->insert_pos); - - dest_info->insert_pos = new_info.insert_pos; - dest_info->cell.row = new_info.cell.row; - dest_info->cell.column = new_info.cell.column; - - GTK_CLIST_GET_CLASS (clist)->draw_drag_highlight - (clist, g_list_nth (clist->row_list, - dest_info->cell.row)->data, - dest_info->cell.row, dest_info->insert_pos); - - clist->drag_highlight_row = dest_info->cell.row; - clist->drag_highlight_pos = dest_info->insert_pos; - - gdk_drag_status (context, context->suggested_action, time); - } - return TRUE; - } - } - - dest_info->insert_pos = new_info.insert_pos; - dest_info->cell.row = new_info.cell.row; - dest_info->cell.column = new_info.cell.column; - return TRUE; -} - -static gboolean -gtk_clist_drag_drop (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - guint time) -{ - g_return_val_if_fail (GTK_IS_CLIST (widget), FALSE); - g_return_val_if_fail (context != NULL, FALSE); - - if (GTK_CLIST_REORDERABLE (widget) && - gtk_drag_get_source_widget (context) == widget) - { - GList *list; - GdkAtom atom = gdk_atom_intern_static_string ("gtk-clist-drag-reorder"); - - list = context->targets; - while (list) - { - if (atom == GDK_POINTER_TO_ATOM (list->data)) - return TRUE; - list = list->next; - } - } - return FALSE; -} - -static void -gtk_clist_drag_data_received (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - GtkSelectionData *selection_data, - guint info, - guint time) -{ - GtkCList *clist; - - g_return_if_fail (GTK_IS_CLIST (widget)); - g_return_if_fail (context != NULL); - g_return_if_fail (selection_data != NULL); - - clist = GTK_CLIST (widget); - - if (GTK_CLIST_REORDERABLE (clist) && - gtk_drag_get_source_widget (context) == widget && - selection_data->target == - gdk_atom_intern_static_string ("gtk-clist-drag-reorder") && - selection_data->format == 8 && - selection_data->length == sizeof (GtkCListCellInfo)) - { - GtkCListCellInfo *source_info; - - source_info = (GtkCListCellInfo *)(selection_data->data); - if (source_info) - { - GtkCListDestInfo dest_info; - - drag_dest_cell (clist, x, y, &dest_info); - - if (dest_info.insert_pos == GTK_CLIST_DRAG_AFTER) - dest_info.cell.row++; - if (source_info->row < dest_info.cell.row) - dest_info.cell.row--; - if (dest_info.cell.row != source_info->row) - gtk_clist_row_move (clist, source_info->row, dest_info.cell.row); - - g_dataset_remove_data (context, "gtk-clist-drag-dest"); - } - } -} - -static void -gtk_clist_drag_data_get (GtkWidget *widget, - GdkDragContext *context, - GtkSelectionData *selection_data, - guint info, - guint time) -{ - g_return_if_fail (GTK_IS_CLIST (widget)); - g_return_if_fail (context != NULL); - g_return_if_fail (selection_data != NULL); - - if (selection_data->target == gdk_atom_intern_static_string ("gtk-clist-drag-reorder")) - { - GtkCListCellInfo *info; - - info = g_dataset_get_data (context, "gtk-clist-drag-source"); - - if (info) - { - GtkCListCellInfo ret_info; - - ret_info.row = info->row; - ret_info.column = info->column; - - gtk_selection_data_set (selection_data, selection_data->target, - 8, (guchar *) &ret_info, - sizeof (GtkCListCellInfo)); - } - } -} - -static void -draw_drag_highlight (GtkCList *clist, - GtkCListRow *dest_row, - gint dest_row_number, - GtkCListDragPos drag_pos) -{ - gint y; - - y = ROW_TOP_YPIXEL (clist, dest_row_number) - 1; - - switch (drag_pos) - { - case GTK_CLIST_DRAG_NONE: - break; - case GTK_CLIST_DRAG_AFTER: - y += clist->row_height + 1; - case GTK_CLIST_DRAG_BEFORE: - gdk_draw_line (clist->clist_window, clist->xor_gc, - 0, y, clist->clist_window_width, y); - break; - case GTK_CLIST_DRAG_INTO: - gdk_draw_rectangle (clist->clist_window, clist->xor_gc, FALSE, 0, y, - clist->clist_window_width - 1, clist->row_height); - break; - } -} - -void -gtk_clist_set_reorderable (GtkCList *clist, - gboolean reorderable) -{ - GtkWidget *widget; - - g_return_if_fail (GTK_IS_CLIST (clist)); - - if ((GTK_CLIST_REORDERABLE(clist) != 0) == reorderable) - return; - - widget = GTK_WIDGET (clist); - - if (reorderable) - { - GTK_CLIST_SET_FLAG (clist, CLIST_REORDERABLE); - gtk_drag_dest_set (widget, - GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_DROP, - &clist_target_table, 1, GDK_ACTION_MOVE); - } - else - { - GTK_CLIST_UNSET_FLAG (clist, CLIST_REORDERABLE); - gtk_drag_dest_unset (GTK_WIDGET (clist)); - } -} - -void -gtk_clist_set_use_drag_icons (GtkCList *clist, - gboolean use_icons) -{ - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (use_icons != 0) - GTK_CLIST_SET_FLAG (clist, CLIST_USE_DRAG_ICONS); - else - GTK_CLIST_UNSET_FLAG (clist, CLIST_USE_DRAG_ICONS); -} - -void -gtk_clist_set_button_actions (GtkCList *clist, - guint button, - guint8 button_actions) -{ - g_return_if_fail (GTK_IS_CLIST (clist)); - - if (button < MAX_BUTTON) - { - if (gdk_display_pointer_is_grabbed (gtk_widget_get_display (GTK_WIDGET (clist))) || - GTK_WIDGET_HAS_GRAB (clist)) - { - remove_grab (clist); - clist->drag_button = 0; - } - - GTK_CLIST_GET_CLASS (clist)->resync_selection (clist, NULL); - - clist->button_actions[button] = button_actions; - } -} - -#include "gtkaliasdef.c" diff --git a/gtk/gtkclist.h b/gtk/gtkclist.h deleted file mode 100644 index d97b5473ee..0000000000 --- a/gtk/gtkclist.h +++ /dev/null @@ -1,792 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball, Josh MacDonald - * Copyright (C) 1997-1998 Jay Painter - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#if !defined (GTK_DISABLE_DEPRECATED) || defined (__GTK_CLIST_C__) || defined (__GTK_CTREE_C__) - -#ifndef __GTK_CLIST_H__ -#define __GTK_CLIST_H__ - - -#include -#include -#include -#include -#include -#include - - -G_BEGIN_DECLS - - -/* clist flags */ -enum { - GTK_CLIST_IN_DRAG = 1 << 0, - GTK_CLIST_ROW_HEIGHT_SET = 1 << 1, - GTK_CLIST_SHOW_TITLES = 1 << 2, - /* Unused */ - GTK_CLIST_ADD_MODE = 1 << 4, - GTK_CLIST_AUTO_SORT = 1 << 5, - GTK_CLIST_AUTO_RESIZE_BLOCKED = 1 << 6, - GTK_CLIST_REORDERABLE = 1 << 7, - GTK_CLIST_USE_DRAG_ICONS = 1 << 8, - GTK_CLIST_DRAW_DRAG_LINE = 1 << 9, - GTK_CLIST_DRAW_DRAG_RECT = 1 << 10 -}; - -/* cell types */ -typedef enum -{ - GTK_CELL_EMPTY, - GTK_CELL_TEXT, - GTK_CELL_PIXMAP, - GTK_CELL_PIXTEXT, - GTK_CELL_WIDGET -} GtkCellType; - -typedef enum -{ - GTK_CLIST_DRAG_NONE, - GTK_CLIST_DRAG_BEFORE, - GTK_CLIST_DRAG_INTO, - GTK_CLIST_DRAG_AFTER -} GtkCListDragPos; - -typedef enum -{ - GTK_BUTTON_IGNORED = 0, - GTK_BUTTON_SELECTS = 1 << 0, - GTK_BUTTON_DRAGS = 1 << 1, - GTK_BUTTON_EXPANDS = 1 << 2 -} GtkButtonAction; - -#define GTK_TYPE_CLIST (gtk_clist_get_type ()) -#define GTK_CLIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CLIST, GtkCList)) -#define GTK_CLIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_CLIST, GtkCListClass)) -#define GTK_IS_CLIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CLIST)) -#define GTK_IS_CLIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CLIST)) -#define GTK_CLIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CLIST, GtkCListClass)) - - -#define GTK_CLIST_FLAGS(clist) (GTK_CLIST (clist)->flags) -#define GTK_CLIST_SET_FLAG(clist,flag) (GTK_CLIST_FLAGS (clist) |= (GTK_ ## flag)) -#define GTK_CLIST_UNSET_FLAG(clist,flag) (GTK_CLIST_FLAGS (clist) &= ~(GTK_ ## flag)) - -#define GTK_CLIST_IN_DRAG(clist) (GTK_CLIST_FLAGS (clist) & GTK_CLIST_IN_DRAG) -#define GTK_CLIST_ROW_HEIGHT_SET(clist) (GTK_CLIST_FLAGS (clist) & GTK_CLIST_ROW_HEIGHT_SET) -#define GTK_CLIST_SHOW_TITLES(clist) (GTK_CLIST_FLAGS (clist) & GTK_CLIST_SHOW_TITLES) -#define GTK_CLIST_ADD_MODE(clist) (GTK_CLIST_FLAGS (clist) & GTK_CLIST_ADD_MODE) -#define GTK_CLIST_AUTO_SORT(clist) (GTK_CLIST_FLAGS (clist) & GTK_CLIST_AUTO_SORT) -#define GTK_CLIST_AUTO_RESIZE_BLOCKED(clist) (GTK_CLIST_FLAGS (clist) & GTK_CLIST_AUTO_RESIZE_BLOCKED) -#define GTK_CLIST_REORDERABLE(clist) (GTK_CLIST_FLAGS (clist) & GTK_CLIST_REORDERABLE) -#define GTK_CLIST_USE_DRAG_ICONS(clist) (GTK_CLIST_FLAGS (clist) & GTK_CLIST_USE_DRAG_ICONS) -#define GTK_CLIST_DRAW_DRAG_LINE(clist) (GTK_CLIST_FLAGS (clist) & GTK_CLIST_DRAW_DRAG_LINE) -#define GTK_CLIST_DRAW_DRAG_RECT(clist) (GTK_CLIST_FLAGS (clist) & GTK_CLIST_DRAW_DRAG_RECT) - -#define GTK_CLIST_ROW(_glist_) ((GtkCListRow *)((_glist_)->data)) - -/* pointer casting for cells */ -#define GTK_CELL_TEXT(cell) (((GtkCellText *) &(cell))) -#define GTK_CELL_PIXMAP(cell) (((GtkCellPixmap *) &(cell))) -#define GTK_CELL_PIXTEXT(cell) (((GtkCellPixText *) &(cell))) -#define GTK_CELL_WIDGET(cell) (((GtkCellWidget *) &(cell))) - -typedef struct _GtkCList GtkCList; -typedef struct _GtkCListClass GtkCListClass; -typedef struct _GtkCListColumn GtkCListColumn; -typedef struct _GtkCListRow GtkCListRow; - -typedef struct _GtkCell GtkCell; -typedef struct _GtkCellText GtkCellText; -typedef struct _GtkCellPixmap GtkCellPixmap; -typedef struct _GtkCellPixText GtkCellPixText; -typedef struct _GtkCellWidget GtkCellWidget; - -typedef gint (*GtkCListCompareFunc) (GtkCList *clist, - gconstpointer ptr1, - gconstpointer ptr2); - -typedef struct _GtkCListCellInfo GtkCListCellInfo; -typedef struct _GtkCListDestInfo GtkCListDestInfo; - -struct _GtkCListCellInfo -{ - gint row; - gint column; -}; - -struct _GtkCListDestInfo -{ - GtkCListCellInfo cell; - GtkCListDragPos insert_pos; -}; - -struct _GtkCList -{ - GtkContainer container; - - guint16 flags; - - gpointer reserved1; - gpointer reserved2; - - guint freeze_count; - - /* allocation rectangle after the container_border_width - * and the width of the shadow border */ - GdkRectangle internal_allocation; - - /* rows */ - gint rows; - gint row_height; - GList *row_list; - GList *row_list_end; - - /* columns */ - gint columns; - GdkRectangle column_title_area; - GdkWindow *title_window; - - /* dynamicly allocated array of column structures */ - GtkCListColumn *column; - - /* the scrolling window and its height and width to - * make things a little speedier */ - GdkWindow *clist_window; - gint clist_window_width; - gint clist_window_height; - - /* offsets for scrolling */ - gint hoffset; - gint voffset; - - /* border shadow style */ - GtkShadowType shadow_type; - - /* the list's selection mode (gtkenums.h) */ - GtkSelectionMode selection_mode; - - /* list of selected rows */ - GList *selection; - GList *selection_end; - - GList *undo_selection; - GList *undo_unselection; - gint undo_anchor; - - /* mouse buttons */ - guint8 button_actions[5]; - - guint8 drag_button; - - /* dnd */ - GtkCListCellInfo click_cell; - - /* scroll adjustments */ - GtkAdjustment *hadjustment; - GtkAdjustment *vadjustment; - - /* xor GC for the vertical drag line */ - GdkGC *xor_gc; - - /* gc for drawing unselected cells */ - GdkGC *fg_gc; - GdkGC *bg_gc; - - /* cursor used to indicate dragging */ - GdkCursor *cursor_drag; - - /* the current x-pixel location of the xor-drag line */ - gint x_drag; - - /* focus handling */ - gint focus_row; - - gint focus_header_column; - - /* dragging the selection */ - gint anchor; - GtkStateType anchor_state; - gint drag_pos; - gint htimer; - gint vtimer; - - GtkSortType sort_type; - GtkCListCompareFunc compare; - gint sort_column; - - gint drag_highlight_row; - GtkCListDragPos drag_highlight_pos; -}; - -struct _GtkCListClass -{ - GtkContainerClass parent_class; - - void (*set_scroll_adjustments) (GtkCList *clist, - GtkAdjustment *hadjustment, - GtkAdjustment *vadjustment); - void (*refresh) (GtkCList *clist); - void (*select_row) (GtkCList *clist, - gint row, - gint column, - GdkEvent *event); - void (*unselect_row) (GtkCList *clist, - gint row, - gint column, - GdkEvent *event); - void (*row_move) (GtkCList *clist, - gint source_row, - gint dest_row); - void (*click_column) (GtkCList *clist, - gint column); - void (*resize_column) (GtkCList *clist, - gint column, - gint width); - void (*toggle_focus_row) (GtkCList *clist); - void (*select_all) (GtkCList *clist); - void (*unselect_all) (GtkCList *clist); - void (*undo_selection) (GtkCList *clist); - void (*start_selection) (GtkCList *clist); - void (*end_selection) (GtkCList *clist); - void (*extend_selection) (GtkCList *clist, - GtkScrollType scroll_type, - gfloat position, - gboolean auto_start_selection); - void (*scroll_horizontal) (GtkCList *clist, - GtkScrollType scroll_type, - gfloat position); - void (*scroll_vertical) (GtkCList *clist, - GtkScrollType scroll_type, - gfloat position); - void (*toggle_add_mode) (GtkCList *clist); - void (*abort_column_resize) (GtkCList *clist); - void (*resync_selection) (GtkCList *clist, - GdkEvent *event); - GList* (*selection_find) (GtkCList *clist, - gint row_number, - GList *row_list_element); - void (*draw_row) (GtkCList *clist, - GdkRectangle *area, - gint row, - GtkCListRow *clist_row); - void (*draw_drag_highlight) (GtkCList *clist, - GtkCListRow *target_row, - gint target_row_number, - GtkCListDragPos drag_pos); - void (*clear) (GtkCList *clist); - void (*fake_unselect_all) (GtkCList *clist, - gint row); - void (*sort_list) (GtkCList *clist); - gint (*insert_row) (GtkCList *clist, - gint row, - gchar *text[]); - void (*remove_row) (GtkCList *clist, - gint row); - void (*set_cell_contents) (GtkCList *clist, - GtkCListRow *clist_row, - gint column, - GtkCellType type, - const gchar *text, - guint8 spacing, - GdkPixmap *pixmap, - GdkBitmap *mask); - void (*cell_size_request) (GtkCList *clist, - GtkCListRow *clist_row, - gint column, - GtkRequisition *requisition); - -}; - -struct _GtkCListColumn -{ - gchar *title; - GdkRectangle area; - - GtkWidget *button; - GdkWindow *window; - - gint width; - gint min_width; - gint max_width; - GtkJustification justification; - - guint visible : 1; - guint width_set : 1; - guint resizeable : 1; - guint auto_resize : 1; - guint button_passive : 1; -}; - -struct _GtkCListRow -{ - GtkCell *cell; - GtkStateType state; - - GdkColor foreground; - GdkColor background; - - GtkStyle *style; - - gpointer data; - GDestroyNotify destroy; - - guint fg_set : 1; - guint bg_set : 1; - guint selectable : 1; -}; - -/* Cell Structures */ -struct _GtkCellText -{ - GtkCellType type; - - gint16 vertical; - gint16 horizontal; - - GtkStyle *style; - - gchar *text; -}; - -struct _GtkCellPixmap -{ - GtkCellType type; - - gint16 vertical; - gint16 horizontal; - - GtkStyle *style; - - GdkPixmap *pixmap; - GdkBitmap *mask; -}; - -struct _GtkCellPixText -{ - GtkCellType type; - - gint16 vertical; - gint16 horizontal; - - GtkStyle *style; - - gchar *text; - guint8 spacing; - GdkPixmap *pixmap; - GdkBitmap *mask; -}; - -struct _GtkCellWidget -{ - GtkCellType type; - - gint16 vertical; - gint16 horizontal; - - GtkStyle *style; - - GtkWidget *widget; -}; - -struct _GtkCell -{ - GtkCellType type; - - gint16 vertical; - gint16 horizontal; - - GtkStyle *style; - - union { - gchar *text; - - struct { - GdkPixmap *pixmap; - GdkBitmap *mask; - } pm; - - struct { - gchar *text; - guint8 spacing; - GdkPixmap *pixmap; - GdkBitmap *mask; - } pt; - - GtkWidget *widget; - } u; -}; - -GType gtk_clist_get_type (void) G_GNUC_CONST; - -/* create a new GtkCList */ -GtkWidget* gtk_clist_new (gint columns); -GtkWidget* gtk_clist_new_with_titles (gint columns, - gchar *titles[]); - -/* set adjustments of clist */ -void gtk_clist_set_hadjustment (GtkCList *clist, - GtkAdjustment *adjustment); -void gtk_clist_set_vadjustment (GtkCList *clist, - GtkAdjustment *adjustment); - -/* get adjustments of clist */ -GtkAdjustment* gtk_clist_get_hadjustment (GtkCList *clist); -GtkAdjustment* gtk_clist_get_vadjustment (GtkCList *clist); - -/* set the border style of the clist */ -void gtk_clist_set_shadow_type (GtkCList *clist, - GtkShadowType type); - -/* set the clist's selection mode */ -void gtk_clist_set_selection_mode (GtkCList *clist, - GtkSelectionMode mode); - -/* enable clists reorder ability */ -void gtk_clist_set_reorderable (GtkCList *clist, - gboolean reorderable); -void gtk_clist_set_use_drag_icons (GtkCList *clist, - gboolean use_icons); -void gtk_clist_set_button_actions (GtkCList *clist, - guint button, - guint8 button_actions); - -/* freeze all visual updates of the list, and then thaw the list after - * you have made a number of changes and the updates wil occure in a - * more efficent mannor than if you made them on a unfrozen list - */ -void gtk_clist_freeze (GtkCList *clist); -void gtk_clist_thaw (GtkCList *clist); - -/* show and hide the column title buttons */ -void gtk_clist_column_titles_show (GtkCList *clist); -void gtk_clist_column_titles_hide (GtkCList *clist); - -/* set the column title to be a active title (responds to button presses, - * prelights, and grabs keyboard focus), or passive where it acts as just - * a title - */ -void gtk_clist_column_title_active (GtkCList *clist, - gint column); -void gtk_clist_column_title_passive (GtkCList *clist, - gint column); -void gtk_clist_column_titles_active (GtkCList *clist); -void gtk_clist_column_titles_passive (GtkCList *clist); - -/* set the title in the column title button */ -void gtk_clist_set_column_title (GtkCList *clist, - gint column, - const gchar *title); - -/* returns the title of column. Returns NULL if title is not set */ -gchar * gtk_clist_get_column_title (GtkCList *clist, - gint column); - -/* set a widget instead of a title for the column title button */ -void gtk_clist_set_column_widget (GtkCList *clist, - gint column, - GtkWidget *widget); - -/* returns the column widget */ -GtkWidget * gtk_clist_get_column_widget (GtkCList *clist, - gint column); - -/* set the justification on a column */ -void gtk_clist_set_column_justification (GtkCList *clist, - gint column, - GtkJustification justification); - -/* set visibility of a column */ -void gtk_clist_set_column_visibility (GtkCList *clist, - gint column, - gboolean visible); - -/* enable/disable column resize operations by mouse */ -void gtk_clist_set_column_resizeable (GtkCList *clist, - gint column, - gboolean resizeable); - -/* resize column automatically to its optimal width */ -void gtk_clist_set_column_auto_resize (GtkCList *clist, - gint column, - gboolean auto_resize); - -gint gtk_clist_columns_autosize (GtkCList *clist); - -/* return the optimal column width, i.e. maximum of all cell widths */ -gint gtk_clist_optimal_column_width (GtkCList *clist, - gint column); - -/* set the pixel width of a column; this is a necessary step in - * creating a CList because otherwise the column width is chozen from - * the width of the column title, which will never be right - */ -void gtk_clist_set_column_width (GtkCList *clist, - gint column, - gint width); - -/* set column minimum/maximum width. min/max_width < 0 => no restriction */ -void gtk_clist_set_column_min_width (GtkCList *clist, - gint column, - gint min_width); -void gtk_clist_set_column_max_width (GtkCList *clist, - gint column, - gint max_width); - -/* change the height of the rows, the default (height=0) is - * the hight of the current font. - */ -void gtk_clist_set_row_height (GtkCList *clist, - guint height); - -/* scroll the viewing area of the list to the given column and row; - * row_align and col_align are between 0-1 representing the location the - * row should appear on the screnn, 0.0 being top or left, 1.0 being - * bottom or right; if row or column is -1 then then there is no change - */ -void gtk_clist_moveto (GtkCList *clist, - gint row, - gint column, - gfloat row_align, - gfloat col_align); - -/* returns whether the row is visible */ -GtkVisibility gtk_clist_row_is_visible (GtkCList *clist, - gint row); - -/* returns the cell type */ -GtkCellType gtk_clist_get_cell_type (GtkCList *clist, - gint row, - gint column); - -/* sets a given cell's text, replacing its current contents */ -void gtk_clist_set_text (GtkCList *clist, - gint row, - gint column, - const gchar *text); - -/* for the "get" functions, any of the return pointer can be - * NULL if you are not interested - */ -gint gtk_clist_get_text (GtkCList *clist, - gint row, - gint column, - gchar **text); - -/* sets a given cell's pixmap, replacing its current contents */ -void gtk_clist_set_pixmap (GtkCList *clist, - gint row, - gint column, - GdkPixmap *pixmap, - GdkBitmap *mask); - -gint gtk_clist_get_pixmap (GtkCList *clist, - gint row, - gint column, - GdkPixmap **pixmap, - GdkBitmap **mask); - -/* sets a given cell's pixmap and text, replacing its current contents */ -void gtk_clist_set_pixtext (GtkCList *clist, - gint row, - gint column, - const gchar *text, - guint8 spacing, - GdkPixmap *pixmap, - GdkBitmap *mask); - -gint gtk_clist_get_pixtext (GtkCList *clist, - gint row, - gint column, - gchar **text, - guint8 *spacing, - GdkPixmap **pixmap, - GdkBitmap **mask); - -/* sets the foreground color of a row, the color must already - * be allocated - */ -void gtk_clist_set_foreground (GtkCList *clist, - gint row, - const GdkColor *color); - -/* sets the background color of a row, the color must already - * be allocated - */ -void gtk_clist_set_background (GtkCList *clist, - gint row, - const GdkColor *color); - -/* set / get cell styles */ -void gtk_clist_set_cell_style (GtkCList *clist, - gint row, - gint column, - GtkStyle *style); - -GtkStyle *gtk_clist_get_cell_style (GtkCList *clist, - gint row, - gint column); - -void gtk_clist_set_row_style (GtkCList *clist, - gint row, - GtkStyle *style); - -GtkStyle *gtk_clist_get_row_style (GtkCList *clist, - gint row); - -/* this sets a horizontal and vertical shift for drawing - * the contents of a cell; it can be positive or negitive; - * this is particulary useful for indenting items in a column - */ -void gtk_clist_set_shift (GtkCList *clist, - gint row, - gint column, - gint vertical, - gint horizontal); - -/* set/get selectable flag of a single row */ -void gtk_clist_set_selectable (GtkCList *clist, - gint row, - gboolean selectable); -gboolean gtk_clist_get_selectable (GtkCList *clist, - gint row); - -/* prepend/append returns the index of the row you just added, - * making it easier to append and modify a row - */ -gint gtk_clist_prepend (GtkCList *clist, - gchar *text[]); -gint gtk_clist_append (GtkCList *clist, - gchar *text[]); - -/* inserts a row at index row and returns the row where it was - * actually inserted (may be different from "row" in auto_sort mode) - */ -gint gtk_clist_insert (GtkCList *clist, - gint row, - gchar *text[]); - -/* removes row at index row */ -void gtk_clist_remove (GtkCList *clist, - gint row); - -/* sets a arbitrary data pointer for a given row */ -void gtk_clist_set_row_data (GtkCList *clist, - gint row, - gpointer data); - -/* sets a data pointer for a given row with destroy notification */ -void gtk_clist_set_row_data_full (GtkCList *clist, - gint row, - gpointer data, - GDestroyNotify destroy); - -/* returns the data set for a row */ -gpointer gtk_clist_get_row_data (GtkCList *clist, - gint row); - -/* givin a data pointer, find the first (and hopefully only!) - * row that points to that data, or -1 if none do - */ -gint gtk_clist_find_row_from_data (GtkCList *clist, - gpointer data); - -/* force selection of a row */ -void gtk_clist_select_row (GtkCList *clist, - gint row, - gint column); - -/* force unselection of a row */ -void gtk_clist_unselect_row (GtkCList *clist, - gint row, - gint column); - -/* undo the last select/unselect operation */ -void gtk_clist_undo_selection (GtkCList *clist); - -/* clear the entire list -- this is much faster than removing - * each item with gtk_clist_remove - */ -void gtk_clist_clear (GtkCList *clist); - -/* return the row column corresponding to the x and y coordinates, - * the returned values are only valid if the x and y coordinates - * are respectively to a window == clist->clist_window - */ -gint gtk_clist_get_selection_info (GtkCList *clist, - gint x, - gint y, - gint *row, - gint *column); - -/* in multiple or extended mode, select all rows */ -void gtk_clist_select_all (GtkCList *clist); - -/* in all modes except browse mode, deselect all rows */ -void gtk_clist_unselect_all (GtkCList *clist); - -/* swap the position of two rows */ -void gtk_clist_swap_rows (GtkCList *clist, - gint row1, - gint row2); - -/* move row from source_row position to dest_row position */ -void gtk_clist_row_move (GtkCList *clist, - gint source_row, - gint dest_row); - -/* sets a compare function different to the default */ -void gtk_clist_set_compare_func (GtkCList *clist, - GtkCListCompareFunc cmp_func); - -/* the column to sort by */ -void gtk_clist_set_sort_column (GtkCList *clist, - gint column); - -/* how to sort : ascending or descending */ -void gtk_clist_set_sort_type (GtkCList *clist, - GtkSortType sort_type); - -/* sort the list with the current compare function */ -void gtk_clist_sort (GtkCList *clist); - -/* Automatically sort upon insertion */ -void gtk_clist_set_auto_sort (GtkCList *clist, - gboolean auto_sort); - -/* Private function for clist, ctree */ - -PangoLayout *_gtk_clist_create_cell_layout (GtkCList *clist, - GtkCListRow *clist_row, - gint column); - - -G_END_DECLS - - -#endif /* __GTK_CLIST_H__ */ - -#endif /* GTK_DISABLE_DEPRECATED */ diff --git a/gtk/gtkcolorbutton.h b/gtk/gtkcolorbutton.h index 21c1460a40..257eb28a42 100644 --- a/gtk/gtkcolorbutton.h +++ b/gtk/gtkcolorbutton.h @@ -29,7 +29,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkcolorsel.c b/gtk/gtkcolorsel.c index d7375c28e2..10ec2724f7 100644 --- a/gtk/gtkcolorsel.c +++ b/gtk/gtkcolorsel.c @@ -149,6 +149,8 @@ struct _ColorSelectionPrivate /* Window for grabbing on */ GtkWidget *dropper_grab_widget; guint32 grab_time; + GdkDevice *keyboard_device; + GdkDevice *pointer_device; /* Connection to settings */ gulong settings_connection; @@ -1631,10 +1633,11 @@ make_picker_cursor (GdkScreen *screen) } static void -grab_color_at_mouse (GdkScreen *screen, - gint x_root, - gint y_root, - gpointer data) +grab_color_at_pointer (GdkScreen *screen, + GdkDevice *device, + gint x_root, + gint y_root, + gpointer data) { GdkImage *image; guint32 pixel; @@ -1651,7 +1654,7 @@ grab_color_at_mouse (GdkScreen *screen, { gint x, y; GdkDisplay *display = gdk_screen_get_display (screen); - GdkWindow *window = gdk_display_get_window_at_pointer (display, &x, &y); + GdkWindow *window = gdk_display_get_window_at_device_position (display, device, &x, &y); if (!window) return; image = gdk_drawable_get_image (window, x, y, 1, 1); @@ -1682,18 +1685,19 @@ shutdown_eyedropper (GtkWidget *widget) { GtkColorSelection *colorsel; ColorSelectionPrivate *priv; - GdkDisplay *display = gtk_widget_get_display (widget); colorsel = GTK_COLOR_SELECTION (widget); - priv = colorsel->private_data; + priv = colorsel->private_data; if (priv->has_grab) { - gdk_display_keyboard_ungrab (display, priv->grab_time); - gdk_display_pointer_ungrab (display, priv->grab_time); - gtk_grab_remove (priv->dropper_grab_widget); + gdk_device_ungrab (priv->keyboard_device, priv->grab_time); + gdk_device_ungrab (priv->pointer_device, priv->grab_time); + gtk_device_grab_remove (priv->dropper_grab_widget, priv->pointer_device); priv->has_grab = FALSE; + priv->keyboard_device = NULL; + priv->pointer_device = NULL; } } @@ -1702,8 +1706,9 @@ mouse_motion (GtkWidget *invisible, GdkEventMotion *event, gpointer data) { - grab_color_at_mouse (gdk_event_get_screen ((GdkEvent *)event), - event->x_root, event->y_root, data); + grab_color_at_pointer (gdk_event_get_screen ((GdkEvent *) event), + gdk_event_get_device ((GdkEvent *) event), + event->x_root, event->y_root, data); } static gboolean @@ -1716,8 +1721,9 @@ mouse_release (GtkWidget *invisible, if (event->button != 1) return FALSE; - grab_color_at_mouse (gdk_event_get_screen ((GdkEvent *)event), - event->x_root, event->y_root, data); + grab_color_at_pointer (gdk_event_get_screen ((GdkEvent *) event), + gdk_event_get_device ((GdkEvent *) event), + event->x_root, event->y_root, data); shutdown_eyedropper (GTK_WIDGET (data)); @@ -1739,12 +1745,15 @@ key_press (GtkWidget *invisible, gpointer data) { GdkDisplay *display = gtk_widget_get_display (invisible); - GdkScreen *screen = gdk_event_get_screen ((GdkEvent *)event); + GdkScreen *screen = gdk_event_get_screen ((GdkEvent *) event); + GdkDevice *device, *pointer_device; guint state = event->state & gtk_accelerator_get_default_mod_mask (); gint x, y; gint dx, dy; - gdk_display_get_pointer (display, NULL, &x, &y, NULL); + device = gdk_event_get_device ((GdkEvent * ) event); + pointer_device = gdk_device_get_associated_device (device); + gdk_display_get_device_state (display, pointer_device, NULL, &x, &y, NULL); dx = 0; dy = 0; @@ -1756,7 +1765,7 @@ key_press (GtkWidget *invisible, case GDK_ISO_Enter: case GDK_KP_Enter: case GDK_KP_Space: - grab_color_at_mouse (screen, x, y, data); + grab_color_at_pointer (screen, pointer_device, x, y, data); /* fall through */ case GDK_Escape: @@ -1797,8 +1806,8 @@ key_press (GtkWidget *invisible, return FALSE; } - gdk_display_warp_pointer (display, screen, x + dx, y + dy); - + gdk_display_warp_device (display, pointer_device, screen, x + dx, y + dy); + return TRUE; } @@ -1838,12 +1847,26 @@ get_screen_color (GtkWidget *button) GtkColorSelection *colorsel = g_object_get_data (G_OBJECT (button), "COLORSEL"); ColorSelectionPrivate *priv = colorsel->private_data; GdkScreen *screen = gtk_widget_get_screen (GTK_WIDGET (button)); + GdkDevice *device, *keyb_device, *pointer_device; GdkCursor *picker_cursor; GdkGrabStatus grab_status; GtkWidget *grab_widget, *toplevel; guint32 time = gtk_get_current_event_time (); - + + device = gtk_get_current_event_device (); + + if (device->source == GDK_SOURCE_KEYBOARD) + { + keyb_device = device; + pointer_device = gdk_device_get_associated_device (device); + } + else + { + pointer_device = device; + keyb_device = gdk_device_get_associated_device (device); + } + if (priv->dropper_grab_widget == NULL) { grab_widget = gtk_window_new (GTK_WINDOW_POPUP); @@ -1867,29 +1890,38 @@ get_screen_color (GtkWidget *button) priv->dropper_grab_widget = grab_widget; } - if (gdk_keyboard_grab (priv->dropper_grab_widget->window, - FALSE, time) != GDK_GRAB_SUCCESS) + if (gdk_device_grab (keyb_device, + priv->dropper_grab_widget->window, + GDK_OWNERSHIP_APPLICATION, FALSE, + GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK, + NULL, time) != GDK_GRAB_SUCCESS) return; - + picker_cursor = make_picker_cursor (screen); - grab_status = gdk_pointer_grab (priv->dropper_grab_widget->window, - FALSE, - GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_PRESS_MASK | GDK_POINTER_MOTION_MASK, - NULL, - picker_cursor, - time); + grab_status = gdk_device_grab (pointer_device, + priv->dropper_grab_widget->window, + GDK_OWNERSHIP_APPLICATION, + FALSE, + GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_PRESS_MASK | GDK_POINTER_MOTION_MASK, + picker_cursor, + time); gdk_cursor_unref (picker_cursor); - + if (grab_status != GDK_GRAB_SUCCESS) { - gdk_display_keyboard_ungrab (gtk_widget_get_display (button), time); + gdk_device_ungrab (keyb_device, time); return; } - gtk_grab_add (priv->dropper_grab_widget); + gtk_device_grab_add (priv->dropper_grab_widget, + pointer_device, + TRUE); + priv->grab_time = time; priv->has_grab = TRUE; - + priv->keyboard_device = keyb_device; + priv->pointer_device = pointer_device; + g_signal_connect (priv->dropper_grab_widget, "button-press-event", G_CALLBACK (mouse_press), colorsel); g_signal_connect (priv->dropper_grab_widget, "key-press-event", @@ -2270,14 +2302,6 @@ gtk_color_selection_new (void) return GTK_WIDGET (colorsel); } - -void -gtk_color_selection_set_update_policy (GtkColorSelection *colorsel, - GtkUpdateType policy) -{ - g_return_if_fail (GTK_IS_COLOR_SELECTION (colorsel)); -} - /** * gtk_color_selection_get_has_opacity_control: * @colorsel: a #GtkColorSelection. @@ -2457,26 +2481,6 @@ gtk_color_selection_set_current_alpha (GtkColorSelection *colorsel, update_color (colorsel); } -/** - * gtk_color_selection_set_color: - * @colorsel: a #GtkColorSelection. - * @color: an array of 4 doubles specifying the red, green, blue and opacity - * to set the current color to. - * - * Sets the current color to be @color. The first time this is called, it will - * also set the original color to be @color too. - * - * Deprecated: 2.0: Use gtk_color_selection_set_current_color() instead. - **/ -void -gtk_color_selection_set_color (GtkColorSelection *colorsel, - gdouble *color) -{ - g_return_if_fail (GTK_IS_COLOR_SELECTION (colorsel)); - - set_color_internal (colorsel, color); -} - /** * gtk_color_selection_get_current_color: * @colorsel: a #GtkColorSelection. @@ -2518,30 +2522,6 @@ gtk_color_selection_get_current_alpha (GtkColorSelection *colorsel) return priv->has_opacity ? UNSCALE (priv->color[COLORSEL_OPACITY]) : 65535; } -/** - * gtk_color_selection_get_color: - * @colorsel: a #GtkColorSelection. - * @color: an array of 4 #gdouble to fill in with the current color. - * - * Sets @color to be the current color in the GtkColorSelection widget. - * - * Deprecated: 2.0: Use gtk_color_selection_get_current_color() instead. - **/ -void -gtk_color_selection_get_color (GtkColorSelection *colorsel, - gdouble *color) -{ - ColorSelectionPrivate *priv; - - g_return_if_fail (GTK_IS_COLOR_SELECTION (colorsel)); - - priv = colorsel->private_data; - color[0] = priv->color[COLORSEL_RED]; - color[1] = priv->color[COLORSEL_GREEN]; - color[2] = priv->color[COLORSEL_BLUE]; - color[3] = priv->has_opacity ? priv->color[COLORSEL_OPACITY] : 65535; -} - /** * gtk_color_selection_set_previous_color: * @colorsel: a #GtkColorSelection. @@ -2830,33 +2810,6 @@ gtk_color_selection_palette_to_string (const GdkColor *colors, return retval; } -/** - * gtk_color_selection_set_change_palette_hook: - * @func: a function to call when the custom palette needs saving. - * - * Installs a global function to be called whenever the user tries to - * modify the palette in a color selection. This function should save - * the new palette contents, and update the GtkSettings property - * "gtk-color-palette" so all GtkColorSelection widgets will be modified. - * - * Return value: the previous change palette hook (that was replaced). - * - * Deprecated: 2.4: This function does not work in multihead environments. - * Use gtk_color_selection_set_change_palette_with_screen_hook() instead. - * - **/ -GtkColorSelectionChangePaletteFunc -gtk_color_selection_set_change_palette_hook (GtkColorSelectionChangePaletteFunc func) -{ - GtkColorSelectionChangePaletteFunc old; - - old = noscreen_change_palette_hook; - - noscreen_change_palette_hook = func; - - return old; -} - /** * gtk_color_selection_set_change_palette_with_screen_hook: * @func: a function to call when the custom palette needs saving. diff --git a/gtk/gtkcolorsel.h b/gtk/gtkcolorsel.h index fedb029588..b99d1266ce 100644 --- a/gtk/gtkcolorsel.h +++ b/gtk/gtkcolorsel.h @@ -25,7 +25,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -112,24 +112,8 @@ gboolean gtk_color_selection_palette_from_string (const gchar *str, gchar* gtk_color_selection_palette_to_string (const GdkColor *colors, gint n_colors); -#ifndef GTK_DISABLE_DEPRECATED -#ifndef GDK_MULTIHEAD_SAFE -GtkColorSelectionChangePaletteFunc gtk_color_selection_set_change_palette_hook (GtkColorSelectionChangePaletteFunc func); -#endif -#endif - GtkColorSelectionChangePaletteWithScreenFunc gtk_color_selection_set_change_palette_with_screen_hook (GtkColorSelectionChangePaletteWithScreenFunc func); -#ifndef GTK_DISABLE_DEPRECATED -/* Deprecated calls: */ -void gtk_color_selection_set_color (GtkColorSelection *colorsel, - gdouble *color); -void gtk_color_selection_get_color (GtkColorSelection *colorsel, - gdouble *color); -void gtk_color_selection_set_update_policy (GtkColorSelection *colorsel, - GtkUpdateType policy); -#endif /* GTK_DISABLE_DEPRECATED */ - G_END_DECLS #endif /* __GTK_COLOR_SELECTION_H__ */ diff --git a/gtk/gtkcolorseldialog.h b/gtk/gtkcolorseldialog.h index 395883693a..dcde2736d8 100644 --- a/gtk/gtkcolorseldialog.h +++ b/gtk/gtkcolorseldialog.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkcombo.c b/gtk/gtkcombo.c deleted file mode 100644 index 69ab413bab..0000000000 --- a/gtk/gtkcombo.c +++ /dev/null @@ -1,1234 +0,0 @@ -/* gtkcombo - combo widget for gtk+ - * Copyright 1997 Paolo Molaro - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -/* Do NOT, I repeat, NOT, copy any of the code in this file. - * The code here relies on all sorts of internal details of GTK+ - */ - -#undef GTK_DISABLE_DEPRECATED - -#include "config.h" -#include - -#include - -#include "gtkarrow.h" -#include "gtklabel.h" -#include "gtklist.h" -#include "gtkentry.h" -#include "gtkeventbox.h" -#include "gtkbutton.h" -#include "gtklistitem.h" -#include "gtkscrolledwindow.h" -#include "gtkmain.h" -#include "gtkwindow.h" -#include "gtkcombo.h" -#include "gtkframe.h" -#include "gtkprivate.h" -#include "gtkintl.h" - -#include "gtkalias.h" - -static const gchar gtk_combo_string_key[] = "gtk-combo-string-value"; - -#define COMBO_LIST_MAX_HEIGHT (400) -#define EMPTY_LIST_HEIGHT (15) - -enum { - PROP_0, - PROP_ENABLE_ARROW_KEYS, - PROP_ENABLE_ARROWS_ALWAYS, - PROP_CASE_SENSITIVE, - PROP_ALLOW_EMPTY, - PROP_VALUE_IN_LIST -}; - -static void gtk_combo_realize (GtkWidget *widget); -static void gtk_combo_unrealize (GtkWidget *widget); -static void gtk_combo_destroy (GtkObject *combo); -static GtkListItem *gtk_combo_find (GtkCombo *combo); -static gchar * gtk_combo_func (GtkListItem *li); -static gboolean gtk_combo_focus_idle (GtkCombo *combo); -static gint gtk_combo_entry_focus_out (GtkEntry *entry, - GdkEventFocus *event, - GtkCombo *combo); -static void gtk_combo_get_pos (GtkCombo *combo, - gint *x, - gint *y, - gint *height, - gint *width); -static void gtk_combo_popup_list (GtkCombo *combo); -static void gtk_combo_popdown_list (GtkCombo *combo); - -static void gtk_combo_activate (GtkWidget *widget, - GtkCombo *combo); -static gboolean gtk_combo_popup_button_press (GtkWidget *button, - GdkEventButton *event, - GtkCombo *combo); -static gboolean gtk_combo_popup_button_leave (GtkWidget *button, - GdkEventCrossing *event, - GtkCombo *combo); -static void gtk_combo_update_entry (GtkCombo *combo); -static void gtk_combo_update_list (GtkEntry *entry, - GtkCombo *combo); -static gint gtk_combo_button_press (GtkWidget *widget, - GdkEvent *event, - GtkCombo *combo); -static void gtk_combo_button_event_after (GtkWidget *widget, - GdkEvent *event, - GtkCombo *combo); -static gint gtk_combo_list_enter (GtkWidget *widget, - GdkEventCrossing *event, - GtkCombo *combo); -static gint gtk_combo_list_key_press (GtkWidget *widget, - GdkEventKey *event, - GtkCombo *combo); -static gint gtk_combo_entry_key_press (GtkEntry *widget, - GdkEventKey *event, - GtkCombo *combo); -static gint gtk_combo_window_key_press (GtkWidget *window, - GdkEventKey *event, - GtkCombo *combo); -static void gtk_combo_size_allocate (GtkWidget *widget, - GtkAllocation *allocation); -static void gtk_combo_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec); -static void gtk_combo_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec); - -G_DEFINE_TYPE (GtkCombo, gtk_combo, GTK_TYPE_HBOX) - -static void -gtk_combo_class_init (GtkComboClass * klass) -{ - GObjectClass *gobject_class; - GtkObjectClass *oclass; - GtkWidgetClass *widget_class; - - gobject_class = (GObjectClass *) klass; - oclass = (GtkObjectClass *) klass; - widget_class = (GtkWidgetClass *) klass; - - gobject_class->set_property = gtk_combo_set_property; - gobject_class->get_property = gtk_combo_get_property; - - g_object_class_install_property (gobject_class, - PROP_ENABLE_ARROW_KEYS, - g_param_spec_boolean ("enable-arrow-keys", - P_("Enable arrow keys"), - P_("Whether the arrow keys move through the list of items"), - TRUE, - GTK_PARAM_READWRITE)); - g_object_class_install_property (gobject_class, - PROP_ENABLE_ARROWS_ALWAYS, - g_param_spec_boolean ("enable-arrows-always", - P_("Always enable arrows"), - P_("Obsolete property, ignored"), - TRUE, - GTK_PARAM_READWRITE)); - g_object_class_install_property (gobject_class, - PROP_CASE_SENSITIVE, - g_param_spec_boolean ("case-sensitive", - P_("Case sensitive"), - P_("Whether list item matching is case sensitive"), - FALSE, - GTK_PARAM_READWRITE)); - - g_object_class_install_property (gobject_class, - PROP_ALLOW_EMPTY, - g_param_spec_boolean ("allow-empty", - P_("Allow empty"), - P_("Whether an empty value may be entered in this field"), - TRUE, - GTK_PARAM_READWRITE)); - - g_object_class_install_property (gobject_class, - PROP_VALUE_IN_LIST, - g_param_spec_boolean ("value-in-list", - P_("Value in list"), - P_("Whether entered values must already be present in the list"), - FALSE, - GTK_PARAM_READWRITE)); - - - oclass->destroy = gtk_combo_destroy; - - widget_class->size_allocate = gtk_combo_size_allocate; - widget_class->realize = gtk_combo_realize; - widget_class->unrealize = gtk_combo_unrealize; -} - -static void -gtk_combo_destroy (GtkObject *object) -{ - GtkCombo *combo = GTK_COMBO (object); - - if (combo->popwin) - { - gtk_widget_destroy (combo->popwin); - g_object_unref (combo->popwin); - combo->popwin = NULL; - } - - GTK_OBJECT_CLASS (gtk_combo_parent_class)->destroy (object); -} - -static int -gtk_combo_entry_key_press (GtkEntry * entry, GdkEventKey * event, GtkCombo * combo) -{ - GList *li; - guint state = event->state & gtk_accelerator_get_default_mod_mask (); - - /* completion */ - if ((event->keyval == GDK_Tab || event->keyval == GDK_KP_Tab) && - state == GDK_MOD1_MASK) - { - GtkEditable *editable = GTK_EDITABLE (entry); - GCompletion * cmpl; - gchar* prefix; - gchar* nprefix = NULL; - gint pos; - - if ( !GTK_LIST (combo->list)->children ) - return FALSE; - - cmpl = g_completion_new ((GCompletionFunc)gtk_combo_func); - g_completion_add_items (cmpl, GTK_LIST (combo->list)->children); - - pos = gtk_editable_get_position (editable); - prefix = gtk_editable_get_chars (editable, 0, pos); - - g_completion_complete_utf8 (cmpl, prefix, &nprefix); - - if (nprefix && strlen (nprefix) > strlen (prefix)) - { - gtk_editable_insert_text (editable, g_utf8_offset_to_pointer (nprefix, pos), - strlen (nprefix) - strlen (prefix), &pos); - gtk_editable_set_position (editable, pos); - } - - g_free (nprefix); - g_free (prefix); - g_completion_free (cmpl); - - return TRUE; - } - - if ((event->keyval == GDK_Down || event->keyval == GDK_KP_Down) && - state == GDK_MOD1_MASK) - { - gtk_combo_activate (NULL, combo); - return TRUE; - } - - if (!combo->use_arrows || !GTK_LIST (combo->list)->children) - return FALSE; - - gtk_combo_update_list (GTK_ENTRY (combo->entry), combo); - li = g_list_find (GTK_LIST (combo->list)->children, gtk_combo_find (combo)); - - if (((event->keyval == GDK_Up || event->keyval == GDK_KP_Up) && state == 0) || - ((event->keyval == 'p' || event->keyval == 'P') && state == GDK_MOD1_MASK)) - { - if (!li) - li = g_list_last (GTK_LIST (combo->list)->children); - else - li = li->prev; - - if (li) - { - gtk_list_select_child (GTK_LIST (combo->list), GTK_WIDGET (li->data)); - gtk_combo_update_entry (combo); - } - - return TRUE; - } - if (((event->keyval == GDK_Down || event->keyval == GDK_KP_Down) && state == 0) || - ((event->keyval == 'n' || event->keyval == 'N') && state == GDK_MOD1_MASK)) - { - if (!li) - li = GTK_LIST (combo->list)->children; - else if (li) - li = li->next; - if (li) - { - gtk_list_select_child (GTK_LIST (combo->list), GTK_WIDGET (li->data)); - gtk_combo_update_entry (combo); - } - - return TRUE; - } - return FALSE; -} - -static int -gtk_combo_window_key_press (GtkWidget *window, - GdkEventKey *event, - GtkCombo *combo) -{ - guint state = event->state & gtk_accelerator_get_default_mod_mask (); - - if ((event->keyval == GDK_Return || - event->keyval == GDK_ISO_Enter || - event->keyval == GDK_KP_Enter) && - state == 0) - { - gtk_combo_popdown_list (combo); - gtk_combo_update_entry (combo); - - return TRUE; - } - else if ((event->keyval == GDK_Up || event->keyval == GDK_KP_Up) && - state == GDK_MOD1_MASK) - { - gtk_combo_popdown_list (combo); - - return TRUE; - } - else if ((event->keyval == GDK_space || event->keyval == GDK_KP_Space) && - state == 0) - { - gtk_combo_update_entry (combo); - } - - return FALSE; -} - -static GtkListItem * -gtk_combo_find (GtkCombo * combo) -{ - const gchar *text; - GtkListItem *found = NULL; - gchar *ltext; - gchar *compare_text; - GList *clist; - - text = gtk_entry_get_text (GTK_ENTRY (combo->entry)); - if (combo->case_sensitive) - compare_text = (gchar *)text; - else - compare_text = g_utf8_casefold (text, -1); - - for (clist = GTK_LIST (combo->list)->children; - !found && clist; - clist = clist->next) - { - ltext = gtk_combo_func (GTK_LIST_ITEM (clist->data)); - if (!ltext) - continue; - - if (!combo->case_sensitive) - ltext = g_utf8_casefold (ltext, -1); - - if (strcmp (ltext, compare_text) == 0) - found = clist->data; - - if (!combo->case_sensitive) - g_free (ltext); - } - - if (!combo->case_sensitive) - g_free (compare_text); - - return found; -} - -static gchar * -gtk_combo_func (GtkListItem * li) -{ - GtkWidget *label; - gchar *ltext = NULL; - - ltext = g_object_get_data (G_OBJECT (li), I_(gtk_combo_string_key)); - if (!ltext) - { - label = GTK_BIN (li)->child; - if (!label || !GTK_IS_LABEL (label)) - return NULL; - ltext = (gchar *) gtk_label_get_text (GTK_LABEL (label)); - } - return ltext; -} - -static gint -gtk_combo_focus_idle (GtkCombo * combo) -{ - if (combo) - { - GDK_THREADS_ENTER (); - gtk_widget_grab_focus (combo->entry); - GDK_THREADS_LEAVE (); - } - return FALSE; -} - -static gint -gtk_combo_entry_focus_out (GtkEntry * entry, GdkEventFocus * event, GtkCombo * combo) -{ - - if (combo->value_in_list && !gtk_combo_find (combo)) - { - GSource *focus_idle; - - /* gdk_beep(); *//* this can be annoying */ - if (combo->ok_if_empty && !strcmp (gtk_entry_get_text (entry), "")) - return FALSE; -#ifdef TEST - printf ("INVALID ENTRY: `%s'\n", gtk_entry_get_text (entry)); -#endif - gtk_grab_add (GTK_WIDGET (combo)); - /* this is needed because if we call gtk_widget_grab_focus() - it isn't guaranteed it's the *last* call before the main-loop, - so the focus can be lost anyway... - the signal_stop_emission doesn't seem to work either... - */ - focus_idle = g_idle_source_new (); - g_source_set_closure (focus_idle, - g_cclosure_new_object (G_CALLBACK (gtk_combo_focus_idle), - G_OBJECT (combo))); - g_source_attach (focus_idle, NULL); - g_source_unref (focus_idle); - - /*g_signal_stop_emission_by_name (entry, "focus_out_event"); */ - return TRUE; - } - return FALSE; -} - -static void -gtk_combo_get_pos (GtkCombo * combo, gint * x, gint * y, gint * height, gint * width) -{ - GtkBin *popwin; - GtkWidget *widget; - GtkScrolledWindow *popup; - - gint real_height; - GtkRequisition list_requisition; - gboolean show_hscroll = FALSE; - gboolean show_vscroll = FALSE; - gint avail_height; - gint min_height; - gint alloc_width; - gint work_height; - gint old_height; - gint old_width; - gint scrollbar_spacing; - - widget = GTK_WIDGET (combo); - popup = GTK_SCROLLED_WINDOW (combo->popup); - popwin = GTK_BIN (combo->popwin); - - scrollbar_spacing = _gtk_scrolled_window_get_scrollbar_spacing (popup); - - gdk_window_get_origin (combo->entry->window, x, y); - if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) - *x -= widget->allocation.width - combo->entry->allocation.width; - real_height = MIN (combo->entry->requisition.height, - combo->entry->allocation.height); - *y += real_height; - avail_height = gdk_screen_get_height (gtk_widget_get_screen (widget)) - *y; - - gtk_widget_size_request (combo->list, &list_requisition); - min_height = MIN (list_requisition.height, - popup->vscrollbar->requisition.height); - if (!GTK_LIST (combo->list)->children) - list_requisition.height += EMPTY_LIST_HEIGHT; - - alloc_width = (widget->allocation.width - - 2 * popwin->child->style->xthickness - - 2 * GTK_CONTAINER (popwin->child)->border_width - - 2 * GTK_CONTAINER (combo->popup)->border_width - - 2 * GTK_CONTAINER (GTK_BIN (popup)->child)->border_width - - 2 * GTK_BIN (popup)->child->style->xthickness); - - work_height = (2 * popwin->child->style->ythickness + - 2 * GTK_CONTAINER (popwin->child)->border_width + - 2 * GTK_CONTAINER (combo->popup)->border_width + - 2 * GTK_CONTAINER (GTK_BIN (popup)->child)->border_width + - 2 * GTK_BIN (popup)->child->style->ythickness); - - do - { - old_width = alloc_width; - old_height = work_height; - - if (!show_hscroll && - alloc_width < list_requisition.width) - { - GtkRequisition requisition; - - gtk_widget_size_request (popup->hscrollbar, &requisition); - work_height += (requisition.height + scrollbar_spacing); - - show_hscroll = TRUE; - } - if (!show_vscroll && - work_height + list_requisition.height > avail_height) - { - GtkRequisition requisition; - - if (work_height + min_height > avail_height && - *y - real_height > avail_height) - { - *y -= (work_height + list_requisition.height + real_height); - break; - } - gtk_widget_size_request (popup->hscrollbar, &requisition); - alloc_width -= (requisition.width + scrollbar_spacing); - show_vscroll = TRUE; - } - } while (old_width != alloc_width || old_height != work_height); - - *width = widget->allocation.width; - if (show_vscroll) - *height = avail_height; - else - *height = work_height + list_requisition.height; - - if (*x < 0) - *x = 0; -} - -static void -gtk_combo_popup_list (GtkCombo *combo) -{ - GtkWidget *toplevel; - GtkList *list; - gint height, width, x, y; - gint old_width, old_height; - - old_width = combo->popwin->allocation.width; - old_height = combo->popwin->allocation.height; - - gtk_combo_get_pos (combo, &x, &y, &height, &width); - - /* workaround for gtk_scrolled_window_size_allocate bug */ - if (old_width != width || old_height != height) - { - gtk_widget_hide (GTK_SCROLLED_WINDOW (combo->popup)->hscrollbar); - gtk_widget_hide (GTK_SCROLLED_WINDOW (combo->popup)->vscrollbar); - } - - gtk_combo_update_list (GTK_ENTRY (combo->entry), combo); - - /* We need to make sure some child of combo->popwin - * is focused to disable GtkWindow's automatic - * "focus-the-first-item" code. If there is no selected - * child, we focus the list itself with some hackery. - */ - list = GTK_LIST (combo->list); - - if (list->selection) - { - gtk_widget_grab_focus (list->selection->data); - } - else - { - gtk_widget_set_can_focus (GTK_WIDGET (list), TRUE); - gtk_widget_grab_focus (combo->list); - GTK_LIST (combo->list)->last_focus_child = NULL; - gtk_widget_set_can_focus (GTK_WIDGET (list), FALSE); - } - - gtk_window_move (GTK_WINDOW (combo->popwin), x, y); - - toplevel = gtk_widget_get_toplevel (GTK_WIDGET (combo)); - - if (GTK_IS_WINDOW (toplevel)) - { - gtk_window_group_add_window (gtk_window_get_group (GTK_WINDOW (toplevel)), - GTK_WINDOW (combo->popwin)); - gtk_window_set_transient_for (GTK_WINDOW (combo->popwin), GTK_WINDOW (toplevel)); - } - - gtk_widget_set_size_request (combo->popwin, width, height); - gtk_widget_show (combo->popwin); - - gtk_widget_grab_focus (combo->popwin); -} - -static void -gtk_combo_popdown_list (GtkCombo *combo) -{ - combo->current_button = 0; - - if (GTK_BUTTON (combo->button)->in_button) - { - GTK_BUTTON (combo->button)->in_button = FALSE; - g_signal_emit_by_name (combo->button, "released"); - } - - if (GTK_WIDGET_HAS_GRAB (combo->popwin)) - { - gtk_grab_remove (combo->popwin); - gdk_display_pointer_ungrab (gtk_widget_get_display (GTK_WIDGET (combo)), - gtk_get_current_event_time ()); - gdk_display_keyboard_ungrab (gtk_widget_get_display (GTK_WIDGET (combo)), - gtk_get_current_event_time ()); - } - - gtk_widget_hide (combo->popwin); - - gtk_window_group_add_window (gtk_window_get_group (NULL), GTK_WINDOW (combo->popwin)); -} - -static gboolean -popup_grab_on_window (GdkWindow *window, - guint32 activate_time) -{ - if ((gdk_pointer_grab (window, TRUE, - GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | - GDK_POINTER_MOTION_MASK, - NULL, NULL, activate_time) == 0)) - { - if (gdk_keyboard_grab (window, TRUE, - activate_time) == 0) - return TRUE; - else - { - gdk_display_pointer_ungrab (gdk_drawable_get_display (window), - activate_time); - return FALSE; - } - } - - return FALSE; -} - -static void -gtk_combo_activate (GtkWidget *widget, - GtkCombo *combo) -{ - if (!combo->button->window || - !popup_grab_on_window (combo->button->window, - gtk_get_current_event_time ())) - return; - - gtk_combo_popup_list (combo); - - /* This must succeed since we already have the grab */ - popup_grab_on_window (combo->popwin->window, - gtk_get_current_event_time ()); - - if (!gtk_widget_has_focus (combo->entry)) - gtk_widget_grab_focus (combo->entry); - - gtk_grab_add (combo->popwin); -} - -static gboolean -gtk_combo_popup_button_press (GtkWidget *button, - GdkEventButton *event, - GtkCombo *combo) -{ - if (!gtk_widget_has_focus (combo->entry)) - gtk_widget_grab_focus (combo->entry); - - if (event->button != 1) - return FALSE; - - if (!popup_grab_on_window (combo->button->window, - gtk_get_current_event_time ())) - return FALSE; - - combo->current_button = event->button; - - gtk_combo_popup_list (combo); - - /* This must succeed since we already have the grab */ - popup_grab_on_window (combo->popwin->window, - gtk_get_current_event_time ()); - - g_signal_emit_by_name (button, "depressed"); - - gtk_grab_add (combo->popwin); - - return TRUE; -} - -static gboolean -gtk_combo_popup_button_leave (GtkWidget *button, - GdkEventCrossing *event, - GtkCombo *combo) -{ - /* The idea here is that we want to keep the button down if the - * popup is popped up. - */ - return combo->current_button != 0; -} - -static void -gtk_combo_update_entry (GtkCombo * combo) -{ - GtkList *list = GTK_LIST (combo->list); - char *text; - - g_signal_handler_block (list, combo->list_change_id); - if (list->selection) - { - text = gtk_combo_func (GTK_LIST_ITEM (list->selection->data)); - if (!text) - text = ""; - gtk_entry_set_text (GTK_ENTRY (combo->entry), text); - } - g_signal_handler_unblock (list, combo->list_change_id); -} - -static void -gtk_combo_selection_changed (GtkList *list, - GtkCombo *combo) -{ - if (!gtk_widget_get_visible (combo->popwin)) - gtk_combo_update_entry (combo); -} - -static void -gtk_combo_update_list (GtkEntry * entry, GtkCombo * combo) -{ - GtkList *list = GTK_LIST (combo->list); - GList *slist = list->selection; - GtkListItem *li; - - gtk_grab_remove (GTK_WIDGET (combo)); - - g_signal_handler_block (entry, combo->entry_change_id); - if (slist && slist->data) - gtk_list_unselect_child (list, GTK_WIDGET (slist->data)); - li = gtk_combo_find (combo); - if (li) - gtk_list_select_child (list, GTK_WIDGET (li)); - g_signal_handler_unblock (entry, combo->entry_change_id); -} - -static gint -gtk_combo_button_press (GtkWidget * widget, GdkEvent * event, GtkCombo * combo) -{ - GtkWidget *child; - - child = gtk_get_event_widget (event); - - /* We don't ask for button press events on the grab widget, so - * if an event is reported directly to the grab widget, it must - * be on a window outside the application (and thus we remove - * the popup window). Otherwise, we check if the widget is a child - * of the grab widget, and only remove the popup window if it - * is not. - */ - if (child != widget) - { - while (child) - { - if (child == widget) - return FALSE; - child = child->parent; - } - } - - gtk_combo_popdown_list (combo); - - return TRUE; -} - -static gboolean -is_within (GtkWidget *widget, - GtkWidget *ancestor) -{ - return widget == ancestor || gtk_widget_is_ancestor (widget, ancestor); -} - -static void -gtk_combo_button_event_after (GtkWidget *widget, - GdkEvent *event, - GtkCombo *combo) -{ - GtkWidget *child; - - if (event->type != GDK_BUTTON_RELEASE) - return; - - child = gtk_get_event_widget ((GdkEvent*) event); - - if ((combo->current_button != 0) && (event->button.button == 1)) - { - /* This was the initial button press */ - - combo->current_button = 0; - - /* Check to see if we released inside the button */ - if (child && is_within (child, combo->button)) - { - gtk_grab_add (combo->popwin); - gdk_pointer_grab (combo->popwin->window, TRUE, - GDK_BUTTON_PRESS_MASK | - GDK_BUTTON_RELEASE_MASK | - GDK_POINTER_MOTION_MASK, - NULL, NULL, GDK_CURRENT_TIME); - return; - } - } - - if (is_within (child, combo->list)) - gtk_combo_update_entry (combo); - - gtk_combo_popdown_list (combo); - -} - -static void -find_child_foreach (GtkWidget *widget, - gpointer data) -{ - GdkEventButton *event = data; - - if (!event->window) - { - if (event->x >= widget->allocation.x && - event->x < widget->allocation.x + widget->allocation.width && - event->y >= widget->allocation.y && - event->y < widget->allocation.y + widget->allocation.height) - event->window = g_object_ref (widget->window); - } -} - -static void -find_child_window (GtkContainer *container, - GdkEventButton *event) -{ - gtk_container_foreach (container, find_child_foreach, event); -} - -static gint -gtk_combo_list_enter (GtkWidget *widget, - GdkEventCrossing *event, - GtkCombo *combo) -{ - GtkWidget *event_widget; - - event_widget = gtk_get_event_widget ((GdkEvent*) event); - - if ((event_widget == combo->list) && - (combo->current_button != 0) && - (!GTK_WIDGET_HAS_GRAB (combo->list))) - { - GdkEvent *tmp_event = gdk_event_new (GDK_BUTTON_PRESS); - gint x, y; - GdkModifierType mask; - - gtk_grab_remove (combo->popwin); - - /* Transfer the grab over to the list by synthesizing - * a button press event - */ - gdk_window_get_pointer (combo->list->window, &x, &y, &mask); - - tmp_event->button.send_event = TRUE; - tmp_event->button.time = GDK_CURRENT_TIME; /* bad */ - tmp_event->button.x = x; - tmp_event->button.y = y; - /* We leave all the XInput fields unfilled here, in the expectation - * that GtkList doesn't care. - */ - tmp_event->button.button = combo->current_button; - tmp_event->button.state = mask; - - find_child_window (GTK_CONTAINER (combo->list), &tmp_event->button); - if (!tmp_event->button.window) - { - GtkWidget *child; - - if (GTK_LIST (combo->list)->children) - child = GTK_LIST (combo->list)->children->data; - else - child = combo->list; - - tmp_event->button.window = g_object_ref (child->window); - } - - gtk_widget_event (combo->list, tmp_event); - gdk_event_free (tmp_event); - } - - return FALSE; -} - -static int -gtk_combo_list_key_press (GtkWidget * widget, GdkEventKey * event, GtkCombo * combo) -{ - guint state = event->state & gtk_accelerator_get_default_mod_mask (); - - if (event->keyval == GDK_Escape && state == 0) - { - if (GTK_WIDGET_HAS_GRAB (combo->list)) - gtk_list_end_drag_selection (GTK_LIST (combo->list)); - - gtk_combo_popdown_list (combo); - - return TRUE; - } - return FALSE; -} - -static void -combo_event_box_realize (GtkWidget *widget) -{ - GdkCursor *cursor = gdk_cursor_new_for_display (gtk_widget_get_display (widget), - GDK_TOP_LEFT_ARROW); - gdk_window_set_cursor (widget->window, cursor); - gdk_cursor_unref (cursor); -} - -static void -gtk_combo_init (GtkCombo * combo) -{ - GtkWidget *arrow; - GtkWidget *frame; - GtkWidget *event_box; - - combo->case_sensitive = FALSE; - combo->value_in_list = FALSE; - combo->ok_if_empty = TRUE; - combo->use_arrows = TRUE; - combo->use_arrows_always = TRUE; - combo->entry = gtk_entry_new (); - combo->button = gtk_button_new (); - combo->current_button = 0; - arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_OUT); - gtk_widget_show (arrow); - gtk_container_add (GTK_CONTAINER (combo->button), arrow); - gtk_box_pack_start (GTK_BOX (combo), combo->entry, TRUE, TRUE, 0); - gtk_box_pack_end (GTK_BOX (combo), combo->button, FALSE, FALSE, 0); - gtk_widget_set_can_focus (combo->button, FALSE); - gtk_widget_show (combo->entry); - gtk_widget_show (combo->button); - combo->entry_change_id = g_signal_connect (combo->entry, "changed", - G_CALLBACK (gtk_combo_update_list), - combo); - g_signal_connect_after (combo->entry, "key-press-event", - G_CALLBACK (gtk_combo_entry_key_press), combo); - g_signal_connect_after (combo->entry, "focus-out-event", - G_CALLBACK (gtk_combo_entry_focus_out), combo); - combo->activate_id = g_signal_connect (combo->entry, "activate", - G_CALLBACK (gtk_combo_activate), - combo); - g_signal_connect (combo->button, "button-press-event", - G_CALLBACK (gtk_combo_popup_button_press), combo); - g_signal_connect (combo->button, "leave-notify-event", - G_CALLBACK (gtk_combo_popup_button_leave), combo); - - combo->popwin = gtk_window_new (GTK_WINDOW_POPUP); - gtk_widget_set_name (combo->popwin, "gtk-combo-popup-window"); - gtk_window_set_type_hint (GTK_WINDOW (combo->popwin), GDK_WINDOW_TYPE_HINT_COMBO); - g_object_ref (combo->popwin); - gtk_window_set_resizable (GTK_WINDOW (combo->popwin), FALSE); - - g_signal_connect (combo->popwin, "key-press-event", - G_CALLBACK (gtk_combo_window_key_press), combo); - - gtk_widget_set_events (combo->popwin, GDK_KEY_PRESS_MASK); - - event_box = gtk_event_box_new (); - gtk_container_add (GTK_CONTAINER (combo->popwin), event_box); - g_signal_connect (event_box, "realize", - G_CALLBACK (combo_event_box_realize), NULL); - gtk_widget_show (event_box); - - - frame = gtk_frame_new (NULL); - gtk_container_add (GTK_CONTAINER (event_box), frame); - gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT); - gtk_widget_show (frame); - - combo->popup = gtk_scrolled_window_new (NULL, NULL); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (combo->popup), - GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - gtk_widget_set_can_focus (GTK_SCROLLED_WINDOW (combo->popup)->hscrollbar, FALSE); - gtk_widget_set_can_focus (GTK_SCROLLED_WINDOW (combo->popup)->vscrollbar, FALSE); - gtk_container_add (GTK_CONTAINER (frame), combo->popup); - gtk_widget_show (combo->popup); - - combo->list = gtk_list_new (); - /* We'll use enter notify events to figure out when to transfer - * the grab to the list - */ - gtk_widget_set_events (combo->list, GDK_ENTER_NOTIFY_MASK); - - gtk_list_set_selection_mode (GTK_LIST(combo->list), GTK_SELECTION_BROWSE); - gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (combo->popup), combo->list); - gtk_container_set_focus_vadjustment (GTK_CONTAINER (combo->list), - gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (combo->popup))); - gtk_container_set_focus_hadjustment (GTK_CONTAINER (combo->list), - gtk_scrolled_window_get_hadjustment (GTK_SCROLLED_WINDOW (combo->popup))); - gtk_widget_show (combo->list); - - combo->list_change_id = g_signal_connect (combo->list, "selection-changed", - G_CALLBACK (gtk_combo_selection_changed), combo); - - g_signal_connect (combo->popwin, "key-press-event", - G_CALLBACK (gtk_combo_list_key_press), combo); - g_signal_connect (combo->popwin, "button-press-event", - G_CALLBACK (gtk_combo_button_press), combo); - - g_signal_connect (combo->popwin, "event-after", - G_CALLBACK (gtk_combo_button_event_after), combo); - g_signal_connect (combo->list, "event-after", - G_CALLBACK (gtk_combo_button_event_after), combo); - - g_signal_connect (combo->list, "enter-notify-event", - G_CALLBACK (gtk_combo_list_enter), combo); -} - -static void -gtk_combo_realize (GtkWidget *widget) -{ - GtkCombo *combo = GTK_COMBO (widget); - - gtk_window_set_screen (GTK_WINDOW (combo->popwin), - gtk_widget_get_screen (widget)); - - GTK_WIDGET_CLASS (gtk_combo_parent_class)->realize (widget); -} - -static void -gtk_combo_unrealize (GtkWidget *widget) -{ - GtkCombo *combo = GTK_COMBO (widget); - - gtk_combo_popdown_list (combo); - gtk_widget_unrealize (combo->popwin); - - GTK_WIDGET_CLASS (gtk_combo_parent_class)->unrealize (widget); -} - -GtkWidget* -gtk_combo_new (void) -{ - return g_object_new (GTK_TYPE_COMBO, NULL); -} - -void -gtk_combo_set_value_in_list (GtkCombo * combo, gboolean val, gboolean ok_if_empty) -{ - g_return_if_fail (GTK_IS_COMBO (combo)); - val = val != FALSE; - ok_if_empty = ok_if_empty != FALSE; - - g_object_freeze_notify (G_OBJECT (combo)); - if (combo->value_in_list != val) - { - combo->value_in_list = val; - g_object_notify (G_OBJECT (combo), "value-in-list"); - } - if (combo->ok_if_empty != ok_if_empty) - { - combo->ok_if_empty = ok_if_empty; - g_object_notify (G_OBJECT (combo), "allow-empty"); - } - g_object_thaw_notify (G_OBJECT (combo)); -} - -void -gtk_combo_set_case_sensitive (GtkCombo * combo, gboolean val) -{ - g_return_if_fail (GTK_IS_COMBO (combo)); - val = val != FALSE; - - if (combo->case_sensitive != val) - { - combo->case_sensitive = val; - g_object_notify (G_OBJECT (combo), "case-sensitive"); - } -} - -void -gtk_combo_set_use_arrows (GtkCombo * combo, gboolean val) -{ - g_return_if_fail (GTK_IS_COMBO (combo)); - val = val != FALSE; - - if (combo->use_arrows != val) - { - combo->use_arrows = val; - g_object_notify (G_OBJECT (combo), "enable-arrow-keys"); - } -} - -void -gtk_combo_set_use_arrows_always (GtkCombo * combo, gboolean val) -{ - g_return_if_fail (GTK_IS_COMBO (combo)); - val = val != FALSE; - - if (combo->use_arrows_always != val) - { - g_object_freeze_notify (G_OBJECT (combo)); - combo->use_arrows_always = val; - g_object_notify (G_OBJECT (combo), "enable-arrows-always"); - - if (combo->use_arrows != TRUE) - { - combo->use_arrows = TRUE; - g_object_notify (G_OBJECT (combo), "enable-arrow-keys"); - } - g_object_thaw_notify (G_OBJECT (combo)); - } -} - -void -gtk_combo_set_popdown_strings (GtkCombo *combo, - GList *strings) -{ - GList *list; - GtkWidget *li; - - g_return_if_fail (GTK_IS_COMBO (combo)); - - gtk_combo_popdown_list (combo); - - gtk_list_clear_items (GTK_LIST (combo->list), 0, -1); - list = strings; - while (list) - { - li = gtk_list_item_new_with_label ((gchar *) list->data); - gtk_widget_show (li); - gtk_container_add (GTK_CONTAINER (combo->list), li); - list = list->next; - } -} - -void -gtk_combo_set_item_string (GtkCombo *combo, - GtkItem *item, - const gchar *item_value) -{ - g_return_if_fail (GTK_IS_COMBO (combo)); - g_return_if_fail (item != NULL); - - g_object_set_data_full (G_OBJECT (item), I_(gtk_combo_string_key), - g_strdup (item_value), g_free); -} - -static void -gtk_combo_size_allocate (GtkWidget *widget, - GtkAllocation *allocation) -{ - GtkCombo *combo = GTK_COMBO (widget); - - GTK_WIDGET_CLASS (gtk_combo_parent_class)->size_allocate (widget, allocation); - - if (combo->entry->allocation.height > combo->entry->requisition.height) - { - GtkAllocation button_allocation; - - button_allocation = combo->button->allocation; - button_allocation.height = combo->entry->requisition.height; - button_allocation.y = combo->entry->allocation.y + - (combo->entry->allocation.height - combo->entry->requisition.height) - / 2; - gtk_widget_size_allocate (combo->button, &button_allocation); - } -} - -void -gtk_combo_disable_activate (GtkCombo *combo) -{ - g_return_if_fail (GTK_IS_COMBO (combo)); - - if ( combo->activate_id ) { - g_signal_handler_disconnect (combo->entry, combo->activate_id); - combo->activate_id = 0; - } -} - -static void -gtk_combo_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - GtkCombo *combo = GTK_COMBO (object); - - switch (prop_id) - { - case PROP_ENABLE_ARROW_KEYS: - gtk_combo_set_use_arrows (combo, g_value_get_boolean (value)); - break; - case PROP_ENABLE_ARROWS_ALWAYS: - gtk_combo_set_use_arrows_always (combo, g_value_get_boolean (value)); - break; - case PROP_CASE_SENSITIVE: - gtk_combo_set_case_sensitive (combo, g_value_get_boolean (value)); - break; - case PROP_ALLOW_EMPTY: - combo->ok_if_empty = g_value_get_boolean (value); - break; - case PROP_VALUE_IN_LIST: - combo->value_in_list = g_value_get_boolean (value); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } - -} - -static void -gtk_combo_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - GtkCombo *combo = GTK_COMBO (object); - - switch (prop_id) - { - case PROP_ENABLE_ARROW_KEYS: - g_value_set_boolean (value, combo->use_arrows); - break; - case PROP_ENABLE_ARROWS_ALWAYS: - g_value_set_boolean (value, combo->use_arrows_always); - break; - case PROP_CASE_SENSITIVE: - g_value_set_boolean (value, combo->case_sensitive); - break; - case PROP_ALLOW_EMPTY: - g_value_set_boolean (value, combo->ok_if_empty); - break; - case PROP_VALUE_IN_LIST: - g_value_set_boolean (value, combo->value_in_list); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } - -} - -#define __GTK_SMART_COMBO_C__ -#include "gtkaliasdef.c" diff --git a/gtk/gtkcombo.h b/gtk/gtkcombo.h deleted file mode 100644 index c9c8b930c0..0000000000 --- a/gtk/gtkcombo.h +++ /dev/null @@ -1,118 +0,0 @@ -/* gtkcombo - combo widget for gtk+ - * Copyright 1997 Paolo Molaro - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#ifndef GTK_DISABLE_DEPRECATED - -#ifndef __GTK_SMART_COMBO_H__ -#define __GTK_SMART_COMBO_H__ - -#include - - -G_BEGIN_DECLS - -#define GTK_TYPE_COMBO (gtk_combo_get_type ()) -#define GTK_COMBO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_COMBO, GtkCombo)) -#define GTK_COMBO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_COMBO, GtkComboClass)) -#define GTK_IS_COMBO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_COMBO)) -#define GTK_IS_COMBO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_COMBO)) -#define GTK_COMBO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_COMBO, GtkComboClass)) - - -typedef struct _GtkCombo GtkCombo; -typedef struct _GtkComboClass GtkComboClass; - -/* you should access only the entry and list fields directly */ -struct _GtkCombo { - GtkHBox hbox; - - /*< public >*/ - GtkWidget *entry; - - /*< private >*/ - GtkWidget *button; - GtkWidget *popup; - GtkWidget *popwin; - - /*< public >*/ - GtkWidget *list; - - /*< private >*/ - guint entry_change_id; - guint list_change_id; /* unused */ - - guint value_in_list:1; - guint ok_if_empty:1; - guint case_sensitive:1; - guint use_arrows:1; - guint use_arrows_always:1; - - guint16 current_button; - guint activate_id; -}; - -struct _GtkComboClass { - GtkHBoxClass parent_class; - - /* Padding for future expansion */ - void (*_gtk_reserved1) (void); - void (*_gtk_reserved2) (void); - void (*_gtk_reserved3) (void); - void (*_gtk_reserved4) (void); -}; - -GType gtk_combo_get_type (void) G_GNUC_CONST; - -GtkWidget* gtk_combo_new (void); -/* the text in the entry must be or not be in the list */ -void gtk_combo_set_value_in_list (GtkCombo* combo, - gboolean val, - gboolean ok_if_empty); -/* set/unset arrows working for changing the value (can be annoying) */ -void gtk_combo_set_use_arrows (GtkCombo* combo, - gboolean val); -/* up/down arrows change value if current value not in list */ -void gtk_combo_set_use_arrows_always (GtkCombo* combo, - gboolean val); -/* perform case-sensitive compares */ -void gtk_combo_set_case_sensitive (GtkCombo* combo, - gboolean val); -/* call this function on an item if it isn't a label or you - want it to have a different value to be displayed in the entry */ -void gtk_combo_set_item_string (GtkCombo* combo, - GtkItem* item, - const gchar* item_value); -/* simple interface */ -void gtk_combo_set_popdown_strings (GtkCombo* combo, - GList *strings); - -void gtk_combo_disable_activate (GtkCombo* combo); - -G_END_DECLS - -#endif /* __GTK_SMART_COMBO_H__ */ - -#endif /* GTK_DISABLE_DEPRECATED */ diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c index fd92dd0d5d..64c8e05658 100644 --- a/gtk/gtkcombobox.c +++ b/gtk/gtkcombobox.c @@ -127,6 +127,9 @@ struct _GtkComboBoxPrivate gpointer row_separator_data; GDestroyNotify row_separator_destroy; + GdkDevice *grab_pointer; + GdkDevice *grab_keyboard; + gchar *tearoff_title; }; @@ -1861,27 +1864,31 @@ gtk_combo_box_menu_popup (GtkComboBox *combo_box, static gboolean popup_grab_on_window (GdkWindow *window, - guint32 activate_time, - gboolean grab_keyboard) + GdkDevice *keyboard, + GdkDevice *pointer, + guint32 activate_time) { - if ((gdk_pointer_grab (window, TRUE, - GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | - GDK_POINTER_MOTION_MASK, - NULL, NULL, activate_time) == 0)) + if (keyboard && + gdk_device_grab (keyboard, window, + GDK_OWNERSHIP_WINDOW, TRUE, + GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK, + NULL, activate_time) != GDK_GRAB_SUCCESS) + return FALSE; + + if (pointer && + gdk_device_grab (pointer, window, + GDK_OWNERSHIP_WINDOW, TRUE, + GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | + GDK_POINTER_MOTION_MASK, + NULL, activate_time) != GDK_GRAB_SUCCESS) { - if (!grab_keyboard || - gdk_keyboard_grab (window, TRUE, - activate_time) == 0) - return TRUE; - else - { - gdk_display_pointer_ungrab (gdk_drawable_get_display (window), - activate_time); - return FALSE; - } + if (keyboard) + gdk_device_ungrab (keyboard, activate_time); + + return FALSE; } - return FALSE; + return TRUE; } /** @@ -1903,13 +1910,30 @@ gtk_combo_box_popup (GtkComboBox *combo_box) g_signal_emit (combo_box, combo_box_signals[POPUP], 0); } -static void -gtk_combo_box_real_popup (GtkComboBox *combo_box) +/** + * gtk_combo_box_popup_for_device: + * @combo_box: a #GtkComboBox + * @device: a #GdkDevice + * + * Pops up the menu or dropdown list of @combo_box, the popup window + * will be grabbed so only @device and its associated pointer/keyboard + * are the only #GdkDevices able to send events to it. + * + * Since: 3.0 + **/ +void +gtk_combo_box_popup_for_device (GtkComboBox *combo_box, + GdkDevice *device) { GtkComboBoxPrivate *priv = combo_box->priv; gint x, y, width, height; GtkTreePath *path = NULL, *ppath; GtkWidget *toplevel; + GdkDevice *keyboard, *pointer; + guint32 time; + + g_return_if_fail (GTK_IS_COMBO_BOX (combo_box)); + g_return_if_fail (GDK_IS_DEVICE (device)); if (!gtk_widget_get_realized (GTK_WIDGET (combo_box))) return; @@ -1917,6 +1941,22 @@ gtk_combo_box_real_popup (GtkComboBox *combo_box) if (gtk_widget_get_mapped (priv->popup_widget)) return; + if (priv->grab_pointer && priv->grab_keyboard) + return; + + time = gtk_get_current_event_time (); + + if (device->source == GDK_SOURCE_KEYBOARD) + { + keyboard = device; + pointer = gdk_device_get_associated_device (device); + } + else + { + pointer = device; + keyboard = gdk_device_get_associated_device (device); + } + if (GTK_IS_MENU (priv->popup_widget)) { gtk_combo_box_menu_popup (combo_box, @@ -1966,13 +2006,40 @@ gtk_combo_box_real_popup (GtkComboBox *combo_box) gtk_widget_grab_focus (priv->tree_view); if (!popup_grab_on_window (priv->popup_window->window, - GDK_CURRENT_TIME, TRUE)) + keyboard, pointer, time)) { gtk_widget_hide (priv->popup_window); return; } - gtk_grab_add (priv->popup_window); + gtk_device_grab_add (priv->popup_window, pointer, TRUE); + priv->grab_pointer = pointer; + priv->grab_keyboard = keyboard; +} + +static void +gtk_combo_box_real_popup (GtkComboBox *combo_box) +{ + GdkDevice *device; + + device = gtk_get_current_event_device (); + + if (!device) + { + GdkDeviceManager *device_manager; + GdkDisplay *display; + GList *devices; + + display = gtk_widget_get_display (GTK_WIDGET (combo_box)); + device_manager = gdk_display_get_device_manager (display); + + /* No device was set, pick the first master device */ + devices = gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_MASTER); + device = devices->data; + g_list_free (devices); + } + + gtk_combo_box_popup_for_device (combo_box, device); } static gboolean @@ -2014,10 +2081,13 @@ gtk_combo_box_popdown (GtkComboBox *combo_box) if (!gtk_widget_get_realized (GTK_WIDGET (combo_box))) return; - gtk_grab_remove (priv->popup_window); + gtk_device_grab_remove (priv->popup_window, priv->grab_pointer); gtk_widget_hide_all (priv->popup_window); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->button), FALSE); + + priv->grab_pointer = NULL; + priv->grab_keyboard = NULL; } static gint @@ -3896,7 +3966,7 @@ gtk_combo_box_list_button_pressed (GtkWidget *widget, !gtk_widget_has_focus (priv->button)) gtk_widget_grab_focus (priv->button); - gtk_combo_box_popup (combo_box); + gtk_combo_box_popup_for_device (combo_box, event->device); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->button), TRUE); @@ -4056,13 +4126,13 @@ gtk_combo_box_list_auto_scroll (GtkComboBox *combo_box, adj->lower < adj->value) { value = adj->value - (tree_view->allocation.x - x + 1); - gtk_adjustment_set_value (adj, CLAMP (value, adj->lower, adj->upper - adj->page_size)); + gtk_adjustment_set_value (adj, value); } else if (x >= tree_view->allocation.x + tree_view->allocation.width && adj->upper - adj->page_size > adj->value) { value = adj->value + (x - tree_view->allocation.x - tree_view->allocation.width + 1); - gtk_adjustment_set_value (adj, CLAMP (value, 0.0, adj->upper - adj->page_size)); + gtk_adjustment_set_value (adj, MAX (value, 0.0)); } } @@ -4073,13 +4143,13 @@ gtk_combo_box_list_auto_scroll (GtkComboBox *combo_box, adj->lower < adj->value) { value = adj->value - (tree_view->allocation.y - y + 1); - gtk_adjustment_set_value (adj, CLAMP (value, adj->lower, adj->upper - adj->page_size)); + gtk_adjustment_set_value (adj, value); } else if (y >= tree_view->allocation.height && adj->upper - adj->page_size > adj->value) { value = adj->value + (y - tree_view->allocation.height + 1); - gtk_adjustment_set_value (adj, CLAMP (value, 0.0, adj->upper - adj->page_size)); + gtk_adjustment_set_value (adj, MAX (value, 0.0)); } } } @@ -4092,7 +4162,9 @@ gtk_combo_box_list_scroll_timeout (GtkComboBox *combo_box) if (priv->auto_scroll) { - gdk_window_get_pointer (priv->tree_view->window, &x, &y, NULL); + gdk_window_get_device_position (priv->tree_view->window, + priv->grab_pointer, + &x, &y, NULL); gtk_combo_box_list_auto_scroll (combo_box, x, y); } diff --git a/gtk/gtkcombobox.h b/gtk/gtkcombobox.h index 963e4b415b..f5141a7ded 100644 --- a/gtk/gtkcombobox.h +++ b/gtk/gtkcombobox.h @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -133,6 +133,8 @@ gchar *gtk_combo_box_get_active_text (GtkComboBox *combo_box); /* programmatic control */ void gtk_combo_box_popup (GtkComboBox *combo_box); +void gtk_combo_box_popup_for_device (GtkComboBox *combo_box, + GdkDevice *device); void gtk_combo_box_popdown (GtkComboBox *combo_box); AtkObject* gtk_combo_box_get_popup_accessible (GtkComboBox *combo_box); diff --git a/gtk/gtkcomboboxentry.h b/gtk/gtkcomboboxentry.h index 81c5aec1f5..c8820c56b5 100644 --- a/gtk/gtkcomboboxentry.h +++ b/gtk/gtkcomboboxentry.h @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c index 6bedc86e99..d1e8da5969 100644 --- a/gtk/gtkcontainer.c +++ b/gtk/gtkcontainer.c @@ -1370,6 +1370,9 @@ _gtk_container_queue_resize (GtkContainer *container) { GTK_PRIVATE_SET_FLAG (widget, GTK_ALLOC_NEEDED); GTK_PRIVATE_SET_FLAG (widget, GTK_REQUEST_NEEDED); + GTK_PRIVATE_SET_FLAG (widget, GTK_WIDTH_REQUEST_NEEDED); + GTK_PRIVATE_SET_FLAG (widget, GTK_HEIGHT_REQUEST_NEEDED); + if ((resize_container && widget == GTK_WIDGET (resize_container)) || !widget->parent) break; @@ -1527,63 +1530,6 @@ gtk_container_foreach (GtkContainer *container, class->forall (container, FALSE, callback, callback_data); } -typedef struct _GtkForeachData GtkForeachData; -struct _GtkForeachData -{ - GtkObject *container; - GtkCallbackMarshal callback; - gpointer callback_data; -}; - -static void -gtk_container_foreach_unmarshal (GtkWidget *child, - gpointer data) -{ - GtkForeachData *fdata = (GtkForeachData*) data; - GtkArg args[2]; - - /* first argument */ - args[0].name = NULL; - args[0].type = G_TYPE_FROM_INSTANCE (child); - GTK_VALUE_OBJECT (args[0]) = GTK_OBJECT (child); - - /* location for return value */ - args[1].name = NULL; - args[1].type = G_TYPE_NONE; - - fdata->callback (fdata->container, fdata->callback_data, 1, args); -} - -void -gtk_container_foreach_full (GtkContainer *container, - GtkCallback callback, - GtkCallbackMarshal marshal, - gpointer callback_data, - GDestroyNotify notify) -{ - g_return_if_fail (GTK_IS_CONTAINER (container)); - - if (marshal) - { - GtkForeachData fdata; - - fdata.container = GTK_OBJECT (container); - fdata.callback = marshal; - fdata.callback_data = callback_data; - - gtk_container_foreach (container, gtk_container_foreach_unmarshal, &fdata); - } - else - { - g_return_if_fail (callback != NULL); - - gtk_container_foreach (container, callback, &callback_data); - } - - if (notify) - notify (callback_data); -} - /** * gtk_container_set_focus_child: * @container: a #GtkContainer diff --git a/gtk/gtkcontainer.h b/gtk/gtkcontainer.h index 0bf30b9a2f..a1c3a52068 100644 --- a/gtk/gtkcontainer.h +++ b/gtk/gtkcontainer.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -122,19 +122,8 @@ void gtk_container_check_resize (GtkContainer *container); void gtk_container_foreach (GtkContainer *container, GtkCallback callback, gpointer callback_data); -#ifndef GTK_DISABLE_DEPRECATED -void gtk_container_foreach_full (GtkContainer *container, - GtkCallback callback, - GtkCallbackMarshal marshal, - gpointer callback_data, - GDestroyNotify notify); -#endif /* GTK_DISABLE_DEPRECATED */ GList* gtk_container_get_children (GtkContainer *container); -#ifndef GTK_DISABLE_DEPRECATED -#define gtk_container_children gtk_container_get_children -#endif - void gtk_container_propagate_expose (GtkContainer *container, GtkWidget *child, GdkEventExpose *event); @@ -220,9 +209,6 @@ GList *_gtk_container_focus_sort (GtkContainer *container, GtkDirectionType direction, GtkWidget *old_focus); -#ifndef GTK_DISABLE_DEPRECATED -#define gtk_container_border_width gtk_container_set_border_width -#endif /* GTK_DISABLE_DEPRECATED */ G_END_DECLS diff --git a/gtk/gtkctree.c b/gtk/gtkctree.c deleted file mode 100644 index bd4175c61d..0000000000 --- a/gtk/gtkctree.c +++ /dev/null @@ -1,6144 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball, Josh MacDonald, - * Copyright (C) 1997-1998 Jay Painter - * - * GtkCTree widget for GTK+ - * Copyright (C) 1998 Lars Hamann and Stefan Jeske - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#include "config.h" -#include - -#undef GTK_DISABLE_DEPRECATED -#define __GTK_CTREE_C__ - -#include "gtkctree.h" -#include "gtkbindings.h" -#include "gtkmain.h" -#include "gtkmarshalers.h" -#include "gtkdnd.h" -#include "gtkintl.h" -#include - -#include "gtkalias.h" - -#define PM_SIZE 8 -#define TAB_SIZE (PM_SIZE + 6) -#define CELL_SPACING 1 -#define CLIST_OPTIMUM_SIZE 64 -#define COLUMN_INSET 3 -#define DRAG_WIDTH 6 - -#define ROW_TOP_YPIXEL(clist, row) (((clist)->row_height * (row)) + \ - (((row) + 1) * CELL_SPACING) + \ - (clist)->voffset) -#define ROW_FROM_YPIXEL(clist, y) (((y) - (clist)->voffset) / \ - ((clist)->row_height + CELL_SPACING)) -#define COLUMN_LEFT_XPIXEL(clist, col) ((clist)->column[(col)].area.x \ - + (clist)->hoffset) -#define COLUMN_LEFT(clist, column) ((clist)->column[(column)].area.x) - -static inline gint -COLUMN_FROM_XPIXEL (GtkCList * clist, - gint x) -{ - gint i, cx; - - for (i = 0; i < clist->columns; i++) - if (clist->column[i].visible) - { - cx = clist->column[i].area.x + clist->hoffset; - - if (x >= (cx - (COLUMN_INSET + CELL_SPACING)) && - x <= (cx + clist->column[i].area.width + COLUMN_INSET)) - return i; - } - - /* no match */ - return -1; -} - -#define CLIST_UNFROZEN(clist) (((GtkCList*) (clist))->freeze_count == 0) -#define CLIST_REFRESH(clist) G_STMT_START { \ - if (CLIST_UNFROZEN (clist)) \ - GTK_CLIST_GET_CLASS (clist)->refresh ((GtkCList*) (clist)); \ -} G_STMT_END - - -enum { - ARG_0, - ARG_N_COLUMNS, - ARG_TREE_COLUMN, - ARG_INDENT, - ARG_SPACING, - ARG_SHOW_STUB, - ARG_LINE_STYLE, - ARG_EXPANDER_STYLE -}; - - -static void gtk_ctree_class_init (GtkCTreeClass *klass); -static void gtk_ctree_init (GtkCTree *ctree); -static GObject* gtk_ctree_constructor (GType type, - guint n_construct_properties, - GObjectConstructParam *construct_params); -static void gtk_ctree_set_arg (GtkObject *object, - GtkArg *arg, - guint arg_id); -static void gtk_ctree_get_arg (GtkObject *object, - GtkArg *arg, - guint arg_id); -static void gtk_ctree_realize (GtkWidget *widget); -static void gtk_ctree_unrealize (GtkWidget *widget); -static gint gtk_ctree_button_press (GtkWidget *widget, - GdkEventButton *event); -static void ctree_attach_styles (GtkCTree *ctree, - GtkCTreeNode *node, - gpointer data); -static void ctree_detach_styles (GtkCTree *ctree, - GtkCTreeNode *node, - gpointer data); -static gint draw_cell_pixmap (GdkWindow *window, - GdkRectangle *clip_rectangle, - GdkGC *fg_gc, - GdkPixmap *pixmap, - GdkBitmap *mask, - gint x, - gint y, - gint width, - gint height); -static void get_cell_style (GtkCList *clist, - GtkCListRow *clist_row, - gint state, - gint column, - GtkStyle **style, - GdkGC **fg_gc, - GdkGC **bg_gc); -static gint gtk_ctree_draw_expander (GtkCTree *ctree, - GtkCTreeRow *ctree_row, - GtkStyle *style, - GdkRectangle *clip_rectangle, - gint x); -static gint gtk_ctree_draw_lines (GtkCTree *ctree, - GtkCTreeRow *ctree_row, - gint row, - gint column, - gint state, - GdkRectangle *clip_rectangle, - GdkRectangle *cell_rectangle, - GdkRectangle *crect, - GdkRectangle *area, - GtkStyle *style); -static void draw_row (GtkCList *clist, - GdkRectangle *area, - gint row, - GtkCListRow *clist_row); -static void draw_drag_highlight (GtkCList *clist, - GtkCListRow *dest_row, - gint dest_row_number, - GtkCListDragPos drag_pos); -static void tree_draw_node (GtkCTree *ctree, - GtkCTreeNode *node); -static void set_cell_contents (GtkCList *clist, - GtkCListRow *clist_row, - gint column, - GtkCellType type, - const gchar *text, - guint8 spacing, - GdkPixmap *pixmap, - GdkBitmap *mask); -static void set_node_info (GtkCTree *ctree, - GtkCTreeNode *node, - const gchar *text, - guint8 spacing, - GdkPixmap *pixmap_closed, - GdkBitmap *mask_closed, - GdkPixmap *pixmap_opened, - GdkBitmap *mask_opened, - gboolean is_leaf, - gboolean expanded); -static GtkCTreeRow *row_new (GtkCTree *ctree); -static void row_delete (GtkCTree *ctree, - GtkCTreeRow *ctree_row); -static void tree_delete (GtkCTree *ctree, - GtkCTreeNode *node, - gpointer data); -static void tree_delete_row (GtkCTree *ctree, - GtkCTreeNode *node, - gpointer data); -static void real_clear (GtkCList *clist); -static void tree_update_level (GtkCTree *ctree, - GtkCTreeNode *node, - gpointer data); -static void tree_select (GtkCTree *ctree, - GtkCTreeNode *node, - gpointer data); -static void tree_unselect (GtkCTree *ctree, - GtkCTreeNode *node, - gpointer data); -static void real_select_all (GtkCList *clist); -static void real_unselect_all (GtkCList *clist); -static void tree_expand (GtkCTree *ctree, - GtkCTreeNode *node, - gpointer data); -static void tree_collapse (GtkCTree *ctree, - GtkCTreeNode *node, - gpointer data); -static void tree_collapse_to_depth (GtkCTree *ctree, - GtkCTreeNode *node, - gint depth); -static void tree_toggle_expansion (GtkCTree *ctree, - GtkCTreeNode *node, - gpointer data); -static void change_focus_row_expansion (GtkCTree *ctree, - GtkCTreeExpansionType expansion); -static void real_select_row (GtkCList *clist, - gint row, - gint column, - GdkEvent *event); -static void real_unselect_row (GtkCList *clist, - gint row, - gint column, - GdkEvent *event); -static void real_tree_select (GtkCTree *ctree, - GtkCTreeNode *node, - gint column); -static void real_tree_unselect (GtkCTree *ctree, - GtkCTreeNode *node, - gint column); -static void real_tree_expand (GtkCTree *ctree, - GtkCTreeNode *node); -static void real_tree_collapse (GtkCTree *ctree, - GtkCTreeNode *node); -static void real_tree_move (GtkCTree *ctree, - GtkCTreeNode *node, - GtkCTreeNode *new_parent, - GtkCTreeNode *new_sibling); -static void real_row_move (GtkCList *clist, - gint source_row, - gint dest_row); -static void gtk_ctree_link (GtkCTree *ctree, - GtkCTreeNode *node, - GtkCTreeNode *parent, - GtkCTreeNode *sibling, - gboolean update_focus_row); -static void gtk_ctree_unlink (GtkCTree *ctree, - GtkCTreeNode *node, - gboolean update_focus_row); -static GtkCTreeNode * gtk_ctree_last_visible (GtkCTree *ctree, - GtkCTreeNode *node); -static gboolean ctree_is_hot_spot (GtkCTree *ctree, - GtkCTreeNode *node, - gint row, - gint x, - gint y); -static void tree_sort (GtkCTree *ctree, - GtkCTreeNode *node, - gpointer data); -static void fake_unselect_all (GtkCList *clist, - gint row); -static GList * selection_find (GtkCList *clist, - gint row_number, - GList *row_list_element); -static void resync_selection (GtkCList *clist, - GdkEvent *event); -static void real_undo_selection (GtkCList *clist); -static void select_row_recursive (GtkCTree *ctree, - GtkCTreeNode *node, - gpointer data); -static gint real_insert_row (GtkCList *clist, - gint row, - gchar *text[]); -static void real_remove_row (GtkCList *clist, - gint row); -static void real_sort_list (GtkCList *clist); -static void cell_size_request (GtkCList *clist, - GtkCListRow *clist_row, - gint column, - GtkRequisition *requisition); -static void column_auto_resize (GtkCList *clist, - GtkCListRow *clist_row, - gint column, - gint old_width); -static void auto_resize_columns (GtkCList *clist); - - -static gboolean check_drag (GtkCTree *ctree, - GtkCTreeNode *drag_source, - GtkCTreeNode *drag_target, - GtkCListDragPos insert_pos); -static void gtk_ctree_drag_begin (GtkWidget *widget, - GdkDragContext *context); -static gint gtk_ctree_drag_motion (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - guint time); -static void gtk_ctree_drag_data_received (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - GtkSelectionData *selection_data, - guint info, - guint32 time); -static void remove_grab (GtkCList *clist); -static void drag_dest_cell (GtkCList *clist, - gint x, - gint y, - GtkCListDestInfo *dest_info); - - -enum -{ - TREE_SELECT_ROW, - TREE_UNSELECT_ROW, - TREE_EXPAND, - TREE_COLLAPSE, - TREE_MOVE, - CHANGE_FOCUS_ROW_EXPANSION, - LAST_SIGNAL -}; - -static GtkCListClass *parent_class = NULL; -static GtkContainerClass *container_class = NULL; -static guint ctree_signals[LAST_SIGNAL] = {0}; - - -GtkType -gtk_ctree_get_type (void) -{ - static GtkType ctree_type = 0; - - if (!ctree_type) - { - static const GtkTypeInfo ctree_info = - { - "GtkCTree", - sizeof (GtkCTree), - sizeof (GtkCTreeClass), - (GtkClassInitFunc) gtk_ctree_class_init, - (GtkObjectInitFunc) gtk_ctree_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, - }; - - I_("GtkCTree"); - ctree_type = gtk_type_unique (GTK_TYPE_CLIST, &ctree_info); - } - - return ctree_type; -} - -static void -gtk_ctree_class_init (GtkCTreeClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - GtkObjectClass *object_class; - GtkWidgetClass *widget_class; - GtkCListClass *clist_class; - GtkBindingSet *binding_set; - - gobject_class->constructor = gtk_ctree_constructor; - - object_class = (GtkObjectClass *) klass; - widget_class = (GtkWidgetClass *) klass; - container_class = (GtkContainerClass *) klass; - clist_class = (GtkCListClass *) klass; - - parent_class = gtk_type_class (GTK_TYPE_CLIST); - container_class = gtk_type_class (GTK_TYPE_CONTAINER); - - object_class->set_arg = gtk_ctree_set_arg; - object_class->get_arg = gtk_ctree_get_arg; - - widget_class->realize = gtk_ctree_realize; - widget_class->unrealize = gtk_ctree_unrealize; - widget_class->button_press_event = gtk_ctree_button_press; - - widget_class->drag_begin = gtk_ctree_drag_begin; - widget_class->drag_motion = gtk_ctree_drag_motion; - widget_class->drag_data_received = gtk_ctree_drag_data_received; - - clist_class->select_row = real_select_row; - clist_class->unselect_row = real_unselect_row; - clist_class->row_move = real_row_move; - clist_class->undo_selection = real_undo_selection; - clist_class->resync_selection = resync_selection; - clist_class->selection_find = selection_find; - clist_class->click_column = NULL; - clist_class->draw_row = draw_row; - clist_class->draw_drag_highlight = draw_drag_highlight; - clist_class->clear = real_clear; - clist_class->select_all = real_select_all; - clist_class->unselect_all = real_unselect_all; - clist_class->fake_unselect_all = fake_unselect_all; - clist_class->insert_row = real_insert_row; - clist_class->remove_row = real_remove_row; - clist_class->sort_list = real_sort_list; - clist_class->set_cell_contents = set_cell_contents; - clist_class->cell_size_request = cell_size_request; - - klass->tree_select_row = real_tree_select; - klass->tree_unselect_row = real_tree_unselect; - klass->tree_expand = real_tree_expand; - klass->tree_collapse = real_tree_collapse; - klass->tree_move = real_tree_move; - klass->change_focus_row_expansion = change_focus_row_expansion; - - gtk_object_add_arg_type ("GtkCTree::n-columns", /* overrides GtkCList::n_columns!! */ - GTK_TYPE_UINT, - GTK_ARG_READWRITE | GTK_ARG_CONSTRUCT_ONLY | G_PARAM_STATIC_NAME, - ARG_N_COLUMNS); - gtk_object_add_arg_type ("GtkCTree::tree-column", - GTK_TYPE_UINT, - GTK_ARG_READWRITE | GTK_ARG_CONSTRUCT_ONLY | G_PARAM_STATIC_NAME, - ARG_TREE_COLUMN); - gtk_object_add_arg_type ("GtkCTree::indent", - GTK_TYPE_UINT, - GTK_ARG_READWRITE | G_PARAM_STATIC_NAME, - ARG_INDENT); - gtk_object_add_arg_type ("GtkCTree::spacing", - GTK_TYPE_UINT, - GTK_ARG_READWRITE | G_PARAM_STATIC_NAME, - ARG_SPACING); - gtk_object_add_arg_type ("GtkCTree::show-stub", - GTK_TYPE_BOOL, - GTK_ARG_READWRITE | G_PARAM_STATIC_NAME, - ARG_SHOW_STUB); - gtk_object_add_arg_type ("GtkCTree::line-style", - GTK_TYPE_CTREE_LINE_STYLE, - GTK_ARG_READWRITE | G_PARAM_STATIC_NAME, - ARG_LINE_STYLE); - gtk_object_add_arg_type ("GtkCTree::expander-style", - GTK_TYPE_CTREE_EXPANDER_STYLE, - GTK_ARG_READWRITE | G_PARAM_STATIC_NAME, - ARG_EXPANDER_STYLE); - - ctree_signals[TREE_SELECT_ROW] = - gtk_signal_new (I_("tree-select-row"), - GTK_RUN_FIRST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkCTreeClass, tree_select_row), - _gtk_marshal_VOID__POINTER_INT, - GTK_TYPE_NONE, 2, - GTK_TYPE_CTREE_NODE, - GTK_TYPE_INT); - ctree_signals[TREE_UNSELECT_ROW] = - gtk_signal_new (I_("tree-unselect-row"), - GTK_RUN_FIRST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkCTreeClass, tree_unselect_row), - _gtk_marshal_VOID__POINTER_INT, - GTK_TYPE_NONE, 2, - GTK_TYPE_CTREE_NODE, - GTK_TYPE_INT); - ctree_signals[TREE_EXPAND] = - gtk_signal_new (I_("tree-expand"), - GTK_RUN_LAST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkCTreeClass, tree_expand), - _gtk_marshal_VOID__POINTER, - GTK_TYPE_NONE, 1, - GTK_TYPE_CTREE_NODE); - ctree_signals[TREE_COLLAPSE] = - gtk_signal_new (I_("tree-collapse"), - GTK_RUN_LAST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkCTreeClass, tree_collapse), - _gtk_marshal_VOID__POINTER, - GTK_TYPE_NONE, 1, - GTK_TYPE_CTREE_NODE); - ctree_signals[TREE_MOVE] = - gtk_signal_new (I_("tree-move"), - GTK_RUN_LAST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkCTreeClass, tree_move), - _gtk_marshal_VOID__POINTER_POINTER_POINTER, - GTK_TYPE_NONE, 3, - GTK_TYPE_CTREE_NODE, - GTK_TYPE_CTREE_NODE, - GTK_TYPE_CTREE_NODE); - ctree_signals[CHANGE_FOCUS_ROW_EXPANSION] = - gtk_signal_new (I_("change-focus-row-expansion"), - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkCTreeClass, - change_focus_row_expansion), - _gtk_marshal_VOID__ENUM, - GTK_TYPE_NONE, 1, GTK_TYPE_CTREE_EXPANSION_TYPE); - - binding_set = gtk_binding_set_by_class (klass); - gtk_binding_entry_add_signal (binding_set, - GDK_plus, 0, - "change-focus-row-expansion", 1, - GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_EXPAND); - gtk_binding_entry_add_signal (binding_set, - GDK_plus, GDK_CONTROL_MASK, - "change-focus-row-expansion", 1, - GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_EXPAND_RECURSIVE); - - gtk_binding_entry_add_signal (binding_set, - GDK_KP_Add, 0, - "change-focus-row-expansion", 1, - GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_EXPAND); - gtk_binding_entry_add_signal (binding_set, - GDK_KP_Add, GDK_CONTROL_MASK, - "change-focus-row-expansion", 1, - GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_EXPAND_RECURSIVE); - - gtk_binding_entry_add_signal (binding_set, - GDK_minus, 0, - "change-focus-row-expansion", 1, - GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_COLLAPSE); - gtk_binding_entry_add_signal (binding_set, - GDK_minus, GDK_CONTROL_MASK, - "change-focus-row-expansion", 1, - GTK_TYPE_ENUM, - GTK_CTREE_EXPANSION_COLLAPSE_RECURSIVE); - gtk_binding_entry_add_signal (binding_set, - GDK_KP_Subtract, 0, - "change-focus-row-expansion", 1, - GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_COLLAPSE); - gtk_binding_entry_add_signal (binding_set, - GDK_KP_Subtract, GDK_CONTROL_MASK, - "change-focus-row-expansion", 1, - GTK_TYPE_ENUM, - GTK_CTREE_EXPANSION_COLLAPSE_RECURSIVE); - gtk_binding_entry_add_signal (binding_set, - GDK_equal, 0, - "change-focus-row-expansion", 1, - GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_TOGGLE); - gtk_binding_entry_add_signal (binding_set, - GDK_KP_Equal, 0, - "change-focus-row-expansion", 1, - GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_TOGGLE); - gtk_binding_entry_add_signal (binding_set, - GDK_KP_Multiply, 0, - "change-focus-row-expansion", 1, - GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_TOGGLE); - gtk_binding_entry_add_signal (binding_set, - GDK_asterisk, 0, - "change-focus-row-expansion", 1, - GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_TOGGLE); - gtk_binding_entry_add_signal (binding_set, - GDK_KP_Multiply, GDK_CONTROL_MASK, - "change-focus-row-expansion", 1, - GTK_TYPE_ENUM, - GTK_CTREE_EXPANSION_TOGGLE_RECURSIVE); - gtk_binding_entry_add_signal (binding_set, - GDK_asterisk, GDK_CONTROL_MASK, - "change-focus-row-expansion", 1, - GTK_TYPE_ENUM, - GTK_CTREE_EXPANSION_TOGGLE_RECURSIVE); -} - -static void -gtk_ctree_set_arg (GtkObject *object, - GtkArg *arg, - guint arg_id) -{ - GtkCTree *ctree; - GtkCList *clist; - - ctree = GTK_CTREE (object); - clist = GTK_CLIST (ctree); - - switch (arg_id) - { - case ARG_N_COLUMNS: /* construct-only arg, only set at construction time */ - clist->columns = MAX (1, GTK_VALUE_UINT (*arg)); - ctree->tree_column = CLAMP (ctree->tree_column, 0, clist->columns); - break; - case ARG_TREE_COLUMN: /* construct-only arg, only set at construction time */ - ctree->tree_column = GTK_VALUE_UINT (*arg); - ctree->tree_column = CLAMP (ctree->tree_column, 0, clist->columns); - break; - case ARG_INDENT: - gtk_ctree_set_indent (ctree, GTK_VALUE_UINT (*arg)); - break; - case ARG_SPACING: - gtk_ctree_set_spacing (ctree, GTK_VALUE_UINT (*arg)); - break; - case ARG_SHOW_STUB: - gtk_ctree_set_show_stub (ctree, GTK_VALUE_BOOL (*arg)); - break; - case ARG_LINE_STYLE: - gtk_ctree_set_line_style (ctree, GTK_VALUE_ENUM (*arg)); - break; - case ARG_EXPANDER_STYLE: - gtk_ctree_set_expander_style (ctree, GTK_VALUE_ENUM (*arg)); - break; - default: - break; - } -} - -static void -gtk_ctree_get_arg (GtkObject *object, - GtkArg *arg, - guint arg_id) -{ - GtkCTree *ctree; - - ctree = GTK_CTREE (object); - - switch (arg_id) - { - case ARG_N_COLUMNS: - GTK_VALUE_UINT (*arg) = GTK_CLIST (ctree)->columns; - break; - case ARG_TREE_COLUMN: - GTK_VALUE_UINT (*arg) = ctree->tree_column; - break; - case ARG_INDENT: - GTK_VALUE_UINT (*arg) = ctree->tree_indent; - break; - case ARG_SPACING: - GTK_VALUE_UINT (*arg) = ctree->tree_spacing; - break; - case ARG_SHOW_STUB: - GTK_VALUE_BOOL (*arg) = ctree->show_stub; - break; - case ARG_LINE_STYLE: - GTK_VALUE_ENUM (*arg) = ctree->line_style; - break; - case ARG_EXPANDER_STYLE: - GTK_VALUE_ENUM (*arg) = ctree->expander_style; - break; - default: - arg->type = GTK_TYPE_INVALID; - break; - } -} - -static void -gtk_ctree_init (GtkCTree *ctree) -{ - GtkCList *clist; - - GTK_CLIST_SET_FLAG (ctree, CLIST_DRAW_DRAG_RECT); - GTK_CLIST_SET_FLAG (ctree, CLIST_DRAW_DRAG_LINE); - - clist = GTK_CLIST (ctree); - - ctree->tree_indent = 20; - ctree->tree_spacing = 5; - ctree->tree_column = 0; - ctree->line_style = GTK_CTREE_LINES_SOLID; - ctree->expander_style = GTK_CTREE_EXPANDER_SQUARE; - ctree->drag_compare = NULL; - ctree->show_stub = TRUE; - - clist->button_actions[0] |= GTK_BUTTON_EXPANDS; -} - -static void -ctree_attach_styles (GtkCTree *ctree, - GtkCTreeNode *node, - gpointer data) -{ - GtkCList *clist; - gint i; - - clist = GTK_CLIST (ctree); - - if (GTK_CTREE_ROW (node)->row.style) - GTK_CTREE_ROW (node)->row.style = - gtk_style_attach (GTK_CTREE_ROW (node)->row.style, clist->clist_window); - - if (GTK_CTREE_ROW (node)->row.fg_set || GTK_CTREE_ROW (node)->row.bg_set) - { - GdkColormap *colormap; - - colormap = gtk_widget_get_colormap (GTK_WIDGET (ctree)); - if (GTK_CTREE_ROW (node)->row.fg_set) - gdk_colormap_alloc_color (colormap, - &(GTK_CTREE_ROW (node)->row.foreground), - FALSE, TRUE); - if (GTK_CTREE_ROW (node)->row.bg_set) - gdk_colormap_alloc_color (colormap, - &(GTK_CTREE_ROW (node)->row.background), - FALSE, TRUE); - } - - for (i = 0; i < clist->columns; i++) - if (GTK_CTREE_ROW (node)->row.cell[i].style) - GTK_CTREE_ROW (node)->row.cell[i].style = - gtk_style_attach (GTK_CTREE_ROW (node)->row.cell[i].style, - clist->clist_window); -} - -static void -ctree_detach_styles (GtkCTree *ctree, - GtkCTreeNode *node, - gpointer data) -{ - GtkCList *clist; - gint i; - - clist = GTK_CLIST (ctree); - - if (GTK_CTREE_ROW (node)->row.style) - gtk_style_detach (GTK_CTREE_ROW (node)->row.style); - for (i = 0; i < clist->columns; i++) - if (GTK_CTREE_ROW (node)->row.cell[i].style) - gtk_style_detach (GTK_CTREE_ROW (node)->row.cell[i].style); -} - -static void -gtk_ctree_realize (GtkWidget *widget) -{ - GtkCTree *ctree; - GtkCList *clist; - GdkGCValues values; - GtkCTreeNode *node; - GtkCTreeNode *child; - gint i; - - g_return_if_fail (GTK_IS_CTREE (widget)); - - GTK_WIDGET_CLASS (parent_class)->realize (widget); - - ctree = GTK_CTREE (widget); - clist = GTK_CLIST (widget); - - node = GTK_CTREE_NODE (clist->row_list); - for (i = 0; i < clist->rows; i++) - { - if (GTK_CTREE_ROW (node)->children && !GTK_CTREE_ROW (node)->expanded) - for (child = GTK_CTREE_ROW (node)->children; child; - child = GTK_CTREE_ROW (child)->sibling) - gtk_ctree_pre_recursive (ctree, child, ctree_attach_styles, NULL); - node = GTK_CTREE_NODE_NEXT (node); - } - - values.foreground = widget->style->fg[GTK_STATE_NORMAL]; - values.background = widget->style->base[GTK_STATE_NORMAL]; - values.subwindow_mode = GDK_INCLUDE_INFERIORS; - values.line_style = GDK_LINE_SOLID; - ctree->lines_gc = gdk_gc_new_with_values (GTK_CLIST(widget)->clist_window, - &values, - GDK_GC_FOREGROUND | - GDK_GC_BACKGROUND | - GDK_GC_SUBWINDOW | - GDK_GC_LINE_STYLE); - - if (ctree->line_style == GTK_CTREE_LINES_DOTTED) - { - gint8 dashes[] = { 1, 1 }; - - gdk_gc_set_line_attributes (ctree->lines_gc, 1, - GDK_LINE_ON_OFF_DASH, GDK_CAP_BUTT, GDK_JOIN_MITER); - gdk_gc_set_dashes (ctree->lines_gc, 0, dashes, G_N_ELEMENTS (dashes)); - } -} - -static void -gtk_ctree_unrealize (GtkWidget *widget) -{ - GtkCTree *ctree; - GtkCList *clist; - - g_return_if_fail (GTK_IS_CTREE (widget)); - - GTK_WIDGET_CLASS (parent_class)->unrealize (widget); - - ctree = GTK_CTREE (widget); - clist = GTK_CLIST (widget); - - if (gtk_widget_get_realized (widget)) - { - GtkCTreeNode *node; - GtkCTreeNode *child; - gint i; - - node = GTK_CTREE_NODE (clist->row_list); - for (i = 0; i < clist->rows; i++) - { - if (GTK_CTREE_ROW (node)->children && - !GTK_CTREE_ROW (node)->expanded) - for (child = GTK_CTREE_ROW (node)->children; child; - child = GTK_CTREE_ROW (child)->sibling) - gtk_ctree_pre_recursive(ctree, child, ctree_detach_styles, NULL); - node = GTK_CTREE_NODE_NEXT (node); - } - } - - g_object_unref (ctree->lines_gc); -} - -static gint -gtk_ctree_button_press (GtkWidget *widget, - GdkEventButton *event) -{ - GtkCTree *ctree; - GtkCList *clist; - gint button_actions; - - g_return_val_if_fail (GTK_IS_CTREE (widget), FALSE); - g_return_val_if_fail (event != NULL, FALSE); - - ctree = GTK_CTREE (widget); - clist = GTK_CLIST (widget); - - button_actions = clist->button_actions[event->button - 1]; - - if (button_actions == GTK_BUTTON_IGNORED) - return FALSE; - - if (event->window == clist->clist_window) - { - GtkCTreeNode *work; - gint x; - gint y; - gint row; - gint column; - - x = event->x; - y = event->y; - - if (!gtk_clist_get_selection_info (clist, x, y, &row, &column)) - return FALSE; - - work = GTK_CTREE_NODE (g_list_nth (clist->row_list, row)); - - if (button_actions & GTK_BUTTON_EXPANDS && - (GTK_CTREE_ROW (work)->children && !GTK_CTREE_ROW (work)->is_leaf && - (event->type == GDK_2BUTTON_PRESS || - ctree_is_hot_spot (ctree, work, row, x, y)))) - { - if (GTK_CTREE_ROW (work)->expanded) - gtk_ctree_collapse (ctree, work); - else - gtk_ctree_expand (ctree, work); - - return TRUE; - } - } - - return GTK_WIDGET_CLASS (parent_class)->button_press_event (widget, event); -} - -static void -draw_drag_highlight (GtkCList *clist, - GtkCListRow *dest_row, - gint dest_row_number, - GtkCListDragPos drag_pos) -{ - GtkCTree *ctree; - GdkPoint points[4]; - gint level; - gint i; - gint y = 0; - - g_return_if_fail (GTK_IS_CTREE (clist)); - - ctree = GTK_CTREE (clist); - - level = ((GtkCTreeRow *)(dest_row))->level; - - y = ROW_TOP_YPIXEL (clist, dest_row_number) - 1; - - switch (drag_pos) - { - case GTK_CLIST_DRAG_NONE: - break; - case GTK_CLIST_DRAG_AFTER: - y += clist->row_height + 1; - case GTK_CLIST_DRAG_BEFORE: - - if (clist->column[ctree->tree_column].visible) - switch (clist->column[ctree->tree_column].justification) - { - case GTK_JUSTIFY_CENTER: - case GTK_JUSTIFY_FILL: - case GTK_JUSTIFY_LEFT: - if (ctree->tree_column > 0) - gdk_draw_line (clist->clist_window, clist->xor_gc, - COLUMN_LEFT_XPIXEL(clist, 0), y, - COLUMN_LEFT_XPIXEL(clist, ctree->tree_column - 1)+ - clist->column[ctree->tree_column - 1].area.width, - y); - - gdk_draw_line (clist->clist_window, clist->xor_gc, - COLUMN_LEFT_XPIXEL(clist, ctree->tree_column) + - ctree->tree_indent * level - - (ctree->tree_indent - PM_SIZE) / 2, y, - GTK_WIDGET (ctree)->allocation.width, y); - break; - case GTK_JUSTIFY_RIGHT: - if (ctree->tree_column < clist->columns - 1) - gdk_draw_line (clist->clist_window, clist->xor_gc, - COLUMN_LEFT_XPIXEL(clist, ctree->tree_column + 1), - y, - COLUMN_LEFT_XPIXEL(clist, clist->columns - 1) + - clist->column[clist->columns - 1].area.width, y); - - gdk_draw_line (clist->clist_window, clist->xor_gc, - 0, y, COLUMN_LEFT_XPIXEL(clist, ctree->tree_column) - + clist->column[ctree->tree_column].area.width - - ctree->tree_indent * level + - (ctree->tree_indent - PM_SIZE) / 2, y); - break; - } - else - gdk_draw_line (clist->clist_window, clist->xor_gc, - 0, y, clist->clist_window_width, y); - break; - case GTK_CLIST_DRAG_INTO: - y = ROW_TOP_YPIXEL (clist, dest_row_number) + clist->row_height; - - if (clist->column[ctree->tree_column].visible) - switch (clist->column[ctree->tree_column].justification) - { - case GTK_JUSTIFY_CENTER: - case GTK_JUSTIFY_FILL: - case GTK_JUSTIFY_LEFT: - points[0].x = COLUMN_LEFT_XPIXEL(clist, ctree->tree_column) + - ctree->tree_indent * level - (ctree->tree_indent - PM_SIZE) / 2; - points[0].y = y; - points[3].x = points[0].x; - points[3].y = y - clist->row_height - 1; - points[1].x = clist->clist_window_width - 1; - points[1].y = points[0].y; - points[2].x = points[1].x; - points[2].y = points[3].y; - - for (i = 0; i < 3; i++) - gdk_draw_line (clist->clist_window, clist->xor_gc, - points[i].x, points[i].y, - points[i+1].x, points[i+1].y); - - if (ctree->tree_column > 0) - { - points[0].x = COLUMN_LEFT_XPIXEL(clist, - ctree->tree_column - 1) + - clist->column[ctree->tree_column - 1].area.width ; - points[0].y = y; - points[3].x = points[0].x; - points[3].y = y - clist->row_height - 1; - points[1].x = 0; - points[1].y = points[0].y; - points[2].x = 0; - points[2].y = points[3].y; - - for (i = 0; i < 3; i++) - gdk_draw_line (clist->clist_window, clist->xor_gc, - points[i].x, points[i].y, points[i+1].x, - points[i+1].y); - } - break; - case GTK_JUSTIFY_RIGHT: - points[0].x = COLUMN_LEFT_XPIXEL(clist, ctree->tree_column) - - ctree->tree_indent * level + (ctree->tree_indent - PM_SIZE) / 2 + - clist->column[ctree->tree_column].area.width; - points[0].y = y; - points[3].x = points[0].x; - points[3].y = y - clist->row_height - 1; - points[1].x = 0; - points[1].y = points[0].y; - points[2].x = 0; - points[2].y = points[3].y; - - for (i = 0; i < 3; i++) - gdk_draw_line (clist->clist_window, clist->xor_gc, - points[i].x, points[i].y, - points[i+1].x, points[i+1].y); - - if (ctree->tree_column < clist->columns - 1) - { - points[0].x = COLUMN_LEFT_XPIXEL(clist, ctree->tree_column +1); - points[0].y = y; - points[3].x = points[0].x; - points[3].y = y - clist->row_height - 1; - points[1].x = clist->clist_window_width - 1; - points[1].y = points[0].y; - points[2].x = points[1].x; - points[2].y = points[3].y; - - for (i = 0; i < 3; i++) - gdk_draw_line (clist->clist_window, clist->xor_gc, - points[i].x, points[i].y, - points[i+1].x, points[i+1].y); - } - break; - } - else - gdk_draw_rectangle (clist->clist_window, clist->xor_gc, FALSE, - 0, y - clist->row_height, - clist->clist_window_width - 1, clist->row_height); - break; - } -} - -static gint -draw_cell_pixmap (GdkWindow *window, - GdkRectangle *clip_rectangle, - GdkGC *fg_gc, - GdkPixmap *pixmap, - GdkBitmap *mask, - gint x, - gint y, - gint width, - gint height) -{ - gint xsrc = 0; - gint ysrc = 0; - - if (mask) - { - gdk_gc_set_clip_mask (fg_gc, mask); - gdk_gc_set_clip_origin (fg_gc, x, y); - } - if (x < clip_rectangle->x) - { - xsrc = clip_rectangle->x - x; - width -= xsrc; - x = clip_rectangle->x; - } - if (x + width > clip_rectangle->x + clip_rectangle->width) - width = clip_rectangle->x + clip_rectangle->width - x; - - if (y < clip_rectangle->y) - { - ysrc = clip_rectangle->y - y; - height -= ysrc; - y = clip_rectangle->y; - } - if (y + height > clip_rectangle->y + clip_rectangle->height) - height = clip_rectangle->y + clip_rectangle->height - y; - - if (width > 0 && height > 0) - gdk_draw_drawable (window, fg_gc, pixmap, xsrc, ysrc, x, y, width, height); - - if (mask) - { - gdk_gc_set_clip_rectangle (fg_gc, NULL); - gdk_gc_set_clip_origin (fg_gc, 0, 0); - } - - return x + MAX (width, 0); -} - -static void -get_cell_style (GtkCList *clist, - GtkCListRow *clist_row, - gint state, - gint column, - GtkStyle **style, - GdkGC **fg_gc, - GdkGC **bg_gc) -{ - gint fg_state; - - if ((state == GTK_STATE_NORMAL) && - (GTK_WIDGET (clist)->state == GTK_STATE_INSENSITIVE)) - fg_state = GTK_STATE_INSENSITIVE; - else - fg_state = state; - - if (clist_row->cell[column].style) - { - if (style) - *style = clist_row->cell[column].style; - if (fg_gc) - *fg_gc = clist_row->cell[column].style->fg_gc[fg_state]; - if (bg_gc) { - if (state == GTK_STATE_SELECTED) - *bg_gc = clist_row->cell[column].style->bg_gc[state]; - else - *bg_gc = clist_row->cell[column].style->base_gc[state]; - } - } - else if (clist_row->style) - { - if (style) - *style = clist_row->style; - if (fg_gc) - *fg_gc = clist_row->style->fg_gc[fg_state]; - if (bg_gc) { - if (state == GTK_STATE_SELECTED) - *bg_gc = clist_row->style->bg_gc[state]; - else - *bg_gc = clist_row->style->base_gc[state]; - } - } - else - { - if (style) - *style = GTK_WIDGET (clist)->style; - if (fg_gc) - *fg_gc = GTK_WIDGET (clist)->style->fg_gc[fg_state]; - if (bg_gc) { - if (state == GTK_STATE_SELECTED) - *bg_gc = GTK_WIDGET (clist)->style->bg_gc[state]; - else - *bg_gc = GTK_WIDGET (clist)->style->base_gc[state]; - } - - if (state != GTK_STATE_SELECTED) - { - if (fg_gc && clist_row->fg_set) - *fg_gc = clist->fg_gc; - if (bg_gc && clist_row->bg_set) - *bg_gc = clist->bg_gc; - } - } -} - -static gint -gtk_ctree_draw_expander (GtkCTree *ctree, - GtkCTreeRow *ctree_row, - GtkStyle *style, - GdkRectangle *clip_rectangle, - gint x) -{ - GtkCList *clist; - GdkPoint points[3]; - gint justification_factor; - gint y; - - if (ctree->expander_style == GTK_CTREE_EXPANDER_NONE) - return x; - - clist = GTK_CLIST (ctree); - if (clist->column[ctree->tree_column].justification == GTK_JUSTIFY_RIGHT) - justification_factor = -1; - else - justification_factor = 1; - y = (clip_rectangle->y + (clip_rectangle->height - PM_SIZE) / 2 - - (clip_rectangle->height + 1) % 2); - - if (!ctree_row->children) - { - switch (ctree->expander_style) - { - case GTK_CTREE_EXPANDER_NONE: - return x; - case GTK_CTREE_EXPANDER_TRIANGLE: - return x + justification_factor * (PM_SIZE + 3); - case GTK_CTREE_EXPANDER_SQUARE: - case GTK_CTREE_EXPANDER_CIRCULAR: - return x + justification_factor * (PM_SIZE + 1); - } - } - - gdk_gc_set_clip_rectangle (style->fg_gc[GTK_STATE_NORMAL], clip_rectangle); - gdk_gc_set_clip_rectangle (style->base_gc[GTK_STATE_NORMAL], clip_rectangle); - - switch (ctree->expander_style) - { - case GTK_CTREE_EXPANDER_NONE: - break; - case GTK_CTREE_EXPANDER_TRIANGLE: - if (ctree_row->expanded) - { - points[0].x = x; - points[0].y = y + (PM_SIZE + 2) / 6; - points[1].x = points[0].x + justification_factor * (PM_SIZE + 2); - points[1].y = points[0].y; - points[2].x = (points[0].x + - justification_factor * (PM_SIZE + 2) / 2); - points[2].y = y + 2 * (PM_SIZE + 2) / 3; - } - else - { - points[0].x = x + justification_factor * ((PM_SIZE + 2) / 6 + 2); - points[0].y = y - 1; - points[1].x = points[0].x; - points[1].y = points[0].y + (PM_SIZE + 2); - points[2].x = (points[0].x + - justification_factor * (2 * (PM_SIZE + 2) / 3 - 1)); - points[2].y = points[0].y + (PM_SIZE + 2) / 2; - } - - gdk_draw_polygon (clist->clist_window, style->base_gc[GTK_STATE_NORMAL], - TRUE, points, 3); - gdk_draw_polygon (clist->clist_window, style->fg_gc[GTK_STATE_NORMAL], - FALSE, points, 3); - - x += justification_factor * (PM_SIZE + 3); - break; - case GTK_CTREE_EXPANDER_SQUARE: - case GTK_CTREE_EXPANDER_CIRCULAR: - if (justification_factor == -1) - x += justification_factor * (PM_SIZE + 1); - - if (ctree->expander_style == GTK_CTREE_EXPANDER_CIRCULAR) - { - gdk_draw_arc (clist->clist_window, style->base_gc[GTK_STATE_NORMAL], - TRUE, x, y, PM_SIZE, PM_SIZE, 0, 360 * 64); - gdk_draw_arc (clist->clist_window, style->fg_gc[GTK_STATE_NORMAL], - FALSE, x, y, PM_SIZE, PM_SIZE, 0, 360 * 64); - } - else - { - gdk_draw_rectangle (clist->clist_window, - style->base_gc[GTK_STATE_NORMAL], TRUE, - x, y, PM_SIZE, PM_SIZE); - gdk_draw_rectangle (clist->clist_window, - style->fg_gc[GTK_STATE_NORMAL], FALSE, - x, y, PM_SIZE, PM_SIZE); - } - - gdk_draw_line (clist->clist_window, style->fg_gc[GTK_STATE_NORMAL], - x + 2, y + PM_SIZE / 2, x + PM_SIZE - 2, y + PM_SIZE / 2); - - if (!ctree_row->expanded) - gdk_draw_line (clist->clist_window, style->fg_gc[GTK_STATE_NORMAL], - x + PM_SIZE / 2, y + 2, - x + PM_SIZE / 2, y + PM_SIZE - 2); - - if (justification_factor == 1) - x += justification_factor * (PM_SIZE + 1); - break; - } - - gdk_gc_set_clip_rectangle (style->fg_gc[GTK_STATE_NORMAL], NULL); - gdk_gc_set_clip_rectangle (style->base_gc[GTK_STATE_NORMAL], NULL); - - return x; -} - - -static gint -gtk_ctree_draw_lines (GtkCTree *ctree, - GtkCTreeRow *ctree_row, - gint row, - gint column, - gint state, - GdkRectangle *clip_rectangle, - GdkRectangle *cell_rectangle, - GdkRectangle *crect, - GdkRectangle *area, - GtkStyle *style) -{ - GtkCList *clist; - GtkCTreeNode *node; - GtkCTreeNode *parent; - GdkRectangle tree_rectangle; - GdkRectangle tc_rectangle; - GdkGC *bg_gc; - gint offset; - gint offset_x; - gint offset_y; - gint xcenter; - gint ycenter; - gint next_level; - gint column_right; - gint column_left; - gint justify_right; - gint justification_factor; - - clist = GTK_CLIST (ctree); - ycenter = clip_rectangle->y + (clip_rectangle->height / 2); - justify_right = (clist->column[column].justification == GTK_JUSTIFY_RIGHT); - - if (justify_right) - { - offset = (clip_rectangle->x + clip_rectangle->width - 1 - - ctree->tree_indent * (ctree_row->level - 1)); - justification_factor = -1; - } - else - { - offset = clip_rectangle->x + ctree->tree_indent * (ctree_row->level - 1); - justification_factor = 1; - } - - switch (ctree->line_style) - { - case GTK_CTREE_LINES_NONE: - break; - case GTK_CTREE_LINES_TABBED: - xcenter = offset + justification_factor * TAB_SIZE; - - column_right = (COLUMN_LEFT_XPIXEL (clist, ctree->tree_column) + - clist->column[ctree->tree_column].area.width + - COLUMN_INSET); - column_left = (COLUMN_LEFT_XPIXEL (clist, ctree->tree_column) - - COLUMN_INSET - CELL_SPACING); - - if (area) - { - tree_rectangle.y = crect->y; - tree_rectangle.height = crect->height; - - if (justify_right) - { - tree_rectangle.x = xcenter; - tree_rectangle.width = column_right - xcenter; - } - else - { - tree_rectangle.x = column_left; - tree_rectangle.width = xcenter - column_left; - } - - if (!gdk_rectangle_intersect (area, &tree_rectangle, &tc_rectangle)) - { - offset += justification_factor * 3; - break; - } - } - - gdk_gc_set_clip_rectangle (ctree->lines_gc, crect); - - next_level = ctree_row->level; - - if (!ctree_row->sibling || (ctree_row->children && ctree_row->expanded)) - { - node = gtk_ctree_find_node_ptr (ctree, ctree_row); - if (GTK_CTREE_NODE_NEXT (node)) - next_level = GTK_CTREE_ROW (GTK_CTREE_NODE_NEXT (node))->level; - else - next_level = 0; - } - - if (ctree->tree_indent > 0) - { - node = ctree_row->parent; - while (node) - { - xcenter -= (justification_factor * ctree->tree_indent); - - if ((justify_right && xcenter < column_left) || - (!justify_right && xcenter > column_right)) - { - node = GTK_CTREE_ROW (node)->parent; - continue; - } - - tree_rectangle.y = cell_rectangle->y; - tree_rectangle.height = cell_rectangle->height; - if (justify_right) - { - tree_rectangle.x = MAX (xcenter - ctree->tree_indent + 1, - column_left); - tree_rectangle.width = MIN (xcenter - column_left, - ctree->tree_indent); - } - else - { - tree_rectangle.x = xcenter; - tree_rectangle.width = MIN (column_right - xcenter, - ctree->tree_indent); - } - - if (!area || gdk_rectangle_intersect (area, &tree_rectangle, - &tc_rectangle)) - { - get_cell_style (clist, >K_CTREE_ROW (node)->row, - state, column, NULL, NULL, &bg_gc); - - if (bg_gc == clist->bg_gc) - gdk_gc_set_foreground - (clist->bg_gc, >K_CTREE_ROW (node)->row.background); - - if (!area) - gdk_draw_rectangle (clist->clist_window, bg_gc, TRUE, - tree_rectangle.x, - tree_rectangle.y, - tree_rectangle.width, - tree_rectangle.height); - else - gdk_draw_rectangle (clist->clist_window, bg_gc, TRUE, - tc_rectangle.x, - tc_rectangle.y, - tc_rectangle.width, - tc_rectangle.height); - } - if (next_level > GTK_CTREE_ROW (node)->level) - gdk_draw_line (clist->clist_window, ctree->lines_gc, - xcenter, crect->y, - xcenter, crect->y + crect->height); - else - { - gint width; - - offset_x = MIN (ctree->tree_indent, 2 * TAB_SIZE); - width = offset_x / 2 + offset_x % 2; - - parent = GTK_CTREE_ROW (node)->parent; - - tree_rectangle.y = ycenter; - tree_rectangle.height = (cell_rectangle->y - ycenter + - cell_rectangle->height); - - if (justify_right) - { - tree_rectangle.x = MAX(xcenter + 1 - width, column_left); - tree_rectangle.width = MIN (xcenter + 1 - column_left, - width); - } - else - { - tree_rectangle.x = xcenter; - tree_rectangle.width = MIN (column_right - xcenter, - width); - } - - if (!area || - gdk_rectangle_intersect (area, &tree_rectangle, - &tc_rectangle)) - { - if (parent) - { - get_cell_style (clist, >K_CTREE_ROW (parent)->row, - state, column, NULL, NULL, &bg_gc); - if (bg_gc == clist->bg_gc) - gdk_gc_set_foreground - (clist->bg_gc, - >K_CTREE_ROW (parent)->row.background); - } - else if (state == GTK_STATE_SELECTED) - bg_gc = style->base_gc[state]; - else - bg_gc = GTK_WIDGET (clist)->style->base_gc[state]; - - if (!area) - gdk_draw_rectangle (clist->clist_window, bg_gc, TRUE, - tree_rectangle.x, - tree_rectangle.y, - tree_rectangle.width, - tree_rectangle.height); - else - gdk_draw_rectangle (clist->clist_window, - bg_gc, TRUE, - tc_rectangle.x, - tc_rectangle.y, - tc_rectangle.width, - tc_rectangle.height); - } - - get_cell_style (clist, >K_CTREE_ROW (node)->row, - state, column, NULL, NULL, &bg_gc); - if (bg_gc == clist->bg_gc) - gdk_gc_set_foreground - (clist->bg_gc, >K_CTREE_ROW (node)->row.background); - - gdk_gc_set_clip_rectangle (bg_gc, crect); - gdk_draw_arc (clist->clist_window, bg_gc, TRUE, - xcenter - (justify_right * offset_x), - cell_rectangle->y, - offset_x, clist->row_height, - (180 + (justify_right * 90)) * 64, 90 * 64); - gdk_gc_set_clip_rectangle (bg_gc, NULL); - - gdk_draw_line (clist->clist_window, ctree->lines_gc, - xcenter, cell_rectangle->y, xcenter, ycenter); - - if (justify_right) - gdk_draw_arc (clist->clist_window, ctree->lines_gc, FALSE, - xcenter - offset_x, cell_rectangle->y, - offset_x, clist->row_height, - 270 * 64, 90 * 64); - else - gdk_draw_arc (clist->clist_window, ctree->lines_gc, FALSE, - xcenter, cell_rectangle->y, - offset_x, clist->row_height, - 180 * 64, 90 * 64); - } - node = GTK_CTREE_ROW (node)->parent; - } - } - - if (state != GTK_STATE_SELECTED) - { - tree_rectangle.y = clip_rectangle->y; - tree_rectangle.height = clip_rectangle->height; - tree_rectangle.width = COLUMN_INSET + CELL_SPACING + - MIN (clist->column[ctree->tree_column].area.width + COLUMN_INSET, - TAB_SIZE); - - if (justify_right) - tree_rectangle.x = MAX (xcenter + 1, column_left); - else - tree_rectangle.x = column_left; - - if (!area) - gdk_draw_rectangle (clist->clist_window, - GTK_WIDGET - (ctree)->style->base_gc[GTK_STATE_NORMAL], - TRUE, - tree_rectangle.x, - tree_rectangle.y, - tree_rectangle.width, - tree_rectangle.height); - else if (gdk_rectangle_intersect (area, &tree_rectangle, - &tc_rectangle)) - gdk_draw_rectangle (clist->clist_window, - GTK_WIDGET - (ctree)->style->base_gc[GTK_STATE_NORMAL], - TRUE, - tc_rectangle.x, - tc_rectangle.y, - tc_rectangle.width, - tc_rectangle.height); - } - - xcenter = offset + (justification_factor * ctree->tree_indent / 2); - - get_cell_style (clist, &ctree_row->row, state, column, NULL, NULL, - &bg_gc); - if (bg_gc == clist->bg_gc) - gdk_gc_set_foreground (clist->bg_gc, &ctree_row->row.background); - - gdk_gc_set_clip_rectangle (bg_gc, crect); - if (ctree_row->is_leaf) - { - GdkPoint points[6]; - - points[0].x = offset + justification_factor * TAB_SIZE; - points[0].y = cell_rectangle->y; - - points[1].x = points[0].x - justification_factor * 4; - points[1].y = points[0].y; - - points[2].x = points[1].x - justification_factor * 2; - points[2].y = points[1].y + 3; - - points[3].x = points[2].x; - points[3].y = points[2].y + clist->row_height - 5; - - points[4].x = points[3].x + justification_factor * 2; - points[4].y = points[3].y + 3; - - points[5].x = points[4].x + justification_factor * 4; - points[5].y = points[4].y; - - gdk_draw_polygon (clist->clist_window, bg_gc, TRUE, points, 6); - gdk_draw_lines (clist->clist_window, ctree->lines_gc, points, 6); - } - else - { - gdk_draw_arc (clist->clist_window, bg_gc, TRUE, - offset - (justify_right * 2 * TAB_SIZE), - cell_rectangle->y, - 2 * TAB_SIZE, clist->row_height, - (90 + (180 * justify_right)) * 64, 180 * 64); - gdk_draw_arc (clist->clist_window, ctree->lines_gc, FALSE, - offset - (justify_right * 2 * TAB_SIZE), - cell_rectangle->y, - 2 * TAB_SIZE, clist->row_height, - (90 + (180 * justify_right)) * 64, 180 * 64); - } - gdk_gc_set_clip_rectangle (bg_gc, NULL); - gdk_gc_set_clip_rectangle (ctree->lines_gc, NULL); - - offset += justification_factor * 3; - break; - default: - xcenter = offset + justification_factor * PM_SIZE / 2; - - if (area) - { - tree_rectangle.y = crect->y; - tree_rectangle.height = crect->height; - - if (justify_right) - { - tree_rectangle.x = xcenter - PM_SIZE / 2 - 2; - tree_rectangle.width = (clip_rectangle->x + - clip_rectangle->width -tree_rectangle.x); - } - else - { - tree_rectangle.x = clip_rectangle->x + PM_SIZE / 2; - tree_rectangle.width = (xcenter + PM_SIZE / 2 + 2 - - clip_rectangle->x); - } - - if (!gdk_rectangle_intersect (area, &tree_rectangle, &tc_rectangle)) - break; - } - - offset_x = 1; - offset_y = 0; - if (ctree->line_style == GTK_CTREE_LINES_DOTTED) - { - offset_x += abs((clip_rectangle->x + clist->hoffset) % 2); - offset_y = abs((cell_rectangle->y + clist->voffset) % 2); - } - - clip_rectangle->y--; - clip_rectangle->height++; - gdk_gc_set_clip_rectangle (ctree->lines_gc, clip_rectangle); - gdk_draw_line (clist->clist_window, ctree->lines_gc, - xcenter, - (ctree->show_stub || clist->row_list->data != ctree_row) ? - cell_rectangle->y + offset_y : ycenter, - xcenter, - (ctree_row->sibling) ? crect->y +crect->height : ycenter); - - gdk_draw_line (clist->clist_window, ctree->lines_gc, - xcenter + (justification_factor * offset_x), ycenter, - xcenter + (justification_factor * (PM_SIZE / 2 + 2)), - ycenter); - - node = ctree_row->parent; - while (node) - { - xcenter -= (justification_factor * ctree->tree_indent); - - if (GTK_CTREE_ROW (node)->sibling) - gdk_draw_line (clist->clist_window, ctree->lines_gc, - xcenter, cell_rectangle->y + offset_y, - xcenter, crect->y + crect->height); - node = GTK_CTREE_ROW (node)->parent; - } - gdk_gc_set_clip_rectangle (ctree->lines_gc, NULL); - clip_rectangle->y++; - clip_rectangle->height--; - break; - } - return offset; -} - -static void -draw_row (GtkCList *clist, - GdkRectangle *area, - gint row, - GtkCListRow *clist_row) -{ - GtkWidget *widget; - GtkCTree *ctree; - GdkRectangle *crect; - GdkRectangle row_rectangle; - GdkRectangle cell_rectangle; - GdkRectangle clip_rectangle; - GdkRectangle intersect_rectangle; - gint last_column; - gint column_left = 0; - gint column_right = 0; - gint offset = 0; - gint state; - gint i; - - g_return_if_fail (clist != NULL); - - /* bail now if we arn't drawable yet */ - if (!GTK_WIDGET_DRAWABLE (clist) || row < 0 || row >= clist->rows) - return; - - widget = GTK_WIDGET (clist); - ctree = GTK_CTREE (clist); - - /* if the function is passed the pointer to the row instead of null, - * it avoids this expensive lookup */ - if (!clist_row) - clist_row = (g_list_nth (clist->row_list, row))->data; - - /* rectangle of the entire row */ - row_rectangle.x = 0; - row_rectangle.y = ROW_TOP_YPIXEL (clist, row); - row_rectangle.width = clist->clist_window_width; - row_rectangle.height = clist->row_height; - - /* rectangle of the cell spacing above the row */ - cell_rectangle.x = 0; - cell_rectangle.y = row_rectangle.y - CELL_SPACING; - cell_rectangle.width = row_rectangle.width; - cell_rectangle.height = CELL_SPACING; - - /* rectangle used to clip drawing operations, its y and height - * positions only need to be set once, so we set them once here. - * the x and width are set withing the drawing loop below once per - * column */ - clip_rectangle.y = row_rectangle.y; - clip_rectangle.height = row_rectangle.height; - - if (clist_row->state == GTK_STATE_NORMAL) - { - if (clist_row->fg_set) - gdk_gc_set_foreground (clist->fg_gc, &clist_row->foreground); - if (clist_row->bg_set) - gdk_gc_set_foreground (clist->bg_gc, &clist_row->background); - } - - state = clist_row->state; - - gdk_gc_set_foreground (ctree->lines_gc, - &widget->style->fg[clist_row->state]); - - /* draw the cell borders */ - if (area) - { - crect = &intersect_rectangle; - - if (gdk_rectangle_intersect (area, &cell_rectangle, crect)) - gdk_draw_rectangle (clist->clist_window, - widget->style->base_gc[GTK_STATE_NORMAL], TRUE, - crect->x, crect->y, crect->width, crect->height); - } - else - { - crect = &cell_rectangle; - - gdk_draw_rectangle (clist->clist_window, - widget->style->base_gc[GTK_STATE_NORMAL], TRUE, - crect->x, crect->y, crect->width, crect->height); - } - - /* horizontal black lines */ - if (ctree->line_style == GTK_CTREE_LINES_TABBED) - { - - column_right = (COLUMN_LEFT_XPIXEL (clist, ctree->tree_column) + - clist->column[ctree->tree_column].area.width + - COLUMN_INSET); - column_left = (COLUMN_LEFT_XPIXEL (clist, ctree->tree_column) - - COLUMN_INSET - (ctree->tree_column != 0) * CELL_SPACING); - - switch (clist->column[ctree->tree_column].justification) - { - case GTK_JUSTIFY_CENTER: - case GTK_JUSTIFY_FILL: - case GTK_JUSTIFY_LEFT: - offset = (column_left + ctree->tree_indent * - (((GtkCTreeRow *)clist_row)->level - 1)); - - gdk_draw_line (clist->clist_window, ctree->lines_gc, - MIN (offset + TAB_SIZE, column_right), - cell_rectangle.y, - clist->clist_window_width, cell_rectangle.y); - break; - case GTK_JUSTIFY_RIGHT: - offset = (column_right - 1 - ctree->tree_indent * - (((GtkCTreeRow *)clist_row)->level - 1)); - - gdk_draw_line (clist->clist_window, ctree->lines_gc, - -1, cell_rectangle.y, - MAX (offset - TAB_SIZE, column_left), - cell_rectangle.y); - break; - } - } - - /* the last row has to clear its bottom cell spacing too */ - if (clist_row == clist->row_list_end->data) - { - cell_rectangle.y += clist->row_height + CELL_SPACING; - - if (!area || gdk_rectangle_intersect (area, &cell_rectangle, crect)) - { - gdk_draw_rectangle (clist->clist_window, - widget->style->base_gc[GTK_STATE_NORMAL], TRUE, - crect->x, crect->y, crect->width, crect->height); - - /* horizontal black lines */ - if (ctree->line_style == GTK_CTREE_LINES_TABBED) - { - switch (clist->column[ctree->tree_column].justification) - { - case GTK_JUSTIFY_CENTER: - case GTK_JUSTIFY_FILL: - case GTK_JUSTIFY_LEFT: - gdk_draw_line (clist->clist_window, ctree->lines_gc, - MIN (column_left + TAB_SIZE + COLUMN_INSET + - (((GtkCTreeRow *)clist_row)->level > 1) * - MIN (ctree->tree_indent / 2, TAB_SIZE), - column_right), - cell_rectangle.y, - clist->clist_window_width, cell_rectangle.y); - break; - case GTK_JUSTIFY_RIGHT: - gdk_draw_line (clist->clist_window, ctree->lines_gc, - -1, cell_rectangle.y, - MAX (column_right - TAB_SIZE - 1 - - COLUMN_INSET - - (((GtkCTreeRow *)clist_row)->level > 1) * - MIN (ctree->tree_indent / 2, TAB_SIZE), - column_left - 1), cell_rectangle.y); - break; - } - } - } - } - - for (last_column = clist->columns - 1; - last_column >= 0 && !clist->column[last_column].visible; last_column--) - ; - - /* iterate and draw all the columns (row cells) and draw their contents */ - for (i = 0; i < clist->columns; i++) - { - GtkStyle *style; - GdkGC *fg_gc; - GdkGC *bg_gc; - PangoLayout *layout = NULL; - PangoRectangle logical_rect; - - gint width; - gint height; - gint pixmap_width; - gint string_width; - gint old_offset; - - if (!clist->column[i].visible) - continue; - - get_cell_style (clist, clist_row, state, i, &style, &fg_gc, &bg_gc); - - /* calculate clipping region */ - clip_rectangle.x = clist->column[i].area.x + clist->hoffset; - clip_rectangle.width = clist->column[i].area.width; - - cell_rectangle.x = clip_rectangle.x - COLUMN_INSET - CELL_SPACING; - cell_rectangle.width = (clip_rectangle.width + 2 * COLUMN_INSET + - (1 + (i == last_column)) * CELL_SPACING); - cell_rectangle.y = clip_rectangle.y; - cell_rectangle.height = clip_rectangle.height; - - string_width = 0; - pixmap_width = 0; - - if (area && !gdk_rectangle_intersect (area, &cell_rectangle, - &intersect_rectangle)) - { - if (i != ctree->tree_column) - continue; - } - else - { - gdk_draw_rectangle (clist->clist_window, bg_gc, TRUE, - crect->x, crect->y, crect->width, crect->height); - - - layout = _gtk_clist_create_cell_layout (clist, clist_row, i); - if (layout) - { - pango_layout_get_pixel_extents (layout, NULL, &logical_rect); - width = logical_rect.width; - } - else - width = 0; - - switch (clist_row->cell[i].type) - { - case GTK_CELL_PIXMAP: - gdk_drawable_get_size - (GTK_CELL_PIXMAP (clist_row->cell[i])->pixmap, &pixmap_width, - &height); - width += pixmap_width; - break; - case GTK_CELL_PIXTEXT: - if (GTK_CELL_PIXTEXT (clist_row->cell[i])->pixmap) - { - gdk_drawable_get_size - (GTK_CELL_PIXTEXT (clist_row->cell[i])->pixmap, - &pixmap_width, &height); - width += pixmap_width; - } - - if (GTK_CELL_PIXTEXT (clist_row->cell[i])->text && - GTK_CELL_PIXTEXT (clist_row->cell[i])->pixmap) - width += GTK_CELL_PIXTEXT (clist_row->cell[i])->spacing; - - if (i == ctree->tree_column) - width += (ctree->tree_indent * - ((GtkCTreeRow *)clist_row)->level); - break; - default: - break; - } - - switch (clist->column[i].justification) - { - case GTK_JUSTIFY_LEFT: - offset = clip_rectangle.x + clist_row->cell[i].horizontal; - break; - case GTK_JUSTIFY_RIGHT: - offset = (clip_rectangle.x + clist_row->cell[i].horizontal + - clip_rectangle.width - width); - break; - case GTK_JUSTIFY_CENTER: - case GTK_JUSTIFY_FILL: - offset = (clip_rectangle.x + clist_row->cell[i].horizontal + - (clip_rectangle.width / 2) - (width / 2)); - break; - }; - - if (i != ctree->tree_column) - { - offset += clist_row->cell[i].horizontal; - switch (clist_row->cell[i].type) - { - case GTK_CELL_PIXMAP: - draw_cell_pixmap - (clist->clist_window, &clip_rectangle, fg_gc, - GTK_CELL_PIXMAP (clist_row->cell[i])->pixmap, - GTK_CELL_PIXMAP (clist_row->cell[i])->mask, - offset, - clip_rectangle.y + clist_row->cell[i].vertical + - (clip_rectangle.height - height) / 2, - pixmap_width, height); - break; - case GTK_CELL_PIXTEXT: - offset = draw_cell_pixmap - (clist->clist_window, &clip_rectangle, fg_gc, - GTK_CELL_PIXTEXT (clist_row->cell[i])->pixmap, - GTK_CELL_PIXTEXT (clist_row->cell[i])->mask, - offset, - clip_rectangle.y + clist_row->cell[i].vertical + - (clip_rectangle.height - height) / 2, - pixmap_width, height); - offset += GTK_CELL_PIXTEXT (clist_row->cell[i])->spacing; - - /* Fall through */ - case GTK_CELL_TEXT: - if (layout) - { - gint row_center_offset = (clist->row_height - logical_rect.height) / 2; - - gdk_gc_set_clip_rectangle (fg_gc, &clip_rectangle); - gdk_draw_layout (clist->clist_window, fg_gc, - offset, - row_rectangle.y + row_center_offset + clist_row->cell[i].vertical, - layout); - gdk_gc_set_clip_rectangle (fg_gc, NULL); - g_object_unref (G_OBJECT (layout)); - } - break; - default: - break; - } - continue; - } - } - - if (bg_gc == clist->bg_gc) - gdk_gc_set_background (ctree->lines_gc, &clist_row->background); - - /* draw ctree->tree_column */ - cell_rectangle.y -= CELL_SPACING; - cell_rectangle.height += CELL_SPACING; - - if (area && !gdk_rectangle_intersect (area, &cell_rectangle, - &intersect_rectangle)) - { - if (layout) - g_object_unref (G_OBJECT (layout)); - continue; - } - - /* draw lines */ - offset = gtk_ctree_draw_lines (ctree, (GtkCTreeRow *)clist_row, row, i, - state, &clip_rectangle, &cell_rectangle, - crect, area, style); - - /* draw expander */ - offset = gtk_ctree_draw_expander (ctree, (GtkCTreeRow *)clist_row, - style, &clip_rectangle, offset); - - if (clist->column[i].justification == GTK_JUSTIFY_RIGHT) - offset -= ctree->tree_spacing; - else - offset += ctree->tree_spacing; - - if (clist->column[i].justification == GTK_JUSTIFY_RIGHT) - offset -= (pixmap_width + clist_row->cell[i].horizontal); - else - offset += clist_row->cell[i].horizontal; - - old_offset = offset; - offset = draw_cell_pixmap (clist->clist_window, &clip_rectangle, fg_gc, - GTK_CELL_PIXTEXT (clist_row->cell[i])->pixmap, - GTK_CELL_PIXTEXT (clist_row->cell[i])->mask, - offset, - clip_rectangle.y + clist_row->cell[i].vertical - + (clip_rectangle.height - height) / 2, - pixmap_width, height); - - if (layout) - { - gint row_center_offset = (clist->row_height - logical_rect.height) / 2; - - if (clist->column[i].justification == GTK_JUSTIFY_RIGHT) - { - offset = (old_offset - string_width); - if (GTK_CELL_PIXTEXT (clist_row->cell[i])->pixmap) - offset -= GTK_CELL_PIXTEXT (clist_row->cell[i])->spacing; - } - else - { - if (GTK_CELL_PIXTEXT (clist_row->cell[i])->pixmap) - offset += GTK_CELL_PIXTEXT (clist_row->cell[i])->spacing; - } - - gdk_gc_set_clip_rectangle (fg_gc, &clip_rectangle); - gdk_draw_layout (clist->clist_window, fg_gc, - offset, - row_rectangle.y + row_center_offset + clist_row->cell[i].vertical, - layout); - - g_object_unref (G_OBJECT (layout)); - } - gdk_gc_set_clip_rectangle (fg_gc, NULL); - } - - /* draw focus rectangle */ - if (clist->focus_row == row && - GTK_WIDGET_CAN_FOCUS (widget) && gtk_widget_has_focus (widget)) - { - if (!area) - gdk_draw_rectangle (clist->clist_window, clist->xor_gc, FALSE, - row_rectangle.x, row_rectangle.y, - row_rectangle.width - 1, row_rectangle.height - 1); - else if (gdk_rectangle_intersect (area, &row_rectangle, - &intersect_rectangle)) - { - gdk_gc_set_clip_rectangle (clist->xor_gc, &intersect_rectangle); - gdk_draw_rectangle (clist->clist_window, clist->xor_gc, FALSE, - row_rectangle.x, row_rectangle.y, - row_rectangle.width - 1, - row_rectangle.height - 1); - gdk_gc_set_clip_rectangle (clist->xor_gc, NULL); - } - } -} - -static void -tree_draw_node (GtkCTree *ctree, - GtkCTreeNode *node) -{ - GtkCList *clist; - - clist = GTK_CLIST (ctree); - - if (CLIST_UNFROZEN (clist) && gtk_ctree_is_viewable (ctree, node)) - { - GtkCTreeNode *work; - gint num = 0; - - work = GTK_CTREE_NODE (clist->row_list); - while (work && work != node) - { - work = GTK_CTREE_NODE_NEXT (work); - num++; - } - if (work && gtk_clist_row_is_visible (clist, num) != GTK_VISIBILITY_NONE) - GTK_CLIST_GET_CLASS (clist)->draw_row - (clist, NULL, num, GTK_CLIST_ROW ((GList *) node)); - } -} - -static GtkCTreeNode * -gtk_ctree_last_visible (GtkCTree *ctree, - GtkCTreeNode *node) -{ - GtkCTreeNode *work; - - if (!node) - return NULL; - - work = GTK_CTREE_ROW (node)->children; - - if (!work || !GTK_CTREE_ROW (node)->expanded) - return node; - - while (GTK_CTREE_ROW (work)->sibling) - work = GTK_CTREE_ROW (work)->sibling; - - return gtk_ctree_last_visible (ctree, work); -} - -static void -gtk_ctree_link (GtkCTree *ctree, - GtkCTreeNode *node, - GtkCTreeNode *parent, - GtkCTreeNode *sibling, - gboolean update_focus_row) -{ - GtkCList *clist; - GList *list_end; - GList *list; - GList *work; - gboolean visible = FALSE; - gint rows = 0; - - if (sibling) - g_return_if_fail (GTK_CTREE_ROW (sibling)->parent == parent); - g_return_if_fail (node != NULL); - g_return_if_fail (node != sibling); - g_return_if_fail (node != parent); - - clist = GTK_CLIST (ctree); - - if (update_focus_row && clist->selection_mode == GTK_SELECTION_MULTIPLE) - { - GTK_CLIST_GET_CLASS (clist)->resync_selection (clist, NULL); - - g_list_free (clist->undo_selection); - g_list_free (clist->undo_unselection); - clist->undo_selection = NULL; - clist->undo_unselection = NULL; - } - - for (rows = 1, list_end = (GList *)node; list_end->next; - list_end = list_end->next) - rows++; - - GTK_CTREE_ROW (node)->parent = parent; - GTK_CTREE_ROW (node)->sibling = sibling; - - if (!parent || (parent && (gtk_ctree_is_viewable (ctree, parent) && - GTK_CTREE_ROW (parent)->expanded))) - { - visible = TRUE; - clist->rows += rows; - } - - if (parent) - work = (GList *)(GTK_CTREE_ROW (parent)->children); - else - work = clist->row_list; - - if (sibling) - { - if (work != (GList *)sibling) - { - while (GTK_CTREE_ROW (work)->sibling != sibling) - work = (GList *)(GTK_CTREE_ROW (work)->sibling); - GTK_CTREE_ROW (work)->sibling = node; - } - - if (sibling == GTK_CTREE_NODE (clist->row_list)) - clist->row_list = (GList *) node; - if (GTK_CTREE_NODE_PREV (sibling) && - GTK_CTREE_NODE_NEXT (GTK_CTREE_NODE_PREV (sibling)) == sibling) - { - list = (GList *)GTK_CTREE_NODE_PREV (sibling); - list->next = (GList *)node; - } - - list = (GList *)node; - list->prev = (GList *)GTK_CTREE_NODE_PREV (sibling); - list_end->next = (GList *)sibling; - list = (GList *)sibling; - list->prev = list_end; - if (parent && GTK_CTREE_ROW (parent)->children == sibling) - GTK_CTREE_ROW (parent)->children = node; - } - else - { - if (work) - { - /* find sibling */ - while (GTK_CTREE_ROW (work)->sibling) - work = (GList *)(GTK_CTREE_ROW (work)->sibling); - GTK_CTREE_ROW (work)->sibling = node; - - /* find last visible child of sibling */ - work = (GList *) gtk_ctree_last_visible (ctree, - GTK_CTREE_NODE (work)); - - list_end->next = work->next; - if (work->next) - list = work->next->prev = list_end; - work->next = (GList *)node; - list = (GList *)node; - list->prev = work; - } - else - { - if (parent) - { - GTK_CTREE_ROW (parent)->children = node; - list = (GList *)node; - list->prev = (GList *)parent; - if (GTK_CTREE_ROW (parent)->expanded) - { - list_end->next = (GList *)GTK_CTREE_NODE_NEXT (parent); - if (GTK_CTREE_NODE_NEXT(parent)) - { - list = (GList *)GTK_CTREE_NODE_NEXT (parent); - list->prev = list_end; - } - list = (GList *)parent; - list->next = (GList *)node; - } - else - list_end->next = NULL; - } - else - { - clist->row_list = (GList *)node; - list = (GList *)node; - list->prev = NULL; - list_end->next = NULL; - } - } - } - - gtk_ctree_pre_recursive (ctree, node, tree_update_level, NULL); - - if (clist->row_list_end == NULL || - clist->row_list_end->next == (GList *)node) - clist->row_list_end = list_end; - - if (visible && update_focus_row) - { - gint pos; - - pos = g_list_position (clist->row_list, (GList *)node); - - if (pos <= clist->focus_row) - { - clist->focus_row += rows; - clist->undo_anchor = clist->focus_row; - } - } -} - -static void -gtk_ctree_unlink (GtkCTree *ctree, - GtkCTreeNode *node, - gboolean update_focus_row) -{ - GtkCList *clist; - gint rows; - gint level; - gint visible; - GtkCTreeNode *work; - GtkCTreeNode *parent; - GList *list; - - g_return_if_fail (GTK_IS_CTREE (ctree)); - g_return_if_fail (node != NULL); - - clist = GTK_CLIST (ctree); - - if (update_focus_row && clist->selection_mode == GTK_SELECTION_MULTIPLE) - { - GTK_CLIST_GET_CLASS (clist)->resync_selection (clist, NULL); - - g_list_free (clist->undo_selection); - g_list_free (clist->undo_unselection); - clist->undo_selection = NULL; - clist->undo_unselection = NULL; - } - - visible = gtk_ctree_is_viewable (ctree, node); - - /* clist->row_list_end unlinked ? */ - if (visible && - (GTK_CTREE_NODE_NEXT (node) == NULL || - (GTK_CTREE_ROW (node)->children && - gtk_ctree_is_ancestor (ctree, node, - GTK_CTREE_NODE (clist->row_list_end))))) - clist->row_list_end = (GList *) (GTK_CTREE_NODE_PREV (node)); - - /* update list */ - rows = 0; - level = GTK_CTREE_ROW (node)->level; - work = GTK_CTREE_NODE_NEXT (node); - while (work && GTK_CTREE_ROW (work)->level > level) - { - work = GTK_CTREE_NODE_NEXT (work); - rows++; - } - - if (visible) - { - clist->rows -= (rows + 1); - - if (update_focus_row) - { - gint pos; - - pos = g_list_position (clist->row_list, (GList *)node); - if (pos + rows < clist->focus_row) - clist->focus_row -= (rows + 1); - else if (pos <= clist->focus_row) - { - if (!GTK_CTREE_ROW (node)->sibling) - clist->focus_row = MAX (pos - 1, 0); - else - clist->focus_row = pos; - - clist->focus_row = MIN (clist->focus_row, clist->rows - 1); - } - clist->undo_anchor = clist->focus_row; - } - } - - if (work) - { - list = (GList *)GTK_CTREE_NODE_PREV (work); - list->next = NULL; - list = (GList *)work; - list->prev = (GList *)GTK_CTREE_NODE_PREV (node); - } - - if (GTK_CTREE_NODE_PREV (node) && - GTK_CTREE_NODE_NEXT (GTK_CTREE_NODE_PREV (node)) == node) - { - list = (GList *)GTK_CTREE_NODE_PREV (node); - list->next = (GList *)work; - } - - /* update tree */ - parent = GTK_CTREE_ROW (node)->parent; - if (parent) - { - if (GTK_CTREE_ROW (parent)->children == node) - { - GTK_CTREE_ROW (parent)->children = GTK_CTREE_ROW (node)->sibling; - if (!GTK_CTREE_ROW (parent)->children) - gtk_ctree_collapse (ctree, parent); - } - else - { - GtkCTreeNode *sibling; - - sibling = GTK_CTREE_ROW (parent)->children; - while (GTK_CTREE_ROW (sibling)->sibling != node) - sibling = GTK_CTREE_ROW (sibling)->sibling; - GTK_CTREE_ROW (sibling)->sibling = GTK_CTREE_ROW (node)->sibling; - } - } - else - { - if (clist->row_list == (GList *)node) - clist->row_list = (GList *) (GTK_CTREE_ROW (node)->sibling); - else - { - GtkCTreeNode *sibling; - - sibling = GTK_CTREE_NODE (clist->row_list); - while (GTK_CTREE_ROW (sibling)->sibling != node) - sibling = GTK_CTREE_ROW (sibling)->sibling; - GTK_CTREE_ROW (sibling)->sibling = GTK_CTREE_ROW (node)->sibling; - } - } -} - -static void -real_row_move (GtkCList *clist, - gint source_row, - gint dest_row) -{ - GtkCTree *ctree; - GtkCTreeNode *node; - - g_return_if_fail (GTK_IS_CTREE (clist)); - - if (GTK_CLIST_AUTO_SORT (clist)) - return; - - if (source_row < 0 || source_row >= clist->rows || - dest_row < 0 || dest_row >= clist->rows || - source_row == dest_row) - return; - - ctree = GTK_CTREE (clist); - node = GTK_CTREE_NODE (g_list_nth (clist->row_list, source_row)); - - if (source_row < dest_row) - { - GtkCTreeNode *work; - - dest_row++; - work = GTK_CTREE_ROW (node)->children; - - while (work && GTK_CTREE_ROW (work)->level > GTK_CTREE_ROW (node)->level) - { - work = GTK_CTREE_NODE_NEXT (work); - dest_row++; - } - - if (dest_row > clist->rows) - dest_row = clist->rows; - } - - if (dest_row < clist->rows) - { - GtkCTreeNode *sibling; - - sibling = GTK_CTREE_NODE (g_list_nth (clist->row_list, dest_row)); - gtk_ctree_move (ctree, node, GTK_CTREE_ROW (sibling)->parent, sibling); - } - else - gtk_ctree_move (ctree, node, NULL, NULL); -} - -static void -real_tree_move (GtkCTree *ctree, - GtkCTreeNode *node, - GtkCTreeNode *new_parent, - GtkCTreeNode *new_sibling) -{ - GtkCList *clist; - GtkCTreeNode *work; - gboolean visible = FALSE; - - g_return_if_fail (ctree != NULL); - g_return_if_fail (node != NULL); - g_return_if_fail (!new_sibling || - GTK_CTREE_ROW (new_sibling)->parent == new_parent); - - if (new_parent && GTK_CTREE_ROW (new_parent)->is_leaf) - return; - - /* new_parent != child of child */ - for (work = new_parent; work; work = GTK_CTREE_ROW (work)->parent) - if (work == node) - return; - - clist = GTK_CLIST (ctree); - - visible = gtk_ctree_is_viewable (ctree, node); - - if (clist->selection_mode == GTK_SELECTION_MULTIPLE) - { - GTK_CLIST_GET_CLASS (clist)->resync_selection (clist, NULL); - - g_list_free (clist->undo_selection); - g_list_free (clist->undo_unselection); - clist->undo_selection = NULL; - clist->undo_unselection = NULL; - } - - if (GTK_CLIST_AUTO_SORT (clist)) - { - if (new_parent == GTK_CTREE_ROW (node)->parent) - return; - - if (new_parent) - new_sibling = GTK_CTREE_ROW (new_parent)->children; - else - new_sibling = GTK_CTREE_NODE (clist->row_list); - - while (new_sibling && clist->compare - (clist, GTK_CTREE_ROW (node), GTK_CTREE_ROW (new_sibling)) > 0) - new_sibling = GTK_CTREE_ROW (new_sibling)->sibling; - } - - if (new_parent == GTK_CTREE_ROW (node)->parent && - new_sibling == GTK_CTREE_ROW (node)->sibling) - return; - - gtk_clist_freeze (clist); - - work = NULL; - if (gtk_ctree_is_viewable (ctree, node)) - work = GTK_CTREE_NODE (g_list_nth (clist->row_list, clist->focus_row)); - - gtk_ctree_unlink (ctree, node, FALSE); - gtk_ctree_link (ctree, node, new_parent, new_sibling, FALSE); - - if (work) - { - while (work && !gtk_ctree_is_viewable (ctree, work)) - work = GTK_CTREE_ROW (work)->parent; - clist->focus_row = g_list_position (clist->row_list, (GList *)work); - clist->undo_anchor = clist->focus_row; - } - - if (clist->column[ctree->tree_column].auto_resize && - !GTK_CLIST_AUTO_RESIZE_BLOCKED (clist) && - (visible || gtk_ctree_is_viewable (ctree, node))) - gtk_clist_set_column_width - (clist, ctree->tree_column, - gtk_clist_optimal_column_width (clist, ctree->tree_column)); - - gtk_clist_thaw (clist); -} - -static void -change_focus_row_expansion (GtkCTree *ctree, - GtkCTreeExpansionType action) -{ - GtkCList *clist; - GtkCTreeNode *node; - - g_return_if_fail (GTK_IS_CTREE (ctree)); - - clist = GTK_CLIST (ctree); - - if (gdk_display_pointer_is_grabbed (gtk_widget_get_display (GTK_WIDGET (ctree))) && - GTK_WIDGET_HAS_GRAB (ctree)) - return; - - if (!(node = - GTK_CTREE_NODE (g_list_nth (clist->row_list, clist->focus_row))) || - GTK_CTREE_ROW (node)->is_leaf || !(GTK_CTREE_ROW (node)->children)) - return; - - switch (action) - { - case GTK_CTREE_EXPANSION_EXPAND: - gtk_ctree_expand (ctree, node); - break; - case GTK_CTREE_EXPANSION_EXPAND_RECURSIVE: - gtk_ctree_expand_recursive (ctree, node); - break; - case GTK_CTREE_EXPANSION_COLLAPSE: - gtk_ctree_collapse (ctree, node); - break; - case GTK_CTREE_EXPANSION_COLLAPSE_RECURSIVE: - gtk_ctree_collapse_recursive (ctree, node); - break; - case GTK_CTREE_EXPANSION_TOGGLE: - gtk_ctree_toggle_expansion (ctree, node); - break; - case GTK_CTREE_EXPANSION_TOGGLE_RECURSIVE: - gtk_ctree_toggle_expansion_recursive (ctree, node); - break; - } -} - -static void -real_tree_expand (GtkCTree *ctree, - GtkCTreeNode *node) -{ - GtkCList *clist; - GtkCTreeNode *work; - GtkRequisition requisition; - gboolean visible; - - g_return_if_fail (GTK_IS_CTREE (ctree)); - - if (!node || GTK_CTREE_ROW (node)->expanded || GTK_CTREE_ROW (node)->is_leaf) - return; - - clist = GTK_CLIST (ctree); - - GTK_CLIST_GET_CLASS (clist)->resync_selection (clist, NULL); - - GTK_CTREE_ROW (node)->expanded = TRUE; - - visible = gtk_ctree_is_viewable (ctree, node); - /* get cell width if tree_column is auto resized */ - if (visible && clist->column[ctree->tree_column].auto_resize && - !GTK_CLIST_AUTO_RESIZE_BLOCKED (clist)) - GTK_CLIST_GET_CLASS (clist)->cell_size_request - (clist, >K_CTREE_ROW (node)->row, ctree->tree_column, &requisition); - - /* unref/unset closed pixmap */ - if (GTK_CELL_PIXTEXT - (GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->pixmap) - { - g_object_unref - (GTK_CELL_PIXTEXT - (GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->pixmap); - - GTK_CELL_PIXTEXT - (GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->pixmap = NULL; - - if (GTK_CELL_PIXTEXT - (GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->mask) - { - g_object_unref - (GTK_CELL_PIXTEXT - (GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->mask); - GTK_CELL_PIXTEXT - (GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->mask = NULL; - } - } - - /* set/ref opened pixmap */ - if (GTK_CTREE_ROW (node)->pixmap_opened) - { - GTK_CELL_PIXTEXT - (GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->pixmap = - g_object_ref (GTK_CTREE_ROW (node)->pixmap_opened); - - if (GTK_CTREE_ROW (node)->mask_opened) - GTK_CELL_PIXTEXT - (GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->mask = - g_object_ref (GTK_CTREE_ROW (node)->mask_opened); - } - - - work = GTK_CTREE_ROW (node)->children; - if (work) - { - GList *list = (GList *)work; - gint *cell_width = NULL; - gint tmp = 0; - gint row; - gint i; - - if (visible && !GTK_CLIST_AUTO_RESIZE_BLOCKED (clist)) - { - cell_width = g_new0 (gint, clist->columns); - if (clist->column[ctree->tree_column].auto_resize) - cell_width[ctree->tree_column] = requisition.width; - - while (work) - { - /* search maximum cell widths of auto_resize columns */ - for (i = 0; i < clist->columns; i++) - if (clist->column[i].auto_resize) - { - GTK_CLIST_GET_CLASS (clist)->cell_size_request - (clist, >K_CTREE_ROW (work)->row, i, &requisition); - cell_width[i] = MAX (requisition.width, cell_width[i]); - } - - list = (GList *)work; - work = GTK_CTREE_NODE_NEXT (work); - tmp++; - } - } - else - while (work) - { - list = (GList *)work; - work = GTK_CTREE_NODE_NEXT (work); - tmp++; - } - - list->next = (GList *)GTK_CTREE_NODE_NEXT (node); - - if (GTK_CTREE_NODE_NEXT (node)) - { - GList *tmp_list; - - tmp_list = (GList *)GTK_CTREE_NODE_NEXT (node); - tmp_list->prev = list; - } - else - clist->row_list_end = list; - - list = (GList *)node; - list->next = (GList *)(GTK_CTREE_ROW (node)->children); - - if (visible) - { - /* resize auto_resize columns if needed */ - for (i = 0; i < clist->columns; i++) - if (clist->column[i].auto_resize && - cell_width[i] > clist->column[i].width) - gtk_clist_set_column_width (clist, i, cell_width[i]); - g_free (cell_width); - - /* update focus_row position */ - row = g_list_position (clist->row_list, (GList *)node); - if (row < clist->focus_row) - clist->focus_row += tmp; - - clist->rows += tmp; - CLIST_REFRESH (clist); - } - } - else if (visible && clist->column[ctree->tree_column].auto_resize) - /* resize tree_column if needed */ - column_auto_resize (clist, >K_CTREE_ROW (node)->row, ctree->tree_column, - requisition.width); -} - -static void -real_tree_collapse (GtkCTree *ctree, - GtkCTreeNode *node) -{ - GtkCList *clist; - GtkCTreeNode *work; - GtkRequisition requisition; - gboolean visible; - gint level; - - g_return_if_fail (GTK_IS_CTREE (ctree)); - - if (!node || !GTK_CTREE_ROW (node)->expanded || - GTK_CTREE_ROW (node)->is_leaf) - return; - - clist = GTK_CLIST (ctree); - - GTK_CLIST_GET_CLASS (clist)->resync_selection (clist, NULL); - - GTK_CTREE_ROW (node)->expanded = FALSE; - level = GTK_CTREE_ROW (node)->level; - - visible = gtk_ctree_is_viewable (ctree, node); - /* get cell width if tree_column is auto resized */ - if (visible && clist->column[ctree->tree_column].auto_resize && - !GTK_CLIST_AUTO_RESIZE_BLOCKED (clist)) - GTK_CLIST_GET_CLASS (clist)->cell_size_request - (clist, >K_CTREE_ROW (node)->row, ctree->tree_column, &requisition); - - /* unref/unset opened pixmap */ - if (GTK_CELL_PIXTEXT - (GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->pixmap) - { - g_object_unref - (GTK_CELL_PIXTEXT - (GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->pixmap); - - GTK_CELL_PIXTEXT - (GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->pixmap = NULL; - - if (GTK_CELL_PIXTEXT - (GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->mask) - { - g_object_unref - (GTK_CELL_PIXTEXT - (GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->mask); - GTK_CELL_PIXTEXT - (GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->mask = NULL; - } - } - - /* set/ref closed pixmap */ - if (GTK_CTREE_ROW (node)->pixmap_closed) - { - GTK_CELL_PIXTEXT - (GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->pixmap = - g_object_ref (GTK_CTREE_ROW (node)->pixmap_closed); - - if (GTK_CTREE_ROW (node)->mask_closed) - GTK_CELL_PIXTEXT - (GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->mask = - g_object_ref (GTK_CTREE_ROW (node)->mask_closed); - } - - work = GTK_CTREE_ROW (node)->children; - if (work) - { - gint tmp = 0; - gint row; - GList *list; - - while (work && GTK_CTREE_ROW (work)->level > level) - { - work = GTK_CTREE_NODE_NEXT (work); - tmp++; - } - - if (work) - { - list = (GList *)node; - list->next = (GList *)work; - list = (GList *)GTK_CTREE_NODE_PREV (work); - list->next = NULL; - list = (GList *)work; - list->prev = (GList *)node; - } - else - { - list = (GList *)node; - list->next = NULL; - clist->row_list_end = (GList *)node; - } - - if (visible) - { - /* resize auto_resize columns if needed */ - auto_resize_columns (clist); - - row = g_list_position (clist->row_list, (GList *)node); - if (row < clist->focus_row) - clist->focus_row -= tmp; - clist->rows -= tmp; - CLIST_REFRESH (clist); - } - } - else if (visible && clist->column[ctree->tree_column].auto_resize && - !GTK_CLIST_AUTO_RESIZE_BLOCKED (clist)) - /* resize tree_column if needed */ - column_auto_resize (clist, >K_CTREE_ROW (node)->row, ctree->tree_column, - requisition.width); - -} - -static void -column_auto_resize (GtkCList *clist, - GtkCListRow *clist_row, - gint column, - gint old_width) -{ - /* resize column if needed for auto_resize */ - GtkRequisition requisition; - - if (!clist->column[column].auto_resize || - GTK_CLIST_AUTO_RESIZE_BLOCKED (clist)) - return; - - if (clist_row) - GTK_CLIST_GET_CLASS (clist)->cell_size_request (clist, clist_row, - column, &requisition); - else - requisition.width = 0; - - if (requisition.width > clist->column[column].width) - gtk_clist_set_column_width (clist, column, requisition.width); - else if (requisition.width < old_width && - old_width == clist->column[column].width) - { - GList *list; - gint new_width; - - /* run a "gtk_clist_optimal_column_width" but break, if - * the column doesn't shrink */ - if (GTK_CLIST_SHOW_TITLES (clist) && clist->column[column].button) - new_width = (clist->column[column].button->requisition.width - - (CELL_SPACING + (2 * COLUMN_INSET))); - else - new_width = 0; - - for (list = clist->row_list; list; list = list->next) - { - GTK_CLIST_GET_CLASS (clist)->cell_size_request - (clist, GTK_CLIST_ROW (list), column, &requisition); - new_width = MAX (new_width, requisition.width); - if (new_width == clist->column[column].width) - break; - } - if (new_width < clist->column[column].width) - gtk_clist_set_column_width (clist, column, new_width); - } -} - -static void -auto_resize_columns (GtkCList *clist) -{ - gint i; - - if (GTK_CLIST_AUTO_RESIZE_BLOCKED (clist)) - return; - - for (i = 0; i < clist->columns; i++) - column_auto_resize (clist, NULL, i, clist->column[i].width); -} - -static void -cell_size_request (GtkCList *clist, - GtkCListRow *clist_row, - gint column, - GtkRequisition *requisition) -{ - GtkCTree *ctree; - gint width; - gint height; - PangoLayout *layout; - PangoRectangle logical_rect; - - g_return_if_fail (GTK_IS_CTREE (clist)); - g_return_if_fail (requisition != NULL); - - ctree = GTK_CTREE (clist); - - layout = _gtk_clist_create_cell_layout (clist, clist_row, column); - if (layout) - { - pango_layout_get_pixel_extents (layout, NULL, &logical_rect); - - requisition->width = logical_rect.width; - requisition->height = logical_rect.height; - - g_object_unref (G_OBJECT (layout)); - } - else - { - requisition->width = 0; - requisition->height = 0; - } - - switch (clist_row->cell[column].type) - { - case GTK_CELL_PIXTEXT: - if (GTK_CELL_PIXTEXT (clist_row->cell[column])->pixmap) - { - gdk_drawable_get_size (GTK_CELL_PIXTEXT - (clist_row->cell[column])->pixmap, - &width, &height); - width += GTK_CELL_PIXTEXT (clist_row->cell[column])->spacing; - } - else - width = height = 0; - - requisition->width += width; - requisition->height = MAX (requisition->height, height); - - if (column == ctree->tree_column) - { - requisition->width += (ctree->tree_spacing + ctree->tree_indent * - (((GtkCTreeRow *) clist_row)->level - 1)); - switch (ctree->expander_style) - { - case GTK_CTREE_EXPANDER_NONE: - break; - case GTK_CTREE_EXPANDER_TRIANGLE: - requisition->width += PM_SIZE + 3; - break; - case GTK_CTREE_EXPANDER_SQUARE: - case GTK_CTREE_EXPANDER_CIRCULAR: - requisition->width += PM_SIZE + 1; - break; - } - if (ctree->line_style == GTK_CTREE_LINES_TABBED) - requisition->width += 3; - } - break; - case GTK_CELL_PIXMAP: - gdk_drawable_get_size (GTK_CELL_PIXMAP (clist_row->cell[column])->pixmap, - &width, &height); - requisition->width += width; - requisition->height = MAX (requisition->height, height); - break; - default: - break; - } - - requisition->width += clist_row->cell[column].horizontal; - requisition->height += clist_row->cell[column].vertical; -} - -static void -set_cell_contents (GtkCList *clist, - GtkCListRow *clist_row, - gint column, - GtkCellType type, - const gchar *text, - guint8 spacing, - GdkPixmap *pixmap, - GdkBitmap *mask) -{ - gboolean visible = FALSE; - GtkCTree *ctree; - GtkRequisition requisition; - gchar *old_text = NULL; - GdkPixmap *old_pixmap = NULL; - GdkBitmap *old_mask = NULL; - - g_return_if_fail (GTK_IS_CTREE (clist)); - g_return_if_fail (clist_row != NULL); - - ctree = GTK_CTREE (clist); - - if (clist->column[column].auto_resize && - !GTK_CLIST_AUTO_RESIZE_BLOCKED (clist)) - { - GtkCTreeNode *parent; - - parent = ((GtkCTreeRow *)clist_row)->parent; - if (!parent || (parent && GTK_CTREE_ROW (parent)->expanded && - gtk_ctree_is_viewable (ctree, parent))) - { - visible = TRUE; - GTK_CLIST_GET_CLASS (clist)->cell_size_request (clist, clist_row, - column, &requisition); - } - } - - switch (clist_row->cell[column].type) - { - case GTK_CELL_EMPTY: - break; - case GTK_CELL_TEXT: - old_text = GTK_CELL_TEXT (clist_row->cell[column])->text; - break; - case GTK_CELL_PIXMAP: - old_pixmap = GTK_CELL_PIXMAP (clist_row->cell[column])->pixmap; - old_mask = GTK_CELL_PIXMAP (clist_row->cell[column])->mask; - break; - case GTK_CELL_PIXTEXT: - old_text = GTK_CELL_PIXTEXT (clist_row->cell[column])->text; - old_pixmap = GTK_CELL_PIXTEXT (clist_row->cell[column])->pixmap; - old_mask = GTK_CELL_PIXTEXT (clist_row->cell[column])->mask; - break; - case GTK_CELL_WIDGET: - /* unimplemented */ - break; - - default: - break; - } - - clist_row->cell[column].type = GTK_CELL_EMPTY; - if (column == ctree->tree_column && type != GTK_CELL_EMPTY) - type = GTK_CELL_PIXTEXT; - - /* Note that pixmap and mask were already ref'ed by the caller - */ - switch (type) - { - case GTK_CELL_TEXT: - if (text) - { - clist_row->cell[column].type = GTK_CELL_TEXT; - GTK_CELL_TEXT (clist_row->cell[column])->text = g_strdup (text); - } - break; - case GTK_CELL_PIXMAP: - if (pixmap) - { - clist_row->cell[column].type = GTK_CELL_PIXMAP; - GTK_CELL_PIXMAP (clist_row->cell[column])->pixmap = pixmap; - /* We set the mask even if it is NULL */ - GTK_CELL_PIXMAP (clist_row->cell[column])->mask = mask; - } - break; - case GTK_CELL_PIXTEXT: - if (column == ctree->tree_column) - { - clist_row->cell[column].type = GTK_CELL_PIXTEXT; - GTK_CELL_PIXTEXT (clist_row->cell[column])->spacing = spacing; - if (text) - GTK_CELL_PIXTEXT (clist_row->cell[column])->text = g_strdup (text); - else - GTK_CELL_PIXTEXT (clist_row->cell[column])->text = NULL; - if (pixmap) - { - GTK_CELL_PIXTEXT (clist_row->cell[column])->pixmap = pixmap; - GTK_CELL_PIXTEXT (clist_row->cell[column])->mask = mask; - } - else - { - GTK_CELL_PIXTEXT (clist_row->cell[column])->pixmap = NULL; - GTK_CELL_PIXTEXT (clist_row->cell[column])->mask = NULL; - } - } - else if (text && pixmap) - { - clist_row->cell[column].type = GTK_CELL_PIXTEXT; - GTK_CELL_PIXTEXT (clist_row->cell[column])->text = g_strdup (text); - GTK_CELL_PIXTEXT (clist_row->cell[column])->spacing = spacing; - GTK_CELL_PIXTEXT (clist_row->cell[column])->pixmap = pixmap; - GTK_CELL_PIXTEXT (clist_row->cell[column])->mask = mask; - } - break; - default: - break; - } - - if (visible && clist->column[column].auto_resize && - !GTK_CLIST_AUTO_RESIZE_BLOCKED (clist)) - column_auto_resize (clist, clist_row, column, requisition.width); - - g_free (old_text); - if (old_pixmap) - g_object_unref (old_pixmap); - if (old_mask) - g_object_unref (old_mask); -} - -static void -set_node_info (GtkCTree *ctree, - GtkCTreeNode *node, - const gchar *text, - guint8 spacing, - GdkPixmap *pixmap_closed, - GdkBitmap *mask_closed, - GdkPixmap *pixmap_opened, - GdkBitmap *mask_opened, - gboolean is_leaf, - gboolean expanded) -{ - if (GTK_CTREE_ROW (node)->pixmap_opened) - { - g_object_unref (GTK_CTREE_ROW (node)->pixmap_opened); - if (GTK_CTREE_ROW (node)->mask_opened) - g_object_unref (GTK_CTREE_ROW (node)->mask_opened); - } - if (GTK_CTREE_ROW (node)->pixmap_closed) - { - g_object_unref (GTK_CTREE_ROW (node)->pixmap_closed); - if (GTK_CTREE_ROW (node)->mask_closed) - g_object_unref (GTK_CTREE_ROW (node)->mask_closed); - } - - GTK_CTREE_ROW (node)->pixmap_opened = NULL; - GTK_CTREE_ROW (node)->mask_opened = NULL; - GTK_CTREE_ROW (node)->pixmap_closed = NULL; - GTK_CTREE_ROW (node)->mask_closed = NULL; - - if (pixmap_closed) - { - GTK_CTREE_ROW (node)->pixmap_closed = g_object_ref (pixmap_closed); - if (mask_closed) - GTK_CTREE_ROW (node)->mask_closed = g_object_ref (mask_closed); - } - if (pixmap_opened) - { - GTK_CTREE_ROW (node)->pixmap_opened = g_object_ref (pixmap_opened); - if (mask_opened) - GTK_CTREE_ROW (node)->mask_opened = g_object_ref (mask_opened); - } - - GTK_CTREE_ROW (node)->is_leaf = is_leaf; - GTK_CTREE_ROW (node)->expanded = (is_leaf) ? FALSE : expanded; - - if (GTK_CTREE_ROW (node)->expanded) - gtk_ctree_node_set_pixtext (ctree, node, ctree->tree_column, - text, spacing, pixmap_opened, mask_opened); - else - gtk_ctree_node_set_pixtext (ctree, node, ctree->tree_column, - text, spacing, pixmap_closed, mask_closed); -} - -static void -tree_delete (GtkCTree *ctree, - GtkCTreeNode *node, - gpointer data) -{ - tree_unselect (ctree, node, NULL); - row_delete (ctree, GTK_CTREE_ROW (node)); - g_list_free_1 ((GList *)node); -} - -static void -tree_delete_row (GtkCTree *ctree, - GtkCTreeNode *node, - gpointer data) -{ - row_delete (ctree, GTK_CTREE_ROW (node)); - g_list_free_1 ((GList *)node); -} - -static void -tree_update_level (GtkCTree *ctree, - GtkCTreeNode *node, - gpointer data) -{ - if (!node) - return; - - if (GTK_CTREE_ROW (node)->parent) - GTK_CTREE_ROW (node)->level = - GTK_CTREE_ROW (GTK_CTREE_ROW (node)->parent)->level + 1; - else - GTK_CTREE_ROW (node)->level = 1; -} - -static void -tree_select (GtkCTree *ctree, - GtkCTreeNode *node, - gpointer data) -{ - if (node && GTK_CTREE_ROW (node)->row.state != GTK_STATE_SELECTED && - GTK_CTREE_ROW (node)->row.selectable) - gtk_signal_emit (GTK_OBJECT (ctree), ctree_signals[TREE_SELECT_ROW], - node, -1); -} - -static void -tree_unselect (GtkCTree *ctree, - GtkCTreeNode *node, - gpointer data) -{ - if (node && GTK_CTREE_ROW (node)->row.state == GTK_STATE_SELECTED) - gtk_signal_emit (GTK_OBJECT (ctree), ctree_signals[TREE_UNSELECT_ROW], - node, -1); -} - -static void -tree_expand (GtkCTree *ctree, - GtkCTreeNode *node, - gpointer data) -{ - if (node && !GTK_CTREE_ROW (node)->expanded) - gtk_signal_emit (GTK_OBJECT (ctree), ctree_signals[TREE_EXPAND], node); -} - -static void -tree_collapse (GtkCTree *ctree, - GtkCTreeNode *node, - gpointer data) -{ - if (node && GTK_CTREE_ROW (node)->expanded) - gtk_signal_emit (GTK_OBJECT (ctree), ctree_signals[TREE_COLLAPSE], node); -} - -static void -tree_collapse_to_depth (GtkCTree *ctree, - GtkCTreeNode *node, - gint depth) -{ - if (node && GTK_CTREE_ROW (node)->level == depth) - gtk_ctree_collapse_recursive (ctree, node); -} - -static void -tree_toggle_expansion (GtkCTree *ctree, - GtkCTreeNode *node, - gpointer data) -{ - if (!node) - return; - - if (GTK_CTREE_ROW (node)->expanded) - gtk_signal_emit (GTK_OBJECT (ctree), ctree_signals[TREE_COLLAPSE], node); - else - gtk_signal_emit (GTK_OBJECT (ctree), ctree_signals[TREE_EXPAND], node); -} - -static GtkCTreeRow * -row_new (GtkCTree *ctree) -{ - GtkCList *clist; - GtkCTreeRow *ctree_row; - int i; - - clist = GTK_CLIST (ctree); - ctree_row = g_slice_new (GtkCTreeRow); - ctree_row->row.cell = g_slice_alloc (sizeof (GtkCell) * clist->columns); - - for (i = 0; i < clist->columns; i++) - { - ctree_row->row.cell[i].type = GTK_CELL_EMPTY; - ctree_row->row.cell[i].vertical = 0; - ctree_row->row.cell[i].horizontal = 0; - ctree_row->row.cell[i].style = NULL; - } - - GTK_CELL_PIXTEXT (ctree_row->row.cell[ctree->tree_column])->text = NULL; - - ctree_row->row.fg_set = FALSE; - ctree_row->row.bg_set = FALSE; - ctree_row->row.style = NULL; - ctree_row->row.selectable = TRUE; - ctree_row->row.state = GTK_STATE_NORMAL; - ctree_row->row.data = NULL; - ctree_row->row.destroy = NULL; - - ctree_row->level = 0; - ctree_row->expanded = FALSE; - ctree_row->parent = NULL; - ctree_row->sibling = NULL; - ctree_row->children = NULL; - ctree_row->pixmap_closed = NULL; - ctree_row->mask_closed = NULL; - ctree_row->pixmap_opened = NULL; - ctree_row->mask_opened = NULL; - - return ctree_row; -} - -static void -row_delete (GtkCTree *ctree, - GtkCTreeRow *ctree_row) -{ - GtkCList *clist; - gint i; - - clist = GTK_CLIST (ctree); - - for (i = 0; i < clist->columns; i++) - { - GTK_CLIST_GET_CLASS (clist)->set_cell_contents - (clist, &(ctree_row->row), i, GTK_CELL_EMPTY, NULL, 0, NULL, NULL); - if (ctree_row->row.cell[i].style) - { - if (gtk_widget_get_realized (GTK_WIDGET (ctree))) - gtk_style_detach (ctree_row->row.cell[i].style); - g_object_unref (ctree_row->row.cell[i].style); - } - } - - if (ctree_row->row.style) - { - if (gtk_widget_get_realized (GTK_WIDGET (ctree))) - gtk_style_detach (ctree_row->row.style); - g_object_unref (ctree_row->row.style); - } - - if (ctree_row->pixmap_closed) - { - g_object_unref (ctree_row->pixmap_closed); - if (ctree_row->mask_closed) - g_object_unref (ctree_row->mask_closed); - } - - if (ctree_row->pixmap_opened) - { - g_object_unref (ctree_row->pixmap_opened); - if (ctree_row->mask_opened) - g_object_unref (ctree_row->mask_opened); - } - - if (ctree_row->row.destroy) - { - GDestroyNotify dnotify = ctree_row->row.destroy; - gpointer ddata = ctree_row->row.data; - - ctree_row->row.destroy = NULL; - ctree_row->row.data = NULL; - - dnotify (ddata); - } - - g_slice_free1 (sizeof (GtkCell) * clist->columns, ctree_row->row.cell); - g_slice_free (GtkCTreeRow, ctree_row); -} - -static void -real_select_row (GtkCList *clist, - gint row, - gint column, - GdkEvent *event) -{ - GList *node; - - g_return_if_fail (GTK_IS_CTREE (clist)); - - if ((node = g_list_nth (clist->row_list, row)) && - GTK_CTREE_ROW (node)->row.selectable) - gtk_signal_emit (GTK_OBJECT (clist), ctree_signals[TREE_SELECT_ROW], - node, column); -} - -static void -real_unselect_row (GtkCList *clist, - gint row, - gint column, - GdkEvent *event) -{ - GList *node; - - g_return_if_fail (GTK_IS_CTREE (clist)); - - if ((node = g_list_nth (clist->row_list, row))) - gtk_signal_emit (GTK_OBJECT (clist), ctree_signals[TREE_UNSELECT_ROW], - node, column); -} - -static void -real_tree_select (GtkCTree *ctree, - GtkCTreeNode *node, - gint column) -{ - GtkCList *clist; - GList *list; - GtkCTreeNode *sel_row; - gboolean node_selected; - - g_return_if_fail (GTK_IS_CTREE (ctree)); - - if (!node || GTK_CTREE_ROW (node)->row.state == GTK_STATE_SELECTED || - !GTK_CTREE_ROW (node)->row.selectable) - return; - - clist = GTK_CLIST (ctree); - - switch (clist->selection_mode) - { - case GTK_SELECTION_SINGLE: - case GTK_SELECTION_BROWSE: - - node_selected = FALSE; - list = clist->selection; - - while (list) - { - sel_row = list->data; - list = list->next; - - if (node == sel_row) - node_selected = TRUE; - else - gtk_signal_emit (GTK_OBJECT (ctree), - ctree_signals[TREE_UNSELECT_ROW], sel_row, column); - } - - if (node_selected) - return; - - default: - break; - } - - GTK_CTREE_ROW (node)->row.state = GTK_STATE_SELECTED; - - if (!clist->selection) - { - clist->selection = g_list_append (clist->selection, node); - clist->selection_end = clist->selection; - } - else - clist->selection_end = g_list_append (clist->selection_end, node)->next; - - tree_draw_node (ctree, node); -} - -static void -real_tree_unselect (GtkCTree *ctree, - GtkCTreeNode *node, - gint column) -{ - GtkCList *clist; - - g_return_if_fail (GTK_IS_CTREE (ctree)); - - if (!node || GTK_CTREE_ROW (node)->row.state != GTK_STATE_SELECTED) - return; - - clist = GTK_CLIST (ctree); - - if (clist->selection_end && clist->selection_end->data == node) - clist->selection_end = clist->selection_end->prev; - - clist->selection = g_list_remove (clist->selection, node); - - GTK_CTREE_ROW (node)->row.state = GTK_STATE_NORMAL; - - tree_draw_node (ctree, node); -} - -static void -select_row_recursive (GtkCTree *ctree, - GtkCTreeNode *node, - gpointer data) -{ - if (!node || GTK_CTREE_ROW (node)->row.state == GTK_STATE_SELECTED || - !GTK_CTREE_ROW (node)->row.selectable) - return; - - GTK_CLIST (ctree)->undo_unselection = - g_list_prepend (GTK_CLIST (ctree)->undo_unselection, node); - gtk_ctree_select (ctree, node); -} - -static void -real_select_all (GtkCList *clist) -{ - GtkCTree *ctree; - GtkCTreeNode *node; - - g_return_if_fail (GTK_IS_CTREE (clist)); - - ctree = GTK_CTREE (clist); - - switch (clist->selection_mode) - { - case GTK_SELECTION_SINGLE: - case GTK_SELECTION_BROWSE: - return; - - case GTK_SELECTION_MULTIPLE: - - gtk_clist_freeze (clist); - - g_list_free (clist->undo_selection); - g_list_free (clist->undo_unselection); - clist->undo_selection = NULL; - clist->undo_unselection = NULL; - - clist->anchor_state = GTK_STATE_SELECTED; - clist->anchor = -1; - clist->drag_pos = -1; - clist->undo_anchor = clist->focus_row; - - for (node = GTK_CTREE_NODE (clist->row_list); node; - node = GTK_CTREE_NODE_NEXT (node)) - gtk_ctree_pre_recursive (ctree, node, select_row_recursive, NULL); - - gtk_clist_thaw (clist); - break; - - default: - /* do nothing */ - break; - } -} - -static void -real_unselect_all (GtkCList *clist) -{ - GtkCTree *ctree; - GtkCTreeNode *node; - GList *list; - - g_return_if_fail (GTK_IS_CTREE (clist)); - - ctree = GTK_CTREE (clist); - - switch (clist->selection_mode) - { - case GTK_SELECTION_BROWSE: - if (clist->focus_row >= 0) - { - gtk_ctree_select - (ctree, - GTK_CTREE_NODE (g_list_nth (clist->row_list, clist->focus_row))); - return; - } - break; - - case GTK_SELECTION_MULTIPLE: - g_list_free (clist->undo_selection); - g_list_free (clist->undo_unselection); - clist->undo_selection = NULL; - clist->undo_unselection = NULL; - - clist->anchor = -1; - clist->drag_pos = -1; - clist->undo_anchor = clist->focus_row; - break; - - default: - break; - } - - list = clist->selection; - - while (list) - { - node = list->data; - list = list->next; - gtk_ctree_unselect (ctree, node); - } -} - -static gboolean -ctree_is_hot_spot (GtkCTree *ctree, - GtkCTreeNode *node, - gint row, - gint x, - gint y) -{ - GtkCTreeRow *tree_row; - GtkCList *clist; - gint xl; - gint yu; - - g_return_val_if_fail (GTK_IS_CTREE (ctree), FALSE); - g_return_val_if_fail (node != NULL, FALSE); - - clist = GTK_CLIST (ctree); - - if (!clist->column[ctree->tree_column].visible || - ctree->expander_style == GTK_CTREE_EXPANDER_NONE) - return FALSE; - - tree_row = GTK_CTREE_ROW (node); - - yu = (ROW_TOP_YPIXEL (clist, row) + (clist->row_height - PM_SIZE) / 2 - - (clist->row_height - 1) % 2); - - if (clist->column[ctree->tree_column].justification == GTK_JUSTIFY_RIGHT) - xl = (clist->column[ctree->tree_column].area.x + - clist->column[ctree->tree_column].area.width - 1 + clist->hoffset - - (tree_row->level - 1) * ctree->tree_indent - PM_SIZE - - (ctree->line_style == GTK_CTREE_LINES_TABBED) * 3); - else - xl = (clist->column[ctree->tree_column].area.x + clist->hoffset + - (tree_row->level - 1) * ctree->tree_indent + - (ctree->line_style == GTK_CTREE_LINES_TABBED) * 3); - - return (x >= xl && x <= xl + PM_SIZE && y >= yu && y <= yu + PM_SIZE); -} - -/*********************************************************** - *********************************************************** - *** Public interface *** - *********************************************************** - ***********************************************************/ - - -/*********************************************************** - * Creation, insertion, deletion * - ***********************************************************/ - -static GObject* -gtk_ctree_constructor (GType type, - guint n_construct_properties, - GObjectConstructParam *construct_properties) -{ - GObject *object = G_OBJECT_CLASS (parent_class)->constructor (type, - n_construct_properties, - construct_properties); - - return object; -} - -GtkWidget* -gtk_ctree_new_with_titles (gint columns, - gint tree_column, - gchar *titles[]) -{ - GtkWidget *widget; - - g_return_val_if_fail (columns > 0, NULL); - g_return_val_if_fail (tree_column >= 0 && tree_column < columns, NULL); - - widget = g_object_new (GTK_TYPE_CTREE, - "n_columns", columns, - "tree_column", tree_column, - NULL); - if (titles) - { - GtkCList *clist = GTK_CLIST (widget); - guint i; - - for (i = 0; i < columns; i++) - gtk_clist_set_column_title (clist, i, titles[i]); - gtk_clist_column_titles_show (clist); - } - - return widget; -} - -GtkWidget * -gtk_ctree_new (gint columns, - gint tree_column) -{ - return gtk_ctree_new_with_titles (columns, tree_column, NULL); -} - -static gint -real_insert_row (GtkCList *clist, - gint row, - gchar *text[]) -{ - GtkCTreeNode *parent = NULL; - GtkCTreeNode *sibling; - GtkCTreeNode *node; - - g_return_val_if_fail (GTK_IS_CTREE (clist), -1); - - sibling = GTK_CTREE_NODE (g_list_nth (clist->row_list, row)); - if (sibling) - parent = GTK_CTREE_ROW (sibling)->parent; - - node = gtk_ctree_insert_node (GTK_CTREE (clist), parent, sibling, text, 5, - NULL, NULL, NULL, NULL, TRUE, FALSE); - - if (GTK_CLIST_AUTO_SORT (clist) || !sibling) - return g_list_position (clist->row_list, (GList *) node); - - return row; -} - - -/** - * gtk_ctree_insert_node: - * @pixmap_closed: (allow-none): - * @mask_closed: (allow-none): - * @pixmap_opened: (allow-none): - * @mask_opened: (allow-none): - */ -GtkCTreeNode * -gtk_ctree_insert_node (GtkCTree *ctree, - GtkCTreeNode *parent, - GtkCTreeNode *sibling, - gchar *text[], - guint8 spacing, - GdkPixmap *pixmap_closed, - GdkBitmap *mask_closed, - GdkPixmap *pixmap_opened, - GdkBitmap *mask_opened, - gboolean is_leaf, - gboolean expanded) -{ - GtkCList *clist; - GtkCTreeRow *new_row; - GtkCTreeNode *node; - GList *list; - gint i; - - g_return_val_if_fail (GTK_IS_CTREE (ctree), NULL); - if (sibling) - g_return_val_if_fail (GTK_CTREE_ROW (sibling)->parent == parent, NULL); - - if (parent && GTK_CTREE_ROW (parent)->is_leaf) - return NULL; - - clist = GTK_CLIST (ctree); - - /* create the row */ - new_row = row_new (ctree); - list = g_list_alloc (); - list->data = new_row; - node = GTK_CTREE_NODE (list); - - if (text) - for (i = 0; i < clist->columns; i++) - if (text[i] && i != ctree->tree_column) - GTK_CLIST_GET_CLASS (clist)->set_cell_contents - (clist, &(new_row->row), i, GTK_CELL_TEXT, text[i], 0, NULL, NULL); - - set_node_info (ctree, node, text ? - text[ctree->tree_column] : NULL, spacing, pixmap_closed, - mask_closed, pixmap_opened, mask_opened, is_leaf, expanded); - - /* sorted insertion */ - if (GTK_CLIST_AUTO_SORT (clist)) - { - if (parent) - sibling = GTK_CTREE_ROW (parent)->children; - else - sibling = GTK_CTREE_NODE (clist->row_list); - - while (sibling && clist->compare - (clist, GTK_CTREE_ROW (node), GTK_CTREE_ROW (sibling)) > 0) - sibling = GTK_CTREE_ROW (sibling)->sibling; - } - - gtk_ctree_link (ctree, node, parent, sibling, TRUE); - - if (text && !GTK_CLIST_AUTO_RESIZE_BLOCKED (clist) && - gtk_ctree_is_viewable (ctree, node)) - { - for (i = 0; i < clist->columns; i++) - if (clist->column[i].auto_resize) - column_auto_resize (clist, &(new_row->row), i, 0); - } - - if (clist->rows == 1) - { - clist->focus_row = 0; - if (clist->selection_mode == GTK_SELECTION_BROWSE) - gtk_ctree_select (ctree, node); - } - - - CLIST_REFRESH (clist); - - return node; -} - -GtkCTreeNode * -gtk_ctree_insert_gnode (GtkCTree *ctree, - GtkCTreeNode *parent, - GtkCTreeNode *sibling, - GNode *gnode, - GtkCTreeGNodeFunc func, - gpointer data) -{ - GtkCList *clist; - GtkCTreeNode *cnode = NULL; - GtkCTreeNode *child = NULL; - GtkCTreeNode *new_child; - GList *list; - GNode *work; - guint depth = 1; - - g_return_val_if_fail (GTK_IS_CTREE (ctree), NULL); - g_return_val_if_fail (gnode != NULL, NULL); - g_return_val_if_fail (func != NULL, NULL); - if (sibling) - g_return_val_if_fail (GTK_CTREE_ROW (sibling)->parent == parent, NULL); - - clist = GTK_CLIST (ctree); - - if (parent) - depth = GTK_CTREE_ROW (parent)->level + 1; - - list = g_list_alloc (); - list->data = row_new (ctree); - cnode = GTK_CTREE_NODE (list); - - gtk_clist_freeze (clist); - - set_node_info (ctree, cnode, "", 0, NULL, NULL, NULL, NULL, TRUE, FALSE); - - if (!func (ctree, depth, gnode, cnode, data)) - { - tree_delete_row (ctree, cnode, NULL); - gtk_clist_thaw (clist); - return NULL; - } - - if (GTK_CLIST_AUTO_SORT (clist)) - { - if (parent) - sibling = GTK_CTREE_ROW (parent)->children; - else - sibling = GTK_CTREE_NODE (clist->row_list); - - while (sibling && clist->compare - (clist, GTK_CTREE_ROW (cnode), GTK_CTREE_ROW (sibling)) > 0) - sibling = GTK_CTREE_ROW (sibling)->sibling; - } - - gtk_ctree_link (ctree, cnode, parent, sibling, TRUE); - - for (work = g_node_last_child (gnode); work; work = work->prev) - { - new_child = gtk_ctree_insert_gnode (ctree, cnode, child, - work, func, data); - if (new_child) - child = new_child; - } - - gtk_clist_thaw (clist); - - return cnode; -} - -GNode * -gtk_ctree_export_to_gnode (GtkCTree *ctree, - GNode *parent, - GNode *sibling, - GtkCTreeNode *node, - GtkCTreeGNodeFunc func, - gpointer data) -{ - GtkCTreeNode *work; - GNode *gnode; - gint depth; - - g_return_val_if_fail (GTK_IS_CTREE (ctree), NULL); - g_return_val_if_fail (node != NULL, NULL); - g_return_val_if_fail (func != NULL, NULL); - if (sibling) - { - g_return_val_if_fail (parent != NULL, NULL); - g_return_val_if_fail (sibling->parent == parent, NULL); - } - - gnode = g_node_new (NULL); - depth = g_node_depth (parent) + 1; - - if (!func (ctree, depth, gnode, node, data)) - { - g_node_destroy (gnode); - return NULL; - } - - if (parent) - g_node_insert_before (parent, sibling, gnode); - - if (!GTK_CTREE_ROW (node)->is_leaf) - { - GNode *new_sibling = NULL; - - for (work = GTK_CTREE_ROW (node)->children; work; - work = GTK_CTREE_ROW (work)->sibling) - new_sibling = gtk_ctree_export_to_gnode (ctree, gnode, new_sibling, - work, func, data); - - g_node_reverse_children (gnode); - } - - return gnode; -} - -static void -real_remove_row (GtkCList *clist, - gint row) -{ - GtkCTreeNode *node; - - g_return_if_fail (GTK_IS_CTREE (clist)); - - node = GTK_CTREE_NODE (g_list_nth (clist->row_list, row)); - - if (node) - gtk_ctree_remove_node (GTK_CTREE (clist), node); -} - -void -gtk_ctree_remove_node (GtkCTree *ctree, - GtkCTreeNode *node) -{ - GtkCList *clist; - - g_return_if_fail (GTK_IS_CTREE (ctree)); - - clist = GTK_CLIST (ctree); - - gtk_clist_freeze (clist); - - if (node) - { - gtk_ctree_unlink (ctree, node, TRUE); - gtk_ctree_post_recursive (ctree, node, GTK_CTREE_FUNC (tree_delete), - NULL); - if (clist->selection_mode == GTK_SELECTION_BROWSE && !clist->selection && - clist->focus_row >= 0) - gtk_clist_select_row (clist, clist->focus_row, -1); - - auto_resize_columns (clist); - } - else - gtk_clist_clear (clist); - - gtk_clist_thaw (clist); -} - -static void -real_clear (GtkCList *clist) -{ - GtkCTree *ctree; - GtkCTreeNode *work; - GtkCTreeNode *ptr; - - g_return_if_fail (GTK_IS_CTREE (clist)); - - ctree = GTK_CTREE (clist); - - /* remove all rows */ - work = GTK_CTREE_NODE (clist->row_list); - clist->row_list = NULL; - clist->row_list_end = NULL; - - GTK_CLIST_SET_FLAG (clist, CLIST_AUTO_RESIZE_BLOCKED); - while (work) - { - ptr = work; - work = GTK_CTREE_ROW (work)->sibling; - gtk_ctree_post_recursive (ctree, ptr, GTK_CTREE_FUNC (tree_delete_row), - NULL); - } - GTK_CLIST_UNSET_FLAG (clist, CLIST_AUTO_RESIZE_BLOCKED); - - parent_class->clear (clist); -} - - -/*********************************************************** - * Generic recursive functions, querying / finding tree * - * information * - ***********************************************************/ - - -void -gtk_ctree_post_recursive (GtkCTree *ctree, - GtkCTreeNode *node, - GtkCTreeFunc func, - gpointer data) -{ - GtkCTreeNode *work; - GtkCTreeNode *tmp; - - g_return_if_fail (GTK_IS_CTREE (ctree)); - g_return_if_fail (func != NULL); - - if (node) - work = GTK_CTREE_ROW (node)->children; - else - work = GTK_CTREE_NODE (GTK_CLIST (ctree)->row_list); - - while (work) - { - tmp = GTK_CTREE_ROW (work)->sibling; - gtk_ctree_post_recursive (ctree, work, func, data); - work = tmp; - } - - if (node) - func (ctree, node, data); -} - -void -gtk_ctree_post_recursive_to_depth (GtkCTree *ctree, - GtkCTreeNode *node, - gint depth, - GtkCTreeFunc func, - gpointer data) -{ - GtkCTreeNode *work; - GtkCTreeNode *tmp; - - g_return_if_fail (GTK_IS_CTREE (ctree)); - g_return_if_fail (func != NULL); - - if (depth < 0) - { - gtk_ctree_post_recursive (ctree, node, func, data); - return; - } - - if (node) - work = GTK_CTREE_ROW (node)->children; - else - work = GTK_CTREE_NODE (GTK_CLIST (ctree)->row_list); - - if (work && GTK_CTREE_ROW (work)->level <= depth) - { - while (work) - { - tmp = GTK_CTREE_ROW (work)->sibling; - gtk_ctree_post_recursive_to_depth (ctree, work, depth, func, data); - work = tmp; - } - } - - if (node && GTK_CTREE_ROW (node)->level <= depth) - func (ctree, node, data); -} - -void -gtk_ctree_pre_recursive (GtkCTree *ctree, - GtkCTreeNode *node, - GtkCTreeFunc func, - gpointer data) -{ - GtkCTreeNode *work; - GtkCTreeNode *tmp; - - g_return_if_fail (GTK_IS_CTREE (ctree)); - g_return_if_fail (func != NULL); - - if (node) - { - work = GTK_CTREE_ROW (node)->children; - func (ctree, node, data); - } - else - work = GTK_CTREE_NODE (GTK_CLIST (ctree)->row_list); - - while (work) - { - tmp = GTK_CTREE_ROW (work)->sibling; - gtk_ctree_pre_recursive (ctree, work, func, data); - work = tmp; - } -} - -void -gtk_ctree_pre_recursive_to_depth (GtkCTree *ctree, - GtkCTreeNode *node, - gint depth, - GtkCTreeFunc func, - gpointer data) -{ - GtkCTreeNode *work; - GtkCTreeNode *tmp; - - g_return_if_fail (GTK_IS_CTREE (ctree)); - g_return_if_fail (func != NULL); - - if (depth < 0) - { - gtk_ctree_pre_recursive (ctree, node, func, data); - return; - } - - if (node) - { - work = GTK_CTREE_ROW (node)->children; - if (GTK_CTREE_ROW (node)->level <= depth) - func (ctree, node, data); - } - else - work = GTK_CTREE_NODE (GTK_CLIST (ctree)->row_list); - - if (work && GTK_CTREE_ROW (work)->level <= depth) - { - while (work) - { - tmp = GTK_CTREE_ROW (work)->sibling; - gtk_ctree_pre_recursive_to_depth (ctree, work, depth, func, data); - work = tmp; - } - } -} - -gboolean -gtk_ctree_is_viewable (GtkCTree *ctree, - GtkCTreeNode *node) -{ - GtkCTreeRow *work; - - g_return_val_if_fail (GTK_IS_CTREE (ctree), FALSE); - g_return_val_if_fail (node != NULL, FALSE); - - work = GTK_CTREE_ROW (node); - - while (work->parent && GTK_CTREE_ROW (work->parent)->expanded) - work = GTK_CTREE_ROW (work->parent); - - if (!work->parent) - return TRUE; - - return FALSE; -} - -GtkCTreeNode * -gtk_ctree_last (GtkCTree *ctree, - GtkCTreeNode *node) -{ - g_return_val_if_fail (GTK_IS_CTREE (ctree), NULL); - - if (!node) - return NULL; - - while (GTK_CTREE_ROW (node)->sibling) - node = GTK_CTREE_ROW (node)->sibling; - - if (GTK_CTREE_ROW (node)->children) - return gtk_ctree_last (ctree, GTK_CTREE_ROW (node)->children); - - return node; -} - -GtkCTreeNode * -gtk_ctree_find_node_ptr (GtkCTree *ctree, - GtkCTreeRow *ctree_row) -{ - GtkCTreeNode *node; - - g_return_val_if_fail (GTK_IS_CTREE (ctree), NULL); - g_return_val_if_fail (ctree_row != NULL, NULL); - - if (ctree_row->parent) - node = GTK_CTREE_ROW (ctree_row->parent)->children; - else - node = GTK_CTREE_NODE (GTK_CLIST (ctree)->row_list); - - while (GTK_CTREE_ROW (node) != ctree_row) - node = GTK_CTREE_ROW (node)->sibling; - - return node; -} - -GtkCTreeNode * -gtk_ctree_node_nth (GtkCTree *ctree, - guint row) -{ - g_return_val_if_fail (GTK_IS_CTREE (ctree), NULL); - - if ((row >= GTK_CLIST(ctree)->rows)) - return NULL; - - return GTK_CTREE_NODE (g_list_nth (GTK_CLIST (ctree)->row_list, row)); -} - -gboolean -gtk_ctree_find (GtkCTree *ctree, - GtkCTreeNode *node, - GtkCTreeNode *child) -{ - if (!child) - return FALSE; - - if (!node) - node = GTK_CTREE_NODE (GTK_CLIST (ctree)->row_list); - - while (node) - { - if (node == child) - return TRUE; - if (GTK_CTREE_ROW (node)->children) - { - if (gtk_ctree_find (ctree, GTK_CTREE_ROW (node)->children, child)) - return TRUE; - } - node = GTK_CTREE_ROW (node)->sibling; - } - return FALSE; -} - -gboolean -gtk_ctree_is_ancestor (GtkCTree *ctree, - GtkCTreeNode *node, - GtkCTreeNode *child) -{ - g_return_val_if_fail (GTK_IS_CTREE (ctree), FALSE); - g_return_val_if_fail (node != NULL, FALSE); - - if (GTK_CTREE_ROW (node)->children) - return gtk_ctree_find (ctree, GTK_CTREE_ROW (node)->children, child); - - return FALSE; -} - -GtkCTreeNode * -gtk_ctree_find_by_row_data (GtkCTree *ctree, - GtkCTreeNode *node, - gpointer data) -{ - GtkCTreeNode *work; - - if (!node) - node = GTK_CTREE_NODE (GTK_CLIST (ctree)->row_list); - - while (node) - { - if (GTK_CTREE_ROW (node)->row.data == data) - return node; - if (GTK_CTREE_ROW (node)->children && - (work = gtk_ctree_find_by_row_data - (ctree, GTK_CTREE_ROW (node)->children, data))) - return work; - node = GTK_CTREE_ROW (node)->sibling; - } - return NULL; -} - -GList * -gtk_ctree_find_all_by_row_data (GtkCTree *ctree, - GtkCTreeNode *node, - gpointer data) -{ - GList *list = NULL; - - g_return_val_if_fail (GTK_IS_CTREE (ctree), NULL); - - /* if node == NULL then look in the whole tree */ - if (!node) - node = GTK_CTREE_NODE (GTK_CLIST (ctree)->row_list); - - while (node) - { - if (GTK_CTREE_ROW (node)->row.data == data) - list = g_list_append (list, node); - - if (GTK_CTREE_ROW (node)->children) - { - GList *sub_list; - - sub_list = gtk_ctree_find_all_by_row_data (ctree, - GTK_CTREE_ROW - (node)->children, - data); - list = g_list_concat (list, sub_list); - } - node = GTK_CTREE_ROW (node)->sibling; - } - return list; -} - -GtkCTreeNode * -gtk_ctree_find_by_row_data_custom (GtkCTree *ctree, - GtkCTreeNode *node, - gpointer data, - GCompareFunc func) -{ - GtkCTreeNode *work; - - g_return_val_if_fail (func != NULL, NULL); - - if (!node) - node = GTK_CTREE_NODE (GTK_CLIST (ctree)->row_list); - - while (node) - { - if (!func (GTK_CTREE_ROW (node)->row.data, data)) - return node; - if (GTK_CTREE_ROW (node)->children && - (work = gtk_ctree_find_by_row_data_custom - (ctree, GTK_CTREE_ROW (node)->children, data, func))) - return work; - node = GTK_CTREE_ROW (node)->sibling; - } - return NULL; -} - -GList * -gtk_ctree_find_all_by_row_data_custom (GtkCTree *ctree, - GtkCTreeNode *node, - gpointer data, - GCompareFunc func) -{ - GList *list = NULL; - - g_return_val_if_fail (GTK_IS_CTREE (ctree), NULL); - g_return_val_if_fail (func != NULL, NULL); - - /* if node == NULL then look in the whole tree */ - if (!node) - node = GTK_CTREE_NODE (GTK_CLIST (ctree)->row_list); - - while (node) - { - if (!func (GTK_CTREE_ROW (node)->row.data, data)) - list = g_list_append (list, node); - - if (GTK_CTREE_ROW (node)->children) - { - GList *sub_list; - - sub_list = gtk_ctree_find_all_by_row_data_custom (ctree, - GTK_CTREE_ROW - (node)->children, - data, - func); - list = g_list_concat (list, sub_list); - } - node = GTK_CTREE_ROW (node)->sibling; - } - return list; -} - -gboolean -gtk_ctree_is_hot_spot (GtkCTree *ctree, - gint x, - gint y) -{ - GtkCTreeNode *node; - gint column; - gint row; - - g_return_val_if_fail (GTK_IS_CTREE (ctree), FALSE); - - if (gtk_clist_get_selection_info (GTK_CLIST (ctree), x, y, &row, &column)) - if ((node = GTK_CTREE_NODE(g_list_nth (GTK_CLIST (ctree)->row_list, row)))) - return ctree_is_hot_spot (ctree, node, row, x, y); - - return FALSE; -} - - -/*********************************************************** - * Tree signals : move, expand, collapse, (un)select * - ***********************************************************/ - - -/** - * gtk_ctree_move: - * @new_parent: (allow-none): - * @new_sibling: (allow-none): - */ -void -gtk_ctree_move (GtkCTree *ctree, - GtkCTreeNode *node, - GtkCTreeNode *new_parent, - GtkCTreeNode *new_sibling) -{ - g_return_if_fail (GTK_IS_CTREE (ctree)); - g_return_if_fail (node != NULL); - - gtk_signal_emit (GTK_OBJECT (ctree), ctree_signals[TREE_MOVE], node, - new_parent, new_sibling); -} - -void -gtk_ctree_expand (GtkCTree *ctree, - GtkCTreeNode *node) -{ - g_return_if_fail (GTK_IS_CTREE (ctree)); - g_return_if_fail (node != NULL); - - if (GTK_CTREE_ROW (node)->is_leaf) - return; - - gtk_signal_emit (GTK_OBJECT (ctree), ctree_signals[TREE_EXPAND], node); -} - -void -gtk_ctree_expand_recursive (GtkCTree *ctree, - GtkCTreeNode *node) -{ - GtkCList *clist; - gboolean thaw = FALSE; - - g_return_if_fail (GTK_IS_CTREE (ctree)); - - clist = GTK_CLIST (ctree); - - if (node && GTK_CTREE_ROW (node)->is_leaf) - return; - - if (CLIST_UNFROZEN (clist) && (!node || gtk_ctree_is_viewable (ctree, node))) - { - gtk_clist_freeze (clist); - thaw = TRUE; - } - - gtk_ctree_post_recursive (ctree, node, GTK_CTREE_FUNC (tree_expand), NULL); - - if (thaw) - gtk_clist_thaw (clist); -} - -void -gtk_ctree_expand_to_depth (GtkCTree *ctree, - GtkCTreeNode *node, - gint depth) -{ - GtkCList *clist; - gboolean thaw = FALSE; - - g_return_if_fail (GTK_IS_CTREE (ctree)); - - clist = GTK_CLIST (ctree); - - if (node && GTK_CTREE_ROW (node)->is_leaf) - return; - - if (CLIST_UNFROZEN (clist) && (!node || gtk_ctree_is_viewable (ctree, node))) - { - gtk_clist_freeze (clist); - thaw = TRUE; - } - - gtk_ctree_post_recursive_to_depth (ctree, node, depth, - GTK_CTREE_FUNC (tree_expand), NULL); - - if (thaw) - gtk_clist_thaw (clist); -} - -void -gtk_ctree_collapse (GtkCTree *ctree, - GtkCTreeNode *node) -{ - g_return_if_fail (GTK_IS_CTREE (ctree)); - g_return_if_fail (node != NULL); - - if (GTK_CTREE_ROW (node)->is_leaf) - return; - - gtk_signal_emit (GTK_OBJECT (ctree), ctree_signals[TREE_COLLAPSE], node); -} - -void -gtk_ctree_collapse_recursive (GtkCTree *ctree, - GtkCTreeNode *node) -{ - GtkCList *clist; - gboolean thaw = FALSE; - gint i; - - g_return_if_fail (GTK_IS_CTREE (ctree)); - - if (node && GTK_CTREE_ROW (node)->is_leaf) - return; - - clist = GTK_CLIST (ctree); - - if (CLIST_UNFROZEN (clist) && (!node || gtk_ctree_is_viewable (ctree, node))) - { - gtk_clist_freeze (clist); - thaw = TRUE; - } - - GTK_CLIST_SET_FLAG (clist, CLIST_AUTO_RESIZE_BLOCKED); - gtk_ctree_post_recursive (ctree, node, GTK_CTREE_FUNC (tree_collapse), NULL); - GTK_CLIST_UNSET_FLAG (clist, CLIST_AUTO_RESIZE_BLOCKED); - for (i = 0; i < clist->columns; i++) - if (clist->column[i].auto_resize) - gtk_clist_set_column_width (clist, i, - gtk_clist_optimal_column_width (clist, i)); - - if (thaw) - gtk_clist_thaw (clist); -} - -void -gtk_ctree_collapse_to_depth (GtkCTree *ctree, - GtkCTreeNode *node, - gint depth) -{ - GtkCList *clist; - gboolean thaw = FALSE; - gint i; - - g_return_if_fail (GTK_IS_CTREE (ctree)); - - if (node && GTK_CTREE_ROW (node)->is_leaf) - return; - - clist = GTK_CLIST (ctree); - - if (CLIST_UNFROZEN (clist) && (!node || gtk_ctree_is_viewable (ctree, node))) - { - gtk_clist_freeze (clist); - thaw = TRUE; - } - - GTK_CLIST_SET_FLAG (clist, CLIST_AUTO_RESIZE_BLOCKED); - gtk_ctree_post_recursive_to_depth (ctree, node, depth, - GTK_CTREE_FUNC (tree_collapse_to_depth), - GINT_TO_POINTER (depth)); - GTK_CLIST_UNSET_FLAG (clist, CLIST_AUTO_RESIZE_BLOCKED); - for (i = 0; i < clist->columns; i++) - if (clist->column[i].auto_resize) - gtk_clist_set_column_width (clist, i, - gtk_clist_optimal_column_width (clist, i)); - - if (thaw) - gtk_clist_thaw (clist); -} - -void -gtk_ctree_toggle_expansion (GtkCTree *ctree, - GtkCTreeNode *node) -{ - g_return_if_fail (GTK_IS_CTREE (ctree)); - g_return_if_fail (node != NULL); - - if (GTK_CTREE_ROW (node)->is_leaf) - return; - - tree_toggle_expansion (ctree, node, NULL); -} - -void -gtk_ctree_toggle_expansion_recursive (GtkCTree *ctree, - GtkCTreeNode *node) -{ - GtkCList *clist; - gboolean thaw = FALSE; - - g_return_if_fail (GTK_IS_CTREE (ctree)); - - if (node && GTK_CTREE_ROW (node)->is_leaf) - return; - - clist = GTK_CLIST (ctree); - - if (CLIST_UNFROZEN (clist) && (!node || gtk_ctree_is_viewable (ctree, node))) - { - gtk_clist_freeze (clist); - thaw = TRUE; - } - - gtk_ctree_post_recursive (ctree, node, - GTK_CTREE_FUNC (tree_toggle_expansion), NULL); - - if (thaw) - gtk_clist_thaw (clist); -} - -void -gtk_ctree_select (GtkCTree *ctree, - GtkCTreeNode *node) -{ - g_return_if_fail (GTK_IS_CTREE (ctree)); - g_return_if_fail (node != NULL); - - if (GTK_CTREE_ROW (node)->row.selectable) - gtk_signal_emit (GTK_OBJECT (ctree), ctree_signals[TREE_SELECT_ROW], - node, -1); -} - -void -gtk_ctree_unselect (GtkCTree *ctree, - GtkCTreeNode *node) -{ - g_return_if_fail (GTK_IS_CTREE (ctree)); - g_return_if_fail (node != NULL); - - gtk_signal_emit (GTK_OBJECT (ctree), ctree_signals[TREE_UNSELECT_ROW], - node, -1); -} - -void -gtk_ctree_select_recursive (GtkCTree *ctree, - GtkCTreeNode *node) -{ - gtk_ctree_real_select_recursive (ctree, node, TRUE); -} - -void -gtk_ctree_unselect_recursive (GtkCTree *ctree, - GtkCTreeNode *node) -{ - gtk_ctree_real_select_recursive (ctree, node, FALSE); -} - -void -gtk_ctree_real_select_recursive (GtkCTree *ctree, - GtkCTreeNode *node, - gint state) -{ - GtkCList *clist; - gboolean thaw = FALSE; - - g_return_if_fail (GTK_IS_CTREE (ctree)); - - clist = GTK_CLIST (ctree); - - if ((state && - (clist->selection_mode == GTK_SELECTION_BROWSE || - clist->selection_mode == GTK_SELECTION_SINGLE)) || - (!state && clist->selection_mode == GTK_SELECTION_BROWSE)) - return; - - if (CLIST_UNFROZEN (clist) && (!node || gtk_ctree_is_viewable (ctree, node))) - { - gtk_clist_freeze (clist); - thaw = TRUE; - } - - if (clist->selection_mode == GTK_SELECTION_MULTIPLE) - { - GTK_CLIST_GET_CLASS (clist)->resync_selection (clist, NULL); - - g_list_free (clist->undo_selection); - g_list_free (clist->undo_unselection); - clist->undo_selection = NULL; - clist->undo_unselection = NULL; - } - - if (state) - gtk_ctree_post_recursive (ctree, node, - GTK_CTREE_FUNC (tree_select), NULL); - else - gtk_ctree_post_recursive (ctree, node, - GTK_CTREE_FUNC (tree_unselect), NULL); - - if (thaw) - gtk_clist_thaw (clist); -} - - -/*********************************************************** - * Analogons of GtkCList functions * - ***********************************************************/ - - -void -gtk_ctree_node_set_text (GtkCTree *ctree, - GtkCTreeNode *node, - gint column, - const gchar *text) -{ - GtkCList *clist; - - g_return_if_fail (GTK_IS_CTREE (ctree)); - g_return_if_fail (node != NULL); - - if (column < 0 || column >= GTK_CLIST (ctree)->columns) - return; - - clist = GTK_CLIST (ctree); - - GTK_CLIST_GET_CLASS (clist)->set_cell_contents - (clist, &(GTK_CTREE_ROW (node)->row), column, GTK_CELL_TEXT, - text, 0, NULL, NULL); - - tree_draw_node (ctree, node); -} - - -/** - * gtk_ctree_node_set_pixmap: - * @mask: (allow-none): - */ -void -gtk_ctree_node_set_pixmap (GtkCTree *ctree, - GtkCTreeNode *node, - gint column, - GdkPixmap *pixmap, - GdkBitmap *mask) -{ - GtkCList *clist; - - g_return_if_fail (GTK_IS_CTREE (ctree)); - g_return_if_fail (node != NULL); - g_return_if_fail (pixmap != NULL); - - if (column < 0 || column >= GTK_CLIST (ctree)->columns) - return; - - g_object_ref (pixmap); - if (mask) - g_object_ref (mask); - - clist = GTK_CLIST (ctree); - - GTK_CLIST_GET_CLASS (clist)->set_cell_contents - (clist, &(GTK_CTREE_ROW (node)->row), column, GTK_CELL_PIXMAP, - NULL, 0, pixmap, mask); - - tree_draw_node (ctree, node); -} - - -/** - * gtk_ctree_node_set_pixtext: - * @mask: (allow-none): - */ -void -gtk_ctree_node_set_pixtext (GtkCTree *ctree, - GtkCTreeNode *node, - gint column, - const gchar *text, - guint8 spacing, - GdkPixmap *pixmap, - GdkBitmap *mask) -{ - GtkCList *clist; - - g_return_if_fail (GTK_IS_CTREE (ctree)); - g_return_if_fail (node != NULL); - if (column != ctree->tree_column) - g_return_if_fail (pixmap != NULL); - if (column < 0 || column >= GTK_CLIST (ctree)->columns) - return; - - clist = GTK_CLIST (ctree); - - if (pixmap) - { - g_object_ref (pixmap); - if (mask) - g_object_ref (mask); - } - - GTK_CLIST_GET_CLASS (clist)->set_cell_contents - (clist, &(GTK_CTREE_ROW (node)->row), column, GTK_CELL_PIXTEXT, - text, spacing, pixmap, mask); - - tree_draw_node (ctree, node); -} - - -/** - * gtk_ctree_set_node_info: - * @pixmap_closed: (allow-none): - * @mask_closed: (allow-none): - * @pixmap_opened: (allow-none): - * @mask_opened: (allow-none): - */ -void -gtk_ctree_set_node_info (GtkCTree *ctree, - GtkCTreeNode *node, - const gchar *text, - guint8 spacing, - GdkPixmap *pixmap_closed, - GdkBitmap *mask_closed, - GdkPixmap *pixmap_opened, - GdkBitmap *mask_opened, - gboolean is_leaf, - gboolean expanded) -{ - gboolean old_leaf; - gboolean old_expanded; - - g_return_if_fail (GTK_IS_CTREE (ctree)); - g_return_if_fail (node != NULL); - - old_leaf = GTK_CTREE_ROW (node)->is_leaf; - old_expanded = GTK_CTREE_ROW (node)->expanded; - - if (is_leaf && GTK_CTREE_ROW (node)->children) - { - GtkCTreeNode *work; - GtkCTreeNode *ptr; - - work = GTK_CTREE_ROW (node)->children; - while (work) - { - ptr = work; - work = GTK_CTREE_ROW (work)->sibling; - gtk_ctree_remove_node (ctree, ptr); - } - } - - set_node_info (ctree, node, text, spacing, pixmap_closed, mask_closed, - pixmap_opened, mask_opened, is_leaf, expanded); - - if (!is_leaf && !old_leaf) - { - GTK_CTREE_ROW (node)->expanded = old_expanded; - if (expanded && !old_expanded) - gtk_ctree_expand (ctree, node); - else if (!expanded && old_expanded) - gtk_ctree_collapse (ctree, node); - } - - GTK_CTREE_ROW (node)->expanded = (is_leaf) ? FALSE : expanded; - - tree_draw_node (ctree, node); -} - -void -gtk_ctree_node_set_shift (GtkCTree *ctree, - GtkCTreeNode *node, - gint column, - gint vertical, - gint horizontal) -{ - GtkCList *clist; - GtkRequisition requisition; - gboolean visible = FALSE; - - g_return_if_fail (GTK_IS_CTREE (ctree)); - g_return_if_fail (node != NULL); - - if (column < 0 || column >= GTK_CLIST (ctree)->columns) - return; - - clist = GTK_CLIST (ctree); - - if (clist->column[column].auto_resize && - !GTK_CLIST_AUTO_RESIZE_BLOCKED (clist)) - { - visible = gtk_ctree_is_viewable (ctree, node); - if (visible) - GTK_CLIST_GET_CLASS (clist)->cell_size_request - (clist, >K_CTREE_ROW (node)->row, column, &requisition); - } - - GTK_CTREE_ROW (node)->row.cell[column].vertical = vertical; - GTK_CTREE_ROW (node)->row.cell[column].horizontal = horizontal; - - if (visible) - column_auto_resize (clist, >K_CTREE_ROW (node)->row, - column, requisition.width); - - tree_draw_node (ctree, node); -} - -static void -remove_grab (GtkCList *clist) -{ - if (gdk_display_pointer_is_grabbed (gtk_widget_get_display (GTK_WIDGET (clist))) && - GTK_WIDGET_HAS_GRAB (clist)) - { - gtk_grab_remove (GTK_WIDGET (clist)); - gdk_display_pointer_ungrab (gtk_widget_get_display (GTK_WIDGET (clist)), - GDK_CURRENT_TIME); - } - - if (clist->htimer) - { - g_source_remove (clist->htimer); - clist->htimer = 0; - } - - if (clist->vtimer) - { - g_source_remove (clist->vtimer); - clist->vtimer = 0; - } -} - -void -gtk_ctree_node_set_selectable (GtkCTree *ctree, - GtkCTreeNode *node, - gboolean selectable) -{ - g_return_if_fail (GTK_IS_CTREE (ctree)); - g_return_if_fail (node != NULL); - - if (selectable == GTK_CTREE_ROW (node)->row.selectable) - return; - - GTK_CTREE_ROW (node)->row.selectable = selectable; - - if (!selectable && GTK_CTREE_ROW (node)->row.state == GTK_STATE_SELECTED) - { - GtkCList *clist; - - clist = GTK_CLIST (ctree); - - if (clist->anchor >= 0 && - clist->selection_mode == GTK_SELECTION_MULTIPLE) - { - clist->drag_button = 0; - remove_grab (clist); - - GTK_CLIST_GET_CLASS (clist)->resync_selection (clist, NULL); - } - gtk_ctree_unselect (ctree, node); - } -} - -gboolean -gtk_ctree_node_get_selectable (GtkCTree *ctree, - GtkCTreeNode *node) -{ - g_return_val_if_fail (node != NULL, FALSE); - - return GTK_CTREE_ROW (node)->row.selectable; -} - -GtkCellType -gtk_ctree_node_get_cell_type (GtkCTree *ctree, - GtkCTreeNode *node, - gint column) -{ - g_return_val_if_fail (GTK_IS_CTREE (ctree), -1); - g_return_val_if_fail (node != NULL, -1); - - if (column < 0 || column >= GTK_CLIST (ctree)->columns) - return -1; - - return GTK_CTREE_ROW (node)->row.cell[column].type; -} - -gboolean -gtk_ctree_node_get_text (GtkCTree *ctree, - GtkCTreeNode *node, - gint column, - gchar **text) -{ - g_return_val_if_fail (GTK_IS_CTREE (ctree), FALSE); - g_return_val_if_fail (node != NULL, FALSE); - - if (column < 0 || column >= GTK_CLIST (ctree)->columns) - return FALSE; - - if (GTK_CTREE_ROW (node)->row.cell[column].type != GTK_CELL_TEXT) - return FALSE; - - if (text) - *text = GTK_CELL_TEXT (GTK_CTREE_ROW (node)->row.cell[column])->text; - - return TRUE; -} - -gboolean -gtk_ctree_node_get_pixmap (GtkCTree *ctree, - GtkCTreeNode *node, - gint column, - GdkPixmap **pixmap, - GdkBitmap **mask) -{ - g_return_val_if_fail (GTK_IS_CTREE (ctree), FALSE); - g_return_val_if_fail (node != NULL, FALSE); - - if (column < 0 || column >= GTK_CLIST (ctree)->columns) - return FALSE; - - if (GTK_CTREE_ROW (node)->row.cell[column].type != GTK_CELL_PIXMAP) - return FALSE; - - if (pixmap) - *pixmap = GTK_CELL_PIXMAP (GTK_CTREE_ROW (node)->row.cell[column])->pixmap; - if (mask) - *mask = GTK_CELL_PIXMAP (GTK_CTREE_ROW (node)->row.cell[column])->mask; - - return TRUE; -} - -gboolean -gtk_ctree_node_get_pixtext (GtkCTree *ctree, - GtkCTreeNode *node, - gint column, - gchar **text, - guint8 *spacing, - GdkPixmap **pixmap, - GdkBitmap **mask) -{ - g_return_val_if_fail (GTK_IS_CTREE (ctree), FALSE); - g_return_val_if_fail (node != NULL, FALSE); - - if (column < 0 || column >= GTK_CLIST (ctree)->columns) - return FALSE; - - if (GTK_CTREE_ROW (node)->row.cell[column].type != GTK_CELL_PIXTEXT) - return FALSE; - - if (text) - *text = GTK_CELL_PIXTEXT (GTK_CTREE_ROW (node)->row.cell[column])->text; - if (spacing) - *spacing = GTK_CELL_PIXTEXT (GTK_CTREE_ROW - (node)->row.cell[column])->spacing; - if (pixmap) - *pixmap = GTK_CELL_PIXTEXT (GTK_CTREE_ROW - (node)->row.cell[column])->pixmap; - if (mask) - *mask = GTK_CELL_PIXTEXT (GTK_CTREE_ROW (node)->row.cell[column])->mask; - - return TRUE; -} - -gboolean -gtk_ctree_get_node_info (GtkCTree *ctree, - GtkCTreeNode *node, - gchar **text, - guint8 *spacing, - GdkPixmap **pixmap_closed, - GdkBitmap **mask_closed, - GdkPixmap **pixmap_opened, - GdkBitmap **mask_opened, - gboolean *is_leaf, - gboolean *expanded) -{ - g_return_val_if_fail (GTK_IS_CTREE (ctree), FALSE); - g_return_val_if_fail (node != NULL, FALSE); - - if (text) - *text = GTK_CELL_PIXTEXT - (GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->text; - if (spacing) - *spacing = GTK_CELL_PIXTEXT - (GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->spacing; - if (pixmap_closed) - *pixmap_closed = GTK_CTREE_ROW (node)->pixmap_closed; - if (mask_closed) - *mask_closed = GTK_CTREE_ROW (node)->mask_closed; - if (pixmap_opened) - *pixmap_opened = GTK_CTREE_ROW (node)->pixmap_opened; - if (mask_opened) - *mask_opened = GTK_CTREE_ROW (node)->mask_opened; - if (is_leaf) - *is_leaf = GTK_CTREE_ROW (node)->is_leaf; - if (expanded) - *expanded = GTK_CTREE_ROW (node)->expanded; - - return TRUE; -} - -void -gtk_ctree_node_set_cell_style (GtkCTree *ctree, - GtkCTreeNode *node, - gint column, - GtkStyle *style) -{ - GtkCList *clist; - GtkRequisition requisition; - gboolean visible = FALSE; - - g_return_if_fail (GTK_IS_CTREE (ctree)); - g_return_if_fail (node != NULL); - - clist = GTK_CLIST (ctree); - - if (column < 0 || column >= clist->columns) - return; - - if (GTK_CTREE_ROW (node)->row.cell[column].style == style) - return; - - if (clist->column[column].auto_resize && - !GTK_CLIST_AUTO_RESIZE_BLOCKED (clist)) - { - visible = gtk_ctree_is_viewable (ctree, node); - if (visible) - GTK_CLIST_GET_CLASS (clist)->cell_size_request - (clist, >K_CTREE_ROW (node)->row, column, &requisition); - } - - if (GTK_CTREE_ROW (node)->row.cell[column].style) - { - if (gtk_widget_get_realized (GTK_WIDGET (ctree))) - gtk_style_detach (GTK_CTREE_ROW (node)->row.cell[column].style); - g_object_unref (GTK_CTREE_ROW (node)->row.cell[column].style); - } - - GTK_CTREE_ROW (node)->row.cell[column].style = style; - - if (GTK_CTREE_ROW (node)->row.cell[column].style) - { - g_object_ref (GTK_CTREE_ROW (node)->row.cell[column].style); - - if (gtk_widget_get_realized (GTK_WIDGET (ctree))) - GTK_CTREE_ROW (node)->row.cell[column].style = - gtk_style_attach (GTK_CTREE_ROW (node)->row.cell[column].style, - clist->clist_window); - } - - if (visible) - column_auto_resize (clist, >K_CTREE_ROW (node)->row, column, - requisition.width); - - tree_draw_node (ctree, node); -} - -GtkStyle * -gtk_ctree_node_get_cell_style (GtkCTree *ctree, - GtkCTreeNode *node, - gint column) -{ - g_return_val_if_fail (GTK_IS_CTREE (ctree), NULL); - g_return_val_if_fail (node != NULL, NULL); - - if (column < 0 || column >= GTK_CLIST (ctree)->columns) - return NULL; - - return GTK_CTREE_ROW (node)->row.cell[column].style; -} - -void -gtk_ctree_node_set_row_style (GtkCTree *ctree, - GtkCTreeNode *node, - GtkStyle *style) -{ - GtkCList *clist; - GtkRequisition requisition; - gboolean visible; - gint *old_width = NULL; - gint i; - - g_return_if_fail (GTK_IS_CTREE (ctree)); - g_return_if_fail (node != NULL); - - clist = GTK_CLIST (ctree); - - if (GTK_CTREE_ROW (node)->row.style == style) - return; - - visible = gtk_ctree_is_viewable (ctree, node); - if (visible && !GTK_CLIST_AUTO_RESIZE_BLOCKED (clist)) - { - old_width = g_new (gint, clist->columns); - for (i = 0; i < clist->columns; i++) - if (clist->column[i].auto_resize) - { - GTK_CLIST_GET_CLASS (clist)->cell_size_request - (clist, >K_CTREE_ROW (node)->row, i, &requisition); - old_width[i] = requisition.width; - } - } - - if (GTK_CTREE_ROW (node)->row.style) - { - if (gtk_widget_get_realized (GTK_WIDGET (ctree))) - gtk_style_detach (GTK_CTREE_ROW (node)->row.style); - g_object_unref (GTK_CTREE_ROW (node)->row.style); - } - - GTK_CTREE_ROW (node)->row.style = style; - - if (GTK_CTREE_ROW (node)->row.style) - { - g_object_ref (GTK_CTREE_ROW (node)->row.style); - - if (gtk_widget_get_realized (GTK_WIDGET (ctree))) - GTK_CTREE_ROW (node)->row.style = - gtk_style_attach (GTK_CTREE_ROW (node)->row.style, - clist->clist_window); - } - - if (visible && !GTK_CLIST_AUTO_RESIZE_BLOCKED (clist)) - { - for (i = 0; i < clist->columns; i++) - if (clist->column[i].auto_resize) - column_auto_resize (clist, >K_CTREE_ROW (node)->row, i, - old_width[i]); - g_free (old_width); - } - tree_draw_node (ctree, node); -} - -GtkStyle * -gtk_ctree_node_get_row_style (GtkCTree *ctree, - GtkCTreeNode *node) -{ - g_return_val_if_fail (GTK_IS_CTREE (ctree), NULL); - g_return_val_if_fail (node != NULL, NULL); - - return GTK_CTREE_ROW (node)->row.style; -} - -void -gtk_ctree_node_set_foreground (GtkCTree *ctree, - GtkCTreeNode *node, - const GdkColor *color) -{ - g_return_if_fail (GTK_IS_CTREE (ctree)); - g_return_if_fail (node != NULL); - - if (color) - { - GTK_CTREE_ROW (node)->row.foreground = *color; - GTK_CTREE_ROW (node)->row.fg_set = TRUE; - if (gtk_widget_get_realized (GTK_WIDGET (ctree))) - gdk_colormap_alloc_color (gtk_widget_get_colormap (GTK_WIDGET (ctree)), - >K_CTREE_ROW (node)->row.foreground, - FALSE, TRUE); - } - else - GTK_CTREE_ROW (node)->row.fg_set = FALSE; - - tree_draw_node (ctree, node); -} - -void -gtk_ctree_node_set_background (GtkCTree *ctree, - GtkCTreeNode *node, - const GdkColor *color) -{ - g_return_if_fail (GTK_IS_CTREE (ctree)); - g_return_if_fail (node != NULL); - - if (color) - { - GTK_CTREE_ROW (node)->row.background = *color; - GTK_CTREE_ROW (node)->row.bg_set = TRUE; - if (gtk_widget_get_realized (GTK_WIDGET (ctree))) - gdk_colormap_alloc_color (gtk_widget_get_colormap (GTK_WIDGET (ctree)), - >K_CTREE_ROW (node)->row.background, - FALSE, TRUE); - } - else - GTK_CTREE_ROW (node)->row.bg_set = FALSE; - - tree_draw_node (ctree, node); -} - -void -gtk_ctree_node_set_row_data (GtkCTree *ctree, - GtkCTreeNode *node, - gpointer data) -{ - gtk_ctree_node_set_row_data_full (ctree, node, data, NULL); -} - -void -gtk_ctree_node_set_row_data_full (GtkCTree *ctree, - GtkCTreeNode *node, - gpointer data, - GDestroyNotify destroy) -{ - GDestroyNotify dnotify; - gpointer ddata; - - g_return_if_fail (GTK_IS_CTREE (ctree)); - g_return_if_fail (node != NULL); - - dnotify = GTK_CTREE_ROW (node)->row.destroy; - ddata = GTK_CTREE_ROW (node)->row.data; - - GTK_CTREE_ROW (node)->row.data = data; - GTK_CTREE_ROW (node)->row.destroy = destroy; - - if (dnotify) - dnotify (ddata); -} - -gpointer -gtk_ctree_node_get_row_data (GtkCTree *ctree, - GtkCTreeNode *node) -{ - g_return_val_if_fail (GTK_IS_CTREE (ctree), NULL); - - return node ? GTK_CTREE_ROW (node)->row.data : NULL; -} - -void -gtk_ctree_node_moveto (GtkCTree *ctree, - GtkCTreeNode *node, - gint column, - gfloat row_align, - gfloat col_align) -{ - gint row = -1; - GtkCList *clist; - - g_return_if_fail (GTK_IS_CTREE (ctree)); - - clist = GTK_CLIST (ctree); - - while (node && !gtk_ctree_is_viewable (ctree, node)) - node = GTK_CTREE_ROW (node)->parent; - - if (node) - row = g_list_position (clist->row_list, (GList *)node); - - gtk_clist_moveto (clist, row, column, row_align, col_align); -} - -GtkVisibility -gtk_ctree_node_is_visible (GtkCTree *ctree, - GtkCTreeNode *node) -{ - gint row; - - g_return_val_if_fail (ctree != NULL, 0); - g_return_val_if_fail (node != NULL, 0); - - row = g_list_position (GTK_CLIST (ctree)->row_list, (GList*) node); - return gtk_clist_row_is_visible (GTK_CLIST (ctree), row); -} - - -/*********************************************************** - * GtkCTree specific functions * - ***********************************************************/ - -void -gtk_ctree_set_indent (GtkCTree *ctree, - gint indent) -{ - GtkCList *clist; - - g_return_if_fail (GTK_IS_CTREE (ctree)); - g_return_if_fail (indent >= 0); - - if (indent == ctree->tree_indent) - return; - - clist = GTK_CLIST (ctree); - ctree->tree_indent = indent; - - if (clist->column[ctree->tree_column].auto_resize && - !GTK_CLIST_AUTO_RESIZE_BLOCKED (clist)) - gtk_clist_set_column_width - (clist, ctree->tree_column, - gtk_clist_optimal_column_width (clist, ctree->tree_column)); - else - CLIST_REFRESH (ctree); -} - -void -gtk_ctree_set_spacing (GtkCTree *ctree, - gint spacing) -{ - GtkCList *clist; - gint old_spacing; - - g_return_if_fail (GTK_IS_CTREE (ctree)); - g_return_if_fail (spacing >= 0); - - if (spacing == ctree->tree_spacing) - return; - - clist = GTK_CLIST (ctree); - - old_spacing = ctree->tree_spacing; - ctree->tree_spacing = spacing; - - if (clist->column[ctree->tree_column].auto_resize && - !GTK_CLIST_AUTO_RESIZE_BLOCKED (clist)) - gtk_clist_set_column_width (clist, ctree->tree_column, - clist->column[ctree->tree_column].width + - spacing - old_spacing); - else - CLIST_REFRESH (ctree); -} - -void -gtk_ctree_set_show_stub (GtkCTree *ctree, - gboolean show_stub) -{ - g_return_if_fail (GTK_IS_CTREE (ctree)); - - show_stub = show_stub != FALSE; - - if (show_stub != ctree->show_stub) - { - GtkCList *clist; - - clist = GTK_CLIST (ctree); - ctree->show_stub = show_stub; - - if (CLIST_UNFROZEN (clist) && clist->rows && - gtk_clist_row_is_visible (clist, 0) != GTK_VISIBILITY_NONE) - GTK_CLIST_GET_CLASS (clist)->draw_row - (clist, NULL, 0, GTK_CLIST_ROW (clist->row_list)); - } -} - -void -gtk_ctree_set_line_style (GtkCTree *ctree, - GtkCTreeLineStyle line_style) -{ - GtkCList *clist; - GtkCTreeLineStyle old_style; - - g_return_if_fail (GTK_IS_CTREE (ctree)); - - if (line_style == ctree->line_style) - return; - - clist = GTK_CLIST (ctree); - - old_style = ctree->line_style; - ctree->line_style = line_style; - - if (clist->column[ctree->tree_column].auto_resize && - !GTK_CLIST_AUTO_RESIZE_BLOCKED (clist)) - { - if (old_style == GTK_CTREE_LINES_TABBED) - gtk_clist_set_column_width - (clist, ctree->tree_column, - clist->column[ctree->tree_column].width - 3); - else if (line_style == GTK_CTREE_LINES_TABBED) - gtk_clist_set_column_width - (clist, ctree->tree_column, - clist->column[ctree->tree_column].width + 3); - } - - if (gtk_widget_get_realized (GTK_WIDGET (ctree))) - { - gint8 dashes[] = { 1, 1 }; - - switch (line_style) - { - case GTK_CTREE_LINES_SOLID: - if (gtk_widget_get_realized (GTK_WIDGET (ctree))) - gdk_gc_set_line_attributes (ctree->lines_gc, 1, GDK_LINE_SOLID, - GDK_CAP_BUTT, GDK_JOIN_MITER); - break; - case GTK_CTREE_LINES_DOTTED: - if (gtk_widget_get_realized (GTK_WIDGET (ctree))) - gdk_gc_set_line_attributes (ctree->lines_gc, 1, - GDK_LINE_ON_OFF_DASH, GDK_CAP_BUTT, GDK_JOIN_MITER); - gdk_gc_set_dashes (ctree->lines_gc, 0, dashes, G_N_ELEMENTS (dashes)); - break; - case GTK_CTREE_LINES_TABBED: - if (gtk_widget_get_realized (GTK_WIDGET (ctree))) - gdk_gc_set_line_attributes (ctree->lines_gc, 1, GDK_LINE_SOLID, - GDK_CAP_BUTT, GDK_JOIN_MITER); - break; - case GTK_CTREE_LINES_NONE: - break; - default: - return; - } - CLIST_REFRESH (ctree); - } -} - -void -gtk_ctree_set_expander_style (GtkCTree *ctree, - GtkCTreeExpanderStyle expander_style) -{ - GtkCList *clist; - GtkCTreeExpanderStyle old_style; - - g_return_if_fail (GTK_IS_CTREE (ctree)); - - if (expander_style == ctree->expander_style) - return; - - clist = GTK_CLIST (ctree); - - old_style = ctree->expander_style; - ctree->expander_style = expander_style; - - if (clist->column[ctree->tree_column].auto_resize && - !GTK_CLIST_AUTO_RESIZE_BLOCKED (clist)) - { - gint new_width; - - new_width = clist->column[ctree->tree_column].width; - switch (old_style) - { - case GTK_CTREE_EXPANDER_NONE: - break; - case GTK_CTREE_EXPANDER_TRIANGLE: - new_width -= PM_SIZE + 3; - break; - case GTK_CTREE_EXPANDER_SQUARE: - case GTK_CTREE_EXPANDER_CIRCULAR: - new_width -= PM_SIZE + 1; - break; - } - - switch (expander_style) - { - case GTK_CTREE_EXPANDER_NONE: - break; - case GTK_CTREE_EXPANDER_TRIANGLE: - new_width += PM_SIZE + 3; - break; - case GTK_CTREE_EXPANDER_SQUARE: - case GTK_CTREE_EXPANDER_CIRCULAR: - new_width += PM_SIZE + 1; - break; - } - - gtk_clist_set_column_width (clist, ctree->tree_column, new_width); - } - - if (GTK_WIDGET_DRAWABLE (clist)) - CLIST_REFRESH (clist); -} - - -/*********************************************************** - * Tree sorting functions * - ***********************************************************/ - - -static void -tree_sort (GtkCTree *ctree, - GtkCTreeNode *node, - gpointer data) -{ - GtkCTreeNode *list_start; - GtkCTreeNode *cmp; - GtkCTreeNode *work; - GtkCList *clist; - - clist = GTK_CLIST (ctree); - - if (node) - list_start = GTK_CTREE_ROW (node)->children; - else - list_start = GTK_CTREE_NODE (clist->row_list); - - while (list_start) - { - cmp = list_start; - work = GTK_CTREE_ROW (cmp)->sibling; - while (work) - { - if (clist->sort_type == GTK_SORT_ASCENDING) - { - if (clist->compare - (clist, GTK_CTREE_ROW (work), GTK_CTREE_ROW (cmp)) < 0) - cmp = work; - } - else - { - if (clist->compare - (clist, GTK_CTREE_ROW (work), GTK_CTREE_ROW (cmp)) > 0) - cmp = work; - } - work = GTK_CTREE_ROW (work)->sibling; - } - if (cmp == list_start) - list_start = GTK_CTREE_ROW (cmp)->sibling; - else - { - gtk_ctree_unlink (ctree, cmp, FALSE); - gtk_ctree_link (ctree, cmp, node, list_start, FALSE); - } - } -} - -void -gtk_ctree_sort_recursive (GtkCTree *ctree, - GtkCTreeNode *node) -{ - GtkCList *clist; - GtkCTreeNode *focus_node = NULL; - - g_return_if_fail (GTK_IS_CTREE (ctree)); - - clist = GTK_CLIST (ctree); - - gtk_clist_freeze (clist); - - if (clist->selection_mode == GTK_SELECTION_MULTIPLE) - { - GTK_CLIST_GET_CLASS (clist)->resync_selection (clist, NULL); - - g_list_free (clist->undo_selection); - g_list_free (clist->undo_unselection); - clist->undo_selection = NULL; - clist->undo_unselection = NULL; - } - - if (!node || (node && gtk_ctree_is_viewable (ctree, node))) - focus_node = - GTK_CTREE_NODE (g_list_nth (clist->row_list, clist->focus_row)); - - gtk_ctree_post_recursive (ctree, node, GTK_CTREE_FUNC (tree_sort), NULL); - - if (!node) - tree_sort (ctree, NULL, NULL); - - if (focus_node) - { - clist->focus_row = g_list_position (clist->row_list,(GList *)focus_node); - clist->undo_anchor = clist->focus_row; - } - - gtk_clist_thaw (clist); -} - -static void -real_sort_list (GtkCList *clist) -{ - gtk_ctree_sort_recursive (GTK_CTREE (clist), NULL); -} - -void -gtk_ctree_sort_node (GtkCTree *ctree, - GtkCTreeNode *node) -{ - GtkCList *clist; - GtkCTreeNode *focus_node = NULL; - - g_return_if_fail (GTK_IS_CTREE (ctree)); - - clist = GTK_CLIST (ctree); - - gtk_clist_freeze (clist); - - if (clist->selection_mode == GTK_SELECTION_MULTIPLE) - { - GTK_CLIST_GET_CLASS (clist)->resync_selection (clist, NULL); - - g_list_free (clist->undo_selection); - g_list_free (clist->undo_unselection); - clist->undo_selection = NULL; - clist->undo_unselection = NULL; - } - - if (!node || (node && gtk_ctree_is_viewable (ctree, node))) - focus_node = GTK_CTREE_NODE - (g_list_nth (clist->row_list, clist->focus_row)); - - tree_sort (ctree, node, NULL); - - if (focus_node) - { - clist->focus_row = g_list_position (clist->row_list,(GList *)focus_node); - clist->undo_anchor = clist->focus_row; - } - - gtk_clist_thaw (clist); -} - -/************************************************************************/ - -static void -fake_unselect_all (GtkCList *clist, - gint row) -{ - GList *list; - GList *focus_node = NULL; - - if (row >= 0 && (focus_node = g_list_nth (clist->row_list, row))) - { - if (GTK_CTREE_ROW (focus_node)->row.state == GTK_STATE_NORMAL && - GTK_CTREE_ROW (focus_node)->row.selectable) - { - GTK_CTREE_ROW (focus_node)->row.state = GTK_STATE_SELECTED; - - if (CLIST_UNFROZEN (clist) && - gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE) - GTK_CLIST_GET_CLASS (clist)->draw_row (clist, NULL, row, - GTK_CLIST_ROW (focus_node)); - } - } - - clist->undo_selection = clist->selection; - clist->selection = NULL; - clist->selection_end = NULL; - - for (list = clist->undo_selection; list; list = list->next) - { - if (list->data == focus_node) - continue; - - GTK_CTREE_ROW ((GList *)(list->data))->row.state = GTK_STATE_NORMAL; - tree_draw_node (GTK_CTREE (clist), GTK_CTREE_NODE (list->data)); - } -} - -static GList * -selection_find (GtkCList *clist, - gint row_number, - GList *row_list_element) -{ - return g_list_find (clist->selection, row_list_element); -} - -static void -resync_selection (GtkCList *clist, GdkEvent *event) -{ - GtkCTree *ctree; - GList *list; - GtkCTreeNode *node; - gint i; - gint e; - gint row; - gboolean unselect; - - g_return_if_fail (GTK_IS_CTREE (clist)); - - if (clist->selection_mode != GTK_SELECTION_MULTIPLE) - return; - - if (clist->anchor < 0 || clist->drag_pos < 0) - return; - - ctree = GTK_CTREE (clist); - - clist->freeze_count++; - - i = MIN (clist->anchor, clist->drag_pos); - e = MAX (clist->anchor, clist->drag_pos); - - if (clist->undo_selection) - { - list = clist->selection; - clist->selection = clist->undo_selection; - clist->selection_end = g_list_last (clist->selection); - clist->undo_selection = list; - list = clist->selection; - - while (list) - { - node = list->data; - list = list->next; - - unselect = TRUE; - - if (gtk_ctree_is_viewable (ctree, node)) - { - row = g_list_position (clist->row_list, (GList *)node); - if (row >= i && row <= e) - unselect = FALSE; - } - if (unselect && GTK_CTREE_ROW (node)->row.selectable) - { - GTK_CTREE_ROW (node)->row.state = GTK_STATE_SELECTED; - gtk_ctree_unselect (ctree, node); - clist->undo_selection = g_list_prepend (clist->undo_selection, - node); - } - } - } - - if (clist->anchor < clist->drag_pos) - { - for (node = GTK_CTREE_NODE (g_list_nth (clist->row_list, i)); i <= e; - i++, node = GTK_CTREE_NODE_NEXT (node)) - if (GTK_CTREE_ROW (node)->row.selectable) - { - if (g_list_find (clist->selection, node)) - { - if (GTK_CTREE_ROW (node)->row.state == GTK_STATE_NORMAL) - { - GTK_CTREE_ROW (node)->row.state = GTK_STATE_SELECTED; - gtk_ctree_unselect (ctree, node); - clist->undo_selection = - g_list_prepend (clist->undo_selection, node); - } - } - else if (GTK_CTREE_ROW (node)->row.state == GTK_STATE_SELECTED) - { - GTK_CTREE_ROW (node)->row.state = GTK_STATE_NORMAL; - clist->undo_unselection = - g_list_prepend (clist->undo_unselection, node); - } - } - } - else - { - for (node = GTK_CTREE_NODE (g_list_nth (clist->row_list, e)); i <= e; - e--, node = GTK_CTREE_NODE_PREV (node)) - if (GTK_CTREE_ROW (node)->row.selectable) - { - if (g_list_find (clist->selection, node)) - { - if (GTK_CTREE_ROW (node)->row.state == GTK_STATE_NORMAL) - { - GTK_CTREE_ROW (node)->row.state = GTK_STATE_SELECTED; - gtk_ctree_unselect (ctree, node); - clist->undo_selection = - g_list_prepend (clist->undo_selection, node); - } - } - else if (GTK_CTREE_ROW (node)->row.state == GTK_STATE_SELECTED) - { - GTK_CTREE_ROW (node)->row.state = GTK_STATE_NORMAL; - clist->undo_unselection = - g_list_prepend (clist->undo_unselection, node); - } - } - } - - clist->undo_unselection = g_list_reverse (clist->undo_unselection); - for (list = clist->undo_unselection; list; list = list->next) - gtk_ctree_select (ctree, list->data); - - clist->anchor = -1; - clist->drag_pos = -1; - - if (!CLIST_UNFROZEN (clist)) - clist->freeze_count--; -} - -static void -real_undo_selection (GtkCList *clist) -{ - GtkCTree *ctree; - GList *work; - - g_return_if_fail (GTK_IS_CTREE (clist)); - - if (clist->selection_mode != GTK_SELECTION_MULTIPLE) - return; - - if (!(clist->undo_selection || clist->undo_unselection)) - { - gtk_clist_unselect_all (clist); - return; - } - - ctree = GTK_CTREE (clist); - - for (work = clist->undo_selection; work; work = work->next) - if (GTK_CTREE_ROW (work->data)->row.selectable) - gtk_ctree_select (ctree, GTK_CTREE_NODE (work->data)); - - for (work = clist->undo_unselection; work; work = work->next) - if (GTK_CTREE_ROW (work->data)->row.selectable) - gtk_ctree_unselect (ctree, GTK_CTREE_NODE (work->data)); - - if (gtk_widget_has_focus (GTK_WIDGET (clist)) && clist->focus_row != clist->undo_anchor) - { - clist->focus_row = clist->undo_anchor; - gtk_widget_queue_draw (GTK_WIDGET (clist)); - } - else - clist->focus_row = clist->undo_anchor; - - clist->undo_anchor = -1; - - g_list_free (clist->undo_selection); - g_list_free (clist->undo_unselection); - clist->undo_selection = NULL; - clist->undo_unselection = NULL; - - if (ROW_TOP_YPIXEL (clist, clist->focus_row) + clist->row_height > - clist->clist_window_height) - gtk_clist_moveto (clist, clist->focus_row, -1, 1, 0); - else if (ROW_TOP_YPIXEL (clist, clist->focus_row) < 0) - gtk_clist_moveto (clist, clist->focus_row, -1, 0, 0); - -} - -void -gtk_ctree_set_drag_compare_func (GtkCTree *ctree, - GtkCTreeCompareDragFunc cmp_func) -{ - g_return_if_fail (GTK_IS_CTREE (ctree)); - - ctree->drag_compare = cmp_func; -} - -static gboolean -check_drag (GtkCTree *ctree, - GtkCTreeNode *drag_source, - GtkCTreeNode *drag_target, - GtkCListDragPos insert_pos) -{ - g_return_val_if_fail (GTK_IS_CTREE (ctree), FALSE); - - if (drag_source && drag_source != drag_target && - (!GTK_CTREE_ROW (drag_source)->children || - !gtk_ctree_is_ancestor (ctree, drag_source, drag_target))) - { - switch (insert_pos) - { - case GTK_CLIST_DRAG_NONE: - return FALSE; - case GTK_CLIST_DRAG_AFTER: - if (GTK_CTREE_ROW (drag_target)->sibling != drag_source) - return (!ctree->drag_compare || - ctree->drag_compare (ctree, - drag_source, - GTK_CTREE_ROW (drag_target)->parent, - GTK_CTREE_ROW (drag_target)->sibling)); - break; - case GTK_CLIST_DRAG_BEFORE: - if (GTK_CTREE_ROW (drag_source)->sibling != drag_target) - return (!ctree->drag_compare || - ctree->drag_compare (ctree, - drag_source, - GTK_CTREE_ROW (drag_target)->parent, - drag_target)); - break; - case GTK_CLIST_DRAG_INTO: - if (!GTK_CTREE_ROW (drag_target)->is_leaf && - GTK_CTREE_ROW (drag_target)->children != drag_source) - return (!ctree->drag_compare || - ctree->drag_compare (ctree, - drag_source, - drag_target, - GTK_CTREE_ROW (drag_target)->children)); - break; - } - } - return FALSE; -} - - - -/************************************/ -static void -drag_dest_info_destroy (gpointer data) -{ - GtkCListDestInfo *info = data; - - g_free (info); -} - -static void -drag_dest_cell (GtkCList *clist, - gint x, - gint y, - GtkCListDestInfo *dest_info) -{ - GtkWidget *widget; - - widget = GTK_WIDGET (clist); - - dest_info->insert_pos = GTK_CLIST_DRAG_NONE; - - y -= (GTK_CONTAINER (widget)->border_width + - widget->style->ythickness + clist->column_title_area.height); - dest_info->cell.row = ROW_FROM_YPIXEL (clist, y); - - if (dest_info->cell.row >= clist->rows) - { - dest_info->cell.row = clist->rows - 1; - y = ROW_TOP_YPIXEL (clist, dest_info->cell.row) + clist->row_height; - } - if (dest_info->cell.row < -1) - dest_info->cell.row = -1; - - x -= GTK_CONTAINER (widget)->border_width + widget->style->xthickness; - - dest_info->cell.column = COLUMN_FROM_XPIXEL (clist, x); - - if (dest_info->cell.row >= 0) - { - gint y_delta; - gint h = 0; - - y_delta = y - ROW_TOP_YPIXEL (clist, dest_info->cell.row); - - if (GTK_CLIST_DRAW_DRAG_RECT(clist) && - !GTK_CTREE_ROW (g_list_nth (clist->row_list, - dest_info->cell.row))->is_leaf) - { - dest_info->insert_pos = GTK_CLIST_DRAG_INTO; - h = clist->row_height / 4; - } - else if (GTK_CLIST_DRAW_DRAG_LINE(clist)) - { - dest_info->insert_pos = GTK_CLIST_DRAG_BEFORE; - h = clist->row_height / 2; - } - - if (GTK_CLIST_DRAW_DRAG_LINE(clist)) - { - if (y_delta < h) - dest_info->insert_pos = GTK_CLIST_DRAG_BEFORE; - else if (clist->row_height - y_delta < h) - dest_info->insert_pos = GTK_CLIST_DRAG_AFTER; - } - } -} - -static void -gtk_ctree_drag_begin (GtkWidget *widget, - GdkDragContext *context) -{ - GtkCList *clist; - GtkCTree *ctree; - gboolean use_icons; - - g_return_if_fail (GTK_IS_CTREE (widget)); - g_return_if_fail (context != NULL); - - clist = GTK_CLIST (widget); - ctree = GTK_CTREE (widget); - - use_icons = GTK_CLIST_USE_DRAG_ICONS (clist); - GTK_CLIST_UNSET_FLAG (clist, CLIST_USE_DRAG_ICONS); - GTK_WIDGET_CLASS (parent_class)->drag_begin (widget, context); - - if (use_icons) - { - GtkCTreeNode *node; - - GTK_CLIST_SET_FLAG (clist, CLIST_USE_DRAG_ICONS); - node = GTK_CTREE_NODE (g_list_nth (clist->row_list, - clist->click_cell.row)); - if (node) - { - if (GTK_CELL_PIXTEXT - (GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->pixmap) - { - gtk_drag_set_icon_pixmap - (context, - gtk_widget_get_colormap (widget), - GTK_CELL_PIXTEXT - (GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->pixmap, - GTK_CELL_PIXTEXT - (GTK_CTREE_ROW (node)->row.cell[ctree->tree_column])->mask, - -2, -2); - return; - } - } - gtk_drag_set_icon_default (context); - } -} - -static gint -gtk_ctree_drag_motion (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - guint time) -{ - GtkCList *clist; - GtkCTree *ctree; - GtkCListDestInfo new_info; - GtkCListDestInfo *dest_info; - - g_return_val_if_fail (GTK_IS_CTREE (widget), FALSE); - - clist = GTK_CLIST (widget); - ctree = GTK_CTREE (widget); - - dest_info = g_dataset_get_data (context, "gtk-clist-drag-dest"); - - if (!dest_info) - { - dest_info = g_new (GtkCListDestInfo, 1); - - dest_info->cell.row = -1; - dest_info->cell.column = -1; - dest_info->insert_pos = GTK_CLIST_DRAG_NONE; - - g_dataset_set_data_full (context, "gtk-clist-drag-dest", dest_info, - drag_dest_info_destroy); - } - - drag_dest_cell (clist, x, y, &new_info); - - if (GTK_CLIST_REORDERABLE (clist)) - { - GList *list; - GdkAtom atom = gdk_atom_intern_static_string ("gtk-clist-drag-reorder"); - - list = context->targets; - while (list) - { - if (atom == GDK_POINTER_TO_ATOM (list->data)) - break; - list = list->next; - } - - if (list) - { - GtkCTreeNode *drag_source; - GtkCTreeNode *drag_target; - - drag_source = GTK_CTREE_NODE (g_list_nth (clist->row_list, - clist->click_cell.row)); - drag_target = GTK_CTREE_NODE (g_list_nth (clist->row_list, - new_info.cell.row)); - - if (gtk_drag_get_source_widget (context) != widget || - !check_drag (ctree, drag_source, drag_target, - new_info.insert_pos)) - { - if (dest_info->cell.row < 0) - { - gdk_drag_status (context, GDK_ACTION_DEFAULT, time); - return FALSE; - } - return TRUE; - } - - if (new_info.cell.row != dest_info->cell.row || - (new_info.cell.row == dest_info->cell.row && - dest_info->insert_pos != new_info.insert_pos)) - { - if (dest_info->cell.row >= 0) - GTK_CLIST_GET_CLASS (clist)->draw_drag_highlight - (clist, - g_list_nth (clist->row_list, dest_info->cell.row)->data, - dest_info->cell.row, dest_info->insert_pos); - - dest_info->insert_pos = new_info.insert_pos; - dest_info->cell.row = new_info.cell.row; - dest_info->cell.column = new_info.cell.column; - - GTK_CLIST_GET_CLASS (clist)->draw_drag_highlight - (clist, - g_list_nth (clist->row_list, dest_info->cell.row)->data, - dest_info->cell.row, dest_info->insert_pos); - - clist->drag_highlight_row = dest_info->cell.row; - clist->drag_highlight_pos = dest_info->insert_pos; - - gdk_drag_status (context, context->suggested_action, time); - } - return TRUE; - } - } - - dest_info->insert_pos = new_info.insert_pos; - dest_info->cell.row = new_info.cell.row; - dest_info->cell.column = new_info.cell.column; - return TRUE; -} - -static void -gtk_ctree_drag_data_received (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - GtkSelectionData *selection_data, - guint info, - guint32 time) -{ - GtkCTree *ctree; - GtkCList *clist; - - g_return_if_fail (GTK_IS_CTREE (widget)); - g_return_if_fail (context != NULL); - g_return_if_fail (selection_data != NULL); - - ctree = GTK_CTREE (widget); - clist = GTK_CLIST (widget); - - if (GTK_CLIST_REORDERABLE (clist) && - gtk_drag_get_source_widget (context) == widget && - selection_data->target == - gdk_atom_intern_static_string ("gtk-clist-drag-reorder") && - selection_data->format == 8 && - selection_data->length == sizeof (GtkCListCellInfo)) - { - GtkCListCellInfo *source_info; - - source_info = (GtkCListCellInfo *)(selection_data->data); - if (source_info) - { - GtkCListDestInfo dest_info; - GtkCTreeNode *source_node; - GtkCTreeNode *dest_node; - - drag_dest_cell (clist, x, y, &dest_info); - - source_node = GTK_CTREE_NODE (g_list_nth (clist->row_list, - source_info->row)); - dest_node = GTK_CTREE_NODE (g_list_nth (clist->row_list, - dest_info.cell.row)); - - if (!source_node || !dest_node) - return; - - switch (dest_info.insert_pos) - { - case GTK_CLIST_DRAG_NONE: - break; - case GTK_CLIST_DRAG_INTO: - if (check_drag (ctree, source_node, dest_node, - dest_info.insert_pos)) - gtk_ctree_move (ctree, source_node, dest_node, - GTK_CTREE_ROW (dest_node)->children); - g_dataset_remove_data (context, "gtk-clist-drag-dest"); - break; - case GTK_CLIST_DRAG_BEFORE: - if (check_drag (ctree, source_node, dest_node, - dest_info.insert_pos)) - gtk_ctree_move (ctree, source_node, - GTK_CTREE_ROW (dest_node)->parent, dest_node); - g_dataset_remove_data (context, "gtk-clist-drag-dest"); - break; - case GTK_CLIST_DRAG_AFTER: - if (check_drag (ctree, source_node, dest_node, - dest_info.insert_pos)) - gtk_ctree_move (ctree, source_node, - GTK_CTREE_ROW (dest_node)->parent, - GTK_CTREE_ROW (dest_node)->sibling); - g_dataset_remove_data (context, "gtk-clist-drag-dest"); - break; - } - } - } -} - -GType -gtk_ctree_node_get_type (void) -{ - static GType our_type = 0; - - if (our_type == 0) - our_type = g_pointer_type_register_static ("GtkCTreeNode"); - - return our_type; -} - -#include "gtkaliasdef.c" diff --git a/gtk/gtkctree.h b/gtk/gtkctree.h deleted file mode 100644 index a4aa83773b..0000000000 --- a/gtk/gtkctree.h +++ /dev/null @@ -1,445 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball, Josh MacDonald - * Copyright (C) 1997-1998 Jay Painter - * - * GtkCTree widget for GTK+ - * Copyright (C) 1998 Lars Hamann and Stefan Jeske - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#if !defined (GTK_DISABLE_DEPRECATED) || defined (__GTK_CLIST_C__) || defined (__GTK_CTREE_C__) - -#ifndef __GTK_CTREE_H__ -#define __GTK_CTREE_H__ - -#include - -G_BEGIN_DECLS - -#define GTK_TYPE_CTREE (gtk_ctree_get_type ()) -#define GTK_CTREE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CTREE, GtkCTree)) -#define GTK_CTREE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_CTREE, GtkCTreeClass)) -#define GTK_IS_CTREE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CTREE)) -#define GTK_IS_CTREE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CTREE)) -#define GTK_CTREE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CTREE, GtkCTreeClass)) - -#define GTK_CTREE_ROW(_node_) ((GtkCTreeRow *)(((GList *)(_node_))->data)) -#define GTK_CTREE_NODE(_node_) ((GtkCTreeNode *)((_node_))) -#define GTK_CTREE_NODE_NEXT(_nnode_) ((GtkCTreeNode *)(((GList *)(_nnode_))->next)) -#define GTK_CTREE_NODE_PREV(_pnode_) ((GtkCTreeNode *)(((GList *)(_pnode_))->prev)) -#define GTK_CTREE_FUNC(_func_) ((GtkCTreeFunc)(_func_)) - -#define GTK_TYPE_CTREE_NODE (gtk_ctree_node_get_type ()) - -typedef enum -{ - GTK_CTREE_POS_BEFORE, - GTK_CTREE_POS_AS_CHILD, - GTK_CTREE_POS_AFTER -} GtkCTreePos; - -typedef enum -{ - GTK_CTREE_LINES_NONE, - GTK_CTREE_LINES_SOLID, - GTK_CTREE_LINES_DOTTED, - GTK_CTREE_LINES_TABBED -} GtkCTreeLineStyle; - -typedef enum -{ - GTK_CTREE_EXPANDER_NONE, - GTK_CTREE_EXPANDER_SQUARE, - GTK_CTREE_EXPANDER_TRIANGLE, - GTK_CTREE_EXPANDER_CIRCULAR -} GtkCTreeExpanderStyle; - -typedef enum -{ - GTK_CTREE_EXPANSION_EXPAND, - GTK_CTREE_EXPANSION_EXPAND_RECURSIVE, - GTK_CTREE_EXPANSION_COLLAPSE, - GTK_CTREE_EXPANSION_COLLAPSE_RECURSIVE, - GTK_CTREE_EXPANSION_TOGGLE, - GTK_CTREE_EXPANSION_TOGGLE_RECURSIVE -} GtkCTreeExpansionType; - -typedef struct _GtkCTree GtkCTree; -typedef struct _GtkCTreeClass GtkCTreeClass; -typedef struct _GtkCTreeRow GtkCTreeRow; -typedef struct _GtkCTreeNode GtkCTreeNode; - -typedef void (*GtkCTreeFunc) (GtkCTree *ctree, - GtkCTreeNode *node, - gpointer data); - -typedef gboolean (*GtkCTreeGNodeFunc) (GtkCTree *ctree, - guint depth, - GNode *gnode, - GtkCTreeNode *cnode, - gpointer data); - -typedef gboolean (*GtkCTreeCompareDragFunc) (GtkCTree *ctree, - GtkCTreeNode *source_node, - GtkCTreeNode *new_parent, - GtkCTreeNode *new_sibling); - -struct _GtkCTree -{ - GtkCList clist; - - GdkGC *lines_gc; - - gint tree_indent; - gint tree_spacing; - gint tree_column; - - guint line_style : 2; - guint expander_style : 2; - guint show_stub : 1; - - GtkCTreeCompareDragFunc drag_compare; -}; - -struct _GtkCTreeClass -{ - GtkCListClass parent_class; - - void (*tree_select_row) (GtkCTree *ctree, - GtkCTreeNode *row, - gint column); - void (*tree_unselect_row) (GtkCTree *ctree, - GtkCTreeNode *row, - gint column); - void (*tree_expand) (GtkCTree *ctree, - GtkCTreeNode *node); - void (*tree_collapse) (GtkCTree *ctree, - GtkCTreeNode *node); - void (*tree_move) (GtkCTree *ctree, - GtkCTreeNode *node, - GtkCTreeNode *new_parent, - GtkCTreeNode *new_sibling); - void (*change_focus_row_expansion) (GtkCTree *ctree, - GtkCTreeExpansionType action); -}; - -struct _GtkCTreeRow -{ - GtkCListRow row; - - GtkCTreeNode *parent; - GtkCTreeNode *sibling; - GtkCTreeNode *children; - - GdkPixmap *pixmap_closed; - GdkBitmap *mask_closed; - GdkPixmap *pixmap_opened; - GdkBitmap *mask_opened; - - guint16 level; - - guint is_leaf : 1; - guint expanded : 1; -}; - -struct _GtkCTreeNode { - GList list; -}; - - -/*********************************************************** - * Creation, insertion, deletion * - ***********************************************************/ - -GType gtk_ctree_get_type (void) G_GNUC_CONST; -GtkWidget * gtk_ctree_new_with_titles (gint columns, - gint tree_column, - gchar *titles[]); -GtkWidget * gtk_ctree_new (gint columns, - gint tree_column); -GtkCTreeNode * gtk_ctree_insert_node (GtkCTree *ctree, - GtkCTreeNode *parent, - GtkCTreeNode *sibling, - gchar *text[], - guint8 spacing, - GdkPixmap *pixmap_closed, - GdkBitmap *mask_closed, - GdkPixmap *pixmap_opened, - GdkBitmap *mask_opened, - gboolean is_leaf, - gboolean expanded); -void gtk_ctree_remove_node (GtkCTree *ctree, - GtkCTreeNode *node); -GtkCTreeNode * gtk_ctree_insert_gnode (GtkCTree *ctree, - GtkCTreeNode *parent, - GtkCTreeNode *sibling, - GNode *gnode, - GtkCTreeGNodeFunc func, - gpointer data); -GNode * gtk_ctree_export_to_gnode (GtkCTree *ctree, - GNode *parent, - GNode *sibling, - GtkCTreeNode *node, - GtkCTreeGNodeFunc func, - gpointer data); - -/*********************************************************** - * Generic recursive functions, querying / finding tree * - * information * - ***********************************************************/ - -void gtk_ctree_post_recursive (GtkCTree *ctree, - GtkCTreeNode *node, - GtkCTreeFunc func, - gpointer data); -void gtk_ctree_post_recursive_to_depth (GtkCTree *ctree, - GtkCTreeNode *node, - gint depth, - GtkCTreeFunc func, - gpointer data); -void gtk_ctree_pre_recursive (GtkCTree *ctree, - GtkCTreeNode *node, - GtkCTreeFunc func, - gpointer data); -void gtk_ctree_pre_recursive_to_depth (GtkCTree *ctree, - GtkCTreeNode *node, - gint depth, - GtkCTreeFunc func, - gpointer data); -gboolean gtk_ctree_is_viewable (GtkCTree *ctree, - GtkCTreeNode *node); -GtkCTreeNode * gtk_ctree_last (GtkCTree *ctree, - GtkCTreeNode *node); -GtkCTreeNode * gtk_ctree_find_node_ptr (GtkCTree *ctree, - GtkCTreeRow *ctree_row); -GtkCTreeNode * gtk_ctree_node_nth (GtkCTree *ctree, - guint row); -gboolean gtk_ctree_find (GtkCTree *ctree, - GtkCTreeNode *node, - GtkCTreeNode *child); -gboolean gtk_ctree_is_ancestor (GtkCTree *ctree, - GtkCTreeNode *node, - GtkCTreeNode *child); -GtkCTreeNode * gtk_ctree_find_by_row_data (GtkCTree *ctree, - GtkCTreeNode *node, - gpointer data); -/* returns a GList of all GtkCTreeNodes with row->data == data. */ -GList * gtk_ctree_find_all_by_row_data (GtkCTree *ctree, - GtkCTreeNode *node, - gpointer data); -GtkCTreeNode * gtk_ctree_find_by_row_data_custom (GtkCTree *ctree, - GtkCTreeNode *node, - gpointer data, - GCompareFunc func); -/* returns a GList of all GtkCTreeNodes with row->data == data. */ -GList * gtk_ctree_find_all_by_row_data_custom (GtkCTree *ctree, - GtkCTreeNode *node, - gpointer data, - GCompareFunc func); -gboolean gtk_ctree_is_hot_spot (GtkCTree *ctree, - gint x, - gint y); - -/*********************************************************** - * Tree signals : move, expand, collapse, (un)select * - ***********************************************************/ - -void gtk_ctree_move (GtkCTree *ctree, - GtkCTreeNode *node, - GtkCTreeNode *new_parent, - GtkCTreeNode *new_sibling); -void gtk_ctree_expand (GtkCTree *ctree, - GtkCTreeNode *node); -void gtk_ctree_expand_recursive (GtkCTree *ctree, - GtkCTreeNode *node); -void gtk_ctree_expand_to_depth (GtkCTree *ctree, - GtkCTreeNode *node, - gint depth); -void gtk_ctree_collapse (GtkCTree *ctree, - GtkCTreeNode *node); -void gtk_ctree_collapse_recursive (GtkCTree *ctree, - GtkCTreeNode *node); -void gtk_ctree_collapse_to_depth (GtkCTree *ctree, - GtkCTreeNode *node, - gint depth); -void gtk_ctree_toggle_expansion (GtkCTree *ctree, - GtkCTreeNode *node); -void gtk_ctree_toggle_expansion_recursive (GtkCTree *ctree, - GtkCTreeNode *node); -void gtk_ctree_select (GtkCTree *ctree, - GtkCTreeNode *node); -void gtk_ctree_select_recursive (GtkCTree *ctree, - GtkCTreeNode *node); -void gtk_ctree_unselect (GtkCTree *ctree, - GtkCTreeNode *node); -void gtk_ctree_unselect_recursive (GtkCTree *ctree, - GtkCTreeNode *node); -void gtk_ctree_real_select_recursive (GtkCTree *ctree, - GtkCTreeNode *node, - gint state); - -/*********************************************************** - * Analogons of GtkCList functions * - ***********************************************************/ - -void gtk_ctree_node_set_text (GtkCTree *ctree, - GtkCTreeNode *node, - gint column, - const gchar *text); -void gtk_ctree_node_set_pixmap (GtkCTree *ctree, - GtkCTreeNode *node, - gint column, - GdkPixmap *pixmap, - GdkBitmap *mask); -void gtk_ctree_node_set_pixtext (GtkCTree *ctree, - GtkCTreeNode *node, - gint column, - const gchar *text, - guint8 spacing, - GdkPixmap *pixmap, - GdkBitmap *mask); -void gtk_ctree_set_node_info (GtkCTree *ctree, - GtkCTreeNode *node, - const gchar *text, - guint8 spacing, - GdkPixmap *pixmap_closed, - GdkBitmap *mask_closed, - GdkPixmap *pixmap_opened, - GdkBitmap *mask_opened, - gboolean is_leaf, - gboolean expanded); -void gtk_ctree_node_set_shift (GtkCTree *ctree, - GtkCTreeNode *node, - gint column, - gint vertical, - gint horizontal); -void gtk_ctree_node_set_selectable (GtkCTree *ctree, - GtkCTreeNode *node, - gboolean selectable); -gboolean gtk_ctree_node_get_selectable (GtkCTree *ctree, - GtkCTreeNode *node); -GtkCellType gtk_ctree_node_get_cell_type (GtkCTree *ctree, - GtkCTreeNode *node, - gint column); -gboolean gtk_ctree_node_get_text (GtkCTree *ctree, - GtkCTreeNode *node, - gint column, - gchar **text); -gboolean gtk_ctree_node_get_pixmap (GtkCTree *ctree, - GtkCTreeNode *node, - gint column, - GdkPixmap **pixmap, - GdkBitmap **mask); -gboolean gtk_ctree_node_get_pixtext (GtkCTree *ctree, - GtkCTreeNode *node, - gint column, - gchar **text, - guint8 *spacing, - GdkPixmap **pixmap, - GdkBitmap **mask); -gboolean gtk_ctree_get_node_info (GtkCTree *ctree, - GtkCTreeNode *node, - gchar **text, - guint8 *spacing, - GdkPixmap **pixmap_closed, - GdkBitmap **mask_closed, - GdkPixmap **pixmap_opened, - GdkBitmap **mask_opened, - gboolean *is_leaf, - gboolean *expanded); -void gtk_ctree_node_set_row_style (GtkCTree *ctree, - GtkCTreeNode *node, - GtkStyle *style); -GtkStyle * gtk_ctree_node_get_row_style (GtkCTree *ctree, - GtkCTreeNode *node); -void gtk_ctree_node_set_cell_style (GtkCTree *ctree, - GtkCTreeNode *node, - gint column, - GtkStyle *style); -GtkStyle * gtk_ctree_node_get_cell_style (GtkCTree *ctree, - GtkCTreeNode *node, - gint column); -void gtk_ctree_node_set_foreground (GtkCTree *ctree, - GtkCTreeNode *node, - const GdkColor *color); -void gtk_ctree_node_set_background (GtkCTree *ctree, - GtkCTreeNode *node, - const GdkColor *color); -void gtk_ctree_node_set_row_data (GtkCTree *ctree, - GtkCTreeNode *node, - gpointer data); -void gtk_ctree_node_set_row_data_full (GtkCTree *ctree, - GtkCTreeNode *node, - gpointer data, - GDestroyNotify destroy); -gpointer gtk_ctree_node_get_row_data (GtkCTree *ctree, - GtkCTreeNode *node); -void gtk_ctree_node_moveto (GtkCTree *ctree, - GtkCTreeNode *node, - gint column, - gfloat row_align, - gfloat col_align); -GtkVisibility gtk_ctree_node_is_visible (GtkCTree *ctree, - GtkCTreeNode *node); - -/*********************************************************** - * GtkCTree specific functions * - ***********************************************************/ - -void gtk_ctree_set_indent (GtkCTree *ctree, - gint indent); -void gtk_ctree_set_spacing (GtkCTree *ctree, - gint spacing); -void gtk_ctree_set_show_stub (GtkCTree *ctree, - gboolean show_stub); -void gtk_ctree_set_line_style (GtkCTree *ctree, - GtkCTreeLineStyle line_style); -void gtk_ctree_set_expander_style (GtkCTree *ctree, - GtkCTreeExpanderStyle expander_style); -void gtk_ctree_set_drag_compare_func (GtkCTree *ctree, - GtkCTreeCompareDragFunc cmp_func); - -/*********************************************************** - * Tree sorting functions * - ***********************************************************/ - -void gtk_ctree_sort_node (GtkCTree *ctree, - GtkCTreeNode *node); -void gtk_ctree_sort_recursive (GtkCTree *ctree, - GtkCTreeNode *node); - - -#define gtk_ctree_set_reorderable(t,r) gtk_clist_set_reorderable((GtkCList*) (t),(r)) - -/* GType for the GtkCTreeNode. This is a boxed type, although it uses - * no-op's for the copy and free routines. It is defined in order to - * provide type information for the signal arguments - */ -GType gtk_ctree_node_get_type (void) G_GNUC_CONST; - -G_END_DECLS - -#endif /* __GTK_CTREE_H__ */ - -#endif /* GTK_DISABLE_DEPRECATED */ diff --git a/gtk/gtkcurve.c b/gtk/gtkcurve.c deleted file mode 100644 index e1304dbd52..0000000000 --- a/gtk/gtkcurve.c +++ /dev/null @@ -1,1039 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1997 David Mosberger - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#undef GTK_DISABLE_DEPRECATED - -#include "config.h" -#include -#include -#include - -#include "gtkcurve.h" -#include "gtkdrawingarea.h" -#include "gtkmain.h" -#include "gtkmarshalers.h" -#include "gtkradiobutton.h" -#include "gtktable.h" -#include "gtkprivate.h" -#include "gtkintl.h" -#include "gtkalias.h" - -#define RADIUS 3 /* radius of the control points */ -#define MIN_DISTANCE 8 /* min distance between control points */ - -#define GRAPH_MASK (GDK_EXPOSURE_MASK | \ - GDK_POINTER_MOTION_MASK | \ - GDK_POINTER_MOTION_HINT_MASK | \ - GDK_ENTER_NOTIFY_MASK | \ - GDK_BUTTON_PRESS_MASK | \ - GDK_BUTTON_RELEASE_MASK | \ - GDK_BUTTON1_MOTION_MASK) - -enum { - PROP_0, - PROP_CURVE_TYPE, - PROP_MIN_X, - PROP_MAX_X, - PROP_MIN_Y, - PROP_MAX_Y -}; - -static GtkDrawingAreaClass *parent_class = NULL; -static guint curve_type_changed_signal = 0; - - -/* forward declarations: */ -static void gtk_curve_class_init (GtkCurveClass *class); -static void gtk_curve_init (GtkCurve *curve); -static void gtk_curve_get_property (GObject *object, - guint param_id, - GValue *value, - GParamSpec *pspec); -static void gtk_curve_set_property (GObject *object, - guint param_id, - const GValue *value, - GParamSpec *pspec); -static void gtk_curve_finalize (GObject *object); -static gint gtk_curve_graph_events (GtkWidget *widget, - GdkEvent *event, - GtkCurve *c); -static void gtk_curve_size_graph (GtkCurve *curve); - -GType -gtk_curve_get_type (void) -{ - static GType curve_type = 0; - - if (!curve_type) - { - const GTypeInfo curve_info = - { - sizeof (GtkCurveClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc) gtk_curve_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (GtkCurve), - 0, /* n_preallocs */ - (GInstanceInitFunc) gtk_curve_init, - }; - - curve_type = g_type_register_static (GTK_TYPE_DRAWING_AREA, I_("GtkCurve"), - &curve_info, 0); - } - return curve_type; -} - -static void -gtk_curve_class_init (GtkCurveClass *class) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (class); - - parent_class = g_type_class_peek_parent (class); - - gobject_class->finalize = gtk_curve_finalize; - - gobject_class->set_property = gtk_curve_set_property; - gobject_class->get_property = gtk_curve_get_property; - - g_object_class_install_property (gobject_class, - PROP_CURVE_TYPE, - g_param_spec_enum ("curve-type", - P_("Curve type"), - P_("Is this curve linear, spline interpolated, or free-form"), - GTK_TYPE_CURVE_TYPE, - GTK_CURVE_TYPE_SPLINE, - GTK_PARAM_READWRITE)); - g_object_class_install_property (gobject_class, - PROP_MIN_X, - g_param_spec_float ("min-x", - P_("Minimum X"), - P_("Minimum possible value for X"), - -G_MAXFLOAT, - G_MAXFLOAT, - 0.0, - GTK_PARAM_READWRITE)); - g_object_class_install_property (gobject_class, - PROP_MAX_X, - g_param_spec_float ("max-x", - P_("Maximum X"), - P_("Maximum possible X value"), - -G_MAXFLOAT, - G_MAXFLOAT, - 1.0, - GTK_PARAM_READWRITE)); - g_object_class_install_property (gobject_class, - PROP_MIN_Y, - g_param_spec_float ("min-y", - P_("Minimum Y"), - P_("Minimum possible value for Y"), - -G_MAXFLOAT, - G_MAXFLOAT, - 0.0, - GTK_PARAM_READWRITE)); - g_object_class_install_property (gobject_class, - PROP_MAX_Y, - g_param_spec_float ("max-y", - P_("Maximum Y"), - P_("Maximum possible value for Y"), - -G_MAXFLOAT, - G_MAXFLOAT, - 1.0, - GTK_PARAM_READWRITE)); - - curve_type_changed_signal = - g_signal_new (I_("curve-type-changed"), - G_OBJECT_CLASS_TYPE (gobject_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (GtkCurveClass, curve_type_changed), - NULL, NULL, - _gtk_marshal_VOID__VOID, - G_TYPE_NONE, 0); -} - -static void -gtk_curve_init (GtkCurve *curve) -{ - gint old_mask; - - curve->cursor_type = GDK_TOP_LEFT_ARROW; - curve->pixmap = NULL; - curve->curve_type = GTK_CURVE_TYPE_SPLINE; - curve->height = 0; - curve->grab_point = -1; - - curve->num_points = 0; - curve->point = NULL; - - curve->num_ctlpoints = 0; - curve->ctlpoint = NULL; - - curve->min_x = 0.0; - curve->max_x = 1.0; - curve->min_y = 0.0; - curve->max_y = 1.0; - - old_mask = gtk_widget_get_events (GTK_WIDGET (curve)); - gtk_widget_set_events (GTK_WIDGET (curve), old_mask | GRAPH_MASK); - g_signal_connect (curve, "event", - G_CALLBACK (gtk_curve_graph_events), curve); - gtk_curve_size_graph (curve); -} - -static void -gtk_curve_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - GtkCurve *curve = GTK_CURVE (object); - - switch (prop_id) - { - case PROP_CURVE_TYPE: - gtk_curve_set_curve_type (curve, g_value_get_enum (value)); - break; - case PROP_MIN_X: - gtk_curve_set_range (curve, g_value_get_float (value), curve->max_x, - curve->min_y, curve->max_y); - break; - case PROP_MAX_X: - gtk_curve_set_range (curve, curve->min_x, g_value_get_float (value), - curve->min_y, curve->max_y); - break; - case PROP_MIN_Y: - gtk_curve_set_range (curve, curve->min_x, curve->max_x, - g_value_get_float (value), curve->max_y); - break; - case PROP_MAX_Y: - gtk_curve_set_range (curve, curve->min_x, curve->max_x, - curve->min_y, g_value_get_float (value)); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -gtk_curve_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - GtkCurve *curve = GTK_CURVE (object); - - switch (prop_id) - { - case PROP_CURVE_TYPE: - g_value_set_enum (value, curve->curve_type); - break; - case PROP_MIN_X: - g_value_set_float (value, curve->min_x); - break; - case PROP_MAX_X: - g_value_set_float (value, curve->max_x); - break; - case PROP_MIN_Y: - g_value_set_float (value, curve->min_y); - break; - case PROP_MAX_Y: - g_value_set_float (value, curve->max_y); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static int -project (gfloat value, gfloat min, gfloat max, int norm) -{ - return (norm - 1) * ((value - min) / (max - min)) + 0.5; -} - -static gfloat -unproject (gint value, gfloat min, gfloat max, int norm) -{ - return value / (gfloat) (norm - 1) * (max - min) + min; -} - -/* Solve the tridiagonal equation system that determines the second - derivatives for the interpolation points. (Based on Numerical - Recipies 2nd Edition.) */ -static void -spline_solve (int n, gfloat x[], gfloat y[], gfloat y2[]) -{ - gfloat p, sig, *u; - gint i, k; - - u = g_malloc ((n - 1) * sizeof (u[0])); - - y2[0] = u[0] = 0.0; /* set lower boundary condition to "natural" */ - - for (i = 1; i < n - 1; ++i) - { - sig = (x[i] - x[i - 1]) / (x[i + 1] - x[i - 1]); - p = sig * y2[i - 1] + 2.0; - y2[i] = (sig - 1.0) / p; - u[i] = ((y[i + 1] - y[i]) - / (x[i + 1] - x[i]) - (y[i] - y[i - 1]) / (x[i] - x[i - 1])); - u[i] = (6.0 * u[i] / (x[i + 1] - x[i - 1]) - sig * u[i - 1]) / p; - } - - y2[n - 1] = 0.0; - for (k = n - 2; k >= 0; --k) - y2[k] = y2[k] * y2[k + 1] + u[k]; - - g_free (u); -} - -static gfloat -spline_eval (int n, gfloat x[], gfloat y[], gfloat y2[], gfloat val) -{ - gint k_lo, k_hi, k; - gfloat h, b, a; - - /* do a binary search for the right interval: */ - k_lo = 0; k_hi = n - 1; - while (k_hi - k_lo > 1) - { - k = (k_hi + k_lo) / 2; - if (x[k] > val) - k_hi = k; - else - k_lo = k; - } - - h = x[k_hi] - x[k_lo]; - g_assert (h > 0.0); - - a = (x[k_hi] - val) / h; - b = (val - x[k_lo]) / h; - return a*y[k_lo] + b*y[k_hi] + - ((a*a*a - a)*y2[k_lo] + (b*b*b - b)*y2[k_hi]) * (h*h)/6.0; -} - -static void -gtk_curve_interpolate (GtkCurve *c, gint width, gint height) -{ - gfloat *vector; - int i; - - vector = g_malloc (width * sizeof (vector[0])); - - gtk_curve_get_vector (c, width, vector); - - c->height = height; - if (c->num_points != width) - { - c->num_points = width; - g_free (c->point); - c->point = g_malloc (c->num_points * sizeof (c->point[0])); - } - - for (i = 0; i < width; ++i) - { - c->point[i].x = RADIUS + i; - c->point[i].y = RADIUS + height - - project (vector[i], c->min_y, c->max_y, height); - } - - g_free (vector); -} - -static void -gtk_curve_draw (GtkCurve *c, gint width, gint height) -{ - GtkStateType state; - GtkStyle *style; - gint i; - - if (!c->pixmap) - return; - - if (c->height != height || c->num_points != width) - gtk_curve_interpolate (c, width, height); - - state = GTK_STATE_NORMAL; - if (!gtk_widget_is_sensitive (GTK_WIDGET (c))) - state = GTK_STATE_INSENSITIVE; - - style = GTK_WIDGET (c)->style; - - /* clear the pixmap: */ - gtk_paint_flat_box (style, c->pixmap, GTK_STATE_NORMAL, GTK_SHADOW_NONE, - NULL, GTK_WIDGET (c), "curve_bg", - 0, 0, width + RADIUS * 2, height + RADIUS * 2); - /* draw the grid lines: (XXX make more meaningful) */ - for (i = 0; i < 5; i++) - { - gdk_draw_line (c->pixmap, style->dark_gc[state], - RADIUS, i * (height / 4.0) + RADIUS, - width + RADIUS, i * (height / 4.0) + RADIUS); - gdk_draw_line (c->pixmap, style->dark_gc[state], - i * (width / 4.0) + RADIUS, RADIUS, - i * (width / 4.0) + RADIUS, height + RADIUS); - } - - gdk_draw_points (c->pixmap, style->fg_gc[state], c->point, c->num_points); - if (c->curve_type != GTK_CURVE_TYPE_FREE) - for (i = 0; i < c->num_ctlpoints; ++i) - { - gint x, y; - - if (c->ctlpoint[i][0] < c->min_x) - continue; - - x = project (c->ctlpoint[i][0], c->min_x, c->max_x, - width); - y = height - - project (c->ctlpoint[i][1], c->min_y, c->max_y, - height); - - /* draw a bullet: */ - gdk_draw_arc (c->pixmap, style->fg_gc[state], TRUE, x, y, - RADIUS * 2, RADIUS*2, 0, 360*64); - } - gdk_draw_drawable (GTK_WIDGET (c)->window, style->fg_gc[state], c->pixmap, - 0, 0, 0, 0, width + RADIUS * 2, height + RADIUS * 2); -} - -static gint -gtk_curve_graph_events (GtkWidget *widget, GdkEvent *event, GtkCurve *c) -{ - GdkCursorType new_type = c->cursor_type; - gint i, src, dst, leftbound, rightbound; - GdkEventMotion *mevent; - GtkWidget *w; - gint tx, ty; - gint cx, x, y, width, height; - gint closest_point = 0; - gfloat rx, ry, min_x; - guint distance; - gint x1, x2, y1, y2; - gint retval = FALSE; - - w = GTK_WIDGET (c); - width = w->allocation.width - RADIUS * 2; - height = w->allocation.height - RADIUS * 2; - - if ((width < 0) || (height < 0)) - return FALSE; - - /* get the pointer position */ - gdk_window_get_pointer (w->window, &tx, &ty, NULL); - x = CLAMP ((tx - RADIUS), 0, width-1); - y = CLAMP ((ty - RADIUS), 0, height-1); - - min_x = c->min_x; - - distance = ~0U; - for (i = 0; i < c->num_ctlpoints; ++i) - { - cx = project (c->ctlpoint[i][0], min_x, c->max_x, width); - if ((guint) abs (x - cx) < distance) - { - distance = abs (x - cx); - closest_point = i; - } - } - - switch (event->type) - { - case GDK_CONFIGURE: - if (c->pixmap) - g_object_unref (c->pixmap); - c->pixmap = NULL; - /* fall through */ - case GDK_EXPOSE: - if (!c->pixmap) - c->pixmap = gdk_pixmap_new (w->window, - w->allocation.width, - w->allocation.height, -1); - gtk_curve_draw (c, width, height); - break; - - case GDK_BUTTON_PRESS: - gtk_grab_add (widget); - - new_type = GDK_TCROSS; - - switch (c->curve_type) - { - case GTK_CURVE_TYPE_LINEAR: - case GTK_CURVE_TYPE_SPLINE: - if (distance > MIN_DISTANCE) - { - /* insert a new control point */ - if (c->num_ctlpoints > 0) - { - cx = project (c->ctlpoint[closest_point][0], min_x, - c->max_x, width); - if (x > cx) - ++closest_point; - } - ++c->num_ctlpoints; - c->ctlpoint = - g_realloc (c->ctlpoint, - c->num_ctlpoints * sizeof (*c->ctlpoint)); - for (i = c->num_ctlpoints - 1; i > closest_point; --i) - memcpy (c->ctlpoint + i, c->ctlpoint + i - 1, - sizeof (*c->ctlpoint)); - } - c->grab_point = closest_point; - c->ctlpoint[c->grab_point][0] = - unproject (x, min_x, c->max_x, width); - c->ctlpoint[c->grab_point][1] = - unproject (height - y, c->min_y, c->max_y, height); - - gtk_curve_interpolate (c, width, height); - break; - - case GTK_CURVE_TYPE_FREE: - c->point[x].x = RADIUS + x; - c->point[x].y = RADIUS + y; - c->grab_point = x; - c->last = y; - break; - } - gtk_curve_draw (c, width, height); - retval = TRUE; - break; - - case GDK_BUTTON_RELEASE: - gtk_grab_remove (widget); - - /* delete inactive points: */ - if (c->curve_type != GTK_CURVE_TYPE_FREE) - { - for (src = dst = 0; src < c->num_ctlpoints; ++src) - { - if (c->ctlpoint[src][0] >= min_x) - { - memcpy (c->ctlpoint + dst, c->ctlpoint + src, - sizeof (*c->ctlpoint)); - ++dst; - } - } - if (dst < src) - { - c->num_ctlpoints -= (src - dst); - if (c->num_ctlpoints <= 0) - { - c->num_ctlpoints = 1; - c->ctlpoint[0][0] = min_x; - c->ctlpoint[0][1] = c->min_y; - gtk_curve_interpolate (c, width, height); - gtk_curve_draw (c, width, height); - } - c->ctlpoint = - g_realloc (c->ctlpoint, - c->num_ctlpoints * sizeof (*c->ctlpoint)); - } - } - new_type = GDK_FLEUR; - c->grab_point = -1; - retval = TRUE; - break; - - case GDK_MOTION_NOTIFY: - mevent = (GdkEventMotion *) event; - - switch (c->curve_type) - { - case GTK_CURVE_TYPE_LINEAR: - case GTK_CURVE_TYPE_SPLINE: - if (c->grab_point == -1) - { - /* if no point is grabbed... */ - if (distance <= MIN_DISTANCE) - new_type = GDK_FLEUR; - else - new_type = GDK_TCROSS; - } - else - { - /* drag the grabbed point */ - new_type = GDK_TCROSS; - - leftbound = -MIN_DISTANCE; - if (c->grab_point > 0) - leftbound = project (c->ctlpoint[c->grab_point - 1][0], - min_x, c->max_x, width); - - rightbound = width + RADIUS * 2 + MIN_DISTANCE; - if (c->grab_point + 1 < c->num_ctlpoints) - rightbound = project (c->ctlpoint[c->grab_point + 1][0], - min_x, c->max_x, width); - - if (tx <= leftbound || tx >= rightbound - || ty > height + RADIUS * 2 + MIN_DISTANCE - || ty < -MIN_DISTANCE) - c->ctlpoint[c->grab_point][0] = min_x - 1.0; - else - { - rx = unproject (x, min_x, c->max_x, width); - ry = unproject (height - y, c->min_y, c->max_y, height); - c->ctlpoint[c->grab_point][0] = rx; - c->ctlpoint[c->grab_point][1] = ry; - } - gtk_curve_interpolate (c, width, height); - gtk_curve_draw (c, width, height); - } - break; - - case GTK_CURVE_TYPE_FREE: - if (c->grab_point != -1) - { - if (c->grab_point > x) - { - x1 = x; - x2 = c->grab_point; - y1 = y; - y2 = c->last; - } - else - { - x1 = c->grab_point; - x2 = x; - y1 = c->last; - y2 = y; - } - - if (x2 != x1) - for (i = x1; i <= x2; i++) - { - c->point[i].x = RADIUS + i; - c->point[i].y = RADIUS + - (y1 + ((y2 - y1) * (i - x1)) / (x2 - x1)); - } - else - { - c->point[x].x = RADIUS + x; - c->point[x].y = RADIUS + y; - } - c->grab_point = x; - c->last = y; - gtk_curve_draw (c, width, height); - } - if (mevent->state & GDK_BUTTON1_MASK) - new_type = GDK_TCROSS; - else - new_type = GDK_PENCIL; - break; - } - if (new_type != (GdkCursorType) c->cursor_type) - { - GdkCursor *cursor; - - c->cursor_type = new_type; - - cursor = gdk_cursor_new_for_display (gtk_widget_get_display (w), - c->cursor_type); - gdk_window_set_cursor (w->window, cursor); - gdk_cursor_unref (cursor); - } - retval = TRUE; - break; - - default: - break; - } - - return retval; -} - -void -gtk_curve_set_curve_type (GtkCurve *c, GtkCurveType new_type) -{ - gfloat rx, dx; - gint x, i; - - if (new_type != c->curve_type) - { - gint width, height; - - width = GTK_WIDGET (c)->allocation.width - RADIUS * 2; - height = GTK_WIDGET (c)->allocation.height - RADIUS * 2; - - if (new_type == GTK_CURVE_TYPE_FREE) - { - gtk_curve_interpolate (c, width, height); - c->curve_type = new_type; - } - else if (c->curve_type == GTK_CURVE_TYPE_FREE) - { - g_free (c->ctlpoint); - c->num_ctlpoints = 9; - c->ctlpoint = g_malloc (c->num_ctlpoints * sizeof (*c->ctlpoint)); - - rx = 0.0; - dx = (width - 1) / (gfloat) (c->num_ctlpoints - 1); - - for (i = 0; i < c->num_ctlpoints; ++i, rx += dx) - { - x = (int) (rx + 0.5); - c->ctlpoint[i][0] = - unproject (x, c->min_x, c->max_x, width); - c->ctlpoint[i][1] = - unproject (RADIUS + height - c->point[x].y, - c->min_y, c->max_y, height); - } - c->curve_type = new_type; - gtk_curve_interpolate (c, width, height); - } - else - { - c->curve_type = new_type; - gtk_curve_interpolate (c, width, height); - } - g_signal_emit (c, curve_type_changed_signal, 0); - g_object_notify (G_OBJECT (c), "curve-type"); - gtk_curve_draw (c, width, height); - } -} - -static void -gtk_curve_size_graph (GtkCurve *curve) -{ - gint width, height; - gfloat aspect; - GdkScreen *screen = gtk_widget_get_screen (GTK_WIDGET (curve)); - - width = (curve->max_x - curve->min_x) + 1; - height = (curve->max_y - curve->min_y) + 1; - aspect = width / (gfloat) height; - if (width > gdk_screen_get_width (screen) / 4) - width = gdk_screen_get_width (screen) / 4; - if (height > gdk_screen_get_height (screen) / 4) - height = gdk_screen_get_height (screen) / 4; - - if (aspect < 1.0) - width = height * aspect; - else - height = width / aspect; - - gtk_widget_set_size_request (GTK_WIDGET (curve), - width + RADIUS * 2, - height + RADIUS * 2); -} - -static void -gtk_curve_reset_vector (GtkCurve *curve) -{ - g_free (curve->ctlpoint); - - curve->num_ctlpoints = 2; - curve->ctlpoint = g_malloc (2 * sizeof (curve->ctlpoint[0])); - curve->ctlpoint[0][0] = curve->min_x; - curve->ctlpoint[0][1] = curve->min_y; - curve->ctlpoint[1][0] = curve->max_x; - curve->ctlpoint[1][1] = curve->max_y; - - if (curve->pixmap) - { - gint width, height; - - width = GTK_WIDGET (curve)->allocation.width - RADIUS * 2; - height = GTK_WIDGET (curve)->allocation.height - RADIUS * 2; - - if (curve->curve_type == GTK_CURVE_TYPE_FREE) - { - curve->curve_type = GTK_CURVE_TYPE_LINEAR; - gtk_curve_interpolate (curve, width, height); - curve->curve_type = GTK_CURVE_TYPE_FREE; - } - else - gtk_curve_interpolate (curve, width, height); - gtk_curve_draw (curve, width, height); - } -} - -void -gtk_curve_reset (GtkCurve *c) -{ - GtkCurveType old_type; - - old_type = c->curve_type; - c->curve_type = GTK_CURVE_TYPE_SPLINE; - gtk_curve_reset_vector (c); - - if (old_type != GTK_CURVE_TYPE_SPLINE) - { - g_signal_emit (c, curve_type_changed_signal, 0); - g_object_notify (G_OBJECT (c), "curve-type"); - } -} - -void -gtk_curve_set_gamma (GtkCurve *c, gfloat gamma) -{ - gfloat x, one_over_gamma, height; - GtkCurveType old_type; - gint i; - - if (c->num_points < 2) - return; - - old_type = c->curve_type; - c->curve_type = GTK_CURVE_TYPE_FREE; - - if (gamma <= 0) - one_over_gamma = 1.0; - else - one_over_gamma = 1.0 / gamma; - height = c->height; - for (i = 0; i < c->num_points; ++i) - { - x = (gfloat) i / (c->num_points - 1); - c->point[i].x = RADIUS + i; - c->point[i].y = - RADIUS + (height * (1.0 - pow (x, one_over_gamma)) + 0.5); - } - - if (old_type != GTK_CURVE_TYPE_FREE) - g_signal_emit (c, curve_type_changed_signal, 0); - - gtk_curve_draw (c, c->num_points, c->height); -} - -void -gtk_curve_set_range (GtkCurve *curve, - gfloat min_x, - gfloat max_x, - gfloat min_y, - gfloat max_y) -{ - g_object_freeze_notify (G_OBJECT (curve)); - if (curve->min_x != min_x) { - curve->min_x = min_x; - g_object_notify (G_OBJECT (curve), "min-x"); - } - if (curve->max_x != max_x) { - curve->max_x = max_x; - g_object_notify (G_OBJECT (curve), "max-x"); - } - if (curve->min_y != min_y) { - curve->min_y = min_y; - g_object_notify (G_OBJECT (curve), "min-y"); - } - if (curve->max_y != max_y) { - curve->max_y = max_y; - g_object_notify (G_OBJECT (curve), "max-y"); - } - g_object_thaw_notify (G_OBJECT (curve)); - - gtk_curve_size_graph (curve); - gtk_curve_reset_vector (curve); -} - -void -gtk_curve_set_vector (GtkCurve *c, int veclen, gfloat vector[]) -{ - GtkCurveType old_type; - gfloat rx, dx, ry; - gint i, height; - GdkScreen *screen = gtk_widget_get_screen (GTK_WIDGET (c)); - - old_type = c->curve_type; - c->curve_type = GTK_CURVE_TYPE_FREE; - - if (c->point) - height = GTK_WIDGET (c)->allocation.height - RADIUS * 2; - else - { - height = (c->max_y - c->min_y); - if (height > gdk_screen_get_height (screen) / 4) - height = gdk_screen_get_height (screen) / 4; - - c->height = height; - c->num_points = veclen; - c->point = g_malloc (c->num_points * sizeof (c->point[0])); - } - rx = 0; - dx = (veclen - 1.0) / (c->num_points - 1.0); - - for (i = 0; i < c->num_points; ++i, rx += dx) - { - ry = vector[(int) (rx + 0.5)]; - if (ry > c->max_y) ry = c->max_y; - if (ry < c->min_y) ry = c->min_y; - c->point[i].x = RADIUS + i; - c->point[i].y = - RADIUS + height - project (ry, c->min_y, c->max_y, height); - } - if (old_type != GTK_CURVE_TYPE_FREE) - { - g_signal_emit (c, curve_type_changed_signal, 0); - g_object_notify (G_OBJECT (c), "curve-type"); - } - - gtk_curve_draw (c, c->num_points, height); -} - -void -gtk_curve_get_vector (GtkCurve *c, int veclen, gfloat vector[]) -{ - gfloat rx, ry, dx, dy, min_x, delta_x, *mem, *xv, *yv, *y2v, prev; - gint dst, i, x, next, num_active_ctlpoints = 0, first_active = -1; - - min_x = c->min_x; - - if (c->curve_type != GTK_CURVE_TYPE_FREE) - { - /* count active points: */ - prev = min_x - 1.0; - for (i = num_active_ctlpoints = 0; i < c->num_ctlpoints; ++i) - if (c->ctlpoint[i][0] > prev) - { - if (first_active < 0) - first_active = i; - prev = c->ctlpoint[i][0]; - ++num_active_ctlpoints; - } - - /* handle degenerate case: */ - if (num_active_ctlpoints < 2) - { - if (num_active_ctlpoints > 0) - ry = c->ctlpoint[first_active][1]; - else - ry = c->min_y; - if (ry < c->min_y) ry = c->min_y; - if (ry > c->max_y) ry = c->max_y; - for (x = 0; x < veclen; ++x) - vector[x] = ry; - return; - } - } - - switch (c->curve_type) - { - case GTK_CURVE_TYPE_SPLINE: - mem = g_malloc (3 * num_active_ctlpoints * sizeof (gfloat)); - xv = mem; - yv = mem + num_active_ctlpoints; - y2v = mem + 2*num_active_ctlpoints; - - prev = min_x - 1.0; - for (i = dst = 0; i < c->num_ctlpoints; ++i) - if (c->ctlpoint[i][0] > prev) - { - prev = c->ctlpoint[i][0]; - xv[dst] = c->ctlpoint[i][0]; - yv[dst] = c->ctlpoint[i][1]; - ++dst; - } - - spline_solve (num_active_ctlpoints, xv, yv, y2v); - - rx = min_x; - dx = (c->max_x - min_x) / (veclen - 1); - for (x = 0; x < veclen; ++x, rx += dx) - { - ry = spline_eval (num_active_ctlpoints, xv, yv, y2v, rx); - if (ry < c->min_y) ry = c->min_y; - if (ry > c->max_y) ry = c->max_y; - vector[x] = ry; - } - - g_free (mem); - break; - - case GTK_CURVE_TYPE_LINEAR: - dx = (c->max_x - min_x) / (veclen - 1); - rx = min_x; - ry = c->min_y; - dy = 0.0; - i = first_active; - for (x = 0; x < veclen; ++x, rx += dx) - { - if (rx >= c->ctlpoint[i][0]) - { - if (rx > c->ctlpoint[i][0]) - ry = c->min_y; - dy = 0.0; - next = i + 1; - while (next < c->num_ctlpoints - && c->ctlpoint[next][0] <= c->ctlpoint[i][0]) - ++next; - if (next < c->num_ctlpoints) - { - delta_x = c->ctlpoint[next][0] - c->ctlpoint[i][0]; - dy = ((c->ctlpoint[next][1] - c->ctlpoint[i][1]) - / delta_x); - dy *= dx; - ry = c->ctlpoint[i][1]; - i = next; - } - } - vector[x] = ry; - ry += dy; - } - break; - - case GTK_CURVE_TYPE_FREE: - if (c->point) - { - rx = 0.0; - dx = c->num_points / (double) veclen; - for (x = 0; x < veclen; ++x, rx += dx) - vector[x] = unproject (RADIUS + c->height - c->point[(int) rx].y, - c->min_y, c->max_y, - c->height); - } - else - memset (vector, 0, veclen * sizeof (vector[0])); - break; - } -} - -GtkWidget* -gtk_curve_new (void) -{ - return g_object_new (GTK_TYPE_CURVE, NULL); -} - -static void -gtk_curve_finalize (GObject *object) -{ - GtkCurve *curve; - - g_return_if_fail (GTK_IS_CURVE (object)); - - curve = GTK_CURVE (object); - if (curve->pixmap) - g_object_unref (curve->pixmap); - g_free (curve->point); - g_free (curve->ctlpoint); - - G_OBJECT_CLASS (parent_class)->finalize (object); -} - -#define __GTK_CURVE_C__ -#include "gtkaliasdef.c" diff --git a/gtk/gtkcurve.h b/gtk/gtkcurve.h deleted file mode 100644 index 68ee716edb..0000000000 --- a/gtk/gtkcurve.h +++ /dev/null @@ -1,106 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#ifndef GTK_DISABLE_DEPRECATED - -#ifndef __GTK_CURVE_H__ -#define __GTK_CURVE_H__ - - -#include - - -G_BEGIN_DECLS - -#define GTK_TYPE_CURVE (gtk_curve_get_type ()) -#define GTK_CURVE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CURVE, GtkCurve)) -#define GTK_CURVE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_CURVE, GtkCurveClass)) -#define GTK_IS_CURVE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CURVE)) -#define GTK_IS_CURVE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CURVE)) -#define GTK_CURVE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CURVE, GtkCurveClass)) - - -typedef struct _GtkCurve GtkCurve; -typedef struct _GtkCurveClass GtkCurveClass; - - -struct _GtkCurve -{ - GtkDrawingArea graph; - - gint cursor_type; - gfloat min_x; - gfloat max_x; - gfloat min_y; - gfloat max_y; - GdkPixmap *pixmap; - GtkCurveType curve_type; - gint height; /* (cached) graph height in pixels */ - gint grab_point; /* point currently grabbed */ - gint last; - - /* (cached) curve points: */ - gint num_points; - GdkPoint *point; - - /* control points: */ - gint num_ctlpoints; /* number of control points */ - gfloat (*ctlpoint)[2]; /* array of control points */ -}; - -struct _GtkCurveClass -{ - GtkDrawingAreaClass parent_class; - - void (* curve_type_changed) (GtkCurve *curve); - - /* Padding for future expansion */ - void (*_gtk_reserved1) (void); - void (*_gtk_reserved2) (void); - void (*_gtk_reserved3) (void); - void (*_gtk_reserved4) (void); -}; - - -GType gtk_curve_get_type (void) G_GNUC_CONST; -GtkWidget* gtk_curve_new (void); -void gtk_curve_reset (GtkCurve *curve); -void gtk_curve_set_gamma (GtkCurve *curve, gfloat gamma_); -void gtk_curve_set_range (GtkCurve *curve, - gfloat min_x, gfloat max_x, - gfloat min_y, gfloat max_y); -void gtk_curve_get_vector (GtkCurve *curve, - int veclen, gfloat vector[]); -void gtk_curve_set_vector (GtkCurve *curve, - int veclen, gfloat vector[]); -void gtk_curve_set_curve_type (GtkCurve *curve, GtkCurveType type); - - -G_END_DECLS - -#endif /* __GTK_CURVE_H__ */ - -#endif /* GTK_DISABLE_DEPRECATED */ diff --git a/gtk/gtkdebug.h b/gtk/gtkdebug.h index 2190973239..4cc5fd347c 100644 --- a/gtk/gtkdebug.h +++ b/gtk/gtkdebug.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -36,18 +36,19 @@ G_BEGIN_DECLS typedef enum { - GTK_DEBUG_MISC = 1 << 0, - GTK_DEBUG_PLUGSOCKET = 1 << 1, - GTK_DEBUG_TEXT = 1 << 2, - GTK_DEBUG_TREE = 1 << 3, - GTK_DEBUG_UPDATES = 1 << 4, - GTK_DEBUG_KEYBINDINGS = 1 << 5, - GTK_DEBUG_MULTIHEAD = 1 << 6, - GTK_DEBUG_MODULES = 1 << 7, - GTK_DEBUG_GEOMETRY = 1 << 8, - GTK_DEBUG_ICONTHEME = 1 << 9, - GTK_DEBUG_PRINTING = 1 << 10, - GTK_DEBUG_BUILDER = 1 << 11 + GTK_DEBUG_MISC = 1 << 0, + GTK_DEBUG_PLUGSOCKET = 1 << 1, + GTK_DEBUG_TEXT = 1 << 2, + GTK_DEBUG_TREE = 1 << 3, + GTK_DEBUG_UPDATES = 1 << 4, + GTK_DEBUG_KEYBINDINGS = 1 << 5, + GTK_DEBUG_MULTIHEAD = 1 << 6, + GTK_DEBUG_MODULES = 1 << 7, + GTK_DEBUG_GEOMETRY = 1 << 8, + GTK_DEBUG_ICONTHEME = 1 << 9, + GTK_DEBUG_PRINTING = 1 << 10, + GTK_DEBUG_BUILDER = 1 << 11, + GTK_DEBUG_EXTENDED_LAYOUT = 1 << 12 } GtkDebugFlag; #ifdef G_ENABLE_DEBUG diff --git a/gtk/gtkdialog.h b/gtk/gtkdialog.h index 18a18961c8..b1a89f0072 100644 --- a/gtk/gtkdialog.h +++ b/gtk/gtkdialog.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkdnd-quartz.c b/gtk/gtkdnd-quartz.c index 244015faf5..9a4ee30892 100644 --- a/gtk/gtkdnd-quartz.c +++ b/gtk/gtkdnd-quartz.c @@ -1820,16 +1820,6 @@ gtk_drag_set_icon_default (GdkDragContext *context) gtk_drag_set_icon_stock (context, GTK_STOCK_DND, -2, -2); } -void -gtk_drag_set_default_icon (GdkColormap *colormap, - GdkPixmap *pixmap, - GdkBitmap *mask, - gint hot_x, - gint hot_y) -{ - g_warning ("gtk_drag_set_default_icon is not supported on Mac OS X."); -} - static void gtk_drag_source_info_destroy (GtkDragSourceInfo *info) { diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c index 75a750c4f7..a6409858dc 100644 --- a/gtk/gtkdnd.c +++ b/gtk/gtkdnd.c @@ -47,6 +47,7 @@ #include "gtkmain.h" #include "gtkplug.h" #include "gtkstock.h" +#include "gtktooltip.h" #include "gtkwindow.h" #include "gtkintl.h" #include "gtkdndcursors.h" @@ -59,7 +60,6 @@ typedef struct _GtkDragSourceInfo GtkDragSourceInfo; typedef struct _GtkDragDestSite GtkDragDestSite; typedef struct _GtkDragDestInfo GtkDragDestInfo; typedef struct _GtkDragAnim GtkDragAnim; -typedef struct _GtkDragFindData GtkDragFindData; typedef enum @@ -170,18 +170,11 @@ struct _GtkDragAnim gint n_steps; }; -struct _GtkDragFindData -{ - gint x; - gint y; - GdkDragContext *context; - GtkDragDestInfo *info; - gboolean found; - gboolean toplevel; - gboolean (*callback) (GtkWidget *widget, GdkDragContext *context, - gint x, gint y, guint32 time); - guint32 time; -}; +typedef gboolean (* GtkDragDestCallback) (GtkWidget *widget, + GdkDragContext *context, + gint x, + gint y, + guint32 time); /* Enumeration for some targets we handle internally */ @@ -221,8 +214,13 @@ static void gtk_drag_selection_received (GtkWidget *widget, GtkSelectionData *selection_data, guint time, gpointer data); -static void gtk_drag_find_widget (GtkWidget *widget, - GtkDragFindData *data); +static gboolean gtk_drag_find_widget (GtkWidget *widget, + GdkDragContext *context, + GtkDragDestInfo *info, + gint x, + gint y, + guint32 time, + GtkDragDestCallback callback); static void gtk_drag_proxy_begin (GtkWidget *widget, GtkDragDestInfo *dest_info, guint32 time); @@ -398,8 +396,12 @@ gtk_drag_get_ipc_widget (GtkWidget *widget) return result; } - -#ifdef GDK_WINDOWING_X11 +/* FIXME: modifying the XEvent window as in root_key_filter() isn't + * going to work with XGE/XI2, since the actual event to handle would + * be allocated/freed before GDK gets to translate the event. + * Active grabs on the keyboard are used instead at the moment... + */ +#if defined (GDK_WINDOWING_X11) && !defined (XINPUT_2) /* * We want to handle a handful of keys during DND, e.g. Escape to abort. @@ -418,7 +420,7 @@ root_key_filter (GdkXEvent *xevent, GdkEvent *event, gpointer data) { - XEvent *ev = (XEvent *)xevent; + XEvent *ev = (XEvent *) xevent; if ((ev->type == KeyPress || ev->type == KeyRelease) && ev->xkey.root == ev->xkey.window) @@ -458,6 +460,7 @@ static GrabKey grab_keys[] = { static void grab_dnd_keys (GtkWidget *widget, + GdkDevice *device, guint32 time) { guint i; @@ -488,6 +491,7 @@ grab_dnd_keys (GtkWidget *widget, static void ungrab_dnd_keys (GtkWidget *widget, + GdkDevice *device, guint32 time) { guint i; @@ -513,23 +517,28 @@ ungrab_dnd_keys (GtkWidget *widget, gdk_error_trap_pop (); } -#else +#else /* GDK_WINDOWING_X11 && !XINPUT_2 */ static void grab_dnd_keys (GtkWidget *widget, + GdkDevice *device, guint32 time) { - gdk_keyboard_grab (widget->window, FALSE, time); + gdk_device_grab (device, widget->window, + GDK_OWNERSHIP_APPLICATION, FALSE, + GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK, + NULL, time); } static void ungrab_dnd_keys (GtkWidget *widget, + GdkDevice *device, guint32 time) { - gdk_display_keyboard_ungrab (gtk_widget_get_display (widget), time); + gdk_device_ungrab (device, time); } -#endif +#endif /* GDK_WINDOWING_X11 */ /*************************************************************** @@ -545,9 +554,20 @@ gtk_drag_release_ipc_widget (GtkWidget *widget) { GtkWindow *window = GTK_WINDOW (widget); GdkScreen *screen = gtk_widget_get_screen (widget); + GdkDragContext *context = g_object_get_data (G_OBJECT (widget), "drag-context"); GSList *drag_widgets = g_object_get_data (G_OBJECT (screen), "gtk-dnd-ipc-widgets"); - ungrab_dnd_keys (widget, GDK_CURRENT_TIME); + GdkDevice *pointer, *keyboard; + + if (context) + { + pointer = gdk_drag_context_get_device (context); + keyboard = gdk_device_get_associated_device (pointer); + + if (keyboard) + ungrab_dnd_keys (widget, keyboard, GDK_CURRENT_TIME); + } + if (window->group) gtk_window_group_remove_window (window->group, window); drag_widgets = g_slist_prepend (drag_widgets, widget); @@ -940,11 +960,13 @@ gtk_drag_update_cursor (GtkDragSourceInfo *info) if (cursor != info->cursor) { - gdk_pointer_grab (info->ipc_widget->window, FALSE, - GDK_POINTER_MOTION_MASK | - GDK_BUTTON_RELEASE_MASK, - NULL, - cursor, info->grab_time); + GdkDevice *pointer; + + pointer = gdk_drag_context_get_device (info->context); + gdk_device_grab (pointer, info->ipc_widget->window, + GDK_OWNERSHIP_APPLICATION, FALSE, + GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK, + cursor, info->grab_time); info->cursor = cursor; } } @@ -1595,8 +1617,8 @@ _gtk_drag_dest_handle_event (GtkWidget *toplevel, case GDK_DRAG_MOTION: case GDK_DROP_START: { - GtkDragFindData data; gint tx, ty; + gboolean found; if (event->type == GDK_DROP_START) { @@ -1624,19 +1646,17 @@ _gtk_drag_dest_handle_event (GtkWidget *toplevel, #endif /* GDK_WINDOWING_X11 */ gdk_window_get_position (toplevel->window, &tx, &ty); - data.x = event->dnd.x_root - tx; - data.y = event->dnd.y_root - ty; - data.context = context; - data.info = info; - data.found = FALSE; - data.toplevel = TRUE; - data.callback = (event->type == GDK_DRAG_MOTION) ? - gtk_drag_dest_motion : gtk_drag_dest_drop; - data.time = event->dnd.time; + found = gtk_drag_find_widget (toplevel, + context, + info, + event->dnd.x_root - tx, + event->dnd.y_root - ty, + event->dnd.time, + (event->type == GDK_DRAG_MOTION) ? + gtk_drag_dest_motion : + gtk_drag_dest_drop); - gtk_drag_find_widget (toplevel, &data); - - if (info->widget && !data.found) + if (info->widget && !found) { gtk_drag_dest_leave (info->widget, context, event->dnd.time); info->widget = NULL; @@ -1646,13 +1666,13 @@ _gtk_drag_dest_handle_event (GtkWidget *toplevel, */ if (event->type == GDK_DRAG_MOTION) { - if (!data.found) + if (!found) gdk_drag_status (context, 0, event->dnd.time); } else if (event->type == GDK_DROP_START && !info->proxy_source) { - gdk_drop_reply (context, data.found, event->dnd.time); - if ((context->protocol == GDK_DRAG_PROTO_MOTIF) && !data.found) + gdk_drop_reply (context, found, event->dnd.time); + if ((context->protocol == GDK_DRAG_PROTO_MOTIF) && !found) gtk_drag_finish (context, FALSE, FALSE, event->dnd.time); } } @@ -1817,156 +1837,105 @@ gtk_drag_selection_received (GtkWidget *widget, gtk_drag_release_ipc_widget (widget); } -static void -prepend_and_ref_widget (GtkWidget *widget, - gpointer data) -{ - GSList **slist_p = data; - - *slist_p = g_slist_prepend (*slist_p, g_object_ref (widget)); -} - /************************************************************* * gtk_drag_find_widget: - * Recursive callback used to locate widgets for + * Function used to locate widgets for * DRAG_MOTION and DROP_START events. - * arguments: - * - * results: *************************************************************/ -static void -gtk_drag_find_widget (GtkWidget *widget, - GtkDragFindData *data) +static gboolean +gtk_drag_find_widget (GtkWidget *widget, + GdkDragContext *context, + GtkDragDestInfo *info, + gint x, + gint y, + guint32 time, + GtkDragDestCallback callback) { - GtkAllocation new_allocation; - gint allocation_to_window_x = 0; - gint allocation_to_window_y = 0; - gint x_offset = 0; - gint y_offset = 0; + if (!gtk_widget_get_mapped (widget) || + !gtk_widget_get_sensitive (widget)) + return FALSE; - if (data->found || !gtk_widget_get_mapped (widget) || !gtk_widget_get_sensitive (widget)) - return; + /* Get the widget at the pointer coordinates and travel up + * the widget hierarchy from there. + */ + widget = _gtk_widget_find_at_coords (gtk_widget_get_window (widget), + x, y, &x, &y); + if (!widget) + return FALSE; - /* Note that in the following code, we only count the - * position as being inside a WINDOW widget if it is inside - * widget->window; points that are outside of widget->window - * but within the allocation are not counted. This is consistent - * with the way we highlight drag targets. - * - * data->x,y are relative to widget->parent->window (if - * widget is not a toplevel, widget->window otherwise). - * We compute the allocation of widget in the same coordinates, - * clipping to widget->window, and all intermediate - * windows. If data->x,y is inside that, then we translate - * our coordinates to be relative to widget->window and - * recurse. - */ - new_allocation = widget->allocation; - - if (widget->parent) + while (widget) { - gint tx, ty; - GdkWindow *window = widget->window; + GtkWidget *parent; + GList *hierarchy = NULL; + gboolean found = FALSE; - /* Compute the offset from allocation-relative to - * window-relative coordinates. + if (!gtk_widget_get_mapped (widget) || + !gtk_widget_get_sensitive (widget)) + return FALSE; + + /* need to reference the entire hierarchy temporarily in case the + * ::drag-motion/::drag-drop callbacks change the widget hierarchy. */ - allocation_to_window_x = widget->allocation.x; - allocation_to_window_y = widget->allocation.y; + for (parent = widget; + parent; + parent = gtk_widget_get_parent (parent)) + { + hierarchy = g_list_prepend (hierarchy, g_object_ref (parent)); + } - if (gtk_widget_get_has_window (widget)) - { - /* The allocation is relative to the parent window for - * window widgets, not to widget->window. - */ - gdk_window_get_position (window, &tx, &ty); - - allocation_to_window_x -= tx; - allocation_to_window_y -= ty; - } - - new_allocation.x = 0 + allocation_to_window_x; - new_allocation.y = 0 + allocation_to_window_y; - - while (window && window != widget->parent->window) - { - GdkRectangle window_rect = { 0, 0, 0, 0 }; - - gdk_drawable_get_size (window, &window_rect.width, &window_rect.height); - - gdk_rectangle_intersect (&new_allocation, &window_rect, &new_allocation); - - gdk_window_get_position (window, &tx, &ty); - new_allocation.x += tx; - x_offset += tx; - new_allocation.y += ty; - y_offset += ty; - - window = gdk_window_get_parent (window); - } - - if (!window) /* Window and widget heirarchies didn't match. */ - return; - } - - if (data->toplevel || - ((data->x >= new_allocation.x) && (data->y >= new_allocation.y) && - (data->x < new_allocation.x + new_allocation.width) && - (data->y < new_allocation.y + new_allocation.height))) - { - /* First, check if the drag is in a valid drop site in - * one of our children + /* If the current widget is registered as a drop site, check to + * emit "drag-motion" to check if we are actually in a drop + * site. */ - if (GTK_IS_CONTAINER (widget)) + if (g_object_get_data (G_OBJECT (widget), "gtk-drag-dest")) { - GtkDragFindData new_data = *data; - GSList *children = NULL; - GSList *tmp_list; - - new_data.x -= x_offset; - new_data.y -= y_offset; - new_data.found = FALSE; - new_data.toplevel = FALSE; - - /* need to reference children temporarily in case the - * ::drag-motion/::drag-drop callbacks change the widget hierarchy. - */ - gtk_container_forall (GTK_CONTAINER (widget), prepend_and_ref_widget, &children); - for (tmp_list = children; tmp_list; tmp_list = tmp_list->next) - { - if (!new_data.found && gtk_widget_is_drawable (tmp_list->data)) - gtk_drag_find_widget (tmp_list->data, &new_data); - g_object_unref (tmp_list->data); - } - g_slist_free (children); - - data->found = new_data.found; - } + found = callback (widget, context, x, y, time); - /* If not, and this widget is registered as a drop site, check to - * emit "drag-motion" to check if we are actually in - * a drop site. - */ - if (!data->found && - g_object_get_data (G_OBJECT (widget), "gtk-drag-dest")) - { - data->found = data->callback (widget, - data->context, - data->x - x_offset - allocation_to_window_x, - data->y - y_offset - allocation_to_window_y, - data->time); /* If so, send a "drag-leave" to the last widget */ - if (data->found) + if (found) { - if (data->info->widget && data->info->widget != widget) + if (info->widget && info->widget != widget) { - gtk_drag_dest_leave (data->info->widget, data->context, data->time); + gtk_drag_dest_leave (info->widget, context, time); } - data->info->widget = widget; + + info->widget = widget; } } + + if (!found) + { + /* Get the parent before unreffing the hierarchy because + * invoking the callback might have destroyed the widget + */ + parent = gtk_widget_get_parent (widget); + + /* The parent might be going away when unreffing the + * hierarchy, so also protect againt that + */ + if (parent) + g_object_add_weak_pointer (G_OBJECT (parent), (gpointer *) &parent); + } + + g_list_foreach (hierarchy, (GFunc) g_object_unref, NULL); + g_list_free (hierarchy); + + if (found) + return TRUE; + + if (parent) + g_object_remove_weak_pointer (G_OBJECT (parent), (gpointer *) &parent); + else + return FALSE; + + if (!gtk_widget_translate_coordinates (widget, parent, x, y, &x, &y)) + return FALSE; + + widget = parent; } + + return FALSE; } static void @@ -2379,7 +2348,9 @@ gtk_drag_begin_internal (GtkWidget *widget, GdkDragContext *context; GtkWidget *ipc_widget; GdkCursor *cursor; - + GdkDevice *pointer, *keyboard; + + pointer = keyboard = NULL; ipc_widget = gtk_drag_get_ipc_widget (widget); gtk_drag_get_event_actions (event, button, actions, @@ -2390,24 +2361,45 @@ gtk_drag_begin_internal (GtkWidget *widget, NULL); if (event) - time = gdk_event_get_time (event); + { + time = gdk_event_get_time (event); + pointer = gdk_event_get_device (event); - if (gdk_pointer_grab (ipc_widget->window, FALSE, - GDK_POINTER_MOTION_MASK | - GDK_BUTTON_RELEASE_MASK, NULL, - cursor, time) != GDK_GRAB_SUCCESS) + if (pointer->source == GDK_SOURCE_KEYBOARD) + { + keyboard = pointer; + pointer = gdk_device_get_associated_device (keyboard); + } + else + keyboard = gdk_device_get_associated_device (pointer); + } + else + { + pointer = gdk_display_get_core_pointer (gtk_widget_get_display (widget)); + keyboard = gdk_device_get_associated_device (pointer); + } + + if (!pointer) + return NULL; + + if (gdk_device_grab (pointer, ipc_widget->window, + GDK_OWNERSHIP_APPLICATION, FALSE, + GDK_POINTER_MOTION_MASK | + GDK_BUTTON_RELEASE_MASK, + cursor, time) != GDK_GRAB_SUCCESS) { gtk_drag_release_ipc_widget (ipc_widget); return NULL; } - grab_dnd_keys (ipc_widget, time); + if (keyboard) + grab_dnd_keys (ipc_widget, keyboard, time); /* We use a GTK grab here to override any grabs that the widget * we are dragging from might have held */ - gtk_grab_add (ipc_widget); - + gtk_device_grab_add (ipc_widget, pointer, FALSE); + tmp_list = g_list_last (target_list->list); while (tmp_list) { @@ -2420,6 +2412,7 @@ gtk_drag_begin_internal (GtkWidget *widget, source_widgets = g_slist_prepend (source_widgets, ipc_widget); context = gdk_drag_begin (ipc_widget->window, targets); + gdk_drag_context_set_device (context, pointer); g_list_free (targets); info = gtk_drag_get_source_info (context, TRUE); @@ -2451,10 +2444,10 @@ gtk_drag_begin_internal (GtkWidget *widget, info->cur_x = event->motion.x_root; info->cur_y = event->motion.y_root; } - else + else { - gdk_display_get_pointer (gtk_widget_get_display (widget), - &info->cur_screen, &info->cur_x, &info->cur_y, NULL); + gdk_display_get_device_state (gtk_widget_get_display (widget), pointer, + &info->cur_screen, &info->cur_x, &info->cur_y, NULL); } g_signal_emit_by_name (widget, "drag-begin", info->context); @@ -2510,11 +2503,11 @@ gtk_drag_begin_internal (GtkWidget *widget, if (cursor != info->cursor) { - gdk_pointer_grab (widget->window, FALSE, - GDK_POINTER_MOTION_MASK | - GDK_BUTTON_RELEASE_MASK, - NULL, - cursor, time); + gdk_device_grab (pointer, widget->window, + GDK_OWNERSHIP_APPLICATION, FALSE, + GDK_POINTER_MOTION_MASK | + GDK_BUTTON_RELEASE_MASK, + cursor, time); info->cursor = cursor; } } @@ -3406,53 +3399,6 @@ gtk_drag_set_icon_default (GdkDragContext *context) default_icon_hot_y); } -/** - * gtk_drag_set_default_icon: - * @colormap: the colormap of the icon - * @pixmap: the image data for the icon - * @mask: (allow-none): the transparency mask for an image, or %NULL - * @hot_x: The X offset within @widget of the hotspot. - * @hot_y: The Y offset within @widget of the hotspot. - * - * Changes the default drag icon. GTK+ retains references for the - * arguments, and will release them when they are no longer needed. - * - * Deprecated: Change the default drag icon via the stock system by - * changing the stock pixbuf for #GTK_STOCK_DND instead. - **/ -void -gtk_drag_set_default_icon (GdkColormap *colormap, - GdkPixmap *pixmap, - GdkBitmap *mask, - gint hot_x, - gint hot_y) -{ - g_return_if_fail (GDK_IS_COLORMAP (colormap)); - g_return_if_fail (GDK_IS_PIXMAP (pixmap)); - g_return_if_fail (!mask || GDK_IS_PIXMAP (mask)); - - if (default_icon_colormap) - g_object_unref (default_icon_colormap); - if (default_icon_pixmap) - g_object_unref (default_icon_pixmap); - if (default_icon_mask) - g_object_unref (default_icon_mask); - - default_icon_colormap = colormap; - g_object_ref (colormap); - - default_icon_pixmap = pixmap; - g_object_ref (pixmap); - - default_icon_mask = mask; - if (mask) - g_object_ref (mask); - - default_icon_hot_x = hot_x; - default_icon_hot_y = hot_y; -} - - /************************************************************* * _gtk_drag_source_handle_event: * Called from widget event handling code on Drag events @@ -3515,11 +3461,13 @@ _gtk_drag_source_handle_event (GtkWidget *widget, info); if (info->cursor != cursor) { - gdk_pointer_grab (widget->window, FALSE, - GDK_POINTER_MOTION_MASK | - GDK_BUTTON_RELEASE_MASK, - NULL, - cursor, info->grab_time); + GdkDevice *pointer; + + pointer = gdk_drag_context_get_device (context); + gdk_device_grab (pointer, widget->window, + GDK_OWNERSHIP_APPLICATION, FALSE, + GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK, + cursor, info->grab_time); info->cursor = cursor; } @@ -4109,7 +4057,10 @@ gtk_drag_end (GtkDragSourceInfo *info, guint32 time) { GdkEvent *send_event; GtkWidget *source_widget = info->widget; - GdkDisplay *display = gtk_widget_get_display (source_widget); + GdkDevice *pointer, *keyboard; + + pointer = gdk_drag_context_get_device (info->context); + keyboard = gdk_device_get_associated_device (pointer); if (info->update_idle) { @@ -4141,9 +4092,9 @@ gtk_drag_end (GtkDragSourceInfo *info, guint32 time) gtk_drag_key_cb, info); - gdk_display_pointer_ungrab (display, time); - ungrab_dnd_keys (info->ipc_widget, time); - gtk_grab_remove (info->ipc_widget); + gdk_device_ungrab (pointer, time); + ungrab_dnd_keys (info->ipc_widget, keyboard, time); + gtk_device_grab_remove (info->ipc_widget, pointer); /* Send on a release pair to the original * widget to convince it to release its grab. We need to @@ -4161,7 +4112,7 @@ gtk_drag_end (GtkDragSourceInfo *info, guint32 time) send_event->button.axes = NULL; send_event->button.state = 0; send_event->button.button = info->button; - send_event->button.device = gdk_display_get_core_pointer (display); + send_event->button.device = pointer; send_event->button.x_root = 0; send_event->button.y_root = 0; @@ -4207,15 +4158,16 @@ gtk_drag_motion_cb (GtkWidget *widget, if (event->is_hint) { GdkDisplay *display = gtk_widget_get_display (widget); - - gdk_display_get_pointer (display, &screen, &x_root, &y_root, NULL); + + gdk_display_get_device_state (display, event->device, + &screen, &x_root, &y_root, NULL); event->x_root = x_root; event->y_root = y_root; } else screen = gdk_event_get_screen ((GdkEvent *)event); - gtk_drag_update (info, screen, event->x_root, event->y_root, (GdkEvent *)event); + gtk_drag_update (info, screen, event->x_root, event->y_root, (GdkEvent *) event); return TRUE; } @@ -4239,10 +4191,12 @@ gtk_drag_key_cb (GtkWidget *widget, GtkDragSourceInfo *info = (GtkDragSourceInfo *)data; GdkModifierType state; GdkWindow *root_window; + GdkDevice *pointer; gint dx, dy; dx = dy = 0; state = event->state & gtk_accelerator_get_default_mod_mask (); + pointer = gdk_device_get_associated_device (gdk_event_get_device ((GdkEvent *) event)); if (event->type == GDK_KEY_PRESS) { @@ -4291,16 +4245,16 @@ gtk_drag_key_cb (GtkWidget *widget, * that would be overkill. */ root_window = gtk_widget_get_root_window (widget); - gdk_window_get_pointer (root_window, NULL, NULL, &state); + gdk_window_get_device_position (root_window, pointer, NULL, NULL, &state); event->state = state; if (dx != 0 || dy != 0) { info->cur_x += dx; info->cur_y += dy; - gdk_display_warp_pointer (gtk_widget_get_display (widget), - gtk_widget_get_screen (widget), - info->cur_x, info->cur_y); + gdk_display_warp_device (gtk_widget_get_display (widget), pointer, + gtk_widget_get_screen (widget), + info->cur_x, info->cur_y); } gtk_drag_update (info, info->cur_screen, info->cur_x, info->cur_y, (GdkEvent *)event); @@ -4334,8 +4288,11 @@ gtk_drag_grab_notify_cb (GtkWidget *widget, gpointer data) { GtkDragSourceInfo *info = (GtkDragSourceInfo *)data; + GdkDevice *pointer; - if (!was_grabbed) + pointer = gdk_drag_context_get_device (info->context); + + if (gtk_widget_device_is_shadowed (widget, pointer)) { /* We have to block callbacks to avoid recursion here, because gtk_drag_cancel calls gtk_grab_remove (via gtk_drag_end) */ diff --git a/gtk/gtkdnd.h b/gtk/gtkdnd.h index 19af311411..e26b2fa85d 100644 --- a/gtk/gtkdnd.h +++ b/gtk/gtkdnd.h @@ -25,7 +25,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -175,14 +175,6 @@ void _gtk_drag_source_handle_event (GtkWidget *widget, void _gtk_drag_dest_handle_event (GtkWidget *toplevel, GdkEvent *event); -#ifndef GTK_DISABLE_DEPRECATED -void gtk_drag_set_default_icon (GdkColormap *colormap, - GdkPixmap *pixmap, - GdkBitmap *mask, - gint hot_x, - gint hot_y); -#endif /* !GTK_DISABLE_DEPRECATED */ - G_END_DECLS #endif /* __GTK_DND_H__ */ diff --git a/gtk/gtkdrawingarea.c b/gtk/gtkdrawingarea.c index fa7d8b44b6..0ac5952f2d 100644 --- a/gtk/gtkdrawingarea.c +++ b/gtk/gtkdrawingarea.c @@ -59,19 +59,6 @@ gtk_drawing_area_new (void) return g_object_new (GTK_TYPE_DRAWING_AREA, NULL); } -void -gtk_drawing_area_size (GtkDrawingArea *darea, - gint width, - gint height) -{ - g_return_if_fail (GTK_IS_DRAWING_AREA (darea)); - - GTK_WIDGET (darea)->requisition.width = width; - GTK_WIDGET (darea)->requisition.height = height; - - gtk_widget_queue_resize (GTK_WIDGET (darea)); -} - static void gtk_drawing_area_realize (GtkWidget *widget) { diff --git a/gtk/gtkdrawingarea.h b/gtk/gtkdrawingarea.h index 3984940140..07283bbfb6 100644 --- a/gtk/gtkdrawingarea.h +++ b/gtk/gtkdrawingarea.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -70,13 +70,6 @@ struct _GtkDrawingAreaClass GType gtk_drawing_area_get_type (void) G_GNUC_CONST; GtkWidget* gtk_drawing_area_new (void); -#ifndef GTK_DISABLE_DEPRECATED -void gtk_drawing_area_size (GtkDrawingArea *darea, - gint width, - gint height); -#endif /* GTK_DISABLE_DEPRECATED */ - - G_END_DECLS #endif /* __GTK_DRAWING_AREA_H__ */ diff --git a/gtk/gtkeditable.c b/gtk/gtkeditable.c index 4fc7b744a0..d7eaa945e2 100644 --- a/gtk/gtkeditable.c +++ b/gtk/gtkeditable.c @@ -149,7 +149,7 @@ gtk_editable_base_init (gpointer g_class) * @editable: a #GtkEditable * @new_text: the text to append * @new_text_length: the length of the text in bytes, or -1 - * @position: (in-out): location of the position text will be inserted at + * @position: (inout): location of the position text will be inserted at * * Inserts @new_text_length bytes of @new_text into the contents of the * widget, at position @position. diff --git a/gtk/gtkeditable.h b/gtk/gtkeditable.h index 914d41cb2b..fbbc847111 100644 --- a/gtk/gtkeditable.h +++ b/gtk/gtkeditable.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index 20653b4fca..3c7aa25f94 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -139,6 +139,8 @@ struct _GtkEntryPrivate gint start_y; gchar *im_module; + + GdkDevice *completion_device; }; typedef struct _GtkEntryPasswordHint GtkEntryPasswordHint; @@ -5807,6 +5809,55 @@ _gtk_entry_reset_im_context (GtkEntry *entry) } } +/** + * gtk_entry_reset_im_context: + * @entry: a #GtkEntry + * + * Reset the input method context of the entry if needed. + * + * This can be necessary in the case where modifying the buffer + * would confuse on-going input method behavior. + * + * Since: 2.22 + */ +void +gtk_entry_reset_im_context (GtkEntry *entry) +{ + g_return_if_fail (GTK_IS_ENTRY (entry)); + + _gtk_entry_reset_im_context (entry); +} + +/** + * gtk_entry_im_context_filter_keypress: + * @entry: a #GtkEntry + * @event: the key event + * + * Allow the #GtkEntry input method to internally handle key press + * and release events. If this function returns %TRUE, then no further + * processing should be done for this key event. See + * gtk_im_context_filter_keypress(). + * + * Note that you are expected to call this function from your handler + * when overriding key event handling. This is needed in the case when + * you need to insert your own key handling between the input method + * and the default key event handling of the #GtkEntry. + * See gtk_text_view_reset_im_context() for an example of use. + * + * Return value: %TRUE if the input method handled the key event. + * + * Since: 2.22 + */ +gboolean +gtk_entry_im_context_filter_keypress (GtkEntry *entry, + GdkEventKey *event) +{ + g_return_val_if_fail (GTK_IS_ENTRY (entry), FALSE); + + return gtk_im_context_filter_keypress (entry->im_context, event); +} + + static gint gtk_entry_find_position (GtkEntry *entry, gint x) @@ -6591,32 +6642,6 @@ gtk_entry_new_with_buffer (GtkEntryBuffer *buffer) return g_object_new (GTK_TYPE_ENTRY, "buffer", buffer, NULL); } -/** - * gtk_entry_new_with_max_length: - * @max: the maximum length of the entry, or 0 for no maximum. - * (other than the maximum length of entries.) The value passed in will - * be clamped to the range 0-65536. - * - * Creates a new #GtkEntry widget with the given maximum length. - * - * Return value: a new #GtkEntry - * - * Deprecated: 2.0: Use gtk_entry_set_max_length() instead. - **/ -GtkWidget* -gtk_entry_new_with_max_length (gint max) -{ - GtkEntry *entry; - - max = CLAMP (max, 0, GTK_ENTRY_BUFFER_MAX_SIZE); - - entry = g_object_new (GTK_TYPE_ENTRY, NULL); - gtk_entry_buffer_set_max_length (get_buffer (entry), max); - - return GTK_WIDGET (entry); -} - - static GtkEntryBuffer* get_buffer (GtkEntry *entry) { @@ -6784,75 +6809,6 @@ gtk_entry_set_text (GtkEntry *entry, g_signal_handler_unblock (entry, completion->priv->changed_id); } -/** - * gtk_entry_append_text: - * @entry: a #GtkEntry - * @text: the text to append - * - * Appends the given text to the contents of the widget. - * - * Deprecated: 2.0: Use gtk_editable_insert_text() instead. - */ -void -gtk_entry_append_text (GtkEntry *entry, - const gchar *text) -{ - GtkEntryPrivate *priv; - gint tmp_pos; - - g_return_if_fail (GTK_IS_ENTRY (entry)); - g_return_if_fail (text != NULL); - priv = GTK_ENTRY_GET_PRIVATE (entry); - - tmp_pos = gtk_entry_buffer_get_length (get_buffer (entry)); - gtk_editable_insert_text (GTK_EDITABLE (entry), text, -1, &tmp_pos); -} - -/** - * gtk_entry_prepend_text: - * @entry: a #GtkEntry - * @text: the text to prepend - * - * Prepends the given text to the contents of the widget. - * - * Deprecated: 2.0: Use gtk_editable_insert_text() instead. - */ -void -gtk_entry_prepend_text (GtkEntry *entry, - const gchar *text) -{ - gint tmp_pos; - - g_return_if_fail (GTK_IS_ENTRY (entry)); - g_return_if_fail (text != NULL); - - tmp_pos = 0; - gtk_editable_insert_text (GTK_EDITABLE (entry), text, -1, &tmp_pos); -} - -/** - * gtk_entry_set_position: - * @entry: a #GtkEntry - * @position: the position of the cursor. The cursor is displayed - * before the character with the given (base 0) index in the widget. - * The value must be less than or equal to the number of characters - * in the widget. A value of -1 indicates that the position should - * be set after the last character in the entry. Note that this - * position is in characters, not in bytes. - * - * Sets the cursor position in an entry to the given value. - * - * Deprecated: 2.0: Use gtk_editable_set_position() instead. - */ -void -gtk_entry_set_position (GtkEntry *entry, - gint position) -{ - g_return_if_fail (GTK_IS_ENTRY (entry)); - - gtk_editable_set_position (GTK_EDITABLE (entry), position); -} - /** * gtk_entry_set_visibility: * @entry: a #GtkEntry @@ -6993,26 +6949,6 @@ gtk_entry_unset_invisible_char (GtkEntry *entry) gtk_entry_recompute (entry); } -/** - * gtk_entry_set_editable: - * @entry: a #GtkEntry - * @editable: %TRUE if the user is allowed to edit the text - * in the widget - * - * Determines if the user can edit the text in the editable - * widget or not. - * - * Deprecated: 2.0: Use gtk_editable_set_editable() instead. - */ -void -gtk_entry_set_editable (GtkEntry *entry, - gboolean editable) -{ - g_return_if_fail (GTK_IS_ENTRY (entry)); - - gtk_editable_set_editable (GTK_EDITABLE (entry), editable); -} - /** * gtk_entry_set_overwrite_mode: * @entry: a #GtkEntry @@ -7079,28 +7015,6 @@ gtk_entry_get_text (GtkEntry *entry) return gtk_entry_buffer_get_text (get_buffer (entry)); } -/** - * gtk_entry_select_region: - * @entry: a #GtkEntry - * @start: the starting position - * @end: the end position - * - * Selects a region of text. The characters that are selected are - * those characters at positions from @start_pos up to, but not - * including @end_pos. If @end_pos is negative, then the the characters - * selected will be those characters from @start_pos to the end of - * the text. - * - * Deprecated: 2.0: Use gtk_editable_select_region() instead. - */ -void -gtk_entry_select_region (GtkEntry *entry, - gint start, - gint end) -{ - gtk_editable_select_region (GTK_EDITABLE (entry), start, end); -} - /** * gtk_entry_set_max_length: * @entry: a #GtkEntry @@ -9245,6 +9159,7 @@ static gint gtk_entry_completion_timeout (gpointer data) { GtkEntryCompletion *completion = GTK_ENTRY_COMPLETION (data); + GtkEntryPrivate *priv = GTK_ENTRY_GET_PRIVATE (completion->priv->entry); completion->priv->completion_timeout = 0; @@ -9274,7 +9189,7 @@ gtk_entry_completion_timeout (gpointer data) if (gtk_widget_get_visible (completion->priv->popup_window)) _gtk_entry_completion_resize_popup (completion); else - _gtk_entry_completion_popup (completion); + _gtk_entry_completion_popup (completion, priv->completion_device); } else _gtk_entry_completion_popdown (completion); @@ -9403,6 +9318,7 @@ gtk_entry_completion_key_press (GtkWidget *widget, { GtkTreeIter iter; + GtkTreeIter child_iter; GtkTreeModel *model = NULL; GtkTreeSelection *sel; gboolean entry_set; @@ -9410,12 +9326,15 @@ gtk_entry_completion_key_press (GtkWidget *widget, sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (completion->priv->tree_view)); if (!gtk_tree_selection_get_selected (sel, &model, &iter)) return FALSE; + + gtk_tree_model_filter_convert_iter_to_child_iter (GTK_TREE_MODEL_FILTER (model), &child_iter, &iter); + model = gtk_tree_model_filter_get_model (GTK_TREE_MODEL_FILTER (model)); if (completion->priv->completion_prefix == NULL) completion->priv->completion_prefix = g_strdup (gtk_entry_get_text (GTK_ENTRY (completion->priv->entry))); g_signal_emit_by_name (completion, "cursor-on-match", model, - &iter, &entry_set); + &child_iter, &entry_set); } } else if (completion->priv->current_selected - matches >= 0) @@ -9575,7 +9494,9 @@ static void gtk_entry_completion_changed (GtkWidget *entry, gpointer user_data) { + GtkEntryPrivate *priv = GTK_ENTRY_GET_PRIVATE (entry); GtkEntryCompletion *completion = GTK_ENTRY_COMPLETION (user_data); + GdkDevice *device; /* (re)install completion timeout */ if (completion->priv->completion_timeout) @@ -9593,6 +9514,14 @@ gtk_entry_completion_changed (GtkWidget *entry, return; } + device = gtk_get_current_event_device (); + + if (device && device->source == GDK_SOURCE_KEYBOARD) + device = gdk_device_get_associated_device (device); + + if (device) + priv->completion_device = device; + completion->priv->completion_timeout = gdk_threads_add_timeout (COMPLETION_TIMEOUT, gtk_entry_completion_timeout, diff --git a/gtk/gtkentry.h b/gtk/gtkentry.h index 0c82c63224..9bf5f85ff5 100644 --- a/gtk/gtkentry.h +++ b/gtk/gtkentry.h @@ -28,7 +28,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -302,28 +302,13 @@ void gtk_entry_set_icon_drag_source (GtkEntry * GtkTargetList *target_list, GdkDragAction actions); gint gtk_entry_get_current_icon_drag_source (GtkEntry *entry); - -GdkWindow * gtk_entry_get_icon_window (GtkEntry *entry, +GdkWindow* gtk_entry_get_icon_window (GtkEntry *entry, GtkEntryIconPosition icon_pos); +gboolean gtk_entry_im_context_filter_keypress (GtkEntry *entry, + GdkEventKey *event); +void gtk_entry_reset_im_context (GtkEntry *entry); -/* Deprecated compatibility functions - */ - -#ifndef GTK_DISABLE_DEPRECATED -GtkWidget* gtk_entry_new_with_max_length (gint max); -void gtk_entry_append_text (GtkEntry *entry, - const gchar *text); -void gtk_entry_prepend_text (GtkEntry *entry, - const gchar *text); -void gtk_entry_set_position (GtkEntry *entry, - gint position); -void gtk_entry_select_region (GtkEntry *entry, - gint start, - gint end); -void gtk_entry_set_editable (GtkEntry *entry, - gboolean editable); -#endif /* GTK_DISABLE_DEPRECATED */ G_END_DECLS diff --git a/gtk/gtkentrybuffer.h b/gtk/gtkentrybuffer.h index 20556cb9e8..51725b9720 100644 --- a/gtk/gtkentrybuffer.h +++ b/gtk/gtkentrybuffer.h @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkentrycompletion.c b/gtk/gtkentrycompletion.c index 68b758a9f6..6225b41dda 100644 --- a/gtk/gtkentrycompletion.c +++ b/gtk/gtkentrycompletion.c @@ -178,20 +178,20 @@ gtk_entry_completion_class_init (GtkEntryCompletionClass *klass) * GtkEntryCompletion::insert-prefix: * @widget: the object which received the signal * @prefix: the common prefix of all possible completions - * - * Gets emitted when the inline autocompletion is triggered. - * The default behaviour is to make the entry display the + * + * Gets emitted when the inline autocompletion is triggered. + * The default behaviour is to make the entry display the * whole prefix and select the newly inserted part. * * Applications may connect to this signal in order to insert only a * smaller part of the @prefix into the entry - e.g. the entry used in - * the #GtkFileChooser inserts only the part of the prefix up to the + * the #GtkFileChooser inserts only the part of the prefix up to the * next '/'. * * Return value: %TRUE if the signal has been handled - * + * * Since: 2.6 - */ + */ entry_completion_signals[INSERT_PREFIX] = g_signal_new (I_("insert-prefix"), G_TYPE_FROM_CLASS (klass), @@ -207,16 +207,16 @@ gtk_entry_completion_class_init (GtkEntryCompletionClass *klass) * @widget: the object which received the signal * @model: the #GtkTreeModel containing the matches * @iter: a #GtkTreeIter positioned at the selected match - * - * Gets emitted when a match from the list is selected. - * The default behaviour is to replace the contents of the - * entry with the contents of the text column in the row + * + * Gets emitted when a match from the list is selected. + * The default behaviour is to replace the contents of the + * entry with the contents of the text column in the row * pointed to by @iter. * * Return value: %TRUE if the signal has been handled - * + * * Since: 2.4 - */ + */ entry_completion_signals[MATCH_SELECTED] = g_signal_new (I_("match-selected"), G_TYPE_FROM_CLASS (klass), @@ -227,22 +227,22 @@ gtk_entry_completion_class_init (GtkEntryCompletionClass *klass) G_TYPE_BOOLEAN, 2, GTK_TYPE_TREE_MODEL, GTK_TYPE_TREE_ITER); + /** * GtkEntryCompletion::cursor-on-match: * @widget: the object which received the signal * @model: the #GtkTreeModel containing the matches * @iter: a #GtkTreeIter positioned at the selected match - * + * * Gets emitted when a match from the cursor is on a match - * of the list.The default behaviour is to replace the contents - * of the entry with the contents of the text column in the row + * of the list. The default behaviour is to replace the contents + * of the entry with the contents of the text column in the row * pointed to by @iter. * * Return value: %TRUE if the signal has been handled - * + * * Since: 2.12 - */ - + */ entry_completion_signals[CURSOR_ON_MATCH] = g_signal_new (I_("cursor-on-match"), G_TYPE_FROM_CLASS (klass), @@ -253,7 +253,7 @@ gtk_entry_completion_class_init (GtkEntryCompletionClass *klass) G_TYPE_BOOLEAN, 2, GTK_TYPE_TREE_MODEL, GTK_TYPE_TREE_ITER); - + /** * GtkEntryCompletion::action-activated: * @widget: the object which received the signal @@ -876,18 +876,23 @@ gtk_entry_completion_list_button_press (GtkWidget *widget, { GtkTreeIter iter; gboolean entry_set; + GtkTreeModel *model; + GtkTreeIter child_iter; gtk_tree_model_get_iter (GTK_TREE_MODEL (completion->priv->filter_model), &iter, path); gtk_tree_path_free (path); + gtk_tree_model_filter_convert_iter_to_child_iter (completion->priv->filter_model, + &child_iter, + &iter); + model = gtk_tree_model_filter_get_model (completion->priv->filter_model); g_signal_handler_block (completion->priv->entry, - completion->priv->changed_id); + completion->priv->changed_id); g_signal_emit (completion, entry_completion_signals[MATCH_SELECTED], - 0, GTK_TREE_MODEL (completion->priv->filter_model), - &iter, &entry_set); + 0, model, &child_iter, &entry_set); g_signal_handler_unblock (completion->priv->entry, - completion->priv->changed_id); + completion->priv->changed_id); _gtk_entry_completion_popdown (completion); @@ -1468,7 +1473,8 @@ _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion) } void -_gtk_entry_completion_popup (GtkEntryCompletion *completion) +_gtk_entry_completion_popup (GtkEntryCompletion *completion, + GdkDevice *device) { GtkTreeViewColumn *column; GList *renderers; @@ -1483,6 +1489,9 @@ _gtk_entry_completion_popup (GtkEntryCompletion *completion) if (!gtk_widget_has_focus (completion->priv->entry)) return; + if (completion->priv->grab_device) + return; + completion->priv->ignore_enter = TRUE; column = gtk_tree_view_get_column (GTK_TREE_VIEW (completion->priv->action_view), 0); @@ -1515,13 +1524,16 @@ _gtk_entry_completion_popup (GtkEntryCompletion *completion) gtk_widget_get_screen (completion->priv->entry)); gtk_widget_show (completion->priv->popup_window); - - gtk_grab_add (completion->priv->popup_window); - gdk_pointer_grab (completion->priv->popup_window->window, TRUE, - GDK_BUTTON_PRESS_MASK | - GDK_BUTTON_RELEASE_MASK | - GDK_POINTER_MOTION_MASK, - NULL, NULL, GDK_CURRENT_TIME); + + gtk_device_grab_add (completion->priv->popup_window, device, TRUE); + gdk_device_grab (device, completion->priv->popup_window->window, + GDK_OWNERSHIP_WINDOW, TRUE, + GDK_BUTTON_PRESS_MASK | + GDK_BUTTON_RELEASE_MASK | + GDK_POINTER_MOTION_MASK, + NULL, GDK_CURRENT_TIME); + + completion->priv->grab_device = device; } void @@ -1531,9 +1543,14 @@ _gtk_entry_completion_popdown (GtkEntryCompletion *completion) return; completion->priv->ignore_enter = FALSE; - - gdk_pointer_ungrab (GDK_CURRENT_TIME); - gtk_grab_remove (completion->priv->popup_window); + + if (completion->priv->grab_device) + { + gdk_device_ungrab (completion->priv->grab_device, GDK_CURRENT_TIME); + gtk_device_grab_remove (completion->priv->popup_window, + completion->priv->grab_device); + completion->priv->grab_device = NULL; + } gtk_widget_hide (completion->priv->popup_window); } diff --git a/gtk/gtkentrycompletion.h b/gtk/gtkentrycompletion.h index f0f05aa430..016b25e764 100644 --- a/gtk/gtkentrycompletion.h +++ b/gtk/gtkentrycompletion.h @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkentryprivate.h b/gtk/gtkentryprivate.h index a7678002b8..baf0b9fe1f 100644 --- a/gtk/gtkentryprivate.h +++ b/gtk/gtkentryprivate.h @@ -69,10 +69,13 @@ struct _GtkEntryCompletionPrivate gchar *completion_prefix; GSource *check_completion_idle; + + GdkDevice *grab_device; }; gboolean _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion); -void _gtk_entry_completion_popup (GtkEntryCompletion *completion); +void _gtk_entry_completion_popup (GtkEntryCompletion *completion, + GdkDevice *device); void _gtk_entry_completion_popdown (GtkEntryCompletion *completion); void _gtk_entry_get_borders (GtkEntry *entry, diff --git a/gtk/gtkenums.h b/gtk/gtkenums.h index b8b5e33594..a92ff4cf96 100644 --- a/gtk/gtkenums.h +++ b/gtk/gtkenums.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -94,16 +94,6 @@ typedef enum GTK_BUTTONBOX_CENTER } GtkButtonBoxStyle; -#ifndef GTK_DISABLE_DEPRECATED -/* Curve types */ -typedef enum -{ - GTK_CURVE_TYPE_LINEAR, /* linear interpolation */ - GTK_CURVE_TYPE_SPLINE, /* spline interpolation */ - GTK_CURVE_TYPE_FREE /* free form curve */ -} GtkCurveType; -#endif - typedef enum { GTK_DELETE_CHARS, @@ -150,7 +140,16 @@ typedef enum GTK_ICON_SIZE_DIALOG } GtkIconSize; -/* automatic sensitivity */ +/** + * GtkSensitivityType: + * @GTK_SENSITIVITY_AUTO: The arrow is made insensitive if the + * thumb is at the end + * @GTK_SENSITIVITY_ON: The arrow is always sensitive + * @GTK_SENSITIVITY_OFF: The arrow is always insensitive + * + * Determines how GTK+ handles the sensitivity of stepper arrows + * at the end of range widgets. + */ typedef enum { GTK_SENSITIVITY_AUTO, @@ -158,17 +157,6 @@ typedef enum GTK_SENSITIVITY_OFF } GtkSensitivityType; -#ifndef GTK_DISABLE_DEPRECATED -/* side types */ -typedef enum -{ - GTK_SIDE_TOP, - GTK_SIDE_BOTTOM, - GTK_SIDE_LEFT, - GTK_SIDE_RIGHT -} GtkSideType; -#endif /* GTK_DISABLE_DEPRECATED */ - /* Reading directions for text */ typedef enum { @@ -186,19 +174,6 @@ typedef enum GTK_JUSTIFY_FILL } GtkJustification; -#ifndef GTK_DISABLE_DEPRECATED -/* GtkPatternSpec match types */ -typedef enum -{ - GTK_MATCH_ALL, /* "*A?A*" */ - GTK_MATCH_ALL_TAIL, /* "*A?AA" */ - GTK_MATCH_HEAD, /* "AAAA*" */ - GTK_MATCH_TAIL, /* "*AAAA" */ - GTK_MATCH_EXACT, /* "AAAAA" */ - GTK_MATCH_LAST -} GtkMatchType; -#endif /* GTK_DISABLE_DEPRECATED */ - /* Menu keyboard movement types */ typedef enum { @@ -208,6 +183,16 @@ typedef enum GTK_MENU_DIR_PREV } GtkMenuDirectionType; +/** + * GtkMessageType: + * @GTK_MESSAGE_INFO: Informational message + * @GTK_MESSAGE_WARNING: Nonfatal warning message + * @GTK_MESSAGE_QUESTION: Question requiring a choice + * @GTK_MESSAGE_ERROR: Fatal error message + * @GTK_MESSAGE_OTHER: None of the above, doesn't get an icon + * + * The type of message being displayed in the dialog. + */ typedef enum { GTK_MESSAGE_INFO, @@ -224,18 +209,31 @@ typedef enum GTK_CENTIMETERS } GtkMetricType; +/** + * GtkMovementStep: + * @GTK_MOVEMENT_LOGICAL_POSITIONS: Move forward or back by graphemes + * @GTK_MOVEMENT_VISUAL_POSITIONS: Move left or right by graphemes + * @GTK_MOVEMENT_WORDS: Move forward or back by words + * @GTK_MOVEMENT_DISPLAY_LINES: Move up or down lines (wrapped lines) + * @GTK_MOVEMENT_DISPLAY_LINE_ENDS: Move to either end of a line + * @GTK_MOVEMENT_PARAGRAPHS: Move up or down paragraphs (newline-ended lines) + * @GTK_MOVEMENT_PARAGRAPH_ENDS: Move to either end of a paragraph + * @GTK_MOVEMENT_PAGES: Move by pages + * @GTK_MOVEMENT_BUFFER_ENDS: Move to ends of the buffer + * @GTK_MOVEMENT_HORIZONTAL_PAGES: Move horizontally by pages + */ typedef enum { - GTK_MOVEMENT_LOGICAL_POSITIONS, /* move by forw/back graphemes */ - GTK_MOVEMENT_VISUAL_POSITIONS, /* move by left/right graphemes */ - GTK_MOVEMENT_WORDS, /* move by forward/back words */ - GTK_MOVEMENT_DISPLAY_LINES, /* move up/down lines (wrapped lines) */ - GTK_MOVEMENT_DISPLAY_LINE_ENDS, /* move to either end of a line */ - GTK_MOVEMENT_PARAGRAPHS, /* move up/down paragraphs (newline-ended lines) */ - GTK_MOVEMENT_PARAGRAPH_ENDS, /* move to either end of a paragraph */ - GTK_MOVEMENT_PAGES, /* move by pages */ - GTK_MOVEMENT_BUFFER_ENDS, /* move to ends of the buffer */ - GTK_MOVEMENT_HORIZONTAL_PAGES /* move horizontally by pages */ + GTK_MOVEMENT_LOGICAL_POSITIONS, + GTK_MOVEMENT_VISUAL_POSITIONS, + GTK_MOVEMENT_WORDS, + GTK_MOVEMENT_DISPLAY_LINES, + GTK_MOVEMENT_DISPLAY_LINE_ENDS, + GTK_MOVEMENT_PARAGRAPHS, + GTK_MOVEMENT_PARAGRAPH_ENDS, + GTK_MOVEMENT_PAGES, + GTK_MOVEMENT_BUFFER_ENDS, + GTK_MOVEMENT_HORIZONTAL_PAGES } GtkMovementStep; typedef enum @@ -307,14 +305,6 @@ typedef enum GTK_POS_BOTTOM } GtkPositionType; -#ifndef GTK_DISABLE_DEPRECATED -typedef enum -{ - GTK_PREVIEW_COLOR, - GTK_PREVIEW_GRAYSCALE -} GtkPreviewType; -#endif /* GTK_DISABLE_DEPRECATED */ - /* Style for buttons */ typedef enum { @@ -331,19 +321,6 @@ typedef enum GTK_RESIZE_IMMEDIATE /* Perform the resizes now */ } GtkResizeMode; -#ifndef GTK_DISABLE_DEPRECATED -/* signal run types */ -typedef enum /*< flags >*/ -{ - GTK_RUN_FIRST = G_SIGNAL_RUN_FIRST, - GTK_RUN_LAST = G_SIGNAL_RUN_LAST, - GTK_RUN_BOTH = (GTK_RUN_FIRST | GTK_RUN_LAST), - GTK_RUN_NO_RECURSE = G_SIGNAL_NO_RECURSE, - GTK_RUN_ACTION = G_SIGNAL_ACTION, - GTK_RUN_NO_HOOKS = G_SIGNAL_NO_HOOKS -} GtkSignalRunType; -#endif /* GTK_DISABLE_DEPRECATED */ - /* scrolling types */ typedef enum { diff --git a/gtk/gtkeventbox.h b/gtk/gtkeventbox.h index c8e9d9cd56..079ff48e30 100644 --- a/gtk/gtkeventbox.h +++ b/gtk/gtkeventbox.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkexpander.h b/gtk/gtkexpander.h index dc07a6ce71..11f91750d2 100644 --- a/gtk/gtkexpander.h +++ b/gtk/gtkexpander.h @@ -21,7 +21,7 @@ * Mark McLoughlin */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkextendedlayout.c b/gtk/gtkextendedlayout.c new file mode 100644 index 0000000000..b661abf647 --- /dev/null +++ b/gtk/gtkextendedlayout.c @@ -0,0 +1,534 @@ +/* gtkextendedlayout.c + * Copyright (C) 2007-2010 Openismus GmbH + * + * Authors: + * Mathias Hasselmann + * Tristan Van Berkom + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + + +/** + * SECTION:gtkextendedlayout + * @Short_Description: Height-for-width geometry management + * @Title: GtkExtendedLayout + * + * The extended layout is GTK+'s height-for-width (and width-for-height) + * geometry management system. Height-for-width means that a widget can + * change how much vertical space it needs, depending on the amount + * of horizontal space that it is given (and similar for width-for-height). + * The most common example is a label that reflows to fill up the available + * width, wraps to fewer lines, and therefore needs less height. + * + * GTK+'s traditional two-pass size-allocation + * algorithm does not allow this flexibility. #GtkWidget provides a default + * implementation of the #GtkExtendedLayout interface for existing widgets, + * which always requests the same height, regardless of the available width. + * + * + * Implementing GtkExtendedLayout + * + * Some important things to keep in mind when implementing + * or using the extended layout. + * + * The Extended Layout system will query a logical hierarchy in + * only one orientation at a time. When widgets are initially queried + * for their minimum sizes it is generally done in a dual pass + * in the direction chosen by the toplevel. + * + * For instance when queried in the normal height-for-width mode: + * First the default minimum and natural width for each widget + * in the interface will computed and collectively returned to + * the toplevel by way of gtk_extended_layout_get_desired_width(). + * Next, the toplevel will use the minimum width to query for the + * minimum height contextual to that width using + * gtk_extended_layout_get_height_for_width(), which will also be a + * highly recursive operation. This minimum-for-minimum size can be + * used to set the minimum size constraint on the toplevel. + * + * When allocating, each container can use the minimum and natural + * sizes reported by their children to allocate natural sizes and + * expose as much content as possible with the given allocation. + * + * That means that the request operation at allocation time will + * usually fire again in contexts of different allocated sizes than + * the ones originally queried for. #GtkExtendedLayout caches a + * small number of results to avoid re-querying for the same + * allocated size in one allocation cycle. + * + * A widget that does not actually do height-for-width + * or width-for-height size negotiations only has to implement + * get_desired_width() and get_desired_height(). + * + * If a widget does move content around to smartly use up the + * allocated size, then it must support the request properly in + * both orientations; even if the request only makes sense in + * one orientation. + * + * For instance, a GtkLabel that does height-for-width word wrapping + * will not expect to have get_desired_height() called because that + * call is specific to a width-for-height request, in this case the + * label must return the heights contextual to its minimum possible + * width. By following this rule any widget that handles height-for-width + * or width-for-height requests will always be allocated at least + * enough space to fit its own content. + * + * + */ + + +#include +#include "gtkextendedlayout.h" +#include "gtksizegroup.h" +#include "gtkprivate.h" +#include "gtkintl.h" +#include "gtkalias.h" + +/* With extended layout, a widget may be requested + * its width for 2 or maximum 3 heights in one resize + */ +#define N_CACHED_SIZES 3 + +typedef struct +{ + guint age; + gint for_size; + gint minimum_size; + gint natural_size; +} DesiredSize; + +typedef struct { + DesiredSize desired_widths[N_CACHED_SIZES]; + DesiredSize desired_heights[N_CACHED_SIZES]; + guint8 cached_width_age; + guint8 cached_height_age; +} ExtendedLayoutCache; + +static GQuark quark_cache = 0; + + +GType +gtk_extended_layout_get_type (void) +{ + static GType extended_layout_type = 0; + + if (G_UNLIKELY(!extended_layout_type)) + { + extended_layout_type = + g_type_register_static_simple (G_TYPE_INTERFACE, I_("GtkExtendedLayout"), + sizeof (GtkExtendedLayoutIface), + NULL, 0, NULL, 0); + + g_type_interface_add_prerequisite (extended_layout_type, GTK_TYPE_WIDGET); + + quark_cache = g_quark_from_static_string ("gtk-extended-layout-cache"); + } + + return extended_layout_type; +} + +/* looks for a cached size request for this for_size. If not + * found, returns the oldest entry so it can be overwritten + * + * Note that this caching code was directly derived from + * the Clutter toolkit. + */ +static gboolean +get_cached_desired_size (gint for_size, + DesiredSize *cached_sizes, + DesiredSize **result) +{ + guint i; + + *result = &cached_sizes[0]; + + for (i = 0; i < N_CACHED_SIZES; i++) + { + DesiredSize *cs; + + cs = &cached_sizes[i]; + + if (cs->age > 0 && cs->for_size == for_size) + { + *result = cs; + return TRUE; + } + else if (cs->age < (*result)->age) + { + *result = cs; + } + } + + return FALSE; +} + +static void +destroy_cache (ExtendedLayoutCache *cache) +{ + g_slice_free (ExtendedLayoutCache, cache); +} + +static ExtendedLayoutCache * +get_cache (GtkExtendedLayout *layout, + gboolean create) +{ + ExtendedLayoutCache *cache; + + cache = g_object_get_qdata (G_OBJECT (layout), quark_cache); + if (!cache && create) + { + cache = g_slice_new0 (ExtendedLayoutCache); + + cache->cached_width_age = 1; + cache->cached_height_age = 1; + + g_object_set_qdata_full (G_OBJECT (layout), quark_cache, cache, + (GDestroyNotify)destroy_cache); + } + + return cache; +} + + +static void +do_size_request (GtkWidget *widget) +{ + if (GTK_WIDGET_REQUEST_NEEDED (widget)) + { + gtk_widget_ensure_style (widget); + GTK_PRIVATE_UNSET_FLAG (widget, GTK_REQUEST_NEEDED); + g_signal_emit_by_name (widget, + "size-request", + &widget->requisition); + } +} + +static void +compute_size_for_orientation (GtkExtendedLayout *layout, + GtkSizeGroupMode orientation, + gint for_size, + gint *minimum_size, + gint *natural_size) +{ + ExtendedLayoutCache *cache; + DesiredSize *cached_size; + GtkWidget *widget; + gboolean found_in_cache = FALSE; + + g_return_if_fail (GTK_IS_EXTENDED_LAYOUT (layout)); + g_return_if_fail (minimum_size != NULL || natural_size != NULL); + + widget = GTK_WIDGET (layout); + cache = get_cache (layout, TRUE); + + if (orientation == GTK_SIZE_GROUP_HORIZONTAL) + { + cached_size = &cache->desired_widths[0]; + + if (!GTK_WIDGET_WIDTH_REQUEST_NEEDED (layout)) + found_in_cache = get_cached_desired_size (for_size, cache->desired_widths, &cached_size); + else + { + memset (cache->desired_widths, 0, N_CACHED_SIZES * sizeof (DesiredSize)); + cache->cached_width_age = 1; + } + } + else + { + cached_size = &cache->desired_heights[0]; + + if (!GTK_WIDGET_HEIGHT_REQUEST_NEEDED (layout)) + found_in_cache = get_cached_desired_size (for_size, cache->desired_heights, &cached_size); + else + { + memset (cache->desired_heights, 0, N_CACHED_SIZES * sizeof (DesiredSize)); + cache->cached_height_age = 1; + } + } + + if (!found_in_cache) + { + gint min_size = 0, nat_size = 0; + gint group_size, requisition_size; + + /* Unconditional size request runs but is often unhandled. */ + do_size_request (widget); + + if (orientation == GTK_SIZE_GROUP_HORIZONTAL) + { + requisition_size = widget->requisition.width; + + if (for_size < 0) + GTK_EXTENDED_LAYOUT_GET_IFACE (layout)->get_desired_width (layout, &min_size, &nat_size); + else + GTK_EXTENDED_LAYOUT_GET_IFACE (layout)->get_width_for_height (layout, for_size, &min_size, &nat_size); + } + else + { + requisition_size = widget->requisition.height; + + if (for_size < 0) + GTK_EXTENDED_LAYOUT_GET_IFACE (layout)->get_desired_height (layout, &min_size, &nat_size); + else + GTK_EXTENDED_LAYOUT_GET_IFACE (layout)->get_height_for_width (layout, for_size, &min_size, &nat_size); + } + + /* Support for dangling "size-request" signals and forward derived + * classes that will not default to a ->get_desired_width() that + * returns the values in the ->requisition cache. + */ + min_size = MAX (min_size, requisition_size); + nat_size = MAX (nat_size, requisition_size); + + cached_size->minimum_size = min_size; + cached_size->natural_size = nat_size; + cached_size->for_size = for_size; + + if (orientation == GTK_SIZE_GROUP_HORIZONTAL) + { + cached_size->age = cache->cached_width_age; + cache->cached_width_age++; + + GTK_PRIVATE_UNSET_FLAG (layout, GTK_WIDTH_REQUEST_NEEDED); + } + else + { + cached_size->age = cache->cached_height_age; + cache->cached_height_age++; + + GTK_PRIVATE_UNSET_FLAG (layout, GTK_HEIGHT_REQUEST_NEEDED); + } + + /* Get size groups to compute the base requisition once one + * of the values have been cached, then go ahead and update + * the cache with the sizegroup computed value. + * + * Note this is also where values from gtk_widget_set_size_request() + * are considered. + */ + group_size = + _gtk_size_group_bump_requisition (GTK_WIDGET (layout), + orientation, cached_size->minimum_size); + + cached_size->minimum_size = MAX (cached_size->minimum_size, group_size); + cached_size->natural_size = MAX (cached_size->natural_size, group_size); + } + + if (minimum_size) + *minimum_size = cached_size->minimum_size; + + if (natural_size) + *natural_size = cached_size->natural_size; + + g_assert (cached_size->minimum_size <= cached_size->natural_size); + + GTK_NOTE (EXTENDED_LAYOUT, + g_print ("[%p] %s\t%s: %d is minimum %d and natural: %d (hit cache: %s)\n", + layout, G_OBJECT_TYPE_NAME (layout), + orientation == GTK_SIZE_GROUP_HORIZONTAL ? + "width for height" : "height for width" , + for_size, + cached_size->minimum_size, + cached_size->natural_size, + found_in_cache ? "yes" : "no")); + +} + +/** + * gtk_extended_layout_is_height_for_width: + * @layout: a #GtkExtendedLayout instance + * + * Gets whether the widget prefers a height-for-width layout + * or a width-for-height layout. + * + * #GtkBin widgets generally propagate the preference of + * their child, container widgets need to request something either in + * context of their children or in context of their allocation + * capabilities. + * + * Returns: %TRUE if the widget prefers height-for-width, %FALSE if + * the widget should be treated with a width-for-height preference. + * + * Since: 3.0 + */ +gboolean +gtk_extended_layout_is_height_for_width (GtkExtendedLayout *layout) +{ + GtkExtendedLayoutIface *iface; + + g_return_val_if_fail (GTK_IS_EXTENDED_LAYOUT (layout), FALSE); + + iface = GTK_EXTENDED_LAYOUT_GET_IFACE (layout); + if (iface->is_height_for_width) + return iface->is_height_for_width (layout); + + /* By default widgets are height-for-width. */ + return TRUE; +} + +/** + * gtk_extended_layout_get_desired_width: + * @layout: a #GtkExtendedLayout instance + * @minimum_width: (out) (allow-none): location to store the minimum width, or %NULL + * @natural_width: (out) (allow-none): location to store the natural width, or %NULL + * + * Retrieves a widget's initial minimum and natural width. + * + * This call is specific to height-for-width + * requests. + * + * Since: 3.0 + */ +void +gtk_extended_layout_get_desired_width (GtkExtendedLayout *layout, + gint *minimum_width, + gint *natural_width) +{ + compute_size_for_orientation (layout, GTK_SIZE_GROUP_HORIZONTAL, + -1, minimum_width, natural_width); +} + + +/** + * gtk_extended_layout_get_desired_height: + * @layout: a #GtkExtendedLayout instance + * @minimum_height: (out) (allow-none): location to store the minimum height, or %NULL + * @natural_height: (out) (allow-none): location to store the natural height, or %NULL + * + * Retrieves a widget's initial minimum and natural height. + * + * This call is specific to width-for-height requests. + * + * Since: 3.0 + */ +void +gtk_extended_layout_get_desired_height (GtkExtendedLayout *layout, + gint *minimum_height, + gint *natural_height) +{ + compute_size_for_orientation (layout, GTK_SIZE_GROUP_VERTICAL, + -1, minimum_height, natural_height); +} + + + +/** + * gtk_extended_layout_get_width_for_height: + * @layout: a #GtkExtendedLayout instance + * @height: the height which is available for allocation + * @minimum_width: (out) (allow-none): location for storing the minimum width, or %NULL + * @natural_width: (out) (allow-none): location for storing the natural width, or %NULL + * + * Retrieves a widget's desired width if it would be given + * the specified @height. + * + * Since: 3.0 + */ +void +gtk_extended_layout_get_width_for_height (GtkExtendedLayout *layout, + gint height, + gint *minimum_width, + gint *natural_width) +{ + compute_size_for_orientation (layout, GTK_SIZE_GROUP_HORIZONTAL, + height, minimum_width, natural_width); +} + +/** + * gtk_extended_layout_get_height_for_width: + * @layout: a #GtkExtendedLayout instance + * @width: the width which is available for allocation + * @minimum_height: (out) (allow-none): location for storing the minimum height, or %NULL + * @natural_height: (out) (allow-none): location for storing the natural height, or %NULL + * + * Retrieves a widget's desired height if it would be given + * the specified @width. + * + * Since: 3.0 + */ +void +gtk_extended_layout_get_height_for_width (GtkExtendedLayout *layout, + gint width, + gint *minimum_height, + gint *natural_height) +{ + compute_size_for_orientation (layout, GTK_SIZE_GROUP_VERTICAL, + width, minimum_height, natural_height); +} + +/** + * gtk_extended_layout_get_desired_size: + * @layout: a #GtkExtendedLayout instance + * @request_natural: Whether to base the contextual request off of the + * base natural or the base minimum + * @minimum_size: (out) (allow-none): location for storing the minimum size, or %NULL + * @natural_size: (out) (allow-none): location for storing the natural size, or %NULL + * + * Retrieves the minimum and natural size of a widget taking + * into account the widget's preference for height-for-width management. + * + * If request_natural is specified, the non-contextual natural value will + * be used to make the contextual request; otherwise the minimum will be used. + * + * This is used to retrieve a suitable size by container widgets which do + * not impose any restrictions on the child placement. + * + * Since: 3.0 + */ +void +gtk_extended_layout_get_desired_size (GtkExtendedLayout *layout, + gboolean request_natural, + GtkRequisition *minimum_size, + GtkRequisition *natural_size) +{ + gint min_width, nat_width; + gint min_height, nat_height; + + g_return_if_fail (GTK_IS_EXTENDED_LAYOUT (layout)); + + if (gtk_extended_layout_is_height_for_width (layout)) + { + gtk_extended_layout_get_desired_width (layout, &min_width, &nat_width); + gtk_extended_layout_get_height_for_width (layout, + request_natural ? nat_width : min_width, + &min_height, &nat_height); + } + else + { + gtk_extended_layout_get_desired_height (layout, &min_height, &nat_height); + gtk_extended_layout_get_width_for_height (layout, + request_natural ? nat_height : min_height, + &min_width, &nat_width); + } + + if (minimum_size) + { + minimum_size->width = min_width; + minimum_size->height = min_height; + } + + if (natural_size) + { + natural_size->width = nat_width; + natural_size->height = nat_height; + } +} + + + +#define __GTK_EXTENDED_LAYOUT_C__ +#include "gtkaliasdef.c" diff --git a/gtk/gtkextendedlayout.h b/gtk/gtkextendedlayout.h new file mode 100644 index 0000000000..73ed760110 --- /dev/null +++ b/gtk/gtkextendedlayout.h @@ -0,0 +1,89 @@ +/* GTK - The GIMP Toolkit + * Copyright (C) 2007-2010 Openismus GmbH + * + * Authors: + * Mathias Hasselmann + * Tristan Van Berkom + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GTK_EXTENDED_LAYOUT_H__ +#define __GTK_EXTENDED_LAYOUT_H__ + +#include + +G_BEGIN_DECLS + +#define GTK_TYPE_EXTENDED_LAYOUT (gtk_extended_layout_get_type ()) +#define GTK_EXTENDED_LAYOUT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_EXTENDED_LAYOUT, GtkExtendedLayout)) +#define GTK_EXTENDED_LAYOUT_CLASS(klass) ((GtkExtendedLayoutIface*)g_type_interface_peek ((klass), GTK_TYPE_EXTENDED_LAYOUT)) +#define GTK_IS_EXTENDED_LAYOUT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_EXTENDED_LAYOUT)) +#define GTK_EXTENDED_LAYOUT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GTK_TYPE_EXTENDED_LAYOUT, GtkExtendedLayoutIface)) + +typedef struct _GtkExtendedLayout GtkExtendedLayout; +typedef struct _GtkExtendedLayoutIface GtkExtendedLayoutIface; + +struct _GtkExtendedLayoutIface +{ + GTypeInterface g_iface; + + /* virtual table */ + gboolean (* is_height_for_width) (GtkExtendedLayout *layout); + + void (* get_desired_width) (GtkExtendedLayout *layout, + gint *minimum_width, + gint *natural_width); + void (* get_desired_height) (GtkExtendedLayout *layout, + gint *minimum_height, + gint *natural_height); + void (* get_width_for_height) (GtkExtendedLayout *layout, + gint height, + gint *minimum_width, + gint *natural_width); + void (* get_height_for_width) (GtkExtendedLayout *layout, + gint width, + gint *minimum_height, + gint *natural_height); +}; + +GType gtk_extended_layout_get_type (void) G_GNUC_CONST; + +gboolean gtk_extended_layout_is_height_for_width (GtkExtendedLayout *layout); +void gtk_extended_layout_get_desired_width (GtkExtendedLayout *layout, + gint *minimum_width, + gint *natural_width); +void gtk_extended_layout_get_desired_height (GtkExtendedLayout *layout, + gint *minimum_height, + gint *natural_height); +void gtk_extended_layout_get_width_for_height (GtkExtendedLayout *layout, + gint height, + gint *minimum_width, + gint *natural_width); +void gtk_extended_layout_get_height_for_width (GtkExtendedLayout *layout, + gint width, + gint *minimum_height, + gint *natural_height); + +void gtk_extended_layout_get_desired_size (GtkExtendedLayout *layout, + gboolean request_natural, + GtkRequisition *minimum_size, + GtkRequisition *natural_size); + + +G_END_DECLS + +#endif /* __GTK_EXTENDED_LAYOUT_H__ */ diff --git a/gtk/gtkfilechooser.c b/gtk/gtkfilechooser.c index 85f972f064..e93f8695df 100644 --- a/gtk/gtkfilechooser.c +++ b/gtk/gtkfilechooser.c @@ -255,7 +255,7 @@ * You can change these defaults to something else. For * example, to add a Shift modifier to a few * of the default bindings, you can include the following - * fragment in your .gtkrc-2.0 file: + * fragment in your .gtkrc-3.0 file: * * * binding "my-own-gtkfilechooser-bindings" { @@ -323,14 +323,14 @@ * * * You can create your own bindings for the - * GtkFileChooserDefault::location-popup signal with custom + * #GtkFileChooserDefault::location-popup signal with custom * path strings, and have a crude form * of easily-to-type bookmarks. For example, say you access * the path /home/username/misc very * frequently. You could then create an * Alt M * shortcut by including the following in your - * .gtkrc-2.0: + * .gtkrc-3.0: * * binding "misc-shortcut" { * bind "<Alt>M" { @@ -761,12 +761,6 @@ gtk_file_chooser_class_init (gpointer g_iface) GTK_TYPE_FILE_CHOOSER_ACTION, GTK_FILE_CHOOSER_ACTION_OPEN, GTK_PARAM_READWRITE)); - g_object_interface_install_property (g_iface, - g_param_spec_string ("file-system-backend", - P_("File System Backend"), - P_("Name of file system backend to use"), - NULL, - GTK_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); g_object_interface_install_property (g_iface, g_param_spec_object ("filter", P_("Filter"), diff --git a/gtk/gtkfilechooser.h b/gtk/gtkfilechooser.h index 21ba7ee5f7..a7d0512b43 100644 --- a/gtk/gtkfilechooser.h +++ b/gtk/gtkfilechooser.h @@ -18,7 +18,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -101,7 +101,7 @@ GType gtk_file_chooser_get_type (void) G_GNUC_CONST; * @GTK_FILE_CHOOSER_ERROR_BAD_FILENAME: Indicates a malformed filename. * @GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS: Indicates a duplicate path (e.g. when * adding a bookmark). - * @GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME: + * @GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME: Indicates an incomplete hostname (e.g. "http://foo" without a slash after that). * * These identify the various errors that can occur while calling * #GtkFileChooser functions. diff --git a/gtk/gtkfilechooserbutton.c b/gtk/gtkfilechooserbutton.c index b7227a0bec..439e3ded68 100644 --- a/gtk/gtkfilechooserbutton.c +++ b/gtk/gtkfilechooserbutton.c @@ -820,10 +820,6 @@ gtk_file_chooser_button_set_property (GObject *object, fs_bookmarks_changed_cb (priv->fs, button); break; - case GTK_FILE_CHOOSER_PROP_FILE_SYSTEM_BACKEND: - /* Ignore property */ - break; - case GTK_FILE_CHOOSER_PROP_SELECT_MULTIPLE: g_warning ("%s: Choosers of type `%s` do not support selecting multiple files.", G_STRFUNC, G_OBJECT_TYPE_NAME (object)); @@ -856,7 +852,6 @@ gtk_file_chooser_button_get_property (GObject *object, case PROP_TITLE: case GTK_FILE_CHOOSER_PROP_ACTION: - case GTK_FILE_CHOOSER_PROP_FILE_SYSTEM_BACKEND: case GTK_FILE_CHOOSER_PROP_FILTER: case GTK_FILE_CHOOSER_PROP_LOCAL_ONLY: case GTK_FILE_CHOOSER_PROP_PREVIEW_WIDGET: @@ -2738,33 +2733,6 @@ gtk_file_chooser_button_new (const gchar *title, NULL); } -/** - * gtk_file_chooser_button_new_with_backend: - * @title: the title of the browse dialog. - * @action: the open mode for the widget. - * @backend: the name of the #GtkFileSystem backend to use. - * - * Creates a new file-selecting button widget using @backend. - * - * Returns: a new button widget. - * - * Since: 2.6 - * Deprecated: 2.14: Use gtk_file_chooser_button_new() instead. - **/ -GtkWidget * -gtk_file_chooser_button_new_with_backend (const gchar *title, - GtkFileChooserAction action, - const gchar *backend) -{ - g_return_val_if_fail (action == GTK_FILE_CHOOSER_ACTION_OPEN || - action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, NULL); - - return g_object_new (GTK_TYPE_FILE_CHOOSER_BUTTON, - "action", action, - "title", (title ? title : _(DEFAULT_TITLE)), - NULL); -} - /** * gtk_file_chooser_button_new_with_dialog: * @dialog: the widget to use as dialog diff --git a/gtk/gtkfilechooserbutton.h b/gtk/gtkfilechooserbutton.h index b57209c84c..f6a5bd58c5 100644 --- a/gtk/gtkfilechooserbutton.h +++ b/gtk/gtkfilechooserbutton.h @@ -18,7 +18,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -69,13 +69,6 @@ struct _GtkFileChooserButtonClass GType gtk_file_chooser_button_get_type (void) G_GNUC_CONST; GtkWidget * gtk_file_chooser_button_new (const gchar *title, GtkFileChooserAction action); - -#ifndef GTK_DISABLE_DEPRECATED -GtkWidget * gtk_file_chooser_button_new_with_backend (const gchar *title, - GtkFileChooserAction action, - const gchar *backend); -#endif /* GTK_DISABLE_DEPRECATED */ - GtkWidget * gtk_file_chooser_button_new_with_dialog (GtkWidget *dialog); G_CONST_RETURN gchar *gtk_file_chooser_button_get_title (GtkFileChooserButton *button); void gtk_file_chooser_button_set_title (GtkFileChooserButton *button, diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c index 429e8c4df0..7f1f31c0e2 100644 --- a/gtk/gtkfilechooserdefault.c +++ b/gtk/gtkfilechooserdefault.c @@ -5440,10 +5440,6 @@ gtk_file_chooser_default_set_property (GObject *object, } break; - case GTK_FILE_CHOOSER_PROP_FILE_SYSTEM_BACKEND: - /* Ignore property */ - break; - case GTK_FILE_CHOOSER_PROP_FILTER: set_current_filter (impl, g_value_get_object (value)); break; @@ -6123,7 +6119,7 @@ size_sort_func (GtkTreeModel *model, size_a = g_value_get_int64 (_gtk_file_system_model_get_value (fs_model, a, MODEL_COL_SIZE)); size_b = g_value_get_int64 (_gtk_file_system_model_get_value (fs_model, b, MODEL_COL_SIZE)); - return size_a > size_b ? -1 : (size_a == size_b ? 0 : 1); + return size_a < size_b ? -1 : (size_a == size_b ? 0 : 1); } } @@ -6142,7 +6138,7 @@ mtime_sort_func (GtkTreeModel *model, ta = g_value_get_long (_gtk_file_system_model_get_value (fs_model, a, MODEL_COL_MTIME)); tb = g_value_get_long (_gtk_file_system_model_get_value (fs_model, b, MODEL_COL_MTIME)); - return ta > tb ? -1 : (ta == tb ? 0 : 1); + return ta < tb ? -1 : (ta == tb ? 0 : 1); } } diff --git a/gtk/gtkfilechooserdialog.c b/gtk/gtkfilechooserdialog.c index 43a11ce037..0660f27d66 100644 --- a/gtk/gtkfilechooserdialog.c +++ b/gtk/gtkfilechooserdialog.c @@ -272,7 +272,6 @@ gtk_file_chooser_dialog_constructor (GType type, if (priv->file_system) priv->widget = g_object_new (GTK_TYPE_FILE_CHOOSER_WIDGET, - "file-system-backend", priv->file_system, NULL); else priv->widget = g_object_new (GTK_TYPE_FILE_CHOOSER_WIDGET, NULL); @@ -308,10 +307,6 @@ gtk_file_chooser_dialog_set_property (GObject *object, switch (prop_id) { - case GTK_FILE_CHOOSER_PROP_FILE_SYSTEM_BACKEND: - g_free (priv->file_system); - priv->file_system = g_value_dup_string (value); - break; default: g_object_set_property (G_OBJECT (priv->widget), pspec->name, value); break; @@ -408,7 +403,6 @@ static GtkWidget * gtk_file_chooser_dialog_new_valist (const gchar *title, GtkWindow *parent, GtkFileChooserAction action, - const gchar *backend, const gchar *first_button_text, va_list varargs) { @@ -461,46 +455,7 @@ gtk_file_chooser_dialog_new (const gchar *title, va_start (varargs, first_button_text); result = gtk_file_chooser_dialog_new_valist (title, parent, action, - NULL, first_button_text, - varargs); - va_end (varargs); - - return result; -} - -/** - * gtk_file_chooser_dialog_new_with_backend: - * @title: (allow-none): Title of the dialog, or %NULL - * @parent: (allow-none): Transient parent of the dialog, or %NULL - * @action: Open or save mode for the dialog - * @backend: The name of the specific filesystem backend to use. - * @first_button_text: (allow-none): stock ID or text to go in the first button, or %NULL - * @Varargs: response ID for the first button, then additional (button, id) pairs, ending with %NULL - * - * Creates a new #GtkFileChooserDialog with a specified backend. This is - * especially useful if you use gtk_file_chooser_set_local_only() to allow - * non-local files and you use a more expressive vfs, such as gnome-vfs, - * to load files. - * - * Return value: a new #GtkFileChooserDialog - * - * Since: 2.4 - * Deprecated: 2.14: Use gtk_file_chooser_dialog_new() instead. - **/ -GtkWidget * -gtk_file_chooser_dialog_new_with_backend (const gchar *title, - GtkWindow *parent, - GtkFileChooserAction action, - const gchar *backend, - const gchar *first_button_text, - ...) -{ - GtkWidget *result; - va_list varargs; - - va_start (varargs, first_button_text); - result = gtk_file_chooser_dialog_new_valist (title, parent, action, - backend, first_button_text, + first_button_text, varargs); va_end (varargs); diff --git a/gtk/gtkfilechooserdialog.h b/gtk/gtkfilechooserdialog.h index d79f6f89a7..10ee0639c9 100644 --- a/gtk/gtkfilechooserdialog.h +++ b/gtk/gtkfilechooserdialog.h @@ -18,7 +18,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -60,15 +60,6 @@ GtkWidget *gtk_file_chooser_dialog_new (const gchar *title const gchar *first_button_text, ...) G_GNUC_NULL_TERMINATED; -#ifndef GTK_DISABLE_DEPRECATED -GtkWidget *gtk_file_chooser_dialog_new_with_backend (const gchar *title, - GtkWindow *parent, - GtkFileChooserAction action, - const gchar *backend, - const gchar *first_button_text, - ...) G_GNUC_NULL_TERMINATED; -#endif /* GTK_DISABLE_DEPRECATED */ - G_END_DECLS #endif /* __GTK_FILE_CHOOSER_DIALOG_H__ */ diff --git a/gtk/gtkfilechooserutils.c b/gtk/gtkfilechooserutils.c index 69c71d1116..1f0847bf9d 100644 --- a/gtk/gtkfilechooserutils.c +++ b/gtk/gtkfilechooserutils.c @@ -90,9 +90,6 @@ _gtk_file_chooser_install_properties (GObjectClass *klass) g_object_class_override_property (klass, GTK_FILE_CHOOSER_PROP_EXTRA_WIDGET, "extra-widget"); - g_object_class_override_property (klass, - GTK_FILE_CHOOSER_PROP_FILE_SYSTEM_BACKEND, - "file-system-backend"); g_object_class_override_property (klass, GTK_FILE_CHOOSER_PROP_FILTER, "filter"); diff --git a/gtk/gtkfilechooserutils.h b/gtk/gtkfilechooserutils.h index a590cccd16..8b80ab66f9 100644 --- a/gtk/gtkfilechooserutils.h +++ b/gtk/gtkfilechooserutils.h @@ -31,10 +31,9 @@ G_BEGIN_DECLS typedef enum { GTK_FILE_CHOOSER_PROP_FIRST = 0x1000, GTK_FILE_CHOOSER_PROP_ACTION = GTK_FILE_CHOOSER_PROP_FIRST, - GTK_FILE_CHOOSER_PROP_FILE_SYSTEM_BACKEND, GTK_FILE_CHOOSER_PROP_FILTER, GTK_FILE_CHOOSER_PROP_LOCAL_ONLY, - GTK_FILE_CHOOSER_PROP_PREVIEW_WIDGET, + GTK_FILE_CHOOSER_PROP_PREVIEW_WIDGET, GTK_FILE_CHOOSER_PROP_PREVIEW_WIDGET_ACTIVE, GTK_FILE_CHOOSER_PROP_USE_PREVIEW_LABEL, GTK_FILE_CHOOSER_PROP_EXTRA_WIDGET, diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c index d69d8542b2..ca37b17936 100644 --- a/gtk/gtkfilechooserwidget.c +++ b/gtk/gtkfilechooserwidget.c @@ -126,10 +126,6 @@ gtk_file_chooser_widget_set_property (GObject *object, switch (prop_id) { - case GTK_FILE_CHOOSER_PROP_FILE_SYSTEM_BACKEND: - g_free (priv->file_system); - priv->file_system = g_value_dup_string (value); - break; default: g_object_set_property (G_OBJECT (priv->impl), pspec->name, value); break; @@ -167,30 +163,5 @@ gtk_file_chooser_widget_new (GtkFileChooserAction action) NULL); } -/** - * gtk_file_chooser_widget_new_with_backend: - * @action: Open or save mode for the widget - * @backend: The name of the specific filesystem backend to use. - * - * Creates a new #GtkFileChooserWidget with a specified backend. This is - * especially useful if you use gtk_file_chooser_set_local_only() to allow - * non-local files. This is a file chooser widget that can be embedded in - * custom windows and it is the same widget that is used by - * #GtkFileChooserDialog. - * - * Return value: a new #GtkFileChooserWidget - * - * Since: 2.4 - * Deprecated: 2.14: Use gtk_file_chooser_widget_new() instead. - **/ -GtkWidget * -gtk_file_chooser_widget_new_with_backend (GtkFileChooserAction action, - const gchar *backend) -{ - return g_object_new (GTK_TYPE_FILE_CHOOSER_WIDGET, - "action", action, - NULL); -} - #define __GTK_FILE_CHOOSER_WIDGET_C__ #include "gtkaliasdef.c" diff --git a/gtk/gtkfilechooserwidget.h b/gtk/gtkfilechooserwidget.h index 333531f573..fbc04c9d6e 100644 --- a/gtk/gtkfilechooserwidget.h +++ b/gtk/gtkfilechooserwidget.h @@ -18,7 +18,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -56,12 +56,6 @@ struct _GtkFileChooserWidgetClass GType gtk_file_chooser_widget_get_type (void) G_GNUC_CONST; GtkWidget *gtk_file_chooser_widget_new (GtkFileChooserAction action); - -#ifndef GTK_DISABLE_DEPRECATED -GtkWidget *gtk_file_chooser_widget_new_with_backend (GtkFileChooserAction action, - const gchar *backend); -#endif /* GTK_DISABLE_DEPRECATED */ - G_END_DECLS #endif /* __GTK_FILE_CHOOSER_WIDGET_H__ */ diff --git a/gtk/gtkfilefilter.h b/gtk/gtkfilefilter.h index dde1fa931a..7a848e51a5 100644 --- a/gtk/gtkfilefilter.h +++ b/gtk/gtkfilefilter.h @@ -18,7 +18,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkfilesel.c b/gtk/gtkfilesel.c deleted file mode 100644 index 465b722a51..0000000000 --- a/gtk/gtkfilesel.c +++ /dev/null @@ -1,3999 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#include "config.h" - -#include -#include -#include -#ifdef HAVE_SYS_PARAM_H -#include -#endif -#include -#ifdef HAVE_UNISTD_H -#include -#endif -#include -#include -#ifdef HAVE_PWD_H -#include -#endif - -#include /* Include early to get G_OS_WIN32 etc */ -#include - -#if defined(G_PLATFORM_WIN32) -#include -#define STRICT -#include -#undef STRICT -#endif /* G_PLATFORM_WIN32 */ - -#include "gdk/gdkkeysyms.h" - -#undef GTK_DISABLE_DEPRECATED /* GtkOptionMenu */ - -#include "gtkbutton.h" -#include "gtkcellrenderertext.h" -#include "gtkentry.h" -#include "gtkfilesel.h" -#include "gtkhbox.h" -#include "gtkhbbox.h" -#include "gtkintl.h" -#include "gtklabel.h" -#include "gtkliststore.h" -#include "gtkmain.h" -#include "gtkprivate.h" -#include "gtkscrolledwindow.h" -#include "gtkstock.h" -#include "gtktreeselection.h" -#include "gtktreeview.h" -#include "gtkvbox.h" -#include "gtkmenu.h" -#include "gtkmenuitem.h" -#include "gtkdialog.h" -#include "gtkmessagedialog.h" -#include "gtkdnd.h" -#include "gtkeventbox.h" -#include "gtkoptionmenu.h" - -#define WANT_HPANED 1 -#include "gtkhpaned.h" - -#include "gtkalias.h" - -#ifdef G_OS_WIN32 -#include -#include -#ifndef S_ISDIR -#define S_ISDIR(mode) ((mode)&_S_IFDIR) -#endif -#endif /* G_OS_WIN32 */ - -#ifdef G_WITH_CYGWIN -#include /* For cygwin_conv_to_posix_path */ -#endif - -#define DIR_LIST_WIDTH 180 -#define DIR_LIST_HEIGHT 180 -#define FILE_LIST_WIDTH 180 -#define FILE_LIST_HEIGHT 180 - -/* The Hurd doesn't define either PATH_MAX or MAXPATHLEN, so we put this - * in here, since the rest of the code in the file does require some - * fixed maximum. - */ -#ifndef MAXPATHLEN -# ifdef PATH_MAX -# define MAXPATHLEN PATH_MAX -# else -# define MAXPATHLEN 2048 -# endif -#endif - -/* I've put this here so it doesn't get confused with the - * file completion interface */ -typedef struct _HistoryCallbackArg HistoryCallbackArg; - -struct _HistoryCallbackArg -{ - gchar *directory; - GtkWidget *menu_item; -}; - - -typedef struct _CompletionState CompletionState; -typedef struct _CompletionDir CompletionDir; -typedef struct _CompletionDirSent CompletionDirSent; -typedef struct _CompletionDirEntry CompletionDirEntry; -typedef struct _CompletionUserDir CompletionUserDir; -typedef struct _PossibleCompletion PossibleCompletion; - -/* Non-external file completion decls and structures */ - -/* A contant telling PRCS how many directories to cache. Its actually - * kept in a list, so the geometry isn't important. */ -#define CMPL_DIRECTORY_CACHE_SIZE 10 - -/* A constant used to determine whether a substring was an exact - * match by first_diff_index() - */ -#define PATTERN_MATCH -1 -#define CMPL_ERRNO_TOO_LONG ((1<<16)-1) -#define CMPL_ERRNO_DID_NOT_CONVERT ((1<<16)-2) - -/* This structure contains all the useful information about a directory - * for the purposes of filename completion. These structures are cached - * in the CompletionState struct. CompletionDir's are reference counted. - */ -struct _CompletionDirSent -{ -#ifndef G_PLATFORM_WIN32 - ino_t inode; - time_t mtime; - dev_t device; -#endif - - gint entry_count; - struct _CompletionDirEntry *entries; -}; - -struct _CompletionDir -{ - CompletionDirSent *sent; - - gchar *fullname; - gint fullname_len; - - struct _CompletionDir *cmpl_parent; - gint cmpl_index; - gchar *cmpl_text; -}; - -/* This structure contains pairs of directory entry names with a flag saying - * whether or not they are a valid directory. NOTE: This information is used - * to provide the caller with information about whether to update its completions - * or try to open a file. Since directories are cached by the directory mtime, - * a symlink which points to an invalid file (which will not be a directory), - * will not be reevaluated if that file is created, unless the containing - * directory is touched. I consider this case to be worth ignoring (josh). - */ -struct _CompletionDirEntry -{ - gboolean is_dir; - gchar *entry_name; - gchar *sort_key; -}; - -struct _CompletionUserDir -{ - gchar *login; - gchar *homedir; -}; - -struct _PossibleCompletion -{ - /* accessible fields, all are accessed externally by functions - * declared above - */ - gchar *text; - gint is_a_completion; - gboolean is_directory; - - /* Private fields - */ - gint text_alloc; -}; - -struct _CompletionState -{ - gint last_valid_char; - gchar *updated_text; - gint updated_text_len; - gint updated_text_alloc; - gboolean re_complete; - - gchar *user_dir_name_buffer; - gint user_directories_len; - - gchar *last_completion_text; - - gint user_completion_index; /* if >= 0, currently completing ~user */ - - struct _CompletionDir *completion_dir; /* directory completing from */ - struct _CompletionDir *active_completion_dir; - - struct _PossibleCompletion the_completion; - - struct _CompletionDir *reference_dir; /* initial directory */ - - GList* directory_storage; - GList* directory_sent_storage; - - struct _CompletionUserDir *user_directories; -}; - -enum { - PROP_0, - PROP_SHOW_FILEOPS, - PROP_FILENAME, - PROP_SELECT_MULTIPLE -}; - -enum { - DIR_COLUMN -}; - -enum { - FILE_COLUMN -}; - -/* File completion functions which would be external, were they used - * outside of this file. - */ - -static CompletionState* cmpl_init_state (void); -static void cmpl_free_state (CompletionState *cmpl_state); -static gint cmpl_state_okay (CompletionState* cmpl_state); -static const gchar* cmpl_strerror (gint); - -static PossibleCompletion* cmpl_completion_matches(gchar *text_to_complete, - gchar **remaining_text, - CompletionState *cmpl_state); - -/* Returns a name for consideration, possibly a completion, this name - * will be invalid after the next call to cmpl_next_completion. - */ -static char* cmpl_this_completion (PossibleCompletion*); - -/* True if this completion matches the given text. Otherwise, this - * output can be used to have a list of non-completions. - */ -static gint cmpl_is_a_completion (PossibleCompletion*); - -/* True if the completion is a directory - */ -static gboolean cmpl_is_directory (PossibleCompletion*); - -/* Obtains the next completion, or NULL - */ -static PossibleCompletion* cmpl_next_completion (CompletionState*); - -/* Updating completions: the return value of cmpl_updated_text() will - * be text_to_complete completed as much as possible after the most - * recent call to cmpl_completion_matches. For the present - * application, this is the suggested replacement for the user's input - * string. You must CALL THIS AFTER ALL cmpl_text_completions have - * been received. - */ -static gchar* cmpl_updated_text (CompletionState* cmpl_state); - -/* After updating, to see if the completion was a directory, call - * this. If it was, you should consider re-calling completion_matches. - */ -static gboolean cmpl_updated_dir (CompletionState* cmpl_state); - -/* Current location: if using file completion, return the current - * directory, from which file completion begins. More specifically, - * the cwd concatenated with all exact completions up to the last - * directory delimiter('/'). - */ -static gchar* cmpl_reference_position (CompletionState* cmpl_state); - -#if 0 -/* This doesn't work currently and would require changes - * to fnmatch.c to get working. - */ -/* backing up: if cmpl_completion_matches returns NULL, you may query - * the index of the last completable character into cmpl_updated_text. - */ -static gint cmpl_last_valid_char (CompletionState* cmpl_state); -#endif - -/* When the user selects a non-directory, call cmpl_completion_fullname - * to get the full name of the selected file. - */ -static gchar* cmpl_completion_fullname (const gchar*, CompletionState* cmpl_state); - - -/* Directory operations. */ -static CompletionDir* open_ref_dir (gchar* text_to_complete, - gchar** remaining_text, - CompletionState* cmpl_state); -#ifndef G_PLATFORM_WIN32 -static gboolean check_dir (gchar *dir_name, - struct stat *result, - gboolean *stat_subdirs); -#endif -static CompletionDir* open_dir (gchar* dir_name, - CompletionState* cmpl_state); -#ifdef HAVE_PWD_H -static CompletionDir* open_user_dir (const gchar* text_to_complete, - CompletionState *cmpl_state); -#endif -static CompletionDir* open_relative_dir (gchar* dir_name, CompletionDir* dir, - CompletionState *cmpl_state); -static CompletionDirSent* open_new_dir (gchar* dir_name, - struct stat* sbuf, - gboolean stat_subdirs); -static gint correct_dir_fullname (CompletionDir* cmpl_dir); -static gint correct_parent (CompletionDir* cmpl_dir, - struct stat *sbuf); -#ifndef G_PLATFORM_WIN32 -static gchar* find_parent_dir_fullname (gchar* dirname); -#endif -static CompletionDir* attach_dir (CompletionDirSent* sent, - gchar* dir_name, - CompletionState *cmpl_state); -static void free_dir_sent (CompletionDirSent* sent); -static void free_dir (CompletionDir *dir); -static void prune_memory_usage(CompletionState *cmpl_state); - -/* Completion operations */ -#ifdef HAVE_PWD_H -static PossibleCompletion* attempt_homedir_completion(gchar* text_to_complete, - CompletionState *cmpl_state); -#endif -static PossibleCompletion* attempt_file_completion(CompletionState *cmpl_state); -static CompletionDir* find_completion_dir(gchar* text_to_complete, - gchar** remaining_text, - CompletionState* cmpl_state); -static PossibleCompletion* append_completion_text(gchar* text, - CompletionState* cmpl_state); -#ifdef HAVE_PWD_H -static gint get_pwdb(CompletionState* cmpl_state); -static gint compare_user_dir(const void* a, const void* b); -#endif -static gint first_diff_index(gchar* pat, gchar* text); -static gint compare_cmpl_dir(const void* a, const void* b); -static void update_cmpl(PossibleCompletion* poss, - CompletionState* cmpl_state); - -static void gtk_file_selection_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec); -static void gtk_file_selection_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec); -static void gtk_file_selection_finalize (GObject *object); -static void gtk_file_selection_destroy (GtkObject *object); -static void gtk_file_selection_map (GtkWidget *widget); -static gint gtk_file_selection_key_press (GtkWidget *widget, - GdkEventKey *event, - gpointer user_data); -static gint gtk_file_selection_insert_text (GtkWidget *widget, - const gchar *new_text, - gint new_text_length, - gint *position, - gpointer user_data); -static void gtk_file_selection_update_fileops (GtkFileSelection *filesel); - -static void gtk_file_selection_file_activate (GtkTreeView *tree_view, - GtkTreePath *path, - GtkTreeViewColumn *column, - gpointer user_data); -static void gtk_file_selection_file_changed (GtkTreeSelection *selection, - gpointer user_data); -static void gtk_file_selection_dir_activate (GtkTreeView *tree_view, - GtkTreePath *path, - GtkTreeViewColumn *column, - gpointer user_data); - -static void gtk_file_selection_populate (GtkFileSelection *fs, - gchar *rel_path, - gboolean try_complete, - gboolean reset_entry); -static void gtk_file_selection_abort (GtkFileSelection *fs); - -static void gtk_file_selection_update_history_menu (GtkFileSelection *fs, - gchar *current_dir); - -static void gtk_file_selection_create_dir (GtkWidget *widget, gpointer data); -static void gtk_file_selection_delete_file (GtkWidget *widget, gpointer data); -static void gtk_file_selection_rename_file (GtkWidget *widget, gpointer data); - -static void free_selected_names (GPtrArray *names); - -#ifndef G_PLATFORM_WIN32 - -#define compare_utf8_filenames(a, b) strcmp(a, b) -#define compare_sys_filenames(a, b) strcmp(a, b) - -#else - -static gint -compare_utf8_filenames (const gchar *a, - const gchar *b) -{ - gchar *a_folded, *b_folded; - gint retval; - - a_folded = g_utf8_strdown (a, -1); - b_folded = g_utf8_strdown (b, -1); - - retval = strcmp (a_folded, b_folded); - - g_free (a_folded); - g_free (b_folded); - - return retval; -} - -static gint -compare_sys_filenames (const gchar *a, - const gchar *b) -{ - gchar *a_utf8, *b_utf8; - gint retval; - - a_utf8 = g_filename_to_utf8 (a, -1, NULL, NULL, NULL); - b_utf8 = g_filename_to_utf8 (b, -1, NULL, NULL, NULL); - - retval = compare_utf8_filenames (a_utf8, b_utf8); - - g_free (a_utf8); - g_free (b_utf8); - - return retval; -} - -#endif - -/* Saves errno when something cmpl does fails. */ -static gint cmpl_errno; - -#ifdef G_WITH_CYGWIN -/* - * Take the path currently in the file selection - * entry field and translate as necessary from - * a Win32 style to Cygwin style path. For - * instance translate: - * x:\somepath\file.jpg - * to: - * /cygdrive/x/somepath/file.jpg - * - * Replace the path in the selection text field. - * Return a boolean value concerning whether a - * translation had to be made. - */ -static int -translate_win32_path (GtkFileSelection *filesel) -{ - int updated = 0; - const gchar *path; - gchar newPath[MAX_PATH]; - - /* - * Retrieve the current path - */ - path = gtk_entry_get_text (GTK_ENTRY (filesel->selection_entry)); - - cygwin_conv_to_posix_path (path, newPath); - updated = (strcmp (path, newPath) != 0); - - if (updated) - gtk_entry_set_text (GTK_ENTRY (filesel->selection_entry), newPath); - - return updated; -} -#endif - -G_DEFINE_TYPE (GtkFileSelection, gtk_file_selection, GTK_TYPE_DIALOG) - -static void -gtk_file_selection_class_init (GtkFileSelectionClass *class) -{ - GObjectClass *gobject_class; - GtkObjectClass *object_class; - GtkWidgetClass *widget_class; - - gobject_class = (GObjectClass*) class; - object_class = (GtkObjectClass*) class; - widget_class = (GtkWidgetClass*) class; - - gobject_class->finalize = gtk_file_selection_finalize; - gobject_class->set_property = gtk_file_selection_set_property; - gobject_class->get_property = gtk_file_selection_get_property; - - g_object_class_install_property (gobject_class, - PROP_FILENAME, - g_param_spec_string ("filename", - P_("Filename"), - P_("The currently selected filename"), - NULL, - GTK_PARAM_READWRITE)); - g_object_class_install_property (gobject_class, - PROP_SHOW_FILEOPS, - g_param_spec_boolean ("show-fileops", - P_("Show file operations"), - P_("Whether buttons for creating/manipulating files should be displayed"), - TRUE, - GTK_PARAM_READWRITE)); - g_object_class_install_property (gobject_class, - PROP_SELECT_MULTIPLE, - g_param_spec_boolean ("select-multiple", - P_("Select Multiple"), - P_("Whether to allow multiple files to be selected"), - FALSE, - GTK_PARAM_READWRITE)); - object_class->destroy = gtk_file_selection_destroy; - widget_class->map = gtk_file_selection_map; -} - -static void gtk_file_selection_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - GtkFileSelection *filesel; - - filesel = GTK_FILE_SELECTION (object); - - switch (prop_id) - { - case PROP_FILENAME: - gtk_file_selection_set_filename (filesel, - g_value_get_string (value)); - break; - case PROP_SHOW_FILEOPS: - if (g_value_get_boolean (value)) - gtk_file_selection_show_fileop_buttons (filesel); - else - gtk_file_selection_hide_fileop_buttons (filesel); - break; - case PROP_SELECT_MULTIPLE: - gtk_file_selection_set_select_multiple (filesel, g_value_get_boolean (value)); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void gtk_file_selection_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - GtkFileSelection *filesel; - - filesel = GTK_FILE_SELECTION (object); - - switch (prop_id) - { - case PROP_FILENAME: - g_value_set_string (value, - gtk_file_selection_get_filename(filesel)); - break; - - case PROP_SHOW_FILEOPS: - /* This is a little bit hacky, but doing otherwise would require - * adding a field to the object. - */ - g_value_set_boolean (value, (filesel->fileop_c_dir && - filesel->fileop_del_file && - filesel->fileop_ren_file)); - break; - case PROP_SELECT_MULTIPLE: - g_value_set_boolean (value, gtk_file_selection_get_select_multiple (filesel)); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static gboolean -grab_default (GtkWidget *widget) -{ - gtk_widget_grab_default (widget); - return FALSE; -} - -static void -gtk_file_selection_init (GtkFileSelection *filesel) -{ - GtkWidget *entry_vbox; - GtkWidget *label; - GtkWidget *list_hbox, *list_container; - GtkWidget *pulldown_hbox; - GtkWidget *scrolled_win; - GtkWidget *eventbox; - GtkWidget *spacer; - GtkDialog *dialog; - - GtkListStore *model; - GtkTreeViewColumn *column; - - gtk_widget_push_composite_child (); - - dialog = GTK_DIALOG (filesel); - - filesel->cmpl_state = cmpl_init_state (); - - /* The dialog-sized vertical box */ - filesel->main_vbox = dialog->vbox; - gtk_container_set_border_width (GTK_CONTAINER (filesel), 10); - - /* The horizontal box containing create, rename etc. buttons */ - filesel->button_area = gtk_hbutton_box_new (); - gtk_button_box_set_layout (GTK_BUTTON_BOX (filesel->button_area), GTK_BUTTONBOX_START); - gtk_box_set_spacing (GTK_BOX (filesel->button_area), 0); - gtk_box_pack_start (GTK_BOX (filesel->main_vbox), filesel->button_area, - FALSE, FALSE, 0); - gtk_widget_show (filesel->button_area); - - gtk_file_selection_show_fileop_buttons (filesel); - - /* hbox for pulldown menu */ - pulldown_hbox = gtk_hbox_new (TRUE, 5); - gtk_box_pack_start (GTK_BOX (filesel->main_vbox), pulldown_hbox, FALSE, FALSE, 0); - gtk_widget_show (pulldown_hbox); - - /* Pulldown menu */ - filesel->history_pulldown = gtk_option_menu_new (); - gtk_widget_show (filesel->history_pulldown); - gtk_box_pack_start (GTK_BOX (pulldown_hbox), filesel->history_pulldown, - FALSE, FALSE, 0); - - /* The horizontal box containing the directory and file listboxes */ - - spacer = gtk_hbox_new (FALSE, 0); - gtk_widget_set_size_request (spacer, -1, 5); - gtk_box_pack_start (GTK_BOX (filesel->main_vbox), spacer, FALSE, FALSE, 0); - gtk_widget_show (spacer); - - list_hbox = gtk_hbox_new (FALSE, 5); - gtk_box_pack_start (GTK_BOX (filesel->main_vbox), list_hbox, TRUE, TRUE, 0); - gtk_widget_show (list_hbox); - if (WANT_HPANED) - list_container = g_object_new (GTK_TYPE_HPANED, - "visible", TRUE, - "parent", list_hbox, - "border_width", 0, - NULL); - else - list_container = list_hbox; - - spacer = gtk_hbox_new (FALSE, 0); - gtk_widget_set_size_request (spacer, -1, 5); - gtk_box_pack_start (GTK_BOX (filesel->main_vbox), spacer, FALSE, FALSE, 0); - gtk_widget_show (spacer); - - /* The directories list */ - - model = gtk_list_store_new (1, G_TYPE_STRING); - filesel->dir_list = gtk_tree_view_new_with_model (GTK_TREE_MODEL (model)); - g_object_unref (model); - - column = gtk_tree_view_column_new_with_attributes (_("Folders"), - gtk_cell_renderer_text_new (), - "text", DIR_COLUMN, - NULL); - label = gtk_label_new_with_mnemonic (_("Fol_ders")); - gtk_label_set_mnemonic_widget (GTK_LABEL (label), filesel->dir_list); - gtk_widget_show (label); - gtk_tree_view_column_set_widget (column, label); - gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE); - gtk_tree_view_append_column (GTK_TREE_VIEW (filesel->dir_list), column); - - gtk_widget_set_size_request (filesel->dir_list, - DIR_LIST_WIDTH, DIR_LIST_HEIGHT); - g_signal_connect (filesel->dir_list, "row-activated", - G_CALLBACK (gtk_file_selection_dir_activate), filesel); - - /* gtk_clist_column_titles_passive (GTK_CLIST (filesel->dir_list)); */ - - scrolled_win = gtk_scrolled_window_new (NULL, NULL); - gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); - gtk_container_add (GTK_CONTAINER (scrolled_win), filesel->dir_list); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win), - GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); - gtk_container_set_border_width (GTK_CONTAINER (scrolled_win), 0); - if (GTK_IS_PANED (list_container)) - gtk_paned_pack1 (GTK_PANED (list_container), scrolled_win, TRUE, TRUE); - else - gtk_container_add (GTK_CONTAINER (list_container), scrolled_win); - gtk_widget_show (filesel->dir_list); - gtk_widget_show (scrolled_win); - - /* The files list */ - model = gtk_list_store_new (1, G_TYPE_STRING); - filesel->file_list = gtk_tree_view_new_with_model (GTK_TREE_MODEL (model)); - g_object_unref (model); - - column = gtk_tree_view_column_new_with_attributes (_("Files"), - gtk_cell_renderer_text_new (), - "text", FILE_COLUMN, - NULL); - label = gtk_label_new_with_mnemonic (_("_Files")); - gtk_label_set_mnemonic_widget (GTK_LABEL (label), filesel->file_list); - gtk_widget_show (label); - gtk_tree_view_column_set_widget (column, label); - gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE); - gtk_tree_view_append_column (GTK_TREE_VIEW (filesel->file_list), column); - - gtk_widget_set_size_request (filesel->file_list, - FILE_LIST_WIDTH, FILE_LIST_HEIGHT); - g_signal_connect (filesel->file_list, "row-activated", - G_CALLBACK (gtk_file_selection_file_activate), filesel); - g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (filesel->file_list)), "changed", - G_CALLBACK (gtk_file_selection_file_changed), filesel); - - /* gtk_clist_column_titles_passive (GTK_CLIST (filesel->file_list)); */ - - scrolled_win = gtk_scrolled_window_new (NULL, NULL); - gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); - gtk_container_add (GTK_CONTAINER (scrolled_win), filesel->file_list); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win), - GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); - gtk_container_set_border_width (GTK_CONTAINER (scrolled_win), 0); - gtk_container_add (GTK_CONTAINER (list_container), scrolled_win); - gtk_widget_show (filesel->file_list); - gtk_widget_show (scrolled_win); - - /* action area for packing buttons into. */ - filesel->action_area = gtk_hbox_new (TRUE, 0); - gtk_box_pack_start (GTK_BOX (filesel->main_vbox), filesel->action_area, - FALSE, FALSE, 0); - gtk_widget_show (filesel->action_area); - - /* The OK/Cancel button area */ - - /* The Cancel button */ - filesel->cancel_button = gtk_dialog_add_button (dialog, - GTK_STOCK_CANCEL, - GTK_RESPONSE_CANCEL); - /* The OK button */ - filesel->ok_button = gtk_dialog_add_button (dialog, - GTK_STOCK_OK, - GTK_RESPONSE_OK); - - gtk_dialog_set_alternative_button_order (dialog, - GTK_RESPONSE_OK, - GTK_RESPONSE_CANCEL, - -1); - - gtk_widget_grab_default (filesel->ok_button); - - /* The selection entry widget */ - entry_vbox = gtk_vbox_new (FALSE, 2); - gtk_box_pack_end (GTK_BOX (filesel->main_vbox), entry_vbox, FALSE, FALSE, 2); - gtk_widget_show (entry_vbox); - - eventbox = gtk_event_box_new (); - filesel->selection_text = label = gtk_label_new (""); - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_container_add (GTK_CONTAINER (eventbox), label); - gtk_box_pack_start (GTK_BOX (entry_vbox), eventbox, FALSE, FALSE, 0); - gtk_widget_show (label); - gtk_widget_show (eventbox); - - filesel->selection_entry = gtk_entry_new (); - g_signal_connect (filesel->selection_entry, "key-press-event", - G_CALLBACK (gtk_file_selection_key_press), filesel); - g_signal_connect (filesel->selection_entry, "insert-text", - G_CALLBACK (gtk_file_selection_insert_text), NULL); - g_signal_connect_swapped (filesel->selection_entry, "changed", - G_CALLBACK (gtk_file_selection_update_fileops), filesel); - g_signal_connect_swapped (filesel->selection_entry, "focus-in-event", - G_CALLBACK (grab_default), - filesel->ok_button); - g_signal_connect_swapped (filesel->selection_entry, "activate", - G_CALLBACK (gtk_button_clicked), - filesel->ok_button); - - gtk_box_pack_start (GTK_BOX (entry_vbox), filesel->selection_entry, TRUE, TRUE, 0); - gtk_widget_show (filesel->selection_entry); - - gtk_label_set_mnemonic_widget (GTK_LABEL (filesel->selection_text), - filesel->selection_entry); - - if (!cmpl_state_okay (filesel->cmpl_state)) - { - gchar err_buf[256]; - - g_snprintf (err_buf, sizeof (err_buf), _("Folder unreadable: %s"), cmpl_strerror (cmpl_errno)); - - gtk_label_set_text (GTK_LABEL (filesel->selection_text), err_buf); - } - else - { - gtk_file_selection_populate (filesel, "", FALSE, TRUE); - } - - gtk_widget_grab_focus (filesel->selection_entry); - - gtk_widget_pop_composite_child (); -} - -static void -dnd_really_drop (GtkWidget *dialog, gint response_id, GtkFileSelection *fs) -{ - gchar *filename; - - if (response_id == GTK_RESPONSE_YES) - { - filename = g_object_get_data (G_OBJECT (dialog), "gtk-fs-dnd-filename"); - - gtk_file_selection_set_filename (fs, filename); - } - - gtk_widget_destroy (dialog); -} - -static void -filenames_dropped (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, - GtkSelectionData *selection_data, - guint info, - guint time) -{ - char **uris = NULL; - char *filename = NULL; - char *hostname; - const char *this_hostname; - GError *error = NULL; - - uris = gtk_selection_data_get_uris (selection_data); - if (!uris || !uris[0]) - { - g_strfreev (uris); - return; - } - - filename = g_filename_from_uri (uris[0], &hostname, &error); - g_strfreev (uris); - - if (!filename) - { - g_warning ("Error getting dropped filename: %s\n", - error->message); - g_error_free (error); - return; - } - - this_hostname = g_get_host_name (); - - if ((hostname == NULL) || - (strcmp (hostname, this_hostname) == 0) || - (strcmp (hostname, "localhost") == 0)) - gtk_file_selection_set_filename (GTK_FILE_SELECTION (widget), - filename); - else - { - GtkWidget *dialog; - gchar *filename_utf8; - - /* Conversion back to UTF-8 should always succeed for the result - * of g_filename_from_uri() - */ - filename_utf8 = g_filename_to_utf8 (filename, -1, NULL, NULL, NULL); - g_assert (filename_utf8); - - dialog = gtk_message_dialog_new (GTK_WINDOW (widget), - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_QUESTION, - GTK_BUTTONS_YES_NO, - _("The file \"%s\" resides on another machine (called %s) and may not be available to this program.\n" - "Are you sure that you want to select it?"), filename_utf8, hostname); - g_free (filename_utf8); - - g_object_set_data_full (G_OBJECT (dialog), I_("gtk-fs-dnd-filename"), g_strdup (filename), g_free); - - g_signal_connect_data (dialog, "response", - (GCallback) dnd_really_drop, - widget, NULL, 0); - - gtk_widget_show (dialog); - } - - g_free (hostname); - g_free (filename); -} - -static void -filenames_drag_get (GtkWidget *widget, - GdkDragContext *context, - GtkSelectionData *selection_data, - guint info, - guint time, - GtkFileSelection *filesel) -{ - const gchar *file; - gchar *filename_utf8; - - file = gtk_file_selection_get_filename (filesel); - if (!file) - return; - - if (gtk_targets_include_uri (&selection_data->target, 1)) - { - gchar *file_uri; - const char *hostname; - GError *error; - char *uris[2]; - - hostname = g_get_host_name (); - - error = NULL; - file_uri = g_filename_to_uri (file, hostname, &error); - if (!file_uri) - { - g_warning ("Error getting filename: %s\n", - error->message); - g_error_free (error); - return; - } - - uris[0] = file_uri; - uris[1] = NULL; - gtk_selection_data_set_uris (selection_data, uris); - g_free (file_uri); - - return; - } - - filename_utf8 = g_filename_to_utf8 (file, -1, NULL, NULL, NULL); - if (!filename_utf8) - return; - - gtk_selection_data_set_text (selection_data, filename_utf8, -1); - g_free (filename_utf8); -} - -static void -file_selection_setup_dnd (GtkFileSelection *filesel) -{ - GtkWidget *eventbox; - - gtk_drag_dest_set (GTK_WIDGET (filesel), - GTK_DEST_DEFAULT_ALL, - NULL, 0, - GDK_ACTION_COPY); - gtk_drag_dest_add_uri_targets (GTK_WIDGET (filesel)); - - g_signal_connect (filesel, "drag-data-received", - G_CALLBACK (filenames_dropped), NULL); - - eventbox = gtk_widget_get_parent (filesel->selection_text); - gtk_drag_source_set (eventbox, - GDK_BUTTON1_MASK, - NULL, 0, - GDK_ACTION_COPY); - gtk_drag_source_add_uri_targets (eventbox); - gtk_drag_source_add_text_targets (eventbox); - - g_signal_connect (eventbox, "drag-data-get", - G_CALLBACK (filenames_drag_get), filesel); -} - -GtkWidget* -gtk_file_selection_new (const gchar *title) -{ - GtkFileSelection *filesel; - - filesel = g_object_new (GTK_TYPE_FILE_SELECTION, NULL); - gtk_window_set_title (GTK_WINDOW (filesel), title); - gtk_dialog_set_has_separator (GTK_DIALOG (filesel), FALSE); - - file_selection_setup_dnd (filesel); - - return GTK_WIDGET (filesel); -} - -void -gtk_file_selection_show_fileop_buttons (GtkFileSelection *filesel) -{ - g_return_if_fail (GTK_IS_FILE_SELECTION (filesel)); - - /* delete, create directory, and rename */ - if (!filesel->fileop_c_dir) - { - filesel->fileop_c_dir = gtk_button_new_with_mnemonic (_("_New Folder")); - g_signal_connect (filesel->fileop_c_dir, "clicked", - G_CALLBACK (gtk_file_selection_create_dir), - filesel); - gtk_box_pack_start (GTK_BOX (filesel->button_area), - filesel->fileop_c_dir, TRUE, TRUE, 0); - gtk_widget_show (filesel->fileop_c_dir); - } - - if (!filesel->fileop_del_file) - { - filesel->fileop_del_file = gtk_button_new_with_mnemonic (_("De_lete File")); - g_signal_connect (filesel->fileop_del_file, "clicked", - G_CALLBACK (gtk_file_selection_delete_file), - filesel); - gtk_box_pack_start (GTK_BOX (filesel->button_area), - filesel->fileop_del_file, TRUE, TRUE, 0); - gtk_widget_show (filesel->fileop_del_file); - } - - if (!filesel->fileop_ren_file) - { - filesel->fileop_ren_file = gtk_button_new_with_mnemonic (_("_Rename File")); - g_signal_connect (filesel->fileop_ren_file, "clicked", - G_CALLBACK (gtk_file_selection_rename_file), - filesel); - gtk_box_pack_start (GTK_BOX (filesel->button_area), - filesel->fileop_ren_file, TRUE, TRUE, 0); - gtk_widget_show (filesel->fileop_ren_file); - } - - gtk_file_selection_update_fileops (filesel); - - g_object_notify (G_OBJECT (filesel), "show-fileops"); -} - -void -gtk_file_selection_hide_fileop_buttons (GtkFileSelection *filesel) -{ - g_return_if_fail (GTK_IS_FILE_SELECTION (filesel)); - - if (filesel->fileop_ren_file) - { - gtk_widget_destroy (filesel->fileop_ren_file); - filesel->fileop_ren_file = NULL; - } - - if (filesel->fileop_del_file) - { - gtk_widget_destroy (filesel->fileop_del_file); - filesel->fileop_del_file = NULL; - } - - if (filesel->fileop_c_dir) - { - gtk_widget_destroy (filesel->fileop_c_dir); - filesel->fileop_c_dir = NULL; - } - g_object_notify (G_OBJECT (filesel), "show-fileops"); -} - - - -/** - * gtk_file_selection_set_filename: - * @filesel: a #GtkFileSelection. - * @filename: a string to set as the default file name. - * - * Sets a default path for the file requestor. If @filename includes a - * directory path, then the requestor will open with that path as its - * current working directory. - * - * This has the consequence that in order to open the requestor with a - * working directory and an empty filename, @filename must have a trailing - * directory separator. - * - * The encoding of @filename is preferred GLib file name encoding, which - * may not be UTF-8. See g_filename_from_utf8(). - **/ -void -gtk_file_selection_set_filename (GtkFileSelection *filesel, - const gchar *filename) -{ - gchar *buf; - const char *name, *last_slash; - char *filename_utf8; - - g_return_if_fail (GTK_IS_FILE_SELECTION (filesel)); - g_return_if_fail (filename != NULL); - - filename_utf8 = g_filename_to_utf8 (filename, -1, NULL, NULL, NULL); - g_return_if_fail (filename_utf8 != NULL); - - last_slash = strrchr (filename_utf8, G_DIR_SEPARATOR); - - if (!last_slash) - { - buf = g_strdup (""); - name = filename_utf8; - } - else - { - buf = g_strdup (filename_utf8); - buf[last_slash - filename_utf8 + 1] = 0; - name = last_slash + 1; - } - - gtk_file_selection_populate (filesel, buf, FALSE, TRUE); - - if (filesel->selection_entry) - gtk_entry_set_text (GTK_ENTRY (filesel->selection_entry), name); - g_free (buf); - g_object_notify (G_OBJECT (filesel), "filename"); - - g_free (filename_utf8); -} - -/** - * gtk_file_selection_get_filename: - * @filesel: a #GtkFileSelection - * - * This function returns the selected filename in the GLib file name - * encoding. To convert to UTF-8, call g_filename_to_utf8(). The - * returned string points to a statically allocated buffer and should - * be copied if you plan to keep it around. - * - * If no file is selected then the selected directory path is returned. - * - * Return value: currently-selected filename in the on-disk encoding. - **/ -G_CONST_RETURN gchar* -gtk_file_selection_get_filename (GtkFileSelection *filesel) -{ - static const gchar nothing[2] = ""; - static GString *something; - char *sys_filename; - const char *text; - - g_return_val_if_fail (GTK_IS_FILE_SELECTION (filesel), nothing); - -#ifdef G_WITH_CYGWIN - translate_win32_path (filesel); -#endif - text = gtk_entry_get_text (GTK_ENTRY (filesel->selection_entry)); - if (text) - { - gchar *fullname = cmpl_completion_fullname (text, filesel->cmpl_state); - sys_filename = g_filename_from_utf8 (fullname, -1, NULL, NULL, NULL); - g_free (fullname); - if (!sys_filename) - return nothing; - if (!something) - something = g_string_new (sys_filename); - else - g_string_assign (something, sys_filename); - g_free (sys_filename); - - return something->str; - } - - return nothing; -} - -void -gtk_file_selection_complete (GtkFileSelection *filesel, - const gchar *pattern) -{ - g_return_if_fail (GTK_IS_FILE_SELECTION (filesel)); - g_return_if_fail (pattern != NULL); - - if (filesel->selection_entry) - gtk_entry_set_text (GTK_ENTRY (filesel->selection_entry), pattern); - gtk_file_selection_populate (filesel, (gchar*) pattern, TRUE, TRUE); -} - -static void -gtk_file_selection_destroy (GtkObject *object) -{ - GtkFileSelection *filesel; - GList *list; - HistoryCallbackArg *callback_arg; - - g_return_if_fail (GTK_IS_FILE_SELECTION (object)); - - filesel = GTK_FILE_SELECTION (object); - - if (filesel->fileop_dialog) - { - gtk_widget_destroy (filesel->fileop_dialog); - filesel->fileop_dialog = NULL; - } - - if (filesel->history_list) - { - list = filesel->history_list; - while (list) - { - callback_arg = list->data; - g_free (callback_arg->directory); - g_free (callback_arg); - list = list->next; - } - g_list_free (filesel->history_list); - filesel->history_list = NULL; - } - - if (filesel->cmpl_state) - { - cmpl_free_state (filesel->cmpl_state); - filesel->cmpl_state = NULL; - } - - if (filesel->selected_names) - { - free_selected_names (filesel->selected_names); - filesel->selected_names = NULL; - } - - if (filesel->last_selected) - { - g_free (filesel->last_selected); - filesel->last_selected = NULL; - } - - GTK_OBJECT_CLASS (gtk_file_selection_parent_class)->destroy (object); -} - -static void -gtk_file_selection_map (GtkWidget *widget) -{ - GtkFileSelection *filesel = GTK_FILE_SELECTION (widget); - - /* Refresh the contents */ - gtk_file_selection_populate (filesel, "", FALSE, FALSE); - - GTK_WIDGET_CLASS (gtk_file_selection_parent_class)->map (widget); -} - -static void -gtk_file_selection_finalize (GObject *object) -{ - GtkFileSelection *filesel = GTK_FILE_SELECTION (object); - - g_free (filesel->fileop_file); - - G_OBJECT_CLASS (gtk_file_selection_parent_class)->finalize (object); -} - -/* Begin file operations callbacks */ - -static void -gtk_file_selection_fileop_error (GtkFileSelection *fs, - gchar *error_message) -{ - GtkWidget *dialog; - - g_return_if_fail (error_message != NULL); - - /* main dialog */ - dialog = gtk_message_dialog_new (GTK_WINDOW (fs), - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, - "%s", error_message); - - /* yes, we free it */ - g_free (error_message); - - gtk_window_set_modal (GTK_WINDOW (dialog), TRUE); - - g_signal_connect_swapped (dialog, "response", - G_CALLBACK (gtk_widget_destroy), - dialog); - - gtk_widget_show (dialog); -} - -static void -gtk_file_selection_fileop_destroy (GtkWidget *widget, - gpointer data) -{ - GtkFileSelection *fs = data; - - g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); - - fs->fileop_dialog = NULL; -} - -static gboolean -entry_is_empty (GtkEntry *entry) -{ - const gchar *text = gtk_entry_get_text (entry); - - return *text == '\0'; -} - -static void -gtk_file_selection_fileop_entry_changed (GtkEntry *entry, - GtkWidget *button) -{ - gtk_widget_set_sensitive (button, !entry_is_empty (entry)); -} - -static void -gtk_file_selection_create_dir_confirmed (GtkWidget *widget, - gpointer data) -{ - GtkFileSelection *fs = data; - const gchar *dirname; - gchar *path; - gchar *full_path; - gchar *sys_full_path; - gchar *buf; - GError *error = NULL; - CompletionState *cmpl_state; - - g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); - - dirname = gtk_entry_get_text (GTK_ENTRY (fs->fileop_entry)); - cmpl_state = (CompletionState*) fs->cmpl_state; - path = cmpl_reference_position (cmpl_state); - - full_path = g_strconcat (path, G_DIR_SEPARATOR_S, dirname, NULL); - sys_full_path = g_filename_from_utf8 (full_path, -1, NULL, NULL, &error); - if (error) - { - if (g_error_matches (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE)) - buf = g_strdup_printf (_("The folder name \"%s\" contains symbols that are not allowed in filenames"), dirname); - else - buf = g_strdup_printf (_("Error creating folder '%s': %s"), - dirname, error->message); - gtk_file_selection_fileop_error (fs, buf); - g_error_free (error); - goto out; - } - - if (g_mkdir (sys_full_path, 0777) < 0) - { - int errsv = errno; - - buf = g_strdup_printf (_("Error creating folder '%s': %s"), - dirname, g_strerror (errsv)); - gtk_file_selection_fileop_error (fs, buf); - } - - out: - g_free (full_path); - g_free (sys_full_path); - - gtk_widget_destroy (fs->fileop_dialog); - gtk_file_selection_populate (fs, "", FALSE, FALSE); -} - -static void -gtk_file_selection_create_dir (GtkWidget *widget, - gpointer data) -{ - GtkFileSelection *fs = data; - GtkWidget *label; - GtkWidget *dialog; - GtkWidget *vbox; - GtkWidget *button; - - g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); - - if (fs->fileop_dialog) - return; - - /* main dialog */ - dialog = gtk_dialog_new (); - fs->fileop_dialog = dialog; - g_signal_connect (dialog, "destroy", - G_CALLBACK (gtk_file_selection_fileop_destroy), - fs); - gtk_window_set_title (GTK_WINDOW (dialog), _("New Folder")); - gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE); - gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (fs)); - - /* If file dialog is grabbed, grab option dialog */ - /* When option dialog is closed, file dialog will be grabbed again */ - if (GTK_WINDOW (fs)->modal) - gtk_window_set_modal (GTK_WINDOW (dialog), TRUE); - - vbox = gtk_vbox_new (FALSE, 0); - gtk_container_set_border_width (GTK_CONTAINER (vbox), 8); - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), vbox, - FALSE, FALSE, 0); - gtk_widget_show( vbox); - - label = gtk_label_new_with_mnemonic (_("_Folder name:")); - gtk_misc_set_alignment(GTK_MISC (label), 0.0, 0.0); - gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 5); - gtk_widget_show (label); - - /* The directory entry widget */ - fs->fileop_entry = gtk_entry_new (); - gtk_label_set_mnemonic_widget (GTK_LABEL (label), fs->fileop_entry); - gtk_box_pack_start (GTK_BOX (vbox), fs->fileop_entry, - TRUE, TRUE, 5); - gtk_widget_set_can_default (fs->fileop_entry, TRUE); - gtk_entry_set_activates_default (GTK_ENTRY (fs->fileop_entry), TRUE); - gtk_widget_show (fs->fileop_entry); - - /* buttons */ - button = gtk_dialog_add_button (GTK_DIALOG (dialog), - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL); - g_signal_connect_swapped (button, "clicked", - G_CALLBACK (gtk_widget_destroy), - dialog); - - gtk_widget_grab_focus (fs->fileop_entry); - - button = gtk_dialog_add_button (GTK_DIALOG (dialog), - _("C_reate"), GTK_RESPONSE_OK); - gtk_widget_set_sensitive (button, FALSE); - g_signal_connect (button, "clicked", - G_CALLBACK (gtk_file_selection_create_dir_confirmed), - fs); - g_signal_connect (fs->fileop_entry, "changed", - G_CALLBACK (gtk_file_selection_fileop_entry_changed), - button); - - gtk_widget_grab_default (button); - - gtk_widget_show (dialog); -} - -static void -gtk_file_selection_delete_file_response (GtkDialog *dialog, - gint response_id, - gpointer data) -{ - GtkFileSelection *fs = data; - CompletionState *cmpl_state; - gchar *path; - gchar *full_path; - gchar *sys_full_path; - GError *error = NULL; - gchar *buf; - - g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); - - if (response_id != GTK_RESPONSE_OK) - { - gtk_widget_destroy (GTK_WIDGET (dialog)); - return; - } - - cmpl_state = (CompletionState*) fs->cmpl_state; - path = cmpl_reference_position (cmpl_state); - - full_path = g_strconcat (path, G_DIR_SEPARATOR_S, fs->fileop_file, NULL); - sys_full_path = g_filename_from_utf8 (full_path, -1, NULL, NULL, &error); - if (error) - { - if (g_error_matches (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE)) - buf = g_strdup_printf (_("The filename \"%s\" contains symbols that are not allowed in filenames"), - fs->fileop_file); - else - buf = g_strdup_printf (_("Error deleting file '%s': %s"), - fs->fileop_file, error->message); - - gtk_file_selection_fileop_error (fs, buf); - g_error_free (error); - goto out; - } - - if (g_unlink (sys_full_path) < 0) - { - int errsv = errno; - - buf = g_strdup_printf (_("Error deleting file '%s': %s"), - fs->fileop_file, g_strerror (errsv)); - gtk_file_selection_fileop_error (fs, buf); - } - - out: - g_free (full_path); - g_free (sys_full_path); - - gtk_widget_destroy (fs->fileop_dialog); - gtk_file_selection_populate (fs, "", FALSE, TRUE); -} - -static void -gtk_file_selection_delete_file (GtkWidget *widget, - gpointer data) -{ - GtkFileSelection *fs = data; - GtkWidget *dialog; - const gchar *filename; - - g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); - - if (fs->fileop_dialog) - return; - -#ifdef G_WITH_CYGWIN - translate_win32_path (fs); -#endif - - filename = gtk_entry_get_text (GTK_ENTRY (fs->selection_entry)); - if (strlen (filename) < 1) - return; - - g_free (fs->fileop_file); - fs->fileop_file = g_strdup (filename); - - /* main dialog */ - fs->fileop_dialog = dialog = - gtk_message_dialog_new (GTK_WINDOW (fs), - GTK_WINDOW (fs)->modal ? GTK_DIALOG_MODAL : 0, - GTK_MESSAGE_QUESTION, - GTK_BUTTONS_NONE, - _("Really delete file \"%s\"?"), filename); - - g_signal_connect (dialog, "destroy", - G_CALLBACK (gtk_file_selection_fileop_destroy), - fs); - gtk_window_set_title (GTK_WINDOW (dialog), _("Delete File")); - gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE); - - /* buttons */ - gtk_dialog_add_buttons (GTK_DIALOG (dialog), - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_DELETE, GTK_RESPONSE_OK, - NULL); - - gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CANCEL); - - g_signal_connect (dialog, "response", - G_CALLBACK (gtk_file_selection_delete_file_response), - fs); - - gtk_widget_show (dialog); -} - -static void -gtk_file_selection_rename_file_confirmed (GtkWidget *widget, - gpointer data) -{ - GtkFileSelection *fs = data; - gchar *buf; - const gchar *file; - gchar *path; - gchar *new_filename; - gchar *old_filename; - gchar *sys_new_filename; - gchar *sys_old_filename; - CompletionState *cmpl_state; - GError *error = NULL; - - g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); - - file = gtk_entry_get_text (GTK_ENTRY (fs->fileop_entry)); - cmpl_state = (CompletionState*) fs->cmpl_state; - path = cmpl_reference_position (cmpl_state); - - new_filename = g_strconcat (path, G_DIR_SEPARATOR_S, file, NULL); - old_filename = g_strconcat (path, G_DIR_SEPARATOR_S, fs->fileop_file, NULL); - - sys_new_filename = g_filename_from_utf8 (new_filename, -1, NULL, NULL, &error); - if (error) - { - if (g_error_matches (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE)) - buf = g_strdup_printf (_("The filename \"%s\" contains symbols that are not allowed in filenames"), new_filename); - else - buf = g_strdup_printf (_("Error renaming file to \"%s\": %s"), - new_filename, error->message); - gtk_file_selection_fileop_error (fs, buf); - g_error_free (error); - goto out1; - } - - sys_old_filename = g_filename_from_utf8 (old_filename, -1, NULL, NULL, &error); - if (error) - { - if (g_error_matches (error, G_CONVERT_ERROR, G_CONVERT_ERROR_ILLEGAL_SEQUENCE)) - buf = g_strdup_printf (_("The filename \"%s\" contains symbols that are not allowed in filenames"), old_filename); - else - buf = g_strdup_printf (_("Error renaming file \"%s\": %s"), - old_filename, error->message); - gtk_file_selection_fileop_error (fs, buf); - g_error_free (error); - goto out2; - } - - if (g_rename (sys_old_filename, sys_new_filename) < 0) - { - int errsv = errno; - - buf = g_strdup_printf (_("Error renaming file \"%s\" to \"%s\": %s"), - sys_old_filename, sys_new_filename, - g_strerror (errsv)); - gtk_file_selection_fileop_error (fs, buf); - goto out2; - } - - gtk_file_selection_populate (fs, "", FALSE, FALSE); - gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), file); - - out2: - g_free (sys_old_filename); - - out1: - g_free (new_filename); - g_free (old_filename); - g_free (sys_new_filename); - - gtk_widget_destroy (fs->fileop_dialog); -} - -static void -gtk_file_selection_rename_file (GtkWidget *widget, - gpointer data) -{ - GtkFileSelection *fs = data; - GtkWidget *label; - GtkWidget *dialog; - GtkWidget *vbox; - GtkWidget *button; - gchar *buf; - - g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); - - if (fs->fileop_dialog) - return; - - g_free (fs->fileop_file); - fs->fileop_file = g_strdup (gtk_entry_get_text (GTK_ENTRY (fs->selection_entry))); - if (strlen (fs->fileop_file) < 1) - return; - - /* main dialog */ - fs->fileop_dialog = dialog = gtk_dialog_new (); - g_signal_connect (dialog, "destroy", - G_CALLBACK (gtk_file_selection_fileop_destroy), - fs); - gtk_window_set_title (GTK_WINDOW (dialog), _("Rename File")); - gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE); - gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (fs)); - - /* If file dialog is grabbed, grab option dialog */ - /* When option dialog closed, file dialog will be grabbed again */ - if (GTK_WINDOW (fs)->modal) - gtk_window_set_modal (GTK_WINDOW (dialog), TRUE); - - vbox = gtk_vbox_new (FALSE, 0); - gtk_container_set_border_width (GTK_CONTAINER (vbox), 8); - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), vbox, - FALSE, FALSE, 0); - gtk_widget_show(vbox); - - buf = g_strdup_printf (_("Rename file \"%s\" to:"), fs->fileop_file); - label = gtk_label_new (buf); - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0); - gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 5); - gtk_widget_show (label); - g_free (buf); - - /* New filename entry */ - fs->fileop_entry = gtk_entry_new (); - gtk_box_pack_start (GTK_BOX (vbox), fs->fileop_entry, - TRUE, TRUE, 5); - gtk_widget_set_can_default (fs->fileop_entry, TRUE); - gtk_entry_set_activates_default (GTK_ENTRY (fs->fileop_entry), TRUE); - gtk_widget_show (fs->fileop_entry); - - gtk_entry_set_text (GTK_ENTRY (fs->fileop_entry), fs->fileop_file); - gtk_editable_select_region (GTK_EDITABLE (fs->fileop_entry), - 0, strlen (fs->fileop_file)); - - /* buttons */ - button = gtk_dialog_add_button (GTK_DIALOG (dialog), - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL); - g_signal_connect_swapped (button, "clicked", - G_CALLBACK (gtk_widget_destroy), - dialog); - - gtk_widget_grab_focus (fs->fileop_entry); - - button = gtk_dialog_add_button (GTK_DIALOG (dialog), - _("_Rename"), GTK_RESPONSE_OK); - g_signal_connect (button, "clicked", - G_CALLBACK (gtk_file_selection_rename_file_confirmed), - fs); - g_signal_connect (fs->fileop_entry, "changed", - G_CALLBACK (gtk_file_selection_fileop_entry_changed), - button); - - gtk_widget_grab_default (button); - - gtk_widget_show (dialog); -} - -static gint -gtk_file_selection_insert_text (GtkWidget *widget, - const gchar *new_text, - gint new_text_length, - gint *position, - gpointer user_data) -{ - gchar *filename; - - filename = g_filename_from_utf8 (new_text, new_text_length, NULL, NULL, NULL); - - if (!filename) - { - gdk_display_beep (gtk_widget_get_display (widget)); - g_signal_stop_emission_by_name (widget, "insert-text"); - return FALSE; - } - - g_free (filename); - - return TRUE; -} - -static void -gtk_file_selection_update_fileops (GtkFileSelection *fs) -{ - gboolean sensitive; - - if (!fs->selection_entry) - return; - - sensitive = !entry_is_empty (GTK_ENTRY (fs->selection_entry)); - - if (fs->fileop_del_file) - gtk_widget_set_sensitive (fs->fileop_del_file, sensitive); - - if (fs->fileop_ren_file) - gtk_widget_set_sensitive (fs->fileop_ren_file, sensitive); -} - -static gint -gtk_file_selection_key_press (GtkWidget *widget, - GdkEventKey *event, - gpointer user_data) -{ - GtkFileSelection *fs; - char *text; - - g_return_val_if_fail (widget != NULL, FALSE); - g_return_val_if_fail (event != NULL, FALSE); - - if ((event->keyval == GDK_Tab || event->keyval == GDK_KP_Tab) && - (event->state & gtk_accelerator_get_default_mod_mask ()) == 0) - { - fs = GTK_FILE_SELECTION (user_data); -#ifdef G_WITH_CYGWIN - translate_win32_path (fs); -#endif - text = g_strdup (gtk_entry_get_text (GTK_ENTRY (fs->selection_entry))); - - gtk_file_selection_populate (fs, text, TRUE, TRUE); - - g_free (text); - - return TRUE; - } - - return FALSE; -} - -static void -gtk_file_selection_history_callback (GtkWidget *widget, - gpointer data) -{ - GtkFileSelection *fs = data; - HistoryCallbackArg *callback_arg; - GList *list; - - g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); - - list = fs->history_list; - - while (list) { - callback_arg = list->data; - - if (callback_arg->menu_item == widget) - { - gtk_file_selection_populate (fs, callback_arg->directory, FALSE, FALSE); - break; - } - - list = list->next; - } -} - -static void -gtk_file_selection_update_history_menu (GtkFileSelection *fs, - gchar *current_directory) -{ - HistoryCallbackArg *callback_arg; - GtkWidget *menu_item; - GList *list; - gchar *current_dir; - gint dir_len; - gint i; - - g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); - g_return_if_fail (current_directory != NULL); - - list = fs->history_list; - - if (fs->history_menu) - { - while (list) { - callback_arg = list->data; - g_free (callback_arg->directory); - g_free (callback_arg); - list = list->next; - } - g_list_free (fs->history_list); - fs->history_list = NULL; - - gtk_widget_destroy (fs->history_menu); - } - - fs->history_menu = gtk_menu_new (); - - current_dir = g_strdup (current_directory); - - dir_len = strlen (current_dir); - - for (i = dir_len; i >= 0; i--) - { - /* the i == dir_len is to catch the full path for the first - * entry. */ - if ( (current_dir[i] == G_DIR_SEPARATOR) || (i == dir_len)) - { - /* another small hack to catch the full path */ - if (i != dir_len) - current_dir[i + 1] = '\0'; -#ifdef G_WITH_CYGWIN - if (!strcmp (current_dir, "//")) - continue; -#endif - menu_item = gtk_menu_item_new_with_label (current_dir); - - callback_arg = g_new (HistoryCallbackArg, 1); - callback_arg->menu_item = menu_item; - - /* since the autocompletion gets confused if you don't - * supply a trailing '/' on a dir entry, set the full - * (current) path to "" which just refreshes the filesel */ - if (dir_len == i) - { - callback_arg->directory = g_strdup (""); - } - else - { - callback_arg->directory = g_strdup (current_dir); - } - - fs->history_list = g_list_append (fs->history_list, callback_arg); - - g_signal_connect (menu_item, "activate", - G_CALLBACK (gtk_file_selection_history_callback), - fs); - gtk_menu_shell_append (GTK_MENU_SHELL (fs->history_menu), menu_item); - gtk_widget_show (menu_item); - } - } - - gtk_option_menu_set_menu (GTK_OPTION_MENU (fs->history_pulldown), - fs->history_menu); - g_free (current_dir); -} - -static gchar * -get_real_filename (gchar *filename, - gboolean free_old) -{ -#ifdef G_WITH_CYGWIN - /* Check to see if the selection was a drive selector */ - if (isalpha (filename[0]) && (filename[1] == ':')) - { - gchar temp_filename[MAX_PATH]; - int len; - - cygwin_conv_to_posix_path (filename, temp_filename); - - /* we need trailing '/'. */ - len = strlen (temp_filename); - if (len > 0 && temp_filename[len-1] != '/') - { - temp_filename[len] = '/'; - temp_filename[len+1] = '\0'; - } - - if (free_old) - g_free (filename); - - return g_strdup (temp_filename); - } -#endif /* G_WITH_CYGWIN */ - return filename; -} - -static void -gtk_file_selection_file_activate (GtkTreeView *tree_view, - GtkTreePath *path, - GtkTreeViewColumn *column, - gpointer user_data) -{ - GtkFileSelection *fs = GTK_FILE_SELECTION (user_data); - GtkTreeModel *model = gtk_tree_view_get_model (tree_view); - GtkTreeIter iter; - gchar *filename; - - gtk_tree_model_get_iter (model, &iter, path); - gtk_tree_model_get (model, &iter, FILE_COLUMN, &filename, -1); - filename = get_real_filename (filename, TRUE); - gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), filename); - gtk_button_clicked (GTK_BUTTON (fs->ok_button)); - - g_free (filename); -} - -static void -gtk_file_selection_dir_activate (GtkTreeView *tree_view, - GtkTreePath *path, - GtkTreeViewColumn *column, - gpointer user_data) -{ - GtkFileSelection *fs = GTK_FILE_SELECTION (user_data); - GtkTreeModel *model = gtk_tree_view_get_model (tree_view); - GtkTreeIter iter; - gchar *filename; - - gtk_tree_model_get_iter (model, &iter, path); - gtk_tree_model_get (model, &iter, DIR_COLUMN, &filename, -1); - filename = get_real_filename (filename, TRUE); - gtk_file_selection_populate (fs, filename, FALSE, FALSE); - g_free (filename); -} - -#ifdef G_PLATFORM_WIN32 - -static void -win32_gtk_add_drives_to_dir_list (GtkListStore *model) -{ - gchar *textPtr; - gchar buffer[128]; - char formatBuffer[128]; - GtkTreeIter iter; - - /* Get the drives string */ - GetLogicalDriveStrings (sizeof (buffer), buffer); - - /* Add the drives as necessary */ - textPtr = buffer; - while (*textPtr != '\0') - { - /* Ignore floppies (?) */ - if (GetDriveType (textPtr) != DRIVE_REMOVABLE) - { - /* Build the actual displayable string */ - g_snprintf (formatBuffer, sizeof (formatBuffer), "%c:\\", toupper (textPtr[0])); - - /* Add to the list */ - gtk_list_store_append (model, &iter); - gtk_list_store_set (model, &iter, DIR_COLUMN, formatBuffer, -1); - } - textPtr += (strlen (textPtr) + 1); - } -} -#endif - -static gchar * -escape_underscores (const gchar *str) -{ - GString *result = g_string_new (NULL); - while (*str) - { - if (*str == '_') - g_string_append_c (result, '_'); - - g_string_append_c (result, *str); - str++; - } - - return g_string_free (result, FALSE); -} - -static void -gtk_file_selection_populate (GtkFileSelection *fs, - gchar *rel_path, - gboolean try_complete, - gboolean reset_entry) -{ - CompletionState *cmpl_state; - PossibleCompletion* poss; - GtkTreeIter iter; - GtkListStore *dir_model; - GtkListStore *file_model; - gchar* filename; - gchar* rem_path = rel_path; - gchar* sel_text; - gint did_recurse = FALSE; - gint possible_count = 0; - - g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); - - cmpl_state = (CompletionState*) fs->cmpl_state; - poss = cmpl_completion_matches (rel_path, &rem_path, cmpl_state); - - if (!cmpl_state_okay (cmpl_state)) - { - /* Something went wrong. */ - gtk_file_selection_abort (fs); - return; - } - - g_assert (cmpl_state->reference_dir); - - dir_model = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (fs->dir_list))); - file_model = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (fs->file_list))); - - gtk_list_store_clear (dir_model); - gtk_list_store_clear (file_model); - - /* Set the dir list to include ./ and ../ */ - gtk_list_store_append (dir_model, &iter); - gtk_list_store_set (dir_model, &iter, DIR_COLUMN, "." G_DIR_SEPARATOR_S, -1); - gtk_list_store_append (dir_model, &iter); - gtk_list_store_set (dir_model, &iter, DIR_COLUMN, ".." G_DIR_SEPARATOR_S, -1); - - while (poss) - { - if (cmpl_is_a_completion (poss)) - { - possible_count += 1; - - filename = cmpl_this_completion (poss); - - if (cmpl_is_directory (poss)) - { - if (strcmp (filename, "." G_DIR_SEPARATOR_S) != 0 && - strcmp (filename, ".." G_DIR_SEPARATOR_S) != 0) - { - gtk_list_store_append (dir_model, &iter); - gtk_list_store_set (dir_model, &iter, DIR_COLUMN, filename, -1); - } - } - else - { - gtk_list_store_append (file_model, &iter); - gtk_list_store_set (file_model, &iter, DIR_COLUMN, filename, -1); - } - } - - poss = cmpl_next_completion (cmpl_state); - } - -#ifdef G_PLATFORM_WIN32 - /* For Windows, add drives as potential selections */ - win32_gtk_add_drives_to_dir_list (dir_model); -#endif - - /* File lists are set. */ - - g_assert (cmpl_state->reference_dir); - - if (try_complete) - { - - /* User is trying to complete filenames, so advance the user's input - * string to the updated_text, which is the common leading substring - * of all possible completions, and if its a directory attempt - * attempt completions in it. */ - - if (cmpl_updated_text (cmpl_state)[0]) - { - - if (cmpl_updated_dir (cmpl_state)) - { - gchar* dir_name = g_strdup (cmpl_updated_text (cmpl_state)); - - did_recurse = TRUE; - - gtk_file_selection_populate (fs, dir_name, TRUE, TRUE); - - g_free (dir_name); - } - else - { - if (fs->selection_entry) - gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), - cmpl_updated_text (cmpl_state)); - } - } - else - { - if (fs->selection_entry) - gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), rem_path); - } - } - else if (reset_entry) - { - if (fs->selection_entry) - gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), ""); - } - - if (!did_recurse) - { - if (fs->selection_entry && try_complete) - gtk_editable_set_position (GTK_EDITABLE (fs->selection_entry), -1); - - if (fs->selection_entry) - { - char *escaped = escape_underscores (cmpl_reference_position (cmpl_state)); - sel_text = g_strconcat (_("_Selection: "), escaped, NULL); - g_free (escaped); - - gtk_label_set_text_with_mnemonic (GTK_LABEL (fs->selection_text), sel_text); - g_free (sel_text); - } - - if (fs->history_pulldown) - { - gtk_file_selection_update_history_menu (fs, cmpl_reference_position (cmpl_state)); - } - - } -} - -static void -gtk_file_selection_abort (GtkFileSelection *fs) -{ - gchar err_buf[256]; - - g_snprintf (err_buf, sizeof (err_buf), _("Folder unreadable: %s"), cmpl_strerror (cmpl_errno)); - - /* BEEP gdk_beep(); */ - - if (fs->selection_entry) - gtk_label_set_text (GTK_LABEL (fs->selection_text), err_buf); -} - -/** - * gtk_file_selection_set_select_multiple: - * @filesel: a #GtkFileSelection - * @select_multiple: whether or not the user is allowed to select multiple - * files in the file list. - * - * Sets whether the user is allowed to select multiple files in the file list. - * Use gtk_file_selection_get_selections () to get the list of selected files. - **/ -void -gtk_file_selection_set_select_multiple (GtkFileSelection *filesel, - gboolean select_multiple) -{ - GtkTreeSelection *sel; - GtkSelectionMode mode; - - g_return_if_fail (GTK_IS_FILE_SELECTION (filesel)); - - sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (filesel->file_list)); - - mode = select_multiple ? GTK_SELECTION_MULTIPLE : GTK_SELECTION_SINGLE; - - if (mode != gtk_tree_selection_get_mode (sel)) - { - gtk_tree_selection_set_mode (sel, mode); - - g_object_notify (G_OBJECT (filesel), "select-multiple"); - } -} - -/** - * gtk_file_selection_get_select_multiple: - * @filesel: a #GtkFileSelection - * - * Determines whether or not the user is allowed to select multiple files in - * the file list. See gtk_file_selection_set_select_multiple(). - * - * Return value: %TRUE if the user is allowed to select multiple files in the - * file list - **/ -gboolean -gtk_file_selection_get_select_multiple (GtkFileSelection *filesel) -{ - GtkTreeSelection *sel; - - g_return_val_if_fail (GTK_IS_FILE_SELECTION (filesel), FALSE); - - sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (filesel->file_list)); - return (gtk_tree_selection_get_mode (sel) == GTK_SELECTION_MULTIPLE); -} - -static void -multiple_changed_foreach (GtkTreeModel *model, - GtkTreePath *path, - GtkTreeIter *iter, - gpointer data) -{ - GPtrArray *names = data; - gchar *filename; - - gtk_tree_model_get (model, iter, FILE_COLUMN, &filename, -1); - - g_ptr_array_add (names, filename); -} - -static void -free_selected_names (GPtrArray *names) -{ - gint i; - - for (i = 0; i < names->len; i++) - g_free (g_ptr_array_index (names, i)); - - g_ptr_array_free (names, TRUE); -} - -static void -gtk_file_selection_file_changed (GtkTreeSelection *selection, - gpointer user_data) -{ - GtkFileSelection *fs = GTK_FILE_SELECTION (user_data); - GPtrArray *new_names; - gchar *filename; - const gchar *entry; - gint index = -1; - - new_names = g_ptr_array_sized_new (8); - - gtk_tree_selection_selected_foreach (selection, - multiple_changed_foreach, - new_names); - - /* nothing selected */ - if (new_names->len == 0) - { - g_ptr_array_free (new_names, TRUE); - - if (fs->selected_names != NULL) - { - free_selected_names (fs->selected_names); - fs->selected_names = NULL; - } - - goto maybe_clear_entry; - } - - if (new_names->len != 1) - { - GPtrArray *old_names = fs->selected_names; - - if (old_names != NULL) - { - /* A common case is selecting a range of files from top to bottom, - * so quickly check for that to avoid looping over the entire list - */ - if (compare_utf8_filenames (g_ptr_array_index (old_names, old_names->len - 1), - g_ptr_array_index (new_names, new_names->len - 1)) != 0) - index = new_names->len - 1; - else - { - gint i = 0, j = 0, cmp; - - /* do a quick diff, stopping at the first file not in the - * old list - */ - while (i < old_names->len && j < new_names->len) - { - cmp = compare_utf8_filenames (g_ptr_array_index (old_names, i), - g_ptr_array_index (new_names, j)); - if (cmp < 0) - { - i++; - } - else if (cmp == 0) - { - i++; - j++; - } - else if (cmp > 0) - { - index = j; - break; - } - } - - /* we ran off the end of the old list */ - if (index == -1 && i < new_names->len) - index = j; - } - } - else - { - /* A phantom anchor still exists at the point where the last item - * was selected, which is used for subsequent range selections. - * So search up from there. - */ - if (fs->last_selected && - compare_utf8_filenames (fs->last_selected, - g_ptr_array_index (new_names, 0)) == 0) - index = new_names->len - 1; - else - index = 0; - } - } - else - index = 0; - - if (fs->selected_names != NULL) - free_selected_names (fs->selected_names); - - fs->selected_names = new_names; - - if (index != -1) - { - g_free (fs->last_selected); - - fs->last_selected = g_strdup (g_ptr_array_index (new_names, index)); - filename = get_real_filename (fs->last_selected, FALSE); - - gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), filename); - - if (filename != fs->last_selected) - g_free (filename); - - return; - } - -maybe_clear_entry: - - entry = gtk_entry_get_text (GTK_ENTRY (fs->selection_entry)); - if ((entry != NULL) && (fs->last_selected != NULL) && - (compare_utf8_filenames (entry, fs->last_selected) == 0)) - gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), ""); -} - -/** - * gtk_file_selection_get_selections: - * @filesel: a #GtkFileSelection - * - * Retrieves the list of file selections the user has made in the dialog box. - * This function is intended for use when the user can select multiple files - * in the file list. - * - * The filenames are in the GLib file name encoding. To convert to - * UTF-8, call g_filename_to_utf8() on each string. - * - * Return value: a newly-allocated %NULL-terminated array of strings. Use - * g_strfreev() to free it. - **/ -gchar ** -gtk_file_selection_get_selections (GtkFileSelection *filesel) -{ - GPtrArray *names; - gchar **selections; - gchar *filename, *dirname; - gchar *current, *buf; - gint i, count; - gboolean unselected_entry; - - g_return_val_if_fail (GTK_IS_FILE_SELECTION (filesel), NULL); - - filename = g_strdup (gtk_file_selection_get_filename (filesel)); - - if (strlen (filename) == 0) - { - g_free (filename); - return NULL; - } - - names = filesel->selected_names; - - if (names != NULL) - selections = g_new (gchar *, names->len + 2); - else - selections = g_new (gchar *, 2); - - count = 0; - unselected_entry = TRUE; - - if (names != NULL) - { - dirname = g_path_get_dirname (filename); - - if ((names->len >= 1) && - (strcmp (gtk_entry_get_text (GTK_ENTRY (filesel->selection_entry)), "") == 0)) - { /* multiple files are selected and last selection was removed via ctrl click */ - g_free (dirname); - dirname = g_strdup (filename); /* as gtk_file_selection_get_filename returns dir - if no file is selected */ - unselected_entry = FALSE; - } - - for (i = 0; i < names->len; i++) - { - buf = g_filename_from_utf8 (g_ptr_array_index (names, i), -1, - NULL, NULL, NULL); - current = g_build_filename (dirname, buf, NULL); - g_free (buf); - - selections[count++] = current; - - if (unselected_entry && compare_sys_filenames (current, filename) == 0) - unselected_entry = FALSE; - } - - g_free (dirname); - } - - if (unselected_entry) - selections[count++] = filename; - else - g_free (filename); - - selections[count] = NULL; - - return selections; -} - -/**********************************************************************/ -/* External Interface */ -/**********************************************************************/ - -/* The four completion state selectors - */ -static gchar* -cmpl_updated_text (CompletionState *cmpl_state) -{ - return cmpl_state->updated_text; -} - -static gboolean -cmpl_updated_dir (CompletionState *cmpl_state) -{ - return cmpl_state->re_complete; -} - -static gchar* -cmpl_reference_position (CompletionState *cmpl_state) -{ - return cmpl_state->reference_dir->fullname; -} - -#if 0 -/* This doesn't work currently and would require changes - * to fnmatch.c to get working. - */ -static gint -cmpl_last_valid_char (CompletionState *cmpl_state) -{ - return cmpl_state->last_valid_char; -} -#endif - -static gchar* -cmpl_completion_fullname (const gchar *text, - CompletionState *cmpl_state) -{ - if (!cmpl_state_okay (cmpl_state)) - { - return g_strdup (""); - } - else if (g_path_is_absolute (text)) - { - return g_strdup (text); - } -#ifdef HAVE_PWD_H - else if (text[0] == '~') - { - CompletionDir* dir; - char* slash; - - dir = open_user_dir (text, cmpl_state); - - if (dir) - { - slash = strchr (text, G_DIR_SEPARATOR); - - /* slash may be NULL, that works too */ - return g_strconcat (dir->fullname, slash, NULL); - } - } -#endif - - return g_build_filename (cmpl_state->reference_dir->fullname, - text, - NULL); -} - -/* The three completion selectors - */ -static gchar* -cmpl_this_completion (PossibleCompletion* pc) -{ - return pc->text; -} - -static gboolean -cmpl_is_directory (PossibleCompletion* pc) -{ - return pc->is_directory; -} - -static gint -cmpl_is_a_completion (PossibleCompletion* pc) -{ - return pc->is_a_completion; -} - -/**********************************************************************/ -/* Construction, deletion */ -/**********************************************************************/ - -/* Get the nearest parent of the current directory for which - * we can convert the filename into UTF-8. With paranoia. - * Returns "." when all goes wrong. - */ -static gchar * -get_current_dir_utf8 (void) -{ - gchar *dir = g_get_current_dir (); - gchar *dir_utf8 = NULL; - - while (TRUE) - { - gchar *last_slash; - - dir_utf8 = g_filename_to_utf8 (dir, -1, NULL, NULL, NULL); - if (dir_utf8) - break; - - last_slash = strrchr (dir, G_DIR_SEPARATOR); - if (!last_slash) /* g_get_current_dir() wasn't absolute! */ - break; - - if (last_slash + 1 == g_path_skip_root (dir)) /* Parent directory is a root directory */ - { - if (last_slash[1] == '\0') /* Root misencoded! */ - break; - else - last_slash[1] = '\0'; - } - else - last_slash[0] = '\0'; - - g_assert (last_slash); - } - - g_free (dir); - - return dir_utf8 ? dir_utf8 : g_strdup ("."); -} - -static CompletionState* -cmpl_init_state (void) -{ - gchar *utf8_cwd; - CompletionState *new_state; - gint tries = 0; - - new_state = g_new (CompletionState, 1); - - utf8_cwd = get_current_dir_utf8 (); - -tryagain: - tries++; - new_state->reference_dir = NULL; - new_state->completion_dir = NULL; - new_state->active_completion_dir = NULL; - new_state->directory_storage = NULL; - new_state->directory_sent_storage = NULL; - new_state->last_valid_char = 0; - new_state->updated_text = g_new (gchar, MAXPATHLEN); - new_state->updated_text_alloc = MAXPATHLEN; - new_state->the_completion.text = g_new (gchar, MAXPATHLEN); - new_state->the_completion.text_alloc = MAXPATHLEN; - new_state->user_dir_name_buffer = NULL; - new_state->user_directories = NULL; - - new_state->reference_dir = open_dir (utf8_cwd, new_state); - - if (!new_state->reference_dir) - { - /* Directories changing from underneath us, grumble */ - strcpy (utf8_cwd, G_DIR_SEPARATOR_S); - if (tries < 2) - goto tryagain; - } - - g_free (utf8_cwd); - return new_state; -} - -static void -cmpl_free_dir_list (GList* dp0) -{ - GList *dp = dp0; - - while (dp) - { - free_dir (dp->data); - dp = dp->next; - } - - g_list_free (dp0); -} - -static void -cmpl_free_dir_sent_list (GList* dp0) -{ - GList *dp = dp0; - - while (dp) - { - free_dir_sent (dp->data); - dp = dp->next; - } - - g_list_free (dp0); -} - -static void -cmpl_free_state (CompletionState* cmpl_state) -{ - g_return_if_fail (cmpl_state != NULL); - - cmpl_free_dir_list (cmpl_state->directory_storage); - cmpl_free_dir_sent_list (cmpl_state->directory_sent_storage); - - g_free (cmpl_state->user_dir_name_buffer); - g_free (cmpl_state->user_directories); - g_free (cmpl_state->the_completion.text); - g_free (cmpl_state->updated_text); - - g_free (cmpl_state); -} - -static void -free_dir (CompletionDir* dir) -{ - g_free (dir->cmpl_text); - g_free (dir->fullname); - g_free (dir); -} - -static void -free_dir_sent (CompletionDirSent* sent) -{ - gint i; - for (i = 0; i < sent->entry_count; i++) - { - g_free (sent->entries[i].entry_name); - g_free (sent->entries[i].sort_key); - } - g_free (sent->entries); - g_free (sent); -} - -static void -prune_memory_usage (CompletionState *cmpl_state) -{ - GList* cdsl = cmpl_state->directory_sent_storage; - GList* cdl = cmpl_state->directory_storage; - GList* cdl0 = cdl; - gint len = 0; - - for (; cdsl && len < CMPL_DIRECTORY_CACHE_SIZE; len += 1) - cdsl = cdsl->next; - - if (cdsl) - { - cmpl_free_dir_sent_list (cdsl->next); - cdsl->next = NULL; - } - - cmpl_state->directory_storage = NULL; - while (cdl) - { - if (cdl->data == cmpl_state->reference_dir) - cmpl_state->directory_storage = g_list_prepend (NULL, cdl->data); - else - free_dir (cdl->data); - cdl = cdl->next; - } - - g_list_free (cdl0); -} - -/**********************************************************************/ -/* The main entrances. */ -/**********************************************************************/ - -static PossibleCompletion* -cmpl_completion_matches (gchar *text_to_complete, - gchar **remaining_text, - CompletionState *cmpl_state) -{ -#ifdef HAVE_PWD_H - gchar* first_slash; -#endif - PossibleCompletion *poss; - - prune_memory_usage (cmpl_state); - - g_assert (text_to_complete != NULL); - - cmpl_state->user_completion_index = -1; - cmpl_state->last_completion_text = text_to_complete; - cmpl_state->the_completion.text[0] = 0; - cmpl_state->last_valid_char = 0; - cmpl_state->updated_text_len = -1; - cmpl_state->updated_text[0] = 0; - cmpl_state->re_complete = FALSE; - -#ifdef HAVE_PWD_H - first_slash = strchr (text_to_complete, G_DIR_SEPARATOR); - - if (text_to_complete[0] == '~' && !first_slash) - { - /* Text starts with ~ and there is no slash, show all the - * home directory completions. - */ - poss = attempt_homedir_completion (text_to_complete, cmpl_state); - - update_cmpl (poss, cmpl_state); - - return poss; - } -#endif - cmpl_state->reference_dir = - open_ref_dir (text_to_complete, remaining_text, cmpl_state); - - if (!cmpl_state->reference_dir) - return NULL; - - cmpl_state->completion_dir = - find_completion_dir (*remaining_text, remaining_text, cmpl_state); - - cmpl_state->last_valid_char = *remaining_text - text_to_complete; - - if (!cmpl_state->completion_dir) - return NULL; - - cmpl_state->completion_dir->cmpl_index = -1; - cmpl_state->completion_dir->cmpl_parent = NULL; - cmpl_state->completion_dir->cmpl_text = g_strdup (*remaining_text); - - cmpl_state->active_completion_dir = cmpl_state->completion_dir; - - cmpl_state->reference_dir = cmpl_state->completion_dir; - - poss = attempt_file_completion (cmpl_state); - - update_cmpl (poss, cmpl_state); - - return poss; -} - -static PossibleCompletion* -cmpl_next_completion (CompletionState* cmpl_state) -{ - PossibleCompletion* poss = NULL; - - cmpl_state->the_completion.text[0] = 0; - -#ifdef HAVE_PWD_H - if (cmpl_state->user_completion_index >= 0) - poss = attempt_homedir_completion (cmpl_state->last_completion_text, cmpl_state); - else - poss = attempt_file_completion (cmpl_state); -#else - poss = attempt_file_completion (cmpl_state); -#endif - - update_cmpl (poss, cmpl_state); - - return poss; -} - -/**********************************************************************/ -/* Directory Operations */ -/**********************************************************************/ - -/* Open the directory where completion will begin from, if possible. */ -static CompletionDir* -open_ref_dir (gchar *text_to_complete, - gchar **remaining_text, - CompletionState *cmpl_state) -{ - gchar* first_slash; - CompletionDir *new_dir; - - first_slash = strchr (text_to_complete, G_DIR_SEPARATOR); - -#ifdef G_WITH_CYGWIN - if (text_to_complete[0] == '/' && text_to_complete[1] == '/') - { - char root_dir[5]; - g_snprintf (root_dir, sizeof (root_dir), "//%c", text_to_complete[2]); - - new_dir = open_dir (root_dir, cmpl_state); - - if (new_dir) { - *remaining_text = text_to_complete + 4; - } - } -#else - if (FALSE) - ; -#endif -#ifdef HAVE_PWD_H - else if (text_to_complete[0] == '~') - { - new_dir = open_user_dir (text_to_complete, cmpl_state); - - if (new_dir) - { - if (first_slash) - *remaining_text = first_slash + 1; - else - *remaining_text = text_to_complete + strlen (text_to_complete); - } - else - { - return NULL; - } - } -#endif - else if (g_path_is_absolute (text_to_complete) || !cmpl_state->reference_dir) - { - gchar *tmp = g_strdup (text_to_complete); - gchar *p; - - p = tmp; - while (*p && *p != '*' && *p != '?') - p++; - - *p = '\0'; - p = strrchr (tmp, G_DIR_SEPARATOR); - if (p) - { - if (p + 1 == g_path_skip_root (tmp)) - p++; - - *p = '\0'; - new_dir = open_dir (tmp, cmpl_state); - - if (new_dir) - *remaining_text = text_to_complete + - ((p == g_path_skip_root (tmp)) ? (p - tmp) : (p + 1 - tmp)); - } - else - { - /* If no possible candidates, use the cwd */ - gchar *utf8_curdir = get_current_dir_utf8 (); - - new_dir = open_dir (utf8_curdir, cmpl_state); - - if (new_dir) - *remaining_text = text_to_complete; - - g_free (utf8_curdir); - } - - g_free (tmp); - } - else - { - *remaining_text = text_to_complete; - - new_dir = open_dir (cmpl_state->reference_dir->fullname, cmpl_state); - } - - if (new_dir) - { - new_dir->cmpl_index = -1; - new_dir->cmpl_parent = NULL; - } - - return new_dir; -} - -#ifdef HAVE_PWD_H - -/* open a directory by user name */ -static CompletionDir* -open_user_dir (const gchar *text_to_complete, - CompletionState *cmpl_state) -{ - CompletionDir *result; - gchar *first_slash; - gint cmp_len; - - g_assert (text_to_complete && text_to_complete[0] == '~'); - - first_slash = strchr (text_to_complete, G_DIR_SEPARATOR); - - if (first_slash) - cmp_len = first_slash - text_to_complete - 1; - else - cmp_len = strlen (text_to_complete + 1); - - if (!cmp_len) - { - /* ~/ */ - const gchar *homedir = g_get_home_dir (); - gchar *utf8_homedir = g_filename_to_utf8 (homedir, -1, NULL, NULL, NULL); - - if (utf8_homedir) - result = open_dir (utf8_homedir, cmpl_state); - else - result = NULL; - - g_free (utf8_homedir); - } - else - { - /* ~user/ */ - gchar* copy = g_new (char, cmp_len + 1); - gchar *utf8_dir; - struct passwd *pwd; - - strncpy (copy, text_to_complete + 1, cmp_len); - copy[cmp_len] = 0; - pwd = getpwnam (copy); - g_free (copy); - if (!pwd) - { - cmpl_errno = errno; - return NULL; - } - utf8_dir = g_filename_to_utf8 (pwd->pw_dir, -1, NULL, NULL, NULL); - result = open_dir (utf8_dir, cmpl_state); - g_free (utf8_dir); - } - return result; -} - -#endif - -/* open a directory relative to the current relative directory */ -static CompletionDir* -open_relative_dir (gchar *dir_name, - CompletionDir *dir, - CompletionState *cmpl_state) -{ - CompletionDir *result; - GString *path; - - path = g_string_sized_new (dir->fullname_len + strlen (dir_name) + 10); - g_string_assign (path, dir->fullname); - - if (dir->fullname_len > 1 - && path->str[dir->fullname_len - 1] != G_DIR_SEPARATOR) - g_string_append_c (path, G_DIR_SEPARATOR); - g_string_append (path, dir_name); - - result = open_dir (path->str, cmpl_state); - - g_string_free (path, TRUE); - - return result; -} - -/* after the cache lookup fails, really open a new directory */ -static CompletionDirSent* -open_new_dir (gchar *dir_name, - struct stat *sbuf, - gboolean stat_subdirs) -{ - CompletionDirSent *sent; - GDir *directory; - const char *dirent; - GError *error = NULL; - gint entry_count = 0; - gint n_entries = 0; - gint i; - struct stat ent_sbuf; - GString *path; - gchar *sys_dir_name; - - sent = g_new (CompletionDirSent, 1); -#ifndef G_PLATFORM_WIN32 - sent->mtime = sbuf->st_mtime; - sent->inode = sbuf->st_ino; - sent->device = sbuf->st_dev; -#endif - path = g_string_sized_new (2*MAXPATHLEN + 10); - - sys_dir_name = g_filename_from_utf8 (dir_name, -1, NULL, NULL, NULL); - if (!sys_dir_name) - { - cmpl_errno = CMPL_ERRNO_DID_NOT_CONVERT; - g_free (sent); - return NULL; - } - - directory = g_dir_open (sys_dir_name, 0, &error); - if (!directory) - { - cmpl_errno = error->code; /* ??? */ - g_free (sys_dir_name); - g_free (sent); - return NULL; - } - - while ((dirent = g_dir_read_name (directory)) != NULL) - entry_count++; - entry_count += 2; /* For ".",".." */ - - sent->entries = g_new (CompletionDirEntry, entry_count); - sent->entry_count = entry_count; - - g_dir_rewind (directory); - - for (i = 0; i < entry_count; i += 1) - { - GError *error = NULL; - - if (i == 0) - dirent = "."; - else if (i == 1) - dirent = ".."; - else - { - dirent = g_dir_read_name (directory); - if (!dirent) /* Directory changed */ - break; - } - - sent->entries[n_entries].entry_name = g_filename_to_utf8 (dirent, -1, NULL, NULL, &error); - if (sent->entries[n_entries].entry_name == NULL - || !g_utf8_validate (sent->entries[n_entries].entry_name, -1, NULL)) - { - gchar *escaped_str = g_strescape (dirent, NULL); - g_message (_("The filename \"%s\" couldn't be converted to UTF-8. " - "(try setting the environment variable G_FILENAME_ENCODING): %s"), - escaped_str, - error->message ? error->message : _("Invalid UTF-8")); - g_free (escaped_str); - g_clear_error (&error); - continue; - } - g_clear_error (&error); - - sent->entries[n_entries].sort_key = g_utf8_collate_key (sent->entries[n_entries].entry_name, -1); - - g_string_assign (path, sys_dir_name); - if (path->str[path->len-1] != G_DIR_SEPARATOR) - { - g_string_append_c (path, G_DIR_SEPARATOR); - } - g_string_append (path, dirent); - - if (stat_subdirs) - { - /* Here we know path->str is a "system charset" string */ - if (g_stat (path->str, &ent_sbuf) >= 0 && S_ISDIR (ent_sbuf.st_mode)) - sent->entries[n_entries].is_dir = TRUE; - else - /* stat may fail, and we don't mind, since it could be a - * dangling symlink. */ - sent->entries[n_entries].is_dir = FALSE; - } - else - sent->entries[n_entries].is_dir = 1; - - n_entries++; - } - sent->entry_count = n_entries; - - g_free (sys_dir_name); - g_string_free (path, TRUE); - qsort (sent->entries, sent->entry_count, sizeof (CompletionDirEntry), compare_cmpl_dir); - - g_dir_close (directory); - - return sent; -} - -#ifndef G_PLATFORM_WIN32 - -static gboolean -check_dir (gchar *dir_name, - struct stat *result, - gboolean *stat_subdirs) -{ - /* A list of directories that we know only contain other directories. - * Trying to stat every file in these directories would be very - * expensive. - */ - - static struct { - const gchar name[5]; - gboolean present; - struct stat statbuf; - } no_stat_dirs[] = { - { "/afs", FALSE, { 0 } }, - { "/net", FALSE, { 0 } } - }; - - static const gint n_no_stat_dirs = G_N_ELEMENTS (no_stat_dirs); - static gboolean initialized = FALSE; - gchar *sys_dir_name; - gint i; - - if (!initialized) - { - initialized = TRUE; - for (i = 0; i < n_no_stat_dirs; i++) - { - if (g_stat (no_stat_dirs[i].name, &no_stat_dirs[i].statbuf) == 0) - no_stat_dirs[i].present = TRUE; - } - } - - sys_dir_name = g_filename_from_utf8 (dir_name, -1, NULL, NULL, NULL); - if (!sys_dir_name) - { - cmpl_errno = CMPL_ERRNO_DID_NOT_CONVERT; - return FALSE; - } - - if (g_stat (sys_dir_name, result) < 0) - { - g_free (sys_dir_name); - cmpl_errno = errno; - return FALSE; - } - g_free (sys_dir_name); - - *stat_subdirs = TRUE; - for (i = 0; i < n_no_stat_dirs; i++) - { - if (no_stat_dirs[i].present && - (no_stat_dirs[i].statbuf.st_dev == result->st_dev) && - (no_stat_dirs[i].statbuf.st_ino == result->st_ino)) - { - *stat_subdirs = FALSE; - break; - } - } - - return TRUE; -} - -#endif - -/* open a directory by absolute pathname */ -static CompletionDir* -open_dir (gchar *dir_name, - CompletionState *cmpl_state) -{ -#ifndef G_PLATFORM_WIN32 - struct stat sbuf; - gboolean stat_subdirs; - GList* cdsl; -#endif - CompletionDirSent *sent; - -#ifndef G_PLATFORM_WIN32 - if (!check_dir (dir_name, &sbuf, &stat_subdirs)) - return NULL; - - cdsl = cmpl_state->directory_sent_storage; - - while (cdsl) - { - sent = cdsl->data; - - if (sent->inode == sbuf.st_ino && - sent->mtime == sbuf.st_mtime && - sent->device == sbuf.st_dev) - return attach_dir (sent, dir_name, cmpl_state); - - cdsl = cdsl->next; - } - - sent = open_new_dir (dir_name, &sbuf, stat_subdirs); -#else - sent = open_new_dir (dir_name, NULL, TRUE); -#endif - - if (sent) - { - cmpl_state->directory_sent_storage = - g_list_prepend (cmpl_state->directory_sent_storage, sent); - - return attach_dir (sent, dir_name, cmpl_state); - } - - return NULL; -} - -static CompletionDir* -attach_dir (CompletionDirSent *sent, - gchar *dir_name, - CompletionState *cmpl_state) -{ - CompletionDir* new_dir; - - new_dir = g_new (CompletionDir, 1); - - cmpl_state->directory_storage = - g_list_prepend (cmpl_state->directory_storage, new_dir); - - new_dir->sent = sent; - new_dir->fullname = g_strdup (dir_name); - new_dir->fullname_len = strlen (dir_name); - new_dir->cmpl_text = NULL; - - return new_dir; -} - -static gint -correct_dir_fullname (CompletionDir* cmpl_dir) -{ - gint length = strlen (cmpl_dir->fullname); - gchar *first_slash = strchr (cmpl_dir->fullname, G_DIR_SEPARATOR); - gchar *sys_filename; - struct stat sbuf; - - /* Does it end with /. (\.) ? */ - if (length >= 2 && - strcmp (cmpl_dir->fullname + length - 2, G_DIR_SEPARATOR_S ".") == 0) - { - /* Is it just the root directory (on a drive) ? */ - if (cmpl_dir->fullname + length - 2 == first_slash) - { - cmpl_dir->fullname[length - 1] = 0; - cmpl_dir->fullname_len = length - 1; - return TRUE; - } - else - { - cmpl_dir->fullname[length - 2] = 0; - } - } - - /* Ends with /./ (\.\)? */ - else if (length >= 3 && - strcmp (cmpl_dir->fullname + length - 3, - G_DIR_SEPARATOR_S "." G_DIR_SEPARATOR_S) == 0) - cmpl_dir->fullname[length - 2] = 0; - - /* Ends with /.. (\..) ? */ - else if (length >= 3 && - strcmp (cmpl_dir->fullname + length - 3, - G_DIR_SEPARATOR_S "..") == 0) - { - /* Is it just /.. (X:\..)? */ - if (cmpl_dir->fullname + length - 3 == first_slash) - { - cmpl_dir->fullname[length - 2] = 0; - cmpl_dir->fullname_len = length - 2; - return TRUE; - } - - sys_filename = g_filename_from_utf8 (cmpl_dir->fullname, -1, NULL, NULL, NULL); - if (!sys_filename) - { - cmpl_errno = CMPL_ERRNO_DID_NOT_CONVERT; - return FALSE; - } - - if (g_stat (sys_filename, &sbuf) < 0) - { - g_free (sys_filename); - cmpl_errno = errno; - return FALSE; - } - g_free (sys_filename); - - cmpl_dir->fullname[length - 3] = 0; - - if (!correct_parent (cmpl_dir, &sbuf)) - return FALSE; - } - - /* Ends with /../ (\..\)? */ - else if (length >= 4 && - strcmp (cmpl_dir->fullname + length - 4, - G_DIR_SEPARATOR_S ".." G_DIR_SEPARATOR_S) == 0) - { - /* Is it just /../ (X:\..\)? */ - if (cmpl_dir->fullname + length - 4 == first_slash) - { - cmpl_dir->fullname[length - 3] = 0; - cmpl_dir->fullname_len = length - 3; - return TRUE; - } - - sys_filename = g_filename_from_utf8 (cmpl_dir->fullname, -1, NULL, NULL, NULL); - if (!sys_filename) - { - cmpl_errno = CMPL_ERRNO_DID_NOT_CONVERT; - return FALSE; - } - - if (g_stat (sys_filename, &sbuf) < 0) - { - g_free (sys_filename); - cmpl_errno = errno; - return FALSE; - } - g_free (sys_filename); - - cmpl_dir->fullname[length - 4] = 0; - - if (!correct_parent (cmpl_dir, &sbuf)) - return FALSE; - } - - cmpl_dir->fullname_len = strlen (cmpl_dir->fullname); - - return TRUE; -} - -static gint -correct_parent (CompletionDir *cmpl_dir, - struct stat *sbuf) -{ - struct stat parbuf; - gchar *last_slash; - gchar *first_slash; -#ifndef G_PLATFORM_WIN32 - gchar *new_name; -#endif - gchar *sys_filename; - gchar c = 0; - - last_slash = strrchr (cmpl_dir->fullname, G_DIR_SEPARATOR); - g_assert (last_slash); - first_slash = strchr (cmpl_dir->fullname, G_DIR_SEPARATOR); - - /* Clever (?) way to check for top-level directory that works also on - * Win32, where there is a drive letter and colon prefixed... - */ - if (last_slash != first_slash) - { - last_slash[0] = 0; - } - else - { - c = last_slash[1]; - last_slash[1] = 0; - } - - sys_filename = g_filename_from_utf8 (cmpl_dir->fullname, -1, NULL, NULL, NULL); - if (!sys_filename) - { - cmpl_errno = CMPL_ERRNO_DID_NOT_CONVERT; - if (!c) - last_slash[0] = G_DIR_SEPARATOR; - return FALSE; - } - - if (g_stat (sys_filename, &parbuf) < 0) - { - g_free (sys_filename); - cmpl_errno = errno; - if (!c) - last_slash[0] = G_DIR_SEPARATOR; - return FALSE; - } - g_free (sys_filename); - -#ifndef G_PLATFORM_WIN32 /* No inode numbers on Win32 */ - if (parbuf.st_ino == sbuf->st_ino && parbuf.st_dev == sbuf->st_dev) - /* it wasn't a link */ - return TRUE; - - if (c) - last_slash[1] = c; - else - last_slash[0] = G_DIR_SEPARATOR; - - /* it was a link, have to figure it out the hard way */ - - new_name = find_parent_dir_fullname (cmpl_dir->fullname); - - if (!new_name) - return FALSE; - - g_free (cmpl_dir->fullname); - - cmpl_dir->fullname = new_name; -#endif - - return TRUE; -} - -#ifndef G_PLATFORM_WIN32 - -static gchar* -find_parent_dir_fullname (gchar* dirname) -{ - gchar *sys_orig_dir; - gchar *result; - gchar *sys_cwd; - gchar *sys_dirname; - - sys_orig_dir = g_get_current_dir (); - sys_dirname = g_filename_from_utf8 (dirname, -1, NULL, NULL, NULL); - if (!sys_dirname) - { - g_free (sys_orig_dir); - cmpl_errno = CMPL_ERRNO_DID_NOT_CONVERT; - return NULL; - } - - if (chdir (sys_dirname) != 0 || chdir ("..") != 0) - { - int ignored; - - cmpl_errno = errno; - ignored = g_chdir (sys_orig_dir); - g_free (sys_dirname); - g_free (sys_orig_dir); - return NULL; - } - g_free (sys_dirname); - - sys_cwd = g_get_current_dir (); - result = g_filename_to_utf8 (sys_cwd, -1, NULL, NULL, NULL); - g_free (sys_cwd); - - if (chdir (sys_orig_dir) != 0) - { - cmpl_errno = errno; - g_free (sys_orig_dir); - return NULL; - } - - g_free (sys_orig_dir); - return result; -} - -#endif - -/**********************************************************************/ -/* Completion Operations */ -/**********************************************************************/ - -#ifdef HAVE_PWD_H - -static PossibleCompletion* -attempt_homedir_completion (gchar *text_to_complete, - CompletionState *cmpl_state) -{ - gint index; - - if (!cmpl_state->user_dir_name_buffer && - !get_pwdb (cmpl_state)) - return NULL; - - cmpl_state->user_completion_index += 1; - - while (cmpl_state->user_completion_index < cmpl_state->user_directories_len) - { - index = first_diff_index (text_to_complete + 1, - cmpl_state->user_directories - [cmpl_state->user_completion_index].login); - - switch (index) - { - case PATTERN_MATCH: - break; - default: - if (cmpl_state->last_valid_char < (index + 1)) - cmpl_state->last_valid_char = index + 1; - cmpl_state->user_completion_index += 1; - continue; - } - - cmpl_state->the_completion.is_a_completion = 1; - cmpl_state->the_completion.is_directory = TRUE; - - append_completion_text ("~", cmpl_state); - - append_completion_text (cmpl_state-> - user_directories[cmpl_state->user_completion_index].login, - cmpl_state); - - return append_completion_text (G_DIR_SEPARATOR_S, cmpl_state); - } - - if (text_to_complete[1] - || cmpl_state->user_completion_index > cmpl_state->user_directories_len) - { - cmpl_state->user_completion_index = -1; - return NULL; - } - else - { - cmpl_state->user_completion_index += 1; - cmpl_state->the_completion.is_a_completion = 1; - cmpl_state->the_completion.is_directory = TRUE; - - return append_completion_text ("~" G_DIR_SEPARATOR_S, cmpl_state); - } -} - -#endif - -#ifdef G_PLATFORM_WIN32 -/* FIXME: determine whether we should casefold all Unicode letters - * here, too (and in in first_diff_index() walk through the strings with - * g_utf8_next_char()), or if this folding isn't actually needed at - * all. - */ -#define FOLD(c) (tolower(c)) -#else -#define FOLD(c) (c) -#endif - -/* returns the index (>= 0) of the first differing character, - * PATTERN_MATCH if the completion matches */ -static gint -first_diff_index (gchar *pat, - gchar *text) -{ - gint diff = 0; - - while (*pat && *text && FOLD (*text) == FOLD (*pat)) - { - pat += 1; - text += 1; - diff += 1; - } - - if (*pat) - return diff; - - return PATTERN_MATCH; -} - -static PossibleCompletion* -append_completion_text (gchar *text, - CompletionState *cmpl_state) -{ - gint len, i = 1; - - if (!cmpl_state->the_completion.text) - return NULL; - - len = strlen (text) + strlen (cmpl_state->the_completion.text) + 1; - - if (cmpl_state->the_completion.text_alloc > len) - { - strcat (cmpl_state->the_completion.text, text); - return &cmpl_state->the_completion; - } - - while (i < len) - i <<= 1; - - cmpl_state->the_completion.text_alloc = i; - - cmpl_state->the_completion.text = (gchar*) g_realloc (cmpl_state->the_completion.text, i); - - if (!cmpl_state->the_completion.text) - return NULL; - else - { - strcat (cmpl_state->the_completion.text, text); - return &cmpl_state->the_completion; - } -} - -static CompletionDir* -find_completion_dir (gchar *text_to_complete, - gchar **remaining_text, - CompletionState *cmpl_state) -{ - gchar* first_slash = strchr (text_to_complete, G_DIR_SEPARATOR); - CompletionDir* dir = cmpl_state->reference_dir; - CompletionDir* next; - *remaining_text = text_to_complete; - - while (first_slash) - { - gint len = first_slash - *remaining_text; - gint found = 0; - gchar *found_name = NULL; /* Quiet gcc */ - gint i; - gchar* pat_buf = g_new (gchar, len + 1); - - strncpy (pat_buf, *remaining_text, len); - pat_buf[len] = 0; - - for (i = 0; i < dir->sent->entry_count; i += 1) - { - if (dir->sent->entries[i].is_dir && - _gtk_fnmatch (pat_buf, dir->sent->entries[i].entry_name, TRUE)) - { - if (found) - { - g_free (pat_buf); - return dir; - } - else - { - found = 1; - found_name = dir->sent->entries[i].entry_name; - } - } - } - - if (!found) - { - /* Perhaps we are trying to open an automount directory */ - found_name = pat_buf; - } - - next = open_relative_dir (found_name, dir, cmpl_state); - - if (!next) - { - g_free (pat_buf); - return NULL; -} - - next->cmpl_parent = dir; - - dir = next; - - if (!correct_dir_fullname (dir)) - { - g_free (pat_buf); - return NULL; - } - - *remaining_text = first_slash + 1; - first_slash = strchr (*remaining_text, G_DIR_SEPARATOR); - - g_free (pat_buf); - } - - return dir; -} - -static void -update_cmpl (PossibleCompletion *poss, - CompletionState *cmpl_state) -{ - gint cmpl_len; - - if (!poss || !cmpl_is_a_completion (poss)) - return; - - cmpl_len = strlen (cmpl_this_completion (poss)); - - if (cmpl_state->updated_text_alloc < cmpl_len + 1) - { - cmpl_state->updated_text_alloc = 2*cmpl_len; - cmpl_state->updated_text = - (gchar*)g_realloc (cmpl_state->updated_text, - cmpl_state->updated_text_alloc); - } - - if (cmpl_state->updated_text_len < 0) - { - strcpy (cmpl_state->updated_text, cmpl_this_completion (poss)); - cmpl_state->updated_text_len = cmpl_len; - cmpl_state->re_complete = cmpl_is_directory (poss); - } - else if (cmpl_state->updated_text_len == 0) - { - cmpl_state->re_complete = FALSE; - } - else - { - gint first_diff = - first_diff_index (cmpl_state->updated_text, - cmpl_this_completion (poss)); - - cmpl_state->re_complete = FALSE; - - if (first_diff == PATTERN_MATCH) - return; - - if (first_diff > cmpl_state->updated_text_len) - strcpy (cmpl_state->updated_text, cmpl_this_completion (poss)); - - cmpl_state->updated_text_len = first_diff; - cmpl_state->updated_text[first_diff] = 0; - } -} - -static PossibleCompletion* -attempt_file_completion (CompletionState *cmpl_state) -{ - gchar *pat_buf, *first_slash; - CompletionDir *dir = cmpl_state->active_completion_dir; - - dir->cmpl_index += 1; - - if (dir->cmpl_index == dir->sent->entry_count) - { - if (dir->cmpl_parent == NULL) - { - cmpl_state->active_completion_dir = NULL; - - return NULL; - } - else - { - cmpl_state->active_completion_dir = dir->cmpl_parent; - - return attempt_file_completion (cmpl_state); - } - } - - g_assert (dir->cmpl_text); - - first_slash = strchr (dir->cmpl_text, G_DIR_SEPARATOR); - - if (first_slash) - { - gint len = first_slash - dir->cmpl_text; - - pat_buf = g_new (gchar, len + 1); - strncpy (pat_buf, dir->cmpl_text, len); - pat_buf[len] = 0; - } - else - { - gint len = strlen (dir->cmpl_text); - - pat_buf = g_new (gchar, len + 2); - strcpy (pat_buf, dir->cmpl_text); - /* Don't append a * if the user entered one herself. - * This way one can complete *.h and don't get matches - * on any .help files, for instance. - */ - if (strchr (pat_buf, '*') == NULL) - strcpy (pat_buf + len, "*"); - } - - if (first_slash) - { - if (dir->sent->entries[dir->cmpl_index].is_dir) - { - if (_gtk_fnmatch (pat_buf, dir->sent->entries[dir->cmpl_index].entry_name, TRUE)) - { - CompletionDir* new_dir; - - new_dir = open_relative_dir (dir->sent->entries[dir->cmpl_index].entry_name, - dir, cmpl_state); - - if (!new_dir) - { - g_free (pat_buf); - return NULL; - } - - new_dir->cmpl_parent = dir; - - new_dir->cmpl_index = -1; - new_dir->cmpl_text = g_strdup (first_slash + 1); - - cmpl_state->active_completion_dir = new_dir; - - g_free (pat_buf); - return attempt_file_completion (cmpl_state); - } - else - { - g_free (pat_buf); - return attempt_file_completion (cmpl_state); - } - } - else - { - g_free (pat_buf); - return attempt_file_completion (cmpl_state); - } - } - else - { - if (dir->cmpl_parent != NULL) - { - append_completion_text (dir->fullname + - strlen (cmpl_state->completion_dir->fullname) + 1, - cmpl_state); - append_completion_text (G_DIR_SEPARATOR_S, cmpl_state); - } - - append_completion_text (dir->sent->entries[dir->cmpl_index].entry_name, cmpl_state); - - cmpl_state->the_completion.is_a_completion = - _gtk_fnmatch (pat_buf, dir->sent->entries[dir->cmpl_index].entry_name, TRUE); - - cmpl_state->the_completion.is_directory = dir->sent->entries[dir->cmpl_index].is_dir; - if (dir->sent->entries[dir->cmpl_index].is_dir) - append_completion_text (G_DIR_SEPARATOR_S, cmpl_state); - - g_free (pat_buf); - return &cmpl_state->the_completion; - } -} - -#ifdef HAVE_PWD_H - -static gint -get_pwdb (CompletionState* cmpl_state) -{ - struct passwd *pwd_ptr; - gchar* buf_ptr; - gchar *utf8; - gint len = 0, i, count = 0; - - if (cmpl_state->user_dir_name_buffer) - return TRUE; - setpwent (); - - while ((pwd_ptr = getpwent ()) != NULL) - { - utf8 = g_filename_to_utf8 (pwd_ptr->pw_name, -1, NULL, NULL, NULL); - len += strlen (utf8); - g_free (utf8); - utf8 = g_filename_to_utf8 (pwd_ptr->pw_dir, -1, NULL, NULL, NULL); - len += strlen (utf8); - g_free (utf8); - len += 2; - count += 1; - } - - setpwent (); - - cmpl_state->user_dir_name_buffer = g_new (gchar, len); - cmpl_state->user_directories = g_new (CompletionUserDir, count); - cmpl_state->user_directories_len = count; - - buf_ptr = cmpl_state->user_dir_name_buffer; - - for (i = 0; i < count; i += 1) - { - pwd_ptr = getpwent (); - if (!pwd_ptr) - { - cmpl_errno = errno; - goto error; - } - - utf8 = g_filename_to_utf8 (pwd_ptr->pw_name, -1, NULL, NULL, NULL); - strcpy (buf_ptr, utf8); - g_free (utf8); - - cmpl_state->user_directories[i].login = buf_ptr; - - buf_ptr += strlen (buf_ptr); - buf_ptr += 1; - - utf8 = g_filename_to_utf8 (pwd_ptr->pw_dir, -1, NULL, NULL, NULL); - strcpy (buf_ptr, utf8); - g_free (utf8); - - cmpl_state->user_directories[i].homedir = buf_ptr; - - buf_ptr += strlen (buf_ptr); - buf_ptr += 1; - } - - qsort (cmpl_state->user_directories, - cmpl_state->user_directories_len, - sizeof (CompletionUserDir), - compare_user_dir); - - endpwent (); - - return TRUE; - -error: - - g_free (cmpl_state->user_dir_name_buffer); - g_free (cmpl_state->user_directories); - - cmpl_state->user_dir_name_buffer = NULL; - cmpl_state->user_directories = NULL; - - return FALSE; -} - -static gint -compare_user_dir (const void *a, - const void *b) -{ - return strcmp ((((CompletionUserDir*)a))->login, - (((CompletionUserDir*)b))->login); -} - -#endif - -static gint -compare_cmpl_dir (const void *a, - const void *b) -{ - - return strcmp (((CompletionDirEntry*)a)->sort_key, - (((CompletionDirEntry*)b))->sort_key); -} - -static gint -cmpl_state_okay (CompletionState* cmpl_state) -{ - return cmpl_state && cmpl_state->reference_dir; -} - -static const gchar* -cmpl_strerror (gint err) -{ - if (err == CMPL_ERRNO_TOO_LONG) - return _("Name too long"); - else if (err == CMPL_ERRNO_DID_NOT_CONVERT) - return _("Couldn't convert filename"); - else - return g_strerror (err); -} - -#if defined (G_OS_WIN32) && !defined (_WIN64) - -/* DLL ABI stability backward compatibility versions */ - -#undef gtk_file_selection_get_filename - -G_CONST_RETURN gchar* -gtk_file_selection_get_filename (GtkFileSelection *filesel) -{ - static gchar retval[MAXPATHLEN*2+1]; - gchar *tem; - - tem = g_locale_from_utf8 (gtk_file_selection_get_filename_utf8 (filesel), - -1, NULL, NULL, NULL); - - strncpy (retval, tem, sizeof (retval) - 1); - retval[sizeof (retval) - 1] = '\0'; - g_free (tem); - - return retval; -} - -#undef gtk_file_selection_set_filename - -void -gtk_file_selection_set_filename (GtkFileSelection *filesel, - const gchar *filename) -{ - gchar *utf8_filename = g_locale_to_utf8 (filename, -1, NULL, NULL, NULL); - gtk_file_selection_set_filename_utf8 (filesel, utf8_filename); - g_free (utf8_filename); -} - -#undef gtk_file_selection_get_selections - -gchar ** -gtk_file_selection_get_selections (GtkFileSelection *filesel) -{ - int i = 0; - gchar **selections = gtk_file_selection_get_selections_utf8 (filesel); - - if (selections != NULL) - while (selections[i] != NULL) - { - gchar *tem = selections[i]; - selections[i] = g_locale_from_utf8 (selections[i], - -1, NULL, NULL, NULL); - g_free (tem); - i++; - } - - return selections; -} - -#endif /* G_OS_WIN32 && !_WIN64 */ - -#define __GTK_FILESEL_C__ -#include "gtkaliasdef.c" diff --git a/gtk/gtkfilesel.h b/gtk/gtkfilesel.h deleted file mode 100644 index 8823566872..0000000000 --- a/gtk/gtkfilesel.h +++ /dev/null @@ -1,125 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#ifndef GTK_DISABLE_DEPRECATED - -#ifndef __GTK_FILESEL_H__ -#define __GTK_FILESEL_H__ - -#include - - -G_BEGIN_DECLS - - -#define GTK_TYPE_FILE_SELECTION (gtk_file_selection_get_type ()) -#define GTK_FILE_SELECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_FILE_SELECTION, GtkFileSelection)) -#define GTK_FILE_SELECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_FILE_SELECTION, GtkFileSelectionClass)) -#define GTK_IS_FILE_SELECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_FILE_SELECTION)) -#define GTK_IS_FILE_SELECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_FILE_SELECTION)) -#define GTK_FILE_SELECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_FILE_SELECTION, GtkFileSelectionClass)) - - -typedef struct _GtkFileSelection GtkFileSelection; -typedef struct _GtkFileSelectionClass GtkFileSelectionClass; - -struct _GtkFileSelection -{ - /*< private >*/ - GtkDialog parent_instance; - - /*< public >*/ - GtkWidget *dir_list; - GtkWidget *file_list; - GtkWidget *selection_entry; - GtkWidget *selection_text; - GtkWidget *main_vbox; - GtkWidget *ok_button; - GtkWidget *cancel_button; - GtkWidget *help_button; - GtkWidget *history_pulldown; - GtkWidget *history_menu; - GList *history_list; - GtkWidget *fileop_dialog; - GtkWidget *fileop_entry; - gchar *fileop_file; - gpointer cmpl_state; - - GtkWidget *fileop_c_dir; - GtkWidget *fileop_del_file; - GtkWidget *fileop_ren_file; - - GtkWidget *button_area; - GtkWidget *action_area; - - /*< private >*/ - GPtrArray *selected_names; - gchar *last_selected; -}; - -struct _GtkFileSelectionClass -{ - GtkDialogClass parent_class; - - /* Padding for future expansion */ - void (*_gtk_reserved1) (void); - void (*_gtk_reserved2) (void); - void (*_gtk_reserved3) (void); - void (*_gtk_reserved4) (void); -}; - - -#ifdef G_OS_WIN32 -/* Reserve old names for DLL ABI backward compatibility */ -#define gtk_file_selection_get_filename gtk_file_selection_get_filename_utf8 -#define gtk_file_selection_set_filename gtk_file_selection_set_filename_utf8 -#define gtk_file_selection_get_selections gtk_file_selection_get_selections_utf8 -#endif - -GType gtk_file_selection_get_type (void) G_GNUC_CONST; -GtkWidget* gtk_file_selection_new (const gchar *title); -void gtk_file_selection_set_filename (GtkFileSelection *filesel, - const gchar *filename); -G_CONST_RETURN gchar* gtk_file_selection_get_filename (GtkFileSelection *filesel); - -void gtk_file_selection_complete (GtkFileSelection *filesel, - const gchar *pattern); -void gtk_file_selection_show_fileop_buttons (GtkFileSelection *filesel); -void gtk_file_selection_hide_fileop_buttons (GtkFileSelection *filesel); - -gchar** gtk_file_selection_get_selections (GtkFileSelection *filesel); - -void gtk_file_selection_set_select_multiple (GtkFileSelection *filesel, - gboolean select_multiple); -gboolean gtk_file_selection_get_select_multiple (GtkFileSelection *filesel); - - -G_END_DECLS - - -#endif /* __GTK_FILESEL_H__ */ - -#endif /* GTK_DISABLE_DEPRECATED */ diff --git a/gtk/gtkfilesystemmodel.c b/gtk/gtkfilesystemmodel.c index b3328e02f9..738b061563 100644 --- a/gtk/gtkfilesystemmodel.c +++ b/gtk/gtkfilesystemmodel.c @@ -1747,6 +1747,7 @@ remove_file (GtkFileSystemModel *model, g_object_unref (node->info); g_array_remove_index (model->files, id); + g_hash_table_remove_all (model->file_lookup); /* We don't need to resort, as removing a row doesn't change the sorting order */ } diff --git a/gtk/gtkfixed.c b/gtk/gtkfixed.c index 3106e1f000..9a0d67f0ee 100644 --- a/gtk/gtkfixed.c +++ b/gtk/gtkfixed.c @@ -453,53 +453,5 @@ gtk_fixed_forall (GtkContainer *container, } } -/** - * gtk_fixed_set_has_window: - * @fixed: a #GtkFixed - * @has_window: %TRUE if a separate window should be created - * - * Sets whether a #GtkFixed widget is created with a separate - * #GdkWindow for @widget->window or not. (By default, it will be - * created with no separate #GdkWindow). This function must be called - * while the #GtkFixed is not realized, for instance, immediately after the - * window is created. - * - * This function was added to provide an easy migration path for - * older applications which may expect #GtkFixed to have a separate window. - * - * Deprecated: 2.20: Use gtk_widget_set_has_window() instead. - **/ -void -gtk_fixed_set_has_window (GtkFixed *fixed, - gboolean has_window) -{ - g_return_if_fail (GTK_IS_FIXED (fixed)); - g_return_if_fail (!gtk_widget_get_realized (GTK_WIDGET (fixed))); - - if (has_window != gtk_widget_get_has_window (GTK_WIDGET (fixed))) - { - gtk_widget_set_has_window (GTK_WIDGET (fixed), has_window); - } -} - -/** - * gtk_fixed_get_has_window: - * @fixed: a #GtkWidget - * - * Gets whether the #GtkFixed has its own #GdkWindow. - * See gtk_fixed_set_has_window(). - * - * Return value: %TRUE if @fixed has its own window. - * - * Deprecated: 2.20: Use gtk_widget_get_has_window() instead. - **/ -gboolean -gtk_fixed_get_has_window (GtkFixed *fixed) -{ - g_return_val_if_fail (GTK_IS_FIXED (fixed), FALSE); - - return gtk_widget_get_has_window (GTK_WIDGET (fixed)); -} - #define __GTK_FIXED_C__ #include "gtkaliasdef.c" diff --git a/gtk/gtkfixed.h b/gtk/gtkfixed.h index 6480a2d188..7f2fa96003 100644 --- a/gtk/gtkfixed.h +++ b/gtk/gtkfixed.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -79,11 +79,7 @@ void gtk_fixed_move (GtkFixed *fixed, GtkWidget *widget, gint x, gint y); -#ifndef GTK_DISABLE_DEPRECATED -void gtk_fixed_set_has_window (GtkFixed *fixed, - gboolean has_window); -gboolean gtk_fixed_get_has_window (GtkFixed *fixed); -#endif + G_END_DECLS diff --git a/gtk/gtkfontbutton.h b/gtk/gtkfontbutton.h index 134097096c..813e639ef7 100644 --- a/gtk/gtkfontbutton.h +++ b/gtk/gtkfontbutton.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkfontsel.c b/gtk/gtkfontsel.c index 3eb3d45c33..e22a87f96b 100644 --- a/gtk/gtkfontsel.c +++ b/gtk/gtkfontsel.c @@ -1339,24 +1339,6 @@ gtk_font_selection_get_size (GtkFontSelection *fontsel) return fontsel->size; } -/** - * gtk_font_selection_get_font: - * @fontsel: a #GtkFontSelection - * - * Gets the currently-selected font. - * - * Return value: A #GdkFont. - * - * Deprecated: 2.0: Use gtk_font_selection_get_font_name() instead. - */ -GdkFont * -gtk_font_selection_get_font (GtkFontSelection *fontsel) -{ - g_return_val_if_fail (GTK_IS_FONT_SELECTION (fontsel), NULL); - - return gtk_font_selection_get_font_internal (fontsel); -} - /** * gtk_font_selection_get_font_name: * @fontsel: a #GtkFontSelection @@ -1692,26 +1674,6 @@ gtk_font_selection_dialog_get_ok_button (GtkFontSelectionDialog *fsd) return fsd->ok_button; } -/** - * gtk_font_selection_dialog_get_apply_button: - * @fsd: a #GtkFontSelectionDialog - * - * Obtains a button. The button doesn't have any function. - * - * Return value: a #GtkWidget - * - * Since: 2.14 - * - * Deprecated: 2.16: Don't use this function. - */ -GtkWidget * -gtk_font_selection_dialog_get_apply_button (GtkFontSelectionDialog *fsd) -{ - g_return_val_if_fail (GTK_IS_FONT_SELECTION_DIALOG (fsd), NULL); - - return fsd->apply_button; -} - /** * gtk_font_selection_dialog_get_cancel_button: * @fsd: a #GtkFontSelectionDialog @@ -1778,25 +1740,6 @@ gtk_font_selection_dialog_get_font_name (GtkFontSelectionDialog *fsd) return gtk_font_selection_get_font_name (GTK_FONT_SELECTION (fsd->fontsel)); } -/** - * gtk_font_selection_dialog_get_font: - * @fsd: a #GtkFontSelectionDialog - * - * Gets the currently-selected font. - * - * Return value: the #GdkFont from the #GtkFontSelection for the - * currently selected font in the dialog, or %NULL if no font is selected - * - * Deprecated: 2.0: Use gtk_font_selection_dialog_get_font_name() instead. - */ -GdkFont* -gtk_font_selection_dialog_get_font (GtkFontSelectionDialog *fsd) -{ - g_return_val_if_fail (GTK_IS_FONT_SELECTION_DIALOG (fsd), NULL); - - return gtk_font_selection_get_font_internal (GTK_FONT_SELECTION (fsd->fontsel)); -} - /** * gtk_font_selection_dialog_set_font_name: * @fsd: a #GtkFontSelectionDialog diff --git a/gtk/gtkfontsel.h b/gtk/gtkfontsel.h index 6cf97359d1..5b1b2ceb63 100644 --- a/gtk/gtkfontsel.h +++ b/gtk/gtkfontsel.h @@ -28,7 +28,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -156,10 +156,6 @@ PangoFontFace * gint gtk_font_selection_get_size (GtkFontSelection *fontsel); gchar* gtk_font_selection_get_font_name (GtkFontSelection *fontsel); -#ifndef GTK_DISABLE_DEPRECATED -GdkFont* gtk_font_selection_get_font (GtkFontSelection *fontsel); -#endif /* GTK_DISABLE_DEPRECATED */ - gboolean gtk_font_selection_set_font_name (GtkFontSelection *fontsel, const gchar *fontname); const gchar* gtk_font_selection_get_preview_text (GtkFontSelection *fontsel); @@ -176,9 +172,6 @@ GType gtk_font_selection_dialog_get_type (void) G_GNUC_CONST; GtkWidget *gtk_font_selection_dialog_new (const gchar *title); GtkWidget *gtk_font_selection_dialog_get_ok_button (GtkFontSelectionDialog *fsd); -#ifndef GTK_DISABLE_DEPRECATED -GtkWidget *gtk_font_selection_dialog_get_apply_button (GtkFontSelectionDialog *fsd); -#endif GtkWidget *gtk_font_selection_dialog_get_cancel_button (GtkFontSelectionDialog *fsd); /* This returns the X Logical Font Description fontname, or NULL if no font @@ -188,13 +181,6 @@ GtkWidget *gtk_font_selection_dialog_get_cancel_button (GtkFontSelectionDialog * You should g_free() the returned font name after you're done with it. */ gchar* gtk_font_selection_dialog_get_font_name (GtkFontSelectionDialog *fsd); -#ifndef GTK_DISABLE_DEPRECATED -/* This will return the current GdkFont, or NULL if none is selected or there - was a problem loading it. Remember to use gdk_font_ref/unref() if you want - to use the font (in a style, for example). */ -GdkFont* gtk_font_selection_dialog_get_font (GtkFontSelectionDialog *fsd); -#endif /* GTK_DISABLE_DEPRECATED */ - /* This sets the currently displayed font. It should be a valid X Logical Font Description font name (anything else will be ignored), e.g. "-adobe-courier-bold-o-normal--25-*-*-*-*-*-*-*" diff --git a/gtk/gtkframe.c b/gtk/gtkframe.c index ce0143515b..a377eda7b0 100644 --- a/gtk/gtkframe.c +++ b/gtk/gtkframe.c @@ -31,6 +31,7 @@ #include "gtkprivate.h" #include "gtkintl.h" #include "gtkbuildable.h" +#include "gtkextendedlayout.h" #include "gtkalias.h" #define LABEL_PAD 1 @@ -58,8 +59,6 @@ static void gtk_frame_paint (GtkWidget *widget, GdkRectangle *area); static gint gtk_frame_expose (GtkWidget *widget, GdkEventExpose *event); -static void gtk_frame_size_request (GtkWidget *widget, - GtkRequisition *requisition); static void gtk_frame_size_allocate (GtkWidget *widget, GtkAllocation *allocation); static void gtk_frame_remove (GtkContainer *container, @@ -81,9 +80,19 @@ static void gtk_frame_buildable_add_child (GtkBuildable *buildable, GObject *child, const gchar *type); +static void gtk_frame_extended_layout_init (GtkExtendedLayoutIface *iface); +static void gtk_frame_get_desired_width (GtkExtendedLayout *layout, + gint *minimum_size, + gint *natural_size); +static void gtk_frame_get_desired_height (GtkExtendedLayout *layout, + gint *minimum_size, + gint *natural_size); + G_DEFINE_TYPE_WITH_CODE (GtkFrame, gtk_frame, GTK_TYPE_BIN, G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE, - gtk_frame_buildable_init)) + gtk_frame_buildable_init) + G_IMPLEMENT_INTERFACE (GTK_TYPE_EXTENDED_LAYOUT, + gtk_frame_extended_layout_init)) static void gtk_frame_class_init (GtkFrameClass *class) @@ -150,7 +159,6 @@ gtk_frame_class_init (GtkFrameClass *class) GTK_PARAM_READWRITE)); widget_class->expose_event = gtk_frame_expose; - widget_class->size_request = gtk_frame_size_request; widget_class->size_allocate = gtk_frame_size_allocate; container_class->remove = gtk_frame_remove; @@ -601,42 +609,6 @@ gtk_frame_expose (GtkWidget *widget, return FALSE; } -static void -gtk_frame_size_request (GtkWidget *widget, - GtkRequisition *requisition) -{ - GtkFrame *frame = GTK_FRAME (widget); - GtkBin *bin = GTK_BIN (widget); - GtkRequisition child_requisition; - - if (frame->label_widget && gtk_widget_get_visible (frame->label_widget)) - { - gtk_widget_size_request (frame->label_widget, &child_requisition); - - requisition->width = child_requisition.width + 2 * LABEL_PAD + 2 * LABEL_SIDE_PAD; - requisition->height = - MAX (0, child_requisition.height - widget->style->ythickness); - } - else - { - requisition->width = 0; - requisition->height = 0; - } - - if (bin->child && gtk_widget_get_visible (bin->child)) - { - gtk_widget_size_request (bin->child, &child_requisition); - - requisition->width = MAX (requisition->width, child_requisition.width); - requisition->height += child_requisition.height; - } - - requisition->width += (GTK_CONTAINER (widget)->border_width + - GTK_WIDGET (widget)->style->xthickness) * 2; - requisition->height += (GTK_CONTAINER (widget)->border_width + - GTK_WIDGET (widget)->style->ythickness) * 2; -} - static void gtk_frame_size_allocate (GtkWidget *widget, GtkAllocation *allocation) @@ -652,11 +624,15 @@ gtk_frame_size_allocate (GtkWidget *widget, /* If the child allocation changed, that means that the frame is drawn * in a new place, so we must redraw the entire widget. */ - if (gtk_widget_get_mapped (widget) && + if (gtk_widget_get_mapped (widget) +#if 0 + && (new_allocation.x != frame->child_allocation.x || new_allocation.y != frame->child_allocation.y || new_allocation.width != frame->child_allocation.width || - new_allocation.height != frame->child_allocation.height)) + new_allocation.height != frame->child_allocation.height) +#endif + ) gdk_window_invalidate_rect (widget->window, &widget->allocation, FALSE); if (bin->child && gtk_widget_get_visible (bin->child)) @@ -728,5 +704,103 @@ gtk_frame_real_compute_child_allocation (GtkFrame *frame, child_allocation->y += allocation->y; } +static void +gtk_frame_get_desired_size (GtkExtendedLayout *layout, + GtkOrientation orientation, + gint *minimum_size, + gint *natural_size) +{ + GtkWidget *widget = GTK_WIDGET (layout); + GtkFrame *frame = GTK_FRAME (widget); + GtkBin *bin = GTK_BIN (widget); + gint child_min, child_nat; + gint minimum, natural; + + if (frame->label_widget && gtk_widget_get_visible (frame->label_widget)) + { + if (orientation == GTK_ORIENTATION_HORIZONTAL) + { + gtk_extended_layout_get_desired_width (GTK_EXTENDED_LAYOUT (frame->label_widget), + &child_min, &child_nat); + minimum = child_min + 2 * LABEL_PAD + 2 * LABEL_SIDE_PAD; + natural = child_nat + 2 * LABEL_PAD + 2 * LABEL_SIDE_PAD; + } + else + { + gtk_extended_layout_get_desired_height (GTK_EXTENDED_LAYOUT (frame->label_widget), + &child_min, &child_nat); + minimum = MAX (0, child_min - widget->style->ythickness); + natural = MAX (0, child_nat - widget->style->ythickness); + } + } + else + { + minimum = 0; + natural = 0; + } + + if (bin->child && gtk_widget_get_visible (bin->child)) + { + if (orientation == GTK_ORIENTATION_HORIZONTAL) + { + gtk_extended_layout_get_desired_width (GTK_EXTENDED_LAYOUT (bin->child), + &child_min, &child_nat); + minimum = MAX (minimum, child_min); + natural = MAX (natural, child_nat); + } + else + { + gtk_extended_layout_get_desired_height (GTK_EXTENDED_LAYOUT (bin->child), + &child_min, &child_nat); + minimum += child_min; + natural += child_nat; + } + } + + if (orientation == GTK_ORIENTATION_HORIZONTAL) + { + minimum += (GTK_CONTAINER (widget)->border_width + + GTK_WIDGET (widget)->style->xthickness) * 2; + natural += (GTK_CONTAINER (widget)->border_width + + GTK_WIDGET (widget)->style->xthickness) * 2; + } + else + { + minimum += (GTK_CONTAINER (widget)->border_width + + GTK_WIDGET (widget)->style->ythickness) * 2; + natural += (GTK_CONTAINER (widget)->border_width + + GTK_WIDGET (widget)->style->ythickness) * 2; + } + + if (minimum_size) + *minimum_size = minimum; + + if (natural_size) + *natural_size = natural; +} + +static void +gtk_frame_get_desired_width (GtkExtendedLayout *layout, + gint *minimum_size, + gint *natural_size) +{ + gtk_frame_get_desired_size (layout, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size); +} + +static void +gtk_frame_get_desired_height (GtkExtendedLayout *layout, + gint *minimum_size, + gint *natural_size) +{ + gtk_frame_get_desired_size (layout, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size); +} + +static void +gtk_frame_extended_layout_init (GtkExtendedLayoutIface *iface) +{ + iface->get_desired_width = gtk_frame_get_desired_width; + iface->get_desired_height = gtk_frame_get_desired_height; +} + #define __GTK_FRAME_C__ #include "gtkaliasdef.c" diff --git a/gtk/gtkframe.h b/gtk/gtkframe.h index 2b1e926cde..393f355c72 100644 --- a/gtk/gtkframe.h +++ b/gtk/gtkframe.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkgamma.c b/gtk/gtkgamma.c deleted file mode 100644 index 79e4d1c06b..0000000000 --- a/gtk/gtkgamma.c +++ /dev/null @@ -1,494 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1997 David Mosberger - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#undef GTK_DISABLE_DEPRECATED - -#include "config.h" -#include -#include -#include - -#include - -#include "gtkgamma.h" -#include "gtkcurve.h" -#include "gtkdialog.h" -#include "gtkdrawingarea.h" -#include "gtkentry.h" -#include "gtkhbox.h" -#include "gtkimage.h" -#include "gtklabel.h" -#include "gtkmain.h" -#include "gtkradiobutton.h" -#include "gtkstock.h" -#include "gtktable.h" -#include "gtkvbox.h" -#include "gtkwindow.h" -#include "gtkintl.h" -#include "gtkalias.h" - -/* forward declarations: */ -static void gtk_gamma_curve_destroy (GtkObject *object); - -static void curve_type_changed_callback (GtkWidget *w, gpointer data); -static void button_realize_callback (GtkWidget *w); -static void button_toggled_callback (GtkWidget *w, gpointer data); -static void button_clicked_callback (GtkWidget *w, gpointer data); - -enum - { - LINEAR = 0, - SPLINE, - FREE, - GAMMA, - RESET, - NUM_XPMS - }; - -/* GdkPixbuf RGBA C-Source image dump 1-byte-run-length-encoded */ - -#ifdef __SUNPRO_C -#pragma align 4 (spline_pixdata) -#endif -#ifdef __GNUC__ -static const guint8 spline_pixdata[] __attribute__ ((__aligned__ (4))) = -#else -static const guint8 spline_pixdata[] = -#endif -{ "" - /* Pixbuf magic (0x47646b50) */ - "GdkP" - /* length: header (24) + pixel_data (182) */ - "\0\0\0\316" - /* pixdata_type (0x2010002) */ - "\2\1\0\2" - /* rowstride (64) */ - "\0\0\0@" - /* width (16) */ - "\0\0\0\20" - /* height (16) */ - "\0\0\0\20" - /* pixel_data: */ - "\216\0\0\0\0\202\0\0\0\377\211\0\0\0\0\206\377\0\0\377\1\0\0\0\377\207" - "\0\0\0\0\202\377\0\0\377\214\0\0\0\0\2\0\0\0\377\274--\377\215\0\0\0" - "\0\203\0\0\0\377\215\0\0\0\0\2\274--\377\0\0\0\377\216\0\0\0\0\1\377" - "\0\0\377\216\0\0\0\0\1\377\0\0\377\217\0\0\0\0\1\377\0\0\377\216\0\0" - "\0\0\1\377\0\0\377\217\0\0\0\0\1\377\0\0\377\216\0\0\0\0\1\377\0\0\377" - "\217\0\0\0\0\1\377\0\0\377\217\0\0\0\0\1\377\0\0\377\216\0\0\0\0\2\0" - "\0\0\377\274--\377\216\0\0\0\0\202\0\0\0\377\216\0\0\0\0"}; - - -/* GdkPixbuf RGBA C-Source image dump 1-byte-run-length-encoded */ - -#ifdef __SUNPRO_C -#pragma align 4 (linear_pixdata) -#endif -#ifdef __GNUC__ -static const guint8 linear_pixdata[] __attribute__ ((__aligned__ (4))) = -#else -static const guint8 linear_pixdata[] = -#endif -{ "" - /* Pixbuf magic (0x47646b50) */ - "GdkP" - /* length: header (24) + pixel_data (323) */ - "\0\0\1[" - /* pixdata_type (0x2010002) */ - "\2\1\0\2" - /* rowstride (64) */ - "\0\0\0@" - /* width (16) */ - "\0\0\0\20" - /* height (16) */ - "\0\0\0\20" - /* pixel_data: */ - "\216\0\0\0\0\202\0\0\0\377\216\0\0\0\0\2\202AA\377\0\0\0\377\216\0\0" - "\0\0\1\377\0\0\377\216\0\0\0\0\1\377\0\0\377\217\0\0\0\0\1\377\0\0\377" - "\206\0\0\0\0\3\177\177\177\377\0\0\0\377\177\177\177\377\205\0\0\0\0" - "\1\377\0\0\377\207\0\0\0\0\203\0\0\0\377\205\0\0\0\0\1\377\0\0\377\207" - "\0\0\0\0\3\202AA\377\0\0\0\377\202AA\377\204\0\0\0\0\1\377\0\0\377\210" - "\0\0\0\0\3\377\0\0\377\0\0\0\0\377\0\0\377\204\0\0\0\0\1\377\0\0\377" - "\207\0\0\0\0\1\377\0\0\377\203\0\0\0\0\1\377\0\0\377\202\0\0\0\0\1\377" - "\0\0\377\210\0\0\0\0\1\377\0\0\377\203\0\0\0\0\1\377\0\0\377\202\0\0" - "\0\0\1\377\0\0\377\207\0\0\0\0\1\377\0\0\377\205\0\0\0\0\3\377\0\0\377" - "\0\0\0\377\202AA\377\207\0\0\0\0\1\377\0\0\377\205\0\0\0\0\203\0\0\0" - "\377\206\0\0\0\0\1\377\0\0\377\206\0\0\0\0\3\177\177\177\377\0\0\0\377" - "\177\177\177\377\205\0\0\0\0\2\0\0\0\377\202AA\377\216\0\0\0\0\202\0" - "\0\0\377\216\0\0\0\0"}; - - -/* GdkPixbuf RGBA C-Source image dump 1-byte-run-length-encoded */ - -#ifdef __SUNPRO_C -#pragma align 4 (free_pixdata) -#endif -#ifdef __GNUC__ -static const guint8 free_pixdata[] __attribute__ ((__aligned__ (4))) = -#else -static const guint8 free_pixdata[] = -#endif -{ "" - /* Pixbuf magic (0x47646b50) */ - "GdkP" - /* length: header (24) + pixel_data (204) */ - "\0\0\0\344" - /* pixdata_type (0x2010002) */ - "\2\1\0\2" - /* rowstride (64) */ - "\0\0\0@" - /* width (16) */ - "\0\0\0\20" - /* height (16) */ - "\0\0\0\20" - /* pixel_data: */ - "\246\0\0\0\0\1\377\0\0\377\217\0\0\0\0\1\377\0\0\377\220\0\0\0\0\1\377" - "\0\0\377\217\0\0\0\0\1\377\0\0\377\217\0\0\0\0\1\377\0\0\377\220\0\0" - "\0\0\1\377\0\0\377\217\0\0\0\0\1\377\0\0\377\217\0\0\0\0\1\377\0\0\377" - "\214\0\0\0\0\1\377\0\0\377\203\0\0\0\0\2\377\0\0\377\0\0\0\0\205\377" - "\0\0\377\204\0\0\0\0\1\377\0\0\377\204\0\0\0\0\1\377\0\0\377\211\0\0" - "\0\0\1\377\0\0\377\205\0\0\0\0\1\377\0\0\377\210\0\0\0\0\1\377\0\0\377" - "\207\0\0\0\0\1\377\0\0\377\206\0\0\0\0\1\377\0\0\377\210\0\0\0\0\1\377" - "\0\0\377\205\0\0\0\0\1\377\0\0\377\217\0\0\0\0"}; - - -/* GdkPixbuf RGBA C-Source image dump 1-byte-run-length-encoded */ - -#ifdef __SUNPRO_C -#pragma align 4 (gamma_pixdata) -#endif -#ifdef __GNUC__ -static const guint8 gamma_pixdata[] __attribute__ ((__aligned__ (4))) = -#else -static const guint8 gamma_pixdata[] = -#endif -{ "" - /* Pixbuf magic (0x47646b50) */ - "GdkP" - /* length: header (24) + pixel_data (218) */ - "\0\0\0\362" - /* pixdata_type (0x2010002) */ - "\2\1\0\2" - /* rowstride (64) */ - "\0\0\0@" - /* width (16) */ - "\0\0\0\20" - /* height (16) */ - "\0\0\0\20" - /* pixel_data: */ - "\264\0\0\0\0\2\0\0\0\377^^^\377\202\0\0\0\0\3\214\214\214\377\0\0\0\377" - "\214\214\214\377\211\0\0\0\0\7FFF\377\27\27\27\377\273\273\273\377\0" - "\0\0\0uuu\377\27\27\27\377\244\244\244\377\212\0\0\0\0\3uuu\377\214\214" - "\214\377\0\0\0\0\202FFF\377\214\0\0\0\0\4\0\0\0\377\0\0\0\0\0\0\0\377" - "\214\214\214\377\214\0\0\0\0\3FFF\377\0\0\0\0FFF\377\215\0\0\0\0\3FF" - "F\377\27\27\27\377\214\214\214\377\215\0\0\0\0\2\244\244\244\377\0\0" - "\0\377\216\0\0\0\0\2uuu\377^^^\377\216\0\0\0\0\2///\377\0\0\0\377\216" - "\0\0\0\0\202\0\0\0\377\216\0\0\0\0\2\0\0\0\377///\377\250\0\0\0\0"}; - - -/* GdkPixbuf RGBA C-Source image dump 1-byte-run-length-encoded */ - -#ifdef __SUNPRO_C -#pragma align 4 (reset_pixdata) -#endif -#ifdef __GNUC__ -static const guint8 reset_pixdata[] __attribute__ ((__aligned__ (4))) = -#else -static const guint8 reset_pixdata[] = -#endif -{ "" - /* Pixbuf magic (0x47646b50) */ - "GdkP" - /* length: header (24) + pixel_data (173) */ - "\0\0\0\305" - /* pixdata_type (0x2010002) */ - "\2\1\0\2" - /* rowstride (64) */ - "\0\0\0@" - /* width (16) */ - "\0\0\0\20" - /* height (16) */ - "\0\0\0\20" - /* pixel_data: */ - "\216\0\0\0\0\202\0\0\0\377\216\0\0\0\0\2\202AA\377\0\0\0\377\215\0\0" - "\0\0\1\377\0\0\377\216\0\0\0\0\1\377\0\0\377\216\0\0\0\0\1\377\0\0\377" - "\216\0\0\0\0\1\377\0\0\377\216\0\0\0\0\1\377\0\0\377\216\0\0\0\0\1\377" - "\0\0\377\216\0\0\0\0\1\377\0\0\377\216\0\0\0\0\1\377\0\0\377\216\0\0" - "\0\0\1\377\0\0\377\216\0\0\0\0\1\377\0\0\377\216\0\0\0\0\1\377\0\0\377" - "\216\0\0\0\0\1\377\0\0\377\215\0\0\0\0\2\0\0\0\377\202AA\377\216\0\0" - "\0\0\202\0\0\0\377\216\0\0\0\0"}; - -G_DEFINE_TYPE (GtkGammaCurve, gtk_gamma_curve, GTK_TYPE_VBOX) - -static void -gtk_gamma_curve_class_init (GtkGammaCurveClass *class) -{ - GtkObjectClass *object_class; - - object_class = (GtkObjectClass *) class; - object_class->destroy = gtk_gamma_curve_destroy; -} - -static void -gtk_gamma_curve_init (GtkGammaCurve *curve) -{ - GtkWidget *vbox; - int i; - - curve->gamma = 1.0; - - curve->table = gtk_table_new (1, 2, FALSE); - gtk_table_set_col_spacings (GTK_TABLE (curve->table), 3); - gtk_container_add (GTK_CONTAINER (curve), curve->table); - - curve->curve = gtk_curve_new (); - g_signal_connect (curve->curve, "curve-type-changed", - G_CALLBACK (curve_type_changed_callback), curve); - gtk_table_attach_defaults (GTK_TABLE (curve->table), curve->curve, 0, 1, 0, 1); - - vbox = gtk_vbox_new (/* homogeneous */ FALSE, /* spacing */ 3); - gtk_table_attach (GTK_TABLE (curve->table), vbox, 1, 2, 0, 1, 0, 0, 0, 0); - - /* toggle buttons: */ - for (i = 0; i < 3; ++i) - { - curve->button[i] = gtk_toggle_button_new (); - g_object_set_data (G_OBJECT (curve->button[i]), I_("_GtkGammaCurveIndex"), - GINT_TO_POINTER (i)); - gtk_container_add (GTK_CONTAINER (vbox), curve->button[i]); - g_signal_connect (curve->button[i], "realize", - G_CALLBACK (button_realize_callback), NULL); - g_signal_connect (curve->button[i], "toggled", - G_CALLBACK (button_toggled_callback), curve); - gtk_widget_show (curve->button[i]); - } - - /* push buttons: */ - for (i = 3; i < 5; ++i) - { - curve->button[i] = gtk_button_new (); - g_object_set_data (G_OBJECT (curve->button[i]), I_("_GtkGammaCurveIndex"), - GINT_TO_POINTER (i)); - gtk_container_add (GTK_CONTAINER (vbox), curve->button[i]); - g_signal_connect (curve->button[i], "realize", - G_CALLBACK (button_realize_callback), NULL); - g_signal_connect (curve->button[i], "clicked", - G_CALLBACK (button_clicked_callback), curve); - gtk_widget_show (curve->button[i]); - } - - gtk_widget_show (vbox); - gtk_widget_show (curve->table); - gtk_widget_show (curve->curve); -} - -static void -button_realize_callback (GtkWidget *w) -{ - GtkWidget *image; - struct { - const guint8 *stream; - gint length; - } streams[5] = { - { linear_pixdata, sizeof (linear_pixdata) }, - { spline_pixdata, sizeof (spline_pixdata) }, - { free_pixdata, sizeof (free_pixdata) }, - { gamma_pixdata, sizeof (gamma_pixdata) }, - { reset_pixdata, sizeof (reset_pixdata) } - }; - GdkPixdata pixdata; - GdkPixbuf *pixbuf; - int i; - - i = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (w), "_GtkGammaCurveIndex")); - gdk_pixdata_deserialize (&pixdata, streams[i].length, streams[i].stream, NULL); - pixbuf = gdk_pixbuf_from_pixdata (&pixdata, TRUE, NULL); - image = gtk_image_new_from_pixbuf (pixbuf); - gtk_container_add (GTK_CONTAINER (w), image); - gtk_widget_show (image); - - g_object_unref (pixbuf); -} - -static void -button_toggled_callback (GtkWidget *w, gpointer data) -{ - GtkGammaCurve *c = data; - GtkCurveType type; - int active, i; - - if (!GTK_TOGGLE_BUTTON (w)->active) - return; - - active = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (w), "_GtkGammaCurveIndex")); - - for (i = 0; i < 3; ++i) - if ((i != active) && GTK_TOGGLE_BUTTON (c->button[i])->active) - break; - - if (i < 3) - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (c->button[i]), FALSE); - - switch (active) - { - case 0: type = GTK_CURVE_TYPE_SPLINE; break; - case 1: type = GTK_CURVE_TYPE_LINEAR; break; - default: type = GTK_CURVE_TYPE_FREE; break; - } - gtk_curve_set_curve_type (GTK_CURVE (c->curve), type); -} - -static void -gamma_cancel_callback (GtkWidget *w, gpointer data) -{ - GtkGammaCurve *c = data; - - gtk_widget_destroy (c->gamma_dialog); -} - -static void -gamma_ok_callback (GtkWidget *w, gpointer data) -{ - GtkGammaCurve *c = data; - const gchar *start; - gchar *end; - gfloat v; - - start = gtk_entry_get_text (GTK_ENTRY (c->gamma_text)); - if (start) - { - v = g_strtod (start, &end); - if (end > start && v > 0.0) - c->gamma = v; - } - gtk_curve_set_gamma (GTK_CURVE (c->curve), c->gamma); - gamma_cancel_callback (w, data); -} - -static void -button_clicked_callback (GtkWidget *w, gpointer data) -{ - GtkGammaCurve *c = data; - int active; - - active = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (w), "_GtkGammaCurveIndex")); - if (active == 3) - { - /* set gamma */ - if (c->gamma_dialog) - return; - else - { - GtkWidget *vbox, *hbox, *label, *button; - gchar buf[64]; - - c->gamma_dialog = gtk_dialog_new (); - gtk_window_set_screen (GTK_WINDOW (c->gamma_dialog), - gtk_widget_get_screen (w)); - gtk_window_set_title (GTK_WINDOW (c->gamma_dialog), _("Gamma")); - g_object_add_weak_pointer (G_OBJECT (c->gamma_dialog), - (gpointer *)&c->gamma_dialog); - - vbox = GTK_DIALOG (c->gamma_dialog)->vbox; - - hbox = gtk_hbox_new (/* homogeneous */ FALSE, 0); - gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 2); - gtk_widget_show (hbox); - - label = gtk_label_new_with_mnemonic (_("_Gamma value")); - gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 2); - gtk_widget_show (label); - - sprintf (buf, "%g", c->gamma); - c->gamma_text = gtk_entry_new (); - gtk_label_set_mnemonic_widget (GTK_LABEL (label), c->gamma_text); - gtk_entry_set_text (GTK_ENTRY (c->gamma_text), buf); - gtk_box_pack_start (GTK_BOX (hbox), c->gamma_text, TRUE, TRUE, 2); - gtk_widget_show (c->gamma_text); - - /* fill in action area: */ - hbox = GTK_DIALOG (c->gamma_dialog)->action_area; - - button = gtk_button_new_from_stock (GTK_STOCK_CANCEL); - g_signal_connect (button, "clicked", - G_CALLBACK (gamma_cancel_callback), c); - gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0); - gtk_widget_show (button); - - button = gtk_button_new_from_stock (GTK_STOCK_OK); - gtk_widget_set_can_default (button, TRUE); - g_signal_connect (button, "clicked", - G_CALLBACK (gamma_ok_callback), c); - gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0); - gtk_widget_grab_default (button); - gtk_widget_show (button); - - gtk_widget_show (c->gamma_dialog); - } - } - else - { - /* reset */ - gtk_curve_reset (GTK_CURVE (c->curve)); - } -} - -static void -curve_type_changed_callback (GtkWidget *w, gpointer data) -{ - GtkGammaCurve *c = data; - GtkCurveType new_type; - int active; - - new_type = GTK_CURVE (w)->curve_type; - switch (new_type) - { - case GTK_CURVE_TYPE_SPLINE: active = 0; break; - case GTK_CURVE_TYPE_LINEAR: active = 1; break; - default: active = 2; break; - } - if (!GTK_TOGGLE_BUTTON (c->button[active])->active) - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (c->button[active]), TRUE); -} - -GtkWidget* -gtk_gamma_curve_new (void) -{ - return g_object_new (GTK_TYPE_GAMMA_CURVE, NULL); -} - -static void -gtk_gamma_curve_destroy (GtkObject *object) -{ - GtkGammaCurve *c = GTK_GAMMA_CURVE (object); - - if (c->gamma_dialog) - gtk_widget_destroy (c->gamma_dialog); - - GTK_OBJECT_CLASS (gtk_gamma_curve_parent_class)->destroy (object); -} - -#define __GTK_GAMMA_CURVE_C__ -#include "gtkaliasdef.c" diff --git a/gtk/gtkgamma.h b/gtk/gtkgamma.h deleted file mode 100644 index 0173f960ac..0000000000 --- a/gtk/gtkgamma.h +++ /dev/null @@ -1,82 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1997 David Mosberger - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#ifndef GTK_DISABLE_DEPRECATED - -#ifndef __GTK_GAMMA_CURVE_H__ -#define __GTK_GAMMA_CURVE_H__ - - -#include - - -G_BEGIN_DECLS - -#define GTK_TYPE_GAMMA_CURVE (gtk_gamma_curve_get_type ()) -#define GTK_GAMMA_CURVE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_GAMMA_CURVE, GtkGammaCurve)) -#define GTK_GAMMA_CURVE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_GAMMA_CURVE, GtkGammaCurveClass)) -#define GTK_IS_GAMMA_CURVE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_GAMMA_CURVE)) -#define GTK_IS_GAMMA_CURVE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_GAMMA_CURVE)) -#define GTK_GAMMA_CURVE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_GAMMA_CURVE, GtkGammaCurveClass)) - -typedef struct _GtkGammaCurve GtkGammaCurve; -typedef struct _GtkGammaCurveClass GtkGammaCurveClass; - - -struct _GtkGammaCurve -{ - GtkVBox vbox; - - GtkWidget *GSEAL (table); - GtkWidget *GSEAL (curve); - GtkWidget *GSEAL (button[5]); /* spline, linear, free, gamma, reset */ - - gfloat GSEAL (gamma); - GtkWidget *GSEAL (gamma_dialog); - GtkWidget *GSEAL (gamma_text); -}; - -struct _GtkGammaCurveClass -{ - GtkVBoxClass parent_class; - - /* Padding for future expansion */ - void (*_gtk_reserved1) (void); - void (*_gtk_reserved2) (void); - void (*_gtk_reserved3) (void); - void (*_gtk_reserved4) (void); -}; - - -GType gtk_gamma_curve_get_type (void) G_GNUC_CONST; -GtkWidget* gtk_gamma_curve_new (void); - - -G_END_DECLS - -#endif /* __GTK_GAMMA_CURVE_H__ */ - -#endif /* GTK_DISABLE_DEPRECATED */ diff --git a/gtk/gtkgc.h b/gtk/gtkgc.h index 5fcb1a2cf0..8395bbafbf 100644 --- a/gtk/gtkgc.h +++ b/gtk/gtkgc.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkhandlebox.c b/gtk/gtkhandlebox.c index 5ff6050a9f..119ba107ed 100644 --- a/gtk/gtkhandlebox.c +++ b/gtk/gtkhandlebox.c @@ -42,6 +42,7 @@ struct _GtkHandleBoxPrivate { gint orig_x; gint orig_y; + GdkDevice *grab_device; }; enum { @@ -1114,22 +1115,25 @@ gtk_handle_box_button_press (GtkWidget *widget, hb->attach_allocation.height = 0; } hb->in_drag = TRUE; + private->grab_device = event->device; fleur = gdk_cursor_new_for_display (gtk_widget_get_display (widget), GDK_FLEUR); - if (gdk_pointer_grab (invisible->window, - FALSE, - (GDK_BUTTON1_MOTION_MASK | - GDK_POINTER_MOTION_HINT_MASK | - GDK_BUTTON_RELEASE_MASK), - NULL, - fleur, - event->time) != 0) + if (gdk_device_grab (event->device, + invisible->window, + GDK_OWNERSHIP_WINDOW, + FALSE, + (GDK_BUTTON1_MOTION_MASK | + GDK_POINTER_MOTION_HINT_MASK | + GDK_BUTTON_RELEASE_MASK), + fleur, + event->time) != GDK_GRAB_SUCCESS) { hb->in_drag = FALSE; + private->grab_device = NULL; } else { - gtk_grab_add (invisible); + gtk_device_grab_add (invisible, private->grab_device, TRUE); g_signal_connect (invisible, "event", G_CALLBACK (gtk_handle_box_grab_event), hb); } @@ -1169,9 +1173,10 @@ gtk_handle_box_motion (GtkWidget *widget, new_x = 0; new_y = 0; screen = gtk_widget_get_screen (widget); - gdk_display_get_pointer (gdk_screen_get_display (screen), - &pointer_screen, - &new_x, &new_y, NULL); + gdk_display_get_device_state (gdk_screen_get_display (screen), + event->device, + &pointer_screen, + &new_x, &new_y, NULL); if (pointer_screen != screen) { GtkHandleBoxPrivate *private = gtk_handle_box_get_private (hb); @@ -1418,15 +1423,18 @@ static void gtk_handle_box_end_drag (GtkHandleBox *hb, guint32 time) { + GtkHandleBoxPrivate *private = gtk_handle_box_get_private (hb); GtkWidget *invisible = gtk_handle_box_get_invisible (); - + hb->in_drag = FALSE; - gtk_grab_remove (invisible); - gdk_pointer_ungrab (time); + gtk_device_grab_remove (invisible, private->grab_device); + gdk_device_ungrab (private->grab_device, time); g_signal_handlers_disconnect_by_func (invisible, G_CALLBACK (gtk_handle_box_grab_event), hb); + + private->grab_device = NULL; } #define __GTK_HANDLE_BOX_C__ diff --git a/gtk/gtkhandlebox.h b/gtk/gtkhandlebox.h index 47fb39053d..b914e962d7 100644 --- a/gtk/gtkhandlebox.h +++ b/gtk/gtkhandlebox.h @@ -29,7 +29,7 @@ * their parents. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkhbbox.c b/gtk/gtkhbbox.c index 50131d1ea1..55b0b15098 100644 --- a/gtk/gtkhbbox.c +++ b/gtk/gtkhbbox.c @@ -30,8 +30,6 @@ #include "gtkintl.h" #include "gtkalias.h" - -static gint default_spacing = 30; static gint default_layout_style = GTK_BUTTONBOX_EDGE; G_DEFINE_TYPE (GtkHButtonBox, gtk_hbutton_box, GTK_TYPE_BUTTON_BOX) @@ -54,44 +52,6 @@ gtk_hbutton_box_new (void) return g_object_new (GTK_TYPE_HBUTTON_BOX, NULL); } - -/* set default value for spacing */ - -void -gtk_hbutton_box_set_spacing_default (gint spacing) -{ - default_spacing = spacing; -} - - -/* set default value for layout style */ - -void -gtk_hbutton_box_set_layout_default (GtkButtonBoxStyle layout) -{ - g_return_if_fail (layout >= GTK_BUTTONBOX_DEFAULT_STYLE && - layout <= GTK_BUTTONBOX_CENTER); - - default_layout_style = layout; -} - -/* get default value for spacing */ - -gint -gtk_hbutton_box_get_spacing_default (void) -{ - return default_spacing; -} - - -/* get default value for layout style */ - -GtkButtonBoxStyle -gtk_hbutton_box_get_layout_default (void) -{ - return default_layout_style; -} - GtkButtonBoxStyle _gtk_hbutton_box_get_layout_default (void) { diff --git a/gtk/gtkhbbox.h b/gtk/gtkhbbox.h index 25eecba106..f0aec6e8dd 100644 --- a/gtk/gtkhbbox.h +++ b/gtk/gtkhbbox.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -64,14 +64,6 @@ GtkWidget* gtk_hbutton_box_new (void); /* buttons can be added by gtk_container_add() */ -#ifndef GTK_DISABLE_DEPRECATED -gint gtk_hbutton_box_get_spacing_default (void); -GtkButtonBoxStyle gtk_hbutton_box_get_layout_default (void); - -void gtk_hbutton_box_set_spacing_default (gint spacing); -void gtk_hbutton_box_set_layout_default (GtkButtonBoxStyle layout); -#endif - /* private API */ GtkButtonBoxStyle _gtk_hbutton_box_get_layout_default (void); diff --git a/gtk/gtkhbox.c b/gtk/gtkhbox.c index b917c4019d..61855f35af 100644 --- a/gtk/gtkhbox.c +++ b/gtk/gtkhbox.c @@ -30,6 +30,22 @@ #include "gtkorientable.h" #include "gtkalias.h" + +/** + * SECTION:gtkhbox + * @Short_description: A horizontal container box + * @Title: GtkHBox + * @See_also: #GtkVBox + * + * #GtkHBox is a container that organizes child widgets into a single row. + * + * Use the #GtkBox packing interface to determine the arrangement, + * spacing, width, and alignment of #GtkHBox children. + * + * All children are allocated the same height. + */ + + G_DEFINE_TYPE (GtkHBox, gtk_hbox, GTK_TYPE_BOX) static void @@ -46,6 +62,15 @@ gtk_hbox_init (GtkHBox *hbox) _gtk_box_set_old_defaults (GTK_BOX (hbox)); } +/** + * gtk_hbox_new: + * @homogeneous: %TRUE if all children are to be given equal space allotments. + * @spacing: the number of pixels to place by default between children. + * + * Creates a new #GtkHBox. + * + * Returns: a new #GtkHBox. + */ GtkWidget * gtk_hbox_new (gboolean homogeneous, gint spacing) diff --git a/gtk/gtkhbox.h b/gtk/gtkhbox.h index 02b74acbe9..e04c7314cf 100644 --- a/gtk/gtkhbox.h +++ b/gtk/gtkhbox.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkhpaned.h b/gtk/gtkhpaned.h index 560ea2e3e6..3a526b5cb1 100644 --- a/gtk/gtkhpaned.h +++ b/gtk/gtkhpaned.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkhruler.h b/gtk/gtkhruler.h index 3c30917cef..d2c876e3f4 100644 --- a/gtk/gtkhruler.h +++ b/gtk/gtkhruler.h @@ -34,7 +34,7 @@ * distribution. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkhscale.h b/gtk/gtkhscale.h index 6b13a09c4c..9ecfd699fb 100644 --- a/gtk/gtkhscale.h +++ b/gtk/gtkhscale.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkhscrollbar.h b/gtk/gtkhscrollbar.h index f3300a7ccb..2246c74dc5 100644 --- a/gtk/gtkhscrollbar.h +++ b/gtk/gtkhscrollbar.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkhseparator.h b/gtk/gtkhseparator.h index a4d9f11725..4cda938477 100644 --- a/gtk/gtkhseparator.h +++ b/gtk/gtkhseparator.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkiconfactory.c b/gtk/gtkiconfactory.c index c825a97242..0e6e3d8ed1 100644 --- a/gtk/gtkiconfactory.c +++ b/gtk/gtkiconfactory.c @@ -1075,7 +1075,6 @@ gtk_icon_size_register_alias (const gchar *alias, /** * gtk_icon_size_from_name: * @name: the name to look up. - * @returns: the icon size with the given name. * * Looks up the icon size associated with @name. * diff --git a/gtk/gtkiconfactory.h b/gtk/gtkiconfactory.h index 574b101d08..d7a1bf8787 100644 --- a/gtk/gtkiconfactory.h +++ b/gtk/gtkiconfactory.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c index 67ed420332..380595ec8c 100644 --- a/gtk/gtkicontheme.c +++ b/gtk/gtkicontheme.c @@ -3079,6 +3079,146 @@ gtk_icon_info_load_icon (GtkIconInfo *icon_info, return g_object_ref (icon_info->pixbuf); } +static gchar * +gdk_color_to_css (GdkColor *color) +{ + return g_strdup_printf ("rgb(%d,%d,%d)", + color->red >> 8, + color->green >> 8, + color->blue >> 8); +} + +/** + * gtk_icon_info_load_symbolic: + * @icon_info: a #GtkIconInfo + * @fg: a #GdkColor representing the foreground color of the icon + * @success_color: (allow-none): a #GdkColor representing the warning color + * of the icon or %NULL to use the default color + * @warning_color: (allow-none): a #GdkColor representing the warning color + * of the icon or %NULL to use the default color + * @error_color: (allow-none): a #GdkColor representing the error color + * of the icon or %NULL to use the default color (allow-none) + * @was_symbolic: (allow-none): a #gboolean, returns whether the loaded icon + * was a symbolic one and whether the @fg color was applied to it. + * @error: (allow-none): location to store error information on failure, + * or %NULL. + * + * Loads an icon, modifying it to match the system colours for the foreground, + * success, warning and error colors provided. If the icon is not a symbolic + * one, the function will return the result from gtk_icon_info_load_icon(). + * + * This allows loading symbolic icons that will match the system theme. + * + * Unless you are implementing a widget, you will want to use + * g_themed_icon_new_with_default_fallbacks() to load the icon. + * + * As implementation details, the icon loaded needs to be of SVG type, + * contain the "symbolic" term as the last component of the icon name, + * and use the 'fg', 'success', 'warning' and 'error' CSS styles in the + * SVG file itself. + * + * See the Symbolic Icons spec + * for more information about symbolic icons. + * + * Return value: a #GdkPixbuf representing the loaded icon + * + * Since: 3.0 + **/ +GdkPixbuf * +gtk_icon_info_load_symbolic (GtkIconInfo *icon_info, + GdkColor *fg, + GdkColor *success_color, + GdkColor *warning_color, + GdkColor *error_color, + gboolean *was_symbolic, + GError **error) +{ + GdkPixbuf *pixbuf; + GInputStream *stream; + gchar *data; + gchar *css_fg; + gchar *css_success; + gchar *css_warning; + gchar *css_error; + + g_return_val_if_fail (fg != NULL, NULL); + + if (!icon_info->filename || + !g_str_has_suffix (icon_info->filename, "-symbolic.svg")) + { + if (was_symbolic) + *was_symbolic = FALSE; + return gtk_icon_info_load_icon (icon_info, error); + } + + if (was_symbolic) + *was_symbolic = TRUE; + + css_fg = gdk_color_to_css (fg); + if (!warning_color) + { + GdkColor warning_default_color = { 0, 0xf500, 0x7900, 0x3e00 }; + css_warning = gdk_color_to_css (&warning_default_color); + } + else + css_warning = gdk_color_to_css (warning_color); + if (!error_color) + { + GdkColor error_default_color = { 0, 0xcc00, 0x0000, 0x0000 }; + css_error = gdk_color_to_css (&error_default_color); + } + else + css_error = gdk_color_to_css (error_color); + if (!success_color) + { + GdkColor success_default_color = { 0, 0x4e00, 0x9a00, 0x0600 }; + css_success = gdk_color_to_css (&success_default_color); + } + else + css_success = gdk_color_to_css (success_color); + + data = g_strconcat ( +"\n" +"\n" +" \n" +" filename, "\"/>\n" +"", + NULL); + g_free (css_fg); + g_free (css_warning); + g_free (css_success); + g_free (css_error); + + stream = g_memory_input_stream_new_from_data (data, -1, g_free); + + pixbuf = gdk_pixbuf_new_from_stream_at_scale (stream, + icon_info->desired_size, + icon_info->desired_size, + TRUE, + NULL, + error); + g_object_unref (stream); + + return pixbuf; +} + /** * gtk_icon_info_set_raw_coordinates: * @icon_info: a #GtkIconInfo diff --git a/gtk/gtkicontheme.h b/gtk/gtkicontheme.h index b6d7d31fe2..aa1fa51685 100644 --- a/gtk/gtkicontheme.h +++ b/gtk/gtkicontheme.h @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -179,6 +179,13 @@ G_CONST_RETURN gchar *gtk_icon_info_get_filename (GtkIconInfo *icon_info GdkPixbuf * gtk_icon_info_get_builtin_pixbuf (GtkIconInfo *icon_info); GdkPixbuf * gtk_icon_info_load_icon (GtkIconInfo *icon_info, GError **error); +GdkPixbuf * gtk_icon_info_load_symbolic (GtkIconInfo *icon_info, + GdkColor *fg, + GdkColor *success_color, + GdkColor *warning_color, + GdkColor *error_color, + gboolean *was_symbolic, + GError **error); void gtk_icon_info_set_raw_coordinates (GtkIconInfo *icon_info, gboolean raw_coordinates); diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c index ebb63a12b0..cdbd9cfe92 100644 --- a/gtk/gtkiconview.c +++ b/gtk/gtkiconview.c @@ -124,6 +124,7 @@ struct _GtkIconViewPrivate gboolean doing_rubberband; gint rubberband_x1, rubberband_y1; gint rubberband_x2, rubberband_y2; + GdkDevice *rubberband_device; guint scroll_timeout_id; gint scroll_value_diff; @@ -308,6 +309,7 @@ static void gtk_icon_view_set_cursor_item (GtkIco GtkIconViewItem *item, gint cursor_cell); static void gtk_icon_view_start_rubberbanding (GtkIconView *icon_view, + GdkDevice *device, gint x, gint y); static void gtk_icon_view_stop_rubberbanding (GtkIconView *icon_view); @@ -1496,7 +1498,7 @@ gtk_icon_view_size_allocate (GtkWidget *widget, hadjustment->upper = MAX (allocation->width, icon_view->priv->width); if (hadjustment->value > hadjustment->upper - hadjustment->page_size) - gtk_adjustment_set_value (hadjustment, MAX (0, hadjustment->upper - hadjustment->page_size)); + gtk_adjustment_set_value (hadjustment, hadjustment->upper - hadjustment->page_size); vadjustment->page_size = allocation->height; vadjustment->page_increment = allocation->height * 0.9; @@ -1505,7 +1507,7 @@ gtk_icon_view_size_allocate (GtkWidget *widget, vadjustment->upper = MAX (allocation->height, icon_view->priv->height); if (vadjustment->value > vadjustment->upper - vadjustment->page_size) - gtk_adjustment_set_value (vadjustment, MAX (0, vadjustment->upper - vadjustment->page_size)); + gtk_adjustment_set_value (vadjustment, vadjustment->upper - vadjustment->page_size); if (gtk_widget_get_realized (widget) && icon_view->priv->scroll_to_path) @@ -1668,17 +1670,11 @@ gtk_icon_view_expose (GtkWidget *widget, static gboolean rubberband_scroll_timeout (gpointer data) { - GtkIconView *icon_view; - gdouble value; + GtkIconView *icon_view = data; - icon_view = data; - - value = MIN (icon_view->priv->vadjustment->value + - icon_view->priv->scroll_value_diff, - icon_view->priv->vadjustment->upper - - icon_view->priv->vadjustment->page_size); - - gtk_adjustment_set_value (icon_view->priv->vadjustment, value); + gtk_adjustment_set_value (icon_view->priv->vadjustment, + icon_view->priv->vadjustment->value + + icon_view->priv->scroll_value_diff); gtk_icon_view_update_rubberband (icon_view); @@ -2223,7 +2219,7 @@ gtk_icon_view_button_press (GtkWidget *widget, } if (icon_view->priv->selection_mode == GTK_SELECTION_MULTIPLE) - gtk_icon_view_start_rubberbanding (icon_view, event->x, event->y); + gtk_icon_view_start_rubberbanding (icon_view, event->device, event->x, event->y); } /* don't draw keyboard focus around an clicked-on item */ @@ -2315,7 +2311,9 @@ gtk_icon_view_update_rubberband (gpointer data) icon_view = GTK_ICON_VIEW (data); - gdk_window_get_pointer (icon_view->priv->bin_window, &x, &y, NULL); + gdk_window_get_device_position (icon_view->priv->bin_window, + icon_view->priv->rubberband_device, + &x, &y, NULL); x = MAX (x, 0); y = MAX (y, 0); @@ -2366,12 +2364,14 @@ gtk_icon_view_update_rubberband (gpointer data) static void gtk_icon_view_start_rubberbanding (GtkIconView *icon_view, + GdkDevice *device, gint x, gint y) { GList *items; - g_assert (!icon_view->priv->doing_rubberband); + if (icon_view->priv->rubberband_device) + return; for (items = icon_view->priv->items; items; items = items->next) { @@ -2386,8 +2386,9 @@ gtk_icon_view_start_rubberbanding (GtkIconView *icon_view, icon_view->priv->rubberband_y2 = y; icon_view->priv->doing_rubberband = TRUE; + icon_view->priv->rubberband_device = device; - gtk_grab_add (GTK_WIDGET (icon_view)); + gtk_device_grab_add (GTK_WIDGET (icon_view), device, TRUE); } static void @@ -2396,10 +2397,12 @@ gtk_icon_view_stop_rubberbanding (GtkIconView *icon_view) if (!icon_view->priv->doing_rubberband) return; - icon_view->priv->doing_rubberband = FALSE; + gtk_device_grab_remove (GTK_WIDGET (icon_view), + icon_view->priv->rubberband_device); + + icon_view->priv->doing_rubberband = FALSE; + icon_view->priv->rubberband_device = NULL; - gtk_grab_remove (GTK_WIDGET (icon_view)); - gtk_widget_queue_draw (GTK_WIDGET (icon_view)); } @@ -4080,10 +4083,13 @@ gtk_icon_view_move_cursor_up_down (GtkIconView *icon_view, gint cell; gboolean dirty = FALSE; gint step; - + GtkDirectionType direction; + if (!gtk_widget_has_focus (GTK_WIDGET (icon_view))) return; - + + direction = count < 0 ? GTK_DIR_UP : GTK_DIR_DOWN; + if (!icon_view->priv->cursor_item) { GList *list; @@ -4116,7 +4122,16 @@ gtk_icon_view_move_cursor_up_down (GtkIconView *icon_view, if (!item) { - gtk_widget_error_bell (GTK_WIDGET (icon_view)); + if (!gtk_widget_keynav_failed (GTK_WIDGET (icon_view), direction)) + { + GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (icon_view)); + if (toplevel) + gtk_widget_child_focus (toplevel, + direction == GTK_DIR_UP ? + GTK_DIR_TAB_BACKWARD : + GTK_DIR_TAB_FORWARD); + } + return; } @@ -4206,10 +4221,13 @@ gtk_icon_view_move_cursor_left_right (GtkIconView *icon_view, gint cell = -1; gboolean dirty = FALSE; gint step; - + GtkDirectionType direction; + if (!gtk_widget_has_focus (GTK_WIDGET (icon_view))) return; - + + direction = count < 0 ? GTK_DIR_LEFT : GTK_DIR_RIGHT; + if (!icon_view->priv->cursor_item) { GList *list; @@ -4241,7 +4259,16 @@ gtk_icon_view_move_cursor_left_right (GtkIconView *icon_view, if (!item) { - gtk_widget_error_bell (GTK_WIDGET (icon_view)); + if (!gtk_widget_keynav_failed (GTK_WIDGET (icon_view), direction)) + { + GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (icon_view)); + if (toplevel) + gtk_widget_child_focus (toplevel, + direction == GTK_DIR_LEFT ? + GTK_DIR_TAB_BACKWARD : + GTK_DIR_TAB_FORWARD); + } + return; } @@ -4380,7 +4407,7 @@ gtk_icon_view_scroll_to_path (GtkIconView *icon_view, { gint x, y; gint focus_width; - gfloat offset, value; + gfloat offset; gtk_widget_style_get (GTK_WIDGET (icon_view), "focus-line-width", &focus_width, @@ -4390,17 +4417,15 @@ gtk_icon_view_scroll_to_path (GtkIconView *icon_view, offset = y + item->y - focus_width - row_align * (GTK_WIDGET (icon_view)->allocation.height - item->height); - value = CLAMP (icon_view->priv->vadjustment->value + offset, - icon_view->priv->vadjustment->lower, - icon_view->priv->vadjustment->upper - icon_view->priv->vadjustment->page_size); - gtk_adjustment_set_value (icon_view->priv->vadjustment, value); + + gtk_adjustment_set_value (icon_view->priv->vadjustment, + icon_view->priv->vadjustment->value + offset); offset = x + item->x - focus_width - col_align * (GTK_WIDGET (icon_view)->allocation.width - item->width); - value = CLAMP (icon_view->priv->hadjustment->value + offset, - icon_view->priv->hadjustment->lower, - icon_view->priv->hadjustment->upper - icon_view->priv->hadjustment->page_size); - gtk_adjustment_set_value (icon_view->priv->hadjustment, value); + + gtk_adjustment_set_value (icon_view->priv->hadjustment, + icon_view->priv->hadjustment->value + offset); gtk_adjustment_changed (icon_view->priv->hadjustment); gtk_adjustment_changed (icon_view->priv->vadjustment); @@ -5192,7 +5217,7 @@ gtk_icon_view_get_visible_range (GtkIconView *icon_view, /** * gtk_icon_view_selected_foreach: * @icon_view: A #GtkIconView. - * @func: The funcion to call for each selected icon. + * @func: The function to call for each selected icon. * @data: User data to pass to the function. * * Calls a function for each selected icon. Note that the model or @@ -5917,6 +5942,68 @@ gtk_icon_view_path_is_selected (GtkIconView *icon_view, return item->selected; } +/** + * gtk_icon_view_get_item_row: + * @icon_view: a #GtkIconView + * @path: the #GtkTreePath of the item + * + * Gets the row in which the item @path is currently + * displayed. Row numbers start at 0. + * + * Returns: The row in which the item is displayed + * + * Since: 2.22 + */ +gint +gtk_icon_view_get_item_row (GtkIconView *icon_view, + GtkTreePath *path) +{ + GtkIconViewItem *item; + + g_return_val_if_fail (GTK_IS_ICON_VIEW (icon_view), FALSE); + g_return_val_if_fail (icon_view->priv->model != NULL, FALSE); + g_return_val_if_fail (path != NULL, FALSE); + + item = g_list_nth_data (icon_view->priv->items, + gtk_tree_path_get_indices(path)[0]); + + if (!item) + return -1; + + return item->row; +} + +/** + * gtk_icon_view_get_item_column: + * @icon_view: a #GtkIconView + * @path: the #GtkTreePath of the item + * + * Gets the column in which the item @path is currently + * displayed. Column numbers start at 0. + * + * Returns: The column in which the item is displayed + * + * Since: 2.22 + */ +gint +gtk_icon_view_get_item_column (GtkIconView *icon_view, + GtkTreePath *path) +{ + GtkIconViewItem *item; + + g_return_val_if_fail (GTK_IS_ICON_VIEW (icon_view), FALSE); + g_return_val_if_fail (icon_view->priv->model != NULL, FALSE); + g_return_val_if_fail (path != NULL, FALSE); + + item = g_list_nth_data (icon_view->priv->items, + gtk_tree_path_get_indices(path)[0]); + + if (!item) + return -1; + + return item->col; +} + /** * gtk_icon_view_item_activated: * @icon_view: A #GtkIconView @@ -6485,7 +6572,6 @@ gtk_icon_view_autoscroll (GtkIconView *icon_view) { gint px, py, x, y, width, height; gint hoffset, voffset; - gfloat value; gdk_window_get_pointer (GTK_WIDGET (icon_view)->window, &px, &py, NULL); gdk_window_get_geometry (GTK_WIDGET (icon_view)->window, &x, &y, &width, &height, NULL); @@ -6500,19 +6586,12 @@ gtk_icon_view_autoscroll (GtkIconView *icon_view) hoffset = MAX (px - (x + width - 2 * SCROLL_EDGE_SIZE), 0); if (voffset != 0) - { - value = CLAMP (icon_view->priv->vadjustment->value + voffset, - icon_view->priv->vadjustment->lower, - icon_view->priv->vadjustment->upper - icon_view->priv->vadjustment->page_size); - gtk_adjustment_set_value (icon_view->priv->vadjustment, value); - } + gtk_adjustment_set_value (icon_view->priv->vadjustment, + icon_view->priv->vadjustment->value + voffset); + if (hoffset != 0) - { - value = CLAMP (icon_view->priv->hadjustment->value + hoffset, - icon_view->priv->hadjustment->lower, - icon_view->priv->hadjustment->upper - icon_view->priv->hadjustment->page_size); - gtk_adjustment_set_value (icon_view->priv->hadjustment, value); - } + gtk_adjustment_set_value (icon_view->priv->hadjustment, + icon_view->priv->hadjustment->value + hoffset); } diff --git a/gtk/gtkiconview.h b/gtk/gtkiconview.h index 7b9e51d227..422b51a385 100644 --- a/gtk/gtkiconview.h +++ b/gtk/gtkiconview.h @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -154,6 +154,10 @@ void gtk_icon_view_unselect_path (GtkIconView *icon_ GtkTreePath *path); gboolean gtk_icon_view_path_is_selected (GtkIconView *icon_view, GtkTreePath *path); +gint gtk_icon_view_get_item_row (GtkIconView *icon_view, + GtkTreePath *path); +gint gtk_icon_view_get_item_column (GtkIconView *icon_view, + GtkTreePath *path); GList *gtk_icon_view_get_selected_items (GtkIconView *icon_view); void gtk_icon_view_select_all (GtkIconView *icon_view); void gtk_icon_view_unselect_all (GtkIconView *icon_view); diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c index 6654f0db62..9edae99a16 100644 --- a/gtk/gtkimage.c +++ b/gtk/gtkimage.c @@ -134,6 +134,11 @@ struct _GtkImagePrivate /* Only used with GTK_IMAGE_ANIMATION, GTK_IMAGE_PIXBUF */ gchar *filename; + /* a GtkStateType, with -1 meaning an invalid state, + * only used with GTK_IMAGE_GICON, GTK_IMAGE_ICON_NAME */ + gint last_rendered_state; + gboolean was_symbolic; + gint pixel_size; guint need_calc_size : 1; }; @@ -1521,46 +1526,6 @@ gtk_image_new (void) return g_object_new (GTK_TYPE_IMAGE, NULL); } -/** - * gtk_image_set: - * @image: a #GtkImage - * @val: a #GdkImage - * @mask: a #GdkBitmap that indicates which parts of the image should be transparent. - * - * Sets the #GtkImage. - * - * Deprecated: 2.0: Use gtk_image_set_from_image() instead. - */ -void -gtk_image_set (GtkImage *image, - GdkImage *val, - GdkBitmap *mask) -{ - g_return_if_fail (GTK_IS_IMAGE (image)); - - gtk_image_set_from_image (image, val, mask); -} - -/** - * gtk_image_get: - * @image: a #GtkImage - * @val: return location for a #GdkImage - * @mask: a #GdkBitmap that indicates which parts of the image should be transparent. - * - * Gets the #GtkImage. - * - * Deprecated: 2.0: Use gtk_image_get_image() instead. - */ -void -gtk_image_get (GtkImage *image, - GdkImage **val, - GdkBitmap **mask) -{ - g_return_if_fail (GTK_IS_IMAGE (image)); - - gtk_image_get_image (image, val, mask); -} - static void gtk_image_reset_anim_iter (GtkImage *image) { @@ -1628,6 +1593,10 @@ animation_timeout (gpointer data) static void icon_theme_changed (GtkImage *image) { + GtkImagePrivate *priv; + + priv = GTK_IMAGE_GET_PRIVATE (image); + if (image->storage_type == GTK_IMAGE_ICON_NAME) { if (image->data.name.pixbuf) @@ -1647,7 +1616,8 @@ icon_theme_changed (GtkImage *image) } static void -ensure_pixbuf_for_icon_name (GtkImage *image) +ensure_pixbuf_for_icon_name (GtkImage *image, + GtkStateType state) { GtkImagePrivate *priv; GdkScreen *screen; @@ -1655,8 +1625,8 @@ ensure_pixbuf_for_icon_name (GtkImage *image) GtkSettings *settings; gint width, height; gint *sizes, *s, dist; + GtkIconInfo *info; GtkIconLookupFlags flags; - GError *error = NULL; g_return_if_fail (image->storage_type == GTK_IMAGE_ICON_NAME); @@ -1665,8 +1635,15 @@ ensure_pixbuf_for_icon_name (GtkImage *image) icon_theme = gtk_icon_theme_get_for_screen (screen); settings = gtk_settings_get_for_screen (screen); flags = GTK_ICON_LOOKUP_USE_BUILTIN; - if (image->data.name.pixbuf == NULL) + if (image->data.name.pixbuf == NULL || + (priv->was_symbolic && priv->last_rendered_state != state)) { + priv->last_rendered_state = state; + if (image->data.name.pixbuf) + { + g_object_unref (image->data.name.pixbuf); + image->data.name.pixbuf = NULL; + } if (priv->pixel_size != -1) { width = height = priv->pixel_size; @@ -1714,24 +1691,57 @@ ensure_pixbuf_for_icon_name (GtkImage *image) width = height = 24; } } - image->data.name.pixbuf = - gtk_icon_theme_load_icon (icon_theme, - image->data.name.icon_name, - MIN (width, height), flags, &error); + + info = gtk_icon_theme_lookup_icon (icon_theme, + image->data.name.icon_name, + MIN (width, height), flags); + if (info) + { + GdkColor error_color, warning_color, success_color; + GdkColor *error_ptr, *warning_ptr, *success_ptr; + GtkStyle *style; + gboolean was_symbolic; + + style = gtk_widget_get_style (GTK_WIDGET (image)); + if (!gtk_style_lookup_color (style, "error_color", &error_color)) + error_ptr = NULL; + else + error_ptr = &error_color; + if (!gtk_style_lookup_color (style, "warning_color", &warning_color)) + warning_ptr = NULL; + else + warning_ptr = &warning_color; + if (!gtk_style_lookup_color (style, "success_color", &success_color)) + success_ptr = NULL; + else + success_ptr = &success_color; + + image->data.name.pixbuf = gtk_icon_info_load_symbolic (info, + &style->fg[state], + success_ptr, + warning_ptr, + error_ptr, + &was_symbolic, + NULL); + priv->was_symbolic = was_symbolic; + gtk_icon_info_free (info); + } + if (image->data.name.pixbuf == NULL) { - g_error_free (error); image->data.name.pixbuf = gtk_widget_render_icon (GTK_WIDGET (image), GTK_STOCK_MISSING_IMAGE, image->icon_size, NULL); + priv->was_symbolic = FALSE; } } } static void -ensure_pixbuf_for_gicon (GtkImage *image) +ensure_pixbuf_for_gicon (GtkImage *image, + GtkStateType state) { GtkImagePrivate *priv; GdkScreen *screen; @@ -1748,8 +1758,15 @@ ensure_pixbuf_for_gicon (GtkImage *image) icon_theme = gtk_icon_theme_get_for_screen (screen); settings = gtk_settings_get_for_screen (screen); flags = GTK_ICON_LOOKUP_USE_BUILTIN; - if (image->data.gicon.pixbuf == NULL) + if (image->data.gicon.pixbuf == NULL || + (priv->was_symbolic && priv->last_rendered_state != state)) { + priv->last_rendered_state = state; + if (image->data.gicon.pixbuf) + { + g_object_unref (image->data.gicon.pixbuf); + image->data.gicon.pixbuf = NULL; + } if (priv->pixel_size != -1) { width = height = priv->pixel_size; @@ -1773,7 +1790,33 @@ ensure_pixbuf_for_gicon (GtkImage *image) MIN (width, height), flags); if (info) { - image->data.gicon.pixbuf = gtk_icon_info_load_icon (info, NULL); + GdkColor error_color, warning_color, success_color; + GdkColor *error_ptr, *warning_ptr, *success_ptr; + GtkStyle *style; + gboolean was_symbolic; + + style = gtk_widget_get_style (GTK_WIDGET (image)); + if (!gtk_style_lookup_color (style, "error_color", &error_color)) + error_ptr = NULL; + else + error_ptr = &error_color; + if (!gtk_style_lookup_color (style, "warning_color", &warning_color)) + warning_ptr = NULL; + else + warning_ptr = &warning_color; + if (!gtk_style_lookup_color (style, "success_color", &success_color)) + success_ptr = NULL; + else + success_ptr = &success_color; + + image->data.gicon.pixbuf = gtk_icon_info_load_symbolic (info, + &style->fg[state], + success_ptr, + warning_ptr, + error_ptr, + &was_symbolic, + NULL); + priv->was_symbolic = was_symbolic; gtk_icon_info_free (info); } @@ -1784,6 +1827,7 @@ ensure_pixbuf_for_gicon (GtkImage *image) GTK_STOCK_MISSING_IMAGE, image->icon_size, NULL); + priv->was_symbolic = FALSE; } } } @@ -1845,6 +1889,7 @@ gtk_image_expose (GtkWidget *widget, gint x, y, mask_x, mask_y; GdkBitmap *mask; GdkPixbuf *pixbuf; + GtkStateType state; gboolean needs_state_transform; image = GTK_IMAGE (widget); @@ -2012,7 +2057,18 @@ gtk_image_expose (GtkWidget *widget, break; case GTK_IMAGE_ICON_NAME: - ensure_pixbuf_for_icon_name (image); + state = gtk_widget_get_state (widget); + if (state == GTK_STATE_INSENSITIVE) + { + ensure_pixbuf_for_icon_name (image, GTK_STATE_NORMAL); + } + else + { + ensure_pixbuf_for_icon_name (image, state); + /* Already done by the loading function? */ + if (priv->was_symbolic) + needs_state_transform = FALSE; + } pixbuf = image->data.name.pixbuf; if (pixbuf) { @@ -2023,7 +2079,18 @@ gtk_image_expose (GtkWidget *widget, break; case GTK_IMAGE_GICON: - ensure_pixbuf_for_gicon (image); + state = gtk_widget_get_state (widget); + if (state == GTK_STATE_INSENSITIVE) + { + ensure_pixbuf_for_gicon (image, GTK_STATE_NORMAL); + } + else + { + ensure_pixbuf_for_gicon (image, state); + /* Already done by the loading function? */ + if (priv->was_symbolic) + needs_state_transform = FALSE; + } pixbuf = image->data.gicon.pixbuf; if (pixbuf) { @@ -2325,12 +2392,12 @@ gtk_image_calc_size (GtkImage *image) NULL); break; case GTK_IMAGE_ICON_NAME: - ensure_pixbuf_for_icon_name (image); + ensure_pixbuf_for_icon_name (image, GTK_STATE_NORMAL); pixbuf = image->data.name.pixbuf; if (pixbuf) g_object_ref (pixbuf); break; case GTK_IMAGE_GICON: - ensure_pixbuf_for_gicon (image); + ensure_pixbuf_for_gicon (image, GTK_STATE_NORMAL); pixbuf = image->data.gicon.pixbuf; if (pixbuf) g_object_ref (pixbuf); diff --git a/gtk/gtkimage.h b/gtk/gtkimage.h index dd6153c44c..13da499888 100644 --- a/gtk/gtkimage.h +++ b/gtk/gtkimage.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -258,17 +258,6 @@ void gtk_image_get_gicon (GtkImage *image, GtkIconSize *size); gint gtk_image_get_pixel_size (GtkImage *image); -#ifndef GTK_DISABLE_DEPRECATED -/* These three are deprecated */ - -void gtk_image_set (GtkImage *image, - GdkImage *val, - GdkBitmap *mask); -void gtk_image_get (GtkImage *image, - GdkImage **val, - GdkBitmap **mask); -#endif /* GTK_DISABLE_DEPRECATED */ - G_END_DECLS #endif /* __GTK_IMAGE_H__ */ diff --git a/gtk/gtkimagemenuitem.c b/gtk/gtkimagemenuitem.c index 3c934766a3..f634d71359 100644 --- a/gtk/gtkimagemenuitem.c +++ b/gtk/gtkimagemenuitem.c @@ -726,8 +726,8 @@ gtk_image_menu_item_new_with_mnemonic (const gchar *label) /** * gtk_image_menu_item_new_from_stock: * @stock_id: the name of the stock item. - * @accel_group: the #GtkAccelGroup to add the menu items accelerator to, - * or %NULL. + * @accel_group: (allow-none): the #GtkAccelGroup to add the menu items + * accelerator to, or %NULL. * @returns: a new #GtkImageMenuItem. * * Creates a new #GtkImageMenuItem containing the image and text from a diff --git a/gtk/gtkimagemenuitem.h b/gtk/gtkimagemenuitem.h index b82bdfd319..7d50ea44b6 100644 --- a/gtk/gtkimagemenuitem.h +++ b/gtk/gtkimagemenuitem.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkimcontext.c b/gtk/gtkimcontext.c index 2768b0b153..7aec5c1d6b 100644 --- a/gtk/gtkimcontext.c +++ b/gtk/gtkimcontext.c @@ -96,7 +96,7 @@ * * After a new loadable input method module has been installed on the system, * the configuration file gtk.immodules needs to be - * regenerated by gtk-query-immodules-2.0, + * regenerated by gtk-query-immodules-3.0, * in order for the new input method to become available to GTK+ applications. */ diff --git a/gtk/gtkimcontext.h b/gtk/gtkimcontext.h index a0f26471a5..21452f2cce 100644 --- a/gtk/gtkimcontext.h +++ b/gtk/gtkimcontext.h @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkimcontextsimple.h b/gtk/gtkimcontextsimple.h index 2c44db25a3..8017c314f8 100644 --- a/gtk/gtkimcontextsimple.h +++ b/gtk/gtkimcontextsimple.h @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkimmulticontext.h b/gtk/gtkimmulticontext.h index 951ddae266..418a9327f7 100644 --- a/gtk/gtkimmulticontext.h +++ b/gtk/gtkimmulticontext.h @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkinputdialog.c b/gtk/gtkinputdialog.c deleted file mode 100644 index c91467b6ae..0000000000 --- a/gtk/gtkinputdialog.c +++ /dev/null @@ -1,764 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * gtkinputdialog.c - * - * Copyright 1997 Owen Taylor - * - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#include "config.h" - -#include - -#include "gdk/gdkkeysyms.h" - -#undef GTK_DISABLE_DEPRECATED /* GtkOptionMenu */ - -#include "gtkinputdialog.h" -#include "gtkbutton.h" -#include "gtkentry.h" -#include "gtkhbox.h" -#include "gtklabel.h" -#include "gtkmain.h" -#include "gtkmarshalers.h" -#include "gtkmenu.h" -#include "gtkmenuitem.h" -#include "gtknotebook.h" -#include "gtkoptionmenu.h" -#include "gtkscrolledwindow.h" -#include "gtkstock.h" -#include "gtktable.h" -#include "gtkvbox.h" - -#include "gtkintl.h" -#include "gtkalias.h" - -typedef struct _GtkInputDialogPrivate GtkInputDialogPrivate; -typedef struct _GtkInputKeyInfo GtkInputKeyInfo; - -struct _GtkInputDialogPrivate -{ - GtkWidget *device_menu; - GtkWidget *device_optionmenu; - GtkWidget *no_devices_label; - GtkWidget *main_vbox; -}; - -struct _GtkInputKeyInfo -{ - gint index; - GtkWidget *entry; - GtkInputDialog *inputd; -}; - -enum -{ - ENABLE_DEVICE, - DISABLE_DEVICE, - LAST_SIGNAL -}; - - -#define AXIS_LIST_WIDTH 160 -#define AXIS_LIST_HEIGHT 175 - -#define KEYS_LIST_WIDTH 200 -#define KEYS_LIST_HEIGHT 175 - -/* Forward declarations */ - -static void gtk_input_dialog_screen_changed (GtkWidget *widget, - GdkScreen *previous_screen); -static void gtk_input_dialog_set_device (GtkWidget *widget, - gpointer data); -static void gtk_input_dialog_set_mapping_mode (GtkWidget *w, - gpointer data); -static void gtk_input_dialog_set_axis (GtkWidget *widget, - gpointer data); -static void gtk_input_dialog_fill_axes (GtkInputDialog *inputd, - GdkDevice *info); -static void gtk_input_dialog_set_key (GtkInputKeyInfo *key, - guint keyval, - GdkModifierType modifiers); -static gboolean gtk_input_dialog_key_press (GtkWidget *widget, - GdkEventKey *event, - GtkInputKeyInfo *key); -static void gtk_input_dialog_clear_key (GtkWidget *widget, - GtkInputKeyInfo *key); -static void gtk_input_dialog_destroy_key (GtkWidget *widget, - GtkInputKeyInfo *key); -static void gtk_input_dialog_fill_keys (GtkInputDialog *inputd, - GdkDevice *info); - -static guint input_dialog_signals[LAST_SIGNAL] = { 0 }; - -G_DEFINE_TYPE (GtkInputDialog, gtk_input_dialog, GTK_TYPE_DIALOG) - -static GtkInputDialogPrivate * -gtk_input_dialog_get_private (GtkInputDialog *input_dialog) -{ - return G_TYPE_INSTANCE_GET_PRIVATE (input_dialog, - GTK_TYPE_INPUT_DIALOG, - GtkInputDialogPrivate); -} - -static GtkInputDialog * -input_dialog_from_widget (GtkWidget *widget) -{ - GtkWidget *toplevel; - - if (GTK_IS_MENU_ITEM (widget)) - { - GtkMenu *menu = GTK_MENU (widget->parent); - widget = gtk_menu_get_attach_widget (menu); - } - - toplevel = gtk_widget_get_toplevel (widget); - return GTK_INPUT_DIALOG (toplevel); -} - -static void -gtk_input_dialog_class_init (GtkInputDialogClass *klass) -{ - GObjectClass *object_class = (GObjectClass *) klass; - GtkWidgetClass *widget_class = (GtkWidgetClass *)klass; - - widget_class->screen_changed = gtk_input_dialog_screen_changed; - - klass->enable_device = NULL; - klass->disable_device = NULL; - - input_dialog_signals[ENABLE_DEVICE] = - g_signal_new (I_("enable-device"), - G_OBJECT_CLASS_TYPE (klass), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GtkInputDialogClass, enable_device), - NULL, NULL, - _gtk_marshal_VOID__OBJECT, - G_TYPE_NONE, 1, - GDK_TYPE_DEVICE); - - input_dialog_signals[DISABLE_DEVICE] = - g_signal_new (I_("disable-device"), - G_OBJECT_CLASS_TYPE (klass), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GtkInputDialogClass, disable_device), - NULL, NULL, - _gtk_marshal_VOID__OBJECT, - G_TYPE_NONE, 1, - GDK_TYPE_DEVICE); - - g_type_class_add_private (object_class, sizeof (GtkInputDialogPrivate)); -} - -static void -gtk_input_dialog_init (GtkInputDialog *inputd) -{ - GtkInputDialogPrivate *private = gtk_input_dialog_get_private (inputd); - GtkDialog *dialog = GTK_DIALOG (inputd); - GtkWidget *util_box; - GtkWidget *label; - GtkWidget *mapping_menu; - GtkWidget *menuitem; - GtkWidget *notebook; - - gtk_widget_push_composite_child (); - - gtk_window_set_title (GTK_WINDOW (inputd), _("Input")); - - gtk_dialog_set_has_separator (dialog, FALSE); - gtk_container_set_border_width (GTK_CONTAINER (dialog), 5); - gtk_box_set_spacing (GTK_BOX (dialog->vbox), 2); /* 2 * 5 + 2 = 12 */ - gtk_container_set_border_width (GTK_CONTAINER (dialog->action_area), 5); - gtk_box_set_spacing (GTK_BOX (dialog->action_area), 6); - - /* main vbox */ - - private->main_vbox = gtk_vbox_new (FALSE, 12); - gtk_container_set_border_width (GTK_CONTAINER (private->main_vbox), 5); - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (inputd)->vbox), private->main_vbox, - TRUE, TRUE, 0); - - private->no_devices_label = gtk_label_new (_("No extended input devices")); - gtk_container_set_border_width (GTK_CONTAINER (private->main_vbox), 5); - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (inputd)->vbox), - private->no_devices_label, - TRUE, TRUE, 0); - - /* menu for selecting device */ - - private->device_menu = gtk_menu_new (); - - util_box = gtk_hbox_new (FALSE, 12); - gtk_box_pack_start (GTK_BOX (private->main_vbox), util_box, FALSE, FALSE, 0); - - label = gtk_label_new_with_mnemonic (_("_Device:")); - gtk_box_pack_start (GTK_BOX (util_box), label, FALSE, FALSE, 0); - - private->device_optionmenu = gtk_option_menu_new (); - gtk_label_set_mnemonic_widget (GTK_LABEL (label), private->device_optionmenu); - gtk_box_pack_start (GTK_BOX (util_box), private->device_optionmenu, TRUE, TRUE, 0); - gtk_widget_show (private->device_optionmenu); - gtk_option_menu_set_menu (GTK_OPTION_MENU (private->device_optionmenu), private->device_menu); - - gtk_widget_show (label); - - /* Device options */ - - /* mapping mode option menu */ - - mapping_menu = gtk_menu_new (); - - menuitem = gtk_menu_item_new_with_label(_("Disabled")); - gtk_menu_shell_append (GTK_MENU_SHELL (mapping_menu), menuitem); - gtk_widget_show (menuitem); - g_signal_connect (menuitem, "activate", - G_CALLBACK (gtk_input_dialog_set_mapping_mode), - GINT_TO_POINTER (GDK_MODE_DISABLED)); - - menuitem = gtk_menu_item_new_with_label(_("Screen")); - gtk_menu_shell_append (GTK_MENU_SHELL (mapping_menu), menuitem); - gtk_widget_show (menuitem); - g_signal_connect (menuitem, "activate", - G_CALLBACK (gtk_input_dialog_set_mapping_mode), - GINT_TO_POINTER (GDK_MODE_SCREEN)); - - menuitem = gtk_menu_item_new_with_label(_("Window")); - gtk_menu_shell_append (GTK_MENU_SHELL (mapping_menu), menuitem); - gtk_widget_show (menuitem); - g_signal_connect (menuitem, "activate", - G_CALLBACK (gtk_input_dialog_set_mapping_mode), - GINT_TO_POINTER (GDK_MODE_WINDOW)); - - label = gtk_label_new_with_mnemonic (_("_Mode:")); - gtk_box_pack_start (GTK_BOX (util_box), label, FALSE, FALSE, 0); - - inputd->mode_optionmenu = gtk_option_menu_new (); - gtk_label_set_mnemonic_widget (GTK_LABEL (label), inputd->mode_optionmenu); - gtk_box_pack_start (GTK_BOX (util_box), inputd->mode_optionmenu, FALSE, FALSE, 0); - gtk_widget_show (inputd->mode_optionmenu); - gtk_option_menu_set_menu (GTK_OPTION_MENU (inputd->mode_optionmenu), mapping_menu); - - gtk_widget_show(label); - - gtk_widget_show (util_box); - - /* Notebook */ - - notebook = gtk_notebook_new (); - gtk_box_pack_start (GTK_BOX (private->main_vbox), notebook, TRUE, TRUE, 0); - gtk_widget_show (notebook); - - /* The axis listbox */ - - label = gtk_label_new (_("Axes")); - - inputd->axis_listbox = gtk_scrolled_window_new (NULL, NULL); - gtk_container_set_border_width (GTK_CONTAINER (inputd->axis_listbox), 12); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(inputd->axis_listbox), - GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - - gtk_widget_set_size_request (inputd->axis_listbox, - AXIS_LIST_WIDTH, AXIS_LIST_HEIGHT); - gtk_notebook_append_page (GTK_NOTEBOOK(notebook), - inputd->axis_listbox, label); - - gtk_widget_show (inputd->axis_listbox); - - inputd->axis_list = NULL; - - /* Keys listbox */ - - label = gtk_label_new (_("Keys")); - - inputd->keys_listbox = gtk_scrolled_window_new (NULL, NULL); - gtk_container_set_border_width (GTK_CONTAINER (inputd->keys_listbox), 12); - gtk_widget_set_size_request (inputd->keys_listbox, - KEYS_LIST_WIDTH, KEYS_LIST_HEIGHT); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (inputd->keys_listbox), - GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - gtk_notebook_append_page (GTK_NOTEBOOK (notebook), - inputd->keys_listbox, label); - - gtk_widget_show (inputd->keys_listbox); - - inputd->keys_list = NULL; - - inputd->save_button = gtk_button_new_from_stock (GTK_STOCK_SAVE); - gtk_widget_set_can_default (inputd->save_button, TRUE); - gtk_box_pack_start (GTK_BOX (GTK_DIALOG(inputd)->action_area), - inputd->save_button, TRUE, TRUE, 0); - gtk_widget_show (inputd->save_button); - - inputd->close_button = gtk_button_new_from_stock (GTK_STOCK_CLOSE); - gtk_widget_set_can_default (inputd->close_button, TRUE); - gtk_box_pack_start (GTK_BOX (GTK_DIALOG(inputd)->action_area), - inputd->close_button, TRUE, TRUE, 0); - - gtk_widget_show (inputd->close_button); - gtk_widget_grab_default (inputd->close_button); - - gtk_widget_pop_composite_child (); - - gtk_input_dialog_screen_changed (GTK_WIDGET (inputd), NULL); - - _gtk_dialog_set_ignore_separator (dialog, TRUE); -} - -static void -gtk_input_dialog_screen_changed (GtkWidget *widget, - GdkScreen *previous_screen) -{ - GtkInputDialog *inputd = GTK_INPUT_DIALOG (widget); - GtkInputDialogPrivate *private = gtk_input_dialog_get_private (inputd); - - GList *device_info = NULL; - GdkDevice *core_pointer = NULL; - GList *tmp_list; - - if (gtk_widget_has_screen (widget)) - { - GdkDisplay *display; - - display = gtk_widget_get_display (widget); - device_info = gdk_display_list_devices (display); - core_pointer = gdk_display_get_core_pointer (display); - } - - inputd->current_device = NULL; - gtk_container_foreach (GTK_CONTAINER (private->device_menu), - (GtkCallback)gtk_widget_destroy, NULL); - - if (g_list_length(device_info) <= 1) /* only core device */ - { - gtk_widget_hide (private->main_vbox); - gtk_widget_show (private->no_devices_label); - gtk_widget_set_sensitive(inputd->save_button, FALSE); - } - else - { - gtk_widget_show (private->main_vbox); - gtk_widget_hide (private->no_devices_label); - gtk_widget_set_sensitive(inputd->save_button, TRUE); - - for (tmp_list = device_info; tmp_list; tmp_list = tmp_list->next) - { - GdkDevice *info = tmp_list->data; - if (info != core_pointer) - { - GtkWidget *menuitem; - - menuitem = gtk_menu_item_new_with_label (info->name); - - gtk_menu_shell_append (GTK_MENU_SHELL (private->device_menu), - menuitem); - gtk_widget_show (menuitem); - g_signal_connect (menuitem, "activate", - G_CALLBACK (gtk_input_dialog_set_device), - info); - } - } - - gtk_input_dialog_set_device (widget, device_info->data); - gtk_option_menu_set_history (GTK_OPTION_MENU (private->device_optionmenu), 0); - } -} - -GtkWidget* -gtk_input_dialog_new (void) -{ - GtkInputDialog *inputd; - - inputd = g_object_new (GTK_TYPE_INPUT_DIALOG, NULL); - - return GTK_WIDGET (inputd); -} - -static void -gtk_input_dialog_set_device (GtkWidget *w, - gpointer data) -{ - GdkDevice *device = data; - GtkInputDialog *inputd = input_dialog_from_widget (w); - - inputd->current_device = device; - - gtk_input_dialog_fill_axes (inputd, device); - gtk_input_dialog_fill_keys (inputd, device); - - gtk_option_menu_set_history (GTK_OPTION_MENU (inputd->mode_optionmenu), - device->mode); -} - -static void -gtk_input_dialog_set_mapping_mode (GtkWidget *w, - gpointer data) -{ - GtkInputDialog *inputd = input_dialog_from_widget (w); - GdkDevice *info = inputd->current_device; - GdkInputMode old_mode; - GdkInputMode mode = GPOINTER_TO_INT (data); - - if (!info) - return; - - old_mode = info->mode; - - if (mode != old_mode) - { - if (gdk_device_set_mode (info, mode)) - { - if (mode == GDK_MODE_DISABLED) - g_signal_emit (inputd, - input_dialog_signals[DISABLE_DEVICE], - 0, - info); - else - g_signal_emit (inputd, - input_dialog_signals[ENABLE_DEVICE], - 0, - info); - } - else - gtk_option_menu_set_history (GTK_OPTION_MENU (inputd->mode_optionmenu), - old_mode); - - /* FIXME: error dialog ? */ - } -} - -static void -gtk_input_dialog_set_axis (GtkWidget *w, - gpointer data) -{ - GdkAxisUse use = GPOINTER_TO_INT(data) & 0xFFFF; - GdkAxisUse old_use; - GdkAxisUse *new_axes; - GtkInputDialog *inputd = input_dialog_from_widget (w); - GdkDevice *info = inputd->current_device; - - gint axis = (GPOINTER_TO_INT(data) >> 16) - 1; - gint old_axis; - int i; - - if (!info) - return; - - new_axes = g_new (GdkAxisUse, info->num_axes); - old_axis = -1; - for (i=0;inum_axes;i++) - { - new_axes[i] = info->axes[i].use; - if (info->axes[i].use == use) - old_axis = i; - } - - if (axis != -1) - old_use = info->axes[axis].use; - else - old_use = GDK_AXIS_IGNORE; - - if (axis == old_axis) { - g_free (new_axes); - return; - } - - /* we must always have an x and a y axis */ - if ((axis == -1 && (use == GDK_AXIS_X || use == GDK_AXIS_Y)) || - (old_axis == -1 && (old_use == GDK_AXIS_X || old_use == GDK_AXIS_Y))) - { - gtk_option_menu_set_history ( - GTK_OPTION_MENU (inputd->axis_items[use]), - old_axis + 1); - } - else - { - if (axis != -1) - gdk_device_set_axis_use (info, axis, use); - - if (old_axis != -1) - gdk_device_set_axis_use (info, old_axis, old_use); - - if (old_use != GDK_AXIS_IGNORE) - { - gtk_option_menu_set_history ( - GTK_OPTION_MENU (inputd->axis_items[old_use]), - old_axis + 1); - } - } - - g_free (new_axes); -} - -static void -gtk_input_dialog_fill_axes(GtkInputDialog *inputd, GdkDevice *info) -{ - static const char *const axis_use_strings[GDK_AXIS_LAST] = - { - "", - N_("_X:"), - N_("_Y:"), - N_("_Pressure:"), - N_("X _tilt:"), - N_("Y t_ilt:"), - N_("_Wheel:") - }; - - int i,j; - GtkWidget *menu; - GtkWidget *option_menu; - GtkWidget *label; - GtkWidget *viewport; - GtkWidget *old_child; - - /* remove all the old items */ - if (inputd->axis_list) - { - gtk_widget_hide (inputd->axis_list); /* suppress resizes (or get warnings) */ - gtk_widget_destroy (inputd->axis_list); - } - inputd->axis_list = gtk_table_new (GDK_AXIS_LAST, 2, 0); - gtk_table_set_row_spacings (GTK_TABLE (inputd->axis_list), 6); - gtk_table_set_col_spacings (GTK_TABLE (inputd->axis_list), 12); - - viewport = gtk_viewport_new (NULL, NULL); - old_child = gtk_bin_get_child (GTK_BIN (inputd->axis_listbox)); - if (old_child != NULL) - gtk_widget_destroy (old_child); - gtk_container_add (GTK_CONTAINER (inputd->axis_listbox), viewport); - gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport), GTK_SHADOW_NONE); - gtk_widget_show (viewport); - gtk_container_add (GTK_CONTAINER (viewport), inputd->axis_list); - gtk_widget_show (inputd->axis_list); - - gtk_widget_realize (inputd->axis_list); - gdk_window_set_background (inputd->axis_list->window, - &inputd->axis_list->style->base[GTK_STATE_NORMAL]); - - for (i=GDK_AXIS_X;iaxis_list), label, 0, 1, i, i+1, - GTK_FILL, 0, 2, 2); - - /* and the use option menu */ - menu = gtk_menu_new(); - - for (j = -1; j < info->num_axes; j++) - { - char buffer[16]; - GtkWidget *menu_item; - - if (j == -1) - menu_item = gtk_menu_item_new_with_label (_("none")); - else - { - g_snprintf (buffer, sizeof (buffer), "%d", j+1); - menu_item = gtk_menu_item_new_with_label (buffer); - } - g_signal_connect (menu_item, "activate", - G_CALLBACK (gtk_input_dialog_set_axis), - GINT_TO_POINTER (0x10000 * (j + 1) + i)); - gtk_widget_show (menu_item); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item); - } - - inputd->axis_items[i] = option_menu = gtk_option_menu_new (); - gtk_label_set_mnemonic_widget (GTK_LABEL (label), option_menu); - gtk_table_attach (GTK_TABLE (inputd->axis_list), option_menu, - 1, 2, i, i+1, GTK_EXPAND | GTK_FILL, 0, 2, 2); - - gtk_widget_show (option_menu); - gtk_option_menu_set_menu (GTK_OPTION_MENU (option_menu), menu); - for (j = 0; j < info->num_axes; j++) - if (info->axes[j].use == (GdkAxisUse) i) - { - gtk_option_menu_set_history (GTK_OPTION_MENU (option_menu), j+1); - break; - } - - gtk_widget_show (label); - } -} - -static void -gtk_input_dialog_clear_key (GtkWidget *widget, GtkInputKeyInfo *key) -{ - if (!key->inputd->current_device) - return; - - gtk_entry_set_text (GTK_ENTRY(key->entry), _("(disabled)")); - gdk_device_set_key (key->inputd->current_device, key->index, 0, 0); -} - -static void -gtk_input_dialog_set_key (GtkInputKeyInfo *key, - guint keyval, GdkModifierType modifiers) -{ - GString *str; - gchar chars[2]; - - if (keyval) - { - str = g_string_new (NULL); - - if (modifiers & GDK_SHIFT_MASK) - g_string_append (str, "Shift+"); - if (modifiers & GDK_CONTROL_MASK) - g_string_append (str, "Ctrl+"); - if (modifiers & GDK_MOD1_MASK) - g_string_append (str, "Alt+"); - - if ((keyval >= 0x20) && (keyval <= 0xFF)) - { - chars[0] = keyval; - chars[1] = 0; - g_string_append (str, chars); - } - else - g_string_append (str, _("(unknown)")); - gtk_entry_set_text (GTK_ENTRY(key->entry), str->str); - - g_string_free (str, TRUE); - } - else - { - gtk_entry_set_text (GTK_ENTRY(key->entry), _("(disabled)")); - } -} - -static gboolean -gtk_input_dialog_key_press (GtkWidget *widget, - GdkEventKey *event, - GtkInputKeyInfo *key) -{ - if (!key->inputd->current_device) - return FALSE; - - gtk_input_dialog_set_key (key, event->keyval, event->state & 0xFF); - gdk_device_set_key (key->inputd->current_device, key->index, - event->keyval, event->state & 0xFF); - - g_signal_stop_emission_by_name (widget, "key-press-event"); - - return TRUE; -} - -static void -gtk_input_dialog_destroy_key (GtkWidget *widget, GtkInputKeyInfo *key) -{ - g_free (key); -} - -static void -gtk_input_dialog_fill_keys(GtkInputDialog *inputd, GdkDevice *info) -{ - int i; - GtkWidget *label; - GtkWidget *button; - GtkWidget *hbox; - GtkWidget *viewport; - GtkWidget *old_child; - - char buffer[32]; - - /* remove all the old items */ - if (inputd->keys_list) - { - gtk_widget_hide (inputd->keys_list); /* suppress resizes (or get warnings) */ - gtk_widget_destroy (inputd->keys_list); - } - - inputd->keys_list = gtk_table_new (info->num_keys, 2, FALSE); - gtk_table_set_row_spacings (GTK_TABLE (inputd->keys_list), 6); - gtk_table_set_col_spacings (GTK_TABLE (inputd->keys_list), 12); - - viewport = gtk_viewport_new (NULL, NULL); - old_child = gtk_bin_get_child (GTK_BIN (inputd->keys_listbox)); - if (old_child != NULL) - gtk_widget_destroy (old_child); - gtk_container_add (GTK_CONTAINER (inputd->keys_listbox), viewport); - gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport), GTK_SHADOW_NONE); - gtk_widget_show (viewport); - gtk_container_add (GTK_CONTAINER (viewport), inputd->keys_list); - gtk_widget_show (inputd->keys_list); - - gtk_widget_realize (inputd->keys_list); - gdk_window_set_background (inputd->keys_list->window, - &inputd->keys_list->style->base[GTK_STATE_NORMAL]); - - for (i=0;inum_keys;i++) - { - GtkInputKeyInfo *key = g_new (GtkInputKeyInfo, 1); - key->index = i; - key->inputd = inputd; - - /* create the label */ - - g_snprintf (buffer, sizeof (buffer), "_%d:", i+1); - label = gtk_label_new_with_mnemonic (buffer); - gtk_table_attach (GTK_TABLE (inputd->keys_list), label, 0, 1, i, i+1, - GTK_FILL, 0, 2, 2); - gtk_widget_show (label); - - /* the entry */ - - hbox = gtk_hbox_new (FALSE, 6); - gtk_table_attach (GTK_TABLE (inputd->keys_list), hbox, 1, 2, i, i+1, - GTK_EXPAND | GTK_FILL, 0, 2, 2); - gtk_widget_show (hbox); - - key->entry = gtk_entry_new (); - gtk_label_set_mnemonic_widget (GTK_LABEL (label), key->entry); - gtk_box_pack_start (GTK_BOX (hbox), key->entry, TRUE, TRUE, 0); - gtk_widget_show (key->entry); - - g_signal_connect (key->entry, "key-press-event", - G_CALLBACK (gtk_input_dialog_key_press), key); - g_signal_connect (key->entry, "destroy", - G_CALLBACK (gtk_input_dialog_destroy_key), key); - - /* and clear button */ - - button = gtk_button_new_with_mnemonic (_("Cl_ear")); - gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, TRUE, 0); - gtk_widget_show (button); - - g_signal_connect (button, "clicked", - G_CALLBACK (gtk_input_dialog_clear_key), key); - - gtk_input_dialog_set_key (key, info->keys[i].keyval, - info->keys[i].modifiers); - } -} - -#define __GTK_INPUTDIALOG_C__ -#include "gtkaliasdef.c" diff --git a/gtk/gtkinputdialog.h b/gtk/gtkinputdialog.h deleted file mode 100644 index 6e95356bea..0000000000 --- a/gtk/gtkinputdialog.h +++ /dev/null @@ -1,100 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -/* - * NOTE this widget is considered too specialized/little-used for - * GTK+, and will in the future be moved to some other package. If - * your application needs this widget, feel free to use it, as the - * widget does work and is useful in some applications; it's just not - * of general interest. However, we are not accepting new features for - * the widget, and it will eventually move out of the GTK+ - * distribution. - */ - -#ifndef GTK_DISABLE_DEPRECATED - -#ifndef __GTK_INPUTDIALOG_H__ -#define __GTK_INPUTDIALOG_H__ - - -#include - - -G_BEGIN_DECLS - -#define GTK_TYPE_INPUT_DIALOG (gtk_input_dialog_get_type ()) -#define GTK_INPUT_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_INPUT_DIALOG, GtkInputDialog)) -#define GTK_INPUT_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_INPUT_DIALOG, GtkInputDialogClass)) -#define GTK_IS_INPUT_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_INPUT_DIALOG)) -#define GTK_IS_INPUT_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_INPUT_DIALOG)) -#define GTK_INPUT_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_INPUT_DIALOG, GtkInputDialogClass)) - - -typedef struct _GtkInputDialog GtkInputDialog; -typedef struct _GtkInputDialogClass GtkInputDialogClass; - -struct _GtkInputDialog -{ - GtkDialog dialog; - - GtkWidget *GSEAL (axis_list); - GtkWidget *GSEAL (axis_listbox); - GtkWidget *GSEAL (mode_optionmenu); - - GtkWidget *GSEAL (close_button); - GtkWidget *GSEAL (save_button); - - GtkWidget *GSEAL (axis_items[GDK_AXIS_LAST]); - GdkDevice *GSEAL (current_device); - - GtkWidget *GSEAL (keys_list); - GtkWidget *GSEAL (keys_listbox); -}; - -struct _GtkInputDialogClass -{ - GtkDialogClass parent_class; - - void (* enable_device) (GtkInputDialog *inputd, - GdkDevice *device); - void (* disable_device) (GtkInputDialog *inputd, - GdkDevice *device); - - /* Padding for future expansion */ - void (*_gtk_reserved1) (void); - void (*_gtk_reserved2) (void); - void (*_gtk_reserved3) (void); - void (*_gtk_reserved4) (void); -}; - -GType gtk_input_dialog_get_type (void) G_GNUC_CONST; -GtkWidget* gtk_input_dialog_new (void); - -G_END_DECLS - -#endif /* __GTK_INPUTDIALOG_H__ */ - -#endif /* GTK_DISABLE_DEPRECATED */ diff --git a/gtk/gtkinvisible.c b/gtk/gtkinvisible.c index c24487cb53..8c0b3beb5e 100644 --- a/gtk/gtkinvisible.c +++ b/gtk/gtkinvisible.c @@ -95,7 +95,7 @@ gtk_invisible_init (GtkInvisible *invisible) GdkColormap *colormap; gtk_widget_set_has_window (GTK_WIDGET (invisible), TRUE); - GTK_WIDGET_SET_FLAGS (invisible, GTK_TOPLEVEL); + _gtk_widget_set_is_toplevel (GTK_WIDGET (invisible), TRUE); g_object_ref_sink (invisible); diff --git a/gtk/gtkinvisible.h b/gtk/gtkinvisible.h index 5625f99458..2f38905525 100644 --- a/gtk/gtkinvisible.h +++ b/gtk/gtkinvisible.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkitem.h b/gtk/gtkitem.h index 4c3d3aee63..0475805610 100644 --- a/gtk/gtkitem.h +++ b/gtk/gtkitem.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkitemfactory.c b/gtk/gtkitemfactory.c deleted file mode 100644 index 4197866b14..0000000000 --- a/gtk/gtkitemfactory.c +++ /dev/null @@ -1,1586 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * GtkItemFactory: Flexible item factory with automatic rc handling - * Copyright (C) 1998 Tim Janik - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#include - -#undef GTK_DISABLE_DEPRECATED -#include "gtkitemfactory.h" -#include "gtkoptionmenu.h" -#include "gtkmenubar.h" -#include "gtkmenu.h" -#include "gtkmenuitem.h" -#include "gtkradiomenuitem.h" -#include "gtkcheckmenuitem.h" -#include "gtkimagemenuitem.h" -#include "gtktearoffmenuitem.h" -#include "gtkaccelmap.h" -#include "gtkaccellabel.h" -#include "gdk/gdkkeysyms.h" -#include "gtkimage.h" -#include "gtkstock.h" -#include "gtkiconfactory.h" -#include "gtkintl.h" -#include -#include -#ifdef HAVE_UNISTD_H -#include -#endif -#include - -#include "gtkalias.h" - -/* --- defines --- */ -#define ITEM_FACTORY_STRING ((gchar*) item_factory_string) -#define ITEM_BLOCK_SIZE (128) - - -/* --- structures --- */ -typedef struct _GtkIFCBData GtkIFCBData; -typedef struct _GtkIFDumpData GtkIFDumpData; -struct _GtkIFCBData -{ - GtkItemFactoryCallback func; - guint callback_type; - gpointer func_data; - guint callback_action; -}; - - -/* --- prototypes --- */ -static void gtk_item_factory_destroy (GtkObject *object); -static void gtk_item_factory_finalize (GObject *object); - - -/* --- static variables --- */ -static const gchar item_factory_string[] = "Gtk-"; -static GQuark quark_popup_data = 0; -static GQuark quark_if_menu_pos = 0; -static GQuark quark_item_factory = 0; -static GQuark quark_item_path = 0; -static GQuark quark_action = 0; -static GQuark quark_accel_group = 0; -static GQuark quark_type_item = 0; -static GQuark quark_type_title = 0; -static GQuark quark_type_radio_item = 0; -static GQuark quark_type_check_item = 0; -static GQuark quark_type_toggle_item = 0; -static GQuark quark_type_image_item = 0; -static GQuark quark_type_stock_item = 0; -static GQuark quark_type_tearoff_item = 0; -static GQuark quark_type_separator_item = 0; -static GQuark quark_type_branch = 0; -static GQuark quark_type_last_branch = 0; - -G_DEFINE_TYPE (GtkItemFactory, gtk_item_factory, GTK_TYPE_OBJECT) - -/* --- functions --- */ -static void -gtk_item_factory_class_init (GtkItemFactoryClass *class) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (class); - GtkObjectClass *object_class = GTK_OBJECT_CLASS (class); - - gobject_class->finalize = gtk_item_factory_finalize; - - object_class->destroy = gtk_item_factory_destroy; - - class->item_ht = g_hash_table_new (g_str_hash, g_str_equal); - - quark_popup_data = g_quark_from_static_string ("GtkItemFactory-popup-data"); - quark_if_menu_pos = g_quark_from_static_string ("GtkItemFactory-menu-position"); - quark_item_factory = g_quark_from_static_string ("GtkItemFactory"); - quark_item_path = g_quark_from_static_string ("GtkItemFactory-path"); - quark_action = g_quark_from_static_string ("GtkItemFactory-action"); - quark_accel_group = g_quark_from_static_string ("GtkAccelGroup"); - quark_type_item = g_quark_from_static_string (""); - quark_type_title = g_quark_from_static_string (""); - quark_type_radio_item = g_quark_from_static_string ("<RadioItem>"); - quark_type_check_item = g_quark_from_static_string ("<CheckItem>"); - quark_type_toggle_item = g_quark_from_static_string ("<ToggleItem>"); - quark_type_image_item = g_quark_from_static_string ("<ImageItem>"); - quark_type_stock_item = g_quark_from_static_string ("<StockItem>"); - quark_type_separator_item = g_quark_from_static_string ("<Separator>"); - quark_type_tearoff_item = g_quark_from_static_string ("<Tearoff>"); - quark_type_branch = g_quark_from_static_string ("<Branch>"); - quark_type_last_branch = g_quark_from_static_string ("<LastBranch>"); -} - -static void -gtk_item_factory_init (GtkItemFactory *ifactory) -{ - ifactory->path = NULL; - ifactory->accel_group = NULL; - ifactory->widget = NULL; - ifactory->items = NULL; - ifactory->translate_func = NULL; - ifactory->translate_data = NULL; - ifactory->translate_notify = NULL; -} - -/** - * gtk_item_factory_new: - * @container_type: the kind of menu to create; can be - * #GTK_TYPE_MENU_BAR, #GTK_TYPE_MENU or #GTK_TYPE_OPTION_MENU - * @path: the factory path of the new item factory, a string of the form - * <literal>"<name>"</literal> - * @accel_group: (allow-none): a #GtkAccelGroup to which the accelerators for the - * menu items will be added, or %NULL to create a new one - * @returns: a new #GtkItemFactory - * - * Creates a new #GtkItemFactory. - * - * Beware that the returned object does not have a floating reference. - * - * Deprecated: 2.4: Use #GtkUIManager instead. - */ -GtkItemFactory* -gtk_item_factory_new (GType container_type, - const gchar *path, - GtkAccelGroup *accel_group) -{ - GtkItemFactory *ifactory; - - g_return_val_if_fail (path != NULL, NULL); - - ifactory = g_object_new (GTK_TYPE_ITEM_FACTORY, NULL); - gtk_item_factory_construct (ifactory, container_type, path, accel_group); - - return ifactory; -} - -static void -gtk_item_factory_callback_marshal (GtkWidget *widget, - gpointer func_data) -{ - GtkIFCBData *data; - - data = func_data; - - if (data->callback_type == 1) - { - GtkItemFactoryCallback1 func1 = (GtkItemFactoryCallback1) data->func; - func1 (data->func_data, data->callback_action, widget); - } - else if (data->callback_type == 2) - { - GtkItemFactoryCallback2 func2 = (GtkItemFactoryCallback2) data->func; - func2 (widget, data->func_data, data->callback_action); - } -} - -static void -gtk_item_factory_item_remove_widget (GtkWidget *widget, - GtkItemFactoryItem *item) -{ - item->widgets = g_slist_remove (item->widgets, widget); - g_object_set_qdata (G_OBJECT (widget), quark_item_factory, NULL); - g_object_set_qdata (G_OBJECT (widget), quark_item_path, NULL); -} - -/** - * gtk_item_factory_add_foreign: - * @accel_widget: widget to install an accelerator on - * @full_path: the full path for the @accel_widget - * @accel_group: the accelerator group to install the accelerator in - * @keyval: key value of the accelerator - * @modifiers: modifier combination of the accelerator - * - * Installs an accelerator for @accel_widget in @accel_group, that causes - * the ::activate signal to be emitted if the accelerator is activated. - * - * This function can be used to make widgets participate in the accel - * saving/restoring functionality provided by gtk_accel_map_save() and - * gtk_accel_map_load(), even if they haven't been created by an item - * factory. - * - * Deprecated: 2.4: The recommended API for this purpose are the functions - * gtk_menu_item_set_accel_path() and gtk_widget_set_accel_path(); don't - * use gtk_item_factory_add_foreign() in new code, since it is likely to - * be removed in the future. - */ -void -gtk_item_factory_add_foreign (GtkWidget *accel_widget, - const gchar *full_path, - GtkAccelGroup *accel_group, - guint keyval, - GdkModifierType modifiers) -{ - GtkItemFactoryClass *class; - GtkItemFactoryItem *item; - - g_return_if_fail (GTK_IS_WIDGET (accel_widget)); - g_return_if_fail (full_path != NULL); - - class = gtk_type_class (GTK_TYPE_ITEM_FACTORY); - - keyval = keyval != GDK_VoidSymbol ? keyval : 0; - - item = g_hash_table_lookup (class->item_ht, full_path); - if (!item) - { - item = g_slice_new (GtkItemFactoryItem); - - item->path = g_strdup (full_path); - item->widgets = NULL; - - g_hash_table_insert (class->item_ht, item->path, item); - } - - item->widgets = g_slist_prepend (item->widgets, accel_widget); - g_signal_connect (accel_widget, - "destroy", - G_CALLBACK (gtk_item_factory_item_remove_widget), - item); - - /* set the item path for the widget - */ - g_object_set_qdata (G_OBJECT (accel_widget), quark_item_path, item->path); - gtk_widget_set_name (accel_widget, item->path); - if (accel_group) - { - g_object_ref (accel_group); - g_object_set_qdata_full (G_OBJECT (accel_widget), - quark_accel_group, - accel_group, - g_object_unref); - } - else - g_object_set_qdata (G_OBJECT (accel_widget), quark_accel_group, NULL); - - /* install defined accelerators - */ - if (g_signal_lookup ("activate", G_TYPE_FROM_INSTANCE (accel_widget))) - { - if (accel_group) - { - gtk_accel_map_add_entry (full_path, keyval, modifiers); - gtk_widget_set_accel_path (accel_widget, full_path, accel_group); - } - } -} - -static void -ifactory_cb_data_free (gpointer mem) -{ - g_slice_free (GtkIFCBData, mem); -} - -static void -gtk_item_factory_add_item (GtkItemFactory *ifactory, - const gchar *path, - const gchar *accelerator, - GtkItemFactoryCallback callback, - guint callback_action, - gpointer callback_data, - guint callback_type, - gchar *item_type, - GtkWidget *widget) -{ - GtkItemFactoryClass *class; - GtkItemFactoryItem *item; - gchar *fpath; - guint keyval; - GdkModifierType mods; - - g_return_if_fail (widget != NULL); - g_return_if_fail (item_type != NULL); - - class = GTK_ITEM_FACTORY_GET_CLASS (ifactory); - - /* set accelerator group on menu widgets - */ - if (GTK_IS_MENU (widget)) - gtk_menu_set_accel_group ((GtkMenu*) widget, ifactory->accel_group); - - /* connect callback if necessary - */ - if (callback) - { - GtkIFCBData *data; - - data = g_slice_new (GtkIFCBData); - data->func = callback; - data->callback_type = callback_type; - data->func_data = callback_data; - data->callback_action = callback_action; - - g_object_weak_ref (G_OBJECT (widget), - (GWeakNotify) ifactory_cb_data_free, - data); - g_signal_connect (widget, - "activate", - G_CALLBACK (gtk_item_factory_callback_marshal), - data); - } - - /* link the widget into its item-entry - * and keep back pointer on both the item factory and the widget - */ - g_object_set_qdata (G_OBJECT (widget), quark_action, GUINT_TO_POINTER (callback_action)); - g_object_set_qdata (G_OBJECT (widget), quark_item_factory, ifactory); - if (accelerator) - gtk_accelerator_parse (accelerator, &keyval, &mods); - else - { - keyval = 0; - mods = 0; - } - fpath = g_strconcat (ifactory->path, path, NULL); - gtk_item_factory_add_foreign (widget, fpath, ifactory->accel_group, keyval, mods); - item = g_hash_table_lookup (class->item_ht, fpath); - g_free (fpath); - - g_return_if_fail (item != NULL); - - if (!g_slist_find (ifactory->items, item)) - ifactory->items = g_slist_prepend (ifactory->items, item); -} - -/** - * gtk_item_factory_construct: - * @ifactory: a #GtkItemFactory - * @container_type: the kind of menu to create; can be - * #GTK_TYPE_MENU_BAR, #GTK_TYPE_MENU or #GTK_TYPE_OPTION_MENU - * @path: the factory path of @ifactory, a string of the form - * <literal>"<name>"</literal> - * @accel_group: a #GtkAccelGroup to which the accelerators for the - * menu items will be added, or %NULL to create a new one - * - * Initializes an item factory. - * - * Deprecated: 2.4: Use #GtkUIManager instead. - */ -void -gtk_item_factory_construct (GtkItemFactory *ifactory, - GType container_type, - const gchar *path, - GtkAccelGroup *accel_group) -{ - guint len; - - g_return_if_fail (GTK_IS_ITEM_FACTORY (ifactory)); - g_return_if_fail (ifactory->accel_group == NULL); - g_return_if_fail (path != NULL); - if (!g_type_is_a (container_type, GTK_TYPE_OPTION_MENU)) - g_return_if_fail (g_type_is_a (container_type, GTK_TYPE_MENU_SHELL)); - - len = strlen (path); - - if (path[0] != '<' && path[len - 1] != '>') - { - g_warning ("GtkItemFactory: invalid factory path `%s'", path); - return; - } - - if (accel_group) - { - ifactory->accel_group = accel_group; - g_object_ref (ifactory->accel_group); - } - else - ifactory->accel_group = gtk_accel_group_new (); - - ifactory->path = g_strdup (path); - ifactory->widget = g_object_connect (g_object_new (container_type, NULL), - "signal::destroy", gtk_widget_destroyed, &ifactory->widget, - NULL); - g_object_ref_sink (ifactory); - - gtk_item_factory_add_item (ifactory, - "", NULL, - NULL, 0, NULL, 0, - ITEM_FACTORY_STRING, - ifactory->widget); -} - -/** - * gtk_item_factory_from_path: - * @path: a string starting with a factory path of the form - * <literal>"<name>"</literal> - * @returns: (allow-none): the #GtkItemFactory created for the given factory path, or %NULL - * - * Finds an item factory which has been constructed using the - * <literal>"<name>"</literal> prefix of @path as the @path argument - * for gtk_item_factory_new(). - * - * Deprecated: 2.4: Use #GtkUIManager instead. - */ -GtkItemFactory* -gtk_item_factory_from_path (const gchar *path) -{ - GtkItemFactoryClass *class; - GtkItemFactoryItem *item; - gchar *fname; - guint i; - - g_return_val_if_fail (path != NULL, NULL); - g_return_val_if_fail (path[0] == '<', NULL); - - class = gtk_type_class (GTK_TYPE_ITEM_FACTORY); - - i = 0; - while (path[i] && path[i] != '>') - i++; - if (path[i] != '>') - { - g_warning ("gtk_item_factory_from_path(): invalid factory path \"%s\"", - path); - return NULL; - } - fname = g_new (gchar, i + 2); - g_memmove (fname, path, i + 1); - fname[i + 1] = 0; - - item = g_hash_table_lookup (class->item_ht, fname); - - g_free (fname); - - if (item && item->widgets) - return gtk_item_factory_from_widget (item->widgets->data); - - return NULL; -} - -static void -gtk_item_factory_destroy (GtkObject *object) -{ - GtkItemFactory *ifactory = (GtkItemFactory*) object; - GSList *slist; - - if (ifactory->widget) - { - GtkObject *dobj; - - dobj = GTK_OBJECT (ifactory->widget); - - g_object_ref_sink (dobj); - gtk_object_destroy (dobj); - g_object_unref (dobj); - - ifactory->widget = NULL; - } - - for (slist = ifactory->items; slist; slist = slist->next) - { - GtkItemFactoryItem *item = slist->data; - GSList *link; - - for (link = item->widgets; link; link = link->next) - if (g_object_get_qdata (link->data, quark_item_factory) == ifactory) - g_object_set_qdata (link->data, quark_item_factory, NULL); - } - g_slist_free (ifactory->items); - ifactory->items = NULL; - - GTK_OBJECT_CLASS (gtk_item_factory_parent_class)->destroy (object); -} - -static void -gtk_item_factory_finalize (GObject *object) -{ - GtkItemFactory *ifactory = GTK_ITEM_FACTORY (object); - - if (ifactory->accel_group) - g_object_unref (ifactory->accel_group); - - g_free (ifactory->path); - g_assert (ifactory->widget == NULL); - - if (ifactory->translate_notify) - ifactory->translate_notify (ifactory->translate_data); - - G_OBJECT_CLASS (gtk_item_factory_parent_class)->finalize (object); -} - -/** - * gtk_item_factory_from_widget: - * @widget: a widget - * @returns: (allow-none): the item factory from which @widget was created, or %NULL - * - * Obtains the item factory from which a widget was created. - * - * Deprecated: 2.4: Use #GtkUIManager instead. - */ -GtkItemFactory* -gtk_item_factory_from_widget (GtkWidget *widget) -{ - GtkItemFactory *ifactory; - - g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); - - ifactory = g_object_get_qdata (G_OBJECT (widget), quark_item_factory); - - if (ifactory == NULL && GTK_IS_MENU_ITEM (widget) && - GTK_MENU_ITEM (widget)->submenu != NULL) - { - GtkWidget *menu = GTK_MENU_ITEM (widget)->submenu; - ifactory = g_object_get_qdata (G_OBJECT (menu), quark_item_factory); - } - - return ifactory; -} - -/** - * gtk_item_factory_path_from_widget: - * @widget: a widget - * @returns: the full path to @widget if it has been created by an item - * factory, %NULL otherwise. This value is owned by GTK+ and must not be - * modified or freed. - * - * If @widget has been created by an item factory, returns the full path - * to it. (The full path of a widget is the concatenation of the factory - * path specified in gtk_item_factory_new() with the path specified in the - * #GtkItemFactoryEntry from which the widget was created.) - * - * Deprecated: 2.4: Use #GtkUIManager instead. - */ -G_CONST_RETURN gchar* -gtk_item_factory_path_from_widget (GtkWidget *widget) -{ - gchar* path; - - g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); - - path = g_object_get_qdata (G_OBJECT (widget), quark_item_path); - - if (path == NULL && GTK_IS_MENU_ITEM (widget) && - GTK_MENU_ITEM (widget)->submenu != NULL) - { - GtkWidget *menu = GTK_MENU_ITEM (widget)->submenu; - path = g_object_get_qdata (G_OBJECT (menu), quark_item_path); - } - - return path; -} - -/** - * gtk_item_factory_create_items: - * @ifactory: a #GtkItemFactory - * @n_entries: the length of @entries - * @entries: an array of #GtkItemFactoryEntry<!-- -->s whose @callback members - * must by of type #GtkItemFactoryCallback1 - * @callback_data: data passed to the callback functions of all entries - * - * Creates the menu items from the @entries. - * - * Deprecated: 2.4: Use #GtkUIManager instead. - */ -void -gtk_item_factory_create_items (GtkItemFactory *ifactory, - guint n_entries, - GtkItemFactoryEntry *entries, - gpointer callback_data) -{ - gtk_item_factory_create_items_ac (ifactory, n_entries, entries, callback_data, 1); -} - -/** - * gtk_item_factory_create_items_ac: - * @ifactory: a #GtkItemFactory - * @n_entries: the length of @entries - * @entries: an array of #GtkItemFactoryEntry<!-- -->s - * @callback_data: data passed to the callback functions of all entries - * @callback_type: 1 if the callback functions in @entries are of type - * #GtkItemFactoryCallback1, 2 if they are of type #GtkItemFactoryCallback2 - * - * Creates the menu items from the @entries. - * - * Deprecated: 2.4: Use #GtkUIManager instead. - */ -void -gtk_item_factory_create_items_ac (GtkItemFactory *ifactory, - guint n_entries, - GtkItemFactoryEntry *entries, - gpointer callback_data, - guint callback_type) -{ - guint i; - - g_return_if_fail (GTK_IS_ITEM_FACTORY (ifactory)); - g_return_if_fail (callback_type >= 1 && callback_type <= 2); - - if (n_entries == 0) - return; - - g_return_if_fail (entries != NULL); - - for (i = 0; i < n_entries; i++) - gtk_item_factory_create_item (ifactory, entries + i, callback_data, callback_type); -} - -/** - * gtk_item_factory_get_widget: - * @ifactory: a #GtkItemFactory - * @path: the path to the widget - * @returns: (allow-none): the widget for the given path, or %NULL if @path doesn't lead - * to a widget - * - * Obtains the widget which corresponds to @path. - * - * If the widget corresponding to @path is a menu item which opens a - * submenu, then the submenu is returned. If you are interested in the menu - * item, use gtk_item_factory_get_item() instead. - * - * Deprecated: 2.4: Use #GtkUIManager instead. - */ -GtkWidget* -gtk_item_factory_get_widget (GtkItemFactory *ifactory, - const gchar *path) -{ - GtkItemFactoryClass *class; - GtkItemFactoryItem *item; - - g_return_val_if_fail (GTK_IS_ITEM_FACTORY (ifactory), NULL); - g_return_val_if_fail (path != NULL, NULL); - - class = GTK_ITEM_FACTORY_GET_CLASS (ifactory); - - if (path[0] == '<') - item = g_hash_table_lookup (class->item_ht, (gpointer) path); - else - { - gchar *fpath; - - fpath = g_strconcat (ifactory->path, path, NULL); - item = g_hash_table_lookup (class->item_ht, fpath); - g_free (fpath); - } - - if (item) - { - GSList *slist; - - for (slist = item->widgets; slist; slist = slist->next) - { - if (gtk_item_factory_from_widget (slist->data) == ifactory) - return slist->data; - } - } - - return NULL; -} - -/** - * gtk_item_factory_get_widget_by_action: - * @ifactory: a #GtkItemFactory - * @action: an action as specified in the @callback_action field - * of #GtkItemFactoryEntry - * @returns: (allow-none): the widget which corresponds to the given action, or %NULL - * if no widget was found - * - * Obtains the widget which was constructed from the #GtkItemFactoryEntry - * with the given @action. - * - * If there are multiple items with the same action, the result is - * undefined. - * - * Deprecated: 2.4: Use #GtkUIManager instead. - */ -GtkWidget* -gtk_item_factory_get_widget_by_action (GtkItemFactory *ifactory, - guint action) -{ - GSList *slist; - - g_return_val_if_fail (GTK_IS_ITEM_FACTORY (ifactory), NULL); - - for (slist = ifactory->items; slist; slist = slist->next) - { - GtkItemFactoryItem *item = slist->data; - GSList *link; - - for (link = item->widgets; link; link = link->next) - if (g_object_get_qdata (link->data, quark_item_factory) == ifactory && - g_object_get_qdata (link->data, quark_action) == GUINT_TO_POINTER (action)) - return link->data; - } - - return NULL; -} - -/** - * gtk_item_factory_get_item: - * @ifactory: a #GtkItemFactory - * @path: the path to the menu item - * @returns: (allow-none): the menu item for the given path, or %NULL if @path doesn't - * lead to a menu item - * - * Obtains the menu item which corresponds to @path. - * - * If the widget corresponding to @path is a menu item which opens a - * submenu, then the item is returned. If you are interested in the submenu, - * use gtk_item_factory_get_widget() instead. - * - * Deprecated: 2.4: Use #GtkUIManager instead. - */ -GtkWidget* -gtk_item_factory_get_item (GtkItemFactory *ifactory, - const gchar *path) -{ - GtkWidget *widget; - - g_return_val_if_fail (GTK_IS_ITEM_FACTORY (ifactory), NULL); - g_return_val_if_fail (path != NULL, NULL); - - widget = gtk_item_factory_get_widget (ifactory, path); - - if (GTK_IS_MENU (widget)) - widget = gtk_menu_get_attach_widget (GTK_MENU (widget)); - - return GTK_IS_ITEM (widget) ? widget : NULL; -} - - -/** - * gtk_item_factory_get_item_by_action: - * @ifactory: a #GtkItemFactory - * @action: an action as specified in the @callback_action field - * of #GtkItemFactoryEntry - * @returns: (allow-none): the menu item which corresponds to the given action, or %NULL - * if no menu item was found - * - * Obtains the menu item which was constructed from the first - * #GtkItemFactoryEntry with the given @action. - * - * Deprecated: 2.4: Use #GtkUIManager instead. - */ -GtkWidget* -gtk_item_factory_get_item_by_action (GtkItemFactory *ifactory, - guint action) -{ - GtkWidget *widget; - - g_return_val_if_fail (GTK_IS_ITEM_FACTORY (ifactory), NULL); - - widget = gtk_item_factory_get_widget_by_action (ifactory, action); - - if (GTK_IS_MENU (widget)) - widget = gtk_menu_get_attach_widget (GTK_MENU (widget)); - - return GTK_IS_ITEM (widget) ? widget : NULL; -} - -static char * -item_factory_find_separator_r (char *path) -{ - gchar *result = NULL; - gboolean escaped = FALSE; - - while (*path) - { - if (escaped) - escaped = FALSE; - else - { - if (*path == '\\') - escaped = TRUE; - else if (*path == '/') - result = path; - } - - path++; - } - - return result; -} - -static char * -item_factory_unescape_label (const char *label) -{ - char *new = g_malloc (strlen (label) + 1); - char *p = new; - gboolean escaped = FALSE; - - while (*label) - { - if (escaped) - { - *p++ = *label; - escaped = FALSE; - } - else - { - if (*label == '\\') - escaped = TRUE; - else - *p++ = *label; - } - - label++; - } - - *p = '\0'; - - return new; -} - -static gboolean -gtk_item_factory_parse_path (GtkItemFactory *ifactory, - gchar *str, - gchar **path, - gchar **parent_path, - gchar **item) -{ - gchar *translation; - gchar *p, *q; - - *path = g_strdup (str); - - p = q = *path; - while (*p) - { - if (*p == '_') - { - if (p[1] == '_') - { - p++; - *q++ = '_'; - } - } - else - { - *q++ = *p; - } - p++; - } - *q = 0; - - *parent_path = g_strdup (*path); - p = item_factory_find_separator_r (*parent_path); - if (!p) - { - g_warning ("GtkItemFactory: invalid entry path `%s'", str); - return FALSE; - } - *p = 0; - - if (ifactory->translate_func) - translation = ifactory->translate_func (str, ifactory->translate_data); - else - translation = str; - - p = item_factory_find_separator_r (translation); - if (p) - p++; - else - p = translation; - - *item = item_factory_unescape_label (p); - - return TRUE; -} - -/** - * gtk_item_factory_create_item: - * @ifactory: a #GtkItemFactory - * @entry: the #GtkItemFactoryEntry to create an item for - * @callback_data: data passed to the callback function of @entry - * @callback_type: 1 if the callback function of @entry is of type - * #GtkItemFactoryCallback1, 2 if it is of type #GtkItemFactoryCallback2 - * - * Creates an item for @entry. - * - * Deprecated: 2.4: Use #GtkUIManager instead. - */ -void -gtk_item_factory_create_item (GtkItemFactory *ifactory, - GtkItemFactoryEntry *entry, - gpointer callback_data, - guint callback_type) -{ - GtkOptionMenu *option_menu = NULL; - GtkWidget *parent; - GtkWidget *widget; - GtkWidget *image; - GSList *radio_group; - gchar *name; - gchar *parent_path; - gchar *path; - gchar *accelerator; - guint type_id; - GType type; - gchar *item_type_path; - GtkStockItem stock_item; - - g_return_if_fail (GTK_IS_ITEM_FACTORY (ifactory)); - g_return_if_fail (entry != NULL); - g_return_if_fail (entry->path != NULL); - g_return_if_fail (entry->path[0] == '/'); - g_return_if_fail (callback_type >= 1 && callback_type <= 2); - - if (!entry->item_type || - entry->item_type[0] == 0) - { - item_type_path = "<Item>"; - type_id = quark_type_item; - } - else - { - item_type_path = entry->item_type; - type_id = g_quark_try_string (item_type_path); - } - - radio_group = NULL; - if (type_id == quark_type_item) - type = GTK_TYPE_MENU_ITEM; - else if (type_id == quark_type_title) - type = GTK_TYPE_MENU_ITEM; - else if (type_id == quark_type_radio_item) - type = GTK_TYPE_RADIO_MENU_ITEM; - else if (type_id == quark_type_check_item) - type = GTK_TYPE_CHECK_MENU_ITEM; - else if (type_id == quark_type_image_item) - type = GTK_TYPE_IMAGE_MENU_ITEM; - else if (type_id == quark_type_stock_item) - type = GTK_TYPE_IMAGE_MENU_ITEM; - else if (type_id == quark_type_tearoff_item) - type = GTK_TYPE_TEAROFF_MENU_ITEM; - else if (type_id == quark_type_toggle_item) - type = GTK_TYPE_CHECK_MENU_ITEM; - else if (type_id == quark_type_separator_item) - type = GTK_TYPE_MENU_ITEM; - else if (type_id == quark_type_branch) - type = GTK_TYPE_MENU_ITEM; - else if (type_id == quark_type_last_branch) - type = GTK_TYPE_MENU_ITEM; - else - { - GtkWidget *radio_link; - - radio_link = gtk_item_factory_get_widget (ifactory, item_type_path); - if (radio_link && GTK_IS_RADIO_MENU_ITEM (radio_link)) - { - type = GTK_TYPE_RADIO_MENU_ITEM; - radio_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (radio_link)); - } - else - { - g_warning ("GtkItemFactory: entry path `%s' has invalid type `%s'", - entry->path, - item_type_path); - return; - } - } - - if (!gtk_item_factory_parse_path (ifactory, entry->path, - &path, &parent_path, &name)) - return; - - parent = gtk_item_factory_get_widget (ifactory, parent_path); - if (!parent) - { - GtkItemFactoryEntry pentry; - gchar *ppath, *p; - - ppath = g_strdup (entry->path); - p = item_factory_find_separator_r (ppath); - g_return_if_fail (p != NULL); - *p = 0; - pentry.path = ppath; - pentry.accelerator = NULL; - pentry.callback = NULL; - pentry.callback_action = 0; - pentry.item_type = "<Branch>"; - - gtk_item_factory_create_item (ifactory, &pentry, NULL, 1); - g_free (ppath); - - parent = gtk_item_factory_get_widget (ifactory, parent_path); - g_return_if_fail (parent != NULL); - } - - if (GTK_IS_OPTION_MENU (parent)) - { - option_menu = GTK_OPTION_MENU (parent); - if (!option_menu->menu) - { - GtkWidget *menu = g_object_new (GTK_TYPE_MENU, NULL); - gchar *p = g_strconcat (ifactory->path, parent_path, NULL); - - gtk_menu_set_accel_path (GTK_MENU (menu), p); - g_free (p); - gtk_option_menu_set_menu (option_menu, menu); - } - parent = option_menu->menu; - } - g_free (parent_path); - - g_return_if_fail (GTK_IS_CONTAINER (parent)); - - accelerator = entry->accelerator; - - widget = g_object_new (type, - "visible", TRUE, - "sensitive", (type_id != quark_type_separator_item && - type_id != quark_type_title), - "parent", parent, - NULL); - if (option_menu && !option_menu->menu_item) - gtk_option_menu_set_history (option_menu, 0); - - if (GTK_IS_RADIO_MENU_ITEM (widget)) - gtk_radio_menu_item_set_group (GTK_RADIO_MENU_ITEM (widget), radio_group); - if (type_id == quark_type_image_item) - { - GdkPixbuf *pixbuf = NULL; - image = NULL; - if (entry->extra_data) - { - pixbuf = gdk_pixbuf_new_from_inline (-1, - entry->extra_data, - FALSE, - NULL); - if (pixbuf) - image = gtk_image_new_from_pixbuf (pixbuf); - } - if (image) - { - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (widget), image); - gtk_widget_show (image); - } - if (pixbuf) - g_object_unref (pixbuf); - } - if (type_id == quark_type_stock_item) - { - image = gtk_image_new_from_stock (entry->extra_data, GTK_ICON_SIZE_MENU); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (widget), image); - gtk_widget_show (image); - - if (gtk_stock_lookup (entry->extra_data, &stock_item)) - { - if (!accelerator) - accelerator = gtk_accelerator_name (stock_item.keyval, stock_item.modifier); - } - } - - /* install underline accelerators for this item - */ - if (type_id != quark_type_separator_item && - type_id != quark_type_tearoff_item && - *name) - { - GtkWidget *label; - - label = g_object_new (GTK_TYPE_ACCEL_LABEL, - "visible", TRUE, - "parent", widget, - "accel-widget", widget, - "xalign", 0.0, - NULL); - gtk_label_set_text_with_mnemonic (GTK_LABEL (label), name); - } - - g_free (name); - - if (type_id == quark_type_branch || - type_id == quark_type_last_branch) - { - gchar *p; - - if (entry->callback) - g_warning ("gtk_item_factory_create_item(): Can't specify a callback on a branch: \"%s\"", - entry->path); - if (type_id == quark_type_last_branch) - gtk_menu_item_set_right_justified (GTK_MENU_ITEM (widget), TRUE); - - parent = widget; - widget = g_object_new (GTK_TYPE_MENU, NULL); - p = g_strconcat (ifactory->path, path, NULL); - gtk_menu_set_accel_path (GTK_MENU (widget), p); - g_free (p); - - gtk_menu_item_set_submenu (GTK_MENU_ITEM (parent), widget); - } - - gtk_item_factory_add_item (ifactory, - path, accelerator, - (type_id == quark_type_branch || - type_id == quark_type_last_branch) ? - (GtkItemFactoryCallback) NULL : entry->callback, - entry->callback_action, callback_data, - callback_type, - item_type_path, - widget); - if (accelerator != entry->accelerator) - g_free (accelerator); - g_free (path); -} - -/** - * gtk_item_factory_create_menu_entries: - * @n_entries: the length of @entries - * @entries: an array of #GtkMenuEntry<!-- -->s - * - * Creates the menu items from the @entries. - * - * Deprecated: 2.4: Use #GtkUIManager instead. - */ -void -gtk_item_factory_create_menu_entries (guint n_entries, - GtkMenuEntry *entries) -{ - static GPatternSpec *pspec_separator = NULL; - static GPatternSpec *pspec_check = NULL; - guint i; - - if (!n_entries) - return; - g_return_if_fail (entries != NULL); - - if (!pspec_separator) - { - pspec_separator = g_pattern_spec_new ("*<separator>*"); - pspec_check = g_pattern_spec_new ("*<check>*"); - } - - for (i = 0; i < n_entries; i++) - { - GtkItemFactory *ifactory; - GtkItemFactoryEntry entry; - gchar *path; - gchar *cpath; - - path = entries[i].path; - ifactory = gtk_item_factory_from_path (path); - if (!ifactory) - { - g_warning ("gtk_item_factory_create_menu_entries(): " - "entry[%u] refers to unknown item factory: \"%s\"", - i, entries[i].path); - continue; - } - - while (*path != '>') - path++; - path++; - cpath = NULL; - - entry.path = path; - entry.accelerator = entries[i].accelerator; - entry.callback = entries[i].callback; - entry.callback_action = 0; - if (g_pattern_match_string (pspec_separator, path)) - entry.item_type = "<Separator>"; - else if (!g_pattern_match_string (pspec_check, path)) - entry.item_type = NULL; - else - { - gboolean in_brace = FALSE; - gchar *c; - - cpath = g_new (gchar, strlen (path)); - c = cpath; - while (*path != 0) - { - if (*path == '<') - in_brace = TRUE; - else if (*path == '>') - in_brace = FALSE; - else if (!in_brace) - *(c++) = *path; - path++; - } - *c = 0; - entry.item_type = "<ToggleItem>"; - entry.path = cpath; - } - - gtk_item_factory_create_item (ifactory, &entry, entries[i].callback_data, 2); - entries[i].widget = gtk_item_factory_get_widget (ifactory, entries[i].path); - g_free (cpath); - } -} - -/** - * gtk_item_factories_path_delete: - * @ifactory_path: a factory path to prepend to @path. May be %NULL if @path - * starts with a factory path - * @path: a path - * - * Deletes all widgets constructed from the specified path. - * - * Deprecated: 2.4: Use #GtkUIManager instead. - */ -void -gtk_item_factories_path_delete (const gchar *ifactory_path, - const gchar *path) -{ - GtkItemFactoryClass *class; - GtkItemFactoryItem *item; - - g_return_if_fail (path != NULL); - - class = gtk_type_class (GTK_TYPE_ITEM_FACTORY); - - if (path[0] == '<') - item = g_hash_table_lookup (class->item_ht, (gpointer) path); - else - { - gchar *fpath; - - g_return_if_fail (ifactory_path != NULL); - - fpath = g_strconcat (ifactory_path, path, NULL); - item = g_hash_table_lookup (class->item_ht, fpath); - g_free (fpath); - } - - if (item) - { - GSList *widget_list; - GSList *slist; - - widget_list = NULL; - for (slist = item->widgets; slist; slist = slist->next) - { - GtkWidget *widget; - - widget = slist->data; - widget_list = g_slist_prepend (widget_list, widget); - g_object_ref (widget); - } - - for (slist = widget_list; slist; slist = slist->next) - { - GtkWidget *widget; - - widget = slist->data; - gtk_widget_destroy (widget); - g_object_unref (widget); - } - g_slist_free (widget_list); - } -} - -/** - * gtk_item_factory_delete_item: - * @ifactory: a #GtkItemFactory - * @path: a path - * - * Deletes the menu item which was created for @path by the given - * item factory. - * - * Deprecated: 2.4: Use #GtkUIManager instead. - */ -void -gtk_item_factory_delete_item (GtkItemFactory *ifactory, - const gchar *path) -{ - GtkWidget *widget; - - g_return_if_fail (GTK_IS_ITEM_FACTORY (ifactory)); - g_return_if_fail (path != NULL); - - widget = gtk_item_factory_get_widget (ifactory, path); - - if (widget) - { - if (GTK_IS_MENU (widget)) - widget = gtk_menu_get_attach_widget (GTK_MENU (widget)); - - gtk_widget_destroy (widget); - } -} - -/** - * gtk_item_factory_delete_entry: - * @ifactory: a #GtkItemFactory - * @entry: a #GtkItemFactoryEntry - * - * Deletes the menu item which was created from @entry by the given - * item factory. - * - * Deprecated: 2.4: Use #GtkUIManager instead. - */ -void -gtk_item_factory_delete_entry (GtkItemFactory *ifactory, - GtkItemFactoryEntry *entry) -{ - gchar *path; - gchar *parent_path; - gchar *name; - - g_return_if_fail (GTK_IS_ITEM_FACTORY (ifactory)); - g_return_if_fail (entry != NULL); - g_return_if_fail (entry->path != NULL); - g_return_if_fail (entry->path[0] == '/'); - - if (!gtk_item_factory_parse_path (ifactory, entry->path, - &path, &parent_path, &name)) - return; - - gtk_item_factory_delete_item (ifactory, path); - - g_free (path); - g_free (parent_path); - g_free (name); -} - -/** - * gtk_item_factory_delete_entries: - * @ifactory: a #GtkItemFactory - * @n_entries: the length of @entries - * @entries: an array of #GtkItemFactoryEntry<!-- -->s - * - * Deletes the menu items which were created from the @entries by the given - * item factory. - * - * Deprecated: 2.4: Use #GtkUIManager instead. - */ -void -gtk_item_factory_delete_entries (GtkItemFactory *ifactory, - guint n_entries, - GtkItemFactoryEntry *entries) -{ - guint i; - - g_return_if_fail (GTK_IS_ITEM_FACTORY (ifactory)); - if (n_entries > 0) - g_return_if_fail (entries != NULL); - - for (i = 0; i < n_entries; i++) - gtk_item_factory_delete_entry (ifactory, entries + i); -} - -typedef struct -{ - guint x; - guint y; -} MenuPos; - -static void -gtk_item_factory_menu_pos (GtkMenu *menu, - gint *x, - gint *y, - gboolean *push_in, - gpointer func_data) -{ - MenuPos *mpos = func_data; - - *x = mpos->x; - *y = mpos->y; -} - -/** - * gtk_item_factory_popup_data_from_widget: - * @widget: a widget - * @returns: @popup_data associated with the item factory from - * which @widget was created, or %NULL if @widget wasn't created - * by an item factory - * - * Obtains the @popup_data which was passed to - * gtk_item_factory_popup_with_data(). This data is available until the menu - * is popped down again. - * - * Deprecated: 2.4: Use #GtkUIManager instead. - */ -gpointer -gtk_item_factory_popup_data_from_widget (GtkWidget *widget) -{ - GtkItemFactory *ifactory; - - g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); - - ifactory = gtk_item_factory_from_widget (widget); - if (ifactory) - return g_object_get_qdata (G_OBJECT (ifactory), quark_popup_data); - - return NULL; -} - -/** - * gtk_item_factory_popup_data: - * @ifactory: a #GtkItemFactory - * @returns: @popup_data associated with @ifactory - * - * Obtains the @popup_data which was passed to - * gtk_item_factory_popup_with_data(). This data is available until the menu - * is popped down again. - * - * Deprecated: 2.4: Use #GtkUIManager instead. - */ -gpointer -gtk_item_factory_popup_data (GtkItemFactory *ifactory) -{ - g_return_val_if_fail (GTK_IS_ITEM_FACTORY (ifactory), NULL); - - return g_object_get_qdata (G_OBJECT (ifactory), quark_popup_data); -} - -static void -ifactory_delete_popup_data (GtkObject *object, - GtkItemFactory *ifactory) -{ - g_signal_handlers_disconnect_by_func (object, - ifactory_delete_popup_data, - ifactory); - g_object_set_qdata (G_OBJECT (ifactory), quark_popup_data, NULL); -} - -/** - * gtk_item_factory_popup: - * @ifactory: a #GtkItemFactory of type #GTK_TYPE_MENU (see gtk_item_factory_new()) - * @x: the x position - * @y: the y position - * @mouse_button: the mouse button which was pressed to initiate the popup - * @time_: the time at which the activation event occurred - * - * Pops up the menu constructed from the item factory at (@x, @y). - * - * The @mouse_button parameter should be the mouse button pressed to initiate - * the menu popup. If the menu popup was initiated by something other than - * a mouse button press, such as a mouse button release or a keypress, - * @mouse_button should be 0. - * - * The @time_ parameter should be the time stamp of the event that - * initiated the popup. If such an event is not available, use - * gtk_get_current_event_time() instead. - * - * The operation of the @mouse_button and the @time_ parameter is the same - * as the @button and @activation_time parameters for gtk_menu_popup(). - * - * Deprecated: 2.4: Use #GtkUIManager instead. - */ -void -gtk_item_factory_popup (GtkItemFactory *ifactory, - guint x, - guint y, - guint mouse_button, - guint32 time) -{ - gtk_item_factory_popup_with_data (ifactory, NULL, NULL, x, y, mouse_button, time); -} - -/** - * gtk_item_factory_popup_with_data: - * @ifactory: a #GtkItemFactory of type #GTK_TYPE_MENU (see gtk_item_factory_new()) - * @popup_data: data available for callbacks while the menu is posted - * @destroy: a #GDestroyNotify function to be called on @popup_data when - * the menu is unposted - * @x: the x position - * @y: the y position - * @mouse_button: the mouse button which was pressed to initiate the popup - * @time_: the time at which the activation event occurred - * - * Pops up the menu constructed from the item factory at (@x, @y). Callbacks - * can access the @popup_data while the menu is posted via - * gtk_item_factory_popup_data() and gtk_item_factory_popup_data_from_widget(). - * - * The @mouse_button parameter should be the mouse button pressed to initiate - * the menu popup. If the menu popup was initiated by something other than - * a mouse button press, such as a mouse button release or a keypress, - * @mouse_button should be 0. - * - * The @time_ parameter should be the time stamp of the event that - * initiated the popup. If such an event is not available, use - * gtk_get_current_event_time() instead. - * - * The operation of the @mouse_button and the @time_ parameters is the same - * as the @button and @activation_time parameters for gtk_menu_popup(). - * - * Deprecated: 2.4: Use #GtkUIManager instead. - */ -void -gtk_item_factory_popup_with_data (GtkItemFactory *ifactory, - gpointer popup_data, - GDestroyNotify destroy, - guint x, - guint y, - guint mouse_button, - guint32 time) -{ - MenuPos *mpos; - - g_return_if_fail (GTK_IS_ITEM_FACTORY (ifactory)); - g_return_if_fail (GTK_IS_MENU (ifactory->widget)); - - mpos = g_object_get_qdata (G_OBJECT (ifactory->widget), quark_if_menu_pos); - - if (!mpos) - { - mpos = g_new0 (MenuPos, 1); - g_object_set_qdata_full (G_OBJECT (ifactory->widget), - quark_if_menu_pos, - mpos, - g_free); - } - - mpos->x = x; - mpos->y = y; - - if (popup_data != NULL) - { - g_object_set_qdata_full (G_OBJECT (ifactory), - quark_popup_data, - popup_data, - destroy); - g_signal_connect (ifactory->widget, - "selection-done", - G_CALLBACK (ifactory_delete_popup_data), - ifactory); - } - - gtk_menu_popup (GTK_MENU (ifactory->widget), - NULL, NULL, - gtk_item_factory_menu_pos, mpos, - mouse_button, time); -} - -/** - * gtk_item_factory_set_translate_func: - * @ifactory: a #GtkItemFactory - * @func: the #GtkTranslateFunc function to be used to translate path elements - * @data: data to pass to @func and @notify - * @notify: a #GDestroyNotify function to be called when @ifactory is - * destroyed and when the translation function is changed again - * - * Sets a function to be used for translating the path elements before they - * are displayed. - * - * Deprecated: 2.4: Use #GtkUIManager instead. - */ -void -gtk_item_factory_set_translate_func (GtkItemFactory *ifactory, - GtkTranslateFunc func, - gpointer data, - GDestroyNotify notify) -{ - g_return_if_fail (ifactory != NULL); - - if (ifactory->translate_notify) - ifactory->translate_notify (ifactory->translate_data); - - ifactory->translate_func = func; - ifactory->translate_data = data; - ifactory->translate_notify = notify; -} - -#define __GTK_ITEM_FACTORY_C__ -#include "gtkaliasdef.c" diff --git a/gtk/gtkitemfactory.h b/gtk/gtkitemfactory.h deleted file mode 100644 index 5c57b8032e..0000000000 --- a/gtk/gtkitemfactory.h +++ /dev/null @@ -1,236 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * GtkItemFactory: Flexible item factory with automatic rc handling - * Copyright (C) 1998 Tim Janik - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#ifndef GTK_DISABLE_DEPRECATED - -#ifndef __GTK_ITEM_FACTORY_H__ -#define __GTK_ITEM_FACTORY_H__ - -#include <gtk/gtk.h> - - -G_BEGIN_DECLS - -typedef void (*GtkPrintFunc) (gpointer func_data, - const gchar *str); -/* We use () here to mean unspecified arguments. This is deprecated - * as of C99, but we can't change it without breaking compatibility. - * (Note that if we are included from a C++ program () will mean - * (void) so an explicit cast will be needed.) - */ -typedef void (*GtkItemFactoryCallback) (); -typedef void (*GtkItemFactoryCallback1) (gpointer callback_data, - guint callback_action, - GtkWidget *widget); - -#define GTK_TYPE_ITEM_FACTORY (gtk_item_factory_get_type ()) -#define GTK_ITEM_FACTORY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GTK_TYPE_ITEM_FACTORY, GtkItemFactory)) -#define GTK_ITEM_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_ITEM_FACTORY, GtkItemFactoryClass)) -#define GTK_IS_ITEM_FACTORY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GTK_TYPE_ITEM_FACTORY)) -#define GTK_IS_ITEM_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ITEM_FACTORY)) -#define GTK_ITEM_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ITEM_FACTORY, GtkItemFactoryClass)) - - -typedef struct _GtkItemFactory GtkItemFactory; -typedef struct _GtkItemFactoryClass GtkItemFactoryClass; -typedef struct _GtkItemFactoryEntry GtkItemFactoryEntry; -typedef struct _GtkItemFactoryItem GtkItemFactoryItem; - -struct _GtkItemFactory -{ - GtkObject object; - - gchar *path; - GtkAccelGroup *accel_group; - GtkWidget *widget; - GSList *items; - - GtkTranslateFunc translate_func; - gpointer translate_data; - GDestroyNotify translate_notify; -}; - -struct _GtkItemFactoryClass -{ - GtkObjectClass object_class; - - GHashTable *item_ht; - - /* Padding for future expansion */ - void (*_gtk_reserved1) (void); - void (*_gtk_reserved2) (void); - void (*_gtk_reserved3) (void); - void (*_gtk_reserved4) (void); -}; - -struct _GtkItemFactoryEntry -{ - gchar *path; - gchar *accelerator; - - GtkItemFactoryCallback callback; - guint callback_action; - - /* possible values: - * NULL -> "<Item>" - * "" -> "<Item>" - * "<Title>" -> create a title item - * "<Item>" -> create a simple item - * "<ImageItem>" -> create an item holding an image - * "<StockItem>" -> create an item holding a stock image - * "<CheckItem>" -> create a check item - * "<ToggleItem>" -> create a toggle item - * "<RadioItem>" -> create a radio item - * <path> -> path of a radio item to link against - * "<Separator>" -> create a separator - * "<Tearoff>" -> create a tearoff separator - * "<Branch>" -> create an item to hold sub items - * "<LastBranch>" -> create a right justified item to hold sub items - */ - gchar *item_type; - - /* Extra data for some item types: - * ImageItem -> pointer to inlined pixbuf stream - * StockItem -> name of stock item - */ - gconstpointer extra_data; -}; - -struct _GtkItemFactoryItem -{ - gchar *path; - GSList *widgets; -}; - - -GType gtk_item_factory_get_type (void) G_GNUC_CONST; - -/* `container_type' must be of GTK_TYPE_MENU_BAR, GTK_TYPE_MENU, - * or GTK_TYPE_OPTION_MENU. - */ -GtkItemFactory* gtk_item_factory_new (GType container_type, - const gchar *path, - GtkAccelGroup *accel_group); -void gtk_item_factory_construct (GtkItemFactory *ifactory, - GType container_type, - const gchar *path, - GtkAccelGroup *accel_group); - -/* These functions operate on GtkItemFactoryClass basis. - */ -void gtk_item_factory_add_foreign (GtkWidget *accel_widget, - const gchar *full_path, - GtkAccelGroup *accel_group, - guint keyval, - GdkModifierType modifiers); - -GtkItemFactory* gtk_item_factory_from_widget (GtkWidget *widget); -G_CONST_RETURN gchar* gtk_item_factory_path_from_widget (GtkWidget *widget); - -GtkWidget* gtk_item_factory_get_item (GtkItemFactory *ifactory, - const gchar *path); -GtkWidget* gtk_item_factory_get_widget (GtkItemFactory *ifactory, - const gchar *path); -GtkWidget* gtk_item_factory_get_widget_by_action (GtkItemFactory *ifactory, - guint action); -GtkWidget* gtk_item_factory_get_item_by_action (GtkItemFactory *ifactory, - guint action); - -void gtk_item_factory_create_item (GtkItemFactory *ifactory, - GtkItemFactoryEntry *entry, - gpointer callback_data, - guint callback_type); -void gtk_item_factory_create_items (GtkItemFactory *ifactory, - guint n_entries, - GtkItemFactoryEntry *entries, - gpointer callback_data); -void gtk_item_factory_delete_item (GtkItemFactory *ifactory, - const gchar *path); -void gtk_item_factory_delete_entry (GtkItemFactory *ifactory, - GtkItemFactoryEntry *entry); -void gtk_item_factory_delete_entries (GtkItemFactory *ifactory, - guint n_entries, - GtkItemFactoryEntry *entries); -void gtk_item_factory_popup (GtkItemFactory *ifactory, - guint x, - guint y, - guint mouse_button, - guint32 time_); -void gtk_item_factory_popup_with_data(GtkItemFactory *ifactory, - gpointer popup_data, - GDestroyNotify destroy, - guint x, - guint y, - guint mouse_button, - guint32 time_); -gpointer gtk_item_factory_popup_data (GtkItemFactory *ifactory); -gpointer gtk_item_factory_popup_data_from_widget (GtkWidget *widget); -void gtk_item_factory_set_translate_func (GtkItemFactory *ifactory, - GtkTranslateFunc func, - gpointer data, - GDestroyNotify notify); - -/* Compatibility functions for deprecated GtkMenuFactory code - */ - -/* Used by gtk_item_factory_create_menu_entries () */ -typedef void (*GtkMenuCallback) (GtkWidget *widget, - gpointer user_data); -typedef struct { - gchar *path; - gchar *accelerator; - GtkMenuCallback callback; - gpointer callback_data; - GtkWidget *widget; -} GtkMenuEntry; - -/* Used by gtk_item_factory_callback_marshal () */ -typedef void (*GtkItemFactoryCallback2) (GtkWidget *widget, - gpointer callback_data, - guint callback_action); - -/* Used by gtk_item_factory_create_items () */ -void gtk_item_factory_create_items_ac (GtkItemFactory *ifactory, - guint n_entries, - GtkItemFactoryEntry *entries, - gpointer callback_data, - guint callback_type); - -GtkItemFactory* gtk_item_factory_from_path (const gchar *path); -void gtk_item_factory_create_menu_entries (guint n_entries, - GtkMenuEntry *entries); -void gtk_item_factories_path_delete (const gchar *ifactory_path, - const gchar *path); - -G_END_DECLS - -#endif /* !GTK_DISABLE_DEPRECATED */ - -#endif /* __GTK_ITEM_FACTORY_H__ */ - diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c index 10e5850c36..a027f857e9 100644 --- a/gtk/gtklabel.c +++ b/gtk/gtklabel.c @@ -48,6 +48,7 @@ #include "gtkimage.h" #include "gtkshow.h" #include "gtktooltip.h" +#include "gtkextendedlayout.h" #include "gtkprivate.h" #include "gtkalias.h" @@ -153,6 +154,11 @@ enum { PROP_TRACK_VISITED_LINKS }; +/* When rotating ellipsizable text we want the natural size to request + * more to ensure the label wont ever ellipsize in an allocation of full natural size. + * */ +#define ROTATION_ELLIPSIZE_PADDING 2 + static guint signals[LAST_SIGNAL] = { 0 }; static const GdkColor default_link_color = { 0, 0, 0, 0xeeee }; @@ -168,8 +174,6 @@ static void gtk_label_get_property (GObject *object, GParamSpec *pspec); static void gtk_label_destroy (GtkObject *object); static void gtk_label_finalize (GObject *object); -static void gtk_label_size_request (GtkWidget *widget, - GtkRequisition *requisition); static void gtk_label_size_allocate (GtkWidget *widget, GtkAllocation *allocation); static void gtk_label_state_changed (GtkWidget *widget, @@ -236,7 +240,7 @@ static void gtk_label_ensure_select_info (GtkLabel *label); static void gtk_label_clear_select_info (GtkLabel *label); static void gtk_label_update_cursor (GtkLabel *label); static void gtk_label_clear_layout (GtkLabel *label); -static void gtk_label_ensure_layout (GtkLabel *label); +static void gtk_label_ensure_layout (GtkLabel *label, gboolean guess_wrap_width); static void gtk_label_invalidate_wrap_width (GtkLabel *label); static void gtk_label_select_region_index (GtkLabel *label, gint anchor_index, @@ -301,13 +305,32 @@ static void gtk_label_get_link_colors (GtkWidget *widget, static void emit_activate_link (GtkLabel *label, GtkLabelLink *link); +static void gtk_label_extended_layout_init (GtkExtendedLayoutIface *iface); +static gboolean gtk_label_is_height_for_width (GtkExtendedLayout *layout); +static void gtk_label_get_desired_width (GtkExtendedLayout *layout, + gint *minimum_size, + gint *natural_size); +static void gtk_label_get_desired_height (GtkExtendedLayout *layout, + gint *minimum_size, + gint *natural_size); +static void gtk_label_get_width_for_height (GtkExtendedLayout *layout, + gint height, + gint *minimum_width, + gint *natural_width); +static void gtk_label_get_height_for_width (GtkExtendedLayout *layout, + gint width, + gint *minimum_height, + gint *natural_height); + static GQuark quark_angle = 0; static GtkBuildableIface *buildable_parent_iface = NULL; G_DEFINE_TYPE_WITH_CODE (GtkLabel, gtk_label, GTK_TYPE_MISC, G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE, - gtk_label_buildable_interface_init)); + gtk_label_buildable_interface_init) + G_IMPLEMENT_INTERFACE (GTK_TYPE_EXTENDED_LAYOUT, + gtk_label_extended_layout_init)); static void add_move_binding (GtkBindingSet *binding_set, @@ -348,7 +371,6 @@ gtk_label_class_init (GtkLabelClass *class) object_class->destroy = gtk_label_destroy; - widget_class->size_request = gtk_label_size_request; widget_class->size_allocate = gtk_label_size_allocate; widget_class->state_changed = gtk_label_state_changed; widget_class->style_set = gtk_label_style_set; @@ -643,12 +665,13 @@ gtk_label_class_init (GtkLabelClass *class) /** * GtkLabel:width-chars: - * + * * The desired width of the label, in characters. If this property is set to - * -1, the width will be calculated automatically, otherwise the label will - * request either 3 characters or the property value, whichever is greater. - * If the "width-chars" property is set to a positive value, then the - * #GtkLabel:max-width-chars property is ignored. + * -1, the width will be calculated automatically. + * + * See the section on <link linkend="label-text-layout">text layout</link> + * for details of how #GtkLabel:width-chars and #GtkLabel:max-width-chars + * determine the width of ellipsized and wrapped labels. * * Since: 2.6 **/ @@ -705,11 +728,12 @@ gtk_label_class_init (GtkLabelClass *class) * GtkLabel:max-width-chars: * * The desired maximum width of the label, in characters. If this property - * is set to -1, the width will be calculated automatically, otherwise the - * label will request space for no more than the requested number of - * characters. If the #GtkLabel:width-chars property is set to a positive - * value, then the "max-width-chars" property is ignored. - * + * is set to -1, the width will be calculated automatically. + * + * See the section on <link linkend="label-text-layout">text layout</link> + * for details of how #GtkLabel:width-chars and #GtkLabel:max-width-chars + * determine the width of ellipsized and wrapped labels. + * * Since: 2.6 **/ g_object_class_install_property (gobject_class, @@ -1131,7 +1155,6 @@ attribute_from_text (GtkBuilder *builder, value, &val, error)) attribute = pango_attr_gravity_hint_new (g_value_get_enum (&val)); break; - /* PangoAttrString */ case PANGO_ATTR_FAMILY: attribute = pango_attr_family_new (value); @@ -2856,17 +2879,6 @@ gtk_label_get_line_wrap_mode (GtkLabel *label) return label->wrap_mode; } - -void -gtk_label_get (GtkLabel *label, - gchar **str) -{ - g_return_if_fail (GTK_IS_LABEL (label)); - g_return_if_fail (str != NULL); - - *str = label->text; -} - static void gtk_label_destroy (GtkObject *object) { @@ -2912,17 +2924,25 @@ gtk_label_clear_layout (GtkLabel *label) } } -static gint -get_label_char_width (GtkLabel *label) + +static void +get_label_width (GtkLabel *label, + gint *minimum, + gint *natural) { - GtkLabelPrivate *priv; - PangoContext *context; + GtkWidgetAuxInfo *aux_info; + GtkLabelPrivate *priv; + PangoLayout *layout; + PangoContext *context; PangoFontMetrics *metrics; - gint char_width, digit_width, char_pixels, w; - - priv = GTK_LABEL_GET_PRIVATE (label); - - context = pango_layout_get_context (label->layout); + PangoRectangle rect; + gint char_width, digit_width, char_pixels, text_width, ellipsize_chars, guess_width; + + priv = GTK_LABEL_GET_PRIVATE (label); + aux_info = _gtk_widget_get_aux_info (GTK_WIDGET (label), FALSE); + + layout = pango_layout_copy (label->layout); + context = pango_layout_get_context (layout); metrics = pango_context_get_metrics (context, GTK_WIDGET (label)->style->font_desc, pango_context_get_language (context)); @@ -2930,24 +2950,88 @@ get_label_char_width (GtkLabel *label) digit_width = pango_font_metrics_get_approximate_digit_width (metrics); char_pixels = MAX (char_width, digit_width); pango_font_metrics_unref (metrics); - - if (priv->width_chars < 0) + + /* Fetch the length of the complete unwrapped text */ + pango_layout_set_width (layout, -1); + pango_layout_get_extents (layout, NULL, &rect); + text_width = rect.width; + + /* Fetch the width that was guessed by gtk_label_ensure_layout() */ + pango_layout_get_extents (label->layout, NULL, &rect); + guess_width = rect.width; + + /* enforce minimum width for ellipsized labels at ~3 chars */ + if (label->ellipsize) + ellipsize_chars = 3; + else + ellipsize_chars = 0; + + /* "width-chars" Hard-coded minimum width: + * - minimum size should be MAX (width-chars, strlen ("...")); + * - natural size should be MAX (width-chars, strlen (label->text)); + * + * "max-width-chars" User specified maximum size requisition + * - minimum size should be MAX (width-chars, 0) + * - natural size should be MIN (max-width-chars, strlen (label->text)) + * + * For ellipsizing labels; if max-width-chars is specified: either it is used as + * a minimum size or the label text as a minimum size (natural size still overflows). + * + * For wrapping labels; A reasonable minimum size is useful to naturally layout + * interfaces automatically. In this case if no "width-chars" is specified, the minimum + * width will default to the wrap guess that gtk_label_ensure_layout() does. + * + * In *any* case the minimum width is completely overridden if an explicit width + * request was provided. + */ + + if (label->ellipsize || label->wrap) { - PangoRectangle rect; - - pango_layout_set_width (label->layout, -1); - pango_layout_get_extents (label->layout, NULL, &rect); - - w = char_pixels * MAX (priv->max_width_chars, 3); - w = MIN (rect.width, w); + *minimum = char_pixels * MAX (priv->width_chars, ellipsize_chars); + + /* Default to the minimum width regularly guessed by GTK+ if no minimum + * width was specified, only allow unwrapping of these labels. + * + * Note that when specifying a small width_chars for a long text; + * an accordingly large size will be required for the label height. + */ + if (label->wrap && priv->width_chars <= 0) + *minimum = guess_width; + + if (priv->max_width_chars < 0) + { + *natural = MAX (*minimum, text_width); + } + else + { + gint max_char_width = char_pixels * priv->max_width_chars; + gint max_width = MIN (text_width, max_char_width); + + /* With max-char-width specified, we let the minimum widths of + * ellipsized text crawl up to the max-char-width + * (note that we dont want to limit the minimum width for wrapping text). + */ + if (label->ellipsize) + *minimum = MIN (text_width, max_width); + + *natural = MAX (*minimum, max_width); + } } else { - /* enforce minimum width for ellipsized labels at ~3 chars */ - w = char_pixels * MAX (priv->width_chars, 3); + *minimum = text_width; + *natural = *minimum; } - - return w; + + /* if a width-request is set, use that as the requested label width */ + if ((label->wrap || label->ellipsize || priv->width_chars > 0 || priv->max_width_chars > 0) && + aux_info && aux_info->width > 0) + { + *minimum = aux_info->width * PANGO_SCALE; + *natural = MAX (*natural, *minimum); + } + + g_object_unref (layout); } static void @@ -2969,14 +3053,38 @@ get_label_wrap_width (GtkLabel *label) if (priv->wrap_width < 0) { - if (priv->width_chars > 0 || priv->max_width_chars > 0) - priv->wrap_width = get_label_char_width (label); + if (priv->width_chars > 0) + { + PangoLayout *layout; + PangoContext *context; + PangoFontMetrics *metrics; + PangoRectangle rect; + gint char_width, digit_width, char_pixels, text_width; + + layout = pango_layout_copy (label->layout); + context = pango_layout_get_context (layout); + metrics = pango_context_get_metrics (context, GTK_WIDGET (label)->style->font_desc, + pango_context_get_language (context)); + + char_width = pango_font_metrics_get_approximate_char_width (metrics); + digit_width = pango_font_metrics_get_approximate_digit_width (metrics); + char_pixels = MAX (char_width, digit_width); + pango_font_metrics_unref (metrics); + + pango_layout_set_width (layout, -1); + pango_layout_get_extents (layout, NULL, &rect); + g_object_unref (layout); + + text_width = rect.width; + + priv->wrap_width = PANGO_PIXELS (MAX (text_width, char_pixels * priv->width_chars)); + } else { PangoLayout *layout; layout = gtk_widget_create_pango_layout (GTK_WIDGET (label), - "This long string gives a good enough length for any line to have."); + "This string is just about long enough."); pango_layout_get_size (layout, &priv->wrap_width, NULL); g_object_unref (layout); } @@ -2986,7 +3094,7 @@ get_label_wrap_width (GtkLabel *label) } static void -gtk_label_ensure_layout (GtkLabel *label) +gtk_label_ensure_layout (GtkLabel *label, gboolean guess_wrap_width) { GtkWidget *widget; PangoRectangle logical_rect; @@ -3001,14 +3109,14 @@ gtk_label_ensure_layout (GtkLabel *label) PangoAlignment align = PANGO_ALIGN_LEFT; /* Quiet gcc */ gdouble angle = gtk_label_get_angle (label); - if (angle != 0.0 && !label->wrap && !label->ellipsize && !label->select_info) + if (angle != 0.0 && !label->select_info) { + PangoMatrix matrix = PANGO_MATRIX_INIT; + /* We rotate the standard singleton PangoContext for the widget, * depending on the fact that it's meant pretty much exclusively * for our use. */ - PangoMatrix matrix = PANGO_MATRIX_INIT; - pango_matrix_rotate (&matrix, angle); pango_context_set_matrix (gtk_widget_get_pango_context (widget), &matrix); @@ -3054,19 +3162,33 @@ gtk_label_ensure_layout (GtkLabel *label) pango_layout_set_single_paragraph_mode (label->layout, label->single_line_mode); if (label->ellipsize) - pango_layout_set_width (label->layout, - widget->allocation.width * PANGO_SCALE); + pango_layout_set_width (label->layout, + widget->allocation.width * PANGO_SCALE); else if (label->wrap) { - GtkWidgetAuxInfo *aux_info; + GtkWidgetAuxInfo *aux_info = _gtk_widget_get_aux_info (widget, FALSE); gint longest_paragraph; gint width, height; + gint aux_width = 0; - pango_layout_set_wrap (label->layout, label->wrap_mode); - - aux_info = _gtk_widget_get_aux_info (widget, FALSE); - if (aux_info && aux_info->width > 0) - pango_layout_set_width (label->layout, aux_info->width * PANGO_SCALE); + if ((angle == 90 || angle == 270) && aux_info && aux_info->height > 0) + aux_width = aux_info->height; + else if (aux_info && aux_info->width > 0) + aux_width = aux_info->width; + + if (aux_width > 0) + pango_layout_set_width (label->layout, aux_width * PANGO_SCALE); + else if (guess_wrap_width == FALSE && + widget->allocation.width > 1 && widget->allocation.height > 1) + { + if (angle == 90 || angle == 270) + width = widget->allocation.height - label->misc.ypad * 2; + else + width = widget->allocation.width - label->misc.xpad * 2; + + pango_layout_set_wrap (label->layout, label->wrap_mode); + pango_layout_set_width (label->layout, MAX (width, 1) * PANGO_SCALE); + } else { GdkScreen *screen = gtk_widget_get_screen (GTK_WIDGET (label)); @@ -3076,7 +3198,6 @@ gtk_label_ensure_layout (GtkLabel *label) pango_layout_get_extents (label->layout, NULL, &logical_rect); width = logical_rect.width; - /* Try to guess a reasonable maximum width */ longest_paragraph = width; @@ -3084,12 +3205,12 @@ gtk_label_ensure_layout (GtkLabel *label) width = MIN (width, wrap_width); width = MIN (width, PANGO_SCALE * (gdk_screen_get_width (screen) + 1) / 2); - + pango_layout_set_width (label->layout, width); pango_layout_get_extents (label->layout, NULL, &logical_rect); width = logical_rect.width; height = logical_rect.height; - + /* Unfortunately, the above may leave us with a very unbalanced looking paragraph, * so we try short search for a narrower width that leaves us with the same height */ @@ -3130,91 +3251,309 @@ gtk_label_ensure_layout (GtkLabel *label) } } -static void -gtk_label_size_request (GtkWidget *widget, - GtkRequisition *requisition) +static gint +get_single_line_height (GtkWidget *widget, + PangoLayout *layout) { - GtkLabel *label = GTK_LABEL (widget); - GtkLabelPrivate *priv; - gint width, height; - PangoRectangle logical_rect; - GtkWidgetAuxInfo *aux_info; + PangoContext *context; + PangoFontMetrics *metrics; + gint ascent, descent; - priv = GTK_LABEL_GET_PRIVATE (widget); + context = pango_layout_get_context (layout); + metrics = pango_context_get_metrics (context, widget->style->font_desc, + pango_context_get_language (context)); - /* - * If word wrapping is on, then the height requisition can depend - * on: + ascent = pango_font_metrics_get_ascent (metrics); + descent = pango_font_metrics_get_descent (metrics); + pango_font_metrics_unref (metrics); + + return ascent + descent; +} + +static void +gtk_label_extended_layout_init (GtkExtendedLayoutIface *iface) +{ + iface->is_height_for_width = gtk_label_is_height_for_width; + iface->get_desired_width = gtk_label_get_desired_width; + iface->get_desired_height = gtk_label_get_desired_height; + iface->get_width_for_height = gtk_label_get_width_for_height; + iface->get_height_for_width = gtk_label_get_height_for_width; +} + +static gboolean +gtk_label_is_height_for_width (GtkExtendedLayout *layout) +{ + GtkLabel *label = GTK_LABEL (layout); + gdouble angle = gtk_label_get_angle (label); + + if (angle == 90 || angle == 270) + return FALSE; + + return TRUE; +} + +static void +get_size_for_allocation (GtkLabel *label, + GtkOrientation orientation, + gint allocation, + gint *minimum_size, + gint *natural_size) +{ + PangoLayout *layout; + GtkWidgetAuxInfo *aux_info = + _gtk_widget_get_aux_info (GTK_WIDGET (label), FALSE); + gint aux_size; + gint text_height; + + gtk_label_ensure_layout (label, FALSE); + layout = pango_layout_copy (label->layout); + + if (aux_info) + { + if (orientation == GTK_ORIENTATION_HORIZONTAL) + aux_size = aux_info->width; + else + aux_size = aux_info->height; + } + else + aux_size = 0; + + if (aux_size > 0) + pango_layout_set_width (layout, aux_size * PANGO_SCALE); + else + pango_layout_set_width (layout, allocation * PANGO_SCALE); + + pango_layout_get_pixel_size (layout, NULL, &text_height); + + if (minimum_size) + *minimum_size = text_height; + + if (natural_size) + *natural_size = text_height; + + g_object_unref (layout); +} + +static void +gtk_label_get_desired_size (GtkExtendedLayout *layout, + GtkOrientation orientation, + gint *minimum_size, + gint *natural_size) +{ + GtkLabel *label = GTK_LABEL (layout); + PangoRectangle required_rect; + PangoRectangle natural_rect; + gdouble angle; + + /* "width-chars" Hard-coded minimum width: + * - minimum size should be MAX (width-chars, strlen ("...")); + * - natural size should be MAX (width-chars, strlen (label->text)); * - * - Any width set on the widget via gtk_widget_set_size_request(). - * - The padding of the widget (xpad, set by gtk_misc_set_padding) + * "max-width-chars" User specified maximum size requisition + * - minimum size should be MAX (width-chars, 0) + * - natural size should be MIN (max-width-chars, strlen (label->text)) * - * Instead of trying to detect changes to these quantities, if we - * are wrapping, we just rewrap for each size request. Since - * size requisitions are cached by the GTK+ core, this is not - * expensive. */ + /* When calculating ->wrap sometimes we need to invent a size; Ideally we should be doing + * that stuff here instead of inside gtk_label_ensure_layout() */ if (label->wrap) gtk_label_clear_layout (label); + gtk_label_ensure_layout (label, TRUE); - gtk_label_ensure_layout (label); + angle = gtk_label_get_angle (label); - width = label->misc.xpad * 2; - height = label->misc.ypad * 2; + /* Start off with the pixel extents of the rendered layout */ + pango_layout_get_extents (label->layout, NULL, &required_rect); + required_rect.x = required_rect.y = 0; - aux_info = _gtk_widget_get_aux_info (widget, FALSE); + if (label->single_line_mode || label->wrap) + required_rect.height = get_single_line_height (GTK_WIDGET (label), label->layout); + natural_rect = required_rect; + + /* Calculate text width itself based on GtkLabel property rules */ + get_label_width (label, &required_rect.width, &natural_rect.width); + + /* Now that we have minimum and natural sizes in pango extents, apply a possible transform */ if (label->have_transform) { - PangoRectangle rect; - PangoContext *context = pango_layout_get_context (label->layout); - const PangoMatrix *matrix = pango_context_get_matrix (context); + PangoLayout *layout = pango_layout_copy (label->layout); + PangoContext *context = pango_layout_get_context (label->layout); + const PangoMatrix *matrix = pango_context_get_matrix (context); - pango_layout_get_extents (label->layout, NULL, &rect); - pango_matrix_transform_rectangle (matrix, &rect); - pango_extents_to_pixels (&rect, NULL); - - requisition->width = width + rect.width; - requisition->height = height + rect.height; + pango_layout_set_width (layout, -1); + pango_layout_set_ellipsize (layout, PANGO_ELLIPSIZE_NONE); - return; + pango_layout_get_extents (layout, NULL, &natural_rect); + g_object_unref (layout); + + pango_matrix_transform_rectangle (matrix, &required_rect); + pango_matrix_transform_rectangle (matrix, &natural_rect); + + /* Bump the natural size in case of ellipsize to ensure pango has + * enough space in the angles (note, we could alternatively set the + * layout to not ellipsize when we know we have been allocated our + * full natural size, or it may be that pango needs a fix here). + */ + if (label->ellipsize && angle != 0 && angle != 90 && angle != 180 && angle != 270 && angle != 360) + { + /* For some reason we only need this at about 110 degrees, and only + * when gaining in height + */ + natural_rect.height += ROTATION_ELLIPSIZE_PADDING * 2 * PANGO_SCALE; + natural_rect.width += ROTATION_ELLIPSIZE_PADDING * 2 * PANGO_SCALE; + } } - else - pango_layout_get_extents (label->layout, NULL, &logical_rect); - if ((label->wrap || label->ellipsize || - priv->width_chars > 0 || priv->max_width_chars > 0) && - aux_info && aux_info->width > 0) - width += aux_info->width; - else if (label->ellipsize || priv->width_chars > 0 || priv->max_width_chars > 0) + required_rect.width = PANGO_PIXELS_CEIL (required_rect.width); + required_rect.height = PANGO_PIXELS_CEIL (required_rect.height); + + natural_rect.width = PANGO_PIXELS_CEIL (natural_rect.width); + natural_rect.height = PANGO_PIXELS_CEIL (natural_rect.height); + + if (orientation == GTK_ORIENTATION_HORIZONTAL) { - width += PANGO_PIXELS (get_label_char_width (label)); - } - else - width += PANGO_PIXELS (logical_rect.width); + /* Note, we cant use get_size_for_allocation() when rotating + * ellipsized labels. + */ + if (!(label->ellipsize && label->have_transform) && + (angle == 90 || angle == 270)) + { + /* Doing a h4w request on a rotated label here, return the + * required width for the minimum height. + */ + get_size_for_allocation (label, + GTK_ORIENTATION_VERTICAL, + required_rect.height, + minimum_size, natural_size); - if (label->single_line_mode) + } + else + { + /* Normal desired width */ + *minimum_size = required_rect.width; + *natural_size = natural_rect.width; + } + + *minimum_size += label->misc.xpad * 2; + *natural_size += label->misc.xpad * 2; + } + else /* GTK_ORIENTATION_VERTICAL */ { - PangoContext *context; - PangoFontMetrics *metrics; - gint ascent, descent; + /* Note, we cant use get_size_for_allocation() when rotating + * ellipsized labels. + */ + if (!(label->ellipsize && label->have_transform) && + (angle == 0 || angle == 180)) + { + /* Doing a w4h request on a label here, return the required + * height for the minimum width. + */ + get_size_for_allocation (label, + GTK_ORIENTATION_HORIZONTAL, + required_rect.width, + minimum_size, natural_size); + } + else + { + /* A vertically rotated label does w4h, so return the base + * desired height (text length) + */ + *minimum_size = required_rect.height; + *natural_size = natural_rect.height; + } - context = pango_layout_get_context (label->layout); - metrics = pango_context_get_metrics (context, widget->style->font_desc, - pango_context_get_language (context)); + *minimum_size += label->misc.ypad * 2; + *natural_size += label->misc.ypad * 2; + } - ascent = pango_font_metrics_get_ascent (metrics); - descent = pango_font_metrics_get_descent (metrics); - pango_font_metrics_unref (metrics); - - height += PANGO_PIXELS (ascent + descent); + /* Restore real allocated size of layout; sometimes size-requests + * are randomly called without a following allocation; for this case + * we need to make sure we dont have a mucked up layout because we + * went and guessed the wrap-size. + */ + if (label->wrap) + gtk_label_clear_layout (label); + gtk_label_ensure_layout (label, FALSE); + +} + + +static void +gtk_label_get_desired_width (GtkExtendedLayout *layout, + gint *minimum_size, + gint *natural_size) +{ + gtk_label_get_desired_size (layout, + GTK_ORIENTATION_HORIZONTAL, + minimum_size, natural_size); +} + +static void +gtk_label_get_desired_height (GtkExtendedLayout *layout, + gint *minimum_size, + gint *natural_size) +{ + gtk_label_get_desired_size (layout, + GTK_ORIENTATION_VERTICAL, + minimum_size, natural_size); +} + +static void +gtk_label_get_width_for_height (GtkExtendedLayout *layout, + gint height, + gint *minimum_width, + gint *natural_width) +{ + GtkLabel *label = GTK_LABEL (layout); + gdouble angle = gtk_label_get_angle (label); + + if (label->wrap && (angle == 90 || angle == 270)) + { + if (label->wrap) + gtk_label_clear_layout (label); + + get_size_for_allocation (label, GTK_ORIENTATION_VERTICAL, + MAX (1, height - (label->misc.ypad * 2)), + minimum_width, natural_width); + + if (minimum_width) + *minimum_width += label->misc.xpad * 2; + + if (natural_width) + *natural_width += label->misc.xpad * 2; } else - height += PANGO_PIXELS (logical_rect.height); + GTK_EXTENDED_LAYOUT_GET_IFACE (layout)->get_desired_width (layout, minimum_width, natural_width); +} - requisition->width = width; - requisition->height = height; +static void +gtk_label_get_height_for_width (GtkExtendedLayout *layout, + gint width, + gint *minimum_height, + gint *natural_height) +{ + GtkLabel *label = GTK_LABEL (layout); + gdouble angle = gtk_label_get_angle (label); + + if (label->wrap && (angle == 0 || angle == 180 || angle == 360)) + { + if (label->wrap) + gtk_label_clear_layout (label); + + get_size_for_allocation (label, GTK_ORIENTATION_HORIZONTAL, + MAX (1, width - label->misc.xpad * 2), + minimum_height, natural_height); + + if (minimum_height) + *minimum_height += label->misc.ypad * 2; + + if (natural_height) + *natural_height += label->misc.ypad * 2; + } + else + GTK_EXTENDED_LAYOUT_GET_IFACE (layout)->get_desired_height (layout, minimum_height, natural_height); } static void @@ -3227,21 +3566,86 @@ gtk_label_size_allocate (GtkWidget *widget, GTK_WIDGET_CLASS (gtk_label_parent_class)->size_allocate (widget, allocation); + /* The layout may have been recently cleared in get_size_for_orientation(), + * but the width at that point may not be the same as the allocated width + */ + if (label->wrap) + gtk_label_clear_layout (label); + + gtk_label_ensure_layout (label, FALSE); + if (label->ellipsize) { if (label->layout) - { - gint width; - PangoRectangle logical; + { + PangoRectangle logical; + PangoRectangle bounds; - width = (allocation->width - label->misc.xpad * 2) * PANGO_SCALE; + bounds.x = bounds.y = 0; + bounds.width = allocation->width - label->misc.xpad * 2; + bounds.height = allocation->height - label->misc.ypad * 2; - pango_layout_set_width (label->layout, -1); - pango_layout_get_extents (label->layout, NULL, &logical); + pango_layout_set_width (label->layout, -1); + pango_layout_get_pixel_extents (label->layout, NULL, &logical); - if (logical.width > width) - pango_layout_set_width (label->layout, width); - } + if (label->have_transform) + { + PangoContext *context = gtk_widget_get_pango_context (widget); + const PangoMatrix *matrix = pango_context_get_matrix (context); + + const gdouble dx = matrix->xx; /* cos (M_PI * angle / 180) */ + const gdouble dy = matrix->xy; /* sin (M_PI * angle / 180) */ + if (fabs (dy) < 0.01) + { + if (logical.width > bounds.width) + pango_layout_set_width (label->layout, bounds.width * PANGO_SCALE); + } + else if (fabs (dx) < 0.01) + { + if (logical.width > bounds.height) + pango_layout_set_width (label->layout, bounds.height * PANGO_SCALE); + } + else + { + gdouble x0, y0, x1, y1, length; + gboolean vertical; + gint cy; + + x0 = bounds.width / 2; + y0 = dx ? x0 * dy / dx : G_MAXDOUBLE; + vertical = fabs (y0) > bounds.height / 2; + + if (vertical) + { + y0 = bounds.height/2; + x0 = dy ? y0 * dx / dy : G_MAXDOUBLE; + } + + length = 2 * sqrt (x0 * x0 + y0 * y0); + pango_layout_set_width (label->layout, rint (length * PANGO_SCALE)); + pango_layout_get_pixel_size (label->layout, NULL, &cy); + + x1 = +dy * cy/2; + y1 = -dx * cy/2; + + if (vertical) + { + y0 = bounds.height/2 + y1 - y0; + x0 = -y0 * dx/dy; + } + else + { + x0 = bounds.width/2 + x1 - x0; + y0 = -x0 * dy/dx; + } + + length = length - sqrt (x0 * x0 + y0 * y0) * 2; + pango_layout_set_width (label->layout, rint (length * PANGO_SCALE)); + } + } + else if (logical.width > bounds.width) + pango_layout_set_width (label->layout, bounds.width * PANGO_SCALE); + } } if (label->select_info && label->select_info->window) @@ -3335,36 +3739,52 @@ get_layout_location (GtkLabel *label, gint *yp) { GtkMisc *misc; - GtkWidget *widget; + GtkWidget *widget; GtkLabelPrivate *priv; gfloat xalign; gint req_width, x, y; + gint req_height; PangoRectangle logical; - - misc = GTK_MISC (label); + gdouble angle; + + misc = GTK_MISC (label); widget = GTK_WIDGET (label); - priv = GTK_LABEL_GET_PRIVATE (label); + priv = GTK_LABEL_GET_PRIVATE (label); + angle = gtk_label_get_angle (label); if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR) xalign = misc->xalign; else xalign = 1.0 - misc->xalign; - pango_layout_get_pixel_extents (label->layout, NULL, &logical); + pango_layout_get_extents (label->layout, NULL, &logical); - if (label->ellipsize || priv->width_chars > 0) + /* Do the wrap width delimiting before the transform + */ + if (label->wrap || label->ellipsize || priv->width_chars > 0) { int width; width = pango_layout_get_width (label->layout); - req_width = logical.width; if (width != -1) - req_width = MIN(PANGO_PIXELS (width), req_width); - req_width += 2 * misc->xpad; + logical.width = MIN (width, logical.width); } - else - req_width = widget->requisition.width; + + if (label->have_transform) + { + PangoContext *context = gtk_widget_get_pango_context (widget); + const PangoMatrix *matrix = pango_context_get_matrix (context); + pango_matrix_transform_rectangle (matrix, &logical); + } + + pango_extents_to_pixels (&logical, NULL); + + req_width = logical.width; + req_height = logical.height; + + req_width += 2 * misc->xpad; + req_height += 2 * misc->ypad; x = floor (widget->allocation.x + (gint)misc->xpad + xalign * (widget->allocation.width - req_width)); @@ -3373,7 +3793,9 @@ get_layout_location (GtkLabel *label, x = MAX (x, widget->allocation.x + misc->xpad); else x = MIN (x, widget->allocation.x + widget->allocation.width - misc->xpad); - x -= logical.x; + + + /* bgo#315462 - For single-line labels, *do* align the requisition with * respect to the allocation, even if we are under-allocated. For multi-line @@ -3390,10 +3812,10 @@ get_layout_location (GtkLabel *label, */ if (pango_layout_get_line_count (label->layout) == 1) y = floor (widget->allocation.y + (gint)misc->ypad - + (widget->allocation.height - widget->requisition.height) * misc->yalign); + + (widget->allocation.height - req_height) * misc->yalign); else y = floor (widget->allocation.y + (gint)misc->ypad - + MAX (((widget->allocation.height - widget->requisition.height) * misc->yalign), + + MAX (((widget->allocation.height - req_height) * misc->yalign), 0)); if (xp) @@ -3430,7 +3852,7 @@ get_cursor_direction (GtkLabel *label) g_assert (label->select_info); - gtk_label_ensure_layout (label); + gtk_label_ensure_layout (label, FALSE); for (l = pango_layout_get_lines_readonly (label->layout); l; l = l->next) { @@ -3475,7 +3897,7 @@ gtk_label_draw_cursor (GtkLabel *label, gint xoffset, gint yoffset) keymap_direction = gdk_keymap_get_direction (gdk_keymap_get_for_display (gtk_widget_get_display (widget))); cursor_direction = get_cursor_direction (label); - gtk_label_ensure_layout (label); + gtk_label_ensure_layout (label, FALSE); pango_layout_get_cursor_pos (label->layout, label->select_info->selection_end, &strong_pos, &weak_pos); @@ -3559,7 +3981,7 @@ gtk_label_expose (GtkWidget *widget, GtkLabelSelectionInfo *info = label->select_info; gint x, y; - gtk_label_ensure_layout (label); + gtk_label_ensure_layout (label, FALSE); if (gtk_widget_get_visible (widget) && gtk_widget_get_mapped (widget) && label->text && (*label->text != '\0')) @@ -3794,36 +4216,6 @@ gtk_label_set_uline_text_internal (GtkLabel *label, g_free (pattern); } -guint -gtk_label_parse_uline (GtkLabel *label, - const gchar *str) -{ - guint keyval; - - g_return_val_if_fail (GTK_IS_LABEL (label), GDK_VoidSymbol); - g_return_val_if_fail (str != NULL, GDK_VoidSymbol); - - g_object_freeze_notify (G_OBJECT (label)); - - gtk_label_set_label_internal (label, g_strdup (str ? str : "")); - gtk_label_set_use_markup_internal (label, FALSE); - gtk_label_set_use_underline_internal (label, TRUE); - - gtk_label_recalculate (label); - - keyval = label->mnemonic_keyval; - if (keyval != GDK_VoidSymbol) - { - label->mnemonic_keyval = GDK_VoidSymbol; - gtk_label_setup_mnemonic (label, keyval); - g_object_notify (G_OBJECT (label), "mnemonic-keyval"); - } - - g_object_thaw_notify (G_OBJECT (label)); - - return keyval; -} - /** * gtk_label_set_text_with_mnemonic: * @label: a #GtkLabel @@ -3972,7 +4364,7 @@ get_layout_index (GtkLabel *label, *index = 0; - gtk_label_ensure_layout (label); + gtk_label_ensure_layout (label, FALSE); window_to_layout_coords (label, &x, &y); @@ -4394,7 +4786,6 @@ gtk_label_motion (GtkWidget *widget, GtkLabel *label = GTK_LABEL (widget); GtkLabelSelectionInfo *info = label->select_info; gint index; - gint x, y; if (info == NULL) return FALSE; @@ -4407,8 +4798,7 @@ gtk_label_motion (GtkWidget *widget, if (info->selection_anchor == info->selection_end) { - gdk_window_get_pointer (event->window, &x, &y, NULL); - if (get_layout_index (label, x, y, &index)) + if (get_layout_index (label, event->x, event->y, &index)) { for (l = info->links; l != NULL; l = l->next) { @@ -4450,8 +4840,6 @@ gtk_label_motion (GtkWidget *widget, if ((event->state & GDK_BUTTON1_MASK) == 0) return FALSE; - gdk_window_get_pointer (info->window, &x, &y, NULL); - if (info->in_drag) { if (gtk_drag_check_threshold (widget, @@ -4476,6 +4864,9 @@ gtk_label_motion (GtkWidget *widget, } else { + gint x, y; + + gdk_window_get_device_position (info->window, event->device, &x, &y, NULL); get_layout_index (label, x, y, &index); if (info->select_words) @@ -5016,7 +5407,7 @@ gtk_label_get_layout (GtkLabel *label) { g_return_val_if_fail (GTK_IS_LABEL (label), NULL); - gtk_label_ensure_layout (label); + gtk_label_ensure_layout (label, FALSE); return label->layout; } @@ -5043,7 +5434,7 @@ gtk_label_get_layout_offsets (GtkLabel *label, { g_return_if_fail (GTK_IS_LABEL (label)); - gtk_label_ensure_layout (label); + gtk_label_ensure_layout (label, FALSE); get_layout_location (label, x, y); } @@ -5188,7 +5579,7 @@ get_better_cursor (GtkLabel *label, "gtk-split-cursor", &split_cursor, NULL); - gtk_label_ensure_layout (label); + gtk_label_ensure_layout (label, FALSE); pango_layout_get_cursor_pos (label->layout, index, &strong_pos, &weak_pos); @@ -5228,7 +5619,7 @@ gtk_label_move_logically (GtkLabel *label, gint n_attrs; gint length; - gtk_label_ensure_layout (label); + gtk_label_ensure_layout (label, FALSE); length = g_utf8_strlen (label->text, -1); @@ -5272,7 +5663,7 @@ gtk_label_move_visually (GtkLabel *label, gboolean split_cursor; gboolean strong; - gtk_label_ensure_layout (label); + gtk_label_ensure_layout (label, FALSE); g_object_get (gtk_widget_get_settings (GTK_WIDGET (label)), "gtk-split-cursor", &split_cursor, @@ -5325,7 +5716,7 @@ gtk_label_move_forward_word (GtkLabel *label, PangoLogAttr *log_attrs; gint n_attrs; - gtk_label_ensure_layout (label); + gtk_label_ensure_layout (label, FALSE); pango_layout_get_log_attrs (label->layout, &log_attrs, &n_attrs); @@ -5353,7 +5744,7 @@ gtk_label_move_backward_word (GtkLabel *label, PangoLogAttr *log_attrs; gint n_attrs; - gtk_label_ensure_layout (label); + gtk_label_ensure_layout (label, FALSE); pango_layout_get_log_attrs (label->layout, &log_attrs, &n_attrs); diff --git a/gtk/gtklabel.h b/gtk/gtklabel.h index 88a9db7ddf..9c8cffacfd 100644 --- a/gtk/gtklabel.h +++ b/gtk/gtklabel.h @@ -23,7 +23,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only <gtk/gtk.h> can be included directly." #endif @@ -182,20 +182,6 @@ void gtk_label_set_track_visited_links (GtkLabel *label, gboolean track_links); gboolean gtk_label_get_track_visited_links (GtkLabel *label); -#ifndef GTK_DISABLE_DEPRECATED - -#define gtk_label_set gtk_label_set_text -void gtk_label_get (GtkLabel *label, - gchar **str); - -/* Convenience function to set the name and pattern by parsing - * a string with embedded underscores, and return the appropriate - * key symbol for the accelerator. - */ -guint gtk_label_parse_uline (GtkLabel *label, - const gchar *string); - -#endif /* GTK_DISABLE_DEPRECATED */ /* private */ diff --git a/gtk/gtklayout.c b/gtk/gtklayout.c index 7e3e0b9afb..868347f645 100644 --- a/gtk/gtklayout.c +++ b/gtk/gtklayout.c @@ -534,42 +534,6 @@ gtk_layout_get_size (GtkLayout *layout, *height = layout->height; } -/** - * gtk_layout_freeze: - * @layout: a #GtkLayout - * - * This is a deprecated function, it doesn't do anything useful. - **/ -void -gtk_layout_freeze (GtkLayout *layout) -{ - g_return_if_fail (GTK_IS_LAYOUT (layout)); - - layout->freeze_count++; -} - -/** - * gtk_layout_thaw: - * @layout: a #GtkLayout - * - * This is a deprecated function, it doesn't do anything useful. - **/ -void -gtk_layout_thaw (GtkLayout *layout) -{ - g_return_if_fail (GTK_IS_LAYOUT (layout)); - - if (layout->freeze_count) - { - if (!(--layout->freeze_count)) - { - gtk_widget_queue_draw (GTK_WIDGET (layout)); - gdk_window_process_updates (GTK_WIDGET (layout)->window, TRUE); - } - } - -} - /* Basic Object handling procedures */ static void diff --git a/gtk/gtklayout.h b/gtk/gtklayout.h index 0d2e6bcf54..b446fb331f 100644 --- a/gtk/gtklayout.h +++ b/gtk/gtklayout.h @@ -28,7 +28,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only <gtk/gtk.h> can be included directly." #endif @@ -119,20 +119,6 @@ void gtk_layout_set_hadjustment (GtkLayout *layout, void gtk_layout_set_vadjustment (GtkLayout *layout, GtkAdjustment *adjustment); - -#ifndef GTK_DISABLE_DEPRECATED -/* These disable and enable moving and repainting the scrolling window - * of the GtkLayout, respectively. If you want to update the layout's - * offsets but do not want it to repaint itself, you should use these - * functions. - * - * - I don't understand these are supposed to work, so I suspect - * - they don't now. OWT 1/20/98 - */ -void gtk_layout_freeze (GtkLayout *layout); -void gtk_layout_thaw (GtkLayout *layout); -#endif /* GTK_DISABLE_DEPRECATED */ - G_END_DECLS #endif /* __GTK_LAYOUT_H__ */ diff --git a/gtk/gtklinkbutton.h b/gtk/gtklinkbutton.h index 4e834dae94..a5e987e27c 100644 --- a/gtk/gtklinkbutton.h +++ b/gtk/gtklinkbutton.h @@ -22,7 +22,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Cambridge, MA 02139, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only <gtk/gtk.h> can be included directly." #endif diff --git a/gtk/gtklist.c b/gtk/gtklist.c deleted file mode 100644 index db4c665831..0000000000 --- a/gtk/gtklist.c +++ /dev/null @@ -1,2587 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#include "config.h" -#include <string.h> /* memset */ - -#undef GTK_DISABLE_DEPRECATED -#define __GTK_LIST_C__ - -#include "gtklist.h" -#include "gtklistitem.h" -#include "gtkmain.h" -#include "gtksignal.h" -#include "gtklabel.h" -#include "gtkmarshalers.h" -#include "gtkintl.h" - -#include "gtkalias.h" - -enum { - SELECTION_CHANGED, - SELECT_CHILD, - UNSELECT_CHILD, - LAST_SIGNAL -}; - -enum { - ARG_0, - ARG_SELECTION_MODE -}; - -#define SCROLL_TIME 100 - -/*** GtkList Methods ***/ -static void gtk_list_class_init (GtkListClass *klass); -static void gtk_list_init (GtkList *list); -static void gtk_list_set_arg (GtkObject *object, - GtkArg *arg, - guint arg_id); -static void gtk_list_get_arg (GtkObject *object, - GtkArg *arg, - guint arg_id); -/*** GtkObject Methods ***/ -static void gtk_list_dispose (GObject *object); - -/*** GtkWidget Methods ***/ -static void gtk_list_size_request (GtkWidget *widget, - GtkRequisition *requisition); -static void gtk_list_size_allocate (GtkWidget *widget, - GtkAllocation *allocation); -static void gtk_list_realize (GtkWidget *widget); -static void gtk_list_unmap (GtkWidget *widget); -static void gtk_list_style_set (GtkWidget *widget, - GtkStyle *previous_style); -static gint gtk_list_motion_notify (GtkWidget *widget, - GdkEventMotion *event); -static gint gtk_list_button_press (GtkWidget *widget, - GdkEventButton *event); -static gint gtk_list_button_release (GtkWidget *widget, - GdkEventButton *event); - -static gboolean gtk_list_focus (GtkWidget *widget, - GtkDirectionType direction); - -/*** GtkContainer Methods ***/ -static void gtk_list_add (GtkContainer *container, - GtkWidget *widget); -static void gtk_list_remove (GtkContainer *container, - GtkWidget *widget); -static void gtk_list_forall (GtkContainer *container, - gboolean include_internals, - GtkCallback callback, - gpointer callback_data); -static GtkType gtk_list_child_type (GtkContainer *container); -static void gtk_list_set_focus_child (GtkContainer *container, - GtkWidget *widget); - -/*** GtkList Private Functions ***/ -static void gtk_list_move_focus_child (GtkList *list, - GtkScrollType scroll_type, - gfloat position); -static gint gtk_list_horizontal_timeout (GtkWidget *list); -static gint gtk_list_vertical_timeout (GtkWidget *list); -static void gtk_list_remove_items_internal (GtkList *list, - GList *items, - gboolean no_unref); - -/*** GtkList Selection Methods ***/ -static void gtk_real_list_select_child (GtkList *list, - GtkWidget *child); -static void gtk_real_list_unselect_child (GtkList *list, - GtkWidget *child); - -/*** GtkList Selection Functions ***/ -static void gtk_list_set_anchor (GtkList *list, - gboolean add_mode, - gint anchor, - GtkWidget *undo_focus_child); -static void gtk_list_fake_unselect_all (GtkList *list, - GtkWidget *item); -static void gtk_list_fake_toggle_row (GtkList *list, - GtkWidget *item); -static void gtk_list_update_extended_selection (GtkList *list, - gint row); -static void gtk_list_reset_extended_selection (GtkList *list); - -/*** GtkListItem Signal Functions ***/ -static void gtk_list_signal_drag_begin (GtkWidget *widget, - GdkDragContext *context, - GtkList *list); -static void gtk_list_signal_toggle_focus_row (GtkListItem *list_item, - GtkList *list); -static void gtk_list_signal_select_all (GtkListItem *list_item, - GtkList *list); -static void gtk_list_signal_unselect_all (GtkListItem *list_item, - GtkList *list); -static void gtk_list_signal_undo_selection (GtkListItem *list_item, - GtkList *list); -static void gtk_list_signal_start_selection (GtkListItem *list_item, - GtkList *list); -static void gtk_list_signal_end_selection (GtkListItem *list_item, - GtkList *list); -static void gtk_list_signal_extend_selection (GtkListItem *list_item, - GtkScrollType scroll_type, - gfloat position, - gboolean auto_start_selection, - GtkList *list); -static void gtk_list_signal_scroll_horizontal (GtkListItem *list_item, - GtkScrollType scroll_type, - gfloat position, - GtkList *list); -static void gtk_list_signal_scroll_vertical (GtkListItem *list_item, - GtkScrollType scroll_type, - gfloat position, - GtkList *list); -static void gtk_list_signal_toggle_add_mode (GtkListItem *list_item, - GtkList *list); -static void gtk_list_signal_item_select (GtkListItem *list_item, - GtkList *list); -static void gtk_list_signal_item_deselect (GtkListItem *list_item, - GtkList *list); -static void gtk_list_signal_item_toggle (GtkListItem *list_item, - GtkList *list); - - -static void gtk_list_drag_begin (GtkWidget *widget, - GdkDragContext *context); - - -static GtkContainerClass *parent_class = NULL; -static guint list_signals[LAST_SIGNAL] = { 0 }; - -static const gchar vadjustment_key[] = "gtk-vadjustment"; -static guint vadjustment_key_id = 0; -static const gchar hadjustment_key[] = "gtk-hadjustment"; -static guint hadjustment_key_id = 0; - -GtkType -gtk_list_get_type (void) -{ - static GtkType list_type = 0; - - if (!list_type) - { - static const GtkTypeInfo list_info = - { - "GtkList", - sizeof (GtkList), - sizeof (GtkListClass), - (GtkClassInitFunc) gtk_list_class_init, - (GtkObjectInitFunc) gtk_list_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, - }; - - I_("GtkList"); - list_type = gtk_type_unique (GTK_TYPE_CONTAINER, &list_info); - } - - return list_type; -} - -static void -gtk_list_class_init (GtkListClass *class) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (class); - GtkObjectClass *object_class; - GtkWidgetClass *widget_class; - GtkContainerClass *container_class; - - object_class = (GtkObjectClass*) class; - widget_class = (GtkWidgetClass*) class; - container_class = (GtkContainerClass*) class; - - parent_class = gtk_type_class (GTK_TYPE_CONTAINER); - - vadjustment_key_id = g_quark_from_static_string (vadjustment_key); - hadjustment_key_id = g_quark_from_static_string (hadjustment_key); - - gobject_class->dispose = gtk_list_dispose; - - - object_class->set_arg = gtk_list_set_arg; - object_class->get_arg = gtk_list_get_arg; - - widget_class->unmap = gtk_list_unmap; - widget_class->style_set = gtk_list_style_set; - widget_class->realize = gtk_list_realize; - widget_class->button_press_event = gtk_list_button_press; - widget_class->button_release_event = gtk_list_button_release; - widget_class->motion_notify_event = gtk_list_motion_notify; - widget_class->size_request = gtk_list_size_request; - widget_class->size_allocate = gtk_list_size_allocate; - widget_class->drag_begin = gtk_list_drag_begin; - widget_class->focus = gtk_list_focus; - - container_class->add = gtk_list_add; - container_class->remove = gtk_list_remove; - container_class->forall = gtk_list_forall; - container_class->child_type = gtk_list_child_type; - container_class->set_focus_child = gtk_list_set_focus_child; - - class->selection_changed = NULL; - class->select_child = gtk_real_list_select_child; - class->unselect_child = gtk_real_list_unselect_child; - - list_signals[SELECTION_CHANGED] = - gtk_signal_new (I_("selection-changed"), - GTK_RUN_FIRST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkListClass, selection_changed), - _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); - list_signals[SELECT_CHILD] = - gtk_signal_new (I_("select-child"), - GTK_RUN_FIRST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkListClass, select_child), - _gtk_marshal_VOID__OBJECT, - GTK_TYPE_NONE, 1, - GTK_TYPE_WIDGET); - list_signals[UNSELECT_CHILD] = - gtk_signal_new (I_("unselect-child"), - GTK_RUN_FIRST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkListClass, unselect_child), - _gtk_marshal_VOID__OBJECT, - GTK_TYPE_NONE, 1, - GTK_TYPE_WIDGET); - - gtk_object_add_arg_type ("GtkList::selection-mode", - GTK_TYPE_SELECTION_MODE, - GTK_ARG_READWRITE | G_PARAM_STATIC_NAME, - ARG_SELECTION_MODE); -} - -static void -gtk_list_init (GtkList *list) -{ - list->children = NULL; - list->selection = NULL; - - list->undo_selection = NULL; - list->undo_unselection = NULL; - - list->last_focus_child = NULL; - list->undo_focus_child = NULL; - - list->htimer = 0; - list->vtimer = 0; - - list->anchor = -1; - list->drag_pos = -1; - list->anchor_state = GTK_STATE_SELECTED; - - list->selection_mode = GTK_SELECTION_SINGLE; - list->drag_selection = FALSE; - list->add_mode = FALSE; -} - -static void -gtk_list_set_arg (GtkObject *object, - GtkArg *arg, - guint arg_id) -{ - GtkList *list = GTK_LIST (object); - - switch (arg_id) - { - case ARG_SELECTION_MODE: - gtk_list_set_selection_mode (list, GTK_VALUE_ENUM (*arg)); - break; - } -} - -static void -gtk_list_get_arg (GtkObject *object, - GtkArg *arg, - guint arg_id) -{ - GtkList *list = GTK_LIST (object); - - switch (arg_id) - { - case ARG_SELECTION_MODE: - GTK_VALUE_ENUM (*arg) = list->selection_mode; - break; - default: - arg->type = GTK_TYPE_INVALID; - break; - } -} - -GtkWidget* -gtk_list_new (void) -{ - return GTK_WIDGET (gtk_type_new (GTK_TYPE_LIST)); -} - - -/* Private GtkObject Methods : - * - * gtk_list_dispose - */ -static void -gtk_list_dispose (GObject *object) -{ - gtk_list_clear_items (GTK_LIST (object), 0, -1); - - G_OBJECT_CLASS (parent_class)->dispose (object); -} - - -/* Private GtkWidget Methods : - * - * gtk_list_size_request - * gtk_list_size_allocate - * gtk_list_realize - * gtk_list_unmap - * gtk_list_motion_notify - * gtk_list_button_press - * gtk_list_button_release - */ -static void -gtk_list_size_request (GtkWidget *widget, - GtkRequisition *requisition) -{ - GtkList *list = GTK_LIST (widget); - GtkWidget *child; - GList *children; - - requisition->width = 0; - requisition->height = 0; - - children = list->children; - while (children) - { - child = children->data; - children = children->next; - - if (gtk_widget_get_visible (child)) - { - GtkRequisition child_requisition; - - gtk_widget_size_request (child, &child_requisition); - - requisition->width = MAX (requisition->width, - child_requisition.width); - requisition->height += child_requisition.height; - } - } - - requisition->width += GTK_CONTAINER (list)->border_width * 2; - requisition->height += GTK_CONTAINER (list)->border_width * 2; - - requisition->width = MAX (requisition->width, 1); - requisition->height = MAX (requisition->height, 1); -} - -static void -gtk_list_size_allocate (GtkWidget *widget, - GtkAllocation *allocation) -{ - GtkList *list = GTK_LIST (widget); - GtkWidget *child; - GtkAllocation child_allocation; - GList *children; - - widget->allocation = *allocation; - if (gtk_widget_get_realized (widget)) - gdk_window_move_resize (widget->window, - allocation->x, allocation->y, - allocation->width, allocation->height); - - if (list->children) - { - child_allocation.x = GTK_CONTAINER (list)->border_width; - child_allocation.y = GTK_CONTAINER (list)->border_width; - child_allocation.width = MAX (1, (gint)allocation->width - - child_allocation.x * 2); - - children = list->children; - - while (children) - { - child = children->data; - children = children->next; - - if (gtk_widget_get_visible (child)) - { - GtkRequisition child_requisition; - gtk_widget_get_child_requisition (child, &child_requisition); - - child_allocation.height = child_requisition.height; - - gtk_widget_size_allocate (child, &child_allocation); - - child_allocation.y += child_allocation.height; - } - } - } -} - -static void -gtk_list_realize (GtkWidget *widget) -{ - GdkWindowAttr attributes; - gint attributes_mask; - - gtk_widget_set_realized (widget, TRUE); - - 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_OUTPUT; - attributes.visual = gtk_widget_get_visual (widget); - attributes.colormap = gtk_widget_get_colormap (widget); - attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK; - - attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP; - - widget->window = gdk_window_new (gtk_widget_get_parent_window (widget), - &attributes, attributes_mask); - gdk_window_set_user_data (widget->window, widget); - - widget->style = gtk_style_attach (widget->style, widget->window); - gdk_window_set_background (widget->window, - &widget->style->base[GTK_STATE_NORMAL]); -} - -static gboolean -list_has_grab (GtkList *list) -{ - return (GTK_WIDGET_HAS_GRAB (list) && - gdk_display_pointer_is_grabbed (gtk_widget_get_display (GTK_WIDGET (list)))); - -} - -static void -gtk_list_unmap (GtkWidget *widget) -{ - GtkList *list = GTK_LIST (widget); - - if (!gtk_widget_get_mapped (widget)) - return; - - gtk_widget_set_mapped (widget, FALSE); - - if (list_has_grab (list)) - { - gtk_list_end_drag_selection (list); - - if (list->anchor != -1 && list->selection_mode == GTK_SELECTION_MULTIPLE) - gtk_list_end_selection (list); - } - - gdk_window_hide (widget->window); -} - -static gint -gtk_list_motion_notify (GtkWidget *widget, - GdkEventMotion *event) -{ - GtkList *list = GTK_LIST (widget); - GtkWidget *item = NULL; - GtkAdjustment *adj; - GtkContainer *container; - GList *work; - gint x; - gint y; - gint row = -1; - gint focus_row = 0; - gint length = 0; - - if (!list->drag_selection || !list->children) - return FALSE; - - container = GTK_CONTAINER (widget); - - if (event->is_hint || event->window != widget->window) - gdk_window_get_pointer (widget->window, &x, &y, NULL); - else - { - x = event->x; - y = event->y; - } - - adj = gtk_object_get_data_by_id (GTK_OBJECT (list), hadjustment_key_id); - - /* horizontal autoscrolling */ - if (adj && widget->allocation.width > adj->page_size && - (x < adj->value || x >= adj->value + adj->page_size)) - { - if (list->htimer == 0) - { - list->htimer = gdk_threads_add_timeout - (SCROLL_TIME, (GSourceFunc) gtk_list_horizontal_timeout, widget); - - if (!((x < adj->value && adj->value <= 0) || - (x > adj->value + adj->page_size && - adj->value >= adj->upper - adj->page_size))) - { - gdouble value; - - if (x < adj->value) - value = adj->value + (x - adj->value) / 2 - 1; - else - value = adj->value + 1 + (x - adj->value - adj->page_size) / 2; - - gtk_adjustment_set_value (adj, - CLAMP (value, 0.0, - adj->upper - adj->page_size)); - } - } - else - return FALSE; - } - - - /* vertical autoscrolling */ - for (work = list->children; work; length++, work = work->next) - { - if (row < 0) - { - item = GTK_WIDGET (work->data); - if (item->allocation.y > y || - (item->allocation.y <= y && - item->allocation.y + item->allocation.height > y)) - row = length; - } - - if (work->data == container->focus_child) - focus_row = length; - } - - if (row < 0) - row = length - 1; - - if (list->vtimer != 0) - return FALSE; - - if (!((y < 0 && focus_row == 0) || - (y > widget->allocation.height && focus_row >= length - 1))) - list->vtimer = gdk_threads_add_timeout (SCROLL_TIME, - (GSourceFunc) gtk_list_vertical_timeout, - list); - - if (row != focus_row) - gtk_widget_grab_focus (item); - - switch (list->selection_mode) - { - case GTK_SELECTION_BROWSE: - gtk_list_select_child (list, item); - break; - case GTK_SELECTION_MULTIPLE: - gtk_list_update_extended_selection (list, row); - break; - default: - break; - } - - return FALSE; -} - -static gint -gtk_list_button_press (GtkWidget *widget, - GdkEventButton *event) -{ - GtkList *list = GTK_LIST (widget); - GtkWidget *item; - - if (event->button != 1) - return FALSE; - - item = gtk_get_event_widget ((GdkEvent*) event); - - while (item && !GTK_IS_LIST_ITEM (item)) - item = item->parent; - - if (item && (item->parent == widget)) - { - gint last_focus_row; - gint focus_row; - - if (event->type == GDK_BUTTON_PRESS) - { - gtk_grab_add (widget); - list->drag_selection = TRUE; - } - else if (list_has_grab (list)) - gtk_list_end_drag_selection (list); - - if (!gtk_widget_has_focus(item)) - gtk_widget_grab_focus (item); - - if (list->add_mode) - { - list->add_mode = FALSE; - gtk_widget_queue_draw (item); - } - - switch (list->selection_mode) - { - case GTK_SELECTION_SINGLE: - if (event->type != GDK_BUTTON_PRESS) - gtk_list_select_child (list, item); - else - list->undo_focus_child = item; - break; - - case GTK_SELECTION_BROWSE: - break; - - case GTK_SELECTION_MULTIPLE: - focus_row = g_list_index (list->children, item); - - if (list->last_focus_child) - last_focus_row = g_list_index (list->children, - list->last_focus_child); - else - { - last_focus_row = focus_row; - list->last_focus_child = item; - } - - if (event->type != GDK_BUTTON_PRESS) - { - if (list->anchor >= 0) - { - gtk_list_update_extended_selection (list, focus_row); - gtk_list_end_selection (list); - } - gtk_list_select_child (list, item); - break; - } - - if (event->state & GDK_CONTROL_MASK) - { - if (event->state & GDK_SHIFT_MASK) - { - if (list->anchor < 0) - { - g_list_free (list->undo_selection); - g_list_free (list->undo_unselection); - list->undo_selection = NULL; - list->undo_unselection = NULL; - - list->anchor = last_focus_row; - list->drag_pos = last_focus_row; - list->undo_focus_child = list->last_focus_child; - } - gtk_list_update_extended_selection (list, focus_row); - } - else - { - if (list->anchor < 0) - gtk_list_set_anchor (list, TRUE, - focus_row, list->last_focus_child); - else - gtk_list_update_extended_selection (list, focus_row); - } - break; - } - - if (event->state & GDK_SHIFT_MASK) - { - gtk_list_set_anchor (list, FALSE, - last_focus_row, list->last_focus_child); - gtk_list_update_extended_selection (list, focus_row); - break; - } - - if (list->anchor < 0) - gtk_list_set_anchor (list, FALSE, focus_row, - list->last_focus_child); - else - gtk_list_update_extended_selection (list, focus_row); - break; - - default: - break; - } - - return TRUE; - } - - return FALSE; -} - -static gint -gtk_list_button_release (GtkWidget *widget, - GdkEventButton *event) -{ - GtkList *list = GTK_LIST (widget); - GtkWidget *item; - - /* we don't handle button 2 and 3 */ - if (event->button != 1) - return FALSE; - - if (list->drag_selection) - { - gtk_list_end_drag_selection (list); - - switch (list->selection_mode) - { - case GTK_SELECTION_MULTIPLE: - if (!(event->state & GDK_SHIFT_MASK)) - gtk_list_end_selection (list); - break; - - case GTK_SELECTION_SINGLE: - - item = gtk_get_event_widget ((GdkEvent*) event); - - while (item && !GTK_IS_LIST_ITEM (item)) - item = item->parent; - - if (item && item->parent == widget) - { - if (list->undo_focus_child == item) - gtk_list_toggle_row (list, item); - } - list->undo_focus_child = NULL; - break; - - default: - break; - } - - return TRUE; - } - - return FALSE; -} - -static void -gtk_list_style_set (GtkWidget *widget, - GtkStyle *previous_style) -{ - GtkStyle *style; - - if (previous_style && gtk_widget_get_realized (widget)) - { - style = gtk_widget_get_style (widget); - gdk_window_set_background (gtk_widget_get_window (widget), - &style->base[gtk_widget_get_state (widget)]); - } -} - -/* GtkContainer Methods : - * gtk_list_add - * gtk_list_remove - * gtk_list_forall - * gtk_list_child_type - * gtk_list_set_focus_child - * gtk_list_focus - */ -static void -gtk_list_add (GtkContainer *container, - GtkWidget *widget) -{ - GList *item_list; - - g_return_if_fail (GTK_IS_LIST_ITEM (widget)); - - item_list = g_list_alloc (); - item_list->data = widget; - - gtk_list_append_items (GTK_LIST (container), item_list); -} - -static void -gtk_list_remove (GtkContainer *container, - GtkWidget *widget) -{ - GList *item_list; - - g_return_if_fail (container == GTK_CONTAINER (widget->parent)); - - item_list = g_list_alloc (); - item_list->data = widget; - - gtk_list_remove_items (GTK_LIST (container), item_list); - - g_list_free (item_list); -} - -static void -gtk_list_forall (GtkContainer *container, - gboolean include_internals, - GtkCallback callback, - gpointer callback_data) -{ - GtkList *list = GTK_LIST (container); - GtkWidget *child; - GList *children; - - children = list->children; - - while (children) - { - child = children->data; - children = children->next; - - (* callback) (child, callback_data); - } -} - -static GtkType -gtk_list_child_type (GtkContainer *container) -{ - return GTK_TYPE_LIST_ITEM; -} - -static void -gtk_list_set_focus_child (GtkContainer *container, - GtkWidget *child) -{ - GtkList *list; - - g_return_if_fail (GTK_IS_LIST (container)); - - if (child) - g_return_if_fail (GTK_IS_WIDGET (child)); - - list = GTK_LIST (container); - - if (child != container->focus_child) - { - if (container->focus_child) - { - list->last_focus_child = container->focus_child; - g_object_unref (container->focus_child); - } - container->focus_child = child; - if (container->focus_child) - g_object_ref (container->focus_child); - } - - /* check for v adjustment */ - if (container->focus_child) - { - GtkAdjustment *adjustment; - - adjustment = gtk_object_get_data_by_id (GTK_OBJECT (container), - vadjustment_key_id); - if (adjustment) - gtk_adjustment_clamp_page (adjustment, - container->focus_child->allocation.y, - (container->focus_child->allocation.y + - container->focus_child->allocation.height)); - switch (list->selection_mode) - { - case GTK_SELECTION_BROWSE: - gtk_list_select_child (list, child); - break; - case GTK_SELECTION_MULTIPLE: - if (!list->last_focus_child && !list->add_mode) - { - list->undo_focus_child = list->last_focus_child; - gtk_list_unselect_all (list); - gtk_list_select_child (list, child); - } - break; - default: - break; - } - } -} - -static gboolean -gtk_list_focus (GtkWidget *widget, - GtkDirectionType direction) -{ - gint return_val = FALSE; - GtkContainer *container; - - container = GTK_CONTAINER (widget); - - if (container->focus_child == NULL || - !gtk_widget_has_focus (container->focus_child)) - { - if (GTK_LIST (container)->last_focus_child) - gtk_container_set_focus_child - (container, GTK_LIST (container)->last_focus_child); - - if (GTK_WIDGET_CLASS (parent_class)->focus) - return_val = GTK_WIDGET_CLASS (parent_class)->focus (widget, - direction); - } - - if (!return_val) - { - GtkList *list; - - list = GTK_LIST (container); - if (list->selection_mode == GTK_SELECTION_MULTIPLE && list->anchor >= 0) - gtk_list_end_selection (list); - - if (container->focus_child) - list->last_focus_child = container->focus_child; - } - - return return_val; -} - - -/* Public GtkList Methods : - * - * gtk_list_insert_items - * gtk_list_append_items - * gtk_list_prepend_items - * gtk_list_remove_items - * gtk_list_remove_items_no_unref - * gtk_list_clear_items - * - * gtk_list_child_position - */ -void -gtk_list_insert_items (GtkList *list, - GList *items, - gint position) -{ - GtkWidget *widget; - GList *tmp_list; - GList *last; - gint nchildren; - - g_return_if_fail (GTK_IS_LIST (list)); - - if (!items) - return; - - gtk_list_end_drag_selection (list); - if (list->selection_mode == GTK_SELECTION_MULTIPLE && list->anchor >= 0) - gtk_list_end_selection (list); - - tmp_list = items; - while (tmp_list) - { - widget = tmp_list->data; - tmp_list = tmp_list->next; - - gtk_widget_set_parent (widget, GTK_WIDGET (list)); - gtk_signal_connect (GTK_OBJECT (widget), "drag-begin", - G_CALLBACK (gtk_list_signal_drag_begin), - list); - gtk_signal_connect (GTK_OBJECT (widget), "toggle-focus-row", - G_CALLBACK (gtk_list_signal_toggle_focus_row), - list); - gtk_signal_connect (GTK_OBJECT (widget), "select-all", - G_CALLBACK (gtk_list_signal_select_all), - list); - gtk_signal_connect (GTK_OBJECT (widget), "unselect-all", - G_CALLBACK (gtk_list_signal_unselect_all), - list); - gtk_signal_connect (GTK_OBJECT (widget), "undo-selection", - G_CALLBACK (gtk_list_signal_undo_selection), - list); - gtk_signal_connect (GTK_OBJECT (widget), "start-selection", - G_CALLBACK (gtk_list_signal_start_selection), - list); - gtk_signal_connect (GTK_OBJECT (widget), "end-selection", - G_CALLBACK (gtk_list_signal_end_selection), - list); - gtk_signal_connect (GTK_OBJECT (widget), "extend-selection", - G_CALLBACK (gtk_list_signal_extend_selection), - list); - gtk_signal_connect (GTK_OBJECT (widget), "scroll-horizontal", - G_CALLBACK (gtk_list_signal_scroll_horizontal), - list); - gtk_signal_connect (GTK_OBJECT (widget), "scroll-vertical", - G_CALLBACK (gtk_list_signal_scroll_vertical), - list); - gtk_signal_connect (GTK_OBJECT (widget), "toggle-add-mode", - G_CALLBACK (gtk_list_signal_toggle_add_mode), - list); - gtk_signal_connect (GTK_OBJECT (widget), "select", - G_CALLBACK (gtk_list_signal_item_select), - list); - gtk_signal_connect (GTK_OBJECT (widget), "deselect", - G_CALLBACK (gtk_list_signal_item_deselect), - list); - gtk_signal_connect (GTK_OBJECT (widget), "toggle", - G_CALLBACK (gtk_list_signal_item_toggle), - list); - } - - - nchildren = g_list_length (list->children); - if ((position < 0) || (position > nchildren)) - position = nchildren; - - if (position == nchildren) - { - if (list->children) - { - tmp_list = g_list_last (list->children); - tmp_list->next = items; - items->prev = tmp_list; - } - else - { - list->children = items; - } - } - else - { - tmp_list = g_list_nth (list->children, position); - last = g_list_last (items); - - if (tmp_list->prev) - tmp_list->prev->next = items; - last->next = tmp_list; - items->prev = tmp_list->prev; - tmp_list->prev = last; - - if (tmp_list == list->children) - list->children = items; - } - - if (list->children && !list->selection && - (list->selection_mode == GTK_SELECTION_BROWSE)) - { - widget = list->children->data; - gtk_list_select_child (list, widget); - } -} - -void -gtk_list_append_items (GtkList *list, - GList *items) -{ - g_return_if_fail (GTK_IS_LIST (list)); - - gtk_list_insert_items (list, items, -1); -} - -void -gtk_list_prepend_items (GtkList *list, - GList *items) -{ - g_return_if_fail (GTK_IS_LIST (list)); - - gtk_list_insert_items (list, items, 0); -} - -void -gtk_list_remove_items (GtkList *list, - GList *items) -{ - gtk_list_remove_items_internal (list, items, FALSE); -} - -void -gtk_list_remove_items_no_unref (GtkList *list, - GList *items) -{ - gtk_list_remove_items_internal (list, items, TRUE); -} - -void -gtk_list_clear_items (GtkList *list, - gint start, - gint end) -{ - GtkContainer *container; - GtkWidget *widget; - GtkWidget *new_focus_child = NULL; - GList *start_list; - GList *end_list; - GList *tmp_list; - guint nchildren; - gboolean grab_focus = FALSE; - - g_return_if_fail (GTK_IS_LIST (list)); - - nchildren = g_list_length (list->children); - - if (nchildren == 0) - return; - - if ((end < 0) || (end > nchildren)) - end = nchildren; - - if (start >= end) - return; - - container = GTK_CONTAINER (list); - - gtk_list_end_drag_selection (list); - if (list->selection_mode == GTK_SELECTION_MULTIPLE) - { - if (list->anchor >= 0) - gtk_list_end_selection (list); - - gtk_list_reset_extended_selection (list); - } - - start_list = g_list_nth (list->children, start); - end_list = g_list_nth (list->children, end); - - if (start_list->prev) - start_list->prev->next = end_list; - if (end_list && end_list->prev) - end_list->prev->next = NULL; - if (end_list) - end_list->prev = start_list->prev; - if (start_list == list->children) - list->children = end_list; - - if (container->focus_child) - { - if (g_list_find (start_list, container->focus_child)) - { - if (start_list->prev) - new_focus_child = start_list->prev->data; - else if (list->children) - new_focus_child = list->children->data; - - if (gtk_widget_has_focus (container->focus_child)) - grab_focus = TRUE; - } - } - - tmp_list = start_list; - while (tmp_list) - { - widget = tmp_list->data; - tmp_list = tmp_list->next; - - g_object_ref (widget); - - if (widget->state == GTK_STATE_SELECTED) - gtk_list_unselect_child (list, widget); - - gtk_signal_disconnect_by_data (GTK_OBJECT (widget), (gpointer) list); - gtk_widget_unparent (widget); - - if (widget == list->undo_focus_child) - list->undo_focus_child = NULL; - if (widget == list->last_focus_child) - list->last_focus_child = NULL; - - g_object_unref (widget); - } - - g_list_free (start_list); - - if (new_focus_child) - { - if (grab_focus) - gtk_widget_grab_focus (new_focus_child); - else if (container->focus_child) - gtk_container_set_focus_child (container, new_focus_child); - - if ((list->selection_mode == GTK_SELECTION_BROWSE || - list->selection_mode == GTK_SELECTION_MULTIPLE) && !list->selection) - { - list->last_focus_child = new_focus_child; - gtk_list_select_child (list, new_focus_child); - } - } - - if (gtk_widget_get_visible (GTK_WIDGET (list))) - gtk_widget_queue_resize (GTK_WIDGET (list)); -} - -gint -gtk_list_child_position (GtkList *list, - GtkWidget *child) -{ - GList *children; - gint pos; - - g_return_val_if_fail (GTK_IS_LIST (list), -1); - g_return_val_if_fail (child != NULL, -1); - - pos = 0; - children = list->children; - - while (children) - { - if (child == GTK_WIDGET (children->data)) - return pos; - - pos += 1; - children = children->next; - } - - return -1; -} - - -/* Private GtkList Insert/Remove Item Functions: - * - * gtk_list_remove_items_internal - */ -static void -gtk_list_remove_items_internal (GtkList *list, - GList *items, - gboolean no_unref) -{ - GtkWidget *widget; - GtkWidget *new_focus_child; - GtkWidget *old_focus_child; - GtkContainer *container; - GList *tmp_list; - GList *work; - gboolean grab_focus = FALSE; - - g_return_if_fail (GTK_IS_LIST (list)); - - if (!items) - return; - - container = GTK_CONTAINER (list); - - gtk_list_end_drag_selection (list); - if (list->selection_mode == GTK_SELECTION_MULTIPLE) - { - if (list->anchor >= 0) - gtk_list_end_selection (list); - - gtk_list_reset_extended_selection (list); - } - - tmp_list = items; - while (tmp_list) - { - widget = tmp_list->data; - tmp_list = tmp_list->next; - - if (widget->state == GTK_STATE_SELECTED) - gtk_list_unselect_child (list, widget); - } - - if (container->focus_child) - { - old_focus_child = new_focus_child = container->focus_child; - if (gtk_widget_has_focus (container->focus_child)) - grab_focus = TRUE; - } - else - old_focus_child = new_focus_child = list->last_focus_child; - - tmp_list = items; - while (tmp_list) - { - widget = tmp_list->data; - tmp_list = tmp_list->next; - - g_object_ref (widget); - if (no_unref) - g_object_ref (widget); - - if (widget == new_focus_child) - { - work = g_list_find (list->children, widget); - - if (work) - { - if (work->next) - new_focus_child = work->next->data; - else if (list->children != work && work->prev) - new_focus_child = work->prev->data; - else - new_focus_child = NULL; - } - } - - gtk_signal_disconnect_by_data (GTK_OBJECT (widget), (gpointer) list); - list->children = g_list_remove (list->children, widget); - gtk_widget_unparent (widget); - - if (widget == list->undo_focus_child) - list->undo_focus_child = NULL; - if (widget == list->last_focus_child) - list->last_focus_child = NULL; - - g_object_unref (widget); - } - - if (new_focus_child && new_focus_child != old_focus_child) - { - if (grab_focus) - gtk_widget_grab_focus (new_focus_child); - else if (container->focus_child) - gtk_container_set_focus_child (container, new_focus_child); - - if (list->selection_mode == GTK_SELECTION_BROWSE && !list->selection) - { - list->last_focus_child = new_focus_child; - gtk_list_select_child (list, new_focus_child); - } - } - - if (gtk_widget_get_visible (GTK_WIDGET (list))) - gtk_widget_queue_resize (GTK_WIDGET (list)); -} - - -/* Public GtkList Selection Methods : - * - * gtk_list_set_selection_mode - * gtk_list_select_item - * gtk_list_unselect_item - * gtk_list_select_child - * gtk_list_unselect_child - * gtk_list_select_all - * gtk_list_unselect_all - * gtk_list_extend_selection - * gtk_list_end_drag_selection - * gtk_list_start_selection - * gtk_list_end_selection - * gtk_list_toggle_row - * gtk_list_toggle_focus_row - * gtk_list_toggle_add_mode - * gtk_list_undo_selection - */ -void -gtk_list_set_selection_mode (GtkList *list, - GtkSelectionMode mode) -{ - g_return_if_fail (GTK_IS_LIST (list)); - - if (list->selection_mode == mode) - return; - - list->selection_mode = mode; - - switch (mode) - { - case GTK_SELECTION_SINGLE: - case GTK_SELECTION_BROWSE: - gtk_list_unselect_all (list); - break; - default: - break; - } -} - -void -gtk_list_select_item (GtkList *list, - gint item) -{ - GList *tmp_list; - - g_return_if_fail (GTK_IS_LIST (list)); - - tmp_list = g_list_nth (list->children, item); - if (tmp_list) - gtk_list_select_child (list, GTK_WIDGET (tmp_list->data)); -} - -void -gtk_list_unselect_item (GtkList *list, - gint item) -{ - GList *tmp_list; - - g_return_if_fail (GTK_IS_LIST (list)); - - tmp_list = g_list_nth (list->children, item); - if (tmp_list) - gtk_list_unselect_child (list, GTK_WIDGET (tmp_list->data)); -} - -void -gtk_list_select_child (GtkList *list, - GtkWidget *child) -{ - gtk_signal_emit (GTK_OBJECT (list), list_signals[SELECT_CHILD], child); -} - -void -gtk_list_unselect_child (GtkList *list, - GtkWidget *child) -{ - gtk_signal_emit (GTK_OBJECT (list), list_signals[UNSELECT_CHILD], child); -} - -void -gtk_list_select_all (GtkList *list) -{ - GtkContainer *container; - - g_return_if_fail (GTK_IS_LIST (list)); - - if (!list->children) - return; - - if (list_has_grab (list)) - gtk_list_end_drag_selection (list); - - if (list->selection_mode == GTK_SELECTION_MULTIPLE && list->anchor >= 0) - gtk_list_end_selection (list); - - container = GTK_CONTAINER (list); - - switch (list->selection_mode) - { - case GTK_SELECTION_BROWSE: - if (container->focus_child) - { - gtk_list_select_child (list, container->focus_child); - return; - } - break; - case GTK_SELECTION_MULTIPLE: - g_list_free (list->undo_selection); - g_list_free (list->undo_unselection); - list->undo_selection = NULL; - list->undo_unselection = NULL; - - if (list->children && - gtk_widget_get_state (list->children->data) != GTK_STATE_SELECTED) - gtk_list_fake_toggle_row (list, GTK_WIDGET (list->children->data)); - - list->anchor_state = GTK_STATE_SELECTED; - list->anchor = 0; - list->drag_pos = 0; - list->undo_focus_child = container->focus_child; - gtk_list_update_extended_selection (list, g_list_length(list->children)); - gtk_list_end_selection (list); - return; - default: - break; - } -} - -void -gtk_list_unselect_all (GtkList *list) -{ - GtkContainer *container; - GtkWidget *item; - GList *work; - - g_return_if_fail (GTK_IS_LIST (list)); - - if (!list->children) - return; - - if (list_has_grab (list)) - gtk_list_end_drag_selection (list); - - if (list->selection_mode == GTK_SELECTION_MULTIPLE && list->anchor >= 0) - gtk_list_end_selection (list); - - container = GTK_CONTAINER (list); - - switch (list->selection_mode) - { - case GTK_SELECTION_BROWSE: - if (container->focus_child) - { - gtk_list_select_child (list, container->focus_child); - return; - } - break; - case GTK_SELECTION_MULTIPLE: - gtk_list_reset_extended_selection (list); - break; - default: - break; - } - - work = list->selection; - - while (work) - { - item = work->data; - work = work->next; - gtk_list_unselect_child (list, item); - } -} - -void -gtk_list_extend_selection (GtkList *list, - GtkScrollType scroll_type, - gfloat position, - gboolean auto_start_selection) -{ - GtkContainer *container; - - g_return_if_fail (GTK_IS_LIST (list)); - - if (list_has_grab (list) || - list->selection_mode != GTK_SELECTION_MULTIPLE) - return; - - container = GTK_CONTAINER (list); - - if (auto_start_selection) - { - gint focus_row; - - focus_row = g_list_index (list->children, container->focus_child); - gtk_list_set_anchor (list, list->add_mode, focus_row, - container->focus_child); - } - else if (list->anchor < 0) - return; - - gtk_list_move_focus_child (list, scroll_type, position); - gtk_list_update_extended_selection - (list, g_list_index (list->children, container->focus_child)); -} - -void -gtk_list_end_drag_selection (GtkList *list) -{ - g_return_if_fail (GTK_IS_LIST (list)); - - list->drag_selection = FALSE; - if (GTK_WIDGET_HAS_GRAB (list)) - gtk_grab_remove (GTK_WIDGET (list)); - - if (list->htimer) - { - g_source_remove (list->htimer); - list->htimer = 0; - } - if (list->vtimer) - { - g_source_remove (list->vtimer); - list->vtimer = 0; - } -} - -void -gtk_list_start_selection (GtkList *list) -{ - GtkContainer *container; - gint focus_row; - - g_return_if_fail (GTK_IS_LIST (list)); - - if (list_has_grab (list)) - return; - - container = GTK_CONTAINER (list); - - if ((focus_row = g_list_index (list->selection, container->focus_child)) - >= 0) - gtk_list_set_anchor (list, list->add_mode, - focus_row, container->focus_child); -} - -void -gtk_list_end_selection (GtkList *list) -{ - gint i; - gint e; - gboolean top_down; - GList *work; - GtkWidget *item; - gint item_index; - - g_return_if_fail (GTK_IS_LIST (list)); - - if (list_has_grab (list) || list->anchor < 0) - return; - - i = MIN (list->anchor, list->drag_pos); - e = MAX (list->anchor, list->drag_pos); - - top_down = (list->anchor < list->drag_pos); - - list->anchor = -1; - list->drag_pos = -1; - - if (list->undo_selection) - { - work = list->selection; - list->selection = list->undo_selection; - list->undo_selection = work; - work = list->selection; - while (work) - { - item = work->data; - work = work->next; - item_index = g_list_index (list->children, item); - if (item_index < i || item_index > e) - { - gtk_widget_set_state (item, GTK_STATE_SELECTED); - gtk_list_unselect_child (list, item); - list->undo_selection = g_list_prepend (list->undo_selection, - item); - } - } - } - - if (top_down) - { - for (work = g_list_nth (list->children, i); i <= e; - i++, work = work->next) - { - item = work->data; - if (g_list_find (list->selection, item)) - { - if (item->state == GTK_STATE_NORMAL) - { - gtk_widget_set_state (item, GTK_STATE_SELECTED); - gtk_list_unselect_child (list, item); - list->undo_selection = g_list_prepend (list->undo_selection, - item); - } - } - else if (item->state == GTK_STATE_SELECTED) - { - gtk_widget_set_state (item, GTK_STATE_NORMAL); - list->undo_unselection = g_list_prepend (list->undo_unselection, - item); - } - } - } - else - { - for (work = g_list_nth (list->children, e); i <= e; - e--, work = work->prev) - { - item = work->data; - if (g_list_find (list->selection, item)) - { - if (item->state == GTK_STATE_NORMAL) - { - gtk_widget_set_state (item, GTK_STATE_SELECTED); - gtk_list_unselect_child (list, item); - list->undo_selection = g_list_prepend (list->undo_selection, - item); - } - } - else if (item->state == GTK_STATE_SELECTED) - { - gtk_widget_set_state (item, GTK_STATE_NORMAL); - list->undo_unselection = g_list_prepend (list->undo_unselection, - item); - } - } - } - - for (work = g_list_reverse (list->undo_unselection); work; work = work->next) - gtk_list_select_child (list, GTK_WIDGET (work->data)); - - -} - -void -gtk_list_toggle_row (GtkList *list, - GtkWidget *item) -{ - g_return_if_fail (GTK_IS_LIST (list)); - g_return_if_fail (GTK_IS_LIST_ITEM (item)); - - switch (list->selection_mode) - { - case GTK_SELECTION_MULTIPLE: - case GTK_SELECTION_SINGLE: - if (item->state == GTK_STATE_SELECTED) - { - gtk_list_unselect_child (list, item); - return; - } - case GTK_SELECTION_BROWSE: - gtk_list_select_child (list, item); - break; - } -} - -void -gtk_list_toggle_focus_row (GtkList *list) -{ - GtkContainer *container; - gint focus_row; - - g_return_if_fail (list != 0); - g_return_if_fail (GTK_IS_LIST (list)); - - container = GTK_CONTAINER (list); - - if (list_has_grab (list) || !container->focus_child) - return; - - switch (list->selection_mode) - { - case GTK_SELECTION_SINGLE: - gtk_list_toggle_row (list, container->focus_child); - break; - case GTK_SELECTION_MULTIPLE: - if ((focus_row = g_list_index (list->children, container->focus_child)) - < 0) - return; - - g_list_free (list->undo_selection); - g_list_free (list->undo_unselection); - list->undo_selection = NULL; - list->undo_unselection = NULL; - - list->anchor = focus_row; - list->drag_pos = focus_row; - list->undo_focus_child = container->focus_child; - - if (list->add_mode) - gtk_list_fake_toggle_row (list, container->focus_child); - else - gtk_list_fake_unselect_all (list, container->focus_child); - - gtk_list_end_selection (list); - break; - default: - break; - } -} - -void -gtk_list_toggle_add_mode (GtkList *list) -{ - GtkContainer *container; - - g_return_if_fail (list != 0); - g_return_if_fail (GTK_IS_LIST (list)); - - if (list_has_grab (list) || - list->selection_mode != GTK_SELECTION_MULTIPLE) - return; - - container = GTK_CONTAINER (list); - - if (list->add_mode) - { - list->add_mode = FALSE; - list->anchor_state = GTK_STATE_SELECTED; - } - else - list->add_mode = TRUE; - - if (container->focus_child) - gtk_widget_queue_draw (container->focus_child); -} - -void -gtk_list_undo_selection (GtkList *list) -{ - GList *work; - - g_return_if_fail (GTK_IS_LIST (list)); - - if (list->selection_mode != GTK_SELECTION_MULTIPLE || - list_has_grab (list)) - return; - - if (list->anchor >= 0) - gtk_list_end_selection (list); - - if (!(list->undo_selection || list->undo_unselection)) - { - gtk_list_unselect_all (list); - return; - } - - for (work = list->undo_selection; work; work = work->next) - gtk_list_select_child (list, GTK_WIDGET (work->data)); - - for (work = list->undo_unselection; work; work = work->next) - gtk_list_unselect_child (list, GTK_WIDGET (work->data)); - - if (list->undo_focus_child) - { - GtkContainer *container; - - container = GTK_CONTAINER (list); - - if (container->focus_child && - gtk_widget_has_focus (container->focus_child)) - gtk_widget_grab_focus (list->undo_focus_child); - else - gtk_container_set_focus_child (container, list->undo_focus_child); - } - - list->undo_focus_child = NULL; - - g_list_free (list->undo_selection); - g_list_free (list->undo_unselection); - list->undo_selection = NULL; - list->undo_unselection = NULL; -} - - -/* Private GtkList Selection Methods : - * - * gtk_real_list_select_child - * gtk_real_list_unselect_child - */ -static void -gtk_real_list_select_child (GtkList *list, - GtkWidget *child) -{ - g_return_if_fail (GTK_IS_LIST (list)); - g_return_if_fail (GTK_IS_LIST_ITEM (child)); - - switch (child->state) - { - case GTK_STATE_SELECTED: - case GTK_STATE_INSENSITIVE: - break; - default: - gtk_list_item_select (GTK_LIST_ITEM (child)); - break; - } -} - -static void -gtk_real_list_unselect_child (GtkList *list, - GtkWidget *child) -{ - g_return_if_fail (GTK_IS_LIST (list)); - g_return_if_fail (GTK_IS_LIST_ITEM (child)); - - if (child->state == GTK_STATE_SELECTED) - gtk_list_item_deselect (GTK_LIST_ITEM (child)); -} - - -/* Private GtkList Selection Functions : - * - * gtk_list_set_anchor - * gtk_list_fake_unselect_all - * gtk_list_fake_toggle_row - * gtk_list_update_extended_selection - * gtk_list_reset_extended_selection - */ -static void -gtk_list_set_anchor (GtkList *list, - gboolean add_mode, - gint anchor, - GtkWidget *undo_focus_child) -{ - GList *work; - - g_return_if_fail (GTK_IS_LIST (list)); - - if (list->selection_mode != GTK_SELECTION_MULTIPLE || list->anchor >= 0) - return; - - g_list_free (list->undo_selection); - g_list_free (list->undo_unselection); - list->undo_selection = NULL; - list->undo_unselection = NULL; - - if ((work = g_list_nth (list->children, anchor))) - { - if (add_mode) - gtk_list_fake_toggle_row (list, GTK_WIDGET (work->data)); - else - { - gtk_list_fake_unselect_all (list, GTK_WIDGET (work->data)); - list->anchor_state = GTK_STATE_SELECTED; - } - } - - list->anchor = anchor; - list->drag_pos = anchor; - list->undo_focus_child = undo_focus_child; -} - -static void -gtk_list_fake_unselect_all (GtkList *list, - GtkWidget *item) -{ - GList *work; - - if (item && item->state == GTK_STATE_NORMAL) - gtk_widget_set_state (item, GTK_STATE_SELECTED); - - list->undo_selection = list->selection; - list->selection = NULL; - - for (work = list->undo_selection; work; work = work->next) - if (work->data != item) - gtk_widget_set_state (GTK_WIDGET (work->data), GTK_STATE_NORMAL); -} - -static void -gtk_list_fake_toggle_row (GtkList *list, - GtkWidget *item) -{ - if (!item) - return; - - if (item->state == GTK_STATE_NORMAL) - { - list->anchor_state = GTK_STATE_SELECTED; - gtk_widget_set_state (item, GTK_STATE_SELECTED); - } - else - { - list->anchor_state = GTK_STATE_NORMAL; - gtk_widget_set_state (item, GTK_STATE_NORMAL); - } -} - -static void -gtk_list_update_extended_selection (GtkList *list, - gint row) -{ - gint i; - GList *work; - gint s1 = -1; - gint s2 = -1; - gint e1 = -1; - gint e2 = -1; - gint length; - - if (row < 0) - row = 0; - - length = g_list_length (list->children); - if (row >= length) - row = length - 1; - - if (list->selection_mode != GTK_SELECTION_MULTIPLE || !list->anchor < 0) - return; - - /* extending downwards */ - if (row > list->drag_pos && list->anchor <= list->drag_pos) - { - s2 = list->drag_pos + 1; - e2 = row; - } - /* extending upwards */ - else if (row < list->drag_pos && list->anchor >= list->drag_pos) - { - s2 = row; - e2 = list->drag_pos - 1; - } - else if (row < list->drag_pos && list->anchor < list->drag_pos) - { - e1 = list->drag_pos; - /* row and drag_pos on different sides of anchor : - take back the selection between anchor and drag_pos, - select between anchor and row */ - if (row < list->anchor) - { - s1 = list->anchor + 1; - s2 = row; - e2 = list->anchor - 1; - } - /* take back the selection between anchor and drag_pos */ - else - s1 = row + 1; - } - else if (row > list->drag_pos && list->anchor > list->drag_pos) - { - s1 = list->drag_pos; - /* row and drag_pos on different sides of anchor : - take back the selection between anchor and drag_pos, - select between anchor and row */ - if (row > list->anchor) - { - e1 = list->anchor - 1; - s2 = list->anchor + 1; - e2 = row; - } - /* take back the selection between anchor and drag_pos */ - else - e1 = row - 1; - } - - list->drag_pos = row; - - /* restore the elements between s1 and e1 */ - if (s1 >= 0) - { - for (i = s1, work = g_list_nth (list->children, i); i <= e1; - i++, work = work->next) - { - if (g_list_find (list->selection, work->data)) - gtk_widget_set_state (GTK_WIDGET (work->data), GTK_STATE_SELECTED); - else - gtk_widget_set_state (GTK_WIDGET (work->data), GTK_STATE_NORMAL); - } - } - - /* extend the selection between s2 and e2 */ - if (s2 >= 0) - { - for (i = s2, work = g_list_nth (list->children, i); i <= e2; - i++, work = work->next) - if (GTK_WIDGET (work->data)->state != list->anchor_state) - gtk_widget_set_state (GTK_WIDGET (work->data), list->anchor_state); - } -} - -static void -gtk_list_reset_extended_selection (GtkList *list) -{ - g_return_if_fail (list != 0); - g_return_if_fail (GTK_IS_LIST (list)); - - g_list_free (list->undo_selection); - g_list_free (list->undo_unselection); - list->undo_selection = NULL; - list->undo_unselection = NULL; - - list->anchor = -1; - list->drag_pos = -1; - list->undo_focus_child = GTK_CONTAINER (list)->focus_child; -} - -/* Public GtkList Scroll Methods : - * - * gtk_list_scroll_horizontal - * gtk_list_scroll_vertical - */ -void -gtk_list_scroll_horizontal (GtkList *list, - GtkScrollType scroll_type, - gfloat position) -{ - GtkAdjustment *adj; - - g_return_if_fail (list != 0); - g_return_if_fail (GTK_IS_LIST (list)); - - if (list_has_grab (list)) - return; - - if (!(adj = - gtk_object_get_data_by_id (GTK_OBJECT (list), hadjustment_key_id))) - return; - - switch (scroll_type) - { - case GTK_SCROLL_STEP_UP: - case GTK_SCROLL_STEP_BACKWARD: - adj->value = CLAMP (adj->value - adj->step_increment, adj->lower, - adj->upper - adj->page_size); - break; - case GTK_SCROLL_STEP_DOWN: - case GTK_SCROLL_STEP_FORWARD: - adj->value = CLAMP (adj->value + adj->step_increment, adj->lower, - adj->upper - adj->page_size); - break; - case GTK_SCROLL_PAGE_UP: - case GTK_SCROLL_PAGE_BACKWARD: - adj->value = CLAMP (adj->value - adj->page_increment, adj->lower, - adj->upper - adj->page_size); - break; - case GTK_SCROLL_PAGE_DOWN: - case GTK_SCROLL_PAGE_FORWARD: - adj->value = CLAMP (adj->value + adj->page_increment, adj->lower, - adj->upper - adj->page_size); - break; - case GTK_SCROLL_JUMP: - adj->value = CLAMP (adj->lower + (adj->upper - adj->lower) * position, - adj->lower, adj->upper - adj->page_size); - break; - default: - break; - } - gtk_adjustment_value_changed (adj); -} - -void -gtk_list_scroll_vertical (GtkList *list, - GtkScrollType scroll_type, - gfloat position) -{ - g_return_if_fail (GTK_IS_LIST (list)); - - if (list_has_grab (list)) - return; - - if (list->selection_mode == GTK_SELECTION_MULTIPLE) - { - GtkContainer *container; - - if (list->anchor >= 0) - return; - - container = GTK_CONTAINER (list); - list->undo_focus_child = container->focus_child; - gtk_list_move_focus_child (list, scroll_type, position); - if (container->focus_child != list->undo_focus_child && !list->add_mode) - { - gtk_list_unselect_all (list); - gtk_list_select_child (list, container->focus_child); - } - } - else - gtk_list_move_focus_child (list, scroll_type, position); -} - - -/* Private GtkList Scroll/Focus Functions : - * - * gtk_list_move_focus_child - * gtk_list_horizontal_timeout - * gtk_list_vertical_timeout - */ -static void -gtk_list_move_focus_child (GtkList *list, - GtkScrollType scroll_type, - gfloat position) -{ - GtkContainer *container; - GList *work; - GtkWidget *item; - GtkAdjustment *adj; - gint new_value; - - g_return_if_fail (list != 0); - g_return_if_fail (GTK_IS_LIST (list)); - - container = GTK_CONTAINER (list); - - if (container->focus_child) - work = g_list_find (list->children, container->focus_child); - else - work = list->children; - - if (!work) - return; - - switch (scroll_type) - { - case GTK_SCROLL_STEP_BACKWARD: - work = work->prev; - if (work) - gtk_widget_grab_focus (GTK_WIDGET (work->data)); - break; - case GTK_SCROLL_STEP_FORWARD: - work = work->next; - if (work) - gtk_widget_grab_focus (GTK_WIDGET (work->data)); - break; - case GTK_SCROLL_PAGE_BACKWARD: - if (!work->prev) - return; - - item = work->data; - adj = gtk_object_get_data_by_id (GTK_OBJECT (list), vadjustment_key_id); - - if (adj) - { - gboolean correct = FALSE; - - new_value = adj->value; - - if (item->allocation.y <= adj->value) - { - new_value = MAX (item->allocation.y + item->allocation.height - - adj->page_size, adj->lower); - correct = TRUE; - } - - if (item->allocation.y > new_value) - for (; work; work = work->prev) - { - item = GTK_WIDGET (work->data); - if (item->allocation.y <= new_value && - item->allocation.y + item->allocation.height > new_value) - break; - } - else - for (; work; work = work->next) - { - item = GTK_WIDGET (work->data); - if (item->allocation.y <= new_value && - item->allocation.y + item->allocation.height > new_value) - break; - } - - if (correct && work && work->next && item->allocation.y < new_value) - item = work->next->data; - } - else - item = list->children->data; - - gtk_widget_grab_focus (item); - break; - case GTK_SCROLL_PAGE_FORWARD: - if (!work->next) - return; - - item = work->data; - adj = gtk_object_get_data_by_id (GTK_OBJECT (list), vadjustment_key_id); - - if (adj) - { - gboolean correct = FALSE; - - new_value = adj->value; - - if (item->allocation.y + item->allocation.height >= - adj->value + adj->page_size) - { - new_value = item->allocation.y; - correct = TRUE; - } - - new_value = MIN (new_value + adj->page_size, adj->upper); - - if (item->allocation.y > new_value) - for (; work; work = work->prev) - { - item = GTK_WIDGET (work->data); - if (item->allocation.y <= new_value && - item->allocation.y + item->allocation.height > new_value) - break; - } - else - for (; work; work = work->next) - { - item = GTK_WIDGET (work->data); - if (item->allocation.y <= new_value && - item->allocation.y + item->allocation.height > new_value) - break; - } - - if (correct && work && work->prev && - item->allocation.y + item->allocation.height - 1 > new_value) - item = work->prev->data; - } - else - item = g_list_last (work)->data; - - gtk_widget_grab_focus (item); - break; - case GTK_SCROLL_JUMP: - new_value = GTK_WIDGET(list)->allocation.height * CLAMP (position, 0, 1); - - for (item = NULL, work = list->children; work; work =work->next) - { - item = GTK_WIDGET (work->data); - if (item->allocation.y <= new_value && - item->allocation.y + item->allocation.height > new_value) - break; - } - - gtk_widget_grab_focus (item); - break; - default: - break; - } -} - -static void -do_fake_motion (GtkWidget *list) -{ - GdkEvent *event = gdk_event_new (GDK_MOTION_NOTIFY); - - event->motion.send_event = TRUE; - - gtk_list_motion_notify (list, (GdkEventMotion *)event); - gdk_event_free (event); -} - -static gint -gtk_list_horizontal_timeout (GtkWidget *list) -{ - GTK_LIST (list)->htimer = 0; - do_fake_motion (list); - - return FALSE; -} - -static gint -gtk_list_vertical_timeout (GtkWidget *list) -{ - GTK_LIST (list)->vtimer = 0; - do_fake_motion (list); - - return FALSE; -} - - -/* Private GtkListItem Signal Functions : - * - * gtk_list_signal_toggle_focus_row - * gtk_list_signal_select_all - * gtk_list_signal_unselect_all - * gtk_list_signal_undo_selection - * gtk_list_signal_start_selection - * gtk_list_signal_end_selection - * gtk_list_signal_extend_selection - * gtk_list_signal_scroll_horizontal - * gtk_list_signal_scroll_vertical - * gtk_list_signal_toggle_add_mode - * gtk_list_signal_item_select - * gtk_list_signal_item_deselect - * gtk_list_signal_item_toggle - */ -static void -gtk_list_signal_toggle_focus_row (GtkListItem *list_item, - GtkList *list) -{ - g_return_if_fail (GTK_IS_LIST_ITEM (list_item)); - g_return_if_fail (GTK_IS_LIST (list)); - - gtk_list_toggle_focus_row (list); -} - -static void -gtk_list_signal_select_all (GtkListItem *list_item, - GtkList *list) -{ - g_return_if_fail (GTK_IS_LIST_ITEM (list_item)); - g_return_if_fail (GTK_IS_LIST (list)); - - gtk_list_select_all (list); -} - -static void -gtk_list_signal_unselect_all (GtkListItem *list_item, - GtkList *list) -{ - g_return_if_fail (GTK_IS_LIST_ITEM (list_item)); - g_return_if_fail (GTK_IS_LIST (list)); - - gtk_list_unselect_all (list); -} - -static void -gtk_list_signal_undo_selection (GtkListItem *list_item, - GtkList *list) -{ - g_return_if_fail (GTK_IS_LIST_ITEM (list_item)); - g_return_if_fail (GTK_IS_LIST (list)); - - gtk_list_undo_selection (list); -} - -static void -gtk_list_signal_start_selection (GtkListItem *list_item, - GtkList *list) -{ - g_return_if_fail (GTK_IS_LIST_ITEM (list_item)); - g_return_if_fail (GTK_IS_LIST (list)); - - gtk_list_start_selection (list); -} - -static void -gtk_list_signal_end_selection (GtkListItem *list_item, - GtkList *list) -{ - g_return_if_fail (GTK_IS_LIST_ITEM (list_item)); - g_return_if_fail (GTK_IS_LIST (list)); - - gtk_list_end_selection (list); -} - -static void -gtk_list_signal_extend_selection (GtkListItem *list_item, - GtkScrollType scroll_type, - gfloat position, - gboolean auto_start_selection, - GtkList *list) -{ - g_return_if_fail (GTK_IS_LIST_ITEM (list_item)); - g_return_if_fail (GTK_IS_LIST (list)); - - gtk_list_extend_selection (list, scroll_type, position, - auto_start_selection); -} - -static void -gtk_list_signal_scroll_horizontal (GtkListItem *list_item, - GtkScrollType scroll_type, - gfloat position, - GtkList *list) -{ - g_return_if_fail (GTK_IS_LIST_ITEM (list_item)); - g_return_if_fail (GTK_IS_LIST (list)); - - gtk_list_scroll_horizontal (list, scroll_type, position); -} - -static void -gtk_list_signal_scroll_vertical (GtkListItem *list_item, - GtkScrollType scroll_type, - gfloat position, - GtkList *list) -{ - g_return_if_fail (GTK_IS_LIST_ITEM (list_item)); - g_return_if_fail (GTK_IS_LIST (list)); - - gtk_list_scroll_vertical (list, scroll_type, position); -} - -static void -gtk_list_signal_toggle_add_mode (GtkListItem *list_item, - GtkList *list) -{ - g_return_if_fail (GTK_IS_LIST_ITEM (list_item)); - g_return_if_fail (GTK_IS_LIST (list)); - - gtk_list_toggle_add_mode (list); -} - -static void -gtk_list_signal_item_select (GtkListItem *list_item, - GtkList *list) -{ - GList *selection; - GList *tmp_list; - GList *sel_list; - - g_return_if_fail (GTK_IS_LIST_ITEM (list_item)); - g_return_if_fail (GTK_IS_LIST (list)); - - if (GTK_WIDGET (list_item)->state != GTK_STATE_SELECTED) - return; - - switch (list->selection_mode) - { - case GTK_SELECTION_SINGLE: - case GTK_SELECTION_BROWSE: - sel_list = NULL; - selection = list->selection; - - while (selection) - { - tmp_list = selection; - selection = selection->next; - - if (tmp_list->data == list_item) - sel_list = tmp_list; - else - gtk_list_item_deselect (GTK_LIST_ITEM (tmp_list->data)); - } - - if (!sel_list) - { - list->selection = g_list_prepend (list->selection, list_item); - g_object_ref (list_item); - } - gtk_signal_emit (GTK_OBJECT (list), list_signals[SELECTION_CHANGED]); - break; - case GTK_SELECTION_MULTIPLE: - if (list->anchor >= 0) - return; - } -} - -static void -gtk_list_signal_item_deselect (GtkListItem *list_item, - GtkList *list) -{ - GList *node; - - g_return_if_fail (GTK_IS_LIST_ITEM (list_item)); - g_return_if_fail (GTK_IS_LIST (list)); - - if (GTK_WIDGET (list_item)->state != GTK_STATE_NORMAL) - return; - - node = g_list_find (list->selection, list_item); - - if (node) - { - list->selection = g_list_remove_link (list->selection, node); - g_list_free_1 (node); - g_object_unref (list_item); - gtk_signal_emit (GTK_OBJECT (list), list_signals[SELECTION_CHANGED]); - } -} - -static void -gtk_list_signal_item_toggle (GtkListItem *list_item, - GtkList *list) -{ - g_return_if_fail (GTK_IS_LIST_ITEM (list_item)); - g_return_if_fail (GTK_IS_LIST (list)); - - if ((list->selection_mode == GTK_SELECTION_BROWSE || - list->selection_mode == GTK_SELECTION_MULTIPLE) && - GTK_WIDGET (list_item)->state == GTK_STATE_NORMAL) - { - gtk_widget_set_state (GTK_WIDGET (list_item), GTK_STATE_SELECTED); - return; - } - - switch (GTK_WIDGET (list_item)->state) - { - case GTK_STATE_SELECTED: - gtk_list_signal_item_select (list_item, list); - break; - case GTK_STATE_NORMAL: - gtk_list_signal_item_deselect (list_item, list); - break; - default: - break; - } -} - -static void -gtk_list_signal_drag_begin (GtkWidget *widget, - GdkDragContext *context, - GtkList *list) -{ - g_return_if_fail (GTK_IS_LIST_ITEM (widget)); - g_return_if_fail (GTK_IS_LIST (list)); - - gtk_list_drag_begin (GTK_WIDGET (list), context); -} - -static void -gtk_list_drag_begin (GtkWidget *widget, - GdkDragContext *context) -{ - GtkList *list; - - g_return_if_fail (GTK_IS_LIST (widget)); - g_return_if_fail (context != NULL); - - list = GTK_LIST (widget); - - if (list->drag_selection) - { - gtk_list_end_drag_selection (list); - - switch (list->selection_mode) - { - case GTK_SELECTION_MULTIPLE: - gtk_list_end_selection (list); - break; - case GTK_SELECTION_SINGLE: - list->undo_focus_child = NULL; - break; - default: - break; - } - } -} - -#include "gtkaliasdef.c" diff --git a/gtk/gtklist.h b/gtk/gtklist.h deleted file mode 100644 index 3a2f13f13b..0000000000 --- a/gtk/gtklist.h +++ /dev/null @@ -1,138 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#if !defined (GTK_DISABLE_DEPRECATED) || defined (__GTK_LIST_C__) - -#ifndef __GTK_LIST_H__ -#define __GTK_LIST_H__ - -#include <gtk/gtk.h> - -G_BEGIN_DECLS - -#define GTK_TYPE_LIST (gtk_list_get_type ()) -#define GTK_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_LIST, GtkList)) -#define GTK_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_LIST, GtkListClass)) -#define GTK_IS_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_LIST)) -#define GTK_IS_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_LIST)) -#define GTK_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_LIST, GtkListClass)) - - -typedef struct _GtkList GtkList; -typedef struct _GtkListClass GtkListClass; - -struct _GtkList -{ - GtkContainer container; - - GList *children; - GList *selection; - - GList *undo_selection; - GList *undo_unselection; - - GtkWidget *last_focus_child; - GtkWidget *undo_focus_child; - - guint htimer; - guint vtimer; - - gint anchor; - gint drag_pos; - GtkStateType anchor_state; - - guint selection_mode : 2; - guint drag_selection:1; - guint add_mode:1; -}; - -struct _GtkListClass -{ - GtkContainerClass parent_class; - - void (* selection_changed) (GtkList *list); - void (* select_child) (GtkList *list, - GtkWidget *child); - void (* unselect_child) (GtkList *list, - GtkWidget *child); -}; - - -GType gtk_list_get_type (void) G_GNUC_CONST; -GtkWidget* gtk_list_new (void); -void gtk_list_insert_items (GtkList *list, - GList *items, - gint position); -void gtk_list_append_items (GtkList *list, - GList *items); -void gtk_list_prepend_items (GtkList *list, - GList *items); -void gtk_list_remove_items (GtkList *list, - GList *items); -void gtk_list_remove_items_no_unref (GtkList *list, - GList *items); -void gtk_list_clear_items (GtkList *list, - gint start, - gint end); -void gtk_list_select_item (GtkList *list, - gint item); -void gtk_list_unselect_item (GtkList *list, - gint item); -void gtk_list_select_child (GtkList *list, - GtkWidget *child); -void gtk_list_unselect_child (GtkList *list, - GtkWidget *child); -gint gtk_list_child_position (GtkList *list, - GtkWidget *child); -void gtk_list_set_selection_mode (GtkList *list, - GtkSelectionMode mode); - -void gtk_list_extend_selection (GtkList *list, - GtkScrollType scroll_type, - gfloat position, - gboolean auto_start_selection); -void gtk_list_start_selection (GtkList *list); -void gtk_list_end_selection (GtkList *list); -void gtk_list_select_all (GtkList *list); -void gtk_list_unselect_all (GtkList *list); -void gtk_list_scroll_horizontal (GtkList *list, - GtkScrollType scroll_type, - gfloat position); -void gtk_list_scroll_vertical (GtkList *list, - GtkScrollType scroll_type, - gfloat position); -void gtk_list_toggle_add_mode (GtkList *list); -void gtk_list_toggle_focus_row (GtkList *list); -void gtk_list_toggle_row (GtkList *list, - GtkWidget *item); -void gtk_list_undo_selection (GtkList *list); -void gtk_list_end_drag_selection (GtkList *list); - -G_END_DECLS - -#endif /* __GTK_LIST_H__ */ - -#endif /* GTK_DISABLE_DEPRECATED */ diff --git a/gtk/gtklistitem.c b/gtk/gtklistitem.c deleted file mode 100644 index 4615841525..0000000000 --- a/gtk/gtklistitem.c +++ /dev/null @@ -1,635 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#include "config.h" - -#include <gdk/gdkkeysyms.h> - -#undef GTK_DISABLE_DEPRECATED -#define __GTK_LIST_ITEM_C__ - -#include "gtkbindings.h" -#include "gtklabel.h" -#include "gtklistitem.h" -#include "gtklist.h" -#include "gtkmarshalers.h" -#include "gtksignal.h" -#include "gtkintl.h" - -#include "gtkalias.h" - - -enum -{ - TOGGLE_FOCUS_ROW, - SELECT_ALL, - UNSELECT_ALL, - UNDO_SELECTION, - START_SELECTION, - END_SELECTION, - TOGGLE_ADD_MODE, - EXTEND_SELECTION, - SCROLL_VERTICAL, - SCROLL_HORIZONTAL, - LAST_SIGNAL -}; - -static void gtk_list_item_class_init (GtkListItemClass *klass); -static void gtk_list_item_init (GtkListItem *list_item); -static void gtk_list_item_realize (GtkWidget *widget); -static void gtk_list_item_size_request (GtkWidget *widget, - GtkRequisition *requisition); -static void gtk_list_item_size_allocate (GtkWidget *widget, - GtkAllocation *allocation); -static void gtk_list_item_style_set (GtkWidget *widget, - GtkStyle *previous_style); -static gint gtk_list_item_button_press (GtkWidget *widget, - GdkEventButton *event); -static gint gtk_list_item_expose (GtkWidget *widget, - GdkEventExpose *event); -static void gtk_real_list_item_select (GtkItem *item); -static void gtk_real_list_item_deselect (GtkItem *item); -static void gtk_real_list_item_toggle (GtkItem *item); - - -static GtkItemClass *parent_class = NULL; -static guint list_item_signals[LAST_SIGNAL] = {0}; - - -GtkType -gtk_list_item_get_type (void) -{ - static GtkType list_item_type = 0; - - if (!list_item_type) - { - static const GtkTypeInfo list_item_info = - { - "GtkListItem", - sizeof (GtkListItem), - sizeof (GtkListItemClass), - (GtkClassInitFunc) gtk_list_item_class_init, - (GtkObjectInitFunc) gtk_list_item_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, - }; - - I_("GtkListItem"); - list_item_type = gtk_type_unique (gtk_item_get_type (), &list_item_info); - } - - return list_item_type; -} - -static void -gtk_list_item_class_init (GtkListItemClass *class) -{ - GtkObjectClass *object_class; - GtkWidgetClass *widget_class; - GtkItemClass *item_class; - GtkBindingSet *binding_set; - - object_class = (GtkObjectClass*) class; - widget_class = (GtkWidgetClass*) class; - item_class = (GtkItemClass*) class; - - parent_class = gtk_type_class (gtk_item_get_type ()); - - widget_class->realize = gtk_list_item_realize; - widget_class->size_request = gtk_list_item_size_request; - widget_class->size_allocate = gtk_list_item_size_allocate; - widget_class->style_set = gtk_list_item_style_set; - widget_class->button_press_event = gtk_list_item_button_press; - widget_class->expose_event = gtk_list_item_expose; - - item_class->select = gtk_real_list_item_select; - item_class->deselect = gtk_real_list_item_deselect; - item_class->toggle = gtk_real_list_item_toggle; - - class->toggle_focus_row = NULL; - class->select_all = NULL; - class->unselect_all = NULL; - class->undo_selection = NULL; - class->start_selection = NULL; - class->end_selection = NULL; - class->extend_selection = NULL; - class->scroll_horizontal = NULL; - class->scroll_vertical = NULL; - class->toggle_add_mode = NULL; - - list_item_signals[TOGGLE_FOCUS_ROW] = - gtk_signal_new (I_("toggle-focus-row"), - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkListItemClass, toggle_focus_row), - _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); - list_item_signals[SELECT_ALL] = - gtk_signal_new (I_("select-all"), - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkListItemClass, select_all), - _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); - list_item_signals[UNSELECT_ALL] = - gtk_signal_new (I_("unselect-all"), - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkListItemClass, unselect_all), - _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); - list_item_signals[UNDO_SELECTION] = - gtk_signal_new (I_("undo-selection"), - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkListItemClass, undo_selection), - _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); - list_item_signals[START_SELECTION] = - gtk_signal_new (I_("start-selection"), - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkListItemClass, start_selection), - _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); - list_item_signals[END_SELECTION] = - gtk_signal_new (I_("end-selection"), - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkListItemClass, end_selection), - _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); - list_item_signals[TOGGLE_ADD_MODE] = - gtk_signal_new (I_("toggle-add-mode"), - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkListItemClass, toggle_add_mode), - _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); - list_item_signals[EXTEND_SELECTION] = - gtk_signal_new (I_("extend-selection"), - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkListItemClass, extend_selection), - _gtk_marshal_VOID__ENUM_FLOAT_BOOLEAN, - GTK_TYPE_NONE, 3, - GTK_TYPE_SCROLL_TYPE, GTK_TYPE_FLOAT, GTK_TYPE_BOOL); - list_item_signals[SCROLL_VERTICAL] = - gtk_signal_new (I_("scroll-vertical"), - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkListItemClass, scroll_vertical), - _gtk_marshal_VOID__ENUM_FLOAT, - GTK_TYPE_NONE, 2, GTK_TYPE_SCROLL_TYPE, GTK_TYPE_FLOAT); - list_item_signals[SCROLL_HORIZONTAL] = - gtk_signal_new (I_("scroll-horizontal"), - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkListItemClass, scroll_horizontal), - _gtk_marshal_VOID__ENUM_FLOAT, - GTK_TYPE_NONE, 2, GTK_TYPE_SCROLL_TYPE, GTK_TYPE_FLOAT); - - binding_set = gtk_binding_set_by_class (class); - gtk_binding_entry_add_signal (binding_set, GDK_Up, 0, - "scroll-vertical", 2, - GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD, - GTK_TYPE_FLOAT, 0.0); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Up, 0, - "scroll-vertical", 2, - GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD, - GTK_TYPE_FLOAT, 0.0); - gtk_binding_entry_add_signal (binding_set, GDK_Down, 0, - "scroll-vertical", 2, - GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD, - GTK_TYPE_FLOAT, 0.0); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Down, 0, - "scroll-vertical", 2, - GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD, - GTK_TYPE_FLOAT, 0.0); - gtk_binding_entry_add_signal (binding_set, GDK_Page_Up, 0, - "scroll-vertical", 2, - GTK_TYPE_ENUM, GTK_SCROLL_PAGE_BACKWARD, - GTK_TYPE_FLOAT, 0.0); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Page_Up, 0, - "scroll-vertical", 2, - GTK_TYPE_ENUM, GTK_SCROLL_PAGE_BACKWARD, - GTK_TYPE_FLOAT, 0.0); - gtk_binding_entry_add_signal (binding_set, GDK_Page_Down, 0, - "scroll-vertical", 2, - GTK_TYPE_ENUM, GTK_SCROLL_PAGE_FORWARD, - GTK_TYPE_FLOAT, 0.0); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Page_Down, 0, - "scroll-vertical", 2, - GTK_TYPE_ENUM, GTK_SCROLL_PAGE_FORWARD, - GTK_TYPE_FLOAT, 0.0); - gtk_binding_entry_add_signal (binding_set, GDK_Home, GDK_CONTROL_MASK, - "scroll-vertical", 2, - GTK_TYPE_ENUM, GTK_SCROLL_JUMP, - GTK_TYPE_FLOAT, 0.0); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Home, GDK_CONTROL_MASK, - "scroll-vertical", 2, - GTK_TYPE_ENUM, GTK_SCROLL_JUMP, - GTK_TYPE_FLOAT, 0.0); - gtk_binding_entry_add_signal (binding_set, GDK_End, GDK_CONTROL_MASK, - "scroll-vertical", 2, - GTK_TYPE_ENUM, GTK_SCROLL_JUMP, - GTK_TYPE_FLOAT, 1.0); - gtk_binding_entry_add_signal (binding_set, GDK_KP_End, GDK_CONTROL_MASK, - "scroll-vertical", 2, - GTK_TYPE_ENUM, GTK_SCROLL_JUMP, - GTK_TYPE_FLOAT, 1.0); - - gtk_binding_entry_add_signal (binding_set, GDK_Up, GDK_SHIFT_MASK, - "extend-selection", 3, - GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD, - GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Up, GDK_SHIFT_MASK, - "extend-selection", 3, - GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD, - GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE); - - gtk_binding_entry_add_signal (binding_set, GDK_Down, GDK_SHIFT_MASK, - "extend-selection", 3, - GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD, - GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Down, GDK_SHIFT_MASK, - "extend-selection", 3, - GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD, - GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_Page_Up, GDK_SHIFT_MASK, - "extend-selection", 3, - GTK_TYPE_ENUM, GTK_SCROLL_PAGE_BACKWARD, - GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Page_Up, GDK_SHIFT_MASK, - "extend-selection", 3, - GTK_TYPE_ENUM, GTK_SCROLL_PAGE_BACKWARD, - GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_Page_Down, GDK_SHIFT_MASK, - "extend-selection", 3, - GTK_TYPE_ENUM, GTK_SCROLL_PAGE_FORWARD, - GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Page_Down, GDK_SHIFT_MASK, - "extend-selection", 3, - GTK_TYPE_ENUM, GTK_SCROLL_PAGE_FORWARD, - GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_Home, - GDK_SHIFT_MASK | GDK_CONTROL_MASK, - "extend-selection", 3, - GTK_TYPE_ENUM, GTK_SCROLL_JUMP, - GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Home, - GDK_SHIFT_MASK | GDK_CONTROL_MASK, - "extend-selection", 3, - GTK_TYPE_ENUM, GTK_SCROLL_JUMP, - GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_End, - GDK_SHIFT_MASK | GDK_CONTROL_MASK, - "extend-selection", 3, - GTK_TYPE_ENUM, GTK_SCROLL_JUMP, - GTK_TYPE_FLOAT, 1.0, GTK_TYPE_BOOL, TRUE); - gtk_binding_entry_add_signal (binding_set, GDK_KP_End, - GDK_SHIFT_MASK | GDK_CONTROL_MASK, - "extend-selection", 3, - GTK_TYPE_ENUM, GTK_SCROLL_JUMP, - GTK_TYPE_FLOAT, 1.0, GTK_TYPE_BOOL, TRUE); - - - gtk_binding_entry_add_signal (binding_set, GDK_Left, 0, - "scroll-horizontal", 2, - GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD, - GTK_TYPE_FLOAT, 0.0); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Left, 0, - "scroll-horizontal", 2, - GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD, - GTK_TYPE_FLOAT, 0.0); - gtk_binding_entry_add_signal (binding_set, GDK_Right, 0, - "scroll-horizontal", 2, - GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD, - GTK_TYPE_FLOAT, 0.0); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Right, 0, - "scroll-horizontal", 2, - GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD, - GTK_TYPE_FLOAT, 0.0); - gtk_binding_entry_add_signal (binding_set, GDK_Home, 0, - "scroll-horizontal", 2, - GTK_TYPE_ENUM, GTK_SCROLL_JUMP, - GTK_TYPE_FLOAT, 0.0); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Home, 0, - "scroll-horizontal", 2, - GTK_TYPE_ENUM, GTK_SCROLL_JUMP, - GTK_TYPE_FLOAT, 0.0); - gtk_binding_entry_add_signal (binding_set, GDK_End, 0, - "scroll-horizontal", 2, - GTK_TYPE_ENUM, GTK_SCROLL_JUMP, - GTK_TYPE_FLOAT, 1.0); - gtk_binding_entry_add_signal (binding_set, GDK_KP_End, 0, - "scroll-horizontal", 2, - GTK_TYPE_ENUM, GTK_SCROLL_JUMP, - GTK_TYPE_FLOAT, 1.0); - - gtk_binding_entry_add_signal (binding_set, GDK_Escape, 0, - "undo-selection", 0); - gtk_binding_entry_add_signal (binding_set, GDK_space, 0, - "toggle-focus-row", 0); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Space, 0, - "toggle-focus-row", 0); - gtk_binding_entry_add_signal (binding_set, GDK_space, GDK_CONTROL_MASK, - "toggle-add-mode", 0); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Space, GDK_CONTROL_MASK, - "toggle-add-mode", 0); - gtk_binding_entry_add_signal (binding_set, GDK_slash, GDK_CONTROL_MASK, - "select-all", 0); - gtk_binding_entry_add_signal (binding_set, GDK_KP_Divide, GDK_CONTROL_MASK, - "select-all", 0); - gtk_binding_entry_add_signal (binding_set, '\\', GDK_CONTROL_MASK, - "unselect-all", 0); - gtk_binding_entry_add_signal (binding_set, GDK_Shift_L, - GDK_RELEASE_MASK | GDK_SHIFT_MASK, - "end-selection", 0); - gtk_binding_entry_add_signal (binding_set, GDK_Shift_R, - GDK_RELEASE_MASK | GDK_SHIFT_MASK, - "end-selection", 0); - gtk_binding_entry_add_signal (binding_set, GDK_Shift_R, - GDK_RELEASE_MASK | GDK_SHIFT_MASK | - GDK_CONTROL_MASK, - "end-selection", 0); -} - -static void -gtk_list_item_init (GtkListItem *list_item) -{ - gtk_widget_set_can_focus (GTK_WIDGET (list_item), TRUE); -} - -GtkWidget* -gtk_list_item_new (void) -{ - return GTK_WIDGET (gtk_type_new (gtk_list_item_get_type ())); -} - -GtkWidget* -gtk_list_item_new_with_label (const gchar *label) -{ - GtkWidget *list_item; - GtkWidget *label_widget; - - list_item = gtk_list_item_new (); - label_widget = gtk_label_new (label); - gtk_misc_set_alignment (GTK_MISC (label_widget), 0.0, 0.5); - gtk_misc_set_padding (GTK_MISC (label_widget), 0, 1); - - gtk_container_add (GTK_CONTAINER (list_item), label_widget); - gtk_widget_show (label_widget); - - return list_item; -} - -void -gtk_list_item_select (GtkListItem *list_item) -{ - gtk_item_select (GTK_ITEM (list_item)); -} - -void -gtk_list_item_deselect (GtkListItem *list_item) -{ - gtk_item_deselect (GTK_ITEM (list_item)); -} - - -static void -gtk_list_item_realize (GtkWidget *widget) -{ - GdkWindowAttr attributes; - gint attributes_mask; - - /*GTK_WIDGET_CLASS (parent_class)->realize (widget);*/ - - g_return_if_fail (GTK_IS_LIST_ITEM (widget)); - - gtk_widget_set_realized (widget, TRUE); - - attributes.x = widget->allocation.x; - attributes.y = widget->allocation.y; - attributes.width = widget->allocation.width; - attributes.height = widget->allocation.height; - attributes.window_type = GDK_WINDOW_CHILD; - attributes.wclass = GDK_INPUT_OUTPUT; - attributes.visual = gtk_widget_get_visual (widget); - attributes.colormap = gtk_widget_get_colormap (widget); - attributes.event_mask = (gtk_widget_get_events (widget) | - GDK_EXPOSURE_MASK | - GDK_BUTTON_PRESS_MASK | - GDK_BUTTON_RELEASE_MASK | - GDK_BUTTON1_MOTION_MASK | - GDK_POINTER_MOTION_HINT_MASK | - GDK_KEY_PRESS_MASK | - GDK_KEY_RELEASE_MASK | - GDK_ENTER_NOTIFY_MASK | - GDK_LEAVE_NOTIFY_MASK); - - attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP; - widget->window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask); - gdk_window_set_user_data (widget->window, widget); - - widget->style = gtk_style_attach (widget->style, widget->window); - gdk_window_set_background (widget->window, - &widget->style->base[GTK_STATE_NORMAL]); -} - -static void -gtk_list_item_size_request (GtkWidget *widget, - GtkRequisition *requisition) -{ - GtkBin *bin; - GtkRequisition child_requisition; - gint focus_width; - gint focus_pad; - - g_return_if_fail (GTK_IS_LIST_ITEM (widget)); - g_return_if_fail (requisition != NULL); - - bin = GTK_BIN (widget); - gtk_widget_style_get (widget, - "focus-line-width", &focus_width, - "focus-padding", &focus_pad, - NULL); - - requisition->width = 2 * (GTK_CONTAINER (widget)->border_width + - widget->style->xthickness + focus_width + focus_pad - 1); - requisition->height = 2 * (GTK_CONTAINER (widget)->border_width + - focus_width + focus_pad - 1); - - if (bin->child && gtk_widget_get_visible (bin->child)) - { - gtk_widget_size_request (bin->child, &child_requisition); - - requisition->width += child_requisition.width; - requisition->height += child_requisition.height; - } -} - -static void -gtk_list_item_size_allocate (GtkWidget *widget, - GtkAllocation *allocation) -{ - GtkBin *bin; - GtkAllocation child_allocation; - - g_return_if_fail (GTK_IS_LIST_ITEM (widget)); - g_return_if_fail (allocation != NULL); - - widget->allocation = *allocation; - if (gtk_widget_get_realized (widget)) - gdk_window_move_resize (widget->window, - allocation->x, allocation->y, - allocation->width, allocation->height); - - bin = GTK_BIN (widget); - - if (bin->child) - { - child_allocation.x = (GTK_CONTAINER (widget)->border_width + - widget->style->xthickness); - child_allocation.y = GTK_CONTAINER (widget)->border_width; - child_allocation.width = allocation->width - child_allocation.x * 2; - child_allocation.height = allocation->height - child_allocation.y * 2; - - gtk_widget_size_allocate (bin->child, &child_allocation); - } -} - -static void -gtk_list_item_style_set (GtkWidget *widget, - GtkStyle *previous_style) -{ - GtkStyle *style; - - g_return_if_fail (widget != NULL); - - if (previous_style && gtk_widget_get_realized (widget)) - { - style = gtk_widget_get_style (widget); - gdk_window_set_background (gtk_widget_get_window (widget), - &style->base[gtk_widget_get_state (widget)]); - } -} - -static gint -gtk_list_item_button_press (GtkWidget *widget, - GdkEventButton *event) -{ - if (event->type == GDK_BUTTON_PRESS && !gtk_widget_has_focus (widget)) - gtk_widget_grab_focus (widget); - - return FALSE; -} - -static gint -gtk_list_item_expose (GtkWidget *widget, - GdkEventExpose *event) -{ - g_return_val_if_fail (widget != NULL, FALSE); - - if (gtk_widget_is_drawable (widget)) - { - if (widget->state == GTK_STATE_NORMAL) - { - gdk_window_set_back_pixmap (widget->window, NULL, TRUE); - gdk_window_clear_area (widget->window, event->area.x, event->area.y, - event->area.width, event->area.height); - } - else - { - gtk_paint_flat_box (widget->style, widget->window, - widget->state, GTK_SHADOW_ETCHED_OUT, - &event->area, widget, "listitem", - 0, 0, -1, -1); - } - - GTK_WIDGET_CLASS (parent_class)->expose_event (widget, event); - - if (gtk_widget_has_focus (widget)) - { - if (GTK_IS_LIST (widget->parent) && GTK_LIST (widget->parent)->add_mode) - gtk_paint_focus (widget->style, widget->window, gtk_widget_get_state (widget), - NULL, widget, "add-mode", - 0, 0, widget->allocation.width, widget->allocation.height); - else - gtk_paint_focus (widget->style, widget->window, gtk_widget_get_state (widget), - NULL, widget, NULL, - 0, 0, widget->allocation.width, widget->allocation.height); - } - } - - return FALSE; -} - -static void -gtk_real_list_item_select (GtkItem *item) -{ - g_return_if_fail (GTK_IS_LIST_ITEM (item)); - - switch (GTK_WIDGET (item)->state) - { - case GTK_STATE_SELECTED: - case GTK_STATE_INSENSITIVE: - break; - default: - gtk_widget_set_state (GTK_WIDGET (item), GTK_STATE_SELECTED); - break; - } -} - -static void -gtk_real_list_item_deselect (GtkItem *item) -{ - g_return_if_fail (GTK_IS_LIST_ITEM (item)); - - if (GTK_WIDGET (item)->state == GTK_STATE_SELECTED) - gtk_widget_set_state (GTK_WIDGET (item), GTK_STATE_NORMAL); -} - -static void -gtk_real_list_item_toggle (GtkItem *item) -{ - g_return_if_fail (GTK_IS_LIST_ITEM (item)); - - switch (GTK_WIDGET (item)->state) - { - case GTK_STATE_SELECTED: - gtk_widget_set_state (GTK_WIDGET (item), GTK_STATE_NORMAL); - break; - case GTK_STATE_INSENSITIVE: - break; - default: - gtk_widget_set_state (GTK_WIDGET (item), GTK_STATE_SELECTED); - break; - } -} - -#include "gtkaliasdef.c" diff --git a/gtk/gtklistitem.h b/gtk/gtklistitem.h deleted file mode 100644 index 9f83a48722..0000000000 --- a/gtk/gtklistitem.h +++ /dev/null @@ -1,91 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#if !defined (GTK_DISABLE_DEPRECATED) || defined (__GTK_LIST_ITEM_C__) - -#ifndef __GTK_LIST_ITEM_H__ -#define __GTK_LIST_ITEM_H__ - -#include <gtk/gtk.h> - - -G_BEGIN_DECLS - - -#define GTK_TYPE_LIST_ITEM (gtk_list_item_get_type ()) -#define GTK_LIST_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_LIST_ITEM, GtkListItem)) -#define GTK_LIST_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_LIST_ITEM, GtkListItemClass)) -#define GTK_IS_LIST_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_LIST_ITEM)) -#define GTK_IS_LIST_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_LIST_ITEM)) -#define GTK_LIST_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_LIST_ITEM, GtkListItemClass)) - - -typedef struct _GtkListItem GtkListItem; -typedef struct _GtkListItemClass GtkListItemClass; - -struct _GtkListItem -{ - GtkItem item; -}; - -struct _GtkListItemClass -{ - GtkItemClass parent_class; - - void (*toggle_focus_row) (GtkListItem *list_item); - void (*select_all) (GtkListItem *list_item); - void (*unselect_all) (GtkListItem *list_item); - void (*undo_selection) (GtkListItem *list_item); - void (*start_selection) (GtkListItem *list_item); - void (*end_selection) (GtkListItem *list_item); - void (*extend_selection) (GtkListItem *list_item, - GtkScrollType scroll_type, - gfloat position, - gboolean auto_start_selection); - void (*scroll_horizontal) (GtkListItem *list_item, - GtkScrollType scroll_type, - gfloat position); - void (*scroll_vertical) (GtkListItem *list_item, - GtkScrollType scroll_type, - gfloat position); - void (*toggle_add_mode) (GtkListItem *list_item); -}; - - -GType gtk_list_item_get_type (void) G_GNUC_CONST; -GtkWidget* gtk_list_item_new (void); -GtkWidget* gtk_list_item_new_with_label (const gchar *label); -void gtk_list_item_select (GtkListItem *list_item); -void gtk_list_item_deselect (GtkListItem *list_item); - - - -G_END_DECLS - - -#endif /* __GTK_LIST_ITEM_H__ */ - -#endif /* GTK_DISABLE_DEPRECATED */ diff --git a/gtk/gtkliststore.h b/gtk/gtkliststore.h index 6de426e89c..51cbfb3278 100644 --- a/gtk/gtkliststore.h +++ b/gtk/gtkliststore.h @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only <gtk/gtk.h> can be included directly." #endif diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c index 641e19b422..0ab2b53c82 100644 --- a/gtk/gtkmain.c +++ b/gtk/gtkmain.c @@ -148,7 +148,6 @@ _gtk_get_localedir (void) */ typedef struct _GtkInitFunction GtkInitFunction; typedef struct _GtkQuitFunction GtkQuitFunction; -typedef struct _GtkClosure GtkClosure; typedef struct _GtkKeySnooperData GtkKeySnooperData; struct _GtkInitFunction @@ -167,13 +166,6 @@ struct _GtkQuitFunction GDestroyNotify destroy; }; -struct _GtkClosure -{ - GtkCallbackMarshal marshal; - gpointer data; - GDestroyNotify destroy; -}; - struct _GtkKeySnooperData { GtkKeySnoopFunc func; @@ -186,19 +178,6 @@ static void gtk_quit_destroy (GtkQuitFunction *quitf); static gint gtk_invoke_key_snoopers (GtkWidget *grab_widget, GdkEvent *event); -static void gtk_destroy_closure (gpointer data); -static gboolean gtk_invoke_idle_timeout (gpointer data); -static void gtk_invoke_input (gpointer data, - gint source, - GdkInputCondition condition); - -#if 0 -static void gtk_error (gchar *str); -static void gtk_warning (gchar *str); -static void gtk_message (gchar *str); -static void gtk_print (gchar *str); -#endif - static GtkWindowGroup *gtk_main_get_window_group (GtkWidget *widget); const guint gtk_major_version = GTK_MAJOR_VERSION; @@ -235,7 +214,8 @@ static const GDebugKey gtk_debug_keys[] = { {"geometry", GTK_DEBUG_GEOMETRY}, {"icontheme", GTK_DEBUG_ICONTHEME}, {"printing", GTK_DEBUG_PRINTING}, - {"builder", GTK_DEBUG_BUILDER} + {"builder", GTK_DEBUG_BUILDER}, + {"extended-layout", GTK_DEBUG_EXTENDED_LAYOUT}, }; #endif /* G_ENABLE_DEBUG */ @@ -633,13 +613,6 @@ do_pre_parse_initialization (int *argc, { const gchar *env_string; -#if 0 - g_set_error_handler (gtk_error); - g_set_warning_handler (gtk_warning); - g_set_message_handler (gtk_message); - g_set_print_handler (gtk_print); -#endif - if (pre_initialized) return; @@ -1068,13 +1041,6 @@ gtk_init_check_abi_check (int *argc, char ***argv, int num_checks, size_t sizeof #endif -void -gtk_exit (gint errorcode) -{ - exit (errorcode); -} - - /** * gtk_set_locale: * @@ -1328,12 +1294,10 @@ gtk_main_iteration_do (gboolean blocking) /* private libgtk to libgdk interfaces */ -gboolean gdk_pointer_grab_info_libgtk_only (GdkDisplay *display, - GdkWindow **grab_window, - gboolean *owner_events); -gboolean gdk_keyboard_grab_info_libgtk_only (GdkDisplay *display, - GdkWindow **grab_window, - gboolean *owner_events); +gboolean gdk_device_grab_info_libgtk_only (GdkDisplay *display, + GdkDevice *device, + GdkWindow **grab_window, + gboolean *owner_events); static void rewrite_events_translate (GdkWindow *old_window, @@ -1408,6 +1372,7 @@ rewrite_event_for_grabs (GdkEvent *event) gpointer grab_widget_ptr; gboolean owner_events; GdkDisplay *display; + GdkDevice *device; switch (event->type) { @@ -1419,20 +1384,15 @@ rewrite_event_for_grabs (GdkEvent *event) case GDK_MOTION_NOTIFY: case GDK_PROXIMITY_IN: case GDK_PROXIMITY_OUT: - display = gdk_drawable_get_display (event->proximity.window); - if (!gdk_pointer_grab_info_libgtk_only (display, &grab_window, &owner_events) || - !owner_events) - return NULL; - break; - case GDK_KEY_PRESS: case GDK_KEY_RELEASE: - display = gdk_drawable_get_display (event->key.window); - if (!gdk_keyboard_grab_info_libgtk_only (display, &grab_window, &owner_events) || - !owner_events) - return NULL; - break; + display = gdk_drawable_get_display (event->any.window); + device = gdk_event_get_device (event); + if (!gdk_device_grab_info_libgtk_only (display, device, &grab_window, &owner_events) || + !owner_events) + return NULL; + break; default: return NULL; } @@ -1452,9 +1412,10 @@ void gtk_main_do_event (GdkEvent *event) { GtkWidget *event_widget; - GtkWidget *grab_widget; + GtkWidget *grab_widget = NULL; GtkWindowGroup *window_group; GdkEvent *rewritten_event = NULL; + GdkDevice *device; GList *tmp_list; if (event->type == GDK_SETTING) @@ -1501,13 +1462,9 @@ gtk_main_do_event (GdkEvent *event) event = rewritten_event; event_widget = gtk_get_event_widget (event); } - - window_group = gtk_main_get_window_group (event_widget); - /* Push the event onto a stack of current events for - * gtk_current_event_get(). - */ - current_events = g_list_prepend (current_events, event); + window_group = gtk_main_get_window_group (event_widget); + device = gdk_event_get_device (event); /* If there is a grab in effect... */ @@ -1523,11 +1480,34 @@ gtk_main_do_event (GdkEvent *event) gtk_widget_is_ancestor (event_widget, grab_widget)) grab_widget = event_widget; } - else + else if (device) { - grab_widget = event_widget; + grab_widget = gtk_window_group_get_current_device_grab (window_group, device); + + if (grab_widget && + gtk_widget_get_sensitive (event_widget) && + gtk_widget_is_ancestor (event_widget, grab_widget)) + grab_widget = event_widget; } + if (!grab_widget) + grab_widget = event_widget; + + /* If the widget receiving events is actually blocked by another device GTK+ grab */ + if (device && + _gtk_window_group_widget_is_blocked_for_device (window_group, grab_widget, device)) + { + if (rewritten_event) + gdk_event_free (rewritten_event); + + return; + } + + /* Push the event onto a stack of current events for + * gtk_current_event_get(). + */ + current_events = g_list_prepend (current_events, event); + /* Not all events get sent to the grabbing widget. * The delete, destroy, expose, focus change and resize * events still get sent to the event widget because @@ -1648,14 +1628,17 @@ gtk_main_do_event (GdkEvent *event) break; case GDK_ENTER_NOTIFY: - GTK_PRIVATE_SET_FLAG (event_widget, GTK_HAS_POINTER); - _gtk_widget_set_pointer_window (event_widget, event->any.window); + _gtk_widget_set_device_window (event_widget, + gdk_event_get_device (event), + event->any.window); if (gtk_widget_is_sensitive (grab_widget)) gtk_widget_event (grab_widget, event); break; case GDK_LEAVE_NOTIFY: - GTK_PRIVATE_UNSET_FLAG (event_widget, GTK_HAS_POINTER); + _gtk_widget_set_device_window (event_widget, + gdk_event_get_device (event), + NULL); if (gtk_widget_is_sensitive (grab_widget)) gtk_widget_event (grab_widget, event); break; @@ -1730,16 +1713,73 @@ typedef struct gboolean was_grabbed; gboolean is_grabbed; gboolean from_grab; + GList *notified_windows; + GdkDevice *device; } GrabNotifyInfo; +static void +synth_crossing_for_grab_notify (GtkWidget *from, + GtkWidget *to, + GrabNotifyInfo *info, + GList *devices, + GdkCrossingMode mode) +{ + while (devices) + { + GdkDevice *device = devices->data; + GdkWindow *from_window, *to_window; + + /* Do not propagate events more than once to + * the same windows if non-multidevice aware. + */ + if (!from) + from_window = NULL; + else + { + from_window = _gtk_widget_get_device_window (from, device); + + if (from_window && + !gdk_window_get_support_multidevice (from_window) && + g_list_find (info->notified_windows, from_window)) + from_window = NULL; + } + + if (!to) + to_window = NULL; + else + { + to_window = _gtk_widget_get_device_window (to, device); + + if (to_window && + !gdk_window_get_support_multidevice (to_window) && + g_list_find (info->notified_windows, to_window)) + to_window = NULL; + } + + if (from_window || to_window) + { + _gtk_widget_synthesize_crossing ((from_window) ? from : NULL, + (to_window) ? to : NULL, + device, mode); + + if (from_window) + info->notified_windows = g_list_prepend (info->notified_windows, from_window); + + if (to_window) + info->notified_windows = g_list_prepend (info->notified_windows, to_window); + } + + devices = devices->next; + } +} + static void gtk_grab_notify_foreach (GtkWidget *child, gpointer data) - { GrabNotifyInfo *info = data; - gboolean was_grabbed, is_grabbed, was_shadowed, is_shadowed; + GList *devices; was_grabbed = info->was_grabbed; is_grabbed = info->is_grabbed; @@ -1754,42 +1794,55 @@ gtk_grab_notify_foreach (GtkWidget *child, if ((was_shadowed || is_shadowed) && GTK_IS_CONTAINER (child)) gtk_container_forall (GTK_CONTAINER (child), gtk_grab_notify_foreach, info); - + + if (info->device && + _gtk_widget_get_device_window (child, info->device)) + { + /* Device specified and is on widget */ + devices = g_list_prepend (NULL, info->device); + } + else + devices = _gtk_widget_list_devices (child); + if (is_shadowed) { GTK_PRIVATE_SET_FLAG (child, GTK_SHADOWED); - if (!was_shadowed && GTK_WIDGET_HAS_POINTER (child) - && gtk_widget_is_sensitive (child)) - _gtk_widget_synthesize_crossing (child, info->new_grab_widget, - GDK_CROSSING_GTK_GRAB); + if (!was_shadowed && devices && + gtk_widget_is_sensitive (child)) + synth_crossing_for_grab_notify (child, info->new_grab_widget, + info, devices, + GDK_CROSSING_GTK_GRAB); } else { GTK_PRIVATE_UNSET_FLAG (child, GTK_SHADOWED); - if (was_shadowed && GTK_WIDGET_HAS_POINTER (child) - && gtk_widget_is_sensitive (child)) - _gtk_widget_synthesize_crossing (info->old_grab_widget, child, - info->from_grab ? GDK_CROSSING_GTK_GRAB - : GDK_CROSSING_GTK_UNGRAB); + if (was_shadowed && devices && + gtk_widget_is_sensitive (child)) + synth_crossing_for_grab_notify (info->old_grab_widget, child, + info, devices, + info->from_grab ? GDK_CROSSING_GTK_GRAB : + GDK_CROSSING_GTK_UNGRAB); } if (was_shadowed != is_shadowed) _gtk_widget_grab_notify (child, was_shadowed); - + g_object_unref (child); - + g_list_free (devices); + info->was_grabbed = was_grabbed; info->is_grabbed = is_grabbed; } static void gtk_grab_notify (GtkWindowGroup *group, + GdkDevice *device, GtkWidget *old_grab_widget, GtkWidget *new_grab_widget, gboolean from_grab) { GList *toplevels; - GrabNotifyInfo info; + GrabNotifyInfo info = { 0 }; if (old_grab_widget == new_grab_widget) return; @@ -1797,12 +1850,13 @@ gtk_grab_notify (GtkWindowGroup *group, info.old_grab_widget = old_grab_widget; info.new_grab_widget = new_grab_widget; info.from_grab = from_grab; + info.device = device; g_object_ref (group); toplevels = gtk_window_list_toplevels (); g_list_foreach (toplevels, (GFunc)g_object_ref, NULL); - + while (toplevels) { GtkWindow *toplevel = toplevels->data; @@ -1816,6 +1870,7 @@ gtk_grab_notify (GtkWindowGroup *group, g_object_unref (toplevel); } + g_list_free (info.notified_windows); g_object_unref (group); } @@ -1829,7 +1884,7 @@ gtk_grab_add (GtkWidget *widget) if (!gtk_widget_has_grab (widget) && gtk_widget_is_sensitive (widget)) { - GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_GRAB); + _gtk_widget_set_has_grab (widget, TRUE); group = gtk_main_get_window_group (widget); @@ -1841,7 +1896,7 @@ gtk_grab_add (GtkWidget *widget) g_object_ref (widget); group->grabs = g_slist_prepend (group->grabs, widget); - gtk_grab_notify (group, old_grab_widget, widget, TRUE); + gtk_grab_notify (group, NULL, old_grab_widget, widget, TRUE); } } @@ -1867,7 +1922,7 @@ gtk_grab_remove (GtkWidget *widget) if (gtk_widget_has_grab (widget)) { - GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_GRAB); + _gtk_widget_set_has_grab (widget, FALSE); group = gtk_main_get_window_group (widget); group->grabs = g_slist_remove (group->grabs, widget); @@ -1877,12 +1932,72 @@ gtk_grab_remove (GtkWidget *widget) else new_grab_widget = NULL; - gtk_grab_notify (group, widget, new_grab_widget, FALSE); + gtk_grab_notify (group, NULL, widget, new_grab_widget, FALSE); g_object_unref (widget); } } +/** + * gtk_device_grab_add: + * @widget: a #GtkWidget + * @device: a #GtkDevice to grab on. + * @block_others: %TRUE to prevent other devices to interact with @widget. + * + * Adds a GTK+ grab on @device, so all the events on @device and its + * associated pointer or keyboard (if any) are delivered to @widget. + * If the @block_others parameter is %TRUE, any other devices will be + * unable to interact with @widget during the grab. + * + * Since: 3.0 + **/ +void +gtk_device_grab_add (GtkWidget *widget, + GdkDevice *device, + gboolean block_others) +{ + GtkWindowGroup *group; + GtkWidget *old_grab_widget; + + g_return_if_fail (GTK_IS_WIDGET (widget)); + g_return_if_fail (GDK_IS_DEVICE (device)); + + group = gtk_main_get_window_group (widget); + old_grab_widget = gtk_window_group_get_current_device_grab (group, device); + + if (old_grab_widget != widget) + _gtk_window_group_add_device_grab (group, widget, device, block_others); + + gtk_grab_notify (group, device, old_grab_widget, widget, TRUE); +} + +/** + * gtk_device_grab_remove: + * @widget: a #GtkWidget + * @device: a #GdkDevice + * + * Removes a device grab from the given widget. You have to pair calls + * to gtk_device_grab_add() and gtk_device_grab_remove(). + * + * Since: 3.0 + **/ +void +gtk_device_grab_remove (GtkWidget *widget, + GdkDevice *device) +{ + GtkWindowGroup *group; + GtkWidget *new_grab_widget; + + g_return_if_fail (GTK_IS_WIDGET (widget)); + g_return_if_fail (GDK_IS_DEVICE (device)); + + group = gtk_main_get_window_group (widget); + _gtk_window_group_remove_device_grab (group, widget, device); + new_grab_widget = gtk_window_group_get_current_device_grab (group, device); + + gtk_grab_notify (group, device, widget, new_grab_widget, FALSE); +} + void gtk_init_add (GtkFunction function, gpointer data) @@ -2075,175 +2190,6 @@ gtk_quit_remove_by_data (gpointer data) } } -guint -gtk_timeout_add_full (guint32 interval, - GtkFunction function, - GtkCallbackMarshal marshal, - gpointer data, - GDestroyNotify destroy) -{ - if (marshal) - { - GtkClosure *closure; - - closure = g_new (GtkClosure, 1); - closure->marshal = marshal; - closure->data = data; - closure->destroy = destroy; - - return g_timeout_add_full (0, interval, - gtk_invoke_idle_timeout, - closure, - gtk_destroy_closure); - } - else - return g_timeout_add_full (0, interval, function, data, destroy); -} - -guint -gtk_timeout_add (guint32 interval, - GtkFunction function, - gpointer data) -{ - return g_timeout_add_full (0, interval, function, data, NULL); -} - -void -gtk_timeout_remove (guint tag) -{ - g_source_remove (tag); -} - -guint -gtk_idle_add_full (gint priority, - GtkFunction function, - GtkCallbackMarshal marshal, - gpointer data, - GDestroyNotify destroy) -{ - if (marshal) - { - GtkClosure *closure; - - closure = g_new (GtkClosure, 1); - closure->marshal = marshal; - closure->data = data; - closure->destroy = destroy; - - return g_idle_add_full (priority, - gtk_invoke_idle_timeout, - closure, - gtk_destroy_closure); - } - else - return g_idle_add_full (priority, function, data, destroy); -} - -guint -gtk_idle_add (GtkFunction function, - gpointer data) -{ - return g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, function, data, NULL); -} - -guint -gtk_idle_add_priority (gint priority, - GtkFunction function, - gpointer data) -{ - return g_idle_add_full (priority, function, data, NULL); -} - -void -gtk_idle_remove (guint tag) -{ - g_source_remove (tag); -} - -void -gtk_idle_remove_by_data (gpointer data) -{ - if (!g_idle_remove_by_data (data)) - g_warning ("gtk_idle_remove_by_data(%p): no such idle", data); -} - -guint -gtk_input_add_full (gint source, - GdkInputCondition condition, - GdkInputFunction function, - GtkCallbackMarshal marshal, - gpointer data, - GDestroyNotify destroy) -{ - if (marshal) - { - GtkClosure *closure; - - closure = g_new (GtkClosure, 1); - closure->marshal = marshal; - closure->data = data; - closure->destroy = destroy; - - return gdk_input_add_full (source, - condition, - (GdkInputFunction) gtk_invoke_input, - closure, - (GDestroyNotify) gtk_destroy_closure); - } - else - return gdk_input_add_full (source, condition, function, data, destroy); -} - -void -gtk_input_remove (guint tag) -{ - g_source_remove (tag); -} - -static void -gtk_destroy_closure (gpointer data) -{ - GtkClosure *closure = data; - - if (closure->destroy) - (closure->destroy) (closure->data); - g_free (closure); -} - -static gboolean -gtk_invoke_idle_timeout (gpointer data) -{ - GtkClosure *closure = data; - - GtkArg args[1]; - gint ret_val = FALSE; - args[0].name = NULL; - args[0].type = G_TYPE_BOOLEAN; - args[0].d.pointer_data = &ret_val; - closure->marshal (NULL, closure->data, 0, args); - return ret_val; -} - -static void -gtk_invoke_input (gpointer data, - gint source, - GdkInputCondition condition) -{ - GtkClosure *closure = data; - - GtkArg args[3]; - args[0].type = G_TYPE_INT; - args[0].name = NULL; - GTK_VALUE_INT (args[0]) = source; - args[1].type = GDK_TYPE_INPUT_CONDITION; - args[1].name = NULL; - GTK_VALUE_FLAGS (args[1]) = condition; - args[2].type = G_TYPE_NONE; - args[2].name = NULL; - - closure->marshal (NULL, closure->data, 2, args); -} - /** * gtk_get_current_event: * @@ -2305,6 +2251,23 @@ gtk_get_current_event_state (GdkModifierType *state) } } +/** + * gtk_get_current_event_device: + * + * If there is a current event and it has a device, return that + * device, otherwise return %NULL. + * + * Returns: a #GdkDevice, or %NULL + **/ +GdkDevice * +gtk_get_current_event_device (void) +{ + if (current_events) + return gdk_event_get_device (current_events->data); + else + return NULL; +} + /** * gtk_get_event_widget: * @event: a #GdkEvent @@ -2456,119 +2419,6 @@ gtk_propagate_event (GtkWidget *widget, g_object_unref (widget); } -#if 0 -static void -gtk_error (gchar *str) -{ - gtk_print (str); -} - -static void -gtk_warning (gchar *str) -{ - gtk_print (str); -} - -static void -gtk_message (gchar *str) -{ - gtk_print (str); -} - -static void -gtk_print (gchar *str) -{ - static GtkWidget *window = NULL; - static GtkWidget *text; - static int level = 0; - GtkWidget *box1; - GtkWidget *box2; - GtkWidget *table; - GtkWidget *hscrollbar; - GtkWidget *vscrollbar; - GtkWidget *separator; - GtkWidget *button; - - if (level > 0) - { - fputs (str, stdout); - fflush (stdout); - return; - } - - if (!window) - { - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - - gtk_signal_connect (GTK_OBJECT (window), "destroy", - G_CALLBACK (gtk_widget_destroyed), - &window); - - gtk_window_set_title (GTK_WINDOW (window), "Messages"); - - box1 = gtk_vbox_new (FALSE, 0); - gtk_container_add (GTK_CONTAINER (window), box1); - gtk_widget_show (box1); - - - box2 = gtk_vbox_new (FALSE, 10); - gtk_container_set_border_width (GTK_CONTAINER (box2), 10); - gtk_box_pack_start (GTK_BOX (box1), box2, TRUE, TRUE, 0); - gtk_widget_show (box2); - - - table = gtk_table_new (2, 2, FALSE); - gtk_table_set_row_spacing (GTK_TABLE (table), 0, 2); - gtk_table_set_col_spacing (GTK_TABLE (table), 0, 2); - gtk_box_pack_start (GTK_BOX (box2), table, TRUE, TRUE, 0); - gtk_widget_show (table); - - text = gtk_text_new (NULL, NULL); - gtk_text_set_editable (GTK_TEXT (text), FALSE); - gtk_table_attach_defaults (GTK_TABLE (table), text, 0, 1, 0, 1); - gtk_widget_show (text); - gtk_widget_realize (text); - - hscrollbar = gtk_hscrollbar_new (GTK_TEXT (text)->hadj); - gtk_table_attach (GTK_TABLE (table), hscrollbar, 0, 1, 1, 2, - GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); - gtk_widget_show (hscrollbar); - - vscrollbar = gtk_vscrollbar_new (GTK_TEXT (text)->vadj); - gtk_table_attach (GTK_TABLE (table), vscrollbar, 1, 2, 0, 1, - GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); - gtk_widget_show (vscrollbar); - - separator = gtk_hseparator_new (); - gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 0); - gtk_widget_show (separator); - - - box2 = gtk_vbox_new (FALSE, 10); - gtk_container_set_border_width (GTK_CONTAINER (box2), 10); - gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, TRUE, 0); - gtk_widget_show (box2); - - - button = gtk_button_new_with_label ("close"); - gtk_signal_connect_object (GTK_OBJECT (button), "clicked", - G_CALLBACK (gtk_widget_hide), - GTK_OBJECT (window)); - gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); - gtk_widget_set_can_default (button, TRUE); - gtk_widget_grab_default (button); - gtk_widget_show (button); - } - - level += 1; - gtk_text_insert (GTK_TEXT (text), NULL, NULL, NULL, str, -1); - level -= 1; - - if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); -} -#endif - gboolean _gtk_boolean_handled_accumulator (GSignalInvocationHint *ihint, GValue *return_accu, diff --git a/gtk/gtkmain.h b/gtk/gtkmain.h index 21de92ed42..9b4c686469 100644 --- a/gtk/gtkmain.h +++ b/gtk/gtkmain.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only <gtk/gtk.h> can be included directly." #endif @@ -45,20 +45,6 @@ G_BEGIN_DECLS */ #define GTK_PRIORITY_RESIZE (G_PRIORITY_HIGH_IDLE + 10) -#ifndef GTK_DISABLE_DEPRECATED - -/* Use GDK_PRIORITY_REDRAW */ -#define GTK_PRIORITY_REDRAW (G_PRIORITY_HIGH_IDLE + 20) - -/* Deprecated. Use G_PRIORITY #define's instead - */ -#define GTK_PRIORITY_HIGH G_PRIORITY_HIGH -#define GTK_PRIORITY_INTERNAL GTK_PRIORITY_REDRAW -#define GTK_PRIORITY_DEFAULT G_PRIORITY_DEFAULT_IDLE -#define GTK_PRIORITY_LOW G_PRIORITY_LOW - -#endif /* GTK_DISABLE_DEPRECATED */ - typedef gint (*GtkKeySnoopFunc) (GtkWidget *grab_widget, GdkEventKey *event, gpointer func_data); @@ -127,10 +113,6 @@ gboolean gtk_init_check_abi_check (int *argc, #endif -#ifndef GTK_DISABLE_DEPRECATED -void gtk_exit (gint error_code); -#endif /* GTK_DISABLE_DEPRECATED */ - void gtk_disable_setlocale (void); gchar * gtk_set_locale (void); PangoLanguage *gtk_get_default_language (void); @@ -156,6 +138,12 @@ void gtk_grab_add (GtkWidget *widget); GtkWidget* gtk_grab_get_current (void); void gtk_grab_remove (GtkWidget *widget); +void gtk_device_grab_add (GtkWidget *widget, + GdkDevice *device, + gboolean block_others); +void gtk_device_grab_remove (GtkWidget *widget, + GdkDevice *device); + void gtk_init_add (GtkFunction function, gpointer data); void gtk_quit_add_destroy (guint main_level, @@ -170,37 +158,6 @@ guint gtk_quit_add_full (guint main_level, GDestroyNotify destroy); void gtk_quit_remove (guint quit_handler_id); void gtk_quit_remove_by_data (gpointer data); -#ifndef GTK_DISABLE_DEPRECATED -guint gtk_timeout_add (guint32 interval, - GtkFunction function, - gpointer data); -guint gtk_timeout_add_full (guint32 interval, - GtkFunction function, - GtkCallbackMarshal marshal, - gpointer data, - GDestroyNotify destroy); -void gtk_timeout_remove (guint timeout_handler_id); - -guint gtk_idle_add (GtkFunction function, - gpointer data); -guint gtk_idle_add_priority (gint priority, - GtkFunction function, - gpointer data); -guint gtk_idle_add_full (gint priority, - GtkFunction function, - GtkCallbackMarshal marshal, - gpointer data, - GDestroyNotify destroy); -void gtk_idle_remove (guint idle_handler_id); -void gtk_idle_remove_by_data (gpointer data); -guint gtk_input_add_full (gint source, - GdkInputCondition condition, - GdkInputFunction function, - GtkCallbackMarshal marshal, - gpointer data, - GDestroyNotify destroy); -void gtk_input_remove (guint input_handler_id); -#endif /* GTK_DISABLE_DEPRECATED */ guint gtk_key_snooper_install (GtkKeySnoopFunc snooper, gpointer func_data); @@ -209,6 +166,7 @@ void gtk_key_snooper_remove (guint snooper_handler_id); GdkEvent* gtk_get_current_event (void); guint32 gtk_get_current_event_time (void); gboolean gtk_get_current_event_state (GdkModifierType *state); +GdkDevice * gtk_get_current_event_device (void); GtkWidget* gtk_get_event_widget (GdkEvent *event); diff --git a/gtk/gtkmarshal.list b/gtk/gtkmarshal.list deleted file mode 100644 index a016dffc6d..0000000000 --- a/gtk/gtkmarshal.list +++ /dev/null @@ -1,36 +0,0 @@ -BOOL:NONE -BOOL:POINTER -BOOL:POINTER,POINTER,INT,INT -BOOL:POINTER,INT,INT -BOOL:POINTER,INT,INT,UINT -BOOL:POINTER,STRING,STRING,POINTER -ENUM:ENUM -INT:POINTER -INT:POINTER,CHAR,CHAR -NONE:BOOL -NONE:BOXED -NONE:ENUM -NONE:ENUM,FLOAT -NONE:ENUM,FLOAT,BOOL -NONE:INT -NONE:INT,INT -NONE:INT,INT,POINTER -NONE:NONE -NONE:OBJECT -NONE:POINTER -NONE:POINTER,INT -NONE:POINTER,POINTER -NONE:POINTER,POINTER,POINTER -NONE:POINTER,STRING,STRING -NONE:POINTER,UINT -NONE:POINTER,UINT,ENUM -NONE:POINTER,POINTER,UINT,UINT -NONE:POINTER,INT,INT,POINTER,UINT,UINT -NONE:POINTER,UINT,UINT -NONE:POINTER,UINT,UINT -NONE:STRING -NONE:STRING,INT,POINTER -NONE:UINT -NONE:UINT,POINTER,UINT,ENUM,ENUM,POINTER -NONE:UINT,POINTER,UINT,UINT,ENUM -NONE:UINT,STRING diff --git a/gtk/gtkmarshalers.list b/gtk/gtkmarshalers.list index 77873cb022..22af46d610 100644 --- a/gtk/gtkmarshalers.list +++ b/gtk/gtkmarshalers.list @@ -83,6 +83,7 @@ VOID:OBJECT,INT,OBJECT VOID:OBJECT,INT,INT VOID:OBJECT,INT,INT,BOXED,UINT,UINT VOID:OBJECT,OBJECT +VOID:OBJECT,POINTER VOID:OBJECT,STRING VOID:OBJECT,STRING,STRING VOID:OBJECT,UINT diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c index b5b9820faa..e9999946d1 100644 --- a/gtk/gtkmenu.c +++ b/gtk/gtkmenu.c @@ -64,6 +64,7 @@ typedef struct _GtkMenuAttachData GtkMenuAttachData; typedef struct _GtkMenuPrivate GtkMenuPrivate; +typedef struct _GtkMenuPopdownData GtkMenuPopdownData; struct _GtkMenuAttachData { @@ -100,6 +101,12 @@ struct _GtkMenuPrivate guint no_toggle_size : 1; }; +struct _GtkMenuPopdownData +{ + GtkMenu *menu; + GdkDevice *device; +}; + typedef struct { gint left_attach; @@ -1370,33 +1377,38 @@ gtk_menu_tearoff_bg_copy (GtkMenu *menu) static gboolean popup_grab_on_window (GdkWindow *window, - guint32 activate_time, - gboolean grab_keyboard) + GdkDevice *keyboard, + GdkDevice *pointer, + guint32 activate_time) { - if ((gdk_pointer_grab (window, TRUE, - GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | - GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | - GDK_POINTER_MOTION_MASK, - NULL, NULL, activate_time) == 0)) + if (keyboard && + gdk_device_grab (keyboard, window, + GDK_OWNERSHIP_WINDOW, TRUE, + GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK, + NULL, activate_time) != GDK_GRAB_SUCCESS) + return FALSE; + + if (pointer && + gdk_device_grab (pointer, window, + GDK_OWNERSHIP_WINDOW, TRUE, + GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | + GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | + GDK_POINTER_MOTION_MASK, + NULL, activate_time) != GDK_GRAB_SUCCESS) { - if (!grab_keyboard || - gdk_keyboard_grab (window, TRUE, - activate_time) == 0) - return TRUE; - else - { - gdk_display_pointer_ungrab (gdk_drawable_get_display (window), - activate_time); - return FALSE; - } + if (keyboard) + gdk_device_ungrab (keyboard, activate_time); + + return FALSE; } - return FALSE; + return TRUE; } /** - * gtk_menu_popup: + * gtk_menu_popup_for_device: * @menu: a #GtkMenu. + * @device: (allow-none): a #GdkDevice * @parent_menu_shell: (allow-none): the menu shell containing the triggering menu item, or %NULL * @parent_menu_item: (allow-none): the menu item whose activation triggered the popup, or %NULL * @func: (allow-none): a user supplied function used to position the menu, or %NULL @@ -1406,9 +1418,9 @@ popup_grab_on_window (GdkWindow *window, * * Displays a menu and makes it available for selection. Applications can use * this function to display context-sensitive menus, and will typically supply - * %NULL for the @parent_menu_shell, @parent_menu_item, @func and @data + * %NULL for the @parent_menu_shell, @parent_menu_item, @func and @data * parameters. The default menu positioning function will position the menu - * at the current mouse cursor position. + * at the current position of @device (or its corresponding pointer). * * The @button parameter should be the mouse button pressed to initiate * the menu popup. If the menu popup was initiated by something other than @@ -1421,15 +1433,18 @@ popup_grab_on_window (GdkWindow *window, * a mouse click or key press) that caused the initiation of the popup. * Only if no such event is available, gtk_get_current_event_time() can * be used instead. + * + * Since: 3.0 */ void -gtk_menu_popup (GtkMenu *menu, - GtkWidget *parent_menu_shell, - GtkWidget *parent_menu_item, - GtkMenuPositionFunc func, - gpointer data, - guint button, - guint32 activate_time) +gtk_menu_popup_for_device (GtkMenu *menu, + GdkDevice *device, + GtkWidget *parent_menu_shell, + GtkWidget *parent_menu_item, + GtkMenuPositionFunc func, + gpointer data, + guint button, + guint32 activate_time) { GtkWidget *widget; GtkWidget *xgrab_shell; @@ -1439,13 +1454,26 @@ gtk_menu_popup (GtkMenu *menu, gboolean grab_keyboard; GtkMenuPrivate *priv; GtkWidget *parent_toplevel; + GdkDevice *keyboard, *pointer; g_return_if_fail (GTK_IS_MENU (menu)); + g_return_if_fail (GDK_IS_DEVICE (device)); widget = GTK_WIDGET (menu); menu_shell = GTK_MENU_SHELL (menu); priv = gtk_menu_get_private (menu); + if (device->source == GDK_SOURCE_KEYBOARD) + { + keyboard = device; + pointer = gdk_device_get_associated_device (device); + } + else + { + pointer = device; + keyboard = gdk_device_get_associated_device (device); + } + menu_shell->parent_menu_shell = parent_menu_shell; priv->seen_item_enter = FALSE; @@ -1493,10 +1521,16 @@ gtk_menu_popup (GtkMenu *menu, grab_keyboard = gtk_menu_shell_get_take_focus (menu_shell); gtk_window_set_accept_focus (GTK_WINDOW (menu->toplevel), grab_keyboard); + if (!grab_keyboard) + keyboard = NULL; + if (xgrab_shell && xgrab_shell != widget) { - if (popup_grab_on_window (xgrab_shell->window, activate_time, grab_keyboard)) - GTK_MENU_SHELL (xgrab_shell)->have_xgrab = TRUE; + if (popup_grab_on_window (xgrab_shell->window, keyboard, pointer, activate_time)) + { + _gtk_menu_shell_set_grab_devices (GTK_MENU_SHELL (xgrab_shell), keyboard, pointer); + GTK_MENU_SHELL (xgrab_shell)->have_xgrab = TRUE; + } } else { @@ -1504,8 +1538,11 @@ gtk_menu_popup (GtkMenu *menu, xgrab_shell = widget; transfer_window = menu_grab_transfer_window_get (menu); - if (popup_grab_on_window (transfer_window, activate_time, grab_keyboard)) - GTK_MENU_SHELL (xgrab_shell)->have_xgrab = TRUE; + if (popup_grab_on_window (transfer_window, keyboard, pointer, activate_time)) + { + _gtk_menu_shell_set_grab_devices (GTK_MENU_SHELL (xgrab_shell), keyboard, pointer); + GTK_MENU_SHELL (xgrab_shell)->have_xgrab = TRUE; + } } if (!GTK_MENU_SHELL (xgrab_shell)->have_xgrab) @@ -1519,6 +1556,7 @@ gtk_menu_popup (GtkMenu *menu, return; } + _gtk_menu_shell_set_grab_devices (GTK_MENU_SHELL (menu), keyboard, pointer); menu_shell->active = TRUE; menu_shell->button = button; @@ -1614,8 +1652,9 @@ gtk_menu_popup (GtkMenu *menu, gtk_widget_show (menu->toplevel); if (xgrab_shell == widget) - popup_grab_on_window (widget->window, activate_time, grab_keyboard); /* Should always succeed */ - gtk_grab_add (GTK_WIDGET (menu)); + popup_grab_on_window (widget->window, keyboard, pointer, activate_time); /* Should always succeed */ + + gtk_device_grab_add (GTK_WIDGET (menu), pointer, TRUE); if (parent_menu_shell) { @@ -1630,11 +1669,77 @@ gtk_menu_popup (GtkMenu *menu, _gtk_menu_shell_update_mnemonics (menu_shell); } +/** + * gtk_menu_popup: + * @menu: a #GtkMenu. + * @parent_menu_shell: (allow-none): the menu shell containing the triggering menu item, or %NULL + * @parent_menu_item: (allow-none): the menu item whose activation triggered the popup, or %NULL + * @func: (allow-none): a user supplied function used to position the menu, or %NULL + * @data: (allow-none): user supplied data to be passed to @func. + * @button: the mouse button which was pressed to initiate the event. + * @activate_time: the time at which the activation event occurred. + * + * Displays a menu and makes it available for selection. Applications can use + * this function to display context-sensitive menus, and will typically supply + * %NULL for the @parent_menu_shell, @parent_menu_item, @func and @data + * parameters. The default menu positioning function will position the menu + * at the current mouse cursor position. + * + * The @button parameter should be the mouse button pressed to initiate + * the menu popup. If the menu popup was initiated by something other than + * a mouse button press, such as a mouse button release or a keypress, + * @button should be 0. + * + * The @activate_time parameter is used to conflict-resolve initiation of + * concurrent requests for mouse/keyboard grab requests. To function + * properly, this needs to be the time stamp of the user event (such as + * a mouse click or key press) that caused the initiation of the popup. + * Only if no such event is available, gtk_get_current_event_time() can + * be used instead. + */ +void +gtk_menu_popup (GtkMenu *menu, + GtkWidget *parent_menu_shell, + GtkWidget *parent_menu_item, + GtkMenuPositionFunc func, + gpointer data, + guint button, + guint32 activate_time) +{ + GdkDevice *device; + + g_return_if_fail (GTK_IS_MENU (menu)); + + device = gtk_get_current_event_device (); + + if (!device) + { + GdkDisplay *display; + GdkDeviceManager *device_manager; + GList *devices; + + display = gtk_widget_get_display (GTK_WIDGET (menu)); + device_manager = gdk_display_get_device_manager (display); + devices = gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_MASTER); + + device = devices->data; + + g_list_free (devices); + } + + gtk_menu_popup_for_device (menu, device, + parent_menu_shell, + parent_menu_item, + func, data, + button, activate_time); +} + void gtk_menu_popdown (GtkMenu *menu) { GtkMenuPrivate *private; GtkMenuShell *menu_shell; + GdkDevice *pointer; g_return_if_fail (GTK_IS_MENU (menu)); @@ -1676,15 +1781,16 @@ gtk_menu_popdown (GtkMenu *menu) } else { - /* We popped up the menu from the tearoff, so we need to + GdkDevice *keyboard, *pointer; + + /* We popped up the menu from the tearoff, so we need to * release the grab - we aren't actually hiding the menu. */ - if (menu_shell->have_xgrab) + if (menu_shell->have_xgrab && + _gtk_menu_shell_get_grab_devices (menu_shell, &keyboard, &pointer)) { - GdkDisplay *display = gtk_widget_get_display (GTK_WIDGET (menu)); - - gdk_display_pointer_ungrab (display, GDK_CURRENT_TIME); - gdk_display_keyboard_ungrab (display, GDK_CURRENT_TIME); + gdk_device_ungrab (keyboard, GDK_CURRENT_TIME); + gdk_device_ungrab (pointer, GDK_CURRENT_TIME); } } @@ -1700,7 +1806,13 @@ gtk_menu_popdown (GtkMenu *menu) gtk_widget_hide (GTK_WIDGET (menu)); menu_shell->have_xgrab = FALSE; - gtk_grab_remove (GTK_WIDGET (menu)); + + _gtk_menu_shell_get_grab_devices (menu_shell, NULL, &pointer); + + if (pointer) + gtk_device_grab_remove (GTK_WIDGET (menu), pointer); + + _gtk_menu_shell_set_grab_devices (menu_shell, NULL, NULL); menu_grab_transfer_window_destroy (menu); } @@ -3034,7 +3146,7 @@ get_accel_path (GtkWidget *menu_item, { accel_group = gtk_accel_group_from_accel_closure (accel_closure); - *locked = accel_group->lock_count > 0; + *locked = gtk_accel_group_get_is_locked (accel_group); } } } @@ -3293,6 +3405,7 @@ gtk_menu_motion_notify (GtkWidget *widget, send_event->crossing.x = event->x; send_event->crossing.y = event->y; send_event->crossing.state = event->state; + gdk_event_set_device (send_event, gdk_event_get_device ((GdkEvent *) event)); /* We send the event to 'widget', the currently active menu, * instead of 'menu', the menu that the pointer is in. This @@ -3967,14 +4080,17 @@ gtk_menu_stop_navigating_submenu (GtkMenu *menu) static gboolean gtk_menu_stop_navigating_submenu_cb (gpointer user_data) { - GtkMenu *menu = user_data; + GtkMenuPopdownData *popdown_data = user_data; + GtkMenu *menu = popdown_data->menu; GdkWindow *child_window; gtk_menu_stop_navigating_submenu (menu); if (gtk_widget_get_realized (GTK_WIDGET (menu))) { - child_window = gdk_window_get_pointer (menu->bin_window, NULL, NULL, NULL); + child_window = gdk_window_get_device_position (menu->bin_window, + popdown_data->device, + NULL, NULL, NULL); if (child_window) { @@ -3983,6 +4099,7 @@ gtk_menu_stop_navigating_submenu_cb (gpointer user_data) send_event->crossing.window = g_object_ref (child_window); send_event->crossing.time = GDK_CURRENT_TIME; /* Bogus */ send_event->crossing.send_event = TRUE; + gdk_event_set_device (send_event, popdown_data->device); GTK_WIDGET_CLASS (gtk_menu_parent_class)->enter_notify_event (GTK_WIDGET (menu), (GdkEventCrossing *)send_event); @@ -4089,6 +4206,7 @@ gtk_menu_set_submenu_navigation_region (GtkMenu *menu, gint height = 0; GdkPoint point[3]; GtkWidget *event_widget; + GtkMenuPopdownData *popdown_data; g_return_if_fail (menu_item->submenu != NULL); g_return_if_fail (event != NULL); @@ -4163,9 +4281,15 @@ gtk_menu_set_submenu_navigation_region (GtkMenu *menu, "gtk-menu-popdown-delay", &popdown_delay, NULL); - menu->navigation_timeout = gdk_threads_add_timeout (popdown_delay, - gtk_menu_stop_navigating_submenu_cb, - menu); + popdown_data = g_new (GtkMenuPopdownData, 1); + popdown_data->menu = menu; + popdown_data->device = gdk_event_get_device ((GdkEvent *) event); + + menu->navigation_timeout = gdk_threads_add_timeout_full (G_PRIORITY_DEFAULT, + popdown_delay, + gtk_menu_stop_navigating_submenu_cb, + popdown_data, + (GDestroyNotify) g_free); #ifdef DRAW_STAY_UP_TRIANGLE draw_stay_up_triangle (gdk_get_default_root_window(), @@ -4202,15 +4326,17 @@ gtk_menu_position (GtkMenu *menu) GdkScreen *screen; GdkScreen *pointer_screen; GdkRectangle monitor; - + GdkDevice *pointer; + g_return_if_fail (GTK_IS_MENU (menu)); widget = GTK_WIDGET (menu); screen = gtk_widget_get_screen (widget); - gdk_display_get_pointer (gdk_screen_get_display (screen), - &pointer_screen, &x, &y, NULL); - + _gtk_menu_shell_get_grab_devices (GTK_MENU_SHELL (menu), NULL, &pointer); + gdk_display_get_device_state (gdk_screen_get_display (screen), + pointer, &pointer_screen, &x, &y, NULL); + /* We need the requisition to figure out the right place to * popup the menu. In fact, we always need to ask here, since * if a size_request was queued while we weren't popped up, @@ -5324,16 +5450,24 @@ gtk_menu_grab_notify (GtkWidget *widget, GtkWidget *toplevel; GtkWindowGroup *group; GtkWidget *grab; + GdkDevice *pointer; + + _gtk_menu_shell_get_grab_devices (GTK_MENU_SHELL (widget), NULL, &pointer); + + if (!pointer || + !gtk_widget_device_is_shadowed (widget, pointer)) + return; toplevel = gtk_widget_get_toplevel (widget); - group = gtk_window_get_group (GTK_WINDOW (toplevel)); - grab = _gtk_window_group_get_current_grab (group); - if (!was_grabbed) - { - if (GTK_MENU_SHELL (widget)->active && !GTK_IS_MENU_SHELL (grab)) - gtk_menu_shell_cancel (GTK_MENU_SHELL (widget)); - } + if (!GTK_IS_WINDOW (toplevel)) + return; + + group = gtk_window_get_group (GTK_WINDOW (toplevel)); + grab = gtk_window_group_get_current_device_grab (group, pointer); + + if (GTK_MENU_SHELL (widget)->active && !GTK_IS_MENU_SHELL (grab)) + gtk_menu_shell_cancel (GTK_MENU_SHELL (widget)); } /** diff --git a/gtk/gtkmenu.h b/gtk/gtkmenu.h index 694457a059..0929472af7 100644 --- a/gtk/gtkmenu.h +++ b/gtk/gtkmenu.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only <gtk/gtk.h> can be included directly." #endif @@ -133,6 +133,15 @@ void gtk_menu_popup (GtkMenu *menu, gpointer data, guint button, guint32 activate_time); +void gtk_menu_popup_for_device (GtkMenu *menu, + GdkDevice *device, + GtkWidget *parent_menu_shell, + GtkWidget *parent_menu_item, + GtkMenuPositionFunc func, + gpointer data, + guint button, + guint32 activate_time); + /* Position the menu according to its position function. Called * from gtkmenuitem.c when a menu-item changes its allocation @@ -203,12 +212,6 @@ void gtk_menu_set_monitor (GtkMenu *menu, gint gtk_menu_get_monitor (GtkMenu *menu); GList* gtk_menu_get_for_attach_widget (GtkWidget *widget); -#ifndef GTK_DISABLE_DEPRECATED -#define gtk_menu_append(menu,child) gtk_menu_shell_append ((GtkMenuShell *)(menu),(child)) -#define gtk_menu_prepend(menu,child) gtk_menu_shell_prepend ((GtkMenuShell *)(menu),(child)) -#define gtk_menu_insert(menu,child,pos) gtk_menu_shell_insert ((GtkMenuShell *)(menu),(child),(pos)) -#endif /* GTK_DISABLE_DEPRECATED */ - void gtk_menu_set_reserve_toggle_size (GtkMenu *menu, gboolean reserve_toggle_size); gboolean gtk_menu_get_reserve_toggle_size (GtkMenu *menu); diff --git a/gtk/gtkmenubar.h b/gtk/gtkmenubar.h index 2acce0b172..050fb4846b 100644 --- a/gtk/gtkmenubar.h +++ b/gtk/gtkmenubar.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only <gtk/gtk.h> can be included directly." #endif @@ -75,12 +75,6 @@ GtkPackDirection gtk_menu_bar_get_child_pack_direction (GtkMenuBar *menuba void gtk_menu_bar_set_child_pack_direction (GtkMenuBar *menubar, GtkPackDirection child_pack_dir); -#ifndef GTK_DISABLE_DEPRECATED -#define gtk_menu_bar_append(menu,child) gtk_menu_shell_append ((GtkMenuShell *)(menu),(child)) -#define gtk_menu_bar_prepend(menu,child) gtk_menu_shell_prepend ((GtkMenuShell *)(menu),(child)) -#define gtk_menu_bar_insert(menu,child,pos) gtk_menu_shell_insert ((GtkMenuShell *)(menu),(child),(pos)) -#endif /* GTK_DISABLE_DEPRECATED */ - /* Private functions */ void _gtk_menu_bar_cycle_focus (GtkMenuBar *menubar, GtkDirectionType dir); diff --git a/gtk/gtkmenuitem.c b/gtk/gtkmenuitem.c index 8e03b99c73..76fab0d24d 100644 --- a/gtk/gtkmenuitem.c +++ b/gtk/gtkmenuitem.c @@ -812,24 +812,6 @@ gtk_menu_item_get_submenu (GtkMenuItem *menu_item) return menu_item->submenu; } -/** - * gtk_menu_item_remove_submenu: - * @menu_item: a #GtkMenuItem - * - * Removes the widget's submenu. - * - * Deprecated: 2.12: gtk_menu_item_remove_submenu() is deprecated and - * should not be used in newly written code. Use - * gtk_menu_item_set_submenu() instead. - **/ -void -gtk_menu_item_remove_submenu (GtkMenuItem *menu_item) -{ - g_return_if_fail (GTK_IS_MENU_ITEM (menu_item)); - - gtk_menu_item_set_submenu (menu_item, NULL); -} - void _gtk_menu_item_set_placement (GtkMenuItem *menu_item, GtkSubmenuPlacement placement); diff --git a/gtk/gtkmenuitem.h b/gtk/gtkmenuitem.h index b8a1f1a91f..6334785f1b 100644 --- a/gtk/gtkmenuitem.h +++ b/gtk/gtkmenuitem.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only <gtk/gtk.h> can be included directly." #endif @@ -135,11 +135,6 @@ void _gtk_menu_item_popup_submenu (GtkWidget *menu_item, gboolean with_delay); void _gtk_menu_item_popdown_submenu (GtkWidget *menu_item); -#ifndef GTK_DISABLE_DEPRECATED -void gtk_menu_item_remove_submenu (GtkMenuItem *menu_item); -#define gtk_menu_item_right_justify(menu_item) gtk_menu_item_set_right_justified ((menu_item), TRUE) -#endif /* GTK_DISABLE_DEPRECATED */ - G_END_DECLS #endif /* __GTK_MENU_ITEM_H__ */ diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c index c3e107fa1c..615f9a45c5 100644 --- a/gtk/gtkmenushell.c +++ b/gtk/gtkmenushell.c @@ -135,6 +135,9 @@ struct _GtkMenuShellPrivate GtkMnemonicHash *mnemonic_hash; GtkKeyHash *key_hash; + GdkDevice *grab_keyboard; + GdkDevice *grab_pointer; + guint take_focus : 1; guint activated_submenu : 1; /* This flag is a crutch to keep mnemonics in the same menu @@ -548,7 +551,9 @@ _gtk_menu_shell_activate (GtkMenuShell *menu_shell) { if (!menu_shell->active) { - gtk_grab_add (GTK_WIDGET (menu_shell)); + gtk_device_grab_add (GTK_WIDGET (menu_shell), + gtk_get_current_event_device (), + TRUE); menu_shell->have_grab = TRUE; menu_shell->active = TRUE; } @@ -1073,6 +1078,8 @@ gtk_real_menu_shell_deactivate (GtkMenuShell *menu_shell) { if (menu_shell->active) { + GtkMenuShellPrivate *priv = GTK_MENU_SHELL_GET_PRIVATE (menu_shell); + menu_shell->button = 0; menu_shell->active = FALSE; menu_shell->activate_time = 0; @@ -1086,15 +1093,16 @@ gtk_real_menu_shell_deactivate (GtkMenuShell *menu_shell) if (menu_shell->have_grab) { menu_shell->have_grab = FALSE; - gtk_grab_remove (GTK_WIDGET (menu_shell)); + gtk_device_grab_remove (GTK_WIDGET (menu_shell), priv->grab_pointer); } if (menu_shell->have_xgrab) { - GdkDisplay *display = gtk_widget_get_display (GTK_WIDGET (menu_shell)); + gdk_device_ungrab (priv->grab_pointer, GDK_CURRENT_TIME); + gdk_device_ungrab (priv->grab_keyboard, GDK_CURRENT_TIME); menu_shell->have_xgrab = FALSE; - gdk_display_pointer_ungrab (display, GDK_CURRENT_TIME); - gdk_display_keyboard_ungrab (display, GDK_CURRENT_TIME); + priv->grab_pointer = NULL; + priv->grab_keyboard = NULL; } menu_shell->keyboard_mode = FALSE; @@ -1743,6 +1751,39 @@ _gtk_menu_shell_remove_mnemonic (GtkMenuShell *menu_shell, gtk_menu_shell_reset_key_hash (menu_shell); } +void +_gtk_menu_shell_set_grab_devices (GtkMenuShell *menu_shell, + GdkDevice *keyboard, + GdkDevice *pointer) +{ + GtkMenuShellPrivate *priv = GTK_MENU_SHELL_GET_PRIVATE (menu_shell); + + g_return_if_fail (GTK_IS_MENU_SHELL (menu_shell)); + g_return_if_fail (!keyboard || GDK_IS_DEVICE (keyboard)); + g_return_if_fail (!pointer || GDK_IS_DEVICE (pointer)); + + priv->grab_keyboard = keyboard; + priv->grab_pointer = pointer; +} + +gboolean +_gtk_menu_shell_get_grab_devices (GtkMenuShell *menu_shell, + GdkDevice **keyboard, + GdkDevice **pointer) +{ + GtkMenuShellPrivate *priv = GTK_MENU_SHELL_GET_PRIVATE (menu_shell); + + g_return_val_if_fail (GTK_IS_MENU_SHELL (menu_shell), FALSE); + + if (keyboard) + *keyboard = priv->grab_keyboard; + + if (pointer) + *pointer = priv->grab_pointer; + + return TRUE; +} + /** * gtk_menu_shell_get_take_focus: * @menu_shell: a #GtkMenuShell diff --git a/gtk/gtkmenushell.h b/gtk/gtkmenushell.h index 614d3975f2..f8c5a32c54 100644 --- a/gtk/gtkmenushell.h +++ b/gtk/gtkmenushell.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only <gtk/gtk.h> can be included directly." #endif @@ -118,6 +118,14 @@ void _gtk_menu_shell_select_last (GtkMenuShell *menu_shell, gboolean search_sensitive); void _gtk_menu_shell_activate (GtkMenuShell *menu_shell); gint _gtk_menu_shell_get_popup_delay (GtkMenuShell *menu_shell); + +void _gtk_menu_shell_set_grab_devices (GtkMenuShell *menu_shell, + GdkDevice *keyboard, + GdkDevice *pointer); +gboolean _gtk_menu_shell_get_grab_devices (GtkMenuShell *menu_shell, + GdkDevice **keyboard, + GdkDevice **pointer); + void gtk_menu_shell_cancel (GtkMenuShell *menu_shell); void _gtk_menu_shell_add_mnemonic (GtkMenuShell *menu_shell, diff --git a/gtk/gtkmenutoolbutton.c b/gtk/gtkmenutoolbutton.c index 3e3cf07751..460423d348 100644 --- a/gtk/gtkmenutoolbutton.c +++ b/gtk/gtkmenutoolbutton.c @@ -21,8 +21,6 @@ #include "config.h" -#undef GTK_DISABLE_DEPRECATED /* GtkTooltips */ - #include "gtkmenutoolbutton.h" #include "gtktogglebutton.h" #include "gtkarrow.h" @@ -592,40 +590,13 @@ gtk_menu_tool_button_get_menu (GtkMenuToolButton *button) return GTK_WIDGET (button->priv->menu); } -/** - * gtk_menu_tool_button_set_arrow_tooltip: - * @button: a #GtkMenuToolButton - * @tooltips: the #GtkTooltips object to be used - * @tip_text: (allow-none): text to be used as tooltip text for tool_item - * @tip_private: (allow-none): text to be used as private tooltip text - * - * Sets the #GtkTooltips object to be used for arrow button which - * pops up the menu. See gtk_tool_item_set_tooltip() for setting - * a tooltip on the whole #GtkMenuToolButton. - * - * Since: 2.6 - * - * Deprecated: 2.12: Use gtk_menu_tool_button_set_arrow_tooltip_text() - * instead. - **/ -void -gtk_menu_tool_button_set_arrow_tooltip (GtkMenuToolButton *button, - GtkTooltips *tooltips, - const gchar *tip_text, - const gchar *tip_private) -{ - g_return_if_fail (GTK_IS_MENU_TOOL_BUTTON (button)); - - gtk_tooltips_set_tip (tooltips, button->priv->arrow_button, tip_text, tip_private); -} - /** * gtk_menu_tool_button_set_arrow_tooltip_text: * @button: a #GtkMenuToolButton * @text: text to be used as tooltip text for button's arrow button * * Sets the tooltip text to be used as tooltip for the arrow button which - * pops up the menu. See gtk_tool_item_set_tooltip() for setting a tooltip + * pops up the menu. See gtk_tool_item_set_tooltip_text() for setting a tooltip * on the whole #GtkMenuToolButton. * * Since: 2.12 @@ -645,7 +616,7 @@ gtk_menu_tool_button_set_arrow_tooltip_text (GtkMenuToolButton *button, * @markup: markup text to be used as tooltip text for button's arrow button * * Sets the tooltip markup text to be used as tooltip for the arrow button - * which pops up the menu. See gtk_tool_item_set_tooltip() for setting a + * which pops up the menu. See gtk_tool_item_set_tooltip_text() for setting a * tooltip on the whole #GtkMenuToolButton. * * Since: 2.12 diff --git a/gtk/gtkmenutoolbutton.h b/gtk/gtkmenutoolbutton.h index ec50e34017..916e6acf7b 100644 --- a/gtk/gtkmenutoolbutton.h +++ b/gtk/gtkmenutoolbutton.h @@ -19,7 +19,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only <gtk/gtk.h> can be included directly." #endif @@ -71,14 +71,6 @@ GtkToolItem *gtk_menu_tool_button_new_from_stock (const gchar *stock_id); void gtk_menu_tool_button_set_menu (GtkMenuToolButton *button, GtkWidget *menu); GtkWidget *gtk_menu_tool_button_get_menu (GtkMenuToolButton *button); - -#ifndef GTK_DISABLE_DEPRECATED -void gtk_menu_tool_button_set_arrow_tooltip (GtkMenuToolButton *button, - GtkTooltips *tooltips, - const gchar *tip_text, - const gchar *tip_private); -#endif /* GTK_DISABLE_DEPRECATED */ - void gtk_menu_tool_button_set_arrow_tooltip_text (GtkMenuToolButton *button, const gchar *text); void gtk_menu_tool_button_set_arrow_tooltip_markup (GtkMenuToolButton *button, diff --git a/gtk/gtkmessagedialog.c b/gtk/gtkmessagedialog.c index 71a4098b54..18adeea2a0 100644 --- a/gtk/gtkmessagedialog.c +++ b/gtk/gtkmessagedialog.c @@ -40,6 +40,53 @@ #include "gtkprivate.h" #include "gtkalias.h" +/** + * SECTION:gtkmessagedialog + * @Short_description: A convenient message window + * @Title: GtkMessageDialog + * @See_also:#GtkDialog + * + * #GtkMessageDialog presents a dialog with an image representing the type of + * message (Error, Question, etc.) alongside some message text. It's simply a + * convenience widget; you could construct the equivalent of #GtkMessageDialog + * from #GtkDialog without too much effort, but #GtkMessageDialog saves typing. + * + * The easiest way to do a modal message dialog is to use gtk_dialog_run(), though + * you can also pass in the %GTK_DIALOG_MODAL flag, gtk_dialog_run() automatically + * makes the dialog modal and waits for the user to respond to it. gtk_dialog_run() + * returns when any dialog button is clicked. + * <example> + * <title>A modal dialog. + * + * dialog = gtk_message_dialog_new (main_application_window, + * GTK_DIALOG_DESTROY_WITH_PARENT, + * GTK_MESSAGE_ERROR, + * GTK_BUTTONS_CLOSE, + * "Error loading file '%s': %s", + * filename, g_strerror (errno)); + * gtk_dialog_run (GTK_DIALOG (dialog)); + * gtk_widget_destroy (dialog); + * + * + * You might do a non-modal #GtkMessageDialog as follows: + * + * A non-modal dialog. + * + * dialog = gtk_message_dialog_new (main_application_window, + * GTK_DIALOG_DESTROY_WITH_PARENT, + * GTK_MESSAGE_ERROR, + * GTK_BUTTONS_CLOSE, + * "Error loading file '%s': %s", + * filename, g_strerror (errno)); + * + * /* Destroy the dialog when the user responds to it (e.g. clicks a button) */ + * g_signal_connect_swapped (dialog, "response", + * G_CALLBACK (gtk_widget_destroy), + * dialog); + * + * + */ + #define GTK_MESSAGE_DIALOG_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_MESSAGE_DIALOG, GtkMessageDialogPrivate)) typedef struct _GtkMessageDialogPrivate GtkMessageDialogPrivate; diff --git a/gtk/gtkmessagedialog.h b/gtk/gtkmessagedialog.h index 1bb1ec5fc2..c4ef610693 100644 --- a/gtk/gtkmessagedialog.h +++ b/gtk/gtkmessagedialog.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -36,15 +36,6 @@ G_BEGIN_DECLS -typedef enum -{ - GTK_BUTTONS_NONE, - GTK_BUTTONS_OK, - GTK_BUTTONS_CLOSE, - GTK_BUTTONS_CANCEL, - GTK_BUTTONS_YES_NO, - GTK_BUTTONS_OK_CANCEL -} GtkButtonsType; #define GTK_TYPE_MESSAGE_DIALOG (gtk_message_dialog_get_type ()) #define GTK_MESSAGE_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_MESSAGE_DIALOG, GtkMessageDialog)) @@ -77,6 +68,34 @@ struct _GtkMessageDialogClass void (*_gtk_reserved4) (void); }; +/** + * GtkButtonsType: + * @GTK_BUTTONS_NONE: no buttons at all + * @GTK_BUTTONS_OK: an OK button + * @GTK_BUTTONS_CLOSE: a Close button + * @GTK_BUTTONS_CANCEL: a Cancel button + * @GTK_BUTTONS_YES_NO: Yes and No buttons + * @GTK_BUTTONS_OK_CANCEL: OK and Cancel buttons + * + * Prebuilt sets of buttons for the dialog. If + * none of these choices are appropriate, simply use %GTK_BUTTONS_NONE + * then call gtk_dialog_add_buttons(). + * + * Please note that %GTK_BUTTONS_OK, %GTK_BUTTONS_YES_NO + * and %GTK_BUTTONS_OK_CANCEL are discouraged by the + * GNOME HIG. + * + */ +typedef enum +{ + GTK_BUTTONS_NONE, + GTK_BUTTONS_OK, + GTK_BUTTONS_CLOSE, + GTK_BUTTONS_CANCEL, + GTK_BUTTONS_YES_NO, + GTK_BUTTONS_OK_CANCEL +} GtkButtonsType; + GType gtk_message_dialog_get_type (void) G_GNUC_CONST; GtkWidget* gtk_message_dialog_new (GtkWindow *parent, diff --git a/gtk/gtkmisc.h b/gtk/gtkmisc.h index 477c73b605..0cb14163de 100644 --- a/gtk/gtkmisc.h +++ b/gtk/gtkmisc.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkmodules.c b/gtk/gtkmodules.c index a6b40d88b5..b0b0e7e18a 100644 --- a/gtk/gtkmodules.c +++ b/gtk/gtkmodules.c @@ -66,15 +66,15 @@ get_module_path (void) home_dir = g_get_home_dir(); if (home_dir) - home_gtk_dir = g_build_filename (home_dir, ".gtk-2.0", NULL); + home_gtk_dir = g_build_filename (home_dir, ".gtk-3.0", NULL); module_path_env = g_getenv ("GTK_PATH"); exe_prefix = g_getenv ("GTK_EXE_PREFIX"); if (exe_prefix) - default_dir = g_build_filename (exe_prefix, "lib", "gtk-2.0", NULL); + default_dir = g_build_filename (exe_prefix, "lib", "gtk-3.0", NULL); else - default_dir = g_build_filename (GTK_LIBDIR, "gtk-2.0", NULL); + default_dir = g_build_filename (GTK_LIBDIR, "gtk-3.0", NULL); if (module_path_env && home_gtk_dir) module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S, diff --git a/gtk/gtkmodules.h b/gtk/gtkmodules.h index 84bc86ca63..ca1c52e431 100644 --- a/gtk/gtkmodules.h +++ b/gtk/gtkmodules.h @@ -18,7 +18,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index d038cc5f53..bb528fdf07 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -105,14 +105,9 @@ enum { PROP_SHOW_TABS, PROP_SHOW_BORDER, PROP_SCROLLABLE, - PROP_TAB_BORDER, - PROP_TAB_HBORDER, - PROP_TAB_VBORDER, PROP_PAGE, PROP_ENABLE_POPUP, - PROP_GROUP_ID, PROP_GROUP, - PROP_HOMOGENEOUS }; enum { @@ -417,15 +412,6 @@ static void gtk_notebook_menu_detacher (GtkWidget *widget, GtkMenu *menu); /*** GtkNotebook Private Setters ***/ -static void gtk_notebook_set_homogeneous_tabs_internal (GtkNotebook *notebook, - gboolean homogeneous); -static void gtk_notebook_set_tab_border_internal (GtkNotebook *notebook, - guint border_width); -static void gtk_notebook_set_tab_hborder_internal (GtkNotebook *notebook, - guint tab_hborder); -static void gtk_notebook_set_tab_vborder_internal (GtkNotebook *notebook, - guint tab_vborder); - static void gtk_notebook_update_tab_states (GtkNotebook *notebook); static gboolean gtk_notebook_mnemonic_activate_switch_page (GtkWidget *child, gboolean overload, @@ -596,33 +582,6 @@ gtk_notebook_class_init (GtkNotebookClass *class) GTK_TYPE_POSITION_TYPE, GTK_POS_TOP, GTK_PARAM_READWRITE)); - g_object_class_install_property (gobject_class, - PROP_TAB_BORDER, - g_param_spec_uint ("tab-border", - P_("Tab Border"), - P_("Width of the border around the tab labels"), - 0, - G_MAXUINT, - 2, - GTK_PARAM_WRITABLE)); - g_object_class_install_property (gobject_class, - PROP_TAB_HBORDER, - g_param_spec_uint ("tab-hborder", - P_("Horizontal Tab Border"), - P_("Width of the horizontal border of tab labels"), - 0, - G_MAXUINT, - 2, - GTK_PARAM_READWRITE)); - g_object_class_install_property (gobject_class, - PROP_TAB_VBORDER, - g_param_spec_uint ("tab-vborder", - P_("Vertical Tab Border"), - P_("Width of the vertical border of tab labels"), - 0, - G_MAXUINT, - 2, - GTK_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_SHOW_TABS, g_param_spec_boolean ("show-tabs", @@ -651,22 +610,6 @@ gtk_notebook_class_init (GtkNotebookClass *class) P_("If TRUE, pressing the right mouse button on the notebook pops up a menu that you can use to go to a page"), FALSE, GTK_PARAM_READWRITE)); - g_object_class_install_property (gobject_class, - PROP_HOMOGENEOUS, - g_param_spec_boolean ("homogeneous", - P_("Homogeneous"), - P_("Whether tabs should have homogeneous sizes"), - FALSE, - GTK_PARAM_READWRITE)); - g_object_class_install_property (gobject_class, - PROP_GROUP_ID, - g_param_spec_int ("group-id", - P_("Group ID"), - P_("Group ID for tabs drag and drop"), - -1, - G_MAXINT, - -1, - GTK_PARAM_READWRITE)); /** * GtkNotebook:group: @@ -1530,27 +1473,12 @@ gtk_notebook_set_property (GObject *object, else gtk_notebook_popup_disable (notebook); break; - case PROP_HOMOGENEOUS: - gtk_notebook_set_homogeneous_tabs_internal (notebook, g_value_get_boolean (value)); - break; case PROP_PAGE: gtk_notebook_set_current_page (notebook, g_value_get_int (value)); break; case PROP_TAB_POS: gtk_notebook_set_tab_pos (notebook, g_value_get_enum (value)); break; - case PROP_TAB_BORDER: - gtk_notebook_set_tab_border_internal (notebook, g_value_get_uint (value)); - break; - case PROP_TAB_HBORDER: - gtk_notebook_set_tab_hborder_internal (notebook, g_value_get_uint (value)); - break; - case PROP_TAB_VBORDER: - gtk_notebook_set_tab_vborder_internal (notebook, g_value_get_uint (value)); - break; - case PROP_GROUP_ID: - gtk_notebook_set_group_id (notebook, g_value_get_int (value)); - break; case PROP_GROUP: gtk_notebook_set_group (notebook, g_value_get_pointer (value)); break; @@ -1586,24 +1514,12 @@ gtk_notebook_get_property (GObject *object, case PROP_ENABLE_POPUP: g_value_set_boolean (value, notebook->menu != NULL); break; - case PROP_HOMOGENEOUS: - g_value_set_boolean (value, notebook->homogeneous); - break; case PROP_PAGE: g_value_set_int (value, gtk_notebook_get_current_page (notebook)); break; case PROP_TAB_POS: g_value_set_enum (value, notebook->tab_pos); break; - case PROP_TAB_HBORDER: - g_value_set_uint (value, notebook->tab_hborder); - break; - case PROP_TAB_VBORDER: - g_value_set_uint (value, notebook->tab_vborder); - break; - case PROP_GROUP_ID: - g_value_set_int (value, gtk_notebook_get_group_id (notebook)); - break; case PROP_GROUP: g_value_set_pointer (value, priv->group); break; @@ -2835,7 +2751,8 @@ get_drop_position (GtkNotebook *notebook, static void show_drag_window (GtkNotebook *notebook, GtkNotebookPrivate *priv, - GtkNotebookPage *page) + GtkNotebookPage *page, + GdkDevice *device) { GtkWidget *widget = GTK_WIDGET (notebook); @@ -2870,10 +2787,10 @@ show_drag_window (GtkNotebook *notebook, gdk_window_show (priv->drag_window); /* the grab will dissapear when the window is hidden */ - gdk_pointer_grab (priv->drag_window, - FALSE, - GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK, - NULL, NULL, GDK_CURRENT_TIME); + gdk_device_grab (device, priv->drag_window, + GDK_OWNERSHIP_WINDOW, FALSE, + GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK, + NULL, GDK_CURRENT_TIME); } /* This function undoes the reparenting that happens both when drag_window @@ -3213,7 +3130,7 @@ gtk_notebook_motion_notify (GtkWidget *widget, if (priv->operation != DRAG_OPERATION_REORDER) { priv->operation = DRAG_OPERATION_REORDER; - show_drag_window (notebook, priv, page); + show_drag_window (notebook, priv, page, event->device); } gtk_notebook_pages_allocate (notebook); @@ -3833,7 +3750,7 @@ gtk_notebook_get_child_property (GtkContainer *container, label = gtk_notebook_get_tab_label (notebook, child); if (GTK_IS_LABEL (label)) - g_value_set_string (value, GTK_LABEL (label)->label); + g_value_set_string (value, gtk_label_get_label (GTK_LABEL (label))); else g_value_set_string (value, NULL); break; @@ -3841,7 +3758,7 @@ gtk_notebook_get_child_property (GtkContainer *container, label = gtk_notebook_get_menu_label (notebook, child); if (GTK_IS_LABEL (label)) - g_value_set_string (value, GTK_LABEL (label)->label); + g_value_set_string (value, gtk_label_get_label (GTK_LABEL (label))); else g_value_set_string (value, NULL); break; @@ -4727,7 +4644,7 @@ gtk_notebook_update_labels (GtkNotebook *notebook) { if (GTK_IS_LABEL (page->tab_label)) gtk_label_set_text (GTK_LABEL (page->menu_label), - GTK_LABEL (page->tab_label)->label); + gtk_label_get_label (GTK_LABEL (page->tab_label))); else gtk_label_set_text (GTK_LABEL (page->menu_label), string); } @@ -6273,7 +6190,7 @@ gtk_notebook_menu_item_create (GtkNotebook *notebook, if (page->default_menu) { if (GTK_IS_LABEL (page->tab_label)) - page->menu_label = gtk_label_new (GTK_LABEL (page->tab_label)->label); + page->menu_label = gtk_label_new (gtk_label_get_label (GTK_LABEL (page->tab_label))); else page->menu_label = gtk_label_new (""); gtk_misc_set_alignment (GTK_MISC (page->menu_label), 0.0, 0.5); @@ -6310,75 +6227,6 @@ gtk_notebook_menu_detacher (GtkWidget *widget, notebook->menu = NULL; } -/* Private GtkNotebook Setter Functions: - * - * gtk_notebook_set_homogeneous_tabs_internal - * gtk_notebook_set_tab_border_internal - * gtk_notebook_set_tab_hborder_internal - * gtk_notebook_set_tab_vborder_internal - */ -static void -gtk_notebook_set_homogeneous_tabs_internal (GtkNotebook *notebook, - gboolean homogeneous) -{ - if (homogeneous == notebook->homogeneous) - return; - - notebook->homogeneous = homogeneous; - gtk_widget_queue_resize (GTK_WIDGET (notebook)); - - g_object_notify (G_OBJECT (notebook), "homogeneous"); -} - -static void -gtk_notebook_set_tab_border_internal (GtkNotebook *notebook, - guint border_width) -{ - notebook->tab_hborder = border_width; - notebook->tab_vborder = border_width; - - if (notebook->show_tabs && - gtk_widget_get_visible (GTK_WIDGET (notebook))) - gtk_widget_queue_resize (GTK_WIDGET (notebook)); - - g_object_freeze_notify (G_OBJECT (notebook)); - g_object_notify (G_OBJECT (notebook), "tab-hborder"); - g_object_notify (G_OBJECT (notebook), "tab-vborder"); - g_object_thaw_notify (G_OBJECT (notebook)); -} - -static void -gtk_notebook_set_tab_hborder_internal (GtkNotebook *notebook, - guint tab_hborder) -{ - if (notebook->tab_hborder == tab_hborder) - return; - - notebook->tab_hborder = tab_hborder; - - if (notebook->show_tabs && - gtk_widget_get_visible (GTK_WIDGET (notebook))) - gtk_widget_queue_resize (GTK_WIDGET (notebook)); - - g_object_notify (G_OBJECT (notebook), "tab-hborder"); -} - -static void -gtk_notebook_set_tab_vborder_internal (GtkNotebook *notebook, - guint tab_vborder) -{ - if (notebook->tab_vborder == tab_vborder) - return; - - notebook->tab_vborder = tab_vborder; - - if (notebook->show_tabs && - gtk_widget_get_visible (GTK_WIDGET (notebook))) - gtk_widget_queue_resize (GTK_WIDGET (notebook)); - - g_object_notify (G_OBJECT (notebook), "tab-vborder"); -} - /* Public GtkNotebook Page Insert/Remove Methods : * * gtk_notebook_append_page @@ -6999,73 +6847,6 @@ gtk_notebook_get_tab_pos (GtkNotebook *notebook) return notebook->tab_pos; } -/** - * gtk_notebook_set_homogeneous_tabs: - * @notebook: a #GtkNotebook - * @homogeneous: %TRUE if all tabs should be the same size. - * - * Sets whether the tabs must have all the same size or not. - **/ -void -gtk_notebook_set_homogeneous_tabs (GtkNotebook *notebook, - gboolean homogeneous) -{ - g_return_if_fail (GTK_IS_NOTEBOOK (notebook)); - - gtk_notebook_set_homogeneous_tabs_internal (notebook, homogeneous); -} - -/** - * gtk_notebook_set_tab_border: - * @notebook: a #GtkNotebook - * @border_width: width of the border around the tab labels. - * - * Sets the width the border around the tab labels - * in a notebook. This is equivalent to calling - * gtk_notebook_set_tab_hborder (@notebook, @border_width) followed - * by gtk_notebook_set_tab_vborder (@notebook, @border_width). - **/ -void -gtk_notebook_set_tab_border (GtkNotebook *notebook, - guint border_width) -{ - g_return_if_fail (GTK_IS_NOTEBOOK (notebook)); - - gtk_notebook_set_tab_border_internal (notebook, border_width); -} - -/** - * gtk_notebook_set_tab_hborder: - * @notebook: a #GtkNotebook - * @tab_hborder: width of the horizontal border of tab labels. - * - * Sets the width of the horizontal border of tab labels. - **/ -void -gtk_notebook_set_tab_hborder (GtkNotebook *notebook, - guint tab_hborder) -{ - g_return_if_fail (GTK_IS_NOTEBOOK (notebook)); - - gtk_notebook_set_tab_hborder_internal (notebook, tab_hborder); -} - -/** - * gtk_notebook_set_tab_vborder: - * @notebook: a #GtkNotebook - * @tab_vborder: width of the vertical border of tab labels. - * - * Sets the width of the vertical border of tab labels. - **/ -void -gtk_notebook_set_tab_vborder (GtkNotebook *notebook, - guint tab_vborder) -{ - g_return_if_fail (GTK_IS_NOTEBOOK (notebook)); - - gtk_notebook_set_tab_vborder_internal (notebook, tab_vborder); -} - /** * gtk_notebook_set_scrollable: * @notebook: a #GtkNotebook @@ -7686,32 +7467,6 @@ gtk_notebook_set_window_creation_hook (GtkNotebookWindowCreationFunc func, window_creation_hook_destroy = destroy; } -/** - * gtk_notebook_set_group_id: - * @notebook: a #GtkNotebook - * @group_id: a group identificator, or -1 to unset it - * - * Sets an group identificator for @notebook, notebooks sharing - * the same group identificator will be able to exchange tabs - * via drag and drop. A notebook with group identificator -1 will - * not be able to exchange tabs with any other notebook. - * - * Since: 2.10 - * Deprecated: 2.12: use gtk_notebook_set_group() instead. - */ -void -gtk_notebook_set_group_id (GtkNotebook *notebook, - gint group_id) -{ - gpointer group; - - g_return_if_fail (GTK_IS_NOTEBOOK (notebook)); - - /* add 1 to get rid of the -1/NULL difference */ - group = GINT_TO_POINTER (group_id + 1); - gtk_notebook_set_group (notebook, group); -} - /** * gtk_notebook_set_group: * @notebook: a #GtkNotebook @@ -7742,30 +7497,6 @@ gtk_notebook_set_group (GtkNotebook *notebook, } } -/** - * gtk_notebook_get_group_id: - * @notebook: a #GtkNotebook - * - * Gets the current group identificator for @notebook. - * - * Return Value: the group identificator, or -1 if none is set. - * - * Since: 2.10 - * Deprecated: 2.12: use gtk_notebook_get_group() instead. - */ -gint -gtk_notebook_get_group_id (GtkNotebook *notebook) -{ - GtkNotebookPrivate *priv; - - g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), -1); - - priv = GTK_NOTEBOOK_GET_PRIVATE (notebook); - - /* substract 1 to get rid of the -1/NULL difference */ - return GPOINTER_TO_INT (priv->group) - 1; -} - /** * gtk_notebook_get_group: * @notebook: a #GtkNotebook diff --git a/gtk/gtknotebook.h b/gtk/gtknotebook.h index 0a14a75617..e58bc5d2d2 100644 --- a/gtk/gtknotebook.h +++ b/gtk/gtknotebook.h @@ -25,7 +25,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -173,13 +173,6 @@ void gtk_notebook_remove_page (GtkNotebook *notebook, void gtk_notebook_set_window_creation_hook (GtkNotebookWindowCreationFunc func, gpointer data, GDestroyNotify destroy); -#ifndef GTK_DISABLE_DEPRECATED -void gtk_notebook_set_group_id (GtkNotebook *notebook, - gint group_id); -gint gtk_notebook_get_group_id (GtkNotebook *notebook); - -#endif /* GTK_DISABLE_DEPRECATED */ - void gtk_notebook_set_group (GtkNotebook *notebook, gpointer group); gpointer gtk_notebook_get_group (GtkNotebook *notebook); @@ -214,18 +207,6 @@ gboolean gtk_notebook_get_show_tabs (GtkNotebook *notebook); void gtk_notebook_set_tab_pos (GtkNotebook *notebook, GtkPositionType pos); GtkPositionType gtk_notebook_get_tab_pos (GtkNotebook *notebook); - -#ifndef GTK_DISABLE_DEPRECATED -void gtk_notebook_set_homogeneous_tabs (GtkNotebook *notebook, - gboolean homogeneous); -void gtk_notebook_set_tab_border (GtkNotebook *notebook, - guint border_width); -void gtk_notebook_set_tab_hborder (GtkNotebook *notebook, - guint tab_hborder); -void gtk_notebook_set_tab_vborder (GtkNotebook *notebook, - guint tab_vborder); -#endif /* GTK_DISABLE_DEPRECATED */ - void gtk_notebook_set_scrollable (GtkNotebook *notebook, gboolean scrollable); gboolean gtk_notebook_get_scrollable (GtkNotebook *notebook); @@ -293,11 +274,6 @@ void gtk_notebook_set_action_widget (GtkNotebook *notebook, GtkWidget *widget, GtkPackType pack_type); -#ifndef GTK_DISABLE_DEPRECATED -#define gtk_notebook_current_page gtk_notebook_get_current_page -#define gtk_notebook_set_page gtk_notebook_set_current_page -#endif /* GTK_DISABLE_DEPRECATED */ - G_END_DECLS #endif /* __GTK_NOTEBOOK_H__ */ diff --git a/gtk/gtkobject.c b/gtk/gtkobject.c index d0e65ed0fd..e4bc937d4f 100644 --- a/gtk/gtkobject.c +++ b/gtk/gtkobject.c @@ -30,8 +30,6 @@ #include #include -#undef GTK_DISABLE_DEPRECATED - #include "gtkobject.h" #include "gtkintl.h" #include "gtkmarshalers.h" @@ -40,37 +38,87 @@ #include "gtkalias.h" +/** + * SECTION:gtkobject + * @Short_description: The base class of the GTK+ type hierarchy + * @Title: GtkObject + * @See_also:#GObject + * + * #GtkObject is the base class for all widgets, and for a few + * non-widget objects such as #GtkAdjustment. #GtkObject predates + * #GObject; non-widgets that derive from #GtkObject rather than + * #GObject do so for backward compatibility reasons. + * + * #GtkObjects are created with a "floating" reference count. + * This means that the initial reference is not owned by anyone. Calling + * g_object_unref() on a newly-created #GtkObject is incorrect, the floating + * reference has to be removed first. This can be done by anyone at any time, + * by calling g_object_ref_sink() to convert the floating reference into a + * regular reference. g_object_ref_sink() returns a new reference if an object + * is already sunk (has no floating reference). + * + * When you add a widget to its parent container, the parent container + * will do this: + * + * g_object_ref_sink (G_OBJECT (child_widget)); + * + * This means that the container now owns a reference to the child widget + * and the child widget has no floating reference. + * + * The purpose of the floating reference is to keep the child widget alive + * until you add it to a parent container: + * + * button = gtk_button_new (); + * /* button has one floating reference to keep it alive */ + * gtk_container_add (GTK_CONTAINER (container), button); + * /* button has one non-floating reference owned by the container */ + * + * + * #GtkWindow is a special case, because GTK+ itself will ref/sink it on creation. + * That is, after calling gtk_window_new(), the #GtkWindow will have one + * reference which is owned by GTK+, and no floating references. + * + * One more factor comes into play: the #GtkObject::destroy signal, emitted by the + * gtk_object_destroy() method. The #GtkObject::destroy signal asks all code owning a + * reference to an object to release said reference. So, for example, if you call + * gtk_object_destroy() on a #GtkWindow, GTK+ will release the reference count that + * it owns; if you call gtk_object_destroy() on a #GtkButton, then the button will + * be removed from its parent container and the parent container will release its + * reference to the button. Because these references are released, calling + * gtk_object_destroy() should result in freeing all memory associated with an + * object, unless some buggy code fails to release its references in response to + * the #GtkObject::destroy signal. Freeing memory (referred to as + * finalization) only happens if the reference count reaches + * zero. + * + * Some simple rules for handling #GtkObject: + * + * + * Never call g_object_unref() unless you have previously called g_object_ref(), + * even if you created the #GtkObject. (Note: this is not + * true for #GObject; for #GObject, the creator of the object owns a reference.) + * + * + * Call gtk_object_destroy() to get rid of most objects in most cases. + * In particular, widgets are almost always destroyed in this way. + * + * Because of the floating reference count, you don't need to + * worry about reference counting for widgets and toplevel windows, unless you + * explicitly call g_object_ref() yourself. + * + */ + + enum { DESTROY, LAST_SIGNAL }; -enum { - PROP_0, - PROP_USER_DATA -}; - -static void gtk_object_base_class_init (GtkObjectClass *class); -static void gtk_object_base_class_finalize (GtkObjectClass *class); -static void gtk_object_class_init (GtkObjectClass *klass); -static void gtk_object_init (GtkObject *object, - GtkObjectClass *klass); -static void gtk_object_set_property (GObject *object, - guint property_id, - const GValue *value, - GParamSpec *pspec); -static void gtk_object_get_property (GObject *object, - guint property_id, - GValue *value, - GParamSpec *pspec); -static void gtk_object_dispose (GObject *object); +static void gtk_object_dispose (GObject *object); static void gtk_object_real_destroy (GtkObject *object); static void gtk_object_finalize (GObject *object); -static void gtk_object_notify_weaks (GtkObject *object); -static gpointer parent_class = NULL; static guint object_signals[LAST_SIGNAL] = { 0 }; -static GQuark quark_weakrefs = 0; /**************************************************** @@ -78,298 +126,31 @@ static GQuark quark_weakrefs = 0; * ****************************************************/ -GType -gtk_object_get_type (void) -{ - static GType object_type = 0; - - if (!object_type) - { - const GTypeInfo object_info = - { - sizeof (GtkObjectClass), - (GBaseInitFunc) gtk_object_base_class_init, - (GBaseFinalizeFunc) gtk_object_base_class_finalize, - (GClassInitFunc) gtk_object_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof (GtkObject), - 16, /* n_preallocs */ - (GInstanceInitFunc) gtk_object_init, - NULL, /* value_table */ - }; - - object_type = g_type_register_static (G_TYPE_INITIALLY_UNOWNED, I_("GtkObject"), - &object_info, G_TYPE_FLAG_ABSTRACT); - } - - return object_type; -} +G_DEFINE_ABSTRACT_TYPE (GtkObject, gtk_object, G_TYPE_INITIALLY_UNOWNED); static void -gtk_object_base_class_init (GtkObjectClass *class) +gtk_object_init (GtkObject *object) { - /* reset instance specifc methods that don't get inherited */ - class->get_arg = NULL; - class->set_arg = NULL; -} - -static void -gtk_object_base_class_finalize (GtkObjectClass *class) -{ -} - -static inline gboolean -gtk_arg_set_from_value (GtkArg *arg, - const GValue *value, - gboolean copy_string) -{ - switch (G_TYPE_FUNDAMENTAL (arg->type)) - { - case G_TYPE_CHAR: GTK_VALUE_CHAR (*arg) = g_value_get_char (value); break; - case G_TYPE_UCHAR: GTK_VALUE_UCHAR (*arg) = g_value_get_uchar (value); break; - case G_TYPE_BOOLEAN: GTK_VALUE_BOOL (*arg) = g_value_get_boolean (value); break; - case G_TYPE_INT: GTK_VALUE_INT (*arg) = g_value_get_int (value); break; - case G_TYPE_UINT: GTK_VALUE_UINT (*arg) = g_value_get_uint (value); break; - case G_TYPE_LONG: GTK_VALUE_LONG (*arg) = g_value_get_long (value); break; - case G_TYPE_ULONG: GTK_VALUE_ULONG (*arg) = g_value_get_ulong (value); break; - case G_TYPE_ENUM: GTK_VALUE_ENUM (*arg) = g_value_get_enum (value); break; - case G_TYPE_FLAGS: GTK_VALUE_FLAGS (*arg) = g_value_get_flags (value); break; - case G_TYPE_FLOAT: GTK_VALUE_FLOAT (*arg) = g_value_get_float (value); break; - case G_TYPE_DOUBLE: GTK_VALUE_DOUBLE (*arg) = g_value_get_double (value); break; - case G_TYPE_BOXED: GTK_VALUE_BOXED (*arg) = g_value_get_boxed (value); break; - case G_TYPE_POINTER: GTK_VALUE_POINTER (*arg) = g_value_get_pointer (value); break; - case G_TYPE_OBJECT: GTK_VALUE_POINTER (*arg) = g_value_get_object (value); break; - case G_TYPE_STRING: if (copy_string) - GTK_VALUE_STRING (*arg) = g_value_dup_string (value); - else - GTK_VALUE_STRING (*arg) = (char *) g_value_get_string (value); - break; - default: - return FALSE; - } - return TRUE; -} - -static inline gboolean -gtk_arg_to_value (GtkArg *arg, - GValue *value) -{ - switch (G_TYPE_FUNDAMENTAL (arg->type)) - { - case G_TYPE_CHAR: g_value_set_char (value, GTK_VALUE_CHAR (*arg)); break; - case G_TYPE_UCHAR: g_value_set_uchar (value, GTK_VALUE_UCHAR (*arg)); break; - case G_TYPE_BOOLEAN: g_value_set_boolean (value, GTK_VALUE_BOOL (*arg)); break; - case G_TYPE_INT: g_value_set_int (value, GTK_VALUE_INT (*arg)); break; - case G_TYPE_UINT: g_value_set_uint (value, GTK_VALUE_UINT (*arg)); break; - case G_TYPE_LONG: g_value_set_long (value, GTK_VALUE_LONG (*arg)); break; - case G_TYPE_ULONG: g_value_set_ulong (value, GTK_VALUE_ULONG (*arg)); break; - case G_TYPE_ENUM: g_value_set_enum (value, GTK_VALUE_ENUM (*arg)); break; - case G_TYPE_FLAGS: g_value_set_flags (value, GTK_VALUE_FLAGS (*arg)); break; - case G_TYPE_FLOAT: g_value_set_float (value, GTK_VALUE_FLOAT (*arg)); break; - case G_TYPE_DOUBLE: g_value_set_double (value, GTK_VALUE_DOUBLE (*arg)); break; - case G_TYPE_STRING: g_value_set_string (value, GTK_VALUE_STRING (*arg)); break; - case G_TYPE_BOXED: g_value_set_boxed (value, GTK_VALUE_BOXED (*arg)); break; - case G_TYPE_POINTER: g_value_set_pointer (value, GTK_VALUE_POINTER (*arg)); break; - case G_TYPE_OBJECT: g_value_set_object (value, GTK_VALUE_POINTER (*arg)); break; - default: - return FALSE; - } - return TRUE; -} - -static void -gtk_arg_proxy_set_property (GObject *object, - guint property_id, - const GValue *value, - GParamSpec *pspec) -{ - GtkObjectClass *class = g_type_class_peek (pspec->owner_type); - GtkArg arg; - - g_return_if_fail (class->set_arg != NULL); - - memset (&arg, 0, sizeof (arg)); - arg.type = G_VALUE_TYPE (value); - gtk_arg_set_from_value (&arg, value, FALSE); - arg.name = pspec->name; - class->set_arg (GTK_OBJECT (object), &arg, property_id); -} - -static void -gtk_arg_proxy_get_property (GObject *object, - guint property_id, - GValue *value, - GParamSpec *pspec) -{ - GtkObjectClass *class = g_type_class_peek (pspec->owner_type); - GtkArg arg; - - g_return_if_fail (class->get_arg != NULL); - - memset (&arg, 0, sizeof (arg)); - arg.type = G_VALUE_TYPE (value); - arg.name = pspec->name; - class->get_arg (GTK_OBJECT (object), &arg, property_id); - gtk_arg_to_value (&arg, value); -} - -void -gtk_object_add_arg_type (const gchar *arg_name, - GType arg_type, - guint arg_flags, - guint arg_id) -{ - GObjectClass *oclass; - GParamSpec *pspec; - gchar *type_name, *pname; - GType type; - - g_return_if_fail (arg_name != NULL); - g_return_if_fail (arg_type > G_TYPE_NONE); - g_return_if_fail (arg_id > 0); - g_return_if_fail (arg_flags & G_PARAM_READWRITE); - if (arg_flags & G_PARAM_CONSTRUCT) - g_return_if_fail ((arg_flags & G_PARAM_CONSTRUCT_ONLY) == 0); - if (arg_flags & (G_PARAM_CONSTRUCT | G_PARAM_CONSTRUCT_ONLY)) - g_return_if_fail (arg_flags & G_PARAM_WRITABLE); - g_return_if_fail ((arg_flags & ~(G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_NAME)) == 0); - - pname = strchr (arg_name, ':'); - g_return_if_fail (pname && pname[1] == ':'); - - type_name = g_strndup (arg_name, pname - arg_name); - pname += 2; - type = g_type_from_name (type_name); - g_free (type_name); - g_return_if_fail (G_TYPE_IS_OBJECT (type)); - - oclass = gtk_type_class (type); - if (arg_flags & G_PARAM_READABLE) - { - if (oclass->get_property && oclass->get_property != gtk_arg_proxy_get_property) - { - g_warning (G_STRLOC ": GtkArg compatibility code can't be mixed with customized %s.get_property() implementation", - g_type_name (type)); - return; - } - oclass->get_property = gtk_arg_proxy_get_property; - } - if (arg_flags & G_PARAM_WRITABLE) - { - if (oclass->set_property && oclass->set_property != gtk_arg_proxy_set_property) - { - g_warning (G_STRLOC ": GtkArg compatibility code can't be mixed with customized %s.set_property() implementation", - g_type_name (type)); - return; - } - oclass->set_property = gtk_arg_proxy_set_property; - } - switch (G_TYPE_FUNDAMENTAL (arg_type)) - { - case G_TYPE_ENUM: - pspec = g_param_spec_enum (pname, NULL, NULL, arg_type, 0, arg_flags); - break; - case G_TYPE_FLAGS: - pspec = g_param_spec_flags (pname, NULL, NULL, arg_type, 0, arg_flags); - break; - case G_TYPE_CHAR: - pspec = g_param_spec_char (pname, NULL, NULL, -128, 127, 0, arg_flags); - break; - case G_TYPE_UCHAR: - pspec = g_param_spec_uchar (pname, NULL, NULL, 0, 255, 0, arg_flags); - break; - case G_TYPE_BOOLEAN: - pspec = g_param_spec_boolean (pname, NULL, NULL, FALSE, arg_flags); - break; - case G_TYPE_INT: - pspec = g_param_spec_int (pname, NULL, NULL, G_MININT, G_MAXINT, 0, arg_flags); - break; - case G_TYPE_UINT: - pspec = g_param_spec_uint (pname, NULL, NULL, 0, G_MAXUINT, 0, arg_flags); - break; - case G_TYPE_FLOAT: - pspec = g_param_spec_float (pname, NULL, NULL, -G_MAXFLOAT, G_MAXFLOAT, 0, arg_flags); - break; - case G_TYPE_DOUBLE: - pspec = g_param_spec_double (pname, NULL, NULL, -G_MAXDOUBLE, G_MAXDOUBLE, 0, arg_flags); - break; - case G_TYPE_STRING: - pspec = g_param_spec_string (pname, NULL, NULL, NULL, arg_flags); - break; - case G_TYPE_POINTER: - pspec = g_param_spec_pointer (pname, NULL, NULL, arg_flags); - break; - case G_TYPE_OBJECT: - pspec = g_param_spec_object (pname, NULL, NULL, arg_type, arg_flags); - break; - case G_TYPE_BOXED: - if (!G_TYPE_IS_FUNDAMENTAL (arg_type)) - { - pspec = g_param_spec_boxed (pname, NULL, NULL, arg_type, arg_flags); - break; - } - default: - g_warning (G_STRLOC ": Property type `%s' is not supported by the GtkArg compatibility code", - g_type_name (arg_type)); - return; - } - g_object_class_install_property (oclass, arg_id, pspec); -} - -static guint (*gobject_floating_flag_handler) (GtkObject*,gint) = NULL; - -static guint -gtk_object_floating_flag_handler (GtkObject *object, - gint job) -{ - /* FIXME: remove this whole thing once GTK+ breaks ABI */ - if (!GTK_IS_OBJECT (object)) - return gobject_floating_flag_handler (object, job); - switch (job) - { - guint32 oldvalue; - case +1: /* force floating if possible */ - do - oldvalue = g_atomic_int_get (&object->flags); - while (!g_atomic_int_compare_and_exchange ((gint *)&object->flags, oldvalue, oldvalue | GTK_FLOATING)); - return oldvalue & GTK_FLOATING; - case -1: /* sink if possible */ - do - oldvalue = g_atomic_int_get (&object->flags); - while (!g_atomic_int_compare_and_exchange ((gint *)&object->flags, oldvalue, oldvalue & ~(guint32) GTK_FLOATING)); - return oldvalue & GTK_FLOATING; - default: /* check floating */ - return 0 != (g_atomic_int_get (&object->flags) & GTK_FLOATING); - } } static void gtk_object_class_init (GtkObjectClass *class) { GObjectClass *gobject_class = G_OBJECT_CLASS (class); - gboolean is_glib_2_10_1; - parent_class = g_type_class_ref (G_TYPE_OBJECT); - - is_glib_2_10_1 = g_object_compat_control (3, &gobject_floating_flag_handler); - if (!is_glib_2_10_1) - g_error ("this version of Gtk+ requires GLib-2.10.1"); - g_object_compat_control (2, gtk_object_floating_flag_handler); - - gobject_class->set_property = gtk_object_set_property; - gobject_class->get_property = gtk_object_get_property; gobject_class->dispose = gtk_object_dispose; gobject_class->finalize = gtk_object_finalize; class->destroy = gtk_object_real_destroy; - g_object_class_install_property (gobject_class, - PROP_USER_DATA, - g_param_spec_pointer ("user-data", - P_("User Data"), - P_("Anonymous User Data Pointer"), - GTK_PARAM_READWRITE)); + /** + * GtkObject::destroy: + * @object: the object which received the signal. + * + * Signals that all holders of a reference to the #GtkObject should release + * the reference that they hold. May result in finalization of the object + * if all references are released. + */ object_signals[DESTROY] = g_signal_new (I_("destroy"), G_TYPE_FROM_CLASS (gobject_class), @@ -380,26 +161,26 @@ gtk_object_class_init (GtkObjectClass *class) G_TYPE_NONE, 0); } -static void -gtk_object_init (GtkObject *object, - GtkObjectClass *klass) -{ - gboolean was_floating; - /* sink the GInitiallyUnowned floating flag */ - was_floating = gobject_floating_flag_handler (object, -1); - /* set GTK_FLOATING via gtk_object_floating_flag_handler */ - if (was_floating) - g_object_force_floating (G_OBJECT (object)); -} /******************************************** * Functions to end a GtkObject's life time * ********************************************/ +/** + * gtk_object_destroy: + * @object: the object to destroy. + * + * Emits the #GtkObject::destroy signal notifying all reference holders that they should + * release the #GtkObject. See the overview documentation at the top of the + * page for more details. + * + * The memory for the object itself won't be deleted until + * its reference count actually drops to 0; gtk_object_destroy() merely asks + * reference holders to release their references, it does not free the object. + */ void gtk_object_destroy (GtkObject *object) { - g_return_if_fail (object != NULL); g_return_if_fail (GTK_IS_OBJECT (object)); if (!(GTK_OBJECT_FLAGS (object) & GTK_IN_DESTRUCTION)) @@ -423,7 +204,7 @@ gtk_object_dispose (GObject *gobject) GTK_OBJECT_UNSET_FLAGS (object, GTK_IN_DESTRUCTION); } - G_OBJECT_CLASS (parent_class)->dispose (gobject); + G_OBJECT_CLASS (gtk_object_parent_class)->dispose (gobject); } static void @@ -445,335 +226,7 @@ gtk_object_finalize (GObject *gobject) "and must be removed with g_object_ref_sink()."); } - gtk_object_notify_weaks (object); - - G_OBJECT_CLASS (parent_class)->finalize (gobject); -} - -/***************************************** - * GtkObject argument handlers - * - *****************************************/ - -static void -gtk_object_set_property (GObject *object, - guint property_id, - const GValue *value, - GParamSpec *pspec) -{ - switch (property_id) - { - case PROP_USER_DATA: - g_object_set_data (G_OBJECT (object), I_("user_data"), g_value_get_pointer (value)); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); - break; - } -} - -static void -gtk_object_get_property (GObject *object, - guint property_id, - GValue *value, - GParamSpec *pspec) -{ - switch (property_id) - { - case PROP_USER_DATA: - g_value_set_pointer (value, g_object_get_data (G_OBJECT (object), "user_data")); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); - break; - } -} - -void -gtk_object_sink (GtkObject *object) -{ - g_return_if_fail (GTK_IS_OBJECT (object)); - g_object_ref_sink (object); - g_object_unref (object); -} - -/***************************************** - * Weak references. - * - * Weak refs are very similar to the old "destroy" signal. They allow - * one to register a callback that is called when the weakly - * referenced object is finalized. - * - * They are not implemented as a signal because they really are - * special and need to be used with great care. Unlike signals, which - * should be able to execute any code whatsoever. - * - * A weakref callback is not allowed to retain a reference to the - * object. Object data keys may be retrieved in a weak reference - * callback. - * - * A weakref callback is called at most once. - * - *****************************************/ - -typedef struct _GtkWeakRef GtkWeakRef; - -struct _GtkWeakRef -{ - GtkWeakRef *next; - GDestroyNotify notify; - gpointer data; -}; - -void -gtk_object_weakref (GtkObject *object, - GDestroyNotify notify, - gpointer data) -{ - GtkWeakRef *weak; - - g_return_if_fail (notify != NULL); - g_return_if_fail (GTK_IS_OBJECT (object)); - - if (!quark_weakrefs) - quark_weakrefs = g_quark_from_static_string ("gtk-weakrefs"); - - weak = g_new (GtkWeakRef, 1); - weak->next = g_object_get_qdata (G_OBJECT (object), quark_weakrefs); - weak->notify = notify; - weak->data = data; - g_object_set_qdata (G_OBJECT (object), quark_weakrefs, weak); -} - -void -gtk_object_weakunref (GtkObject *object, - GDestroyNotify notify, - gpointer data) -{ - GtkWeakRef *weaks, *w, **wp; - - g_return_if_fail (GTK_IS_OBJECT (object)); - - if (!quark_weakrefs) - return; - - weaks = g_object_get_qdata (G_OBJECT (object), quark_weakrefs); - for (wp = &weaks; *wp; wp = &(*wp)->next) - { - w = *wp; - if (w->notify == notify && w->data == data) - { - if (w == weaks) - g_object_set_qdata (G_OBJECT (object), quark_weakrefs, w->next); - else - *wp = w->next; - g_free (w); - return; - } - } -} - -static void -gtk_object_notify_weaks (GtkObject *object) -{ - if (quark_weakrefs) - { - GtkWeakRef *w1, *w2; - - w1 = g_object_get_qdata (G_OBJECT (object), quark_weakrefs); - - while (w1) - { - w1->notify (w1->data); - w2 = w1->next; - g_free (w1); - w1 = w2; - } - } -} - -GtkObject* -gtk_object_new (GType object_type, - const gchar *first_property_name, - ...) -{ - GtkObject *object; - va_list var_args; - - g_return_val_if_fail (G_TYPE_IS_OBJECT (object_type), NULL); - - va_start (var_args, first_property_name); - object = (GtkObject *)g_object_new_valist (object_type, first_property_name, var_args); - va_end (var_args); - - return object; -} - -void -gtk_object_get (GtkObject *object, - const gchar *first_property_name, - ...) -{ - va_list var_args; - - g_return_if_fail (GTK_IS_OBJECT (object)); - - va_start (var_args, first_property_name); - g_object_get_valist (G_OBJECT (object), first_property_name, var_args); - va_end (var_args); -} - -void -gtk_object_set (GtkObject *object, - const gchar *first_property_name, - ...) -{ - va_list var_args; - - g_return_if_fail (GTK_IS_OBJECT (object)); - - va_start (var_args, first_property_name); - g_object_set_valist (G_OBJECT (object), first_property_name, var_args); - va_end (var_args); -} - -/***************************************** - * GtkObject object_data mechanism - * - *****************************************/ - -void -gtk_object_set_data_by_id (GtkObject *object, - GQuark data_id, - gpointer data) -{ - g_return_if_fail (GTK_IS_OBJECT (object)); - - g_datalist_id_set_data (&G_OBJECT (object)->qdata, data_id, data); -} - -void -gtk_object_set_data (GtkObject *object, - const gchar *key, - gpointer data) -{ - g_return_if_fail (GTK_IS_OBJECT (object)); - g_return_if_fail (key != NULL); - - g_datalist_set_data (&G_OBJECT (object)->qdata, key, data); -} - -void -gtk_object_set_data_by_id_full (GtkObject *object, - GQuark data_id, - gpointer data, - GDestroyNotify destroy) -{ - g_return_if_fail (GTK_IS_OBJECT (object)); - - g_datalist_id_set_data_full (&G_OBJECT (object)->qdata, data_id, data, destroy); -} - -void -gtk_object_set_data_full (GtkObject *object, - const gchar *key, - gpointer data, - GDestroyNotify destroy) -{ - g_return_if_fail (GTK_IS_OBJECT (object)); - g_return_if_fail (key != NULL); - - g_datalist_set_data_full (&G_OBJECT (object)->qdata, key, data, destroy); -} - -gpointer -gtk_object_get_data_by_id (GtkObject *object, - GQuark data_id) -{ - g_return_val_if_fail (GTK_IS_OBJECT (object), NULL); - - return g_datalist_id_get_data (&G_OBJECT (object)->qdata, data_id); -} - -gpointer -gtk_object_get_data (GtkObject *object, - const gchar *key) -{ - g_return_val_if_fail (GTK_IS_OBJECT (object), NULL); - g_return_val_if_fail (key != NULL, NULL); - - return g_datalist_get_data (&G_OBJECT (object)->qdata, key); -} - -void -gtk_object_remove_data_by_id (GtkObject *object, - GQuark data_id) -{ - g_return_if_fail (GTK_IS_OBJECT (object)); - - g_datalist_id_remove_data (&G_OBJECT (object)->qdata, data_id); -} - -void -gtk_object_remove_data (GtkObject *object, - const gchar *key) -{ - g_return_if_fail (GTK_IS_OBJECT (object)); - g_return_if_fail (key != NULL); - - g_datalist_remove_data (&G_OBJECT (object)->qdata, key); -} - -void -gtk_object_remove_no_notify_by_id (GtkObject *object, - GQuark key_id) -{ - g_return_if_fail (GTK_IS_OBJECT (object)); - - g_datalist_id_remove_no_notify (&G_OBJECT (object)->qdata, key_id); -} - -void -gtk_object_remove_no_notify (GtkObject *object, - const gchar *key) -{ - g_return_if_fail (GTK_IS_OBJECT (object)); - g_return_if_fail (key != NULL); - - g_datalist_remove_no_notify (&G_OBJECT (object)->qdata, key); -} - -void -gtk_object_set_user_data (GtkObject *object, - gpointer data) -{ - g_return_if_fail (GTK_IS_OBJECT (object)); - - g_object_set_data (G_OBJECT (object), "user_data", data); -} - -gpointer -gtk_object_get_user_data (GtkObject *object) -{ - g_return_val_if_fail (GTK_IS_OBJECT (object), NULL); - - return g_object_get_data (G_OBJECT (object), "user_data"); -} - -GtkObject* -gtk_object_ref (GtkObject *object) -{ - g_return_val_if_fail (GTK_IS_OBJECT (object), NULL); - - return (GtkObject*) g_object_ref ((GObject*) object); -} - -void -gtk_object_unref (GtkObject *object) -{ - g_return_if_fail (GTK_IS_OBJECT (object)); - - g_object_unref ((GObject*) object); + G_OBJECT_CLASS (gtk_object_parent_class)->finalize (gobject); } #define __GTK_OBJECT_C__ diff --git a/gtk/gtkobject.h b/gtk/gtkobject.h index a32ecd0bf0..34f34ed7ab 100644 --- a/gtk/gtkobject.h +++ b/gtk/gtkobject.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -51,50 +51,35 @@ G_BEGIN_DECLS #define GTK_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_OBJECT)) #define GTK_OBJECT_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), GTK_TYPE_OBJECT, GtkObjectClass)) -/* Macros for extracting various fields from GtkObject and GtkObjectClass. - */ -#ifndef GTK_DISABLE_DEPRECATED -/** - * GTK_OBJECT_TYPE: - * @object: a #GtkObject. - * - * Gets the type of an object. - * - * Deprecated: 2.20: Use G_OBJECT_TYPE() instead. - */ -#define GTK_OBJECT_TYPE G_OBJECT_TYPE -/** - * GTK_OBJECT_TYPE_NAME: - * @object: a #GtkObject. - * - * Gets the name of an object's type. - * - * Deprecated: 2.20: Use G_OBJECT_TYPE_NAME() instead. - */ -#define GTK_OBJECT_TYPE_NAME G_OBJECT_TYPE_NAME -#endif - /* GtkObject only uses the first 4 bits of the flags field. * Derived objects may use the remaining bits. Though this * is a kinda nasty break up, it does make the size of * derived objects smaller. */ +/** + * GtkObjectFlags: + * @GTK_IN_DESTRUCTION: the object is currently being destroyed. This is used + * internally by GTK+ to prevent reinvokations during destruction. + * @GTK_RESERVED_1: reserved for future use + * @GTK_RESERVED_2: reserved for future use + * + * Tells about the state of the object. + */ typedef enum { GTK_IN_DESTRUCTION = 1 << 0, /* Used internally during dispose */ -#if !defined (GTK_DISABLE_DEPRECATED) || defined (GTK_COMPILATION) - GTK_FLOATING = 1 << 1, -#endif GTK_RESERVED_1 = 1 << 2, GTK_RESERVED_2 = 1 << 3 } GtkObjectFlags; -/* Macros for extracting the object_flags from GtkObject. +/** + * GTK_OBJECT_FLAGS: + * @obj: the object whose flags are returned. + * + * Gets the #GtkObjectFlags for an object without directly + * accessing its members. */ #define GTK_OBJECT_FLAGS(obj) (GTK_OBJECT (obj)->flags) -#ifndef GTK_DISABLE_DEPRECATED -#define GTK_OBJECT_FLOATING(obj) (g_object_is_floating (obj)) -#endif /* Macros for setting and clearing bits in the object_flags field of GtkObject. */ @@ -120,14 +105,6 @@ struct _GtkObjectClass { GInitiallyUnownedClass parent_class; - /* Non overridable class methods to set and get per class arguments */ - void (*set_arg) (GtkObject *object, - GtkArg *arg, - guint arg_id); - void (*get_arg) (GtkObject *object, - GtkArg *arg, - guint arg_id); - /* Default signal handler for the ::destroy signal, which is * invoked to request that references to the widget be dropped. * If an object class overrides destroy() in order to perform class @@ -139,112 +116,12 @@ struct _GtkObjectClass void (*destroy) (GtkObject *object); }; - - /* Application-level methods */ GType gtk_object_get_type (void) G_GNUC_CONST; -#ifndef GTK_DISABLE_DEPRECATED -void gtk_object_sink (GtkObject *object); -#endif void gtk_object_destroy (GtkObject *object); -/****************************************************************/ - -#ifndef GTK_DISABLE_DEPRECATED - -GtkObject* gtk_object_new (GType type, - const gchar *first_property_name, - ...); -GtkObject* gtk_object_ref (GtkObject *object); -void gtk_object_unref (GtkObject *object); -void gtk_object_weakref (GtkObject *object, - GDestroyNotify notify, - gpointer data); -void gtk_object_weakunref (GtkObject *object, - GDestroyNotify notify, - gpointer data); - -/* Set 'data' to the "object_data" field of the object. The - * data is indexed by the "key". If there is already data - * associated with "key" then the new data will replace it. - * If 'data' is NULL then this call is equivalent to - * 'gtk_object_remove_data'. - * The gtk_object_set_data_full variant acts just the same, - * but takes an additional argument which is a function to - * be called when the data is removed. - * `gtk_object_remove_data' is equivalent to the above, - * where 'data' is NULL - * `gtk_object_get_data' gets the data associated with "key". - */ -void gtk_object_set_data (GtkObject *object, - const gchar *key, - gpointer data); -void gtk_object_set_data_full (GtkObject *object, - const gchar *key, - gpointer data, - GDestroyNotify destroy); -void gtk_object_remove_data (GtkObject *object, - const gchar *key); -gpointer gtk_object_get_data (GtkObject *object, - const gchar *key); -void gtk_object_remove_no_notify (GtkObject *object, - const gchar *key); - -/* Set/get the "user_data" object data field of "object". It should - * be noted that these functions are no different than calling - * `gtk_object_set_data'/`gtk_object_get_data' with a key of "user_data". - * They are merely provided as a convenience. - */ -void gtk_object_set_user_data (GtkObject *object, - gpointer data); -gpointer gtk_object_get_user_data (GtkObject *object); - - -/* Object-level methods */ - -/* Object data method variants that operate on key ids. */ -void gtk_object_set_data_by_id (GtkObject *object, - GQuark data_id, - gpointer data); -void gtk_object_set_data_by_id_full (GtkObject *object, - GQuark data_id, - gpointer data, - GDestroyNotify destroy); -gpointer gtk_object_get_data_by_id (GtkObject *object, - GQuark data_id); -void gtk_object_remove_data_by_id (GtkObject *object, - GQuark data_id); -void gtk_object_remove_no_notify_by_id (GtkObject *object, - GQuark key_id); -#define gtk_object_data_try_key g_quark_try_string -#define gtk_object_data_force_id g_quark_from_string - -/* GtkArg flag bits for gtk_object_add_arg_type - */ -typedef enum -{ - GTK_ARG_READABLE = G_PARAM_READABLE, - GTK_ARG_WRITABLE = G_PARAM_WRITABLE, - GTK_ARG_CONSTRUCT = G_PARAM_CONSTRUCT, - GTK_ARG_CONSTRUCT_ONLY = G_PARAM_CONSTRUCT_ONLY, - GTK_ARG_CHILD_ARG = 1 << 4 -} GtkArgFlags; -#define GTK_ARG_READWRITE (GTK_ARG_READABLE | GTK_ARG_WRITABLE) -void gtk_object_get (GtkObject *object, - const gchar *first_property_name, - ...) G_GNUC_NULL_TERMINATED; -void gtk_object_set (GtkObject *object, - const gchar *first_property_name, - ...) G_GNUC_NULL_TERMINATED; -void gtk_object_add_arg_type (const gchar *arg_name, - GType arg_type, - guint arg_flags, - guint arg_id); - -#endif /* GTK_DISABLE_DEPRECATED */ - G_END_DECLS #endif /* __GTK_OBJECT_H__ */ diff --git a/gtk/gtkoldeditable.c b/gtk/gtkoldeditable.c deleted file mode 100644 index 983e99fd3a..0000000000 --- a/gtk/gtkoldeditable.c +++ /dev/null @@ -1,829 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#undef GTK_DISABLE_DEPRECATED - -#include "config.h" -#include -#include "gdk/gdkkeysyms.h" -#include "gdk/gdki18n.h" -#include "gtkclipboard.h" -#include "gtkoldeditable.h" -#include "gtkmain.h" -#include "gtkmarshalers.h" -#include "gtkselection.h" -#include "gtksignal.h" -#include "gtkintl.h" - -#include "gtkalias.h" - -#define MIN_EDITABLE_WIDTH 150 -#define DRAW_TIMEOUT 20 -#define INNER_BORDER 2 - -enum { - /* Binding actions */ - ACTIVATE, - SET_EDITABLE, - MOVE_CURSOR, - MOVE_WORD, - MOVE_PAGE, - MOVE_TO_ROW, - MOVE_TO_COLUMN, - KILL_CHAR, - KILL_WORD, - KILL_LINE, - CUT_CLIPBOARD, - COPY_CLIPBOARD, - PASTE_CLIPBOARD, - LAST_SIGNAL -}; - -enum { - ARG_0, - ARG_TEXT_POSITION, - ARG_EDITABLE -}; - -/* values for selection info */ - -enum { - TARGET_STRING, - TARGET_TEXT, - TARGET_COMPOUND_TEXT -}; - -static void gtk_old_editable_editable_init (GtkEditableClass *iface); -static void gtk_old_editable_set_arg (GtkObject *object, - GtkArg *arg, - guint arg_id); -static void gtk_old_editable_get_arg (GtkObject *object, - GtkArg *arg, - guint arg_id); -static void *gtk_old_editable_get_public_chars (GtkOldEditable *old_editable, - gint start, - gint end); - -static gint gtk_old_editable_selection_clear (GtkWidget *widget, - GdkEventSelection *event); -static void gtk_old_editable_selection_get (GtkWidget *widget, - GtkSelectionData *selection_data, - guint info, - guint time); -static void gtk_old_editable_selection_received (GtkWidget *widget, - GtkSelectionData *selection_data, - guint time); - -static void gtk_old_editable_set_selection (GtkOldEditable *old_editable, - gint start, - gint end); - -static void gtk_old_editable_real_set_editable (GtkOldEditable *old_editable, - gboolean is_editable); -static void gtk_old_editable_real_cut_clipboard (GtkOldEditable *old_editable); -static void gtk_old_editable_real_copy_clipboard (GtkOldEditable *old_editable); -static void gtk_old_editable_real_paste_clipboard (GtkOldEditable *old_editable); - -static void gtk_old_editable_insert_text (GtkEditable *editable, - const gchar *new_text, - gint new_text_length, - gint *position); -static void gtk_old_editable_delete_text (GtkEditable *editable, - gint start_pos, - gint end_pos); -static gchar * gtk_old_editable_get_chars (GtkEditable *editable, - gint start, - gint end); -static void gtk_old_editable_set_selection_bounds (GtkEditable *editable, - gint start, - gint end); -static gboolean gtk_old_editable_get_selection_bounds (GtkEditable *editable, - gint *start, - gint *end); -static void gtk_old_editable_set_position (GtkEditable *editable, - gint position); -static gint gtk_old_editable_get_position (GtkEditable *editable); -static void gtk_old_editable_finalize (GObject *object); - -static guint editable_signals[LAST_SIGNAL] = { 0 }; - -G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GtkOldEditable, gtk_old_editable, GTK_TYPE_WIDGET, - G_IMPLEMENT_INTERFACE (GTK_TYPE_EDITABLE, - gtk_old_editable_editable_init)) - -static void -gtk_old_editable_class_init (GtkOldEditableClass *class) -{ - GObjectClass *gobject_class; - GtkObjectClass *object_class; - GtkWidgetClass *widget_class; - - gobject_class = (GObjectClass*) class; - object_class = (GtkObjectClass*) class; - widget_class = (GtkWidgetClass*) class; - - gobject_class->finalize = gtk_old_editable_finalize; - - object_class->set_arg = gtk_old_editable_set_arg; - object_class->get_arg = gtk_old_editable_get_arg; - - widget_class->selection_clear_event = gtk_old_editable_selection_clear; - widget_class->selection_received = gtk_old_editable_selection_received; - widget_class->selection_get = gtk_old_editable_selection_get; - - class->activate = NULL; - class->set_editable = gtk_old_editable_real_set_editable; - - class->move_cursor = NULL; - class->move_word = NULL; - class->move_page = NULL; - class->move_to_row = NULL; - class->move_to_column = NULL; - - class->kill_char = NULL; - class->kill_word = NULL; - class->kill_line = NULL; - - class->cut_clipboard = gtk_old_editable_real_cut_clipboard; - class->copy_clipboard = gtk_old_editable_real_copy_clipboard; - class->paste_clipboard = gtk_old_editable_real_paste_clipboard; - - class->update_text = NULL; - class->get_chars = NULL; - class->set_selection = NULL; - class->set_position = NULL; - - editable_signals[ACTIVATE] = - gtk_signal_new (I_("activate"), - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkOldEditableClass, activate), - _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); - widget_class->activate_signal = editable_signals[ACTIVATE]; - - editable_signals[SET_EDITABLE] = - gtk_signal_new (I_("set-editable"), - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkOldEditableClass, set_editable), - _gtk_marshal_VOID__BOOLEAN, - GTK_TYPE_NONE, 1, - GTK_TYPE_BOOL); - - editable_signals[MOVE_CURSOR] = - gtk_signal_new (I_("move-cursor"), - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkOldEditableClass, move_cursor), - _gtk_marshal_VOID__INT_INT, - GTK_TYPE_NONE, 2, - GTK_TYPE_INT, - GTK_TYPE_INT); - - editable_signals[MOVE_WORD] = - gtk_signal_new (I_("move-word"), - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkOldEditableClass, move_word), - _gtk_marshal_VOID__INT, - GTK_TYPE_NONE, 1, - GTK_TYPE_INT); - - editable_signals[MOVE_PAGE] = - gtk_signal_new (I_("move-page"), - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkOldEditableClass, move_page), - _gtk_marshal_VOID__INT_INT, - GTK_TYPE_NONE, 2, - GTK_TYPE_INT, - GTK_TYPE_INT); - - editable_signals[MOVE_TO_ROW] = - gtk_signal_new (I_("move-to-row"), - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkOldEditableClass, move_to_row), - _gtk_marshal_VOID__INT, - GTK_TYPE_NONE, 1, - GTK_TYPE_INT); - - editable_signals[MOVE_TO_COLUMN] = - gtk_signal_new (I_("move-to-column"), - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkOldEditableClass, move_to_column), - _gtk_marshal_VOID__INT, - GTK_TYPE_NONE, 1, - GTK_TYPE_INT); - - editable_signals[KILL_CHAR] = - gtk_signal_new (I_("kill-char"), - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkOldEditableClass, kill_char), - _gtk_marshal_VOID__INT, - GTK_TYPE_NONE, 1, - GTK_TYPE_INT); - - editable_signals[KILL_WORD] = - gtk_signal_new (I_("kill-word"), - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkOldEditableClass, kill_word), - _gtk_marshal_VOID__INT, - GTK_TYPE_NONE, 1, - GTK_TYPE_INT); - - editable_signals[KILL_LINE] = - gtk_signal_new (I_("kill-line"), - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkOldEditableClass, kill_line), - _gtk_marshal_VOID__INT, - GTK_TYPE_NONE, 1, - GTK_TYPE_INT); - - editable_signals[CUT_CLIPBOARD] = - gtk_signal_new (I_("cut-clipboard"), - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkOldEditableClass, cut_clipboard), - _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); - - editable_signals[COPY_CLIPBOARD] = - gtk_signal_new (I_("copy-clipboard"), - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkOldEditableClass, copy_clipboard), - _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); - - editable_signals[PASTE_CLIPBOARD] = - gtk_signal_new (I_("paste-clipboard"), - GTK_RUN_LAST | GTK_RUN_ACTION, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkOldEditableClass, paste_clipboard), - _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); - - gtk_object_add_arg_type ("GtkOldEditable::text-position", GTK_TYPE_INT, GTK_ARG_READWRITE | G_PARAM_STATIC_NAME, ARG_TEXT_POSITION); - gtk_object_add_arg_type ("GtkOldEditable::editable", GTK_TYPE_BOOL, GTK_ARG_READWRITE | G_PARAM_STATIC_NAME, ARG_EDITABLE); -} - -static void -gtk_old_editable_editable_init (GtkEditableClass *iface) -{ - iface->do_insert_text = gtk_old_editable_insert_text; - iface->do_delete_text = gtk_old_editable_delete_text; - iface->get_chars = gtk_old_editable_get_chars; - iface->set_selection_bounds = gtk_old_editable_set_selection_bounds; - iface->get_selection_bounds = gtk_old_editable_get_selection_bounds; - iface->set_position = gtk_old_editable_set_position; - iface->get_position = gtk_old_editable_get_position; -} - -static void -gtk_old_editable_set_arg (GtkObject *object, - GtkArg *arg, - guint arg_id) -{ - GtkEditable *editable = GTK_EDITABLE (object); - - switch (arg_id) - { - case ARG_TEXT_POSITION: - gtk_editable_set_position (editable, GTK_VALUE_INT (*arg)); - break; - case ARG_EDITABLE: - gtk_signal_emit (object, editable_signals[SET_EDITABLE], - GTK_VALUE_BOOL (*arg) != FALSE); - break; - default: - break; - } -} - -static void -gtk_old_editable_get_arg (GtkObject *object, - GtkArg *arg, - guint arg_id) -{ - GtkOldEditable *old_editable; - - old_editable = GTK_OLD_EDITABLE (object); - - switch (arg_id) - { - case ARG_TEXT_POSITION: - GTK_VALUE_INT (*arg) = old_editable->current_pos; - break; - case ARG_EDITABLE: - GTK_VALUE_BOOL (*arg) = old_editable->editable; - break; - default: - arg->type = GTK_TYPE_INVALID; - break; - } -} - -static void -gtk_old_editable_init (GtkOldEditable *old_editable) -{ - static const GtkTargetEntry targets[] = { - { "UTF8_STRING", 0, 0 }, - { "STRING", 0, 0 }, - { "TEXT", 0, 0 }, - { "COMPOUND_TEXT", 0, 0 } - }; - - gtk_widget_set_can_focus (GTK_WIDGET (old_editable), TRUE); - - old_editable->selection_start_pos = 0; - old_editable->selection_end_pos = 0; - old_editable->has_selection = FALSE; - old_editable->editable = 1; - old_editable->visible = 1; - old_editable->clipboard_text = NULL; - - gtk_selection_add_targets (GTK_WIDGET (old_editable), GDK_SELECTION_PRIMARY, - targets, G_N_ELEMENTS (targets)); -} - -static void -gtk_old_editable_finalize (GObject *object) -{ - gtk_selection_clear_targets (GTK_WIDGET (object), GDK_SELECTION_PRIMARY); - - G_OBJECT_CLASS (gtk_old_editable_parent_class)->finalize (object); -} - -static void -gtk_old_editable_insert_text (GtkEditable *editable, - const gchar *new_text, - gint new_text_length, - gint *position) -{ - gchar buf[64]; - gchar *text; - - g_object_ref (editable); - - if (new_text_length <= 63) - text = buf; - else - text = g_new (gchar, new_text_length + 1); - - text[new_text_length] = '\0'; - strncpy (text, new_text, new_text_length); - - g_signal_emit_by_name (editable, "insert-text", text, new_text_length, - position); - g_signal_emit_by_name (editable, "changed"); - - if (new_text_length > 63) - g_free (text); - - g_object_unref (editable); -} - -static void -gtk_old_editable_delete_text (GtkEditable *editable, - gint start_pos, - gint end_pos) -{ - GtkOldEditable *old_editable = GTK_OLD_EDITABLE (editable); - - g_object_ref (old_editable); - - g_signal_emit_by_name (editable, "delete-text", start_pos, end_pos); - g_signal_emit_by_name (editable, "changed"); - - if (old_editable->selection_start_pos == old_editable->selection_end_pos && - old_editable->has_selection) - gtk_old_editable_claim_selection (old_editable, FALSE, GDK_CURRENT_TIME); - - g_object_unref (old_editable); -} - -static void -gtk_old_editable_update_text (GtkOldEditable *old_editable, - gint start_pos, - gint end_pos) -{ - GtkOldEditableClass *klass = GTK_OLD_EDITABLE_GET_CLASS (old_editable); - klass->update_text (GTK_OLD_EDITABLE (old_editable), start_pos, end_pos); -} - -static gchar * -gtk_old_editable_get_chars (GtkEditable *editable, - gint start, - gint end) -{ - GtkOldEditableClass *klass = GTK_OLD_EDITABLE_GET_CLASS (editable); - return klass->get_chars (GTK_OLD_EDITABLE (editable), start, end); -} - -/* - * Like gtk_editable_get_chars, but if the editable is not - * visible, return asterisks; also convert result to UTF-8. - */ -static void * -gtk_old_editable_get_public_chars (GtkOldEditable *old_editable, - gint start, - gint end) -{ - gchar *str = NULL; - const gchar *charset; - gboolean need_conversion = !g_get_charset (&charset); - - if (old_editable->visible) - { - GError *error = NULL; - gchar *tmp = gtk_editable_get_chars (GTK_EDITABLE (old_editable), start, end); - - if (need_conversion) - { - str = g_convert (tmp, -1, - "UTF-8", charset, - NULL, NULL, &error); - - if (!str) - { - g_warning ("Cannot convert text from charset to UTF-8 %s: %s", charset, error->message); - g_error_free (error); - } - - g_free (tmp); - } - else - str = tmp; - } - else - { - gint i; - gint nchars = end - start; - - if (nchars < 0) - nchars = -nchars; - - str = g_new (gchar, nchars + 1); - for (i = 0; iset_selection (old_editable, start_pos, end_pos); -} - -static void -gtk_old_editable_set_position (GtkEditable *editable, - gint position) -{ - GtkOldEditableClass *klass = GTK_OLD_EDITABLE_GET_CLASS (editable); - - klass->set_position (GTK_OLD_EDITABLE (editable), position); -} - -static gint -gtk_old_editable_get_position (GtkEditable *editable) -{ - return GTK_OLD_EDITABLE (editable)->current_pos; -} - -static gint -gtk_old_editable_selection_clear (GtkWidget *widget, - GdkEventSelection *event) -{ - GtkOldEditable *old_editable = GTK_OLD_EDITABLE (widget); - - /* Let the selection handling code know that the selection - * has been changed, since we've overriden the default handler */ - if (!GTK_WIDGET_CLASS (gtk_old_editable_parent_class)->selection_clear_event (widget, event)) - return FALSE; - - if (old_editable->has_selection) - { - old_editable->has_selection = FALSE; - gtk_old_editable_update_text (old_editable, old_editable->selection_start_pos, - old_editable->selection_end_pos); - } - - return TRUE; -} - -static void -gtk_old_editable_selection_get (GtkWidget *widget, - GtkSelectionData *selection_data, - guint info, - guint time) -{ - GtkOldEditable *old_editable = GTK_OLD_EDITABLE (widget); - gint selection_start_pos; - gint selection_end_pos; - - gchar *str; - - selection_start_pos = MIN (old_editable->selection_start_pos, old_editable->selection_end_pos); - selection_end_pos = MAX (old_editable->selection_start_pos, old_editable->selection_end_pos); - - str = gtk_old_editable_get_public_chars (old_editable, - selection_start_pos, - selection_end_pos); - - if (str) - { - gtk_selection_data_set_text (selection_data, str, -1); - g_free (str); - } -} - -static void -gtk_old_editable_paste_received (GtkOldEditable *old_editable, - const gchar *text, - gboolean is_clipboard) -{ - const gchar *str = NULL; - const gchar *charset; - gboolean need_conversion = FALSE; - - if (text) - { - GError *error = NULL; - - need_conversion = !g_get_charset (&charset); - - if (need_conversion) - { - str = g_convert_with_fallback (text, -1, - charset, "UTF-8", NULL, - NULL, NULL, &error); - if (!str) - { - g_warning ("Cannot convert text from UTF-8 to %s: %s", - charset, error->message); - g_error_free (error); - return; - } - } - else - str = text; - } - - if (str) - { - gboolean reselect; - gint old_pos; - gint tmp_pos; - - reselect = FALSE; - - if ((old_editable->selection_start_pos != old_editable->selection_end_pos) && - (!old_editable->has_selection || is_clipboard)) - { - reselect = TRUE; - - /* Don't want to call gtk_editable_delete_selection here if we are going - * to reclaim the selection to avoid extra server traffic */ - if (old_editable->has_selection) - { - gtk_editable_delete_text (GTK_EDITABLE (old_editable), - MIN (old_editable->selection_start_pos, old_editable->selection_end_pos), - MAX (old_editable->selection_start_pos, old_editable->selection_end_pos)); - } - else - gtk_editable_delete_selection (GTK_EDITABLE (old_editable)); - } - - tmp_pos = old_pos = old_editable->current_pos; - - gtk_editable_insert_text (GTK_EDITABLE (old_editable), str, -1, &tmp_pos); - - if (reselect) - gtk_old_editable_set_selection (old_editable, old_pos, old_editable->current_pos); - - if (str && str != text) - g_free ((gchar *) str); - } -} - -static void -gtk_old_editable_selection_received (GtkWidget *widget, - GtkSelectionData *selection_data, - guint time) -{ - GtkOldEditable *old_editable = GTK_OLD_EDITABLE (widget); - - guchar *text = gtk_selection_data_get_text (selection_data); - - if (!text) - { - /* If we asked for UTF8 and didn't get it, try text; if we asked - * for text and didn't get it, try string. If we asked for - * anything else and didn't get it, give up. - */ - if (selection_data->target == gdk_atom_intern_static_string ("UTF8_STRING")) - { - gtk_selection_convert (widget, GDK_SELECTION_PRIMARY, - gdk_atom_intern_static_string ("TEXT"), - time); - return; - } - else if (selection_data->target == gdk_atom_intern_static_string ("TEXT")) - { - gtk_selection_convert (widget, GDK_SELECTION_PRIMARY, - GDK_TARGET_STRING, - time); - return; - } - } - - if (text) - { - gtk_old_editable_paste_received (old_editable, (gchar *) text, FALSE); - g_free (text); - } -} - -static void -old_editable_text_received_cb (GtkClipboard *clipboard, - const gchar *text, - gpointer data) -{ - GtkOldEditable *old_editable = GTK_OLD_EDITABLE (data); - - gtk_old_editable_paste_received (old_editable, text, TRUE); - g_object_unref (G_OBJECT (old_editable)); -} - -/** - * gtk_old_editable_claim_selection: - * @old_editable: a #GtkOldEditable - * @claim: if %TRUE, claim ownership of the selection, if %FALSE, give - * up ownership - * @time_: timestamp for this operation - * - * Claims or gives up ownership of the selection. - */ -void -gtk_old_editable_claim_selection (GtkOldEditable *old_editable, - gboolean claim, - guint32 time) -{ - GtkWidget *widget; - GdkDisplay *display; - - g_return_if_fail (GTK_IS_OLD_EDITABLE (old_editable)); - widget = GTK_WIDGET (old_editable); - g_return_if_fail (gtk_widget_get_realized (widget)); - - display = gtk_widget_get_display (widget); - old_editable->has_selection = FALSE; - - if (claim) - { - if (gtk_selection_owner_set_for_display (display, widget, - GDK_SELECTION_PRIMARY, time)) - old_editable->has_selection = TRUE; - } - else - { - if (gdk_selection_owner_get_for_display (display, GDK_SELECTION_PRIMARY) == widget->window) - gtk_selection_owner_set_for_display (display, - NULL, - GDK_SELECTION_PRIMARY, time); - } -} - -static void -gtk_old_editable_set_selection_bounds (GtkEditable *editable, - gint start, - gint end) -{ - GtkOldEditable *old_editable = GTK_OLD_EDITABLE (editable); - - if (gtk_widget_get_realized (GTK_WIDGET (editable))) - gtk_old_editable_claim_selection (old_editable, start != end, GDK_CURRENT_TIME); - - gtk_old_editable_set_selection (old_editable, start, end); -} - -static gboolean -gtk_old_editable_get_selection_bounds (GtkEditable *editable, - gint *start, - gint *end) -{ - GtkOldEditable *old_editable = GTK_OLD_EDITABLE (editable); - - *start = old_editable->selection_start_pos; - *end = old_editable->selection_end_pos; - - return (old_editable->selection_start_pos != old_editable->selection_end_pos); -} - -static void -gtk_old_editable_real_set_editable (GtkOldEditable *old_editable, - gboolean is_editable) -{ - is_editable = is_editable != FALSE; - - if (old_editable->editable != is_editable) - { - old_editable->editable = is_editable; - gtk_widget_queue_draw (GTK_WIDGET (old_editable)); - } -} - -static void -gtk_old_editable_real_cut_clipboard (GtkOldEditable *old_editable) -{ - gtk_old_editable_real_copy_clipboard (old_editable); - gtk_editable_delete_selection (GTK_EDITABLE (old_editable)); -} - -static void -gtk_old_editable_real_copy_clipboard (GtkOldEditable *old_editable) -{ - gint selection_start_pos; - gint selection_end_pos; - - selection_start_pos = MIN (old_editable->selection_start_pos, old_editable->selection_end_pos); - selection_end_pos = MAX (old_editable->selection_start_pos, old_editable->selection_end_pos); - - if (selection_start_pos != selection_end_pos) - { - gchar *text = gtk_old_editable_get_public_chars (old_editable, - selection_start_pos, - selection_end_pos); - - if (text) - { - GtkClipboard *clipboard = gtk_widget_get_clipboard (GTK_WIDGET (old_editable), - GDK_SELECTION_CLIPBOARD); - - gtk_clipboard_set_text (clipboard, text, -1); - g_free (text); - } - } -} - -static void -gtk_old_editable_real_paste_clipboard (GtkOldEditable *old_editable) -{ - GtkClipboard *clipboard = gtk_widget_get_clipboard (GTK_WIDGET (old_editable), - GDK_SELECTION_CLIPBOARD); - - g_object_ref (G_OBJECT (old_editable)); - gtk_clipboard_request_text (clipboard, old_editable_text_received_cb, old_editable); -} - -/** - * gtk_old_editable_changed: - * @old_editable: a #GtkOldEditable - * - * Emits the ::changed signal on @old_editable. - */ -void -gtk_old_editable_changed (GtkOldEditable *old_editable) -{ - g_return_if_fail (GTK_IS_OLD_EDITABLE (old_editable)); - - g_signal_emit_by_name (old_editable, "changed"); -} - -#define __GTK_OLD_EDITABLE_C__ -#include "gtkaliasdef.c" diff --git a/gtk/gtkoldeditable.h b/gtk/gtkoldeditable.h deleted file mode 100644 index ba497cd1cc..0000000000 --- a/gtk/gtkoldeditable.h +++ /dev/null @@ -1,126 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#ifndef GTK_DISABLE_DEPRECATED - -#ifndef __GTK_OLD_EDITABLE_H__ -#define __GTK_OLD_EDITABLE_H__ - -#include - - -G_BEGIN_DECLS - -#define GTK_TYPE_OLD_EDITABLE (gtk_old_editable_get_type ()) -#define GTK_OLD_EDITABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_OLD_EDITABLE, GtkOldEditable)) -#define GTK_OLD_EDITABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_OLD_EDITABLE, GtkOldEditableClass)) -#define GTK_IS_OLD_EDITABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_OLD_EDITABLE)) -#define GTK_IS_OLD_EDITABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_OLD_EDITABLE)) -#define GTK_OLD_EDITABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_OLD_EDITABLE, GtkOldEditableClass)) - - -typedef struct _GtkOldEditable GtkOldEditable; -typedef struct _GtkOldEditableClass GtkOldEditableClass; - -typedef void (*GtkTextFunction) (GtkOldEditable *editable, guint32 time_); - -struct _GtkOldEditable -{ - GtkWidget widget; - - /*< public >*/ - guint current_pos; - - guint selection_start_pos; - guint selection_end_pos; - guint has_selection : 1; - - /*< private >*/ - guint editable : 1; - guint visible : 1; - - gchar *clipboard_text; -}; - -struct _GtkOldEditableClass -{ - GtkWidgetClass parent_class; - - /* Bindings actions */ - void (* activate) (GtkOldEditable *editable); - void (* set_editable) (GtkOldEditable *editable, - gboolean is_editable); - void (* move_cursor) (GtkOldEditable *editable, - gint x, - gint y); - void (* move_word) (GtkOldEditable *editable, - gint n); - void (* move_page) (GtkOldEditable *editable, - gint x, - gint y); - void (* move_to_row) (GtkOldEditable *editable, - gint row); - void (* move_to_column) (GtkOldEditable *editable, - gint row); - void (* kill_char) (GtkOldEditable *editable, - gint direction); - void (* kill_word) (GtkOldEditable *editable, - gint direction); - void (* kill_line) (GtkOldEditable *editable, - gint direction); - void (* cut_clipboard) (GtkOldEditable *editable); - void (* copy_clipboard) (GtkOldEditable *editable); - void (* paste_clipboard) (GtkOldEditable *editable); - - /* Virtual functions. get_chars is in paricular not a signal because - * it returns malloced memory. The others are not signals because - * they would not be particularly useful as such. (All changes to - * selection and position do not go through these functions) - */ - void (* update_text) (GtkOldEditable *editable, - gint start_pos, - gint end_pos); - gchar* (* get_chars) (GtkOldEditable *editable, - gint start_pos, - gint end_pos); - void (* set_selection)(GtkOldEditable *editable, - gint start_pos, - gint end_pos); - void (* set_position) (GtkOldEditable *editable, - gint position); -}; - -GType gtk_old_editable_get_type (void) G_GNUC_CONST; -void gtk_old_editable_claim_selection (GtkOldEditable *old_editable, - gboolean claim, - guint32 time_); -void gtk_old_editable_changed (GtkOldEditable *old_editable); - -G_END_DECLS - -#endif /* __GTK_OLD_EDITABLE_H__ */ - -#endif /* GTK_DISABLE_DEPRECATED */ diff --git a/gtk/gtkoptionmenu.c b/gtk/gtkoptionmenu.c deleted file mode 100644 index c53018c478..0000000000 --- a/gtk/gtkoptionmenu.c +++ /dev/null @@ -1,1036 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Jsh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#include "config.h" - -#include "gdk/gdkkeysyms.h" - -#undef GTK_DISABLE_DEPRECATED - -#include "gtkmenu.h" -#include "gtkmenuitem.h" -#include "gtkmarshalers.h" -#include "gtkoptionmenu.h" -#include "gtkprivate.h" -#include "gtkintl.h" -#include "gtkalias.h" - -#define CHILD_LEFT_SPACING 4 -#define CHILD_RIGHT_SPACING 1 -#define CHILD_TOP_SPACING 1 -#define CHILD_BOTTOM_SPACING 1 - -typedef struct _GtkOptionMenuProps GtkOptionMenuProps; - -struct _GtkOptionMenuProps -{ - gboolean interior_focus; - GtkRequisition indicator_size; - GtkBorder indicator_spacing; - gint focus_width; - gint focus_pad; -}; - -static const GtkOptionMenuProps default_props = { - TRUE, - { 7, 13 }, - { 7, 5, 2, 2 }, /* Left, right, top, bottom */ - 1, - 0 -}; - -static void gtk_option_menu_destroy (GtkObject *object); -static void gtk_option_menu_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec); -static void gtk_option_menu_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec); -static void gtk_option_menu_size_request (GtkWidget *widget, - GtkRequisition *requisition); -static void gtk_option_menu_size_allocate (GtkWidget *widget, - GtkAllocation *allocation); -static void gtk_option_menu_paint (GtkWidget *widget, - GdkRectangle *area); -static gint gtk_option_menu_expose (GtkWidget *widget, - GdkEventExpose *event); -static gint gtk_option_menu_button_press (GtkWidget *widget, - GdkEventButton *event); -static gint gtk_option_menu_key_press (GtkWidget *widget, - GdkEventKey *event); -static void gtk_option_menu_selection_done (GtkMenuShell *menu_shell, - GtkOptionMenu *option_menu); -static void gtk_option_menu_update_contents (GtkOptionMenu *option_menu); -static void gtk_option_menu_remove_contents (GtkOptionMenu *option_menu); -static void gtk_option_menu_calc_size (GtkOptionMenu *option_menu); -static void gtk_option_menu_position (GtkMenu *menu, - gint *x, - gint *y, - gint *scroll_offet, - gpointer user_data); -static void gtk_option_menu_show_all (GtkWidget *widget); -static void gtk_option_menu_hide_all (GtkWidget *widget); -static gboolean gtk_option_menu_mnemonic_activate (GtkWidget *widget, - gboolean group_cycling); -static GType gtk_option_menu_child_type (GtkContainer *container); -static gint gtk_option_menu_scroll_event (GtkWidget *widget, - GdkEventScroll *event); - -enum -{ - CHANGED, - LAST_SIGNAL -}; - -enum -{ - PROP_0, - PROP_MENU -}; - -static guint signals[LAST_SIGNAL] = { 0 }; - -G_DEFINE_TYPE (GtkOptionMenu, gtk_option_menu, GTK_TYPE_BUTTON) - -static void -gtk_option_menu_class_init (GtkOptionMenuClass *class) -{ - GObjectClass *gobject_class; - GtkObjectClass *object_class; - GtkWidgetClass *widget_class; - GtkContainerClass *container_class; - - gobject_class = (GObjectClass*) class; - object_class = (GtkObjectClass*) class; - widget_class = (GtkWidgetClass*) class; - container_class = (GtkContainerClass*) class; - - signals[CHANGED] = - g_signal_new (I_("changed"), - G_OBJECT_CLASS_TYPE (class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GtkOptionMenuClass, changed), - NULL, NULL, - _gtk_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - gobject_class->set_property = gtk_option_menu_set_property; - gobject_class->get_property = gtk_option_menu_get_property; - object_class->destroy = gtk_option_menu_destroy; - - widget_class->size_request = gtk_option_menu_size_request; - widget_class->size_allocate = gtk_option_menu_size_allocate; - widget_class->expose_event = gtk_option_menu_expose; - widget_class->button_press_event = gtk_option_menu_button_press; - widget_class->key_press_event = gtk_option_menu_key_press; - widget_class->scroll_event = gtk_option_menu_scroll_event; - widget_class->show_all = gtk_option_menu_show_all; - widget_class->hide_all = gtk_option_menu_hide_all; - widget_class->mnemonic_activate = gtk_option_menu_mnemonic_activate; - - container_class->child_type = gtk_option_menu_child_type; - - g_object_class_install_property (gobject_class, - PROP_MENU, - g_param_spec_object ("menu", - P_("Menu"), - P_("The menu of options"), - GTK_TYPE_MENU, - GTK_PARAM_READWRITE)); - - gtk_widget_class_install_style_property (widget_class, - g_param_spec_boxed ("indicator-size", - P_("Indicator Size"), - P_("Size of dropdown indicator"), - GTK_TYPE_REQUISITION, - GTK_PARAM_READABLE)); - gtk_widget_class_install_style_property (widget_class, - g_param_spec_boxed ("indicator-spacing", - P_("Indicator Spacing"), - P_("Spacing around indicator"), - GTK_TYPE_BORDER, - GTK_PARAM_READABLE)); -} - -static GType -gtk_option_menu_child_type (GtkContainer *container) -{ - return G_TYPE_NONE; -} - -static void -gtk_option_menu_init (GtkOptionMenu *option_menu) -{ - GtkWidget *widget = GTK_WIDGET (option_menu); - - gtk_widget_set_can_focus (widget, TRUE); - gtk_widget_set_can_default (widget, FALSE); - gtk_widget_set_receives_default (widget, FALSE); - - option_menu->menu = NULL; - option_menu->menu_item = NULL; - option_menu->width = 0; - option_menu->height = 0; -} - -GtkWidget* -gtk_option_menu_new (void) -{ - return g_object_new (GTK_TYPE_OPTION_MENU, NULL); -} - -GtkWidget* -gtk_option_menu_get_menu (GtkOptionMenu *option_menu) -{ - g_return_val_if_fail (GTK_IS_OPTION_MENU (option_menu), NULL); - - return option_menu->menu; -} - -static void -gtk_option_menu_detacher (GtkWidget *widget, - GtkMenu *menu) -{ - GtkOptionMenu *option_menu; - - g_return_if_fail (GTK_IS_OPTION_MENU (widget)); - - option_menu = GTK_OPTION_MENU (widget); - g_return_if_fail (option_menu->menu == (GtkWidget*) menu); - - gtk_option_menu_remove_contents (option_menu); - g_signal_handlers_disconnect_by_func (option_menu->menu, - gtk_option_menu_selection_done, - option_menu); - g_signal_handlers_disconnect_by_func (option_menu->menu, - gtk_option_menu_calc_size, - option_menu); - - option_menu->menu = NULL; - g_object_notify (G_OBJECT (option_menu), "menu"); -} - -void -gtk_option_menu_set_menu (GtkOptionMenu *option_menu, - GtkWidget *menu) -{ - g_return_if_fail (GTK_IS_OPTION_MENU (option_menu)); - g_return_if_fail (GTK_IS_MENU (menu)); - - if (option_menu->menu != menu) - { - gtk_option_menu_remove_menu (option_menu); - - option_menu->menu = menu; - gtk_menu_attach_to_widget (GTK_MENU (menu), - GTK_WIDGET (option_menu), - gtk_option_menu_detacher); - - gtk_option_menu_calc_size (option_menu); - - g_signal_connect_after (option_menu->menu, "selection-done", - G_CALLBACK (gtk_option_menu_selection_done), - option_menu); - g_signal_connect_swapped (option_menu->menu, "size-request", - G_CALLBACK (gtk_option_menu_calc_size), - option_menu); - - if (GTK_WIDGET (option_menu)->parent) - gtk_widget_queue_resize (GTK_WIDGET (option_menu)); - - gtk_option_menu_update_contents (option_menu); - - g_object_notify (G_OBJECT (option_menu), "menu"); - } -} - -void -gtk_option_menu_remove_menu (GtkOptionMenu *option_menu) -{ - g_return_if_fail (GTK_IS_OPTION_MENU (option_menu)); - - if (option_menu->menu) - { - if (GTK_MENU_SHELL (option_menu->menu)->active) - gtk_menu_shell_cancel (GTK_MENU_SHELL (option_menu->menu)); - - gtk_menu_detach (GTK_MENU (option_menu->menu)); - } -} - -void -gtk_option_menu_set_history (GtkOptionMenu *option_menu, - guint index) -{ - GtkWidget *menu_item; - - g_return_if_fail (GTK_IS_OPTION_MENU (option_menu)); - - if (option_menu->menu) - { - gtk_menu_set_active (GTK_MENU (option_menu->menu), index); - menu_item = gtk_menu_get_active (GTK_MENU (option_menu->menu)); - - if (menu_item != option_menu->menu_item) - gtk_option_menu_update_contents (option_menu); - } -} - -/** - * gtk_option_menu_get_history: - * @option_menu: a #GtkOptionMenu - * - * Retrieves the index of the currently selected menu item. The menu - * items are numbered from top to bottom, starting with 0. - * - * Return value: index of the selected menu item, or -1 if there are no menu items - * Deprecated: 2.4: Use #GtkComboBox instead. - **/ -gint -gtk_option_menu_get_history (GtkOptionMenu *option_menu) -{ - GtkWidget *active_widget; - - g_return_val_if_fail (GTK_IS_OPTION_MENU (option_menu), -1); - - if (option_menu->menu) - { - active_widget = gtk_menu_get_active (GTK_MENU (option_menu->menu)); - - if (active_widget) - return g_list_index (GTK_MENU_SHELL (option_menu->menu)->children, - active_widget); - else - return -1; - } - else - return -1; -} - -static void -gtk_option_menu_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - GtkOptionMenu *option_menu = GTK_OPTION_MENU (object); - - switch (prop_id) - { - case PROP_MENU: - gtk_option_menu_set_menu (option_menu, g_value_get_object (value)); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -gtk_option_menu_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - GtkOptionMenu *option_menu = GTK_OPTION_MENU (object); - - switch (prop_id) - { - case PROP_MENU: - g_value_set_object (value, option_menu->menu); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -gtk_option_menu_destroy (GtkObject *object) -{ - GtkOptionMenu *option_menu = GTK_OPTION_MENU (object); - - if (option_menu->menu) - gtk_widget_destroy (option_menu->menu); - - GTK_OBJECT_CLASS (gtk_option_menu_parent_class)->destroy (object); -} - -static void -gtk_option_menu_get_props (GtkOptionMenu *option_menu, - GtkOptionMenuProps *props) -{ - GtkRequisition *indicator_size; - GtkBorder *indicator_spacing; - - gtk_widget_style_get (GTK_WIDGET (option_menu), - "indicator-size", &indicator_size, - "indicator-spacing", &indicator_spacing, - "interior-focus", &props->interior_focus, - "focus-line-width", &props->focus_width, - "focus-padding", &props->focus_pad, - NULL); - - if (indicator_size) - props->indicator_size = *indicator_size; - else - props->indicator_size = default_props.indicator_size; - - if (indicator_spacing) - props->indicator_spacing = *indicator_spacing; - else - props->indicator_spacing = default_props.indicator_spacing; - - gtk_requisition_free (indicator_size); - gtk_border_free (indicator_spacing); -} - -static void -gtk_option_menu_size_request (GtkWidget *widget, - GtkRequisition *requisition) -{ - GtkOptionMenu *option_menu = GTK_OPTION_MENU (widget); - GtkOptionMenuProps props; - gint tmp; - GtkRequisition child_requisition = { 0, 0 }; - - gtk_option_menu_get_props (option_menu, &props); - - if (GTK_BIN (option_menu)->child && gtk_widget_get_visible (GTK_BIN (option_menu)->child)) - { - gtk_widget_size_request (GTK_BIN (option_menu)->child, &child_requisition); - - requisition->width += child_requisition.width; - requisition->height += child_requisition.height; - } - - requisition->width = ((GTK_CONTAINER (widget)->border_width + - GTK_WIDGET (widget)->style->xthickness + props.focus_pad) * 2 + - MAX (child_requisition.width, option_menu->width) + - props.indicator_size.width + - props.indicator_spacing.left + props.indicator_spacing.right + - CHILD_LEFT_SPACING + CHILD_RIGHT_SPACING + props.focus_width * 2); - requisition->height = ((GTK_CONTAINER (widget)->border_width + - GTK_WIDGET (widget)->style->ythickness + props.focus_pad) * 2 + - MAX (child_requisition.height, option_menu->height) + - CHILD_TOP_SPACING + CHILD_BOTTOM_SPACING + props.focus_width * 2); - - tmp = (requisition->height - MAX (child_requisition.height, option_menu->height) + - props.indicator_size.height + props.indicator_spacing.top + props.indicator_spacing.bottom); - requisition->height = MAX (requisition->height, tmp); -} - -static void -gtk_option_menu_size_allocate (GtkWidget *widget, - GtkAllocation *allocation) -{ - GtkWidget *child; - GtkButton *button = GTK_BUTTON (widget); - GtkAllocation child_allocation; - GtkOptionMenuProps props; - gint border_width; - - gtk_option_menu_get_props (GTK_OPTION_MENU (widget), &props); - border_width = GTK_CONTAINER (widget)->border_width; - - widget->allocation = *allocation; - if (gtk_widget_get_realized (widget)) - gdk_window_move_resize (button->event_window, - allocation->x + border_width, allocation->y + border_width, - allocation->width - border_width * 2, allocation->height - border_width * 2); - - child = GTK_BIN (widget)->child; - if (child && gtk_widget_get_visible (child)) - { - gint xthickness = GTK_WIDGET (widget)->style->xthickness; - gint ythickness = GTK_WIDGET (widget)->style->ythickness; - - child_allocation.x = widget->allocation.x + border_width + xthickness + props.focus_width + props.focus_pad + CHILD_LEFT_SPACING; - child_allocation.y = widget->allocation.y + border_width + ythickness + props.focus_width + props.focus_pad + CHILD_TOP_SPACING; - child_allocation.width = MAX (1, allocation->width - (border_width + xthickness + props.focus_width + props.focus_pad) * 2 - - props.indicator_size.width - props.indicator_spacing.left - props.indicator_spacing.right - - CHILD_LEFT_SPACING - CHILD_RIGHT_SPACING); - child_allocation.height = MAX (1, allocation->height - (border_width + ythickness + props.focus_width + props.focus_pad) * 2 - - CHILD_TOP_SPACING - CHILD_BOTTOM_SPACING); - - if (gtk_widget_get_direction (GTK_WIDGET (widget)) == GTK_TEXT_DIR_RTL) - child_allocation.x += props.indicator_size.width + props.indicator_spacing.left + props.indicator_spacing.right; - - gtk_widget_size_allocate (child, &child_allocation); - } -} - -static void -gtk_option_menu_paint (GtkWidget *widget, - GdkRectangle *area) -{ - GdkRectangle button_area; - GtkOptionMenuProps props; - gint border_width; - gint tab_x; - - g_return_if_fail (GTK_IS_OPTION_MENU (widget)); - g_return_if_fail (area != NULL); - - if (GTK_WIDGET_DRAWABLE (widget)) - { - border_width = GTK_CONTAINER (widget)->border_width; - gtk_option_menu_get_props (GTK_OPTION_MENU (widget), &props); - - button_area.x = widget->allocation.x + border_width; - button_area.y = widget->allocation.y + border_width; - button_area.width = widget->allocation.width - 2 * border_width; - button_area.height = widget->allocation.height - 2 * border_width; - - if (!props.interior_focus && gtk_widget_has_focus (widget)) - { - button_area.x += props.focus_width + props.focus_pad; - button_area.y += props.focus_width + props.focus_pad; - button_area.width -= 2 * (props.focus_width + props.focus_pad); - button_area.height -= 2 * (props.focus_width + props.focus_pad); - } - - gtk_paint_box (widget->style, widget->window, - gtk_widget_get_state (widget), GTK_SHADOW_OUT, - area, widget, "optionmenu", - button_area.x, button_area.y, - button_area.width, button_area.height); - - if (gtk_widget_get_direction (GTK_WIDGET (widget)) == GTK_TEXT_DIR_RTL) - tab_x = button_area.x + props.indicator_spacing.right + - widget->style->xthickness; - else - tab_x = button_area.x + button_area.width - - props.indicator_size.width - props.indicator_spacing.right - - widget->style->xthickness; - - gtk_paint_tab (widget->style, widget->window, - gtk_widget_get_state (widget), GTK_SHADOW_OUT, - area, widget, "optionmenutab", - tab_x, - button_area.y + (button_area.height - props.indicator_size.height) / 2, - props.indicator_size.width, props.indicator_size.height); - - if (gtk_widget_has_focus (widget)) - { - if (props.interior_focus) - { - button_area.x += widget->style->xthickness + props.focus_pad; - button_area.y += widget->style->ythickness + props.focus_pad; - button_area.width -= 2 * (widget->style->xthickness + props.focus_pad) + - props.indicator_spacing.left + - props.indicator_spacing.right + - props.indicator_size.width; - button_area.height -= 2 * (widget->style->ythickness + props.focus_pad); - if (gtk_widget_get_direction (GTK_WIDGET (widget)) == GTK_TEXT_DIR_RTL) - button_area.x += props.indicator_spacing.left + - props.indicator_spacing.right + - props.indicator_size.width; - } - else - { - button_area.x -= props.focus_width + props.focus_pad; - button_area.y -= props.focus_width + props.focus_pad; - button_area.width += 2 * (props.focus_width + props.focus_pad); - button_area.height += 2 * (props.focus_width + props.focus_pad); - } - - gtk_paint_focus (widget->style, widget->window, gtk_widget_get_state (widget), - area, widget, "button", - button_area.x, - button_area.y, - button_area.width, - button_area.height); - } - } -} - -static gint -gtk_option_menu_expose (GtkWidget *widget, - GdkEventExpose *event) -{ - g_return_val_if_fail (GTK_IS_OPTION_MENU (widget), FALSE); - g_return_val_if_fail (event != NULL, FALSE); - - if (GTK_WIDGET_DRAWABLE (widget)) - { - gtk_option_menu_paint (widget, &event->area); - - - /* The following code tries to draw the child in two places at - * once. It fails miserably for several reasons - * - * - If the child is not no-window, removing generates - * more expose events. Bad, bad, bad. - * - * - Even if the child is no-window, removing it now (properly) - * clears the space where it was, so it does no good - */ - -#if 0 - remove_child = FALSE; - child = GTK_BUTTON (widget)->child; - - if (!child) - { - if (!GTK_OPTION_MENU (widget)->menu) - return FALSE; - gtk_option_menu_update_contents (GTK_OPTION_MENU (widget)); - child = GTK_BUTTON (widget)->child; - if (!child) - return FALSE; - remove_child = TRUE; - } - - child_event = *event; - - if (!gtk_widget_get_has_window (child) && - gtk_widget_intersect (child, &event->area, &child_event.area)) - gtk_widget_event (child, (GdkEvent*) &child_event); - - if (remove_child) - gtk_option_menu_remove_contents (GTK_OPTION_MENU (widget)); -#else - if (GTK_BIN (widget)->child) - gtk_container_propagate_expose (GTK_CONTAINER (widget), - GTK_BIN (widget)->child, - event); -#endif /* 0 */ - } - - return FALSE; -} - -static gint -gtk_option_menu_button_press (GtkWidget *widget, - GdkEventButton *event) -{ - GtkOptionMenu *option_menu; - GtkWidget *menu_item; - - g_return_val_if_fail (GTK_IS_OPTION_MENU (widget), FALSE); - g_return_val_if_fail (event != NULL, FALSE); - - option_menu = GTK_OPTION_MENU (widget); - - if ((event->type == GDK_BUTTON_PRESS) && - (event->button == 1)) - { - gtk_option_menu_remove_contents (option_menu); - gtk_menu_popup (GTK_MENU (option_menu->menu), NULL, NULL, - gtk_option_menu_position, option_menu, - event->button, event->time); - menu_item = gtk_menu_get_active (GTK_MENU (option_menu->menu)); - if (menu_item) - gtk_menu_shell_select_item (GTK_MENU_SHELL (option_menu->menu), menu_item); - return TRUE; - } - - return FALSE; -} - -static gint -gtk_option_menu_key_press (GtkWidget *widget, - GdkEventKey *event) -{ - GtkOptionMenu *option_menu; - GtkWidget *menu_item; - - g_return_val_if_fail (GTK_IS_OPTION_MENU (widget), FALSE); - g_return_val_if_fail (event != NULL, FALSE); - - option_menu = GTK_OPTION_MENU (widget); - - switch (event->keyval) - { - case GDK_KP_Space: - case GDK_space: - gtk_option_menu_remove_contents (option_menu); - gtk_menu_popup (GTK_MENU (option_menu->menu), NULL, NULL, - gtk_option_menu_position, option_menu, - 0, event->time); - menu_item = gtk_menu_get_active (GTK_MENU (option_menu->menu)); - if (menu_item) - gtk_menu_shell_select_item (GTK_MENU_SHELL (option_menu->menu), menu_item); - return TRUE; - } - - return FALSE; -} - -static void -gtk_option_menu_selection_done (GtkMenuShell *menu_shell, - GtkOptionMenu *option_menu) -{ - g_return_if_fail (menu_shell != NULL); - g_return_if_fail (GTK_IS_OPTION_MENU (option_menu)); - - gtk_option_menu_update_contents (option_menu); -} - -static void -gtk_option_menu_changed (GtkOptionMenu *option_menu) -{ - g_return_if_fail (GTK_IS_OPTION_MENU (option_menu)); - - g_signal_emit (option_menu, signals[CHANGED], 0); -} - -static void -gtk_option_menu_select_first_sensitive (GtkOptionMenu *option_menu) -{ - if (option_menu->menu) - { - GList *children = GTK_MENU_SHELL (option_menu->menu)->children; - gint index = 0; - - while (children) - { - if (gtk_widget_get_sensitive (children->data)) - { - gtk_option_menu_set_history (option_menu, index); - return; - } - - children = children->next; - index++; - } - } -} - -static void -gtk_option_menu_item_state_changed_cb (GtkWidget *widget, - GtkStateType previous_state, - GtkOptionMenu *option_menu) -{ - GtkWidget *child = GTK_BIN (option_menu)->child; - - if (child && gtk_widget_get_sensitive (child) != gtk_widget_is_sensitive (widget)) - gtk_widget_set_sensitive (child, gtk_widget_is_sensitive (widget)); -} - -static void -gtk_option_menu_item_destroy_cb (GtkWidget *widget, - GtkOptionMenu *option_menu) -{ - GtkWidget *child = GTK_BIN (option_menu)->child; - - if (child) - { - g_object_ref (child); - gtk_option_menu_remove_contents (option_menu); - gtk_widget_destroy (child); - g_object_unref (child); - - gtk_option_menu_select_first_sensitive (option_menu); - } -} - -static void -gtk_option_menu_update_contents (GtkOptionMenu *option_menu) -{ - GtkWidget *child; - GtkRequisition child_requisition; - - g_return_if_fail (GTK_IS_OPTION_MENU (option_menu)); - - if (option_menu->menu) - { - GtkWidget *old_item = option_menu->menu_item; - - gtk_option_menu_remove_contents (option_menu); - - option_menu->menu_item = gtk_menu_get_active (GTK_MENU (option_menu->menu)); - if (option_menu->menu_item) - { - g_object_ref (option_menu->menu_item); - child = GTK_BIN (option_menu->menu_item)->child; - if (child) - { - if (!gtk_widget_is_sensitive (option_menu->menu_item)) - gtk_widget_set_sensitive (child, FALSE); - gtk_widget_reparent (child, GTK_WIDGET (option_menu)); - } - - g_signal_connect (option_menu->menu_item, "state-changed", - G_CALLBACK (gtk_option_menu_item_state_changed_cb), option_menu); - g_signal_connect (option_menu->menu_item, "destroy", - G_CALLBACK (gtk_option_menu_item_destroy_cb), option_menu); - - gtk_widget_size_request (child, &child_requisition); - gtk_widget_size_allocate (GTK_WIDGET (option_menu), - &(GTK_WIDGET (option_menu)->allocation)); - - if (GTK_WIDGET_DRAWABLE (option_menu)) - gtk_widget_queue_draw (GTK_WIDGET (option_menu)); - } - - if (old_item != option_menu->menu_item) - gtk_option_menu_changed (option_menu); - } -} - -static void -gtk_option_menu_remove_contents (GtkOptionMenu *option_menu) -{ - GtkWidget *child; - - g_return_if_fail (GTK_IS_OPTION_MENU (option_menu)); - - if (option_menu->menu_item) - { - child = GTK_BIN (option_menu)->child; - - if (child) - { - gtk_widget_set_sensitive (child, TRUE); - gtk_widget_set_state (child, GTK_STATE_NORMAL); - gtk_widget_reparent (child, option_menu->menu_item); - } - - g_signal_handlers_disconnect_by_func (option_menu->menu_item, - gtk_option_menu_item_state_changed_cb, - option_menu); - g_signal_handlers_disconnect_by_func (option_menu->menu_item, - gtk_option_menu_item_destroy_cb, - option_menu); - - g_object_unref (option_menu->menu_item); - option_menu->menu_item = NULL; - } -} - -static void -gtk_option_menu_calc_size (GtkOptionMenu *option_menu) -{ - GtkWidget *child; - GList *children; - GtkRequisition child_requisition; - gint old_width = option_menu->width; - gint old_height = option_menu->height; - - g_return_if_fail (GTK_IS_OPTION_MENU (option_menu)); - - option_menu->width = 0; - option_menu->height = 0; - - if (option_menu->menu) - { - children = GTK_MENU_SHELL (option_menu->menu)->children; - while (children) - { - child = children->data; - children = children->next; - - if (gtk_widget_get_visible (child)) - { - GtkWidget *inner = GTK_BIN (child)->child; - - if (inner) - { - gtk_widget_size_request (inner, &child_requisition); - - option_menu->width = MAX (option_menu->width, child_requisition.width); - option_menu->height = MAX (option_menu->height, child_requisition.height); - } - } - } - } - - if (old_width != option_menu->width || old_height != option_menu->height) - gtk_widget_queue_resize (GTK_WIDGET (option_menu)); -} - -static void -gtk_option_menu_position (GtkMenu *menu, - gint *x, - gint *y, - gboolean *push_in, - gpointer user_data) -{ - GtkOptionMenu *option_menu; - GtkWidget *active; - GtkWidget *child; - GtkWidget *widget; - GtkRequisition requisition; - GList *children; - gint screen_width; - gint menu_xpos; - gint menu_ypos; - gint menu_width; - - g_return_if_fail (GTK_IS_OPTION_MENU (user_data)); - - option_menu = GTK_OPTION_MENU (user_data); - widget = GTK_WIDGET (option_menu); - - gtk_widget_get_child_requisition (GTK_WIDGET (menu), &requisition); - menu_width = requisition.width; - - active = gtk_menu_get_active (GTK_MENU (option_menu->menu)); - gdk_window_get_origin (widget->window, &menu_xpos, &menu_ypos); - - /* set combo box type hint for menu popup */ - gtk_window_set_type_hint (GTK_WINDOW (GTK_MENU (option_menu->menu)->toplevel), - GDK_WINDOW_TYPE_HINT_COMBO); - - menu_xpos += widget->allocation.x; - menu_ypos += widget->allocation.y + widget->allocation.height / 2 - 2; - - if (active != NULL) - { - gtk_widget_get_child_requisition (active, &requisition); - menu_ypos -= requisition.height / 2; - } - - children = GTK_MENU_SHELL (option_menu->menu)->children; - while (children) - { - child = children->data; - - if (active == child) - break; - - if (gtk_widget_get_visible (child)) - { - gtk_widget_get_child_requisition (child, &requisition); - menu_ypos -= requisition.height; - } - - children = children->next; - } - - if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) - menu_xpos = menu_xpos + widget->allocation.width - menu_width; - - /* Clamp the position on screen */ - screen_width = gdk_screen_get_width (gtk_widget_get_screen (widget)); - - if (menu_xpos < 0) - menu_xpos = 0; - else if ((menu_xpos + menu_width) > screen_width) - menu_xpos -= ((menu_xpos + menu_width) - screen_width); - - *x = menu_xpos; - *y = menu_ypos; - *push_in = TRUE; -} - - -static void -gtk_option_menu_show_all (GtkWidget *widget) -{ - GtkContainer *container; - GtkOptionMenu *option_menu; - - g_return_if_fail (GTK_IS_OPTION_MENU (widget)); - container = GTK_CONTAINER (widget); - option_menu = GTK_OPTION_MENU (widget); - - gtk_widget_show (widget); - gtk_container_foreach (container, (GtkCallback) gtk_widget_show_all, NULL); - if (option_menu->menu) - gtk_widget_show_all (option_menu->menu); - if (option_menu->menu_item) - gtk_widget_show_all (option_menu->menu_item); -} - - -static void -gtk_option_menu_hide_all (GtkWidget *widget) -{ - GtkContainer *container; - - g_return_if_fail (GTK_IS_OPTION_MENU (widget)); - container = GTK_CONTAINER (widget); - - gtk_widget_hide (widget); - gtk_container_foreach (container, (GtkCallback) gtk_widget_hide_all, NULL); -} - -static gboolean -gtk_option_menu_mnemonic_activate (GtkWidget *widget, - gboolean group_cycling) -{ - gtk_widget_grab_focus (widget); - return TRUE; -} - -static gint -gtk_option_menu_scroll_event (GtkWidget *widget, - GdkEventScroll *event) -{ - GtkOptionMenu *option_menu = GTK_OPTION_MENU (widget); - gint index; - gint n_children; - gint index_dir; - GList *l; - GtkMenuItem *item; - - index = gtk_option_menu_get_history (option_menu); - - if (index != -1) - { - n_children = g_list_length (GTK_MENU_SHELL (option_menu->menu)->children); - - if (event->direction == GDK_SCROLL_UP) - index_dir = -1; - else - index_dir = 1; - - - while (TRUE) - { - index += index_dir; - - if (index < 0) - break; - if (index >= n_children) - break; - - l = g_list_nth (GTK_MENU_SHELL (option_menu->menu)->children, index); - item = GTK_MENU_ITEM (l->data); - if (gtk_widget_get_visible (GTK_WIDGET (item)) && - gtk_widget_is_sensitive (GTK_WIDGET (item))) - { - gtk_option_menu_set_history (option_menu, index); - gtk_menu_item_activate (GTK_MENU_ITEM (item)); - break; - } - - } - } - - return TRUE; -} - -#define __GTK_OPTION_MENU_C__ -#include "gtkaliasdef.c" - diff --git a/gtk/gtkoptionmenu.h b/gtk/gtkoptionmenu.h deleted file mode 100644 index 8521020edd..0000000000 --- a/gtk/gtkoptionmenu.h +++ /dev/null @@ -1,88 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#ifndef GTK_DISABLE_DEPRECATED - -#ifndef __GTK_OPTION_MENU_H__ -#define __GTK_OPTION_MENU_H__ - -#include - - -G_BEGIN_DECLS - -#define GTK_TYPE_OPTION_MENU (gtk_option_menu_get_type ()) -#define GTK_OPTION_MENU(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_OPTION_MENU, GtkOptionMenu)) -#define GTK_OPTION_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_OPTION_MENU, GtkOptionMenuClass)) -#define GTK_IS_OPTION_MENU(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_OPTION_MENU)) -#define GTK_IS_OPTION_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_OPTION_MENU)) -#define GTK_OPTION_MENU_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_OPTION_MENU, GtkOptionMenuClass)) - - -typedef struct _GtkOptionMenu GtkOptionMenu; -typedef struct _GtkOptionMenuClass GtkOptionMenuClass; - -struct _GtkOptionMenu -{ - GtkButton button; - - GtkWidget *menu; - GtkWidget *menu_item; - - guint16 width; - guint16 height; -}; - -struct _GtkOptionMenuClass -{ - GtkButtonClass parent_class; - - void (*changed) (GtkOptionMenu *option_menu); - - /* Padding for future expansion */ - void (*_gtk_reserved1) (void); - void (*_gtk_reserved2) (void); - void (*_gtk_reserved3) (void); - void (*_gtk_reserved4) (void); -}; - - -GType gtk_option_menu_get_type (void) G_GNUC_CONST; -GtkWidget* gtk_option_menu_new (void); -GtkWidget* gtk_option_menu_get_menu (GtkOptionMenu *option_menu); -void gtk_option_menu_set_menu (GtkOptionMenu *option_menu, - GtkWidget *menu); -void gtk_option_menu_remove_menu (GtkOptionMenu *option_menu); -gint gtk_option_menu_get_history (GtkOptionMenu *option_menu); -void gtk_option_menu_set_history (GtkOptionMenu *option_menu, - guint index_); - - -G_END_DECLS - -#endif /* __GTK_OPTION_MENU_H__ */ - -#endif /* GTK_DISABLE_DEPRECATED */ diff --git a/gtk/gtkorientable.c b/gtk/gtkorientable.c index 95102cb5d9..636f65da8f 100644 --- a/gtk/gtkorientable.c +++ b/gtk/gtkorientable.c @@ -29,6 +29,22 @@ #include "gtkalias.h" +/** + * SECTION:gtkorientable + * @Short_description: An interface for flippable widgets + * @Title: GtkOrientable + * + * The #GtkOrientable interface is implemented by all widgets that can be + * oriented horizontally or vertically. Historically, such widgets have been + * realized as subclasses of a common base class (e.g #GtkBox/#GtkHBox/#GtkVBox + * or #GtkScale/#GtkHScale/#GtkVScale). #GtkOrientable is more flexible in that + * it allows the orientation to be changed at runtime, allowing the widgets + * to 'flip'. + * + * #GtkOrientable was introduced in GTK+ 2.16. + */ + + typedef GtkOrientableIface GtkOrientableInterface; G_DEFINE_INTERFACE (GtkOrientable, gtk_orientable, G_TYPE_OBJECT) diff --git a/gtk/gtkpagesetup.h b/gtk/gtkpagesetup.h index d5eaea6d5d..b310e5c93a 100644 --- a/gtk/gtkpagesetup.h +++ b/gtk/gtkpagesetup.h @@ -18,7 +18,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkpagesetupunixdialog.c b/gtk/gtkpagesetupunixdialog.c index c5f63bf708..19a19a77e1 100644 --- a/gtk/gtkpagesetupunixdialog.c +++ b/gtk/gtkpagesetupunixdialog.c @@ -57,6 +57,21 @@ #include "gtkalias.h" +/** + * SECTION:gtkpagesetupunixdialog + * @Short_description: A page setup dialog + * @Title: GtkPageSetupUnixDialog + * + * #GtkPageSetupUnixDialog implements a page setup dialog for platforms + * which don't provide a native page setup dialog, like Unix. It can + * be used very much like any other GTK+ dialog, at the cost of + * the portability offered by the high-level printing API + * + * Printing support was added in GTK+ 2.10. + */ + + struct GtkPageSetupUnixDialogPrivate { GtkListStore *printer_list; diff --git a/gtk/gtkpagesetupunixdialog.h b/gtk/gtkpagesetupunixdialog.h index f64d004d9b..58d7b611f8 100644 --- a/gtk/gtkpagesetupunixdialog.h +++ b/gtk/gtkpagesetupunixdialog.h @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_UNIX_PRINT_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_UNIX_PRINT_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c index a24468697b..e17131f8f3 100644 --- a/gtk/gtkpaned.c +++ b/gtk/gtkpaned.c @@ -150,12 +150,13 @@ struct _GtkPanedPrivate GtkWidget *saved_focus; GtkPaned *first_paned; guint32 grab_time; + GdkDevice *grab_device; }; -G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GtkPaned, gtk_paned, GTK_TYPE_CONTAINER, - G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE, - NULL)) +G_DEFINE_TYPE_WITH_CODE (GtkPaned, gtk_paned, GTK_TYPE_CONTAINER, + G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE, + NULL)) static guint signals[LAST_SIGNAL] = { 0 }; @@ -1215,18 +1216,20 @@ gtk_paned_button_press (GtkWidget *widget, { /* We need a server grab here, not gtk_grab_add(), since * we don't want to pass events on to the widget's children */ - if (gdk_pointer_grab (paned->handle, FALSE, - GDK_POINTER_MOTION_HINT_MASK - | GDK_BUTTON1_MOTION_MASK - | GDK_BUTTON_RELEASE_MASK - | GDK_ENTER_NOTIFY_MASK - | GDK_LEAVE_NOTIFY_MASK, - NULL, NULL, - event->time) != GDK_GRAB_SUCCESS) + if (gdk_device_grab (event->device, + paned->handle, + GDK_OWNERSHIP_WINDOW, FALSE, + GDK_POINTER_MOTION_HINT_MASK + | GDK_BUTTON1_MOTION_MASK + | GDK_BUTTON_RELEASE_MASK + | GDK_ENTER_NOTIFY_MASK + | GDK_LEAVE_NOTIFY_MASK, + NULL, event->time) != GDK_GRAB_SUCCESS) return FALSE; paned->in_drag = TRUE; paned->priv->grab_time = event->time; + paned->priv->grab_device = event->device; if (paned->priv->orientation == GTK_ORIENTATION_HORIZONTAL) paned->drag_pos = event->x; @@ -1258,8 +1261,10 @@ stop_drag (GtkPaned *paned) paned->in_drag = FALSE; paned->drag_pos = -1; paned->position_set = TRUE; - gdk_display_pointer_ungrab (gtk_widget_get_display (GTK_WIDGET (paned)), - paned->priv->grab_time); + + gdk_device_ungrab (paned->priv->grab_device, + paned->priv->grab_time); + paned->priv->grab_device = NULL; } static void @@ -1267,8 +1272,12 @@ gtk_paned_grab_notify (GtkWidget *widget, gboolean was_grabbed) { GtkPaned *paned = GTK_PANED (widget); + GdkDevice *grab_device; - if (!was_grabbed && paned->in_drag) + grab_device = paned->priv->grab_device; + + if (paned->in_drag && grab_device && + gtk_widget_device_is_shadowed (widget, grab_device)) stop_drag (paned); } @@ -1325,7 +1334,6 @@ gtk_paned_motion (GtkWidget *widget, return FALSE; } -#if 0 /** * gtk_paned_new: * @orientation: the paned's orientation. @@ -1334,7 +1342,7 @@ gtk_paned_motion (GtkWidget *widget, * * Return value: a new #GtkPaned. * - * Since: 2.16 + * Since: 3.0 **/ GtkWidget * gtk_paned_new (GtkOrientation orientation) @@ -1343,7 +1351,6 @@ gtk_paned_new (GtkOrientation orientation) "orientation", orientation, NULL); } -#endif void gtk_paned_add1 (GtkPaned *paned, @@ -1570,17 +1577,6 @@ gtk_paned_get_child2 (GtkPaned *paned) return paned->child2; } -void -gtk_paned_compute_position (GtkPaned *paned, - gint allocation, - gint child1_req, - gint child2_req) -{ - g_return_if_fail (GTK_IS_PANED (paned)); - - gtk_paned_calc_position (paned, allocation, child1_req, child2_req); -} - static void gtk_paned_calc_position (GtkPaned *paned, gint allocation, @@ -2233,7 +2229,7 @@ gtk_paned_toggle_handle_focus (GtkPaned *paned) /** * gtk_paned_get_handle_window: - * @panede: a #GtkPaned + * @paned: a #GtkPaned * * Returns the #GdkWindow of the handle. This function is * useful when handling button or motion events because it diff --git a/gtk/gtkpaned.h b/gtk/gtkpaned.h index 1da08a88f1..1a2861165d 100644 --- a/gtk/gtkpaned.h +++ b/gtk/gtkpaned.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -107,6 +107,7 @@ struct _GtkPanedClass GType gtk_paned_get_type (void) G_GNUC_CONST; +GtkWidget * gtk_paned_new (GtkOrientation orientation); void gtk_paned_add1 (GtkPaned *paned, GtkWidget *child); void gtk_paned_add2 (GtkPaned *paned, @@ -129,15 +130,6 @@ GtkWidget * gtk_paned_get_child2 (GtkPaned *paned); GdkWindow * gtk_paned_get_handle_window (GtkPaned *paned); -#ifndef GTK_DISABLE_DEPRECATED -/* Internal function */ -void gtk_paned_compute_position (GtkPaned *paned, - gint allocation, - gint child1_req, - gint child2_req); -#define gtk_paned_gutter_size(p,s) (void) 0 -#define gtk_paned_set_gutter_size(p,s) (void) 0 -#endif /* GTK_DISABLE_DEPRECATED */ G_END_DECLS diff --git a/gtk/gtkpapersize.c b/gtk/gtkpapersize.c index 7188cefe6c..894dca0b87 100644 --- a/gtk/gtkpapersize.c +++ b/gtk/gtkpapersize.c @@ -669,10 +669,11 @@ gtk_paper_size_get_default (void) if (!locale) return GTK_PAPER_NAME_A4; - if (g_str_has_prefix (locale, "en_CA") || - g_str_has_prefix (locale, "en_US") || - g_str_has_prefix (locale, "es_PR") || - g_str_has_prefix (locale, "es_US")) + /* CLDR 1.8.1 + * http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/territory_language_information.html + */ + if (g_regex_match_simple("[^_.@]{2,3}_(BZ|CA|CL|CO|CR|GT|MX|NI|PA|PH|PR|SV|US|VE)", + locale, G_REGEX_ANCHORED, G_REGEX_MATCH_ANCHORED)) paper_size = GTK_PAPER_NAME_LETTER; else paper_size = GTK_PAPER_NAME_A4; diff --git a/gtk/gtkpapersize.h b/gtk/gtkpapersize.h index 18302cae77..a3ef2f1067 100644 --- a/gtk/gtkpapersize.h +++ b/gtk/gtkpapersize.h @@ -18,7 +18,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c index 87bec1adfc..10c1f3cb8a 100644 --- a/gtk/gtkpathbar.c +++ b/gtk/gtkpathbar.c @@ -461,6 +461,7 @@ gtk_path_bar_size_allocate (GtkWidget *widget, gint border_width; gboolean need_sliders = FALSE; gint up_slider_offset = 0; + GtkRequisition child_requisition; widget->allocation = *allocation; @@ -481,13 +482,15 @@ gtk_path_bar_size_allocate (GtkWidget *widget, if (path_bar->fake_root) width = path_bar->spacing + path_bar->slider_width; else - width = 0; + width = 0; for (list = path_bar->button_list; list; list = list->next) { child = BUTTON_DATA (list->data)->button; - width += child->requisition.width + path_bar->spacing; + gtk_widget_get_child_requisition (child, &child_requisition); + + width += child_requisition.width + path_bar->spacing; if (list == path_bar->fake_root) break; } @@ -515,19 +518,23 @@ gtk_path_bar_size_allocate (GtkWidget *widget, * button, then count backwards. */ /* Count down the path chain towards the end. */ - width = BUTTON_DATA (first_button->data)->button->requisition.width; + gtk_widget_get_child_requisition (BUTTON_DATA (first_button->data)->button, &child_requisition); + + width = child_requisition.width; list = first_button->prev; while (list && !reached_end) { child = BUTTON_DATA (list->data)->button; - if (width + child->requisition.width + + gtk_widget_get_child_requisition (child, &child_requisition); + + if (width + child_requisition.width + path_bar->spacing + slider_space > allocation_width) reached_end = TRUE; else if (list == path_bar->fake_root) break; else - width += child->requisition.width + path_bar->spacing; + width += child_requisition.width + path_bar->spacing; list = list->prev; } @@ -538,13 +545,15 @@ gtk_path_bar_size_allocate (GtkWidget *widget, { child = BUTTON_DATA (first_button->next->data)->button; - if (width + child->requisition.width + path_bar->spacing + slider_space > allocation_width) + gtk_widget_get_child_requisition (child, &child_requisition); + + if (width + child_requisition.width + path_bar->spacing + slider_space > allocation_width) { reached_end = TRUE; } else { - width += child->requisition.width + path_bar->spacing; + width += child_requisition.width + path_bar->spacing; if (first_button == path_bar->fake_root) break; first_button = first_button->next; @@ -582,7 +591,9 @@ gtk_path_bar_size_allocate (GtkWidget *widget, button_data = BUTTON_DATA (list->data); child = button_data->button; - child_allocation.width = MIN (child->requisition.width, + gtk_widget_get_child_requisition (child, &child_requisition); + + child_allocation.width = MIN (child_requisition.width, allocation_width - (path_bar->spacing + path_bar->slider_width) * 2); if (direction == GTK_TEXT_DIR_RTL) @@ -601,7 +612,7 @@ gtk_path_bar_size_allocate (GtkWidget *widget, break; } - if (child_allocation.width < child->requisition.width) + if (child_allocation.width < child_requisition.width) { if (!gtk_widget_get_has_tooltip (child)) gtk_widget_set_tooltip_text (child, button_data->dir_name); diff --git a/gtk/gtkpixmap.c b/gtk/gtkpixmap.c deleted file mode 100644 index e22e5edb78..0000000000 --- a/gtk/gtkpixmap.c +++ /dev/null @@ -1,286 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * Insensitive pixmap building code by Eckehard Berns from GNOME Stock - * Copyright (C) 1997, 1998 Free Software Foundation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#include "config.h" -#include - -#undef GTK_DISABLE_DEPRECATED -#define __GTK_PIXMAP_C__ - -#include "gtkcontainer.h" -#include "gtkpixmap.h" -#include "gtkintl.h" - -#include "gtkalias.h" - - -static gint gtk_pixmap_expose (GtkWidget *widget, - GdkEventExpose *event); -static void gtk_pixmap_finalize (GObject *object); -static void build_insensitive_pixmap (GtkPixmap *gtkpixmap); - -G_DEFINE_TYPE (GtkPixmap, gtk_pixmap, GTK_TYPE_MISC) - -static void -gtk_pixmap_class_init (GtkPixmapClass *class) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (class); - GtkWidgetClass *widget_class; - - widget_class = (GtkWidgetClass*) class; - - gobject_class->finalize = gtk_pixmap_finalize; - - widget_class->expose_event = gtk_pixmap_expose; -} - -static void -gtk_pixmap_init (GtkPixmap *pixmap) -{ - gtk_widget_set_has_window (GTK_WIDGET (pixmap), FALSE); - - pixmap->pixmap = NULL; - pixmap->mask = NULL; -} - -/** - * gtk_pixmap_new: - * @mask: (allow-none): - */ -GtkWidget* -gtk_pixmap_new (GdkPixmap *val, - GdkBitmap *mask) -{ - GtkPixmap *pixmap; - - g_return_val_if_fail (val != NULL, NULL); - - pixmap = gtk_type_new (gtk_pixmap_get_type ()); - - pixmap->build_insensitive = TRUE; - gtk_pixmap_set (pixmap, val, mask); - - return GTK_WIDGET (pixmap); -} - -static void -gtk_pixmap_finalize (GObject *object) -{ - gtk_pixmap_set (GTK_PIXMAP (object), NULL, NULL); - - G_OBJECT_CLASS (gtk_pixmap_parent_class)->finalize (object); -} - -void -gtk_pixmap_set (GtkPixmap *pixmap, - GdkPixmap *val, - GdkBitmap *mask) -{ - gint width; - gint height; - gint oldwidth; - gint oldheight; - - g_return_if_fail (GTK_IS_PIXMAP (pixmap)); - if(GDK_IS_DRAWABLE(val)) - g_return_if_fail (gdk_colormap_get_visual (gtk_widget_get_colormap (GTK_WIDGET (pixmap)))->depth == gdk_drawable_get_depth (GDK_DRAWABLE (val))); - - if (pixmap->pixmap != val) - { - oldwidth = GTK_WIDGET (pixmap)->requisition.width; - oldheight = GTK_WIDGET (pixmap)->requisition.height; - if (pixmap->pixmap) - g_object_unref (pixmap->pixmap); - if (pixmap->pixmap_insensitive) - g_object_unref (pixmap->pixmap_insensitive); - pixmap->pixmap = val; - pixmap->pixmap_insensitive = NULL; - if (pixmap->pixmap) - { - g_object_ref (pixmap->pixmap); - gdk_drawable_get_size (pixmap->pixmap, &width, &height); - GTK_WIDGET (pixmap)->requisition.width = - width + GTK_MISC (pixmap)->xpad * 2; - GTK_WIDGET (pixmap)->requisition.height = - height + GTK_MISC (pixmap)->ypad * 2; - } - else - { - GTK_WIDGET (pixmap)->requisition.width = 0; - GTK_WIDGET (pixmap)->requisition.height = 0; - } - if (gtk_widget_get_visible (GTK_WIDGET (pixmap))) - { - if ((GTK_WIDGET (pixmap)->requisition.width != oldwidth) || - (GTK_WIDGET (pixmap)->requisition.height != oldheight)) - gtk_widget_queue_resize (GTK_WIDGET (pixmap)); - else - gtk_widget_queue_draw (GTK_WIDGET (pixmap)); - } - } - - if (pixmap->mask != mask) - { - if (pixmap->mask) - g_object_unref (pixmap->mask); - pixmap->mask = mask; - if (pixmap->mask) - g_object_ref (pixmap->mask); - } -} - -void -gtk_pixmap_get (GtkPixmap *pixmap, - GdkPixmap **val, - GdkBitmap **mask) -{ - g_return_if_fail (GTK_IS_PIXMAP (pixmap)); - - if (val) - *val = pixmap->pixmap; - if (mask) - *mask = pixmap->mask; -} - -static gint -gtk_pixmap_expose (GtkWidget *widget, - GdkEventExpose *event) -{ - GtkPixmap *pixmap; - GtkMisc *misc; - gint x, y; - gfloat xalign; - - g_return_val_if_fail (GTK_IS_PIXMAP (widget), FALSE); - g_return_val_if_fail (event != NULL, FALSE); - - if (GTK_WIDGET_DRAWABLE (widget)) - { - pixmap = GTK_PIXMAP (widget); - misc = GTK_MISC (widget); - - if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR) - xalign = misc->xalign; - else - xalign = 1.0 - misc->xalign; - - x = floor (widget->allocation.x + misc->xpad - + ((widget->allocation.width - widget->requisition.width) * xalign)); - y = floor (widget->allocation.y + misc->ypad - + ((widget->allocation.height - widget->requisition.height) * misc->yalign)); - - if (pixmap->mask) - { - gdk_gc_set_clip_mask (widget->style->black_gc, pixmap->mask); - gdk_gc_set_clip_origin (widget->style->black_gc, x, y); - } - - if (gtk_widget_get_state (widget) == GTK_STATE_INSENSITIVE - && pixmap->build_insensitive) - { - if (!pixmap->pixmap_insensitive) - build_insensitive_pixmap (pixmap); - gdk_draw_drawable (widget->window, - widget->style->black_gc, - pixmap->pixmap_insensitive, - 0, 0, x, y, -1, -1); - } - else - { - gdk_draw_drawable (widget->window, - widget->style->black_gc, - pixmap->pixmap, - 0, 0, x, y, -1, -1); - } - - if (pixmap->mask) - { - gdk_gc_set_clip_mask (widget->style->black_gc, NULL); - gdk_gc_set_clip_origin (widget->style->black_gc, 0, 0); - } - } - return FALSE; -} - -void -gtk_pixmap_set_build_insensitive (GtkPixmap *pixmap, gboolean build) -{ - g_return_if_fail (GTK_IS_PIXMAP (pixmap)); - - pixmap->build_insensitive = build; - - if (gtk_widget_get_visible (GTK_WIDGET (pixmap))) - { - gtk_widget_queue_draw (GTK_WIDGET (pixmap)); - } -} - -static void -build_insensitive_pixmap (GtkPixmap *gtkpixmap) -{ - GdkPixmap *pixmap = gtkpixmap->pixmap; - GdkPixmap *insensitive; - gint w, h; - GdkPixbuf *pixbuf; - GdkPixbuf *stated; - - gdk_drawable_get_size (pixmap, &w, &h); - - pixbuf = gdk_pixbuf_get_from_drawable (NULL, - pixmap, - gtk_widget_get_colormap (GTK_WIDGET (gtkpixmap)), - 0, 0, - 0, 0, - w, h); - - stated = gdk_pixbuf_copy (pixbuf); - - gdk_pixbuf_saturate_and_pixelate (pixbuf, stated, - 0.8, TRUE); - - g_object_unref (pixbuf); - pixbuf = NULL; - - insensitive = gdk_pixmap_new (GTK_WIDGET (gtkpixmap)->window, w, h, -1); - - gdk_draw_pixbuf (insensitive, - GTK_WIDGET (gtkpixmap)->style->white_gc, - stated, - 0, 0, - 0, 0, - w, h, - GDK_RGB_DITHER_NORMAL, - 0, 0); - - gtkpixmap->pixmap_insensitive = insensitive; - - g_object_unref (stated); -} - -#include "gtkaliasdef.c" diff --git a/gtk/gtkpixmap.h b/gtk/gtkpixmap.h deleted file mode 100644 index 21fa349938..0000000000 --- a/gtk/gtkpixmap.h +++ /dev/null @@ -1,83 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#if !defined (GTK_DISABLE_DEPRECATED) || defined (__GTK_PIXMAP_C__) - -#ifndef __GTK_PIXMAP_H__ -#define __GTK_PIXMAP_H__ - -#include - - -G_BEGIN_DECLS - -#define GTK_TYPE_PIXMAP (gtk_pixmap_get_type ()) -#define GTK_PIXMAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_PIXMAP, GtkPixmap)) -#define GTK_PIXMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_PIXMAP, GtkPixmapClass)) -#define GTK_IS_PIXMAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_PIXMAP)) -#define GTK_IS_PIXMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_PIXMAP)) -#define GTK_PIXMAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_PIXMAP, GtkPixmapClass)) - - -typedef struct _GtkPixmap GtkPixmap; -typedef struct _GtkPixmapClass GtkPixmapClass; - -struct _GtkPixmap -{ - GtkMisc misc; - - GdkPixmap *pixmap; - GdkBitmap *mask; - - GdkPixmap *pixmap_insensitive; - guint build_insensitive : 1; -}; - -struct _GtkPixmapClass -{ - GtkMiscClass parent_class; -}; - - -GType gtk_pixmap_get_type (void) G_GNUC_CONST; -GtkWidget* gtk_pixmap_new (GdkPixmap *pixmap, - GdkBitmap *mask); -void gtk_pixmap_set (GtkPixmap *pixmap, - GdkPixmap *val, - GdkBitmap *mask); -void gtk_pixmap_get (GtkPixmap *pixmap, - GdkPixmap **val, - GdkBitmap **mask); - -void gtk_pixmap_set_build_insensitive (GtkPixmap *pixmap, - gboolean build); - - -G_END_DECLS - -#endif /* __GTK_PIXMAP_H__ */ - -#endif /* GTK_DISABLE_DEPRECATED */ diff --git a/gtk/gtkplug-x11.c b/gtk/gtkplug-x11.c index 95dcf1ab6f..d0df6f54c5 100644 --- a/gtk/gtkplug-x11.c +++ b/gtk/gtkplug-x11.c @@ -25,6 +25,21 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ +#include "config.h" + +#ifdef XINPUT_2 + +/* Hack to have keyboard events interpreted + * regardless of the default device manager + */ +#define GDK_COMPILATION +#include "x11/gdkdevicemanager-core.h" +#include "x11/gdkdevicemanager-xi2.h" +#include "x11/gdkeventtranslator.h" +#undef GDK_COMPILATION + +#endif /* XINPUT_2 */ + #include "gtkmain.h" #include "gtkmarshalers.h" #include "gtkplug.h" @@ -208,7 +223,7 @@ _gtk_plug_windowing_filter_func (GdkXEvent *gdk_xevent, XEvent *xevent = (XEvent *)gdk_xevent; GdkFilterReturn return_val; - + return_val = GDK_FILTER_CONTINUE; switch (xevent->type) @@ -326,6 +341,61 @@ _gtk_plug_windowing_filter_func (GdkXEvent *gdk_xevent, break; } + +#ifdef XINPUT_2 + case KeyPress: + case KeyRelease: + { + static GdkDeviceManager *core_device_manager = NULL; + GdkDeviceManager *device_manager; + GdkEvent *translated_event; + GList *devices, *d; + GdkDevice *keyboard = NULL; + + device_manager = gdk_display_get_device_manager (display); + + /* bail out if the device manager already + * interprets core keyboard events. + */ + if (!GDK_IS_DEVICE_MANAGER_XI2 (device_manager)) + return GDK_FILTER_CONTINUE; + + /* Find out the first keyboard device, the + * generated event will be assigned to it. + */ + devices = gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_MASTER); + + for (d = devices; d; d = d->next) + { + GdkDevice *device = d->data; + + if (device->source == GDK_SOURCE_KEYBOARD) + keyboard = device; + } + + g_list_free (devices); + + if (!keyboard) + return GDK_FILTER_CONTINUE; + + /* This is a crude hack so key events + * are interpreted as if there was a + * GdkDeviceManagerCore available. + */ + if (G_UNLIKELY (!core_device_manager)) + core_device_manager = g_object_new (GDK_TYPE_DEVICE_MANAGER_CORE, + "display", display, + NULL); + + translated_event = gdk_event_translator_translate (GDK_EVENT_TRANSLATOR (core_device_manager), display, xevent); + gdk_event_set_device (translated_event, keyboard); + + gtk_main_do_event (translated_event); + gdk_event_free (translated_event); + + return_val = GDK_FILTER_REMOVE; + } +#endif } return return_val; diff --git a/gtk/gtkplug.h b/gtk/gtkplug.h index 3ea9971960..c96ca774fa 100644 --- a/gtk/gtkplug.h +++ b/gtk/gtkplug.h @@ -23,7 +23,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkpreview.c b/gtk/gtkpreview.c deleted file mode 100644 index 458fed4efe..0000000000 --- a/gtk/gtkpreview.c +++ /dev/null @@ -1,565 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#include "config.h" - -#include -#include -#include -#ifdef HAVE_SYS_PARAM_H -#include -#endif - -#undef GTK_DISABLE_DEPRECATED - -#include "gtkpreview.h" -#include "gtkprivate.h" -#include "gtkintl.h" -#include "gtkalias.h" - - -#define PREVIEW_CLASS(w) GTK_PREVIEW_CLASS (GTK_OBJECT (w)->klass) - -enum { - PROP_0, - PROP_EXPAND -}; - - -static void gtk_preview_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec); -static void gtk_preview_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec); -static void gtk_preview_finalize (GObject *object); -static void gtk_preview_realize (GtkWidget *widget); -static void gtk_preview_size_allocate (GtkWidget *widget, - GtkAllocation *allocation); -static gint gtk_preview_expose (GtkWidget *widget, - GdkEventExpose *event); -static void gtk_preview_make_buffer (GtkPreview *preview); -static void gtk_fill_lookup_array (guchar *array); - -static GtkPreviewClass *preview_class = NULL; -static gint install_cmap = FALSE; - - -G_DEFINE_TYPE (GtkPreview, gtk_preview, GTK_TYPE_WIDGET) - -static void -gtk_preview_class_init (GtkPreviewClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - GtkWidgetClass *widget_class; - - widget_class = (GtkWidgetClass*) klass; - - preview_class = klass; - - gobject_class->finalize = gtk_preview_finalize; - - gobject_class->set_property = gtk_preview_set_property; - gobject_class->get_property = gtk_preview_get_property; - - widget_class->realize = gtk_preview_realize; - widget_class->size_allocate = gtk_preview_size_allocate; - widget_class->expose_event = gtk_preview_expose; - - klass->info.lookup = NULL; - - klass->info.gamma = 1.0; - - g_object_class_install_property (gobject_class, - PROP_EXPAND, - g_param_spec_boolean ("expand", - P_("Expand"), - P_("Whether the preview widget should take up the entire space it is allocated"), - FALSE, - GTK_PARAM_READWRITE)); -} - -static void -gtk_preview_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - GtkPreview *preview = GTK_PREVIEW (object); - - switch (prop_id) - { - case PROP_EXPAND: - gtk_preview_set_expand (preview, g_value_get_boolean (value)); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -gtk_preview_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - GtkPreview *preview; - - preview = GTK_PREVIEW (object); - - switch (prop_id) - { - case PROP_EXPAND: - g_value_set_boolean (value, preview->expand); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -void -gtk_preview_reset (void) -{ - /* unimplemented */ -} - -static void -gtk_preview_init (GtkPreview *preview) -{ - preview->buffer = NULL; - preview->buffer_width = 0; - preview->buffer_height = 0; - preview->expand = FALSE; -} - -void -gtk_preview_uninit (void) -{ - /* unimplemented */ -} - -GtkWidget* -gtk_preview_new (GtkPreviewType type) -{ - GtkPreview *preview; - - preview = gtk_type_new (gtk_preview_get_type ()); - preview->type = type; - - if (type == GTK_PREVIEW_COLOR) - preview->bpp = 3; - else - preview->bpp = 1; - - preview->dither = GDK_RGB_DITHER_NORMAL; - - return GTK_WIDGET (preview); -} - -void -gtk_preview_size (GtkPreview *preview, - gint width, - gint height) -{ - g_return_if_fail (GTK_IS_PREVIEW (preview)); - - if ((width != GTK_WIDGET (preview)->requisition.width) || - (height != GTK_WIDGET (preview)->requisition.height)) - { - GTK_WIDGET (preview)->requisition.width = width; - GTK_WIDGET (preview)->requisition.height = height; - - g_free (preview->buffer); - preview->buffer = NULL; - } -} - -void -gtk_preview_put (GtkPreview *preview, - GdkWindow *window, - GdkGC *gc, - gint srcx, - gint srcy, - gint destx, - gint desty, - gint width, - gint height) -{ - GdkRectangle r1, r2, r3; - guchar *src; - guint bpp; - guint rowstride; - - g_return_if_fail (GTK_IS_PREVIEW (preview)); - g_return_if_fail (window != NULL); - - if (!preview->buffer) - return; - - r1.x = 0; - r1.y = 0; - r1.width = preview->buffer_width; - r1.height = preview->buffer_height; - - r2.x = srcx; - r2.y = srcy; - r2.width = width; - r2.height = height; - - if (!gdk_rectangle_intersect (&r1, &r2, &r3)) - return; - - bpp = preview->bpp; - rowstride = preview->rowstride; - - src = preview->buffer + r3.y * rowstride + r3.x * bpp; - - if (preview->type == GTK_PREVIEW_COLOR) - gdk_draw_rgb_image (window, - gc, - destx + (r3.x - srcx), - desty + (r3.y - srcy), - r3.width, - r3.height, - preview->dither, - src, - rowstride); - else - gdk_draw_gray_image (window, - gc, - destx + (r3.x - srcx), - desty + (r3.y - srcy), - r3.width, - r3.height, - preview->dither, - src, - rowstride); - -} - -void -gtk_preview_draw_row (GtkPreview *preview, - guchar *data, - gint x, - gint y, - gint w) -{ - guint bpp; - guint rowstride; - - g_return_if_fail (GTK_IS_PREVIEW (preview)); - g_return_if_fail (data != NULL); - - bpp = (preview->type == GTK_PREVIEW_COLOR ? 3 : 1); - rowstride = (preview->buffer_width * bpp + 3) & -4; - - if ((w <= 0) || (y < 0)) - return; - - g_return_if_fail (data != NULL); - - gtk_preview_make_buffer (preview); - - if (x + w > preview->buffer_width) - return; - - if (y + 1 > preview->buffer_height) - return; - - if (preview_class->info.gamma == 1.0) - memcpy (preview->buffer + y * rowstride + x * bpp, data, w * bpp); - else - { - guint i, size; - guchar *src, *dst; - guchar *lookup; - - if (preview_class->info.lookup != NULL) - lookup = preview_class->info.lookup; - else - { - preview_class->info.lookup = g_new (guchar, 256); - gtk_fill_lookup_array (preview_class->info.lookup); - lookup = preview_class->info.lookup; - } - size = w * bpp; - src = data; - dst = preview->buffer + y * rowstride + x * bpp; - for (i = 0; i < size; i++) - *dst++ = lookup[*src++]; - } -} - -void -gtk_preview_set_expand (GtkPreview *preview, - gboolean expand) -{ - g_return_if_fail (GTK_IS_PREVIEW (preview)); - - expand = expand != FALSE; - - if (preview->expand != expand) - { - preview->expand = expand; - gtk_widget_queue_resize (GTK_WIDGET (preview)); - - g_object_notify (G_OBJECT (preview), "expand"); - } -} - -void -gtk_preview_set_gamma (double _gamma) -{ - if (!preview_class) - preview_class = gtk_type_class (gtk_preview_get_type ()); - - if (preview_class->info.gamma != _gamma) - { - preview_class->info.gamma = _gamma; - if (preview_class->info.lookup != NULL) - { - g_free (preview_class->info.lookup); - preview_class->info.lookup = NULL; - } - } -} - -void -gtk_preview_set_color_cube (guint nred_shades, - guint ngreen_shades, - guint nblue_shades, - guint ngray_shades) -{ - /* unimplemented */ -} - -void -gtk_preview_set_install_cmap (gint _install_cmap) -{ - /* effectively unimplemented */ - install_cmap = _install_cmap; -} - -void -gtk_preview_set_reserved (gint nreserved) -{ - - /* unimplemented */ -} - -void -gtk_preview_set_dither (GtkPreview *preview, - GdkRgbDither dither) -{ - preview->dither = dither; -} - -GdkVisual* -gtk_preview_get_visual (void) -{ - return gdk_screen_get_rgb_visual (gdk_screen_get_default ()); -} - -GdkColormap* -gtk_preview_get_cmap (void) -{ - return gdk_screen_get_rgb_colormap (gdk_screen_get_default ()); -} - -GtkPreviewInfo* -gtk_preview_get_info (void) -{ - if (!preview_class) - preview_class = gtk_type_class (gtk_preview_get_type ()); - - return &preview_class->info; -} - - -static void -gtk_preview_finalize (GObject *object) -{ - GtkPreview *preview = GTK_PREVIEW (object); - - g_free (preview->buffer); - - G_OBJECT_CLASS (gtk_preview_parent_class)->finalize (object); -} - -static void -gtk_preview_realize (GtkWidget *widget) -{ - GtkPreview *preview = GTK_PREVIEW (widget); - GdkWindowAttr attributes; - gint attributes_mask; - - gtk_widget_set_realized (widget, TRUE); - - attributes.window_type = GDK_WINDOW_CHILD; - - if (preview->expand) - { - attributes.width = widget->allocation.width; - attributes.height = widget->allocation.height; - } - else - { - attributes.width = MIN (widget->requisition.width, widget->allocation.width); - attributes.height = MIN (widget->requisition.height, widget->allocation.height); - } - - attributes.x = widget->allocation.x + (widget->allocation.width - attributes.width) / 2; - attributes.y = widget->allocation.y + (widget->allocation.height - attributes.height) / 2;; - - attributes.wclass = GDK_INPUT_OUTPUT; - attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK; - attributes_mask = GDK_WA_X | GDK_WA_Y; - - widget->window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask); - gdk_window_set_user_data (widget->window, widget); - - widget->style = gtk_style_attach (widget->style, widget->window); - gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL); -} - -static void -gtk_preview_size_allocate (GtkWidget *widget, - GtkAllocation *allocation) -{ - GtkPreview *preview = GTK_PREVIEW (widget); - gint width, height; - - widget->allocation = *allocation; - - if (gtk_widget_get_realized (widget)) - { - if (preview->expand) - { - width = widget->allocation.width; - height = widget->allocation.height; - } - else - { - width = MIN (widget->allocation.width, widget->requisition.width); - height = MIN (widget->allocation.height, widget->requisition.height); - } - - gdk_window_move_resize (widget->window, - widget->allocation.x + (widget->allocation.width - width) / 2, - widget->allocation.y + (widget->allocation.height - height) / 2, - width, height); - } -} - -static gint -gtk_preview_expose (GtkWidget *widget, - GdkEventExpose *event) -{ - GtkPreview *preview; - gint width, height; - - if (GTK_WIDGET_DRAWABLE (widget)) - { - preview = GTK_PREVIEW (widget); - - gdk_drawable_get_size (widget->window, &width, &height); - - gtk_preview_put (GTK_PREVIEW (widget), - widget->window, widget->style->black_gc, - event->area.x - (width - preview->buffer_width)/2, - event->area.y - (height - preview->buffer_height)/2, - event->area.x, event->area.y, - event->area.width, event->area.height); - } - - return FALSE; -} - -static void -gtk_preview_make_buffer (GtkPreview *preview) -{ - GtkWidget *widget; - gint width; - gint height; - - g_return_if_fail (GTK_IS_PREVIEW (preview)); - - widget = GTK_WIDGET (preview); - - if (preview->expand && - (widget->allocation.width != 0) && - (widget->allocation.height != 0)) - { - width = widget->allocation.width; - height = widget->allocation.height; - } - else - { - width = widget->requisition.width; - height = widget->requisition.height; - } - - if (!preview->buffer || - (preview->buffer_width != width) || - (preview->buffer_height != height)) - { - g_free (preview->buffer); - - preview->buffer_width = width; - preview->buffer_height = height; - - preview->rowstride = (preview->buffer_width * preview->bpp + 3) & -4; - preview->buffer = g_new0 (guchar, - preview->buffer_height * - preview->rowstride); - } -} - -/* This is used for implementing gamma. */ -static void -gtk_fill_lookup_array (guchar *array) -{ - double one_over_gamma; - double ind; - int val; - int i; - - one_over_gamma = 1.0 / preview_class->info.gamma; - - for (i = 0; i < 256; i++) - { - ind = (double) i / 255.0; - val = (int) (255 * pow (ind, one_over_gamma)); - array[i] = val; - } -} - -#define __GTK_PREVIEW_C__ -#include "gtkaliasdef.c" diff --git a/gtk/gtkpreview.h b/gtk/gtkpreview.h deleted file mode 100644 index 5e87c94aa3..0000000000 --- a/gtk/gtkpreview.h +++ /dev/null @@ -1,137 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#ifndef GTK_DISABLE_DEPRECATED - -#ifndef __GTK_PREVIEW_H__ -#define __GTK_PREVIEW_H__ - -#include - - -G_BEGIN_DECLS - -#define GTK_TYPE_PREVIEW (gtk_preview_get_type ()) -#define GTK_PREVIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_PREVIEW, GtkPreview)) -#define GTK_PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_PREVIEW, GtkPreviewClass)) -#define GTK_IS_PREVIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_PREVIEW)) -#define GTK_IS_PREVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_PREVIEW)) -#define GTK_PREVIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_PREVIEW, GtkPreviewClass)) - - -typedef struct _GtkPreview GtkPreview; -typedef struct _GtkPreviewInfo GtkPreviewInfo; -typedef union _GtkDitherInfo GtkDitherInfo; -typedef struct _GtkPreviewClass GtkPreviewClass; - -struct _GtkPreview -{ - GtkWidget widget; - - guchar *buffer; - guint16 buffer_width; - guint16 buffer_height; - - guint16 bpp; - guint16 rowstride; - - GdkRgbDither dither; - - guint type : 1; - guint expand : 1; -}; - -struct _GtkPreviewInfo -{ - guchar *lookup; - - gdouble gamma; -}; - -union _GtkDitherInfo -{ - gushort s[2]; - guchar c[4]; -}; - -struct _GtkPreviewClass -{ - GtkWidgetClass parent_class; - - GtkPreviewInfo info; - -}; - - -GType gtk_preview_get_type (void) G_GNUC_CONST; -void gtk_preview_uninit (void); -GtkWidget* gtk_preview_new (GtkPreviewType type); -void gtk_preview_size (GtkPreview *preview, - gint width, - gint height); -void gtk_preview_put (GtkPreview *preview, - GdkWindow *window, - GdkGC *gc, - gint srcx, - gint srcy, - gint destx, - gint desty, - gint width, - gint height); -void gtk_preview_draw_row (GtkPreview *preview, - guchar *data, - gint x, - gint y, - gint w); -void gtk_preview_set_expand (GtkPreview *preview, - gboolean expand); - -void gtk_preview_set_gamma (double gamma_); -void gtk_preview_set_color_cube (guint nred_shades, - guint ngreen_shades, - guint nblue_shades, - guint ngray_shades); -void gtk_preview_set_install_cmap (gint install_cmap); -void gtk_preview_set_reserved (gint nreserved); -void gtk_preview_set_dither (GtkPreview *preview, - GdkRgbDither dither); -GdkVisual* gtk_preview_get_visual (void); -GdkColormap* gtk_preview_get_cmap (void); -GtkPreviewInfo* gtk_preview_get_info (void); - -/* This function reinitializes the preview colormap and visual from - * the current gamma/color_cube/install_cmap settings. It must only - * be called if there are no previews or users's of the preview - * colormap in existence. - */ -void gtk_preview_reset (void); - - -G_END_DECLS - -#endif /* __GTK_PREVIEW_H__ */ - -#endif /* GTK_DISABLE_DEPRECATED */ diff --git a/gtk/gtkprintcontext.h b/gtk/gtkprintcontext.h index 30572d6835..b38fd15ac4 100644 --- a/gtk/gtkprintcontext.h +++ b/gtk/gtkprintcontext.h @@ -18,7 +18,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkprinter.c b/gtk/gtkprinter.c index 1ffaaf5bcb..928896ab1f 100644 --- a/gtk/gtkprinter.c +++ b/gtk/gtkprinter.c @@ -31,6 +31,25 @@ #include "gtkprintjob.h" #include "gtkalias.h" + +/** + * SECTION:gtkprinter + * @Short_description: Represents a printer + * @Title: GtkPrinter + * + * A #GtkPrinter object represents a printer. You only need to + * deal directly with printers if you use the non-portable + * #GtkPrintUnixDialog API. + * + * A #GtkPrinter allows to get status information about the printer, + * such as its description, its location, the number of queued jobs, + * etc. Most importantly, a #GtkPrinter object can be used to create + * a #GtkPrintJob object, which lets you print to the printer. + * + * Printing support was added in GTK+ 2.10. + */ + + #define GTK_PRINTER_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE ((o), GTK_TYPE_PRINTER, GtkPrinterPrivate)) diff --git a/gtk/gtkprinter.h b/gtk/gtkprinter.h index 527582c95d..cb5bcbd056 100644 --- a/gtk/gtkprinter.h +++ b/gtk/gtkprinter.h @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_UNIX_PRINT_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_UNIX_PRINT_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -119,6 +119,19 @@ gboolean gtk_printer_get_hard_margins (GtkPrinter *pr gdouble *left, gdouble *right); +/** + * GtkPrinterFunc: + * @printer: a #GtkPrinter + * @data: user data passed to gtk_enumerate_printers() + * + * The type of function passed to gtk_enumerate_printers(). + * Note that you need to ref @printer, if you want to keep + * a reference to it after the function has returned. + * + * Returns: %TRUE to stop the enumeration, %FALSE to continue + * + * Since: 2.10 + */ typedef gboolean (*GtkPrinterFunc) (GtkPrinter *printer, gpointer data); diff --git a/gtk/gtkprinteroptionwidget.c b/gtk/gtkprinteroptionwidget.c index 413b8281f1..a4e6f0cf43 100644 --- a/gtk/gtkprinteroptionwidget.c +++ b/gtk/gtkprinteroptionwidget.c @@ -792,7 +792,7 @@ construct_widgets (GtkPrinterOptionWidget *widget) /* TODO: make this a gtkfilechooserentry once we move to GTK */ priv->entry = gtk_entry_new (); - priv->combo = gtk_file_chooser_button_new (source->display_text, + priv->combo = gtk_file_chooser_button_new (_("Select a folder"), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER); g_object_set (priv->combo, "local-only", FALSE, NULL); diff --git a/gtk/gtkprintjob.h b/gtk/gtkprintjob.h index fd821840f9..e1c5845289 100644 --- a/gtk/gtkprintjob.h +++ b/gtk/gtkprintjob.h @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_UNIX_PRINT_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_UNIX_PRINT_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -42,9 +42,9 @@ typedef struct _GtkPrintJob GtkPrintJob; typedef struct _GtkPrintJobClass GtkPrintJobClass; typedef struct _GtkPrintJobPrivate GtkPrintJobPrivate; -typedef void (*GtkPrintJobCompleteFunc) (GtkPrintJob *print_job, - gpointer user_data, - GError *error); +typedef void (*GtkPrintJobCompleteFunc) (GtkPrintJob *print_job, + gpointer user_data, + const GError *error); struct _GtkPrinter; diff --git a/gtk/gtkprintoperation-unix.c b/gtk/gtkprintoperation-unix.c index dbf622846f..896871ab22 100644 --- a/gtk/gtkprintoperation-unix.c +++ b/gtk/gtkprintoperation-unix.c @@ -306,20 +306,10 @@ _gtk_print_operation_platform_backend_launch_preview (GtkPrintOperation *op, out: if (error != NULL) { - GtkWidget *edialog; - edialog = gtk_message_dialog_new (parent, - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_CLOSE, - _("Error launching preview") /* FIXME better text */); - gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (edialog), - "%s", error->message); - g_signal_connect (edialog, "response", - G_CALLBACK (gtk_widget_destroy), NULL); - - gtk_window_present (GTK_WINDOW (edialog)); - - g_error_free (error); + if (op->priv->error == NULL) + op->priv->error = error; + else + g_error_free (error); filename_used = FALSE; settings_used = FALSE; @@ -341,29 +331,15 @@ _gtk_print_operation_platform_backend_launch_preview (GtkPrintOperation *op, } static void -unix_finish_send (GtkPrintJob *job, - gpointer user_data, - GError *error) +unix_finish_send (GtkPrintJob *job, + gpointer user_data, + const GError *error) { GtkPrintOperation *op = (GtkPrintOperation *) user_data; GtkPrintOperationUnix *op_unix = op->priv->platform_data; - if (error != NULL) - { - GtkWidget *edialog; - edialog = gtk_message_dialog_new (op_unix->parent, - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_CLOSE, - _("Error printing") /* FIXME better text */); - gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (edialog), - "%s", error->message); - gtk_window_set_modal (GTK_WINDOW (edialog), TRUE); - g_signal_connect (edialog, "response", - G_CALLBACK (gtk_widget_destroy), NULL); - - gtk_window_present (GTK_WINDOW (edialog)); - } + if (error != NULL && op->priv->error == NULL) + op->priv->error = g_error_copy (error); op_unix->data_sent = TRUE; diff --git a/gtk/gtkprintoperation.c b/gtk/gtkprintoperation.c index 72285730c6..a633bcdb7e 100644 --- a/gtk/gtkprintoperation.c +++ b/gtk/gtkprintoperation.c @@ -205,6 +205,7 @@ static void preview_iface_end_preview (GtkPrintOperationPreview *preview) { GtkPrintOperation *op; + GtkPrintOperationResult result; op = GTK_PRINT_OPERATION (preview); @@ -218,7 +219,14 @@ preview_iface_end_preview (GtkPrintOperationPreview *preview) _gtk_print_operation_set_status (op, GTK_PRINT_STATUS_FINISHED, NULL); - g_signal_emit (op, signals[DONE], 0, GTK_PRINT_OPERATION_RESULT_APPLY); + if (op->priv->error) + result = GTK_PRINT_OPERATION_RESULT_ERROR; + else if (op->priv->cancelled) + result = GTK_PRINT_OPERATION_RESULT_CANCEL; + else + result = GTK_PRINT_OPERATION_RESULT_APPLY; + + g_signal_emit (op, signals[DONE], 0, result); } static gboolean @@ -1294,7 +1302,7 @@ gtk_print_operation_class_init (GtkPrintOperationClass *class) PROP_HAS_SELECTION, g_param_spec_boolean ("has-selection", P_("Has Selection"), - P_("TRUE if a selecion exists."), + P_("TRUE if a selection exists."), FALSE, GTK_PARAM_READWRITE)); @@ -2228,10 +2236,18 @@ print_pages_idle_done (gpointer user_data) g_main_loop_quit (priv->rloop); if (!data->is_preview) - g_signal_emit (data->op, signals[DONE], 0, - priv->cancelled ? - GTK_PRINT_OPERATION_RESULT_CANCEL : - GTK_PRINT_OPERATION_RESULT_APPLY); + { + GtkPrintOperationResult result; + + if (priv->error) + result = GTK_PRINT_OPERATION_RESULT_ERROR; + else if (priv->cancelled) + result = GTK_PRINT_OPERATION_RESULT_CANCEL; + else + result = GTK_PRINT_OPERATION_RESULT_APPLY; + + g_signal_emit (data->op, signals[DONE], 0, result); + } g_object_unref (data->op); g_free (data->pages); @@ -2854,8 +2870,19 @@ print_pages (GtkPrintOperation *op, if (!do_print) { + GtkPrintOperationResult tmp_result; + _gtk_print_operation_set_status (op, GTK_PRINT_STATUS_FINISHED_ABORTED, NULL); - g_signal_emit (op, signals[DONE], 0, result); + + if (priv->error) + tmp_result = GTK_PRINT_OPERATION_RESULT_ERROR; + else if (priv->cancelled) + tmp_result = GTK_PRINT_OPERATION_RESULT_CANCEL; + else + tmp_result = result; + + g_signal_emit (op, signals[DONE], 0, tmp_result); + return; } @@ -3132,8 +3159,13 @@ gtk_print_operation_run (GtkPrintOperation *op, print_pages (op, parent, do_print, result); if (priv->error && error) - *error = g_error_copy (priv->error); - + { + *error = g_error_copy (priv->error); + result = GTK_PRINT_OPERATION_RESULT_ERROR; + } + else if (priv->cancelled) + result = GTK_PRINT_OPERATION_RESULT_CANCEL; + return result; } diff --git a/gtk/gtkprintoperation.h b/gtk/gtkprintoperation.h index ef9a2879f3..fed196a3e7 100644 --- a/gtk/gtkprintoperation.h +++ b/gtk/gtkprintoperation.h @@ -18,7 +18,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkprintoperationpreview.h b/gtk/gtkprintoperationpreview.h index a36b4afb71..850b0806e0 100644 --- a/gtk/gtkprintoperationpreview.h +++ b/gtk/gtkprintoperationpreview.h @@ -18,7 +18,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkprintsettings.h b/gtk/gtkprintsettings.h index 267854c351..102c6c497a 100644 --- a/gtk/gtkprintsettings.h +++ b/gtk/gtkprintsettings.h @@ -18,7 +18,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkprintunixdialog.h b/gtk/gtkprintunixdialog.h index 4ff22e4ed8..f0bb798012 100644 --- a/gtk/gtkprintunixdialog.h +++ b/gtk/gtkprintunixdialog.h @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_UNIX_PRINT_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_UNIX_PRINT_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkprivate.h b/gtk/gtkprivate.h index 7ba5a5db62..8db5c48518 100644 --- a/gtk/gtkprivate.h +++ b/gtk/gtkprivate.h @@ -35,37 +35,41 @@ G_BEGIN_DECLS */ typedef enum { - PRIVATE_GTK_USER_STYLE = 1 << 0, - PRIVATE_GTK_RESIZE_PENDING = 1 << 2, - PRIVATE_GTK_HAS_POINTER = 1 << 3, /* If the pointer is above a window belonging to the widget */ - PRIVATE_GTK_SHADOWED = 1 << 4, /* If there is a grab in effect shadowing the widget */ - PRIVATE_GTK_HAS_SHAPE_MASK = 1 << 5, - PRIVATE_GTK_IN_REPARENT = 1 << 6, - PRIVATE_GTK_DIRECTION_SET = 1 << 7, /* If the reading direction is not DIR_NONE */ - PRIVATE_GTK_DIRECTION_LTR = 1 << 8, /* If the reading direction is DIR_LTR */ - PRIVATE_GTK_ANCHORED = 1 << 9, /* If widget has a GtkWindow ancestor */ - PRIVATE_GTK_CHILD_VISIBLE = 1 << 10, /* If widget should be mapped when parent is mapped */ - PRIVATE_GTK_REDRAW_ON_ALLOC = 1 << 11, /* If we should queue a draw on the entire widget when it is reallocated */ - PRIVATE_GTK_ALLOC_NEEDED = 1 << 12, /* If we we should allocate even if the allocation is the same */ - PRIVATE_GTK_REQUEST_NEEDED = 1 << 13 /* Whether we need to call gtk_widget_size_request */ + PRIVATE_GTK_USER_STYLE = 1 << 0, + PRIVATE_GTK_RESIZE_PENDING = 1 << 2, + PRIVATE_GTK_HAS_POINTER = 1 << 3, /* If the pointer is above a window belonging to the widget */ + PRIVATE_GTK_SHADOWED = 1 << 4, /* If there is a grab in effect shadowing the widget */ + PRIVATE_GTK_HAS_SHAPE_MASK = 1 << 5, + PRIVATE_GTK_IN_REPARENT = 1 << 6, + PRIVATE_GTK_DIRECTION_SET = 1 << 7, /* If the reading direction is not DIR_NONE */ + PRIVATE_GTK_DIRECTION_LTR = 1 << 8, /* If the reading direction is DIR_LTR */ + PRIVATE_GTK_ANCHORED = 1 << 9, /* If widget has a GtkWindow ancestor */ + PRIVATE_GTK_CHILD_VISIBLE = 1 << 10, /* If widget should be mapped when parent is mapped */ + PRIVATE_GTK_REDRAW_ON_ALLOC = 1 << 11, /* If we should queue a draw on the entire widget when it is reallocated */ + PRIVATE_GTK_ALLOC_NEEDED = 1 << 12, /* If we we should allocate even if the allocation is the same */ + PRIVATE_GTK_REQUEST_NEEDED = 1 << 13, /* Whether we need to call gtk_widget_size_request */ + PRIVATE_GTK_WIDTH_REQUEST_NEEDED = 1 << 14, /* Whether we need to call gtk_extended_layout_get_desired_width */ + PRIVATE_GTK_HEIGHT_REQUEST_NEEDED = 1 << 15 /* Whether we need to call gtk_extended_layout_get_desired_height */ } GtkPrivateFlags; /* Macros for extracting a widgets private_flags from GtkWidget. */ -#define GTK_PRIVATE_FLAGS(wid) (GTK_WIDGET (wid)->private_flags) -#define GTK_WIDGET_USER_STYLE(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_USER_STYLE) != 0) -#define GTK_CONTAINER_RESIZE_PENDING(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_RESIZE_PENDING) != 0) -#define GTK_WIDGET_HAS_POINTER(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_HAS_POINTER) != 0) -#define GTK_WIDGET_SHADOWED(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_SHADOWED) != 0) -#define GTK_WIDGET_HAS_SHAPE_MASK(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_HAS_SHAPE_MASK) != 0) -#define GTK_WIDGET_IN_REPARENT(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_IN_REPARENT) != 0) -#define GTK_WIDGET_DIRECTION_SET(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_DIRECTION_SET) != 0) -#define GTK_WIDGET_DIRECTION_LTR(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_DIRECTION_LTR) != 0) -#define GTK_WIDGET_ANCHORED(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_ANCHORED) != 0) -#define GTK_WIDGET_CHILD_VISIBLE(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_CHILD_VISIBLE) != 0) -#define GTK_WIDGET_REDRAW_ON_ALLOC(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_REDRAW_ON_ALLOC) != 0) -#define GTK_WIDGET_ALLOC_NEEDED(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_ALLOC_NEEDED) != 0) -#define GTK_WIDGET_REQUEST_NEEDED(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_REQUEST_NEEDED) != 0) +#define GTK_PRIVATE_FLAGS(wid) (GTK_WIDGET (wid)->private_flags) +#define GTK_WIDGET_USER_STYLE(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_USER_STYLE) != 0) +#define GTK_CONTAINER_RESIZE_PENDING(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_RESIZE_PENDING) != 0) +#define GTK_WIDGET_HAS_POINTER(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_HAS_POINTER) != 0) +#define GTK_WIDGET_SHADOWED(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_SHADOWED) != 0) +#define GTK_WIDGET_HAS_SHAPE_MASK(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_HAS_SHAPE_MASK) != 0) +#define GTK_WIDGET_IN_REPARENT(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_IN_REPARENT) != 0) +#define GTK_WIDGET_DIRECTION_SET(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_DIRECTION_SET) != 0) +#define GTK_WIDGET_DIRECTION_LTR(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_DIRECTION_LTR) != 0) +#define GTK_WIDGET_ANCHORED(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_ANCHORED) != 0) +#define GTK_WIDGET_CHILD_VISIBLE(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_CHILD_VISIBLE) != 0) +#define GTK_WIDGET_REDRAW_ON_ALLOC(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_REDRAW_ON_ALLOC) != 0) +#define GTK_WIDGET_ALLOC_NEEDED(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_ALLOC_NEEDED) != 0) +#define GTK_WIDGET_REQUEST_NEEDED(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_REQUEST_NEEDED) != 0) +#define GTK_WIDGET_WIDTH_REQUEST_NEEDED(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_WIDTH_REQUEST_NEEDED) != 0) +#define GTK_WIDGET_HEIGHT_REQUEST_NEEDED(obj) ((GTK_PRIVATE_FLAGS (obj) & PRIVATE_GTK_HEIGHT_REQUEST_NEEDED) != 0) /* Macros for setting and clearing private widget flags. * we use a preprocessor string concatenation here for a clear diff --git a/gtk/gtkprogress.c b/gtk/gtkprogress.c index 8f46de45da..fd5585f204 100644 --- a/gtk/gtkprogress.c +++ b/gtk/gtkprogress.c @@ -274,7 +274,7 @@ static gboolean gtk_progress_expose (GtkWidget *widget, GdkEventExpose *event) { - if (GTK_WIDGET_DRAWABLE (widget)) + if (gtk_widget_is_drawable (widget)) gdk_draw_drawable (widget->window, widget->style->black_gc, GTK_PROGRESS (widget)->offscreen_pixmap, @@ -636,7 +636,7 @@ gtk_progress_set_text_alignment (GtkProgress *progress, } g_object_thaw_notify (G_OBJECT (progress)); - if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (progress))) + if (gtk_widget_is_drawable (GTK_WIDGET (progress))) gtk_widget_queue_resize (GTK_WIDGET (progress)); } } @@ -703,7 +703,7 @@ gtk_progress_set_activity_mode (GtkProgress *progress, if (progress->activity_mode) GTK_PROGRESS_GET_CLASS (progress)->act_mode_enter (progress); - if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (progress))) + if (gtk_widget_is_drawable (GTK_WIDGET (progress))) gtk_widget_queue_resize (GTK_WIDGET (progress)); g_object_notify (G_OBJECT (progress), "activity-mode"); diff --git a/gtk/gtkprogressbar.c b/gtk/gtkprogressbar.c index 798c6b43ef..0274f62221 100644 --- a/gtk/gtkprogressbar.c +++ b/gtk/gtkprogressbar.c @@ -52,12 +52,6 @@ enum { PROP_TEXT, PROP_ELLIPSIZE, - /* Deprecated args */ - PROP_ADJUSTMENT, - PROP_BAR_STYLE, - PROP_ACTIVITY_STEP, - PROP_ACTIVITY_BLOCKS, - PROP_DISCRETE_BLOCKS }; static void gtk_progress_bar_set_property (GObject *object, @@ -78,15 +72,15 @@ static void gtk_progress_bar_real_update (GtkProgress *progress); static void gtk_progress_bar_paint (GtkProgress *progress); static void gtk_progress_bar_act_mode_enter (GtkProgress *progress); -static void gtk_progress_bar_set_bar_style_internal (GtkProgressBar *pbar, - GtkProgressBarStyle style); -static void gtk_progress_bar_set_discrete_blocks_internal (GtkProgressBar *pbar, - guint blocks); -static void gtk_progress_bar_set_activity_step_internal (GtkProgressBar *pbar, - guint step); -static void gtk_progress_bar_set_activity_blocks_internal (GtkProgressBar *pbar, - guint blocks); +typedef struct +{ + gchar* text; + gdouble fraction; +} GtkProgressBarPrivate; + +#define GTK_PROGRESS_BAR_GET_PRIVATE(o) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((o), GTK_TYPE_PROGRESS_BAR, GtkProgressBarPrivate)) G_DEFINE_TYPE (GtkProgressBar, gtk_progress_bar, GTK_TYPE_PROGRESS) @@ -112,14 +106,6 @@ gtk_progress_bar_class_init (GtkProgressBarClass *class) progress_class->update = gtk_progress_bar_real_update; progress_class->act_mode_enter = gtk_progress_bar_act_mode_enter; - g_object_class_install_property (gobject_class, - PROP_ADJUSTMENT, - g_param_spec_object ("adjustment", - P_("Adjustment"), - P_("The GtkAdjustment connected to the progress bar (Deprecated)"), - GTK_TYPE_ADJUSTMENT, - GTK_PARAM_READWRITE)); - g_object_class_install_property (gobject_class, PROP_ORIENTATION, g_param_spec_enum ("orientation", @@ -128,39 +114,6 @@ gtk_progress_bar_class_init (GtkProgressBarClass *class) GTK_TYPE_PROGRESS_BAR_ORIENTATION, GTK_PROGRESS_LEFT_TO_RIGHT, GTK_PARAM_READWRITE)); - - g_object_class_install_property (gobject_class, - PROP_BAR_STYLE, - g_param_spec_enum ("bar-style", - P_("Bar style"), - P_("Specifies the visual style of the bar in percentage mode (Deprecated)"), - GTK_TYPE_PROGRESS_BAR_STYLE, - GTK_PROGRESS_CONTINUOUS, - GTK_PARAM_READWRITE)); - - g_object_class_install_property (gobject_class, - PROP_ACTIVITY_STEP, - g_param_spec_uint ("activity-step", - P_("Activity Step"), - P_("The increment used for each iteration in activity mode (Deprecated)"), - 0, G_MAXUINT, 3, - GTK_PARAM_READWRITE)); - - g_object_class_install_property (gobject_class, - PROP_ACTIVITY_BLOCKS, - g_param_spec_uint ("activity-blocks", - P_("Activity Blocks"), - P_("The number of blocks which can fit in the progress bar area in activity mode (Deprecated)"), - 2, G_MAXUINT, 5, - GTK_PARAM_READWRITE)); - - g_object_class_install_property (gobject_class, - PROP_DISCRETE_BLOCKS, - g_param_spec_uint ("discrete-blocks", - P_("Discrete Blocks"), - P_("The number of discrete blocks in a progress bar (when shown in the discrete style)"), - 2, G_MAXUINT, 10, - GTK_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_FRACTION, @@ -274,11 +227,15 @@ gtk_progress_bar_class_init (GtkProgressBarClass *class) P_("The minimum vertical height of the progress bar"), 1, G_MAXINT, MIN_VERTICAL_BAR_HEIGHT, G_PARAM_READWRITE)); + + g_type_class_add_private (class, sizeof (GtkProgressBarPrivate)); } static void gtk_progress_bar_init (GtkProgressBar *pbar) { + GtkProgressBarPrivate* priv; + pbar->bar_style = GTK_PROGRESS_CONTINUOUS; pbar->blocks = 10; pbar->in_block = -1; @@ -289,6 +246,11 @@ gtk_progress_bar_init (GtkProgressBar *pbar) pbar->activity_step = 3; pbar->activity_blocks = 5; pbar->ellipsize = PANGO_ELLIPSIZE_NONE; + + /* FIXME: Put priv in the structure once we break ABI */ + priv = GTK_PROGRESS_BAR_GET_PRIVATE (pbar); + priv->text = NULL; + priv->fraction = 0.0; } static void @@ -303,25 +265,9 @@ gtk_progress_bar_set_property (GObject *object, switch (prop_id) { - case PROP_ADJUSTMENT: - gtk_progress_set_adjustment (GTK_PROGRESS (pbar), - GTK_ADJUSTMENT (g_value_get_object (value))); - break; case PROP_ORIENTATION: gtk_progress_bar_set_orientation (pbar, g_value_get_enum (value)); break; - case PROP_BAR_STYLE: - gtk_progress_bar_set_bar_style_internal (pbar, g_value_get_enum (value)); - break; - case PROP_ACTIVITY_STEP: - gtk_progress_bar_set_activity_step_internal (pbar, g_value_get_uint (value)); - break; - case PROP_ACTIVITY_BLOCKS: - gtk_progress_bar_set_activity_blocks_internal (pbar, g_value_get_uint (value)); - break; - case PROP_DISCRETE_BLOCKS: - gtk_progress_bar_set_discrete_blocks_internal (pbar, g_value_get_uint (value)); - break; case PROP_FRACTION: gtk_progress_bar_set_fraction (pbar, g_value_get_double (value)); break; @@ -347,37 +293,24 @@ gtk_progress_bar_get_property (GObject *object, GParamSpec *pspec) { GtkProgressBar *pbar; + GtkProgressBarPrivate* priv; pbar = GTK_PROGRESS_BAR (object); + priv = GTK_PROGRESS_BAR_GET_PRIVATE (pbar); switch (prop_id) { - case PROP_ADJUSTMENT: - g_value_set_object (value, GTK_PROGRESS (pbar)->adjustment); - break; case PROP_ORIENTATION: g_value_set_enum (value, pbar->orientation); break; - case PROP_BAR_STYLE: - g_value_set_enum (value, pbar->bar_style); - break; - case PROP_ACTIVITY_STEP: - g_value_set_uint (value, pbar->activity_step); - break; - case PROP_ACTIVITY_BLOCKS: - g_value_set_uint (value, pbar->activity_blocks); - break; - case PROP_DISCRETE_BLOCKS: - g_value_set_uint (value, pbar->blocks); - break; case PROP_FRACTION: - g_value_set_double (value, gtk_progress_get_current_percentage (GTK_PROGRESS (pbar))); + g_value_set_double (value, priv->fraction); break; case PROP_PULSE_STEP: g_value_set_double (value, pbar->pulse_fraction); break; case PROP_TEXT: - g_value_set_string (value, gtk_progress_bar_get_text (pbar)); + g_value_set_string (value, priv->text); break; case PROP_ELLIPSIZE: g_value_set_enum (value, pbar->ellipsize); @@ -398,28 +331,6 @@ gtk_progress_bar_new (void) return pbar; } -/** - * gtk_progress_bar_new_with_adjustment: - * @adjustment: (allow-none): - * - * Creates a new #GtkProgressBar with an associated #GtkAdjustment. - * - * Returns: (transfer none): a #GtkProgressBar. - */ -GtkWidget* -gtk_progress_bar_new_with_adjustment (GtkAdjustment *adjustment) -{ - GtkWidget *pbar; - - g_return_val_if_fail (GTK_IS_ADJUSTMENT (adjustment), NULL); - - pbar = g_object_new (GTK_TYPE_PROGRESS_BAR, - "adjustment", adjustment, - NULL); - - return pbar; -} - static void gtk_progress_bar_real_update (GtkProgress *progress) { @@ -541,8 +452,8 @@ static void gtk_progress_bar_size_request (GtkWidget *widget, GtkRequisition *requisition) { - GtkProgress *progress; GtkProgressBar *pbar; + GtkProgressBarPrivate *priv; gchar *buf; PangoRectangle logical_rect; PangoLayout *layout; @@ -558,19 +469,14 @@ gtk_progress_bar_size_request (GtkWidget *widget, "yspacing", &yspacing, NULL); - progress = GTK_PROGRESS (widget); pbar = GTK_PROGRESS_BAR (widget); + priv = GTK_PROGRESS_BAR_GET_PRIVATE (pbar); width = 2 * widget->style->xthickness + xspacing; height = 2 * widget->style->ythickness + yspacing; - if (progress->show_text && pbar->bar_style != GTK_PROGRESS_DISCRETE) + if ((buf = priv->text)) { - if (!progress->adjustment) - gtk_progress_set_adjustment (progress, NULL); - - buf = gtk_progress_get_text_from_value (progress, progress->adjustment->upper); - layout = gtk_widget_create_pango_layout (widget, buf); pango_layout_get_pixel_extents (layout, NULL, &logical_rect); @@ -596,7 +502,6 @@ gtk_progress_bar_size_request (GtkWidget *widget, height += logical_rect.height; g_object_unref (layout); - g_free (buf); } if (pbar->orientation == GTK_PROGRESS_LEFT_TO_RIGHT || @@ -968,6 +873,7 @@ static void gtk_progress_bar_paint (GtkProgress *progress) { GtkProgressBar *pbar; + GtkProgressBarPrivate *priv; GtkWidget *widget; GtkProgressBarOrientation orientation; @@ -975,6 +881,7 @@ gtk_progress_bar_paint (GtkProgress *progress) g_return_if_fail (GTK_IS_PROGRESS_BAR (progress)); pbar = GTK_PROGRESS_BAR (progress); + priv = GTK_PROGRESS_BAR_GET_PRIVATE (pbar); widget = GTK_WIDGET (progress); orientation = pbar->orientation; @@ -1000,7 +907,7 @@ gtk_progress_bar_paint (GtkProgress *progress) { gtk_progress_bar_paint_activity (pbar, orientation); - if (GTK_PROGRESS (pbar)->show_text) + if (priv->text) { gint offset; gint amount; @@ -1027,7 +934,7 @@ gtk_progress_bar_paint (GtkProgress *progress) { gtk_progress_bar_paint_continuous (pbar, amount, orientation); - if (GTK_PROGRESS (pbar)->show_text) + if (priv->text) gtk_progress_bar_paint_text (pbar, -1, amount, orientation); } else @@ -1038,67 +945,6 @@ gtk_progress_bar_paint (GtkProgress *progress) } } -static void -gtk_progress_bar_set_bar_style_internal (GtkProgressBar *pbar, - GtkProgressBarStyle bar_style) -{ - g_return_if_fail (GTK_IS_PROGRESS_BAR (pbar)); - - if (pbar->bar_style != bar_style) - { - pbar->bar_style = bar_style; - - if (gtk_widget_is_drawable (GTK_WIDGET (pbar))) - gtk_widget_queue_resize (GTK_WIDGET (pbar)); - - g_object_notify (G_OBJECT (pbar), "bar-style"); - } -} - -static void -gtk_progress_bar_set_discrete_blocks_internal (GtkProgressBar *pbar, - guint blocks) -{ - g_return_if_fail (GTK_IS_PROGRESS_BAR (pbar)); - g_return_if_fail (blocks > 1); - - if (pbar->blocks != blocks) - { - pbar->blocks = blocks; - - if (gtk_widget_is_drawable (GTK_WIDGET (pbar))) - gtk_widget_queue_resize (GTK_WIDGET (pbar)); - - g_object_notify (G_OBJECT (pbar), "discrete-blocks"); - } -} - -static void -gtk_progress_bar_set_activity_step_internal (GtkProgressBar *pbar, - guint step) -{ - g_return_if_fail (GTK_IS_PROGRESS_BAR (pbar)); - - if (pbar->activity_step != step) - { - pbar->activity_step = step; - g_object_notify (G_OBJECT (pbar), "activity-step"); - } -} - -static void -gtk_progress_bar_set_activity_blocks_internal (GtkProgressBar *pbar, - guint blocks) -{ - g_return_if_fail (GTK_IS_PROGRESS_BAR (pbar)); - g_return_if_fail (blocks > 1); - - if (pbar->activity_blocks != blocks) - { - pbar->activity_blocks = blocks; - g_object_notify (G_OBJECT (pbar), "activity-blocks"); - } -} /*******************************************************************/ @@ -1116,15 +962,13 @@ void gtk_progress_bar_set_fraction (GtkProgressBar *pbar, gdouble fraction) { + GtkProgressBarPrivate* priv; + g_return_if_fail (GTK_IS_PROGRESS_BAR (pbar)); - /* If we know the percentage, we don't want activity mode. */ + priv = GTK_PROGRESS_BAR_GET_PRIVATE (pbar); + priv->fraction = fraction; gtk_progress_set_activity_mode (GTK_PROGRESS (pbar), FALSE); - - /* We use the deprecated GtkProgress interface internally. - * Once everything's been deprecated for a good long time, - * we can clean up all this code. - */ gtk_progress_set_percentage (GTK_PROGRESS (pbar), fraction); g_object_notify (G_OBJECT (pbar), "fraction"); @@ -1145,10 +989,8 @@ gtk_progress_bar_pulse (GtkProgressBar *pbar) { g_return_if_fail (GTK_IS_PROGRESS_BAR (pbar)); - /* If we don't know the percentage, we must want activity mode. */ - gtk_progress_set_activity_mode (GTK_PROGRESS (pbar), TRUE); - /* Sigh. */ + gtk_progress_set_activity_mode (GTK_PROGRESS (pbar), TRUE); gtk_progress_bar_real_update (GTK_PROGRESS (pbar)); } @@ -1163,15 +1005,15 @@ void gtk_progress_bar_set_text (GtkProgressBar *pbar, const gchar *text) { + GtkProgressBarPrivate *priv; + g_return_if_fail (GTK_IS_PROGRESS_BAR (pbar)); + priv = GTK_PROGRESS_BAR_GET_PRIVATE (pbar); + g_free (priv->text); + priv->text = text && *text ? g_strdup (text) : NULL; gtk_progress_set_show_text (GTK_PROGRESS (pbar), text && *text); gtk_progress_set_format_string (GTK_PROGRESS (pbar), text); - - /* We don't support formats in this interface, but turn - * them back on for NULL, which should put us back to - * the initial state. - */ GTK_PROGRESS (pbar)->use_text_format = (text == NULL); g_object_notify (G_OBJECT (pbar), "text"); @@ -1196,19 +1038,6 @@ gtk_progress_bar_set_pulse_step (GtkProgressBar *pbar, g_object_notify (G_OBJECT (pbar), "pulse-step"); } -void -gtk_progress_bar_update (GtkProgressBar *pbar, - gdouble percentage) -{ - g_return_if_fail (GTK_IS_PROGRESS_BAR (pbar)); - - /* Use of gtk_progress_bar_update() is deprecated ! - * Use gtk_progress_bar_set_percentage () - */ - - gtk_progress_set_percentage (GTK_PROGRESS (pbar), percentage); -} - /** * gtk_progress_bar_set_orientation: * @pbar: a #GtkProgressBar @@ -1249,12 +1078,12 @@ gtk_progress_bar_set_orientation (GtkProgressBar *pbar, G_CONST_RETURN gchar* gtk_progress_bar_get_text (GtkProgressBar *pbar) { + GtkProgressBarPrivate* priv; + g_return_val_if_fail (GTK_IS_PROGRESS_BAR (pbar), NULL); - if (GTK_PROGRESS (pbar)->use_text_format) - return NULL; - else - return GTK_PROGRESS (pbar)->format; + priv = GTK_PROGRESS_BAR_GET_PRIVATE (pbar); + return priv->text; } /** @@ -1268,9 +1097,12 @@ gtk_progress_bar_get_text (GtkProgressBar *pbar) gdouble gtk_progress_bar_get_fraction (GtkProgressBar *pbar) { + GtkProgressBarPrivate* priv; + g_return_val_if_fail (GTK_IS_PROGRESS_BAR (pbar), 0); - return gtk_progress_get_current_percentage (GTK_PROGRESS (pbar)); + priv = GTK_PROGRESS_BAR_GET_PRIVATE (pbar); + return priv->fraction; } /** @@ -1305,44 +1137,6 @@ gtk_progress_bar_get_orientation (GtkProgressBar *pbar) return pbar->orientation; } -void -gtk_progress_bar_set_bar_style (GtkProgressBar *pbar, - GtkProgressBarStyle bar_style) -{ - g_return_if_fail (GTK_IS_PROGRESS_BAR (pbar)); - - gtk_progress_bar_set_bar_style_internal (pbar, bar_style); -} - -void -gtk_progress_bar_set_discrete_blocks (GtkProgressBar *pbar, - guint blocks) -{ - g_return_if_fail (GTK_IS_PROGRESS_BAR (pbar)); - g_return_if_fail (blocks > 1); - - gtk_progress_bar_set_discrete_blocks_internal (pbar, blocks); -} - -void -gtk_progress_bar_set_activity_step (GtkProgressBar *pbar, - guint step) -{ - g_return_if_fail (GTK_IS_PROGRESS_BAR (pbar)); - - gtk_progress_bar_set_activity_step_internal (pbar, step); -} - -void -gtk_progress_bar_set_activity_blocks (GtkProgressBar *pbar, - guint blocks) -{ - g_return_if_fail (GTK_IS_PROGRESS_BAR (pbar)); - g_return_if_fail (blocks > 1); - - gtk_progress_bar_set_activity_blocks_internal (pbar, blocks); -} - /** * gtk_progress_bar_set_ellipsize: * @pbar: a #GtkProgressBar diff --git a/gtk/gtkprogressbar.h b/gtk/gtkprogressbar.h index 6f09b2ce8a..625825fa03 100644 --- a/gtk/gtkprogressbar.h +++ b/gtk/gtkprogressbar.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -98,33 +98,6 @@ struct _GtkProgressBarClass GType gtk_progress_bar_get_type (void) G_GNUC_CONST; GtkWidget* gtk_progress_bar_new (void); -/* - * GtkProgress/GtkProgressBar had serious problems in GTK 1.2. - * - * - Only 3 or 4 functions are really needed for 95% of progress - * interfaces; GtkProgress[Bar] had about 25 functions, and - * didn't even include these 3 or 4. - * - In activity mode, the API involves setting the adjustment - * to any random value, just to have the side effect of - * calling the progress bar update function - the adjustment - * is totally ignored in activity mode - * - You set the activity step as a pixel value, which means to - * set the activity step you basically need to connect to - * size_allocate - * - There are ctree_set_expander_style()-functions, to randomly - * change look-and-feel for no good reason - * - The split between GtkProgress and GtkProgressBar makes no sense - * to me whatsoever. - * - * This was a big wart on GTK and made people waste lots of time, - * both learning and using the interface. - * - * So, I have added what I feel is the correct API, and marked all the - * rest deprecated. However, the changes are 100% backward-compatible and - * should break no existing code. - * - * The following 9 functions are the new programming interface. - */ void gtk_progress_bar_pulse (GtkProgressBar *pbar); void gtk_progress_bar_set_text (GtkProgressBar *pbar, const gchar *text); @@ -146,27 +119,6 @@ void gtk_progress_bar_set_ellipsize (GtkProgressBar *pbar, PangoEllipsizeMode gtk_progress_bar_get_ellipsize (GtkProgressBar *pbar); -#ifndef GTK_DISABLE_DEPRECATED - -/* Everything below here is deprecated */ -GtkWidget* gtk_progress_bar_new_with_adjustment (GtkAdjustment *adjustment); -void gtk_progress_bar_set_bar_style (GtkProgressBar *pbar, - GtkProgressBarStyle style); -void gtk_progress_bar_set_discrete_blocks (GtkProgressBar *pbar, - guint blocks); -/* set_activity_step() is not only deprecated, it doesn't even work. - * (Of course, it wasn't usable anyway, you had to set it from a size_allocate - * handler or something) - */ -void gtk_progress_bar_set_activity_step (GtkProgressBar *pbar, - guint step); -void gtk_progress_bar_set_activity_blocks (GtkProgressBar *pbar, - guint blocks); -void gtk_progress_bar_update (GtkProgressBar *pbar, - gdouble percentage); - -#endif /* GTK_DISABLE_DEPRECATED */ - G_END_DECLS #endif /* __GTK_PROGRESS_BAR_H__ */ diff --git a/gtk/gtkradioaction.c b/gtk/gtkradioaction.c index 8338e17a6d..f44c2b546c 100644 --- a/gtk/gtkradioaction.c +++ b/gtk/gtkradioaction.c @@ -38,6 +38,18 @@ #include "gtkprivate.h" #include "gtkalias.h" + +/** + * SECTION:gtkradioaction + * @Short_description: An action of which only one in a group can be active + * @Title: GtkRadioAction + * + * A #GtkRadioAction is similar to #GtkRadioMenuItem. A number of radio + * actions can be linked together so that only one may be active at any + * one time. + */ + + #define GTK_RADIO_ACTION_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_RADIO_ACTION, GtkRadioActionPrivate)) struct _GtkRadioActionPrivate @@ -395,7 +407,7 @@ create_menu_item (GtkAction *action) * } * ]| * - * Returns: (element-type GtkAction) (transfer none): the list representing the radio group for this object + * Returns: (element-type GtkRadioAction) (transfer none): the list representing the radio group for this object * * Since: 2.4 */ @@ -410,7 +422,7 @@ gtk_radio_action_get_group (GtkRadioAction *action) /** * gtk_radio_action_set_group: * @action: the action object - * @group: a list representing a radio group + * @group: (element-type GtkRadioAction): a list representing a radio group * * Sets the radio group for the radio action object. * @@ -456,6 +468,61 @@ gtk_radio_action_set_group (GtkRadioAction *action, } } +/** + * gtk_radio_action_join_group: + * @action: the action object + * @group_source: (allow-none): a radio action object whos group we are + * joining, or %NULL to remove the radio action from its group + * + * Joins a radio action object to the group of another radio action object. + * + * Use this in language bindings instead of the gtk_radio_action_get_group() + * and gtk_radio_action_set_group() methods + * + * A common way to set up a group of radio actions is the following: + * |[ + * GtkRadioAction *action; + * GtkRadioAction *last_action; + * + * while (/* more actions to add */) + * { + * action = gtk_radio_action_new (...); + * + * gtk_radio_action_join_group (action, last_action); + * last_action = action; + * } + * ]| + * + * Since: 3.0 + */ +void +gtk_radio_action_join_group (GtkRadioAction *action, + GtkRadioAction *group_source) +{ + g_return_if_fail (GTK_IS_RADIO_ACTION (action)); + g_return_if_fail (group_source == NULL || GTK_IS_RADIO_ACTION (group_source)); + + if (group_source) + { + GSList *group; + group = gtk_radio_action_get_group (group_source); + + if (!group) + { + /* if we are not already part of a group we need to set up a new one + and then get the newly created group */ + gtk_radio_action_set_group (group_source, NULL); + group = gtk_radio_action_get_group (group_source); + } + + gtk_radio_action_set_group (action, group); + } + else + { + gtk_radio_action_set_group (action, NULL); + } +} + /** * gtk_radio_action_get_current_value: * @action: a #GtkRadioAction diff --git a/gtk/gtkradioaction.h b/gtk/gtkradioaction.h index 2b7d72361c..e0f5df1b3e 100644 --- a/gtk/gtkradioaction.h +++ b/gtk/gtkradioaction.h @@ -28,7 +28,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -81,6 +81,8 @@ GtkRadioAction *gtk_radio_action_new (const gchar *name, GSList *gtk_radio_action_get_group (GtkRadioAction *action); void gtk_radio_action_set_group (GtkRadioAction *action, GSList *group); +void gtk_radio_action_join_group (GtkRadioAction *action, + GtkRadioAction *group_source); gint gtk_radio_action_get_current_value (GtkRadioAction *action); void gtk_radio_action_set_current_value (GtkRadioAction *action, gint current_value); diff --git a/gtk/gtkradiobutton.c b/gtk/gtkradiobutton.c index f48d2205f5..24300334c9 100644 --- a/gtk/gtkradiobutton.c +++ b/gtk/gtkradiobutton.c @@ -33,6 +33,78 @@ #include "gtkalias.h" +/** + * SECTION:gtkradiobutton + * @Short_description: A choice from multiple check buttons + * @Title: GtkRadioButton + * @See_also: #GtkComboBox + * + * A single radio button performs the same basic function as a #GtkCheckButton, + * as its position in the object hierarchy reflects. It is only when multiple + * radio buttons are grouped together that they become a different user + * interface component in their own right. + * + * Every radio button is a member of some group of radio buttons. When one is + * selected, all other radio buttons in the same group are deselected. A + * #GtkRadioButton is one way of giving the user a choice from many options. + * + * Radio button widgets are created with gtk_radio_button_new(), passing %NULL + * as the argument if this is the first radio button in a group. In subsequent + * calls, the group you wish to add this button to should be passed as an + * argument. Optionally, gtk_radio_button_new_with_label() can be used if you + * want a text label on the radio button. + * + * Alternatively, when adding widgets to an existing group of radio buttons, + * use gtk_radio_button_new_from_widget() with a #GtkRadioButton that already + * has a group assigned to it. The convenience function + * gtk_radio_button_new_with_label_from_widget() is also provided. + * + * To retrieve the group a #GtkRadioButton is assigned to, use + * gtk_radio_button_get_group(). + * + * To remove a #GtkRadioButton from one group and make it part of a new one, + * use gtk_radio_button_set_group(). + * + * The group list does not need to be freed, as each #GtkRadioButton will remove + * itself and its list item when it is destroyed. + * + * + * How to create a group of two radio buttons. + * + * void create_radio_buttons (void) { + * + * GtkWidget *window, *radio1, *radio2, *box, *entry; + * window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + * box = gtk_vbox_new (TRUE, 2); + * + * /* Create a radio button with a GtkEntry widget */ + * radio1 = gtk_radio_button_new (NULL); + * entry = gtk_entry_new (); + * gtk_container_add (GTK_CONTAINER (radio1), entry); + * + * + * /* Create a radio button with a label */ + * radio2 = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON (radio1), + * "I'm the second radio button."); + * + * /* Pack them into a box, then show all the widgets */ + * gtk_box_pack_start (GTK_BOX (box), radio1, TRUE, TRUE, 2); + * gtk_box_pack_start (GTK_BOX (box), radio2, TRUE, TRUE, 2); + * gtk_container_add (GTK_CONTAINER (window), box); + * gtk_widget_show_all (window); + * return; + * } + * + * + * + * When an unselected button in the group is clicked the clicked button + * receives the #GtkToggleButton::toggled signal, as does the previously + * selected button. + * Inside the #GtkToggleButton::toggled handler, gtk_toggle_button_get_active() + * can be used to determine if the button has been selected or deselected. + */ + + enum { PROP_0, PROP_GROUP @@ -76,6 +148,11 @@ gtk_radio_button_class_init (GtkRadioButtonClass *class) gobject_class->set_property = gtk_radio_button_set_property; gobject_class->get_property = gtk_radio_button_get_property; + /** + * GtkRadioButton:group: + * + * Sets a new group for a radio button. + */ g_object_class_install_property (gobject_class, PROP_GROUP, g_param_spec_object ("group", @@ -175,6 +252,17 @@ gtk_radio_button_get_property (GObject *object, } } +/** + * gtk_radio_button_set_group: + * @radio_button: a #GtkRadioButton. + * @group: an existing radio button group, such as one returned from + * gtk_radio_button_get_group(). + * + * Sets a #GtkRadioButton's group. It should be noted that this does not change + * the layout of your interface in any way, so if you are changing the group, + * it is likely you will need to re-arrange the user interface to reflect these + * changes. + */ void gtk_radio_button_set_group (GtkRadioButton *radio_button, GSList *group) @@ -243,6 +331,15 @@ gtk_radio_button_set_group (GtkRadioButton *radio_button, g_object_unref (radio_button); } +/** + * gtk_radio_button_new: + * @group: an existing radio button group, or %NULL if you are creating a new group. + * + * Creates a new #GtkRadioButton. To be of any practical value, a widget should + * then be packed into the radio button. + * + * Returns: a new radio button. + */ GtkWidget* gtk_radio_button_new (GSList *group) { @@ -256,6 +353,16 @@ gtk_radio_button_new (GSList *group) return GTK_WIDGET (radio_button); } +/** + * gtk_radio_button_new_with_label: + * @group: an existing radio button group, or %NULL if you are creating a new + * group. + * @label: the text label to display next to the radio button. + * + * Creates a new #GtkRadioButton with a text label. + * + * Returns: a new radio button. + */ GtkWidget* gtk_radio_button_new_with_label (GSList *group, const gchar *label) @@ -300,6 +407,15 @@ gtk_radio_button_new_with_mnemonic (GSList *group, return radio_button; } +/** + * gtk_radio_button_new_from_widget: + * @radio_group_member: an existing #GtkRadioButton. + * + * Creates a new #GtkRadioButton, adding it to the same group as @radio_group_member. + * As with gtk_radio_button_new(), a widget should be packed into the radio button. + * + * Returns: a new radio button. + */ GtkWidget* gtk_radio_button_new_from_widget (GtkRadioButton *radio_group_member) { @@ -309,7 +425,16 @@ gtk_radio_button_new_from_widget (GtkRadioButton *radio_group_member) return gtk_radio_button_new (l); } - +/** + * gtk_radio_button_new_with_label_from_widget: + * @radio_group_member: widget to get radio group from or %NULL + * @label: a text string to display next to the radio button. + * + * Creates a new #GtkRadioButton with a text label, adding it to the same group + * as @radio_group_member. + * + * Returns: a new radio button. + */ GtkWidget* gtk_radio_button_new_with_label_from_widget (GtkRadioButton *radio_group_member, const gchar *label) diff --git a/gtk/gtkradiobutton.h b/gtk/gtkradiobutton.h index c39e214db2..fb075131f6 100644 --- a/gtk/gtkradiobutton.h +++ b/gtk/gtkradiobutton.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -85,10 +85,6 @@ GSList* gtk_radio_button_get_group (GtkRadioButton *radio void gtk_radio_button_set_group (GtkRadioButton *radio_button, GSList *group); -#ifndef GTK_DISABLE_DEPRECATED -#define gtk_radio_button_group gtk_radio_button_get_group -#endif - G_END_DECLS #endif /* __GTK_RADIO_BUTTON_H__ */ diff --git a/gtk/gtkradiomenuitem.h b/gtk/gtkradiomenuitem.h index 46daa4dc5c..7382bfb7e7 100644 --- a/gtk/gtkradiomenuitem.h +++ b/gtk/gtkradiomenuitem.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -85,10 +85,6 @@ GSList* gtk_radio_menu_item_get_group (GtkRadioMenuItem * void gtk_radio_menu_item_set_group (GtkRadioMenuItem *radio_menu_item, GSList *group); -#ifndef GTK_DISABLE_DEPRECATED -#define gtk_radio_menu_item_group gtk_radio_menu_item_get_group -#endif - G_END_DECLS #endif /* __GTK_RADIO_MENU_ITEM_H__ */ diff --git a/gtk/gtkradiotoolbutton.h b/gtk/gtkradiotoolbutton.h index 768c7630b6..7f77efd429 100644 --- a/gtk/gtkradiotoolbutton.h +++ b/gtk/gtkradiotoolbutton.h @@ -20,7 +20,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c index 552eac7c1c..b415ec75ce 100644 --- a/gtk/gtkrange.c +++ b/gtk/gtkrange.c @@ -35,11 +35,28 @@ #include "gtkmarshalers.h" #include "gtkorientable.h" #include "gtkrange.h" +#include "gtkscale.h" #include "gtkscrollbar.h" #include "gtkprivate.h" #include "gtkintl.h" #include "gtkalias.h" + +/** + * SECTION:gtkrange + * @Short_description: Base class for widgets which visualize an adjustment + * @Title: GtkRange + * + * #GtkRange is the common base class for widgets which visualize an + * adjustment, e.g #GtkScale or #GtkScrollbar. + * + * Apart from signals for monitoring the parameters of the adjustment, + * #GtkRange provides properties and methods for influencing the sensitivity + * of the "steppers". It also provides properties and methods for setting a + * "fill level" on range widgets. See gtk_range_set_fill_level(). + */ + + #define SCROLL_DELAY_FACTOR 5 /* Scroll repeat multiplier */ #define UPDATE_DELAY 300 /* Delay for queued update */ @@ -122,6 +139,8 @@ struct _GtkRangeLayout gint *mark_pos; gint n_marks; gboolean recalc_marks; + + GdkDevice *grab_device; }; @@ -271,7 +290,7 @@ gtk_range_class_init (GtkRangeClass *class) /** * GtkRange::value-changed: - * @range: the #GtkRange + * @range: the #GtkRange that received the signal * * Emitted when the range value changes. */ @@ -283,7 +302,15 @@ gtk_range_class_init (GtkRangeClass *class) NULL, NULL, _gtk_marshal_VOID__VOID, G_TYPE_NONE, 0); - + + /** + * GtkRange::adjust-bounds: + * @range: the #GtkRange that received the signal + * @value: the value before we clamp + * + * Emitted before clamping a value, to give the application a + * chance to adjust the bounds. + */ signals[ADJUST_BOUNDS] = g_signal_new (I_("adjust-bounds"), G_TYPE_FROM_CLASS (gobject_class), @@ -296,7 +323,7 @@ gtk_range_class_init (GtkRangeClass *class) /** * GtkRange::move-slider: - * @range: the #GtkRange + * @range: the #GtkRange that received the signal * @step: how to move the slider * * Virtual function that moves the slider. Used for keybindings. @@ -313,7 +340,7 @@ gtk_range_class_init (GtkRangeClass *class) /** * GtkRange::change-value: - * @range: the range that received the signal + * @range: the #GtkRange that received the signal * @scroll: the type of scroll action that was performed * @value: the new value resulting from the scroll action * @returns: %TRUE to prevent other handlers from being invoked for the @@ -1185,9 +1212,6 @@ gtk_range_set_range (GtkRange *range, value = MIN (value, MAX (range->adjustment->lower, range->layout->fill_level)); - value = CLAMP (value, range->adjustment->lower, - (range->adjustment->upper - range->adjustment->page_size)); - gtk_adjustment_set_value (range->adjustment, value); gtk_adjustment_changed (range->adjustment); } @@ -1212,9 +1236,6 @@ gtk_range_set_value (GtkRange *range, value = MIN (value, MAX (range->adjustment->lower, range->layout->fill_level)); - value = CLAMP (value, range->adjustment->lower, - (range->adjustment->upper - range->adjustment->page_size)); - gtk_adjustment_set_value (range->adjustment, value); } @@ -2013,16 +2034,28 @@ gtk_range_expose (GtkWidget *widget, static void range_grab_add (GtkRange *range, + GdkDevice *device, MouseLocation location, gint button) { - /* we don't actually gtk_grab, since a button is down */ + GtkRangeLayout *layout = range->layout; + + if (device == layout->grab_device) + return; + + if (layout->grab_device != NULL) + { + g_warning ("GtkRange already had a grab device, releasing device grab"); + gtk_device_grab_remove (GTK_WIDGET (range), layout->grab_device); + } + + /* we don't actually gdk_grab, since a button is down */ + gtk_device_grab_add (GTK_WIDGET (range), device, TRUE); - gtk_grab_add (GTK_WIDGET (range)); - range->layout->grab_location = location; range->layout->grab_button = button; - + range->layout->grab_device = device; + if (gtk_range_update_mouse_location (range)) gtk_widget_queue_draw (GTK_WIDGET (range)); } @@ -2030,10 +2063,16 @@ range_grab_add (GtkRange *range, static void range_grab_remove (GtkRange *range) { + GtkRangeLayout *layout = range->layout; MouseLocation location; - gtk_grab_remove (GTK_WIDGET (range)); - + if (layout->grab_device) + { + gtk_device_grab_remove (GTK_WIDGET (range), + layout->grab_device); + layout->grab_device = NULL; + } + location = range->layout->grab_location; range->layout->grab_location = MOUSE_OUTSIDE; range->layout->grab_button = 0; @@ -2158,9 +2197,15 @@ static gboolean gtk_range_key_press (GtkWidget *widget, GdkEventKey *event) { + GdkDevice *device; GtkRange *range = GTK_RANGE (widget); + GtkRangeLayout *layout = range->layout; - if (event->keyval == GDK_Escape && + device = gdk_event_get_device ((GdkEvent *) event); + device = gdk_device_get_associated_device (device); + + if (device == layout->grab_device && + event->keyval == GDK_Escape && range->layout->grab_location != MOUSE_OUTSIDE) { stop_scrolling (range); @@ -2180,6 +2225,7 @@ gtk_range_button_press (GtkWidget *widget, GdkEventButton *event) { GtkRange *range = GTK_RANGE (widget); + GdkDevice *device; if (!gtk_widget_has_focus (widget)) gtk_widget_grab_focus (widget); @@ -2188,8 +2234,10 @@ gtk_range_button_press (GtkWidget *widget, if (range->layout->grab_location != MOUSE_OUTSIDE) return FALSE; + device = gdk_event_get_device ((GdkEvent *) event); range->layout->mouse_x = event->x; range->layout->mouse_y = event->y; + if (gtk_range_update_mouse_location (range)) gtk_widget_queue_draw (widget); @@ -2206,7 +2254,7 @@ gtk_range_button_press (GtkWidget *widget, event->y : event->x); range->trough_click_forward = click_value > range->adjustment->value; - range_grab_add (range, MOUSE_TROUGH, event->button); + range_grab_add (range, device, MOUSE_TROUGH, event->button); scroll = range_get_scroll_for_grab (range); @@ -2223,7 +2271,7 @@ gtk_range_button_press (GtkWidget *widget, GdkRectangle *stepper_area; GtkScrollType scroll; - range_grab_add (range, range->layout->mouse_location, event->button); + range_grab_add (range, device, range->layout->mouse_location, event->button); stepper_area = get_area (range, range->layout->mouse_location); gtk_widget_queue_draw_area (widget, @@ -2290,7 +2338,7 @@ gtk_range_button_press (GtkWidget *widget, range->slide_initial_coordinate = event->x; } - range_grab_add (range, MOUSE_SLIDER, event->button); + range_grab_add (range, device, MOUSE_SLIDER, event->button); gtk_widget_style_get (widget, "activate-slider", &activate_slider, NULL); @@ -2367,8 +2415,12 @@ gtk_range_grab_broken (GtkWidget *widget, GdkEventGrabBroken *event) { GtkRange *range = GTK_RANGE (widget); + GdkDevice *device; - if (range->layout->grab_location != MOUSE_OUTSIDE) + device = gdk_event_get_device ((GdkEvent *) event); + + if (device == range->layout->grab_device && + range->layout->grab_location != MOUSE_OUTSIDE) { if (range->layout->grab_location == MOUSE_SLIDER) update_slider_position (range, range->layout->mouse_x, range->layout->mouse_y); @@ -2386,6 +2438,7 @@ gtk_range_button_release (GtkWidget *widget, GdkEventButton *event) { GtkRange *range = GTK_RANGE (widget); + GdkDevice *device; if (event->window == range->event_window) { @@ -2394,13 +2447,17 @@ gtk_range_button_release (GtkWidget *widget, } else { - gdk_window_get_pointer (range->event_window, - &range->layout->mouse_x, - &range->layout->mouse_y, - NULL); + gdk_window_get_device_position (range->event_window, + event->device, + &range->layout->mouse_x, + &range->layout->mouse_y, + NULL); } - - if (range->layout->grab_button == event->button) + + device = gdk_event_get_device ((GdkEvent *) event); + + if (range->layout->grab_device == device && + range->layout->grab_button == event->button) { if (range->layout->grab_location == MOUSE_SLIDER) update_slider_position (range, range->layout->mouse_x, range->layout->mouse_y); @@ -2532,7 +2589,10 @@ static void gtk_range_grab_notify (GtkWidget *widget, gboolean was_grabbed) { - if (!was_grabbed) + GtkRangeLayout *layout = GTK_RANGE (widget)->layout; + + if (layout->grab_device && + gtk_widget_device_is_shadowed (widget, layout->grab_device)) stop_scrolling (GTK_RANGE (widget)); } @@ -2618,7 +2678,8 @@ gtk_range_adjustment_value_changed (GtkAdjustment *adjustment, gtk_range_calc_layout (range, range->adjustment->value); /* now check whether the layout changed */ - if (layout_changed (range->layout, &layout)) + if (layout_changed (range->layout, &layout) || + (GTK_IS_SCALE (range) && GTK_SCALE (range)->draw_value)) { gtk_widget_queue_draw (GTK_WIDGET (range)); /* setup a timer to ensure the range isn't lagging too much behind the scroll position */ @@ -3629,7 +3690,7 @@ gtk_range_real_change_value (GtkRange *range, GtkScrollType scroll, gdouble value) { - /* potentially adjust the bounds _before we clamp */ + /* potentially adjust the bounds _before_ we clamp */ g_signal_emit (range, signals[ADJUST_BOUNDS], 0, value); if (range->layout->restrict_to_fill_level) diff --git a/gtk/gtkrange.h b/gtk/gtkrange.h index abfbc7c137..abbd105fb1 100644 --- a/gtk/gtkrange.h +++ b/gtk/gtkrange.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkrc.c b/gtk/gtkrc.c index 2e94cdfcec..32b51e144e 100644 --- a/gtk/gtkrc.c +++ b/gtk/gtkrc.c @@ -117,9 +117,10 @@ struct _GtkRcContext /* The files we have parsed, to reread later if necessary */ GSList *rc_files; - gchar *theme_name; - gchar *key_theme_name; - gchar *font_name; + gchar *theme_name; + gboolean prefer_dark_theme; + gchar *key_theme_name; + gchar *font_name; gchar **pixmap_path; @@ -160,9 +161,10 @@ static GtkStyle * gtk_rc_style_to_style (GtkRcContext *context, static GtkStyle* gtk_rc_init_style (GtkRcContext *context, GSList *rc_styles); static void gtk_rc_parse_default_files (GtkRcContext *context); -static void gtk_rc_parse_named (GtkRcContext *context, +static gboolean gtk_rc_parse_named (GtkRcContext *context, const gchar *name, - const gchar *type); + const gchar *type, + const gchar *variant); static void gtk_rc_context_parse_file (GtkRcContext *context, const gchar *filename, gint priority, @@ -399,9 +401,9 @@ gtk_rc_make_default_dir (const gchar *type) var = g_getenv ("GTK_EXE_PREFIX"); if (var) - path = g_build_filename (var, "lib", "gtk-2.0", GTK_BINARY_VERSION, type, NULL); + path = g_build_filename (var, "lib", "gtk-3.0", GTK_BINARY_VERSION, type, NULL); else - path = g_build_filename (GTK_LIBDIR, "gtk-2.0", GTK_BINARY_VERSION, type, NULL); + path = g_build_filename (GTK_LIBDIR, "gtk-3.0", GTK_BINARY_VERSION, type, NULL); return path; } @@ -448,9 +450,9 @@ gtk_rc_get_im_module_file (void) if (!result) { if (im_module_file) - result = g_strdup (im_module_file); + result = g_strdup (im_module_file); else - result = g_build_filename (GTK_SYSCONFDIR, "gtk-2.0", "gtk.immodules", NULL); + result = gtk_rc_make_default_dir ("immodules.cache"); } return result; @@ -522,7 +524,7 @@ gtk_rc_add_initial_default_files (void) else { const gchar *home; - str = g_build_filename (GTK_SYSCONFDIR, "gtk-2.0", "gtkrc", NULL); + str = g_build_filename (GTK_SYSCONFDIR, "gtk-3.0", "gtkrc", NULL); gtk_rc_add_default_file (str); g_free (str); @@ -530,7 +532,7 @@ gtk_rc_add_initial_default_files (void) home = g_get_home_dir (); if (home) { - str = g_build_filename (home, ".gtkrc-2.0", NULL); + str = g_build_filename (home, ".gtkrc-3.0", NULL); gtk_rc_add_default_file (str); g_free (str); } @@ -624,6 +626,7 @@ gtk_rc_settings_changed (GtkSettings *settings, { gchar *new_theme_name; gchar *new_key_theme_name; + gboolean new_prefer_dark_theme; if (context->reloading) return; @@ -631,12 +634,14 @@ gtk_rc_settings_changed (GtkSettings *settings, g_object_get (settings, "gtk-theme-name", &new_theme_name, "gtk-key-theme-name", &new_key_theme_name, + "gtk-application-prefer-dark-theme", &new_prefer_dark_theme, NULL); if ((new_theme_name != context->theme_name && !(new_theme_name && context->theme_name && strcmp (new_theme_name, context->theme_name) == 0)) || (new_key_theme_name != context->key_theme_name && - !(new_key_theme_name && context->key_theme_name && strcmp (new_key_theme_name, context->key_theme_name) == 0))) + !(new_key_theme_name && context->key_theme_name && strcmp (new_key_theme_name, context->key_theme_name) == 0)) || + new_prefer_dark_theme != context->prefer_dark_theme) { gtk_rc_reparse_all_for_settings (settings, TRUE); } @@ -692,6 +697,7 @@ gtk_rc_context_get (GtkSettings *settings) "gtk-key-theme-name", &context->key_theme_name, "gtk-font-name", &context->font_name, "color-hash", &context->color_hash, + "gtk-application-prefer-dark-theme", &context->prefer_dark_theme, NULL); g_signal_connect (settings, @@ -710,6 +716,10 @@ gtk_rc_context_get (GtkSettings *settings) "notify::color-hash", G_CALLBACK (gtk_rc_color_hash_changed), context); + g_signal_connect (settings, + "notify::gtk-application-prefer-dark-theme", + G_CALLBACK (gtk_rc_settings_changed), + context); context->pixmap_path = NULL; @@ -785,22 +795,27 @@ _gtk_rc_context_destroy (GtkSettings *settings) settings->rc_context = NULL; } -static void +static gboolean gtk_rc_parse_named (GtkRcContext *context, const gchar *name, - const gchar *type) + const gchar *type, + const gchar *variant) { gchar *path = NULL; const gchar *home_dir; gchar *subpath; + gboolean retval; + + retval = FALSE; if (type) - subpath = g_strconcat ("gtk-2.0-", type, + subpath = g_strconcat ("gtk-3.0-", type, G_DIR_SEPARATOR_S "gtkrc", NULL); else - subpath = g_strdup ("gtk-2.0" G_DIR_SEPARATOR_S "gtkrc"); - + subpath = g_strconcat ("gtk-3.0" G_DIR_SEPARATOR_S "gtkrc", + variant, NULL); + /* First look in the users home directory */ home_dir = g_get_home_dir (); @@ -831,9 +846,12 @@ gtk_rc_parse_named (GtkRcContext *context, { gtk_rc_context_parse_file (context, path, GTK_PATH_PRIO_THEME, FALSE); g_free (path); + retval = TRUE; } g_free (subpath); + + return retval; } static void @@ -1304,22 +1322,6 @@ _gtk_rc_style_unset_rc_property (GtkRcStyle *rc_style, } } -void -gtk_rc_style_ref (GtkRcStyle *rc_style) -{ - g_return_if_fail (GTK_IS_RC_STYLE (rc_style)); - - g_object_ref (rc_style); -} - -void -gtk_rc_style_unref (GtkRcStyle *rc_style) -{ - g_return_if_fail (GTK_IS_RC_STYLE (rc_style)); - - g_object_unref (rc_style); -} - static GtkRcStyle * gtk_rc_style_real_create_rc_style (GtkRcStyle *style) { @@ -1334,6 +1336,34 @@ _gtk_rc_style_get_color_hashes (GtkRcStyle *rc_style) return priv->color_hashes; } +static void gtk_rc_style_prepend_empty_color_hash (GtkRcStyle *rc_style); + +void +_gtk_rc_style_set_symbolic_color (GtkRcStyle *rc_style, + const gchar *name, + const GdkColor *color) +{ + GtkRcStylePrivate *priv = GTK_RC_STYLE_GET_PRIVATE (rc_style); + GHashTable *our_hash = NULL; + + if (priv->color_hashes) + our_hash = priv->color_hashes->data; + + if (our_hash == NULL) + { + if (color == NULL) + return; + + gtk_rc_style_prepend_empty_color_hash (rc_style); + our_hash = priv->color_hashes->data; + } + + if (color) + g_hash_table_insert (our_hash, g_strdup (name), gdk_color_copy (color)); + else + g_hash_table_remove (our_hash, name); +} + static gint gtk_rc_properties_cmp (gconstpointer bsearch_node1, gconstpointer bsearch_node2) @@ -1812,12 +1842,23 @@ gtk_rc_reparse_all_for_settings (GtkSettings *settings, g_object_get (context->settings, "gtk-theme-name", &context->theme_name, "gtk-key-theme-name", &context->key_theme_name, + "gtk-application-prefer-dark-theme", &context->prefer_dark_theme, NULL); if (context->theme_name && context->theme_name[0]) - gtk_rc_parse_named (context, context->theme_name, NULL); + { + if (context->prefer_dark_theme) + { + if (!gtk_rc_parse_named (context, context->theme_name, NULL, "-dark")) + gtk_rc_parse_named (context, context->theme_name, NULL, NULL); + } + else + { + gtk_rc_parse_named (context, context->theme_name, NULL, NULL); + } + } if (context->key_theme_name && context->key_theme_name[0]) - gtk_rc_parse_named (context, context->key_theme_name, "key"); + gtk_rc_parse_named (context, context->key_theme_name, "key", NULL); context->reloading = FALSE; @@ -2134,86 +2175,6 @@ gtk_rc_get_style_by_paths (GtkSettings *settings, return NULL; } -static GSList * -gtk_rc_add_rc_sets (GSList *slist, - GtkRcStyle *rc_style, - const gchar *pattern, - GtkPathType path_type) -{ - GtkRcStyle *new_style; - GtkRcSet *rc_set; - guint i; - - new_style = gtk_rc_style_new (); - *new_style = *rc_style; - new_style->name = g_strdup (rc_style->name); - if (rc_style->font_desc) - new_style->font_desc = pango_font_description_copy (rc_style->font_desc); - - for (i = 0; i < 5; i++) - new_style->bg_pixmap_name[i] = g_strdup (rc_style->bg_pixmap_name[i]); - - rc_set = g_new (GtkRcSet, 1); - rc_set->type = path_type; - - if (path_type == GTK_PATH_WIDGET_CLASS) - { - rc_set->pspec = NULL; - rc_set->path = _gtk_rc_parse_widget_class_path (pattern); - } - else - { - rc_set->pspec = g_pattern_spec_new (pattern); - rc_set->path = NULL; - } - - rc_set->rc_style = rc_style; - - return g_slist_prepend (slist, rc_set); -} - -void -gtk_rc_add_widget_name_style (GtkRcStyle *rc_style, - const gchar *pattern) -{ - GtkRcContext *context; - - g_return_if_fail (rc_style != NULL); - g_return_if_fail (pattern != NULL); - - context = gtk_rc_context_get (gtk_settings_get_default ()); - - context->rc_sets_widget = gtk_rc_add_rc_sets (context->rc_sets_widget, rc_style, pattern, GTK_PATH_WIDGET); -} - -void -gtk_rc_add_widget_class_style (GtkRcStyle *rc_style, - const gchar *pattern) -{ - GtkRcContext *context; - - g_return_if_fail (rc_style != NULL); - g_return_if_fail (pattern != NULL); - - context = gtk_rc_context_get (gtk_settings_get_default ()); - - context->rc_sets_widget_class = gtk_rc_add_rc_sets (context->rc_sets_widget_class, rc_style, pattern, GTK_PATH_WIDGET_CLASS); -} - -void -gtk_rc_add_class_style (GtkRcStyle *rc_style, - const gchar *pattern) -{ - GtkRcContext *context; - - g_return_if_fail (rc_style != NULL); - g_return_if_fail (pattern != NULL); - - context = gtk_rc_context_get (gtk_settings_get_default ()); - - context->rc_sets_class = gtk_rc_add_rc_sets (context->rc_sets_class, rc_style, pattern, GTK_PATH_CLASS); -} - GScanner* gtk_rc_scanner_new (void) { diff --git a/gtk/gtkrc.h b/gtk/gtkrc.h index 1ca2d33138..fb923c2f6b 100644 --- a/gtk/gtkrc.h +++ b/gtk/gtkrc.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -159,25 +159,10 @@ void gtk_rc_parse (const gchar *filename); void gtk_rc_parse_string (const gchar *rc_string); gboolean gtk_rc_reparse_all (void); -#ifndef GTK_DISABLE_DEPRECATED -void gtk_rc_add_widget_name_style (GtkRcStyle *rc_style, - const gchar *pattern); -void gtk_rc_add_widget_class_style (GtkRcStyle *rc_style, - const gchar *pattern); -void gtk_rc_add_class_style (GtkRcStyle *rc_style, - const gchar *pattern); -#endif /* GTK_DISABLE_DEPRECATED */ - - GType gtk_rc_style_get_type (void) G_GNUC_CONST; GtkRcStyle* gtk_rc_style_new (void); GtkRcStyle* gtk_rc_style_copy (GtkRcStyle *orig); -#ifndef GTK_DISABLE_DEPRECATED -void gtk_rc_style_ref (GtkRcStyle *rc_style); -void gtk_rc_style_unref (GtkRcStyle *rc_style); -#endif - gchar* gtk_rc_find_module_in_path (const gchar *module_file); gchar* gtk_rc_get_theme_dir (void); gchar* gtk_rc_get_module_dir (void); @@ -263,6 +248,10 @@ void _gtk_rc_style_unset_rc_property (GtkRcStyle *rc_style, GSList * _gtk_rc_style_get_color_hashes (GtkRcStyle *rc_style); +void _gtk_rc_style_set_symbolic_color (GtkRcStyle *rc_style, + const gchar *name, + const GdkColor *color); + const gchar* _gtk_rc_context_get_default_font_name (GtkSettings *settings); void _gtk_rc_context_destroy (GtkSettings *settings); diff --git a/gtk/gtkrecentaction.c b/gtk/gtkrecentaction.c index 14acfb426a..458d23f019 100644 --- a/gtk/gtkrecentaction.c +++ b/gtk/gtkrecentaction.c @@ -32,6 +32,23 @@ #include "gtkprivate.h" #include "gtkalias.h" + +/** + * SECTION:gtkrecentaction + * @Short_description: An action of which represents a list of recently used files + * @Title: GtkRecentAction + * + * A #GtkRecentAction represents a list of recently used files, which + * can be shown by widgets such as #GtkRecentChooserDialog or + * #GtkRecentChooserMenu. + * + * To construct a submenu showing recently used files, use a #GtkRecentAction + * as the action for a <menuitem>. To construct a menu toolbutton showing + * the recently used files in the popup menu, use a #GtkRecentAction as the + * action for a <toolitem> element. + */ + + #define FALLBACK_ITEM_LIMIT 10 #define GTK_RECENT_ACTION_GET_PRIVATE(obj) \ diff --git a/gtk/gtkrecentaction.h b/gtk/gtkrecentaction.h index 96d5ca6a19..777a8baf7b 100644 --- a/gtk/gtkrecentaction.h +++ b/gtk/gtkrecentaction.h @@ -19,7 +19,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkrecentchooser.c b/gtk/gtkrecentchooser.c index bb84ef5e07..d381df328a 100644 --- a/gtk/gtkrecentchooser.c +++ b/gtk/gtkrecentchooser.c @@ -33,6 +33,23 @@ #include "gtkalias.h" +/** + * SECTION:gtkrecentchooser + * @Short_description: Interface implemented by widgets displaying recently + * used files + * @Title: GtkRecentChooser + * @See_also: #GtkRecentManager, #GtkRecentChooserDialog, + * #GtkRecentChooserWidget, #GtkRecentChooserMenu + * + * #GtkRecentChooser is an interface that can be implemented by widgets + * displaying the list of recently used files. In GTK+, the main objects + * that implement this interface are #GtkRecentChooserWidget, + * #GtkRecentChooserDialog and #GtkRecentChooserMenu. + * + * Recently used files are supported since GTK+ 2.10. + */ + + enum { ITEM_ACTIVATED, @@ -606,72 +623,6 @@ recent_chooser_has_show_numbers (GtkRecentChooser *chooser) return (pspec && pspec->value_type == G_TYPE_BOOLEAN); } -/** - * gtk_recent_chooser_set_show_numbers: - * @chooser: a #GtkRecentChooser - * @show_numbers: %TRUE to show numbers, %FALSE otherwise - * - * Whether to show recently used resources prepended by a unique number. - * - * Deprecated: 2.12: Use gtk_recent_chooser_menu_set_show_numbers() instead. - * - * Since: 2.10 - */ -void -gtk_recent_chooser_set_show_numbers (GtkRecentChooser *chooser, - gboolean show_numbers) -{ - g_return_if_fail (GTK_IS_RECENT_CHOOSER (chooser)); - - if (!recent_chooser_has_show_numbers (chooser)) - { - g_warning ("Choosers of type `%s' do not support showing numbers", - G_OBJECT_TYPE_NAME (chooser)); - - return; - } - - g_object_set (chooser, "show-numbers", show_numbers, NULL); -} - -/** - * gtk_recent_chooser_get_show_numbers: - * @chooser: a #GtkRecentChooser - * - * Returns whether @chooser should display recently used resources - * prepended by a unique number. - * - * Deprecated: 2.12: use gtk_recent_chooser_menu_get_show_numbers() instead. - * - * Return value: %TRUE if the recent chooser should show display numbers, - * %FALSE otherwise. - * - * Since: 2.10 - */ -gboolean -gtk_recent_chooser_get_show_numbers (GtkRecentChooser *chooser) -{ - GParamSpec *pspec; - gboolean show_numbers; - - g_return_val_if_fail (GTK_IS_RECENT_CHOOSER (chooser), FALSE); - - pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (chooser), - "show-numbers"); - if (!pspec || pspec->value_type != G_TYPE_BOOLEAN) - { - g_warning ("Choosers of type `%s' do not support showing numbers", - G_OBJECT_TYPE_NAME (chooser)); - - return FALSE; - } - - g_object_get (chooser, "show-numbers", &show_numbers, NULL); - - return show_numbers; -} - - /** * gtk_recent_chooser_set_sort_type: * @chooser: a #GtkRecentChooser diff --git a/gtk/gtkrecentchooser.h b/gtk/gtkrecentchooser.h index 2b5dd7e55f..f6494db691 100644 --- a/gtk/gtkrecentchooser.h +++ b/gtk/gtkrecentchooser.h @@ -19,7 +19,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -50,7 +50,9 @@ G_BEGIN_DECLS * * Used to specify the sorting method to be applyed to the recently * used resource list. - **/ + * + * Since: 2.10 + */ typedef enum { GTK_RECENT_SORT_NONE = 0, @@ -67,8 +69,25 @@ typedef gint (*GtkRecentSortFunc) (GtkRecentInfo *a, typedef struct _GtkRecentChooser GtkRecentChooser; /* dummy */ typedef struct _GtkRecentChooserIface GtkRecentChooserIface; +/** + * GTK_RECENT_CHOOSER_ERROR: + * + * Used to get the #GError quark for #GtkRecentChooser errors. + * + * Since: 2.10 + */ #define GTK_RECENT_CHOOSER_ERROR (gtk_recent_chooser_error_quark ()) +/** + * GtkRecentChooserError: + * @GTK_RECENT_CHOOSER_ERROR_NOT_FOUND: Indicates that a file does not exist + * @GTK_RECENT_CHOOSER_ERROR_INVALID_URI: Indicates a malformed URI + * + * These identify the various errors that can occur while calling + * #GtkRecentChooser functions. + * + * Since: 2.10 + */ typedef enum { GTK_RECENT_CHOOSER_ERROR_NOT_FOUND, @@ -138,11 +157,6 @@ gboolean gtk_recent_chooser_get_local_only (GtkRecentChooser *cho void gtk_recent_chooser_set_show_tips (GtkRecentChooser *chooser, gboolean show_tips); gboolean gtk_recent_chooser_get_show_tips (GtkRecentChooser *chooser); -#ifndef GTK_DISABLE_DEPRECATED -void gtk_recent_chooser_set_show_numbers (GtkRecentChooser *chooser, - gboolean show_numbers); -gboolean gtk_recent_chooser_get_show_numbers (GtkRecentChooser *chooser); -#endif /* GTK_DISABLE_DEPRECATED */ void gtk_recent_chooser_set_show_icons (GtkRecentChooser *chooser, gboolean show_icons); gboolean gtk_recent_chooser_get_show_icons (GtkRecentChooser *chooser); diff --git a/gtk/gtkrecentchooserdialog.c b/gtk/gtkrecentchooserdialog.c index 058439af8d..c86910f3fa 100644 --- a/gtk/gtkrecentchooserdialog.c +++ b/gtk/gtkrecentchooserdialog.c @@ -29,6 +29,52 @@ #include + +/** + * SECTION:gtkrecentchooserdialog + * @Short_description: Displays recently used files in a dialog + * @Title: GtkRecentChooserDialog + * @See_also:#GtkRecentChooser, #GtkDialog + * + * #GtkRecentChooserDialog is a dialog box suitable for displaying the recently + * used documents. This widgets works by putting a #GtkRecentChooserWidget inside + * a #GtkDialog. It exposes the #GtkRecentChooserIface interface, so you can use + * all the #GtkRecentChooser functions on the recent chooser dialog as well as + * those for #GtkDialog. + * + * Note that #GtkRecentChooserDialog does not have any methods of its own. + * Instead, you should use the functions that work on a #GtkRecentChooser. + * + * + * Typical usage + * In the simplest of cases, you can use the following code to use + * a #GtkRecentChooserDialog to select a recently used file: + * + * GtkWidget *dialog; + * + * dialog = gtk_recent_chooser_dialog_new ("Recent Documents", + * parent_window, + * GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + * GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, + * NULL); + * + * if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) + * { + * GtkRecentInfo *info; + * + * info = gtk_recent_chooser_get_current_item (GTK_RECENT_CHOOSER (dialog)); + * open_file (gtk_recent_info_get_uri (info)); + * gtk_recent_info_unref (info); + * } + * + * gtk_widget_destroy (dialog); + * + * + * + * Recently used files are supported since GTK+ 2.10. + */ + + struct _GtkRecentChooserDialogPrivate { GtkRecentManager *manager; diff --git a/gtk/gtkrecentchooserdialog.h b/gtk/gtkrecentchooserdialog.h index d8c12214a8..cfcce51362 100644 --- a/gtk/gtkrecentchooserdialog.h +++ b/gtk/gtkrecentchooserdialog.h @@ -18,7 +18,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkrecentchoosermenu.c b/gtk/gtkrecentchoosermenu.c index 1dd2ac26a3..f77643b658 100644 --- a/gtk/gtkrecentchoosermenu.c +++ b/gtk/gtkrecentchoosermenu.c @@ -47,6 +47,34 @@ #include "gtkprivate.h" #include "gtkalias.h" + +/** + * SECTION:gtkrecentchoosermenu + * @Short_description: Displays recently used files in a menu + * @Title: GtkRecentChooserMenu + * @See_also:#GtkRecentChooser + * + * #GtkRecentChooserMenu is a widget suitable for displaying recently used files + * inside a menu. It can be used to set a sub-menu of a #GtkMenuItem using + * gtk_menu_item_set_submenu(), or as the menu of a #GtkMenuToolButton. + * + * Note that #GtkRecentChooserMenu does not have any methods of its own. Instead, + * you should use the functions that work on a #GtkRecentChooser. + * + * Note also that #GtkRecentChooserMenu does not support multiple filters, as it + * has no way to let the user choose between them as the #GtkRecentChooserWidget + * and #GtkRecentChooserDialog widgets do. Thus using gtk_recent_chooser_add_filter() + * on a #GtkRecentChooserMenu widget will yield the same effects as using + * gtk_recent_chooser_set_filter(), replacing any currently set filter + * with the supplied filter; gtk_recent_chooser_remove_filter() will remove + * any currently set #GtkRecentFilter object and will unset the current filter; + * gtk_recent_chooser_list_filters() will return a list containing a single + * #GtkRecentFilter object. + * + * Recently used files are supported since GTK+ 2.10. + */ + + struct _GtkRecentChooserMenuPrivate { /* the recent manager object */ diff --git a/gtk/gtkrecentchoosermenu.h b/gtk/gtkrecentchoosermenu.h index 6b401d6918..c30547a786 100644 --- a/gtk/gtkrecentchoosermenu.h +++ b/gtk/gtkrecentchoosermenu.h @@ -18,7 +18,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkrecentchooserwidget.c b/gtk/gtkrecentchooserwidget.c index 211d852a73..44169a44ea 100644 --- a/gtk/gtkrecentchooserwidget.c +++ b/gtk/gtkrecentchooserwidget.c @@ -26,6 +26,25 @@ #include "gtktypebuiltins.h" #include "gtkalias.h" + +/** + * SECTION:gtkrecentchooserwidget + * @Short_description: Displays recently used files + * @Title: GtkRecentChooserWidget + * @See_also:#GtkRecentChooser, #GtkRecentChooserDialog + * + * #GtkRecentChooserWidget is a widget suitable for selecting recently used + * files. It is the main building block of a #GtkRecentChooserDialog. Most + * applications will only need to use the latter; you can use + * #GtkRecentChooserWidget as part of a larger window if you have special needs. + * + * Note that #GtkRecentChooserWidget does not have any methods of its own. + * Instead, you should use the functions that work on a #GtkRecentChooser. + * + * Recently used files are supported since GTK+ 2.10. + */ + + struct _GtkRecentChooserWidgetPrivate { GtkRecentManager *manager; diff --git a/gtk/gtkrecentchooserwidget.h b/gtk/gtkrecentchooserwidget.h index d5aa58f51f..0a01428471 100644 --- a/gtk/gtkrecentchooserwidget.h +++ b/gtk/gtkrecentchooserwidget.h @@ -18,7 +18,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkrecentfilter.h b/gtk/gtkrecentfilter.h index 3be8e5e979..8dc64a85f9 100644 --- a/gtk/gtkrecentfilter.h +++ b/gtk/gtkrecentfilter.h @@ -18,7 +18,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkrecentmanager.c b/gtk/gtkrecentmanager.c index 4181d4a0e2..a9ee6d37e7 100644 --- a/gtk/gtkrecentmanager.c +++ b/gtk/gtkrecentmanager.c @@ -640,58 +640,6 @@ gtk_recent_manager_get_default (void) return recent_manager_singleton; } -/** - * gtk_recent_manager_get_for_screen: - * @screen: a #GdkScreen - * - * Gets the recent manager object associated with @screen; if this - * function has not previously been called for the given screen, - * a new recent manager object will be created and associated with - * the screen. Recent manager objects are fairly expensive to create, - * so using this function is usually a better choice than calling - * gtk_recent_manager_new() and setting the screen yourself; by using - * this function a single recent manager object will be shared between - * users. - * - * Return value: A unique #GtkRecentManager associated with the given - * screen. This recent manager is associated to the with the screen - * and can be used as long as the screen is open. Do not ref or - * unref it. - * - * Deprecated: 2.12: This function has been deprecated and should - * not be used in newly written code. Calling this function is - * equivalent to calling gtk_recent_manager_get_default(). - * - * Since: 2.10 - */ -GtkRecentManager * -gtk_recent_manager_get_for_screen (GdkScreen *screen) -{ - return gtk_recent_manager_get_default (); -} - -/** - * gtk_recent_manager_set_screen: - * @manager: a #GtkRecentManager - * @screen: a #GdkScreen - * - * Sets the screen for a recent manager; the screen is used to - * track the user's currently configured recently used documents - * storage. - * - * Since: 2.10 - * - * Deprecated: 2.12: This function has been deprecated and should - * not be used in newly written code. Calling this function has - * no effect. - */ -void -gtk_recent_manager_set_screen (GtkRecentManager *manager, - GdkScreen *screen) -{ - -} - /** * gtk_recent_manager_set_limit: * @manager: a #GtkRecentManager diff --git a/gtk/gtkrecentmanager.h b/gtk/gtkrecentmanager.h index ccc6581594..d13fcf4148 100644 --- a/gtk/gtkrecentmanager.h +++ b/gtk/gtkrecentmanager.h @@ -18,7 +18,7 @@ * Free Software Foundation, Inc., 59 Temple Place - Suite 330, */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -140,12 +140,6 @@ GType gtk_recent_manager_get_type (void) G_GNUC_CONST; GtkRecentManager *gtk_recent_manager_new (void); GtkRecentManager *gtk_recent_manager_get_default (void); -#ifndef GTK_DISABLE_DEPRECATED -GtkRecentManager *gtk_recent_manager_get_for_screen (GdkScreen *screen); -void gtk_recent_manager_set_screen (GtkRecentManager *manager, - GdkScreen *screen); -#endif - gboolean gtk_recent_manager_add_item (GtkRecentManager *manager, const gchar *uri); gboolean gtk_recent_manager_add_full (GtkRecentManager *manager, diff --git a/gtk/gtkruler.c b/gtk/gtkruler.c index 5e16daf9e4..b6721dbe4c 100644 --- a/gtk/gtkruler.c +++ b/gtk/gtkruler.c @@ -278,7 +278,6 @@ gtk_ruler_get_property (GObject *object, } } -#if 0 /** * gtk_ruler_new: * @orientation: the ruler's orientation. @@ -287,7 +286,7 @@ gtk_ruler_get_property (GObject *object, * * Return value: a new #GtkRuler. * - * Since: 2.16 + * Since: 3.0 **/ GtkWidget * gtk_ruler_new (GtkOrientation orientation) @@ -296,7 +295,6 @@ gtk_ruler_new (GtkOrientation orientation) "orientation", orientation, NULL); } -#endif void gtk_ruler_set_metric (GtkRuler *ruler, diff --git a/gtk/gtkruler.h b/gtk/gtkruler.h index ed149e3af6..07203ea0fe 100644 --- a/gtk/gtkruler.h +++ b/gtk/gtkruler.h @@ -34,7 +34,7 @@ * distribution. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -110,6 +110,7 @@ struct _GtkRulerMetric GType gtk_ruler_get_type (void) G_GNUC_CONST; +GtkWidget * gtk_ruler_new (GtkOrientation orientation); void gtk_ruler_set_metric (GtkRuler *ruler, GtkMetricType metric); GtkMetricType gtk_ruler_get_metric (GtkRuler *ruler); diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c index 9e92d9cbd3..c2f0f3520c 100644 --- a/gtk/gtkscale.c +++ b/gtk/gtkscale.c @@ -126,9 +126,9 @@ static void gtk_scale_buildable_custom_finished (GtkBuildable *buildable, gpointer user_data); -G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GtkScale, gtk_scale, GTK_TYPE_RANGE, - G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE, - gtk_scale_buildable_interface_init)) +G_DEFINE_TYPE_WITH_CODE (GtkScale, gtk_scale, GTK_TYPE_RANGE, + G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE, + gtk_scale_buildable_interface_init)) static gboolean @@ -463,7 +463,6 @@ gtk_scale_get_property (GObject *object, } } -#if 0 /** * gtk_scale_new: * @orientation: the scale's orientation. @@ -474,7 +473,7 @@ gtk_scale_get_property (GObject *object, * * Return value: a new #GtkScale * - * Since: 2.16 + * Since: 3.0 **/ GtkWidget * gtk_scale_new (GtkOrientation orientation, @@ -508,8 +507,8 @@ gtk_scale_new (GtkOrientation orientation, * * Return value: a new #GtkScale * - * Since: 2.16 - **/ + * Since: 3.0 + */ GtkWidget * gtk_scale_new_with_range (GtkOrientation orientation, gdouble min, @@ -541,14 +540,13 @@ gtk_scale_new_with_range (GtkOrientation orientation, "digits", digits, NULL); } -#endif /** * gtk_scale_set_digits: * @scale: a #GtkScale - * @digits: the number of decimal places to display, + * @digits: the number of decimal places to display, * e.g. use 1 to display 1.0, 2 to display 1.00, etc - * + * * Sets the number of decimal places that are displayed in the value. * Also causes the value of the adjustment to be rounded off to this * number of digits, so the retrieved value matches the value the user saw. @@ -946,7 +944,10 @@ find_next_pos (GtkWidget *widget, return marks[i]; } - return widget->allocation.width; + if (pos == GTK_POS_TOP || pos == GTK_POS_BOTTOM) + return widget->allocation.width; + else + return widget->allocation.height; } static gboolean @@ -1074,7 +1075,7 @@ gtk_scale_expose (GtkWidget *widget, { pango_layout_set_markup (layout, mark->markup, -1); pango_layout_get_pixel_extents (layout, NULL, &logical_rect); - + y3 = y1 - logical_rect.height / 2; if (y3 < min_pos) y3 = min_pos; diff --git a/gtk/gtkscale.h b/gtk/gtkscale.h index 4221dd281c..c98b33a139 100644 --- a/gtk/gtkscale.h +++ b/gtk/gtkscale.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -77,6 +77,12 @@ struct _GtkScaleClass }; GType gtk_scale_get_type (void) G_GNUC_CONST; +GtkWidget * gtk_scale_new (GtkOrientation orientation, + GtkAdjustment *adjustment); +GtkWidget * gtk_scale_new_with_range (GtkOrientation orientation, + gdouble min, + gdouble max, + gdouble step); void gtk_scale_set_digits (GtkScale *scale, gint digits); gint gtk_scale_get_digits (GtkScale *scale); diff --git a/gtk/gtkscalebutton.c b/gtk/gtkscalebutton.c index 7259622001..dce3937a25 100644 --- a/gtk/gtkscalebutton.c +++ b/gtk/gtkscalebutton.c @@ -60,6 +60,19 @@ #include "gtkintl.h" #include "gtkalias.h" + +/** + * SECTION:gtkscalebutton + * @Short_description: A button which pops up a scale + * @Title: GtkScaleButton + * + * #GtkScaleButton provides a button which pops up a scale widget. + * This kind of widget is commonly used for volume controls in multimedia + * applications, and GTK+ provides a #GtkVolumeButton subclass that + * is tailored for this use case. + */ + + #define SCALE_SIZE 100 #define CLICK_TIMEOUT 250 @@ -103,6 +116,9 @@ struct _GtkScaleButtonPrivate gchar **icon_list; + GdkDevice *grab_pointer; + GdkDevice *grab_keyboard; + GtkAdjustment *adjustment; /* needed because it must be settable in init() */ }; @@ -706,46 +722,6 @@ gtk_scale_button_set_adjustment (GtkScaleButton *button, } } -/** - * gtk_scale_button_get_orientation: - * @button: a #GtkScaleButton - * - * Gets the orientation of the #GtkScaleButton's popup window. - * - * Returns: the #GtkScaleButton's orientation. - * - * Since: 2.14 - * - * Deprecated: 2.16: Use gtk_orientable_get_orientation() instead. - **/ -GtkOrientation -gtk_scale_button_get_orientation (GtkScaleButton *button) -{ - g_return_val_if_fail (GTK_IS_SCALE_BUTTON (button), GTK_ORIENTATION_VERTICAL); - - return button->priv->orientation; -} - -/** - * gtk_scale_button_set_orientation: - * @button: a #GtkScaleButton - * @orientation: the new orientation - * - * Sets the orientation of the #GtkScaleButton's popup window. - * - * Since: 2.14 - * - * Deprecated: 2.16: Use gtk_orientable_set_orientation() instead. - **/ -void -gtk_scale_button_set_orientation (GtkScaleButton *button, - GtkOrientation orientation) -{ - g_return_if_fail (GTK_IS_SCALE_BUTTON (button)); - - gtk_scale_button_set_orientation_private (button, orientation); -} - /** * gtk_scale_button_get_plus_button: * @button: a #GtkScaleButton @@ -928,6 +904,7 @@ gtk_scale_popup (GtkWidget *widget, GdkDisplay *display; GdkScreen *screen; gboolean is_moved; + GdkDevice *device, *keyboard, *pointer; is_moved = FALSE; button = GTK_SCALE_BUTTON (widget); @@ -1009,21 +986,27 @@ gtk_scale_popup (GtkWidget *widget, /* Move the dock, but set is_moved so we * don't forward the first click later on, * as it could make the scale go to the bottom */ - if (y < rect.y) { - y = rect.y; - is_moved = TRUE; - } else if (y + d->allocation.height > rect.height + rect.y) { - y = rect.y + rect.height - d->allocation.height; - is_moved = TRUE; - } + if (y < rect.y) + { + y = rect.y; + is_moved = TRUE; + } + else if (y + d->allocation.height > rect.height + rect.y) + { + y = rect.y + rect.height - d->allocation.height; + is_moved = TRUE; + } - if (x < rect.x) { - x = rect.x; - is_moved = TRUE; - } else if (x + d->allocation.width > rect.width + rect.x) { - x = rect.x + rect.width - d->allocation.width; - is_moved = TRUE; - } + if (x < rect.x) + { + x = rect.x; + is_moved = TRUE; + } + else if (x + d->allocation.width > rect.width + rect.x) + { + x = rect.x + rect.width - d->allocation.width; + is_moved = TRUE; + } } gtk_window_move (GTK_WINDOW (priv->dock), x, y); @@ -1031,28 +1014,46 @@ gtk_scale_popup (GtkWidget *widget, if (event->type == GDK_BUTTON_PRESS) GTK_WIDGET_CLASS (gtk_scale_button_parent_class)->button_press_event (widget, (GdkEventButton *) event); - /* grab focus */ - gtk_grab_add (priv->dock); + device = gdk_event_get_device (event); - if (gdk_pointer_grab (priv->dock->window, TRUE, - GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | - GDK_POINTER_MOTION_MASK, NULL, NULL, time) - != GDK_GRAB_SUCCESS) + if (device->source == GDK_SOURCE_KEYBOARD) { - gtk_grab_remove (priv->dock); + keyboard = device; + pointer = gdk_device_get_associated_device (device); + } + else + { + pointer = device; + keyboard = gdk_device_get_associated_device (device); + } + + /* grab focus */ + gtk_device_grab_add (priv->dock, pointer, TRUE); + + if (gdk_device_grab (pointer, priv->dock->window, + GDK_OWNERSHIP_WINDOW, TRUE, + GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | + GDK_POINTER_MOTION_MASK, NULL, time) != GDK_GRAB_SUCCESS) + { + gtk_device_grab_remove (priv->dock, pointer); gtk_widget_hide (priv->dock); return FALSE; } - if (gdk_keyboard_grab (priv->dock->window, TRUE, time) != GDK_GRAB_SUCCESS) + if (gdk_device_grab (keyboard, priv->dock->window, + GDK_OWNERSHIP_WINDOW, TRUE, + GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK, + NULL, time) != GDK_GRAB_SUCCESS) { - gdk_display_pointer_ungrab (display, time); - gtk_grab_remove (priv->dock); + gdk_device_ungrab (pointer, time); + gtk_device_grab_remove (priv->dock, pointer); gtk_widget_hide (priv->dock); return FALSE; } gtk_widget_grab_focus (priv->dock); + priv->grab_keyboard = keyboard; + priv->grab_pointer = pointer; if (event->type == GDK_BUTTON_PRESS && !is_moved) { @@ -1107,8 +1108,21 @@ gtk_scale_button_popup (GtkWidget *widget) { GdkEvent *ev; - ev = gdk_event_new (GDK_KEY_RELEASE); - gtk_scale_popup (widget, ev, GDK_CURRENT_TIME); + /* This is a callback for a keybinding signal, + * current event should be the key event that + * triggered it. + */ + ev = gtk_get_current_event (); + + if (ev->type != GDK_KEY_PRESS && + ev->type != GDK_KEY_RELEASE) + { + gdk_event_free (ev); + ev = gdk_event_new (GDK_KEY_RELEASE); + ev->key.time = GDK_CURRENT_TIME; + } + + gtk_scale_popup (widget, ev, ev->key.time); gdk_event_free (ev); } @@ -1127,22 +1141,35 @@ gtk_scale_button_grab_notify (GtkScaleButton *button, { GdkDisplay *display; GtkScaleButtonPrivate *priv; - - if (was_grabbed != FALSE) - return; + GtkWidget *toplevel, *grab_widget; + GtkWindowGroup *group; priv = button->priv; - if (!gtk_widget_has_grab (priv->dock)) + if (!priv->grab_pointer || + !gtk_widget_device_is_shadowed (GTK_WIDGET (button), priv->grab_pointer)) return; - if (gtk_widget_is_ancestor (gtk_grab_get_current (), priv->dock)) + toplevel = gtk_widget_get_toplevel (GTK_WIDGET (button)); + + if (GTK_IS_WINDOW (toplevel)) + group = gtk_window_get_group (GTK_WINDOW (toplevel)); + else + group = gtk_window_get_group (NULL); + + grab_widget = gtk_window_group_get_current_device_grab (group, priv->grab_pointer); + + if (grab_widget && + gtk_widget_is_ancestor (grab_widget, priv->dock)) return; display = gtk_widget_get_display (priv->dock); - gdk_display_keyboard_ungrab (display, GDK_CURRENT_TIME); - gdk_display_pointer_ungrab (display, GDK_CURRENT_TIME); - gtk_grab_remove (priv->dock); + gdk_device_ungrab (priv->grab_keyboard, GDK_CURRENT_TIME); + gdk_device_ungrab (priv->grab_pointer, GDK_CURRENT_TIME); + gtk_device_grab_remove (priv->dock, priv->grab_pointer); + + priv->grab_keyboard = NULL; + priv->grab_pointer = NULL; /* hide again */ gtk_widget_hide (priv->dock); @@ -1254,7 +1281,7 @@ cb_dock_grab_notify (GtkWidget *widget, static gboolean cb_dock_grab_broken_event (GtkWidget *widget, - gboolean was_grabbed, + gboolean was_grabbed, gpointer user_data) { GtkScaleButton *button = (GtkScaleButton *) user_data; @@ -1280,9 +1307,12 @@ gtk_scale_button_release_grab (GtkScaleButton *button, /* ungrab focus */ display = gtk_widget_get_display (GTK_WIDGET (button)); - gdk_display_keyboard_ungrab (display, event->time); - gdk_display_pointer_ungrab (display, event->time); - gtk_grab_remove (priv->dock); + gdk_device_ungrab (priv->grab_keyboard, event->time); + gdk_device_ungrab (priv->grab_pointer, event->time); + gtk_device_grab_remove (priv->dock, priv->grab_pointer); + + priv->grab_keyboard = NULL; + priv->grab_pointer = NULL; /* hide again */ gtk_widget_hide (priv->dock); @@ -1324,9 +1354,12 @@ gtk_scale_button_popdown (GtkWidget *widget) /* ungrab focus */ display = gtk_widget_get_display (widget); - gdk_display_keyboard_ungrab (display, GDK_CURRENT_TIME); - gdk_display_pointer_ungrab (display, GDK_CURRENT_TIME); - gtk_grab_remove (priv->dock); + gdk_device_ungrab (priv->grab_keyboard, GDK_CURRENT_TIME); + gdk_device_ungrab (priv->grab_pointer, GDK_CURRENT_TIME); + gtk_device_grab_remove (priv->dock, priv->grab_pointer); + + priv->grab_keyboard = NULL; + priv->grab_pointer = NULL; /* hide again */ gtk_widget_hide (priv->dock); @@ -1445,7 +1478,7 @@ gtk_scale_button_scale_press (GtkWidget *widget, /* the scale will grab input; if we have input grabbed, all goes * horribly wrong, so let's not do that. */ - gtk_grab_remove (priv->dock); + gtk_device_grab_remove (priv->dock, event->device); return GTK_WIDGET_CLASS (_gtk_scale_button_scale_parent_class)->button_press_event (widget, event); } @@ -1480,7 +1513,7 @@ gtk_scale_button_scale_release (GtkWidget *widget, * find that, so we do this complex 'first-call-parent-then-do-actual- * action' thingy... */ - gtk_grab_add (button->priv->dock); + gtk_device_grab_add (button->priv->dock, event->device, TRUE); return res; } diff --git a/gtk/gtkscalebutton.h b/gtk/gtkscalebutton.h index 61239098db..fc6cc583c9 100644 --- a/gtk/gtkscalebutton.h +++ b/gtk/gtkscalebutton.h @@ -33,7 +33,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -99,14 +99,6 @@ GtkWidget * gtk_scale_button_get_plus_button (GtkScaleButton *button); GtkWidget * gtk_scale_button_get_minus_button (GtkScaleButton *button); GtkWidget * gtk_scale_button_get_popup (GtkScaleButton *button); -#ifndef GTK_DISABLE_DEPRECATED - -GtkOrientation gtk_scale_button_get_orientation (GtkScaleButton *button); -void gtk_scale_button_set_orientation (GtkScaleButton *button, - GtkOrientation orientation); - -#endif /* GTK_DISABLE_DEPRECATED */ - G_END_DECLS #endif /* __GTK_SCALE_BUTTON_H__ */ diff --git a/gtk/gtkscrollbar.c b/gtk/gtkscrollbar.c index 634b33791f..6bd2f6150e 100644 --- a/gtk/gtkscrollbar.c +++ b/gtk/gtkscrollbar.c @@ -35,7 +35,7 @@ static void gtk_scrollbar_style_set (GtkWidget *widget, GtkStyle *previous); -G_DEFINE_ABSTRACT_TYPE (GtkScrollbar, gtk_scrollbar, GTK_TYPE_RANGE) +G_DEFINE_TYPE (GtkScrollbar, gtk_scrollbar, GTK_TYPE_RANGE) static void gtk_scrollbar_class_init (GtkScrollbarClass *class) @@ -125,7 +125,6 @@ gtk_scrollbar_style_set (GtkWidget *widget, GTK_WIDGET_CLASS (gtk_scrollbar_parent_class)->style_set (widget, previous); } -#if 0 /** * gtk_scrollbar_new: * @orientation: the scrollbar's orientation. @@ -135,7 +134,7 @@ gtk_scrollbar_style_set (GtkWidget *widget, * * Return value: the new #GtkScrollbar. * - * Since: 2.16 + * Since: 3.0 **/ GtkWidget * gtk_scrollbar_new (GtkOrientation orientation, @@ -149,7 +148,6 @@ gtk_scrollbar_new (GtkOrientation orientation, "adjustment", adjustment, NULL); } -#endif #define __GTK_SCROLLBAR_C__ diff --git a/gtk/gtkscrollbar.h b/gtk/gtkscrollbar.h index 524335da14..992bb0dcfc 100644 --- a/gtk/gtkscrollbar.h +++ b/gtk/gtkscrollbar.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -66,6 +66,8 @@ struct _GtkScrollbarClass GType gtk_scrollbar_get_type (void) G_GNUC_CONST; +GtkWidget * gtk_scrollbar_new (GtkOrientation orientation, + GtkAdjustment *adjustment); G_END_DECLS diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c index 5a3cd91520..026bb5912f 100644 --- a/gtk/gtkscrolledwindow.c +++ b/gtk/gtkscrolledwindow.c @@ -28,6 +28,7 @@ #include #include #include "gtkbindings.h" +#include "gtkextendedlayout.h" #include "gtkmarshalers.h" #include "gtkscrolledwindow.h" #include "gtkwindow.h" @@ -113,8 +114,6 @@ static void gtk_scrolled_window_screen_changed (GtkWidget *widge GdkScreen *previous_screen); static gboolean gtk_scrolled_window_expose (GtkWidget *widget, GdkEventExpose *event); -static void gtk_scrolled_window_size_request (GtkWidget *widget, - GtkRequisition *requisition); static void gtk_scrolled_window_size_allocate (GtkWidget *widget, GtkAllocation *allocation); static gboolean gtk_scrolled_window_scroll_event (GtkWidget *widget, @@ -142,9 +141,28 @@ static void gtk_scrolled_window_adjustment_changed (GtkAdjustment *adjus static void gtk_scrolled_window_update_real_placement (GtkScrolledWindow *scrolled_window); +static void gtk_scrolled_window_extended_layout_init (GtkExtendedLayoutIface *iface); +static void gtk_scrolled_window_get_desired_width (GtkExtendedLayout *layout, + gint *minimum_size, + gint *natural_size); +static void gtk_scrolled_window_get_desired_height (GtkExtendedLayout *layout, + gint *minimum_size, + gint *natural_size); +static void gtk_scrolled_window_get_height_for_width (GtkExtendedLayout *layout, + gint width, + gint *minimum_height, + gint *natural_height); +static void gtk_scrolled_window_get_width_for_height (GtkExtendedLayout *layout, + gint width, + gint *minimum_height, + gint *natural_height); + static guint signals[LAST_SIGNAL] = {0}; -G_DEFINE_TYPE (GtkScrolledWindow, gtk_scrolled_window, GTK_TYPE_BIN) +G_DEFINE_TYPE_WITH_CODE (GtkScrolledWindow, gtk_scrolled_window, GTK_TYPE_BIN, + G_IMPLEMENT_INTERFACE (GTK_TYPE_EXTENDED_LAYOUT, + gtk_scrolled_window_extended_layout_init)) + static void add_scroll_binding (GtkBindingSet *binding_set, @@ -198,7 +216,6 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class) widget_class->screen_changed = gtk_scrolled_window_screen_changed; widget_class->expose_event = gtk_scrolled_window_expose; - widget_class->size_request = gtk_scrolled_window_size_request; widget_class->size_allocate = gtk_scrolled_window_size_allocate; widget_class->scroll_event = gtk_scrolled_window_scroll_event; widget_class->focus = gtk_scrolled_window_focus; @@ -1197,8 +1214,6 @@ gtk_scrolled_window_scroll_child (GtkScrolledWindow *scrolled_window, break; } - value = CLAMP (value, adjustment->lower, adjustment->upper - adjustment->page_size); - gtk_adjustment_set_value (adjustment, value); return TRUE; @@ -1229,98 +1244,6 @@ gtk_scrolled_window_move_focus_out (GtkScrolledWindow *scrolled_window, g_object_unref (scrolled_window); } -static void -gtk_scrolled_window_size_request (GtkWidget *widget, - GtkRequisition *requisition) -{ - GtkScrolledWindow *scrolled_window; - GtkBin *bin; - gint extra_width; - gint extra_height; - gint scrollbar_spacing; - GtkRequisition hscrollbar_requisition; - GtkRequisition vscrollbar_requisition; - GtkRequisition child_requisition; - - g_return_if_fail (GTK_IS_SCROLLED_WINDOW (widget)); - g_return_if_fail (requisition != NULL); - - scrolled_window = GTK_SCROLLED_WINDOW (widget); - bin = GTK_BIN (scrolled_window); - - scrollbar_spacing = _gtk_scrolled_window_get_scrollbar_spacing (scrolled_window); - - extra_width = 0; - extra_height = 0; - requisition->width = 0; - requisition->height = 0; - - gtk_widget_size_request (scrolled_window->hscrollbar, - &hscrollbar_requisition); - gtk_widget_size_request (scrolled_window->vscrollbar, - &vscrollbar_requisition); - - if (bin->child && gtk_widget_get_visible (bin->child)) - { - gtk_widget_size_request (bin->child, &child_requisition); - - if (scrolled_window->hscrollbar_policy == GTK_POLICY_NEVER) - requisition->width += child_requisition.width; - else - { - GtkWidgetAuxInfo *aux_info = _gtk_widget_get_aux_info (bin->child, FALSE); - - if (aux_info && aux_info->width > 0) - { - requisition->width += aux_info->width; - extra_width = -1; - } - else - requisition->width += vscrollbar_requisition.width; - } - - if (scrolled_window->vscrollbar_policy == GTK_POLICY_NEVER) - requisition->height += child_requisition.height; - else - { - GtkWidgetAuxInfo *aux_info = _gtk_widget_get_aux_info (bin->child, FALSE); - - if (aux_info && aux_info->height > 0) - { - requisition->height += aux_info->height; - extra_height = -1; - } - else - requisition->height += hscrollbar_requisition.height; - } - } - - if (scrolled_window->hscrollbar_policy == GTK_POLICY_AUTOMATIC || - scrolled_window->hscrollbar_policy == GTK_POLICY_ALWAYS) - { - requisition->width = MAX (requisition->width, hscrollbar_requisition.width); - if (!extra_height || scrolled_window->hscrollbar_policy == GTK_POLICY_ALWAYS) - extra_height = scrollbar_spacing + hscrollbar_requisition.height; - } - - if (scrolled_window->vscrollbar_policy == GTK_POLICY_AUTOMATIC || - scrolled_window->vscrollbar_policy == GTK_POLICY_ALWAYS) - { - requisition->height = MAX (requisition->height, vscrollbar_requisition.height); - if (!extra_height || scrolled_window->vscrollbar_policy == GTK_POLICY_ALWAYS) - extra_width = scrollbar_spacing + vscrollbar_requisition.width; - } - - requisition->width += GTK_CONTAINER (widget)->border_width * 2 + MAX (0, extra_width); - requisition->height += GTK_CONTAINER (widget)->border_width * 2 + MAX (0, extra_height); - - if (scrolled_window->shadow_type != GTK_SHADOW_NONE) - { - requisition->width += 2 * widget->style->xthickness; - requisition->height += 2 * widget->style->ythickness; - } -} - static void gtk_scrolled_window_relative_allocation (GtkWidget *widget, GtkAllocation *allocation) @@ -1582,13 +1505,11 @@ gtk_scrolled_window_scroll_event (GtkWidget *widget, if (range && gtk_widget_get_visible (range)) { GtkAdjustment *adj = GTK_RANGE (range)->adjustment; - gdouble delta, new_value; + gdouble delta; delta = _gtk_range_get_wheel_delta (GTK_RANGE (range), event->direction); - new_value = CLAMP (adj->value + delta, adj->lower, adj->upper - adj->page_size); - - gtk_adjustment_set_value (adj, new_value); + gtk_adjustment_set_value (adj, adj->value + delta); return TRUE; } @@ -1795,5 +1716,193 @@ _gtk_scrolled_window_get_scrollbar_spacing (GtkScrolledWindow *scrolled_window) } } + +static void +gtk_scrolled_window_extended_layout_init (GtkExtendedLayoutIface *iface) +{ + iface->get_desired_width = gtk_scrolled_window_get_desired_width; + iface->get_desired_height = gtk_scrolled_window_get_desired_height; + iface->get_height_for_width = gtk_scrolled_window_get_height_for_width; + iface->get_width_for_height = gtk_scrolled_window_get_width_for_height; +} + +static void +gtk_scrolled_window_get_desired_size (GtkExtendedLayout *layout, + GtkOrientation orientation, + gint *minimum_size, + gint *natural_size) +{ + GtkScrolledWindow *scrolled_window; + GtkBin *bin; + gint extra_width; + gint extra_height; + gint scrollbar_spacing; + GtkRequisition hscrollbar_requisition; + GtkRequisition vscrollbar_requisition; + GtkRequisition minimum_req, natural_req; + gint min_child_size, nat_child_size; + + scrolled_window = GTK_SCROLLED_WINDOW (layout); + bin = GTK_BIN (scrolled_window); + + scrollbar_spacing = _gtk_scrolled_window_get_scrollbar_spacing (scrolled_window); + + extra_width = 0; + extra_height = 0; + minimum_req.width = 0; + minimum_req.height = 0; + natural_req.width = 0; + natural_req.height = 0; + + gtk_widget_size_request (scrolled_window->hscrollbar, + &hscrollbar_requisition); + gtk_widget_size_request (scrolled_window->vscrollbar, + &vscrollbar_requisition); + + if (bin->child && gtk_widget_get_visible (bin->child)) + { + if (orientation == GTK_ORIENTATION_HORIZONTAL) + { + gtk_extended_layout_get_desired_width (GTK_EXTENDED_LAYOUT (bin->child), + &min_child_size, + &nat_child_size); + + if (scrolled_window->hscrollbar_policy == GTK_POLICY_NEVER) + { + minimum_req.width += min_child_size; + natural_req.width += nat_child_size; + } + else + { + GtkWidgetAuxInfo *aux_info = _gtk_widget_get_aux_info (bin->child, FALSE); + + if (aux_info && aux_info->width > 0) + { + minimum_req.width += aux_info->width; + natural_req.width += aux_info->width; + extra_width = -1; + } + else + { + minimum_req.width += vscrollbar_requisition.width; + natural_req.width += vscrollbar_requisition.width; + } + } + } + else /* GTK_ORIENTATION_VERTICAL */ + { + gtk_extended_layout_get_desired_height (GTK_EXTENDED_LAYOUT (bin->child), + &min_child_size, + &nat_child_size); + + if (scrolled_window->vscrollbar_policy == GTK_POLICY_NEVER) + { + minimum_req.height += min_child_size; + natural_req.height += nat_child_size; + } + else + { + GtkWidgetAuxInfo *aux_info = _gtk_widget_get_aux_info (bin->child, FALSE); + + if (aux_info && aux_info->height > 0) + { + minimum_req.height += aux_info->height; + natural_req.height += aux_info->height; + extra_height = -1; + } + else + { + minimum_req.height += hscrollbar_requisition.height; + natural_req.height += hscrollbar_requisition.height; + } + } + } + } + + if (scrolled_window->hscrollbar_policy == GTK_POLICY_AUTOMATIC || + scrolled_window->hscrollbar_policy == GTK_POLICY_ALWAYS) + { + minimum_req.width = MAX (minimum_req.width, hscrollbar_requisition.width); + natural_req.width = MAX (natural_req.width, hscrollbar_requisition.width); + if (!extra_height || scrolled_window->hscrollbar_policy == GTK_POLICY_ALWAYS) + extra_height = scrollbar_spacing + hscrollbar_requisition.height; + } + + if (scrolled_window->vscrollbar_policy == GTK_POLICY_AUTOMATIC || + scrolled_window->vscrollbar_policy == GTK_POLICY_ALWAYS) + { + minimum_req.height = MAX (minimum_req.height, vscrollbar_requisition.height); + natural_req.height = MAX (natural_req.height, vscrollbar_requisition.height); + if (!extra_height || scrolled_window->vscrollbar_policy == GTK_POLICY_ALWAYS) + extra_width = scrollbar_spacing + vscrollbar_requisition.width; + } + + minimum_req.width += GTK_CONTAINER (layout)->border_width * 2 + MAX (0, extra_width); + minimum_req.height += GTK_CONTAINER (layout)->border_width * 2 + MAX (0, extra_height); + natural_req.width += GTK_CONTAINER (layout)->border_width * 2 + MAX (0, extra_width); + natural_req.height += GTK_CONTAINER (layout)->border_width * 2 + MAX (0, extra_height); + + if (scrolled_window->shadow_type != GTK_SHADOW_NONE) + { + minimum_req.width += 2 * GTK_WIDGET (layout)->style->xthickness; + minimum_req.height += 2 * GTK_WIDGET (layout)->style->ythickness; + natural_req.width += 2 * GTK_WIDGET (layout)->style->xthickness; + natural_req.height += 2 * GTK_WIDGET (layout)->style->ythickness; + } + + if (orientation == GTK_ORIENTATION_HORIZONTAL) + { + if (minimum_size) + *minimum_size = minimum_req.width; + if (natural_size) + *natural_size = natural_req.width; + } + else + { + if (minimum_size) + *minimum_size = minimum_req.height; + if (natural_size) + *natural_size = natural_req.height; + } +} + +static void +gtk_scrolled_window_get_desired_width (GtkExtendedLayout *layout, + gint *minimum_size, + gint *natural_size) +{ + gtk_scrolled_window_get_desired_size (layout, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size); +} + +static void +gtk_scrolled_window_get_desired_height (GtkExtendedLayout *layout, + gint *minimum_size, + gint *natural_size) +{ + gtk_scrolled_window_get_desired_size (layout, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size); +} + +static void +gtk_scrolled_window_get_height_for_width (GtkExtendedLayout *layout, + gint width, + gint *minimum_height, + gint *natural_height) +{ + g_return_if_fail (GTK_IS_WIDGET (layout)); + + GTK_EXTENDED_LAYOUT_GET_IFACE (layout)->get_desired_height (layout, minimum_height, natural_height); +} + +static void +gtk_scrolled_window_get_width_for_height (GtkExtendedLayout *layout, + gint height, + gint *minimum_width, + gint *natural_width) +{ + g_return_if_fail (GTK_IS_WIDGET (layout)); + + GTK_EXTENDED_LAYOUT_GET_IFACE (layout)->get_desired_width (layout, minimum_width, natural_width); +} + #define __GTK_SCROLLED_WINDOW_C__ #include "gtkaliasdef.c" diff --git a/gtk/gtkscrolledwindow.h b/gtk/gtkscrolledwindow.h index a82b3b0967..c5d50663f7 100644 --- a/gtk/gtkscrolledwindow.h +++ b/gtk/gtkscrolledwindow.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkselection.c b/gtk/gtkselection.c index cbc2b3ec35..5c7db9cc7f 100644 --- a/gtk/gtkselection.c +++ b/gtk/gtkselection.c @@ -2177,7 +2177,7 @@ gtk_selection_init (void) } /** - * gtk_selection_clear: + * _gtk_selection_clear: * @widget: a #GtkWidget * @event: the event * @@ -2185,15 +2185,9 @@ gtk_selection_init (void) * signal. * * Return value: %TRUE if the event was handled, otherwise false - * - * Since: 2.2 - * - * Deprecated: 2.4: Instead of calling this function, chain up from - * your selection-clear-event handler. Calling this function - * from any other context is illegal. **/ gboolean -gtk_selection_clear (GtkWidget *widget, +_gtk_selection_clear (GtkWidget *widget, GdkEventSelection *event) { /* Note that we filter clear events in gdkselection-x11.c, so diff --git a/gtk/gtkselection.h b/gtk/gtkselection.h index 55bfcad89a..ae689d552e 100644 --- a/gtk/gtkselection.h +++ b/gtk/gtkselection.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -197,10 +197,8 @@ gboolean gtk_targets_include_uri (GdkAtom *targets, void gtk_selection_remove_all (GtkWidget *widget); /* Event handlers */ -#if !defined(GTK_DISABLE_DEPRECATED) || defined (GTK_COMPILATION) -gboolean gtk_selection_clear (GtkWidget *widget, +gboolean _gtk_selection_clear (GtkWidget *widget, GdkEventSelection *event); -#endif gboolean _gtk_selection_request (GtkWidget *widget, GdkEventSelection *event); gboolean _gtk_selection_incr_event (GdkWindow *window, diff --git a/gtk/gtkseparator.c b/gtk/gtkseparator.c index b382c7d050..58ef60f1ad 100644 --- a/gtk/gtkseparator.c +++ b/gtk/gtkseparator.c @@ -33,6 +33,17 @@ #include "gtkalias.h" +/** + * SECTION:gtkseparator + * @Short_description: Base class for GtkHSeparator and GtkVSeparator + * @Title: GtkSeparator + * + * The GtkSeparator widget is the base class for #GtkHSeparator and + * #GtkVSeparator. It can be used in the same way as these, by setting + * the "orientation" property suitably. + */ + + enum { PROP_0, PROP_ORIENTATION @@ -64,9 +75,9 @@ static gboolean gtk_separator_expose (GtkWidget *widget, GdkEventExpose *event); -G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GtkSeparator, gtk_separator, GTK_TYPE_WIDGET, - G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE, - NULL)) +G_DEFINE_TYPE_WITH_CODE (GtkSeparator, gtk_separator, GTK_TYPE_WIDGET, + G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE, + NULL)) static void @@ -237,7 +248,6 @@ gtk_separator_expose (GtkWidget *widget, return FALSE; } -#if 0 /** * gtk_separator_new: * @orientation: the separator's orientation. @@ -246,7 +256,7 @@ gtk_separator_expose (GtkWidget *widget, * * Return value: a new #GtkSeparator. * - * Since: 2.16 + * Since: 3.0 **/ GtkWidget * gtk_separator_new (GtkOrientation orientation) @@ -255,7 +265,6 @@ gtk_separator_new (GtkOrientation orientation) "orientation", orientation, NULL); } -#endif #define __GTK_SEPARATOR_C__ diff --git a/gtk/gtkseparator.h b/gtk/gtkseparator.h index e0f6467358..6b3e519395 100644 --- a/gtk/gtkseparator.h +++ b/gtk/gtkseparator.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -60,6 +60,8 @@ struct _GtkSeparatorClass GType gtk_separator_get_type (void) G_GNUC_CONST; +GtkWidget * gtk_separator_new (GtkOrientation orientation); + G_END_DECLS diff --git a/gtk/gtkseparatormenuitem.c b/gtk/gtkseparatormenuitem.c index e59de238f5..d096b5f33c 100644 --- a/gtk/gtkseparatormenuitem.c +++ b/gtk/gtkseparatormenuitem.c @@ -28,6 +28,18 @@ #include "gtkseparatormenuitem.h" #include "gtkalias.h" + +/** + * SECTION:gtkseparatormenuitem + * @Short_description: A separator used in menus + * @Title: GtkSeparatorMenuItem + * + * The #GtkSeparatorMenuItem is a separator used to group + * items within a menu. It displays a horizontal line with a shadow to + * make it appear sunken into the interface. + */ + + G_DEFINE_TYPE (GtkSeparatorMenuItem, gtk_separator_menu_item, GTK_TYPE_MENU_ITEM) static void @@ -41,6 +53,13 @@ gtk_separator_menu_item_init (GtkSeparatorMenuItem *item) { } +/** + * gtk_separator_menu_item_new: + * + * Creates a new #GtkSeparatorMenuItem. + * + * Returns: a new #GtkSeparatorMenuItem. + */ GtkWidget * gtk_separator_menu_item_new (void) { diff --git a/gtk/gtkseparatormenuitem.h b/gtk/gtkseparatormenuitem.h index 8b9bb5920f..146174bd3d 100644 --- a/gtk/gtkseparatormenuitem.h +++ b/gtk/gtkseparatormenuitem.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkseparatortoolitem.c b/gtk/gtkseparatortoolitem.c index 4aa4b15697..2a35efe5f0 100644 --- a/gtk/gtkseparatortoolitem.c +++ b/gtk/gtkseparatortoolitem.c @@ -27,6 +27,26 @@ #include "gtkprivate.h" #include "gtkalias.h" + +/** + * SECTION:gtkseparatortoolitem + * @Short_description: A toolbar item that separates groups of other + * toolbar items + * @Title: GtkSeparatorToolItem + * @See_also: #GtkToolbar, #GtkRadioToolButton + * + * A #GtkSeparatorItem is a #GtkToolItem that separates groups of other + * #GtkToolItems. Depending on the theme, a #GtkSeparatorToolItem will + * often look like a vertical line on horizontally docked toolbars. + * + * If the #GtkToolbar child property "expand" is %TRUE and the property + * #GtkSeparatorToolItem:draw is %FALSE, a #GtkSeparatorToolItem will act as + * a "spring" that forces other items to the ends of the toolbar. + * + * Use gtk_separator_tool_item_new() to create a new #GtkSeparatorToolItem. + */ + + #define MENU_ID "gtk-separator-tool-item-menu-id" enum { diff --git a/gtk/gtkseparatortoolitem.h b/gtk/gtkseparatortoolitem.h index f015f65443..1547742c23 100644 --- a/gtk/gtkseparatortoolitem.h +++ b/gtk/gtkseparatortoolitem.h @@ -19,7 +19,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c index a7ca546a08..99dcb844ee 100644 --- a/gtk/gtksettings.c +++ b/gtk/gtksettings.c @@ -125,7 +125,8 @@ enum { PROP_ENABLE_TOOLTIPS, PROP_TOOLBAR_STYLE, PROP_TOOLBAR_ICON_SIZE, - PROP_AUTO_MNEMONICS + PROP_AUTO_MNEMONICS, + PROP_APPLICATION_PREFER_DARK_THEME }; @@ -1017,6 +1018,32 @@ gtk_settings_class_init (GtkSettingsClass *class) GTK_PARAM_READWRITE), NULL); g_assert (result == PROP_AUTO_MNEMONICS); + + /** + * GtkSettings:gtk-application-prefer-dark-theme: + * + * Whether the application prefers to use a dark theme. If a GTK+ theme + * includes a dark variant, it will be used instead of the configured + * theme. + * + * Some applications benefit from minimizing the amount of light pollution that + * interferes with the content. Good candidates for dark themes are photo and + * video editors that make the actual content get all the attention and minimize + * the distraction of the chrome. + * + * Dark themes should not be used for documents, where large spaces are white/light + * and the dark chrome creates too much contrast (web browser, text editor...). + * + * Since: 2.22 + */ + result = settings_install_property_parser (class, + g_param_spec_boolean ("gtk-application-prefer-dark-theme", + P_("Application prefers a dark theme"), + P_("Whether the application prefers to have a dark theme."), + FALSE, + GTK_PARAM_READWRITE), + NULL); + g_assert (result == PROP_APPLICATION_PREFER_DARK_THEME); } static void diff --git a/gtk/gtksettings.h b/gtk/gtksettings.h index 4be0772c63..36fb9a5db9 100644 --- a/gtk/gtksettings.h +++ b/gtk/gtksettings.h @@ -16,7 +16,7 @@ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtksignal.c b/gtk/gtksignal.c deleted file mode 100644 index c855582da5..0000000000 --- a/gtk/gtksignal.c +++ /dev/null @@ -1,394 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#undef GTK_DISABLE_DEPRECATED - -#include -#include "gtksignal.h" -#include "gtkalias.h" - -/* the real parameter limit is of course given by GSignal, bu we need - * an upper limit for the implementations. so this should be adjusted - * with any future changes on the GSignal side of things. - */ -#define SIGNAL_MAX_PARAMS 12 - - -/* --- functions --- */ -guint -gtk_signal_newv (const gchar *name, - GtkSignalRunType signal_flags, - GType object_type, - guint function_offset, - GSignalCMarshaller marshaller, - GType return_val, - guint n_params, - GType *params) -{ - GClosure *closure; - - g_return_val_if_fail (n_params < SIGNAL_MAX_PARAMS, 0); - - closure = function_offset ? g_signal_type_cclosure_new (object_type, function_offset) : NULL; - - return g_signal_newv (name, object_type, (GSignalFlags)signal_flags, closure, - NULL, NULL, marshaller, return_val, n_params, params); -} - -guint -gtk_signal_new (const gchar *name, - GtkSignalRunType signal_flags, - GType object_type, - guint function_offset, - GSignalCMarshaller marshaller, - GType return_val, - guint n_params, - ...) -{ - GType *params; - guint signal_id; - - if (n_params) - { - va_list args; - guint i; - - params = g_new (GType, n_params); - va_start (args, n_params); - for (i = 0; i < n_params; i++) - params[i] = va_arg (args, GType); - va_end (args); - } - else - params = NULL; - signal_id = gtk_signal_newv (name, - signal_flags, - object_type, - function_offset, - marshaller, - return_val, - n_params, - params); - g_free (params); - - return signal_id; -} - -void -gtk_signal_emit_stop_by_name (GtkObject *object, - const gchar *name) -{ - g_return_if_fail (GTK_IS_OBJECT (object)); - - g_signal_stop_emission (object, g_signal_lookup (name, G_OBJECT_TYPE (object)), 0); -} - -void -gtk_signal_connect_object_while_alive (GtkObject *object, - const gchar *name, - GCallback func, - GtkObject *alive_object) -{ - g_return_if_fail (GTK_IS_OBJECT (object)); - - g_signal_connect_closure_by_id (object, - g_signal_lookup (name, G_OBJECT_TYPE (object)), 0, - g_cclosure_new_object_swap (func, G_OBJECT (alive_object)), - FALSE); -} - -void -gtk_signal_connect_while_alive (GtkObject *object, - const gchar *name, - GCallback func, - gpointer func_data, - GtkObject *alive_object) -{ - GClosure *closure; - - g_return_if_fail (GTK_IS_OBJECT (object)); - - closure = g_cclosure_new (func, func_data, NULL); - g_object_watch_closure (G_OBJECT (alive_object), closure); - g_signal_connect_closure_by_id (object, - g_signal_lookup (name, G_OBJECT_TYPE (object)), 0, - closure, - FALSE); -} - -gulong -gtk_signal_connect_full (GtkObject *object, - const gchar *name, - GCallback func, - GtkCallbackMarshal unsupported, - gpointer data, - GDestroyNotify destroy_func, - gint object_signal, - gint after) -{ - g_return_val_if_fail (GTK_IS_OBJECT (object), 0); - g_return_val_if_fail (unsupported == NULL, 0); - - return g_signal_connect_closure_by_id (object, - g_signal_lookup (name, G_OBJECT_TYPE (object)), 0, - (object_signal - ? g_cclosure_new_swap - : g_cclosure_new) (func, - data, - (GClosureNotify) destroy_func), - after); -} - -void -gtk_signal_compat_matched (GtkObject *object, - GCallback func, - gpointer data, - GSignalMatchType match, - guint action) -{ - guint n_handlers; - - g_return_if_fail (GTK_IS_OBJECT (object)); - - switch (action) - { - case 0: n_handlers = g_signal_handlers_disconnect_matched (object, match, 0, 0, NULL, (gpointer) func, data); break; - case 1: n_handlers = g_signal_handlers_block_matched (object, match, 0, 0, NULL, (gpointer) func, data); break; - case 2: n_handlers = g_signal_handlers_unblock_matched (object, match, 0, 0, NULL, (gpointer) func, data); break; - default: n_handlers = 0; break; - } - - if (!n_handlers) - g_warning ("unable to find signal handler for object(%s:%p) with func(%p) and data(%p)", - G_OBJECT_TYPE_NAME (object), object, func, data); -} - -static inline gboolean -gtk_arg_to_value (GtkArg *arg, - GValue *value) -{ - switch (G_TYPE_FUNDAMENTAL (arg->type)) - { - case G_TYPE_CHAR: g_value_set_char (value, GTK_VALUE_CHAR (*arg)); break; - case G_TYPE_UCHAR: g_value_set_uchar (value, GTK_VALUE_UCHAR (*arg)); break; - case G_TYPE_BOOLEAN: g_value_set_boolean (value, GTK_VALUE_BOOL (*arg)); break; - case G_TYPE_INT: g_value_set_int (value, GTK_VALUE_INT (*arg)); break; - case G_TYPE_UINT: g_value_set_uint (value, GTK_VALUE_UINT (*arg)); break; - case G_TYPE_LONG: g_value_set_long (value, GTK_VALUE_LONG (*arg)); break; - case G_TYPE_ULONG: g_value_set_ulong (value, GTK_VALUE_ULONG (*arg)); break; - case G_TYPE_ENUM: g_value_set_enum (value, GTK_VALUE_ENUM (*arg)); break; - case G_TYPE_FLAGS: g_value_set_flags (value, GTK_VALUE_FLAGS (*arg)); break; - case G_TYPE_FLOAT: g_value_set_float (value, GTK_VALUE_FLOAT (*arg)); break; - case G_TYPE_DOUBLE: g_value_set_double (value, GTK_VALUE_DOUBLE (*arg)); break; - case G_TYPE_STRING: g_value_set_string (value, GTK_VALUE_STRING (*arg)); break; - case G_TYPE_BOXED: g_value_set_boxed (value, GTK_VALUE_BOXED (*arg)); break; - case G_TYPE_POINTER: g_value_set_pointer (value, GTK_VALUE_POINTER (*arg)); break; - case G_TYPE_OBJECT: g_value_set_object (value, GTK_VALUE_POINTER (*arg)); break; - default: - return FALSE; - } - return TRUE; -} - -static inline gboolean -gtk_arg_static_to_value (GtkArg *arg, - GValue *value) -{ - switch (G_TYPE_FUNDAMENTAL (arg->type)) - { - case G_TYPE_CHAR: g_value_set_char (value, GTK_VALUE_CHAR (*arg)); break; - case G_TYPE_UCHAR: g_value_set_uchar (value, GTK_VALUE_UCHAR (*arg)); break; - case G_TYPE_BOOLEAN: g_value_set_boolean (value, GTK_VALUE_BOOL (*arg)); break; - case G_TYPE_INT: g_value_set_int (value, GTK_VALUE_INT (*arg)); break; - case G_TYPE_UINT: g_value_set_uint (value, GTK_VALUE_UINT (*arg)); break; - case G_TYPE_LONG: g_value_set_long (value, GTK_VALUE_LONG (*arg)); break; - case G_TYPE_ULONG: g_value_set_ulong (value, GTK_VALUE_ULONG (*arg)); break; - case G_TYPE_ENUM: g_value_set_enum (value, GTK_VALUE_ENUM (*arg)); break; - case G_TYPE_FLAGS: g_value_set_flags (value, GTK_VALUE_FLAGS (*arg)); break; - case G_TYPE_FLOAT: g_value_set_float (value, GTK_VALUE_FLOAT (*arg)); break; - case G_TYPE_DOUBLE: g_value_set_double (value, GTK_VALUE_DOUBLE (*arg)); break; - case G_TYPE_STRING: g_value_set_static_string (value, GTK_VALUE_STRING (*arg)); break; - case G_TYPE_BOXED: g_value_set_static_boxed (value, GTK_VALUE_BOXED (*arg)); break; - case G_TYPE_POINTER: g_value_set_pointer (value, GTK_VALUE_POINTER (*arg)); break; - case G_TYPE_OBJECT: g_value_set_object (value, GTK_VALUE_POINTER (*arg)); break; - default: - return FALSE; - } - return TRUE; -} - -static inline gboolean -gtk_arg_set_from_value (GtkArg *arg, - GValue *value, - gboolean copy_string) -{ - switch (G_TYPE_FUNDAMENTAL (arg->type)) - { - case G_TYPE_CHAR: GTK_VALUE_CHAR (*arg) = g_value_get_char (value); break; - case G_TYPE_UCHAR: GTK_VALUE_UCHAR (*arg) = g_value_get_uchar (value); break; - case G_TYPE_BOOLEAN: GTK_VALUE_BOOL (*arg) = g_value_get_boolean (value); break; - case G_TYPE_INT: GTK_VALUE_INT (*arg) = g_value_get_int (value); break; - case G_TYPE_UINT: GTK_VALUE_UINT (*arg) = g_value_get_uint (value); break; - case G_TYPE_LONG: GTK_VALUE_LONG (*arg) = g_value_get_long (value); break; - case G_TYPE_ULONG: GTK_VALUE_ULONG (*arg) = g_value_get_ulong (value); break; - case G_TYPE_ENUM: GTK_VALUE_ENUM (*arg) = g_value_get_enum (value); break; - case G_TYPE_FLAGS: GTK_VALUE_FLAGS (*arg) = g_value_get_flags (value); break; - case G_TYPE_FLOAT: GTK_VALUE_FLOAT (*arg) = g_value_get_float (value); break; - case G_TYPE_DOUBLE: GTK_VALUE_DOUBLE (*arg) = g_value_get_double (value); break; - case G_TYPE_BOXED: GTK_VALUE_BOXED (*arg) = g_value_get_boxed (value); break; - case G_TYPE_POINTER: GTK_VALUE_POINTER (*arg) = g_value_get_pointer (value); break; - case G_TYPE_OBJECT: GTK_VALUE_POINTER (*arg) = g_value_get_object (value); break; - case G_TYPE_STRING: if (copy_string) - GTK_VALUE_STRING (*arg) = g_value_dup_string (value); - else - GTK_VALUE_STRING (*arg) = (char *) g_value_get_string (value); - break; - default: - return FALSE; - } - return TRUE; -} - -static inline gboolean -gtk_argloc_set_from_value (GtkArg *arg, - GValue *value, - gboolean copy_string) -{ - switch (G_TYPE_FUNDAMENTAL (arg->type)) - { - case G_TYPE_CHAR: *GTK_RETLOC_CHAR (*arg) = g_value_get_char (value); break; - case G_TYPE_UCHAR: *GTK_RETLOC_UCHAR (*arg) = g_value_get_uchar (value); break; - case G_TYPE_BOOLEAN: *GTK_RETLOC_BOOL (*arg) = g_value_get_boolean (value); break; - case G_TYPE_INT: *GTK_RETLOC_INT (*arg) = g_value_get_int (value); break; - case G_TYPE_UINT: *GTK_RETLOC_UINT (*arg) = g_value_get_uint (value); break; - case G_TYPE_LONG: *GTK_RETLOC_LONG (*arg) = g_value_get_long (value); break; - case G_TYPE_ULONG: *GTK_RETLOC_ULONG (*arg) = g_value_get_ulong (value); break; - case G_TYPE_ENUM: *GTK_RETLOC_ENUM (*arg) = g_value_get_enum (value); break; - case G_TYPE_FLAGS: *GTK_RETLOC_FLAGS (*arg) = g_value_get_flags (value); break; - case G_TYPE_FLOAT: *GTK_RETLOC_FLOAT (*arg) = g_value_get_float (value); break; - case G_TYPE_DOUBLE: *GTK_RETLOC_DOUBLE (*arg) = g_value_get_double (value); break; - case G_TYPE_BOXED: *GTK_RETLOC_BOXED (*arg) = g_value_get_boxed (value); break; - case G_TYPE_POINTER: *GTK_RETLOC_POINTER (*arg) = g_value_get_pointer (value); break; - case G_TYPE_OBJECT: *GTK_RETLOC_POINTER (*arg) = g_value_get_object (value); break; - case G_TYPE_STRING: if (copy_string) - *GTK_RETLOC_STRING (*arg) = g_value_dup_string (value); - else - *GTK_RETLOC_STRING (*arg) = (char *) g_value_get_string (value); - break; - default: - return FALSE; - } - return TRUE; -} - -void -gtk_signal_emitv (GtkObject *object, - guint signal_id, - GtkArg *args) -{ - GSignalQuery query; - GValue params[SIGNAL_MAX_PARAMS + 1] = { { 0, }, }; - GValue rvalue = { 0, }; - guint i; - - g_return_if_fail (GTK_IS_OBJECT (object)); - - g_signal_query (signal_id, &query); - g_return_if_fail (query.signal_id != 0); - g_return_if_fail (g_type_is_a (GTK_OBJECT_TYPE (object), query.itype)); - g_return_if_fail (query.n_params < SIGNAL_MAX_PARAMS); - if (query.n_params > 0) - g_return_if_fail (args != NULL); - - g_value_init (params + 0, GTK_OBJECT_TYPE (object)); - g_value_set_object (params + 0, G_OBJECT (object)); - for (i = 0; i < query.n_params; i++) - { - GValue *value = params + 1 + i; - GtkArg *arg = args + i; - - g_value_init (value, arg->type & ~G_SIGNAL_TYPE_STATIC_SCOPE); - if (!gtk_arg_static_to_value (arg, value)) - { - g_warning ("%s: failed to convert arg type `%s' to value type `%s'", - G_STRLOC, g_type_name (arg->type & ~G_SIGNAL_TYPE_STATIC_SCOPE), - g_type_name (G_VALUE_TYPE (value))); - return; - } - } - if (query.return_type != G_TYPE_NONE) - g_value_init (&rvalue, query.return_type); - - g_signal_emitv (params, signal_id, 0, &rvalue); - - if (query.return_type != G_TYPE_NONE) - { - gtk_argloc_set_from_value (args + query.n_params, &rvalue, TRUE); - g_value_unset (&rvalue); - } - for (i = 0; i < query.n_params; i++) - g_value_unset (params + 1 + i); - g_value_unset (params + 0); -} - -void -gtk_signal_emit (GtkObject *object, - guint signal_id, - ...) -{ - va_list var_args; - - g_return_if_fail (GTK_IS_OBJECT (object)); - - va_start (var_args, signal_id); - g_signal_emit_valist (G_OBJECT (object), signal_id, 0, var_args); - va_end (var_args); -} - -void -gtk_signal_emit_by_name (GtkObject *object, - const gchar *name, - ...) -{ - GSignalQuery query; - va_list var_args; - - g_return_if_fail (GTK_IS_OBJECT (object)); - g_return_if_fail (name != NULL); - - g_signal_query (g_signal_lookup (name, GTK_OBJECT_TYPE (object)), &query); - g_return_if_fail (query.signal_id != 0); - - va_start (var_args, name); - g_signal_emit_valist (G_OBJECT (object), query.signal_id, 0, var_args); - va_end (var_args); -} - -void -gtk_signal_emitv_by_name (GtkObject *object, - const gchar *name, - GtkArg *args) -{ - g_return_if_fail (GTK_IS_OBJECT (object)); - - gtk_signal_emitv (object, g_signal_lookup (name, GTK_OBJECT_TYPE (object)), args); -} - -#define __GTK_SIGNAL_C__ -#include "gtkaliasdef.c" diff --git a/gtk/gtksignal.h b/gtk/gtksignal.h deleted file mode 100644 index dbb5c430b6..0000000000 --- a/gtk/gtksignal.h +++ /dev/null @@ -1,149 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#ifndef GTK_DISABLE_DEPRECATED - -#ifndef __GTK_SIGNAL_H__ -#define __GTK_SIGNAL_H__ - -#include -#include - -G_BEGIN_DECLS - -#define gtk_signal_default_marshaller g_cclosure_marshal_VOID__VOID - - -/* --- compat defines --- */ -#define GTK_SIGNAL_OFFSET G_STRUCT_OFFSET -#define gtk_signal_lookup(name,object_type) \ - g_signal_lookup ((name), (object_type)) -#define gtk_signal_name(signal_id) \ - g_signal_name (signal_id) -#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), NULL, (func_data), NULL, 0, 0) -#define gtk_signal_connect_after(object,name,func,func_data) \ - 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), NULL, (slot_object), NULL, 1, 0) -#define gtk_signal_connect_object_after(object,name,func,slot_object) \ - 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) \ - g_signal_handler_block ((object), (handler_id)) -#define gtk_signal_handler_unblock(object,handler_id) \ - g_signal_handler_unblock ((object), (handler_id)) -#define gtk_signal_disconnect_by_func(object,func,data) \ - gtk_signal_compat_matched ((object), (func), (data), \ - (GSignalMatchType)(G_SIGNAL_MATCH_FUNC | \ - G_SIGNAL_MATCH_DATA), 0) -#define gtk_signal_disconnect_by_data(object,data) \ - gtk_signal_compat_matched ((object), 0, (data), G_SIGNAL_MATCH_DATA, 0) -#define gtk_signal_handler_block_by_func(object,func,data) \ - gtk_signal_compat_matched ((object), (func), (data), \ - (GSignalMatchType)(G_SIGNAL_MATCH_FUNC | \ - G_SIGNAL_MATCH_DATA), 1) -#define gtk_signal_handler_block_by_data(object,data) \ - gtk_signal_compat_matched ((object), 0, (data), G_SIGNAL_MATCH_DATA, 1) -#define gtk_signal_handler_unblock_by_func(object,func,data) \ - gtk_signal_compat_matched ((object), (func), (data), \ - (GSignalMatchType)(G_SIGNAL_MATCH_FUNC | \ - G_SIGNAL_MATCH_DATA), 2) -#define gtk_signal_handler_unblock_by_data(object,data) \ - gtk_signal_compat_matched ((object), 0, (data), G_SIGNAL_MATCH_DATA, 2) -#define gtk_signal_handler_pending(object,signal_id,may_be_blocked) \ - g_signal_has_handler_pending ((object), (signal_id), 0, (may_be_blocked)) -#define gtk_signal_handler_pending_by_func(object,signal_id,may_be_blocked,func,data) \ - (g_signal_handler_find ((object), \ - (GSignalMatchType)(G_SIGNAL_MATCH_ID | \ - G_SIGNAL_MATCH_FUNC | \ - G_SIGNAL_MATCH_DATA | \ - ((may_be_blocked) ? 0 : G_SIGNAL_MATCH_UNBLOCKED)),\ - (signal_id), 0, 0, (func), (data)) != 0) - - -/* --- compat functions --- */ -guint gtk_signal_newv (const gchar *name, - GtkSignalRunType signal_flags, - GType object_type, - guint function_offset, - GSignalCMarshaller marshaller, - GType return_val, - guint n_args, - GType *args); -guint gtk_signal_new (const gchar *name, - GtkSignalRunType signal_flags, - GType object_type, - guint function_offset, - GSignalCMarshaller marshaller, - GType return_val, - guint n_args, - ...); -void gtk_signal_emit_stop_by_name (GtkObject *object, - const gchar *name); -void gtk_signal_connect_object_while_alive (GtkObject *object, - const gchar *name, - GCallback func, - GtkObject *alive_object); -void gtk_signal_connect_while_alive (GtkObject *object, - const gchar *name, - GCallback func, - gpointer func_data, - GtkObject *alive_object); -gulong gtk_signal_connect_full (GtkObject *object, - const gchar *name, - GCallback func, - GtkCallbackMarshal unsupported, - gpointer data, - GDestroyNotify destroy_func, - gint object_signal, - gint after); -void gtk_signal_emitv (GtkObject *object, - guint signal_id, - GtkArg *args); -void gtk_signal_emit (GtkObject *object, - guint signal_id, - ...); -void gtk_signal_emit_by_name (GtkObject *object, - const gchar *name, - ...); -void gtk_signal_emitv_by_name (GtkObject *object, - const gchar *name, - GtkArg *args); -void gtk_signal_compat_matched (GtkObject *object, - GCallback func, - gpointer data, - GSignalMatchType match, - guint action); - -G_END_DECLS - -#endif /* __GTK_SIGNAL_H__ */ - -#endif /* GTK_DISABLE_DEPRECATED */ diff --git a/gtk/gtksizegroup.c b/gtk/gtksizegroup.c index a6bd13b328..2075912948 100644 --- a/gtk/gtksizegroup.c +++ b/gtk/gtksizegroup.c @@ -25,6 +25,7 @@ #include "gtkprivate.h" #include "gtksizegroup.h" #include "gtkbuildable.h" +#include "gtkextendedlayout.h" #include "gtkalias.h" enum { @@ -71,6 +72,9 @@ static const gchar size_groups_tag[] = "gtk-size-groups"; static GQuark visited_quark; static const gchar visited_tag[] = "gtk-size-group-visited"; +static GQuark bumping_quark; +static const gchar bumping_tag[] = "gtk-size-group-bumping"; + static GSList * get_size_groups (GtkWidget *widget) { @@ -102,6 +106,18 @@ is_visited (gpointer object) return g_object_get_qdata (object, visited_quark) != NULL; } +static void +mark_bumping (gpointer object, gboolean bumping) +{ + g_object_set_qdata (object, bumping_quark, bumping ? "bumping" : NULL); +} + +static gboolean +is_bumping (gpointer object) +{ + return g_object_get_qdata (object, bumping_quark) != NULL; +} + static void add_group_to_closure (GtkSizeGroup *group, GtkSizeGroupMode mode, @@ -154,6 +170,8 @@ real_queue_resize (GtkWidget *widget) { GTK_PRIVATE_SET_FLAG (widget, GTK_ALLOC_NEEDED); GTK_PRIVATE_SET_FLAG (widget, GTK_REQUEST_NEEDED); + GTK_PRIVATE_SET_FLAG (widget, GTK_WIDTH_REQUEST_NEEDED); + GTK_PRIVATE_SET_FLAG (widget, GTK_HEIGHT_REQUEST_NEEDED); if (widget->parent) _gtk_container_queue_resize (GTK_CONTAINER (widget->parent)); @@ -284,6 +302,7 @@ initialize_size_group_quarks (void) { size_groups_quark = g_quark_from_static_string (size_groups_tag); visited_quark = g_quark_from_static_string (visited_tag); + bumping_quark = g_quark_from_static_string (bumping_tag); } } @@ -549,7 +568,7 @@ gtk_size_group_add_widget (GtkSizeGroup *size_group, /** * gtk_size_group_remove_widget: - * @size_group: a #GtkSizeGrup + * @size_group: a #GtkSizeGroup * @widget: the #GtkWidget to remove * * Removes a widget from a #GtkSizeGroup. @@ -581,7 +600,7 @@ gtk_size_group_remove_widget (GtkSizeGroup *size_group, /** * gtk_size_group_get_widgets: - * @size_group: a #GtkSizeGrup + * @size_group: a #GtkSizeGroup * * Returns the list of widgets associated with @size_group. * @@ -607,42 +626,35 @@ get_base_dimension (GtkWidget *widget, if (aux_info && aux_info->width > 0) return aux_info->width; else - return widget->requisition.width; + { + /* XXX Possibly we should be using natural values and not minimums here. */ + gint width; + + gtk_extended_layout_get_desired_width (GTK_EXTENDED_LAYOUT (widget), &width, NULL); + + return width; + } } else { if (aux_info && aux_info->height > 0) return aux_info->height; else - return widget->requisition.height; + { + /* XXX Possibly we should be using natural values and not minimums here. */ + gint height; + + gtk_extended_layout_get_desired_height (GTK_EXTENDED_LAYOUT (widget), &height, NULL); + + return height; + } } } -static void -do_size_request (GtkWidget *widget) -{ - if (GTK_WIDGET_REQUEST_NEEDED (widget)) - { - gtk_widget_ensure_style (widget); - GTK_PRIVATE_UNSET_FLAG (widget, GTK_REQUEST_NEEDED); - g_signal_emit_by_name (widget, - "size-request", - &widget->requisition); - } -} - -static gint -compute_base_dimension (GtkWidget *widget, - GtkSizeGroupMode mode) -{ - do_size_request (widget); - - return get_base_dimension (widget, mode); -} - static gint compute_dimension (GtkWidget *widget, - GtkSizeGroupMode mode) + GtkSizeGroupMode mode, + gint widget_requisition) { GSList *widgets = NULL; GSList *groups = NULL; @@ -658,7 +670,7 @@ compute_dimension (GtkWidget *widget, if (!groups) { - result = compute_base_dimension (widget, mode); + result = widget_requisition; } else { @@ -674,8 +686,12 @@ compute_dimension (GtkWidget *widget, while (tmp_list) { GtkWidget *tmp_widget = tmp_list->data; + gint dimension; - gint dimension = compute_base_dimension (tmp_widget, mode); + if (tmp_widget == widget) + dimension = widget_requisition; + else + dimension = get_base_dimension (tmp_widget, mode); if (gtk_widget_get_mapped (tmp_widget) || !group->ignore_hidden) { @@ -715,122 +731,58 @@ compute_dimension (GtkWidget *widget, return result; } -static gint -get_dimension (GtkWidget *widget, - GtkSizeGroupMode mode) +/** + * _gtk_size_group_bump_requisition: + * @widget: a #GtkWidget + * @mode: either %GTK_SIZE_GROUP_HORIZONTAL or %GTK_SIZE_GROUP_VERTICAL, depending + * on the dimension in which to bump the size. + * + * Refreshes the sizegroup while returning the groups requested + * value in the dimension @mode. + * + * This function is used to update sizegroup minimum size information + * in multiple passes from the new #GtkExtendedLayout manager. + */ +gint +_gtk_size_group_bump_requisition (GtkWidget *widget, + GtkSizeGroupMode mode, + gint widget_requisition) { - GSList *widgets = NULL; - GSList *groups = NULL; - gint result = 0; + gint result = widget_requisition; - add_widget_to_closure (widget, mode, &groups, &widgets); - - g_slist_foreach (widgets, (GFunc)mark_unvisited, NULL); - g_slist_foreach (groups, (GFunc)mark_unvisited, NULL); - - if (!groups) + if (!is_bumping (widget)) { - result = get_base_dimension (widget, mode); + GtkWidgetAuxInfo *aux_info = + _gtk_widget_get_aux_info (widget, FALSE); + + /* Avoid recursion here */ + mark_bumping (widget, TRUE); + + if (get_size_groups (widget)) + { + if (aux_info) + { + if (mode == GTK_SIZE_GROUP_HORIZONTAL) + result = compute_dimension (widget, mode, MAX (aux_info->width, widget_requisition)); + else + result = compute_dimension (widget, mode, MAX (aux_info->height, widget_requisition)); + } + else + result = compute_dimension (widget, mode, widget_requisition); + } + else if (aux_info) + { + if (mode == GTK_SIZE_GROUP_HORIZONTAL) + result = MAX (aux_info->width, widget_requisition); + else + result = MAX (aux_info->height, widget_requisition); + } + mark_bumping (widget, FALSE); } - else - { - GtkSizeGroup *group = groups->data; - - if (mode == GTK_SIZE_GROUP_HORIZONTAL && group->have_width) - result = group->requisition.width; - else if (mode == GTK_SIZE_GROUP_VERTICAL && group->have_height) - result = group->requisition.height; - } - - g_slist_free (widgets); - g_slist_free (groups); - return result; } -static void -get_fast_child_requisition (GtkWidget *widget, - GtkRequisition *requisition) -{ - GtkWidgetAuxInfo *aux_info = _gtk_widget_get_aux_info (widget, FALSE); - - *requisition = widget->requisition; - - if (aux_info) - { - if (aux_info->width > 0) - requisition->width = aux_info->width; - if (aux_info && aux_info->height > 0) - requisition->height = aux_info->height; - } -} -/** - * _gtk_size_group_get_child_requisition: - * @widget: a #GtkWidget - * @requisition: location to store computed requisition. - * - * Retrieve the "child requisition" of the widget, taking account grouping - * of the widget's requisition with other widgets. - **/ -void -_gtk_size_group_get_child_requisition (GtkWidget *widget, - GtkRequisition *requisition) -{ - initialize_size_group_quarks (); - - if (requisition) - { - if (get_size_groups (widget)) - { - requisition->width = get_dimension (widget, GTK_SIZE_GROUP_HORIZONTAL); - requisition->height = get_dimension (widget, GTK_SIZE_GROUP_VERTICAL); - - /* Only do the full computation if we actually have size groups */ - } - else - get_fast_child_requisition (widget, requisition); - } -} - -/** - * _gtk_size_group_compute_requisition: - * @widget: a #GtkWidget - * @requisition: location to store computed requisition. - * - * Compute the requisition of a widget taking into account grouping of - * the widget's requisition with other widgets. - **/ -void -_gtk_size_group_compute_requisition (GtkWidget *widget, - GtkRequisition *requisition) -{ - gint width; - gint height; - - initialize_size_group_quarks (); - - if (get_size_groups (widget)) - { - /* Only do the full computation if we actually have size groups */ - - width = compute_dimension (widget, GTK_SIZE_GROUP_HORIZONTAL); - height = compute_dimension (widget, GTK_SIZE_GROUP_VERTICAL); - - if (requisition) - { - requisition->width = width; - requisition->height = height; - } - } - else - { - do_size_request (widget); - - if (requisition) - get_fast_child_requisition (widget, requisition); - } -} /** * _gtk_size_group_queue_resize: diff --git a/gtk/gtksizegroup.h b/gtk/gtksizegroup.h index ecd2ceacf6..a41f8958ae 100644 --- a/gtk/gtksizegroup.h +++ b/gtk/gtksizegroup.h @@ -18,7 +18,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -100,11 +100,12 @@ void gtk_size_group_remove_widget (GtkSizeGroup *size_group, GSList * gtk_size_group_get_widgets (GtkSizeGroup *size_group); -void _gtk_size_group_get_child_requisition (GtkWidget *widget, - GtkRequisition *requisition); -void _gtk_size_group_compute_requisition (GtkWidget *widget, - GtkRequisition *requisition); -void _gtk_size_group_queue_resize (GtkWidget *widget); + +gint _gtk_size_group_bump_requisition (GtkWidget *widget, + GtkSizeGroupMode mode, + gint widget_requisition); +void _gtk_size_group_queue_resize (GtkWidget *widget); + G_END_DECLS diff --git a/gtk/gtksocket.c b/gtk/gtksocket.c index 847ee9ff01..5e6a1fb8ec 100644 --- a/gtk/gtksocket.c +++ b/gtk/gtksocket.c @@ -41,6 +41,77 @@ #include "gtkalias.h" +/** + * SECTION:gtksocket + * @Short_description: Container for widgets from other processes + * @Title: GtkSocket + * @See_also: #GtkPlug, XEmbed + * + * Together with #GtkPlug, #GtkSocket provides the ability + * to embed widgets from one process into another process + * in a fashion that is transparent to the user. One + * process creates a #GtkSocket widget and passes + * that widget's window ID to the other process, + * which then creates a #GtkPlug with that window ID. + * Any widgets contained in the #GtkPlug then will appear + * inside the first application's window. + * + * The socket's window ID is obtained by using + * gtk_socket_get_id(). Before using this function, + * the socket must have been realized, and for hence, + * have been added to its parent. + * + * + * Obtaining the window ID of a socket. + * + * GtkWidget *socket = gtk_socket_new (); + * gtk_widget_show (socket); + * gtk_container_add (GTK_CONTAINER (parent), socket); + * + * /* The following call is only necessary if one of + * * the ancestors of the socket is not yet visible. + * */ + * gtk_widget_realize (socket); + * g_print ("The ID of the sockets window is %#x\n", + * gtk_socket_get_id (socket)); + * + * + * + * Note that if you pass the window ID of the socket to another + * process that will create a plug in the socket, you + * must make sure that the socket widget is not destroyed + * until that plug is created. Violating this rule will + * cause unpredictable consequences, the most likely + * consequence being that the plug will appear as a + * separate toplevel window. You can check if the plug + * has been created by using gtk_socket_get_plug_window(). If + * it returns a non-%NULL value, then the plug has been + * successfully created inside of the socket. + * + * When GTK+ is notified that the embedded window has been + * destroyed, then it will destroy the socket as well. You + * should always, therefore, be prepared for your sockets + * to be destroyed at any time when the main event loop + * is running. To prevent this from happening, you can + * connect to the #GtkSocket::plug-removed signal. + * + * The communication between a #GtkSocket and a #GtkPlug follows the + * XEmbed + * protocol. This protocol has also been implemented in other toolkits, e.g. + * Qt, allowing the same level of integration + * when embedding a Qt widget in GTK or vice versa. + * + * A socket can also be used to swallow arbitrary + * pre-existing top-level windows using gtk_socket_steal(), + * though the integration when this is done will not be as close + * as between a #GtkPlug and a #GtkSocket. + * + * + * The #GtkPlug and #GtkSocket widgets are currently not available + * on all platforms supported by GTK+. + * + */ + /* Forward declararations */ static void gtk_socket_finalize (GObject *object); @@ -218,32 +289,6 @@ gtk_socket_new (void) return GTK_WIDGET (socket); } -/** - * gtk_socket_steal: - * @socket_: a #GtkSocket - * @wid: the window ID of an existing toplevel window. - * - * Reparents a pre-existing toplevel window into a #GtkSocket. This is - * meant to embed clients that do not know about embedding into a - * #GtkSocket, however doing so is inherently unreliable, and using - * this function is not recommended. - * - * The #GtkSocket must have already be added into a toplevel window - * before you can make this call. - **/ -void -gtk_socket_steal (GtkSocket *socket, - GdkNativeWindow wid) -{ - g_return_if_fail (GTK_IS_SOCKET (socket)); - g_return_if_fail (GTK_WIDGET_ANCHORED (socket)); - - if (!gtk_widget_get_realized (GTK_WIDGET (socket))) - gtk_widget_realize (GTK_WIDGET (socket)); - - _gtk_socket_add_window (socket, wid, TRUE); -} - /** * gtk_socket_add_id: * @socket_: a #GtkSocket @@ -513,7 +558,7 @@ activate_key (GtkAccelGroup *accel_group, if (gdk_event && gdk_event->type == GDK_KEY_PRESS && socket->plug_window) { - _gtk_socket_windowing_send_key_event (socket, gdk_event, TRUE); + _gtk_socket_windowing_send_key_event (socket, gdk_event, FALSE); retval = TRUE; } diff --git a/gtk/gtksocket.h b/gtk/gtksocket.h index db347c06f0..e3cd3a36ce 100644 --- a/gtk/gtksocket.h +++ b/gtk/gtksocket.h @@ -23,7 +23,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -92,11 +92,6 @@ void gtk_socket_add_id (GtkSocket *socket_, GdkNativeWindow gtk_socket_get_id (GtkSocket *socket_); GdkWindow* gtk_socket_get_plug_window (GtkSocket *socket_); -#ifndef GTK_DISABLE_DEPRECATED -void gtk_socket_steal (GtkSocket *socket_, - GdkNativeWindow wid); -#endif /* GTK_DISABLE_DEPRECATED */ - G_END_DECLS #endif /* __GTK_SOCKET_H__ */ diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c index cebdd551b4..71d7934bf0 100644 --- a/gtk/gtkspinbutton.c +++ b/gtk/gtkspinbutton.c @@ -903,10 +903,12 @@ gtk_spin_button_enter_notify (GtkWidget *widget, if (event->window == spin->panel) { + GdkDevice *device; gint x; gint y; - gdk_window_get_pointer (spin->panel, &x, &y, NULL); + device = gdk_event_get_device ((GdkEvent *) event); + gdk_window_get_device_position (spin->panel, device, &x, &y, NULL); if (y <= widget->requisition.height / 2) spin->in_child = GTK_ARROW_UP; @@ -915,7 +917,7 @@ gtk_spin_button_enter_notify (GtkWidget *widget, gtk_widget_queue_draw (GTK_WIDGET (spin)); } - + if (GTK_WIDGET_CLASS (gtk_spin_button_parent_class)->enter_notify_event) return GTK_WIDGET_CLASS (gtk_spin_button_parent_class)->enter_notify_event (widget, event); @@ -1702,13 +1704,6 @@ gtk_spin_button_new_with_range (gdouble min, return GTK_WIDGET (spin); } -static void -warn_nonzero_page_size (GtkAdjustment *adjustment) -{ - if (gtk_adjustment_get_page_size (adjustment) != 0.0) - g_warning ("GtkSpinButton: setting an adjustment with non-zero page size is deprecated"); -} - /* Callback used when the spin button's adjustment changes. We need to redraw * the arrows when the adjustment's range changes, and reevaluate our size request. */ @@ -1720,7 +1715,6 @@ adjustment_changed_cb (GtkAdjustment *adjustment, gpointer data) spin_button = GTK_SPIN_BUTTON (data); spin_button->timer_step = spin_button->adjustment->step_increment; - warn_nonzero_page_size (adjustment); gtk_widget_queue_resize (GTK_WIDGET (spin_button)); } @@ -1760,7 +1754,6 @@ gtk_spin_button_set_adjustment (GtkSpinButton *spin_button, G_CALLBACK (adjustment_changed_cb), spin_button); spin_button->timer_step = spin_button->adjustment->step_increment; - warn_nonzero_page_size (adjustment); } gtk_widget_queue_resize (GTK_WIDGET (spin_button)); diff --git a/gtk/gtkspinbutton.h b/gtk/gtkspinbutton.h index 6767953792..4f43a4a2a1 100644 --- a/gtk/gtkspinbutton.h +++ b/gtk/gtkspinbutton.h @@ -27,7 +27,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -186,11 +186,6 @@ void gtk_spin_button_set_snap_to_ticks (GtkSpinButton *spin_button, gboolean gtk_spin_button_get_snap_to_ticks (GtkSpinButton *spin_button); void gtk_spin_button_update (GtkSpinButton *spin_button); - -#ifndef GTK_DISABLE_DEPRECATED -#define gtk_spin_button_get_value_as_float gtk_spin_button_get_value -#endif - G_END_DECLS #endif /* __GTK_SPIN_BUTTON_H__ */ diff --git a/gtk/gtkstatusbar.c b/gtk/gtkstatusbar.c index ff7bc0fa0d..81d28d02c8 100644 --- a/gtk/gtkstatusbar.c +++ b/gtk/gtkstatusbar.c @@ -462,6 +462,72 @@ gtk_statusbar_remove (GtkStatusbar *statusbar, } } +/** + * gtk_statusbar_remove_all: + * @statusbar: a #GtkStatusBar + * @context_id: a context identifier + * + * Forces the removal of all messages from a statusbar's + * stack with the exact @context_id. + * + * Since: 2.22 + */ +void +gtk_statusbar_remove_all (GtkStatusbar *statusbar, + guint context_id) +{ + GtkStatusbarMsg *msg; + GSList *prev, *list; + + g_return_if_fail (GTK_IS_STATUSBAR (statusbar)); + + if (statusbar->messages == NULL) + return; + + msg = statusbar->messages->data; + + /* care about signal emission if the topmost item is removed */ + if (msg->context_id == context_id) + { + gtk_statusbar_pop (statusbar, context_id); + + prev = NULL; + list = statusbar->messages; + } + else + { + prev = statusbar->messages; + list = prev->next; + } + + while (list != NULL) + { + msg = list->data; + + if (msg->context_id == context_id) + { + if (prev == NULL) + statusbar->messages = list->next; + else + prev->next = list->next; + + g_free (msg->text); + g_slice_free (GtkStatusbarMsg, msg); + g_slist_free_1 (list); + + if (prev == NULL) + prev = statusbar->messages; + + list = prev->next; + } + else + { + prev = list; + list = prev->next; + } + } +} + /** * gtk_statusbar_set_has_resize_grip: * @statusbar: a #GtkStatusBar diff --git a/gtk/gtkstatusbar.h b/gtk/gtkstatusbar.h index ff0597655c..875d80d65b 100644 --- a/gtk/gtkstatusbar.h +++ b/gtk/gtkstatusbar.h @@ -25,7 +25,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -102,6 +102,9 @@ void gtk_statusbar_pop (GtkStatusbar *statusbar, void gtk_statusbar_remove (GtkStatusbar *statusbar, guint context_id, guint message_id); +void gtk_statusbar_remove_all (GtkStatusbar *statusbar, + guint context_id); + void gtk_statusbar_set_has_resize_grip (GtkStatusbar *statusbar, gboolean setting); diff --git a/gtk/gtkstatusicon.c b/gtk/gtkstatusicon.c index dab6ff65e5..8e4ebe633c 100644 --- a/gtk/gtkstatusicon.c +++ b/gtk/gtkstatusicon.c @@ -170,6 +170,11 @@ static void gtk_status_icon_screen_changed (GtkStatusIcon *status_icon, GdkScreen *old_screen); static void gtk_status_icon_embedded_changed (GtkStatusIcon *status_icon); static void gtk_status_icon_orientation_changed (GtkStatusIcon *status_icon); +static void gtk_status_icon_padding_changed (GtkStatusIcon *status_icon); +static void gtk_status_icon_fg_changed (GtkStatusIcon *status_icon); +static void gtk_status_icon_color_changed (GtkTrayIcon *tray, + GParamSpec *pspec, + GtkStatusIcon *status_icon); static gboolean gtk_status_icon_scroll (GtkStatusIcon *status_icon, GdkEventScroll *event); static gboolean gtk_status_icon_query_tooltip (GtkStatusIcon *status_icon, @@ -827,7 +832,7 @@ gtk_status_icon_init (GtkStatusIcon *status_icon) priv = G_TYPE_INSTANCE_GET_PRIVATE (status_icon, GTK_TYPE_STATUS_ICON, GtkStatusIconPrivate); status_icon->priv = priv; - + priv->storage_type = GTK_IMAGE_EMPTY; priv->visible = TRUE; @@ -850,6 +855,16 @@ gtk_status_icon_init (GtkStatusIcon *status_icon) G_CALLBACK (gtk_status_icon_embedded_changed), status_icon); g_signal_connect_swapped (priv->tray_icon, "notify::orientation", G_CALLBACK (gtk_status_icon_orientation_changed), status_icon); + g_signal_connect_swapped (priv->tray_icon, "notify::padding", + G_CALLBACK (gtk_status_icon_padding_changed), status_icon); + g_signal_connect_swapped (priv->tray_icon, "notify::fg-color", + G_CALLBACK (gtk_status_icon_fg_changed), status_icon); + g_signal_connect (priv->tray_icon, "notify::error-color", + G_CALLBACK (gtk_status_icon_color_changed), status_icon); + g_signal_connect (priv->tray_icon, "notify::warning-color", + G_CALLBACK (gtk_status_icon_color_changed), status_icon); + g_signal_connect (priv->tray_icon, "notify::success-color", + G_CALLBACK (gtk_status_icon_color_changed), status_icon); g_signal_connect_swapped (priv->tray_icon, "button-press-event", G_CALLBACK (gtk_status_icon_button_press), status_icon); g_signal_connect_swapped (priv->tray_icon, "button-release-event", @@ -974,6 +989,12 @@ gtk_status_icon_finalize (GObject *object) gtk_status_icon_embedded_changed, status_icon); g_signal_handlers_disconnect_by_func (priv->tray_icon, gtk_status_icon_orientation_changed, status_icon); + g_signal_handlers_disconnect_by_func (priv->tray_icon, + gtk_status_icon_padding_changed, status_icon); + g_signal_handlers_disconnect_by_func (priv->tray_icon, + gtk_status_icon_fg_changed, status_icon); + g_signal_handlers_disconnect_by_func (priv->tray_icon, + gtk_status_icon_color_changed, status_icon); g_signal_handlers_disconnect_by_func (priv->tray_icon, gtk_status_icon_button_press, status_icon); g_signal_handlers_disconnect_by_func (priv->tray_icon, @@ -1678,18 +1699,78 @@ gtk_status_icon_screen_changed (GtkStatusIcon *status_icon, #ifdef GDK_WINDOWING_X11 +static void +gtk_status_icon_padding_changed (GtkStatusIcon *status_icon) +{ + GtkStatusIconPrivate *priv = status_icon->priv; + GtkOrientation orientation; + gint padding; + + orientation = _gtk_tray_icon_get_orientation (GTK_TRAY_ICON (priv->tray_icon)); + padding = _gtk_tray_icon_get_padding (GTK_TRAY_ICON (priv->tray_icon)); + + if (orientation == GTK_ORIENTATION_HORIZONTAL) + gtk_misc_set_padding (GTK_MISC (priv->image), padding, 0); + else + gtk_misc_set_padding (GTK_MISC (priv->image), 0, padding); +} + static void gtk_status_icon_embedded_changed (GtkStatusIcon *status_icon) { + gtk_status_icon_padding_changed (status_icon); g_object_notify (G_OBJECT (status_icon), "embedded"); } static void gtk_status_icon_orientation_changed (GtkStatusIcon *status_icon) { + gtk_status_icon_padding_changed (status_icon); g_object_notify (G_OBJECT (status_icon), "orientation"); } +static void +gtk_status_icon_fg_changed (GtkStatusIcon *status_icon) +{ + GtkStatusIconPrivate *priv = status_icon->priv; + GdkColor color; + + g_object_get (priv->tray_icon, "fg-color", &color, NULL); + gtk_widget_modify_fg (priv->image, GTK_STATE_NORMAL, &color); +} + +static void +gtk_status_icon_color_changed (GtkTrayIcon *tray, + GParamSpec *pspec, + GtkStatusIcon *status_icon) +{ + GtkStatusIconPrivate *priv = status_icon->priv; + const gchar *name; + GdkColor color; + + switch (pspec->name[0]) + { + case 'e': + name = "error"; + break; + case 'w': + name = "warning"; + break; + case 's': + name = "success"; + break; + default: + name = NULL; + break; + } + + if (name) + { + g_object_get (priv->tray_icon, pspec->name, &color, NULL); + gtk_widget_modify_symbolic_color (priv->image, name, &color); + } +} + static gboolean gtk_status_icon_key_press (GtkStatusIcon *status_icon, GdkEventKey *event) @@ -2209,24 +2290,6 @@ gtk_status_icon_get_screen (GtkStatusIcon *status_icon) #endif } -/** - * gtk_status_icon_set_tooltip: - * @status_icon: a #GtkStatusIcon - * @tooltip_text: (allow-none): the tooltip text, or %NULL - * - * Sets the tooltip of the status icon. - * - * Since: 2.10 - * - * Deprecated: 2.16: Use gtk_status_icon_set_tooltip_text() instead. - */ -void -gtk_status_icon_set_tooltip (GtkStatusIcon *status_icon, - const gchar *tooltip_text) -{ - gtk_status_icon_set_tooltip_text (status_icon, tooltip_text); -} - static gboolean gtk_status_icon_blinker (GtkStatusIcon *status_icon) { diff --git a/gtk/gtkstatusicon.h b/gtk/gtkstatusicon.h index 0c08cfe212..9142367b12 100644 --- a/gtk/gtkstatusicon.h +++ b/gtk/gtkstatusicon.h @@ -21,7 +21,7 @@ * Mark McLoughlin */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -110,10 +110,6 @@ void gtk_status_icon_set_screen (GtkStatusIcon *st GdkScreen *screen); GdkScreen *gtk_status_icon_get_screen (GtkStatusIcon *status_icon); -#ifndef GTK_DISABLE_DEPRECATED -void gtk_status_icon_set_tooltip (GtkStatusIcon *status_icon, - const gchar *tooltip_text); -#endif void gtk_status_icon_set_has_tooltip (GtkStatusIcon *status_icon, gboolean has_tooltip); void gtk_status_icon_set_tooltip_text (GtkStatusIcon *status_icon, diff --git a/gtk/gtkstock.h b/gtk/gtkstock.h index 84c22a4db9..0d3d2c02d7 100644 --- a/gtk/gtkstock.h +++ b/gtk/gtkstock.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkstyle.c b/gtk/gtkstyle.c index 03610b7146..1c50d4fd42 100644 --- a/gtk/gtkstyle.c +++ b/gtk/gtkstyle.c @@ -31,8 +31,6 @@ #include #include "gtkgc.h" #include "gtkmarshalers.h" -#undef GTK_DISABLE_DEPRECATED -#include "gtkoptionmenu.h" #include "gtkrc.h" #include "gtkspinbutton.h" #include "gtkstyle.h" @@ -42,6 +40,27 @@ #include "gtksettings.h" /* _gtk_settings_parse_convert() */ #include "gtkintl.h" #include "gtkalias.h" +#include "gtkspinner.h" + + +/** + * SECTION:gtkstyle + * @Short_description: An object that hold style information for widgets + * @Title: GtkStyle + * + * A #GtkStyle object encapsulates the information that provides the look and + * feel for a widget. Each #GtkWidget has an associated #GTkStyle object that + * is used when rendering that widget. Also, a #GtkStyle holds information for + * the five possible widget states though not every widget supports all five + * states; see #GtkStateType. + * + * Usually the #GtkStyle for a widget is the same as the default style that is + * set by GTK+ and modified the theme engine. + * + * Usually applications should not need to use or modify the #GtkStyle of their + * widgets. + */ + #define LIGHTNESS_MULT 1.3 #define DARKNESS_MULT 0.7 @@ -145,15 +164,6 @@ static void gtk_default_draw_diamond (GtkStyle *style, gint y, gint width, gint height); -static void gtk_default_draw_string (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - const gchar *string); static void gtk_default_draw_box (GtkStyle *style, GdkWindow *window, GtkStateType state_type, @@ -507,7 +517,6 @@ gtk_style_class_init (GtkStyleClass *klass) klass->draw_polygon = gtk_default_draw_polygon; klass->draw_arrow = gtk_default_draw_arrow; klass->draw_diamond = gtk_default_draw_diamond; - klass->draw_string = gtk_default_draw_string; klass->draw_box = gtk_default_draw_box; klass->draw_flat_box = gtk_default_draw_flat_box; klass->draw_check = gtk_default_draw_check; @@ -828,35 +837,6 @@ gtk_style_detach (GtkStyle *style) } } -/** - * gtk_style_ref: - * @style: a #GtkStyle. - * @returns: @style. - * - * Increase the reference count of @style. - * - * Deprecated: 2.0: use g_object_ref() instead. - */ -GtkStyle* -gtk_style_ref (GtkStyle *style) -{ - return (GtkStyle *) g_object_ref (style); -} - -/** - * gtk_style_unref: - * @style: a #GtkStyle. - * - * Decrease the reference count of @style. - * - * Deprecated: 2.0: use g_object_unref() instead. - */ -void -gtk_style_unref (GtkStyle *style) -{ - g_object_unref (style); -} - static void gtk_style_realize (GtkStyle *style, GdkColormap *colormap) @@ -948,675 +928,6 @@ gtk_style_lookup_color (GtkStyle *style, return FALSE; } -/** - * gtk_draw_hline: - * @style: a #GtkStyle - * @window: a #GdkWindow - * @state_type: a state - * @x1: the starting x coordinate - * @x2: the ending x coordinate - * @y: the y coordinate - * - * Draws a horizontal line from (@x1, @y) to (@x2, @y) in @window - * using the given style and state. - * - * Deprecated: 2.0: Use gtk_paint_hline() instead. - **/ -void -gtk_draw_hline (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - gint x1, - gint x2, - gint y) -{ - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_hline != NULL); - - GTK_STYLE_GET_CLASS (style)->draw_hline (style, window, state_type, NULL, NULL, NULL, x1, x2, y); -} - - -/** - * gtk_draw_vline: - * @style: a #GtkStyle - * @window: a #GdkWindow - * @state_type: a state - * @y1_: the starting y coordinate - * @y2_: the ending y coordinate - * @x: the x coordinate - * - * Draws a vertical line from (@x, @y1_) to (@x, @y2_) in @window - * using the given style and state. - * - * Deprecated: 2.0: Use gtk_paint_vline() instead. - **/ -void -gtk_draw_vline (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - gint y1_, - gint y2_, - gint x) -{ - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_vline != NULL); - - GTK_STYLE_GET_CLASS (style)->draw_vline (style, window, state_type, NULL, NULL, NULL, y1_, y2_, x); -} - -/** - * gtk_draw_shadow: - * @style: a #GtkStyle - * @window: a #GdkWindow - * @state_type: a state - * @shadow_type: type of shadow to draw - * @x: x origin of the rectangle - * @y: y origin of the rectangle - * @width: width of the rectangle - * @height: width of the rectangle - * - * Draws a shadow around the given rectangle in @window - * using the given style and state and shadow type. - * - * Deprecated: 2.0: Use gtk_paint_shadow() instead. - */ -void -gtk_draw_shadow (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - gint x, - gint y, - gint width, - gint height) -{ - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_shadow != NULL); - - GTK_STYLE_GET_CLASS (style)->draw_shadow (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height); -} - -/** - * gtk_draw_polygon: - * @style: a #GtkStyle - * @window: a #GdkWindow - * @state_type: a state - * @shadow_type: type of shadow to draw - * @points: an array of #GdkPoints - * @npoints: length of @points - * @fill: %TRUE if the polygon should be filled - * - * Draws a polygon on @window with the given parameters. - * - * Deprecated: 2.0: Use gtk_paint_polygon() instead. - */ -void -gtk_draw_polygon (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkPoint *points, - gint npoints, - gboolean fill) -{ - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_polygon != NULL); - - GTK_STYLE_GET_CLASS (style)->draw_polygon (style, window, state_type, shadow_type, NULL, NULL, NULL, points, npoints, fill); -} - -/** - * gtk_draw_arrow: - * @style: a #GtkStyle - * @window: a #GdkWindow - * @state_type: a state - * @shadow_type: the type of shadow to draw - * @arrow_type: the type of arrow to draw - * @fill: %TRUE if the arrow tip should be filled - * @x: x origin of the rectangle to draw the arrow in - * @y: y origin of the rectangle to draw the arrow in - * @width: width of the rectangle to draw the arrow in - * @height: height of the rectangle to draw the arrow in - * - * Draws an arrow in the given rectangle on @window using the given - * parameters. @arrow_type determines the direction of the arrow. - * - * Deprecated: 2.0: Use gtk_paint_arrow() instead. - */ -void -gtk_draw_arrow (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GtkArrowType arrow_type, - gboolean fill, - gint x, - gint y, - gint width, - gint height) -{ - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_arrow != NULL); - - GTK_STYLE_GET_CLASS (style)->draw_arrow (style, window, state_type, shadow_type, NULL, NULL, NULL, arrow_type, fill, x, y, width, height); -} - -/** - * gtk_draw_diamond: - * @style: a #GtkStyle - * @window: a #GdkWindow - * @state_type: a state - * @shadow_type: the type of shadow to draw - * @x: x origin of the rectangle to draw the diamond in - * @y: y origin of the rectangle to draw the diamond in - * @width: width of the rectangle to draw the diamond in - * @height: height of the rectangle to draw the diamond in - * - * Draws a diamond in the given rectangle on @window using the given - * parameters. - * - * Deprecated: 2.0: Use gtk_paint_diamond() instead. - */ -void -gtk_draw_diamond (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - gint x, - gint y, - gint width, - gint height) -{ - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_diamond != NULL); - - GTK_STYLE_GET_CLASS (style)->draw_diamond (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height); -} - -/** - * gtk_draw_string: - * @style: a #GtkStyle - * @window: a #GdkWindow - * @state_type: a state - * @x: x origin - * @y: y origin - * @string: the string to draw - * - * Draws a text string on @window with the given parameters. - * - * Deprecated: 2.0: Use gtk_paint_layout() instead. - */ -void -gtk_draw_string (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - gint x, - gint y, - const gchar *string) -{ - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_string != NULL); - - GTK_STYLE_GET_CLASS (style)->draw_string (style, window, state_type, NULL, NULL, NULL, x, y, string); -} - -/** - * gtk_draw_box: - * @style: a #GtkStyle - * @window: a #GdkWindow - * @state_type: a state - * @shadow_type: the type of shadow to draw - * @x: x origin of the box - * @y: y origin of the box - * @width: the width of the box - * @height: the height of the box - * - * Draws a box on @window with the given parameters. - * - * Deprecated: 2.0: Use gtk_paint_box() instead. - */ -void -gtk_draw_box (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - gint x, - gint y, - gint width, - gint height) -{ - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_box != NULL); - - GTK_STYLE_GET_CLASS (style)->draw_box (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height); -} - -/** - * gtk_draw_flat_box: - * @style: a #GtkStyle - * @window: a #GdkWindow - * @state_type: a state - * @shadow_type: the type of shadow to draw - * @x: x origin of the box - * @y: y origin of the box - * @width: the width of the box - * @height: the height of the box - * - * Draws a flat box on @window with the given parameters. - * - * Deprecated: 2.0: Use gtk_paint_flat_box() instead. - */ -void -gtk_draw_flat_box (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - gint x, - gint y, - gint width, - gint height) -{ - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_flat_box != NULL); - - GTK_STYLE_GET_CLASS (style)->draw_flat_box (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height); -} - -/** - * gtk_draw_check: - * @style: a #GtkStyle - * @window: a #GdkWindow - * @state_type: a state - * @shadow_type: the type of shadow to draw - * @x: x origin of the rectangle to draw the check in - * @y: y origin of the rectangle to draw the check in - * @width: the width of the rectangle to draw the check in - * @height: the height of the rectangle to draw the check in - * - * Draws a check button indicator in the given rectangle on @window with - * the given parameters. - * - * Deprecated: 2.0: Use gtk_paint_check() instead. - */ -void -gtk_draw_check (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - gint x, - gint y, - gint width, - gint height) -{ - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_check != NULL); - - GTK_STYLE_GET_CLASS (style)->draw_check (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height); -} - -/** - * gtk_draw_option: - * @style: a #GtkStyle - * @window: a #GdkWindow - * @state_type: a state - * @shadow_type: the type of shadow to draw - * @x: x origin of the rectangle to draw the option in - * @y: y origin of the rectangle to draw the option in - * @width: the width of the rectangle to draw the option in - * @height: the height of the rectangle to draw the option in - * - * Draws a radio button indicator in the given rectangle on @window with - * the given parameters. - * - * Deprecated: 2.0: Use gtk_paint_option() instead. - */ -void -gtk_draw_option (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - gint x, - gint y, - gint width, - gint height) -{ - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_option != NULL); - - GTK_STYLE_GET_CLASS (style)->draw_option (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height); -} - -/** - * gtk_draw_tab: - * @style: a #GtkStyle - * @window: a #GdkWindow - * @state_type: a state - * @shadow_type: the type of shadow to draw - * @x: x origin of the rectangle to draw the tab in - * @y: y origin of the rectangle to draw the tab in - * @width: the width of the rectangle to draw the tab in - * @height: the height of the rectangle to draw the tab in - * - * Draws an option menu tab (i.e. the up and down pointing arrows) - * in the given rectangle on @window using the given parameters. - * - * Deprecated: 2.0: Use gtk_paint_tab() instead. - */ -void -gtk_draw_tab (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - gint x, - gint y, - gint width, - gint height) -{ - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_tab != NULL); - - GTK_STYLE_GET_CLASS (style)->draw_tab (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height); -} - -/** - * gtk_draw_shadow_gap: - * @style: a #GtkStyle - * @window: a #GdkWindow - * @state_type: a state - * @shadow_type: type of shadow to draw - * @x: x origin of the rectangle - * @y: y origin of the rectangle - * @width: width of the rectangle - * @height: width of the rectangle - * @gap_side: side in which to leave the gap - * @gap_x: starting position of the gap - * @gap_width: width of the gap - * - * Draws a shadow around the given rectangle in @window - * using the given style and state and shadow type, leaving a - * gap in one side. - * - * Deprecated: 2.0: Use gtk_paint_shadow_gap() instead. -*/ -void -gtk_draw_shadow_gap (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - gint x, - gint y, - gint width, - gint height, - GtkPositionType gap_side, - gint gap_x, - gint gap_width) -{ - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_shadow_gap != NULL); - - GTK_STYLE_GET_CLASS (style)->draw_shadow_gap (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height, gap_side, gap_x, gap_width); -} - -/** - * gtk_draw_box_gap: - * @style: a #GtkStyle - * @window: a #GdkWindow - * @state_type: a state - * @shadow_type: type of shadow to draw - * @x: x origin of the rectangle - * @y: y origin of the rectangle - * @width: width of the rectangle - * @height: width of the rectangle - * @gap_side: side in which to leave the gap - * @gap_x: starting position of the gap - * @gap_width: width of the gap - * - * Draws a box in @window using the given style and state and shadow type, - * leaving a gap in one side. - * - * Deprecated: 2.0: Use gtk_paint_box_gap() instead. - */ -void -gtk_draw_box_gap (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - gint x, - gint y, - gint width, - gint height, - GtkPositionType gap_side, - gint gap_x, - gint gap_width) -{ - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_box_gap != NULL); - - GTK_STYLE_GET_CLASS (style)->draw_box_gap (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height, gap_side, gap_x, gap_width); -} - -/** - * gtk_draw_extension: - * @style: a #GtkStyle - * @window: a #GdkWindow - * @state_type: a state - * @shadow_type: type of shadow to draw - * @x: x origin of the extension - * @y: y origin of the extension - * @width: width of the extension - * @height: width of the extension - * @gap_side: the side on to which the extension is attached - * - * Draws an extension, i.e. a notebook tab. - * - * Deprecated: 2.0: Use gtk_paint_extension() instead. - **/ -void -gtk_draw_extension (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - gint x, - gint y, - gint width, - gint height, - GtkPositionType gap_side) -{ - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_extension != NULL); - - GTK_STYLE_GET_CLASS (style)->draw_extension (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height, gap_side); -} - -/** - * gtk_draw_focus: - * @style: a #GtkStyle - * @window: a #GdkWindow - * @x: the x origin of the rectangle around which to draw a focus indicator - * @y: the y origin of the rectangle around which to draw a focus indicator - * @width: the width of the rectangle around which to draw a focus indicator - * @height: the height of the rectangle around which to draw a focus indicator - * - * Draws a focus indicator around the given rectangle on @window using the - * given style. - * - * Deprecated: 2.0: Use gtk_paint_focus() instead. - */ -void -gtk_draw_focus (GtkStyle *style, - GdkWindow *window, - gint x, - gint y, - gint width, - gint height) -{ - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_focus != NULL); - - GTK_STYLE_GET_CLASS (style)->draw_focus (style, window, GTK_STATE_NORMAL, NULL, NULL, NULL, x, y, width, height); -} - -/** - * gtk_draw_slider: - * @style: a #GtkStyle - @window: a #GdkWindow - * @state_type: a state - * @shadow_type: a shadow - * @x: the x origin of the rectangle in which to draw a slider - * @y: the y origin of the rectangle in which to draw a slider - * @width: the width of the rectangle in which to draw a slider - * @height: the height of the rectangle in which to draw a slider - * @orientation: the orientation to be used - * - * Draws a slider in the given rectangle on @window using the - * given style and orientation. - */ -void -gtk_draw_slider (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - gint x, - gint y, - gint width, - gint height, - GtkOrientation orientation) -{ - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_slider != NULL); - - GTK_STYLE_GET_CLASS (style)->draw_slider (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height, orientation); -} - -/** - * gtk_draw_handle: - * @style: a #GtkStyle - * @window: a #GdkWindow - * @state_type: a state - * @shadow_type: type of shadow to draw - * @x: x origin of the handle - * @y: y origin of the handle - * @width: with of the handle - * @height: height of the handle - * @orientation: the orientation of the handle - * - * Draws a handle as used in #GtkHandleBox and #GtkPaned. - * - * Deprecated: 2.0: Use gtk_paint_handle() instead. - **/ -void -gtk_draw_handle (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - gint x, - gint y, - gint width, - gint height, - GtkOrientation orientation) -{ - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_handle != NULL); - - GTK_STYLE_GET_CLASS (style)->draw_handle (style, window, state_type, shadow_type, NULL, NULL, NULL, x, y, width, height, orientation); -} - -/** - * gtk_draw_expander: - * @style: a #GtkStyle - * @window: a #GdkWindow - * @state_type: a state - * @x: the x position to draw the expander at - * @y: the y position to draw the expander at - * @expander_style: the style to draw the expander in - * - * Draws an expander as used in #GtkTreeView. - * - * Deprecated: 2.0: Use gtk_paint_expander() instead. - **/ -void -gtk_draw_expander (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - gint x, - gint y, - GtkExpanderStyle expander_style) -{ - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_expander != NULL); - - GTK_STYLE_GET_CLASS (style)->draw_expander (style, window, state_type, - NULL, NULL, NULL, - x, y, expander_style); -} - -/** - * gtk_draw_layout: - * @style: a #GtkStyle - * @window: a #GdkWindow - * @state_type: a state - * @use_text: whether to use the text or foreground - * graphics context of @style - * @x: x origin - * @y: y origin - * @layout: the layout to draw - * - * Draws a layout on @window using the given parameters. - */ -void -gtk_draw_layout (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - gboolean use_text, - gint x, - gint y, - PangoLayout *layout) -{ - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_layout != NULL); - - GTK_STYLE_GET_CLASS (style)->draw_layout (style, window, state_type, use_text, - NULL, NULL, NULL, - x, y, layout); -} - -/** - * gtk_draw_resize_grip: - * @style: a #GtkStyle - * @window: a #GdkWindow - * @state_type: a state - * @edge: the edge in which to draw the resize grip - * @x: the x origin of the rectangle in which to draw the resize grip - * @y: the y origin of the rectangle in which to draw the resize grip - * @width: the width of the rectangle in which to draw the resize grip - * @height: the height of the rectangle in which to draw the resize grip - * - * Draws a resize grip in the given rectangle on @window using the given - * parameters. - * - * Deprecated: 2.0: Use gtk_paint_resize_grip() instead. - */ -void -gtk_draw_resize_grip (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GdkWindowEdge edge, - gint x, - gint y, - gint width, - gint height) -{ - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_resize_grip != NULL); - - GTK_STYLE_GET_CLASS (style)->draw_resize_grip (style, window, state_type, - NULL, NULL, NULL, - edge, - x, y, width, height); -} - - /** * gtk_style_set_background: * @style: a #GtkStyle @@ -3427,39 +2738,6 @@ gtk_default_draw_diamond (GtkStyle *style, } } -static void -gtk_default_draw_string (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - const gchar *string) -{ - if (area) - { - gdk_gc_set_clip_rectangle (style->white_gc, area); - gdk_gc_set_clip_rectangle (style->fg_gc[state_type], area); - } - - if (state_type == GTK_STATE_INSENSITIVE) - gdk_draw_string (window, - gtk_style_get_font_internal (style), - style->white_gc, x + 1, y + 1, string); - - gdk_draw_string (window, - gtk_style_get_font_internal (style), - style->fg_gc[state_type], x, y, string); - - if (area) - { - gdk_gc_set_clip_rectangle (style->white_gc, NULL); - gdk_gc_set_clip_rectangle (style->fg_gc[state_type], NULL); - } -} - static void option_menu_get_props (GtkWidget *widget, GtkRequisition *indicator_size, @@ -3467,12 +2745,6 @@ option_menu_get_props (GtkWidget *widget, { GtkRequisition *tmp_size = NULL; GtkBorder *tmp_spacing = NULL; - - if (GTK_IS_OPTION_MENU (widget)) - gtk_widget_style_get (widget, - "indicator-size", &tmp_size, - "indicator-spacing", &tmp_spacing, - NULL); if (tmp_size) { @@ -6259,43 +5531,6 @@ gtk_paint_diamond (GtkStyle *style, x, y, width, height); } -/** - * gtk_paint_string: - * @style: a #GtkStyle - * @window: a #GdkWindow - * @state_type: a state - * @area: (allow-none): clip rectangle, or %NULL if the - * output should not be clipped - * @widget: (allow-none): the widget - * @detail: (allow-none): a style detail - * @x: x origin - * @y: y origin - * @string: the string to draw - * - * Draws a text string on @window with the given parameters. - * - * Deprecated: 2.0: Use gtk_paint_layout() instead. - */ -void -gtk_paint_string (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - const GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - const gchar *string) -{ - g_return_if_fail (GTK_IS_STYLE (style)); - g_return_if_fail (GTK_STYLE_GET_CLASS (style)->draw_string != NULL); - g_return_if_fail (style->depth == gdk_drawable_get_depth (window)); - - GTK_STYLE_GET_CLASS (style)->draw_string (style, window, state_type, - (GdkRectangle *) area, widget, detail, - x, y, string); -} - /** * gtk_paint_box: * @style: a #GtkStyle @@ -7023,62 +6258,6 @@ gtk_style_get_font_internal (GtkStyle *style) return style->private_font; } -/** - * gtk_style_get_font: - * @style: a #GtkStyle - * - * Gets the #GdkFont to use for the given style. This is - * meant only as a replacement for direct access to @style->font - * and should not be used in new code. New code should - * use @style->font_desc instead. - * - * Return value: the #GdkFont for the style. This font is owned - * by the style; if you want to keep around a copy, you must - * call gdk_font_ref(). - **/ -GdkFont * -gtk_style_get_font (GtkStyle *style) -{ - g_return_val_if_fail (GTK_IS_STYLE (style), NULL); - - return gtk_style_get_font_internal (style); -} - -/** - * gtk_style_set_font: - * @style: a #GtkStyle. - * @font: (allow-none): a #GdkFont, or %NULL to use the #GdkFont corresponding - * to style->font_desc. - * - * Sets the #GdkFont to use for a given style. This is - * meant only as a replacement for direct access to style->font - * and should not be used in new code. New code should - * use style->font_desc instead. - **/ -void -gtk_style_set_font (GtkStyle *style, - GdkFont *font) -{ - GdkFont *old_font; - - g_return_if_fail (GTK_IS_STYLE (style)); - - old_font = style->private_font; - - style->private_font = font; - if (font) - gdk_font_ref (font); - - if (old_font) - gdk_font_unref (old_font); - - if (style->private_font_desc) - { - pango_font_description_free (style->private_font_desc); - style->private_font_desc = NULL; - } -} - typedef struct _CursorInfo CursorInfo; struct _CursorInfo diff --git a/gtk/gtkstyle.h b/gtk/gtkstyle.h index 75dc109ec9..93feed6243 100644 --- a/gtk/gtkstyle.h +++ b/gtk/gtkstyle.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -68,6 +68,12 @@ typedef gboolean (*GtkRcPropertyParser) (const GParamSpec *pspec, */ typedef struct _GtkWidget GtkWidget; +/** + * GTK_STYLE_ATTACHED: + * @style: a #GtkStyle. + * + * Returns whether the style is attached to a window. + */ #define GTK_STYLE_ATTACHED(style) (GTK_STYLE (style)->attach_count > 0) struct _GtkStyle @@ -234,15 +240,6 @@ struct _GtkStyleClass gint y, gint width, gint height); - void (*draw_string) (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - const gchar *string); void (*draw_box) (GtkStyle *style, GdkWindow *window, GtkStateType state_type, @@ -429,6 +426,16 @@ struct _GtkStyleClass void (*_gtk_reserved11) (void); }; +/** + * GtkBorder: + * @left: The width of the left border. + * @right: The width of the right border. + * @top: The width of the top border. + * @bottom: The width of the bottom border. + * + * A struct that specifies a border around a rectangular area that can + * be of different width on each side. + */ struct _GtkBorder { gint left; @@ -443,16 +450,6 @@ GtkStyle* gtk_style_copy (GtkStyle *style); GtkStyle* gtk_style_attach (GtkStyle *style, GdkWindow *window) G_GNUC_WARN_UNUSED_RESULT; void gtk_style_detach (GtkStyle *style); - -#ifndef GTK_DISABLE_DEPRECATED -GtkStyle* gtk_style_ref (GtkStyle *style); -void gtk_style_unref (GtkStyle *style); - -GdkFont * gtk_style_get_font (GtkStyle *style); -void gtk_style_set_font (GtkStyle *style, - GdkFont *font); -#endif /* GTK_DISABLE_DEPRECATED */ - void gtk_style_set_background (GtkStyle *style, GdkWindow *window, GtkStateType state_type); @@ -480,170 +477,6 @@ GdkPixbuf* gtk_style_render_icon (GtkStyle *style, GtkWidget *widget, const gchar *detail); -#ifndef GTK_DISABLE_DEPRECATED -void gtk_draw_hline (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - gint x1, - gint x2, - gint y); -void gtk_draw_vline (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - gint y1_, - gint y2_, - gint x); -void gtk_draw_shadow (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - gint x, - gint y, - gint width, - gint height); -void gtk_draw_polygon (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GdkPoint *points, - gint npoints, - gboolean fill); -void gtk_draw_arrow (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - GtkArrowType arrow_type, - gboolean fill, - gint x, - gint y, - gint width, - gint height); -void gtk_draw_diamond (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - gint x, - gint y, - gint width, - gint height); -void gtk_draw_box (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - gint x, - gint y, - gint width, - gint height); -void gtk_draw_flat_box (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - gint x, - gint y, - gint width, - gint height); -void gtk_draw_check (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - gint x, - gint y, - gint width, - gint height); -void gtk_draw_option (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - gint x, - gint y, - gint width, - gint height); -void gtk_draw_tab (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - gint x, - gint y, - gint width, - gint height); -void gtk_draw_shadow_gap (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - gint x, - gint y, - gint width, - gint height, - GtkPositionType gap_side, - gint gap_x, - gint gap_width); -void gtk_draw_box_gap (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - gint x, - gint y, - gint width, - gint height, - GtkPositionType gap_side, - gint gap_x, - gint gap_width); -void gtk_draw_extension (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - gint x, - gint y, - gint width, - gint height, - GtkPositionType gap_side); -void gtk_draw_focus (GtkStyle *style, - GdkWindow *window, - gint x, - gint y, - gint width, - gint height); -void gtk_draw_slider (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - gint x, - gint y, - gint width, - gint height, - GtkOrientation orientation); -void gtk_draw_handle (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GtkShadowType shadow_type, - gint x, - gint y, - gint width, - gint height, - GtkOrientation orientation); -void gtk_draw_expander (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - gint x, - gint y, - GtkExpanderStyle expander_style); -void gtk_draw_layout (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - gboolean use_text, - gint x, - gint y, - PangoLayout *layout); -void gtk_draw_resize_grip (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - GdkWindowEdge edge, - gint x, - gint y, - gint width, - gint height); -#endif /* GTK_DISABLE_DEPRECATED */ - void gtk_paint_hline (GtkStyle *style, GdkWindow *window, GtkStateType state_type, @@ -909,26 +742,6 @@ void _gtk_style_shade (const GdkColor *a, GdkColor *b, gdouble k); -/* deprecated */ -#ifndef GTK_DISABLE_DEPRECATED -#define gtk_style_apply_default_pixmap(s,gw,st,a,x,y,w,h) gtk_style_apply_default_background (s,gw,1,st,a,x,y,w,h) -void gtk_draw_string (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - gint x, - gint y, - const gchar *string); -void gtk_paint_string (GtkStyle *style, - GdkWindow *window, - GtkStateType state_type, - const GdkRectangle *area, - GtkWidget *widget, - const gchar *detail, - gint x, - gint y, - const gchar *string); -#endif /* GTK_DISABLE_DEPRECATED */ - void gtk_draw_insertion_cursor (GtkWidget *widget, GdkDrawable *drawable, const GdkRectangle *area, diff --git a/gtk/gtktable.h b/gtk/gtktable.h index 9b3ebf9dd3..f993d7e8f1 100644 --- a/gtk/gtktable.h +++ b/gtk/gtktable.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtktearoffmenuitem.h b/gtk/gtktearoffmenuitem.h index a30b0ec462..3fa32a613c 100644 --- a/gtk/gtktearoffmenuitem.h +++ b/gtk/gtktearoffmenuitem.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtktestutils.c b/gtk/gtktestutils.c index a60cdcf651..ab9e267f0c 100644 --- a/gtk/gtktestutils.c +++ b/gtk/gtktestutils.c @@ -19,7 +19,6 @@ */ /* need to get the prototypes of all get_type functions */ -#define GTK_ENABLE_BROKEN #undef GTK_DISABLE_DEPRECATED /* Need to get GDK_WINDOW_OBJECT */ #undef GDK_DISABLE_DEPRECATED @@ -34,7 +33,12 @@ #include -/* --- test utilities --- */ +/** + * SECTION:gtktesting + * @Short_description: Utilities for testing GTK+ applications + * @Title: Testing + */ + /** * gtk_test_init: * @argcp: Address of the argc parameter of the diff --git a/gtk/gtktext.c b/gtk/gtktext.c deleted file mode 100644 index 5535d5a3b8..0000000000 --- a/gtk/gtktext.c +++ /dev/null @@ -1,5461 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#include "config.h" - -#include -#include - -#undef GDK_DISABLE_DEPRECATED - -#include "gdk/gdkkeysyms.h" -#include "gdk/gdki18n.h" - -#undef GTK_DISABLE_DEPRECATED - -#include "gtkmain.h" -#include "gtkmarshalers.h" -#include "gtkselection.h" -#include "gtksignal.h" -#include "gtkstyle.h" -#define GTK_ENABLE_BROKEN -#include "gtktext.h" -#include "line-wrap.xbm" -#include "line-arrow.xbm" -#include "gtkprivate.h" -#include "gtkintl.h" - -#include "gtkalias.h" - - -#define INITIAL_BUFFER_SIZE 1024 -#define INITIAL_LINE_CACHE_SIZE 256 -#define MIN_GAP_SIZE 256 -#define LINE_DELIM '\n' -#define MIN_TEXT_WIDTH_LINES 20 -#define MIN_TEXT_HEIGHT_LINES 10 -#define TEXT_BORDER_ROOM 1 -#define LINE_WRAP_ROOM 8 /* The bitmaps are 6 wide. */ -#define DEFAULT_TAB_STOP_WIDTH 4 -#define SCROLL_PIXELS 5 -#define KEY_SCROLL_PIXELS 10 -#define SCROLL_TIME 100 -#define FREEZE_LENGTH 1024 -/* Freeze text when inserting or deleting more than this many characters */ - -#define SET_PROPERTY_MARK(m, p, o) do { \ - (m)->property = (p); \ - (m)->offset = (o); \ - } while (0) -#define MARK_CURRENT_PROPERTY(mark) ((TextProperty*)(mark)->property->data) -#define MARK_NEXT_PROPERTY(mark) ((TextProperty*)(mark)->property->next->data) -#define MARK_PREV_PROPERTY(mark) ((TextProperty*)((mark)->property->prev ? \ - (mark)->property->prev->data \ - : NULL)) -#define MARK_PREV_LIST_PTR(mark) ((mark)->property->prev) -#define MARK_LIST_PTR(mark) ((mark)->property) -#define MARK_NEXT_LIST_PTR(mark) ((mark)->property->next) -#define MARK_OFFSET(mark) ((mark)->offset) -#define MARK_PROPERTY_LENGTH(mark) (MARK_CURRENT_PROPERTY(mark)->length) - - -#define MARK_CURRENT_FONT(text, mark) \ - ((MARK_CURRENT_PROPERTY(mark)->flags & PROPERTY_FONT) ? \ - MARK_CURRENT_PROPERTY(mark)->font->gdk_font : \ - gtk_style_get_font (GTK_WIDGET (text)->style)) -#define MARK_CURRENT_FORE(text, mark) \ - ((MARK_CURRENT_PROPERTY(mark)->flags & PROPERTY_FOREGROUND) ? \ - &MARK_CURRENT_PROPERTY(mark)->fore_color : \ - &((GtkWidget *)text)->style->text[((GtkWidget *)text)->state]) -#define MARK_CURRENT_BACK(text, mark) \ - ((MARK_CURRENT_PROPERTY(mark)->flags & PROPERTY_BACKGROUND) ? \ - &MARK_CURRENT_PROPERTY(mark)->back_color : \ - &((GtkWidget *)text)->style->base[((GtkWidget *)text)->state]) -#define MARK_CURRENT_TEXT_FONT(text, mark) \ - ((MARK_CURRENT_PROPERTY(mark)->flags & PROPERTY_FONT) ? \ - MARK_CURRENT_PROPERTY(mark)->font : \ - text->current_font) - -#define TEXT_LENGTH(t) ((t)->text_end - (t)->gap_size) -#define FONT_HEIGHT(f) ((f)->ascent + (f)->descent) -#define LINE_HEIGHT(l) ((l).font_ascent + (l).font_descent) -#define LINE_CONTAINS(l, i) ((l).start.index <= (i) && (l).end.index >= (i)) -#define LINE_STARTS_AT(l, i) ((l).start.index == (i)) -#define LINE_START_PIXEL(l) ((l).tab_cont.pixel_offset) -#define LAST_INDEX(t, m) ((m).index == TEXT_LENGTH(t)) -#define CACHE_DATA(c) (*(LineParams*)(c)->data) - -enum { - PROP_0, - PROP_HADJUSTMENT, - PROP_VADJUSTMENT, - PROP_LINE_WRAP, - PROP_WORD_WRAP -}; - -typedef struct _TextProperty TextProperty; -typedef struct _TabStopMark TabStopMark; -typedef struct _PrevTabCont PrevTabCont; -typedef struct _FetchLinesData FetchLinesData; -typedef struct _LineParams LineParams; -typedef struct _SetVerticalScrollData SetVerticalScrollData; - -typedef gint (*LineIteratorFunction) (GtkText* text, LineParams* lp, void* data); - -typedef enum -{ - FetchLinesPixels, - FetchLinesCount -} FLType; - -struct _SetVerticalScrollData { - gint pixel_height; - gint last_didnt_wrap; - gint last_line_start; - GtkPropertyMark mark; -}; - -struct _GtkTextFont -{ - /* The actual font. */ - GdkFont *gdk_font; - guint ref_count; - - gint16 char_widths[256]; -}; - -typedef enum { - PROPERTY_FONT = 1 << 0, - PROPERTY_FOREGROUND = 1 << 1, - PROPERTY_BACKGROUND = 1 << 2 -} TextPropertyFlags; - -struct _TextProperty -{ - /* Font. */ - GtkTextFont* font; - - /* Background Color. */ - GdkColor back_color; - - /* Foreground Color. */ - GdkColor fore_color; - - /* Show which properties are set */ - TextPropertyFlags flags; - - /* Length of this property. */ - guint length; -}; - -struct _TabStopMark -{ - GList* tab_stops; /* Index into list containing the next tab position. If - * NULL, using default widths. */ - gint to_next_tab; -}; - -struct _PrevTabCont -{ - guint pixel_offset; - TabStopMark tab_start; -}; - -struct _FetchLinesData -{ - GList* new_lines; - FLType fl_type; - gint data; - gint data_max; -}; - -struct _LineParams -{ - guint font_ascent; - guint font_descent; - guint pixel_width; - guint displayable_chars; - guint wraps : 1; - - PrevTabCont tab_cont; - PrevTabCont tab_cont_next; - - GtkPropertyMark start; - GtkPropertyMark end; -}; - - -static void gtk_text_class_init (GtkTextClass *klass); -static void gtk_text_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec); -static void gtk_text_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec); -static void gtk_text_editable_init (GtkEditableClass *iface); -static void gtk_text_init (GtkText *text); -static void gtk_text_destroy (GtkObject *object); -static void gtk_text_finalize (GObject *object); -static void gtk_text_realize (GtkWidget *widget); -static void gtk_text_unrealize (GtkWidget *widget); -static void gtk_text_style_set (GtkWidget *widget, - GtkStyle *previous_style); -static void gtk_text_state_changed (GtkWidget *widget, - GtkStateType previous_state); -static void gtk_text_draw_focus (GtkWidget *widget); -static void gtk_text_size_request (GtkWidget *widget, - GtkRequisition *requisition); -static void gtk_text_size_allocate (GtkWidget *widget, - GtkAllocation *allocation); -static void gtk_text_adjustment (GtkAdjustment *adjustment, - GtkText *text); -static void gtk_text_insert_text (GtkEditable *editable, - const gchar *new_text, - gint new_text_length, - gint *position); -static void gtk_text_delete_text (GtkEditable *editable, - gint start_pos, - gint end_pos); -static void gtk_text_update_text (GtkOldEditable *old_editable, - gint start_pos, - gint end_pos); -static gchar *gtk_text_get_chars (GtkOldEditable *old_editable, - gint start, - gint end); -static void gtk_text_set_selection (GtkOldEditable *old_editable, - gint start, - gint end); -static void gtk_text_real_set_editable (GtkOldEditable *old_editable, - gboolean is_editable); - -static void gtk_text_adjustment_destroyed (GtkAdjustment *adjustment, - GtkText *text); - -/* Event handlers */ -static gint gtk_text_expose (GtkWidget *widget, - GdkEventExpose *event); -static gint gtk_text_button_press (GtkWidget *widget, - GdkEventButton *event); -static gint gtk_text_button_release (GtkWidget *widget, - GdkEventButton *event); -static gint gtk_text_motion_notify (GtkWidget *widget, - GdkEventMotion *event); -static gint gtk_text_key_press (GtkWidget *widget, - GdkEventKey *event); - -static void move_gap (GtkText* text, guint index); -static void make_forward_space (GtkText* text, guint len); - -/* Property management */ -static GtkTextFont* get_text_font (GdkFont* gfont); -static void text_font_unref (GtkTextFont *text_font); - -static void insert_text_property (GtkText* text, GdkFont* font, - const GdkColor *fore, const GdkColor* back, guint len); -static TextProperty* new_text_property (GtkText *text, GdkFont* font, - const GdkColor* fore, const GdkColor* back, guint length); -static void destroy_text_property (TextProperty *prop); -static void init_properties (GtkText *text); -static void realize_property (GtkText *text, TextProperty *prop); -static void realize_properties (GtkText *text); -static void unrealize_property (GtkText *text, TextProperty *prop); -static void unrealize_properties (GtkText *text); - -static void delete_text_property (GtkText* text, guint len); - -static guint pixel_height_of (GtkText* text, GList* cache_line); - -/* Property Movement and Size Computations */ -static void advance_mark (GtkPropertyMark* mark); -static void decrement_mark (GtkPropertyMark* mark); -static void advance_mark_n (GtkPropertyMark* mark, gint n); -static void decrement_mark_n (GtkPropertyMark* mark, gint n); -static void move_mark_n (GtkPropertyMark* mark, gint n); -static GtkPropertyMark find_mark (GtkText* text, guint mark_position); -static GtkPropertyMark find_mark_near (GtkText* text, guint mark_position, const GtkPropertyMark* near); -static void find_line_containing_point (GtkText* text, guint point, - gboolean scroll); - -/* Display */ -static void compute_lines_pixels (GtkText* text, guint char_count, - guint *lines, guint *pixels); - -static gint total_line_height (GtkText* text, - GList* line, - gint line_count); -static LineParams find_line_params (GtkText* text, - const GtkPropertyMark *mark, - const PrevTabCont *tab_cont, - PrevTabCont *next_cont); -static void recompute_geometry (GtkText* text); -static void insert_expose (GtkText* text, guint old_pixels, gint nchars, guint new_line_count); -static void delete_expose (GtkText* text, - guint nchars, - guint old_lines, - guint old_pixels); -static GdkGC *create_bg_gc (GtkText *text); -static void clear_area (GtkText *text, GdkRectangle *area); -static void draw_line (GtkText* text, - gint pixel_height, - LineParams* lp); -static void draw_line_wrap (GtkText* text, - guint height); -static void draw_cursor (GtkText* text, gint absolute); -static void undraw_cursor (GtkText* text, gint absolute); -static gint drawn_cursor_min (GtkText* text); -static gint drawn_cursor_max (GtkText* text); -static void expose_text (GtkText* text, GdkRectangle *area, gboolean cursor); - -/* Search and Placement. */ -static void find_cursor (GtkText* text, - gboolean scroll); -static void find_cursor_at_line (GtkText* text, - const LineParams* start_line, - gint pixel_height); -static void find_mouse_cursor (GtkText* text, gint x, gint y); - -/* Scrolling. */ -static void adjust_adj (GtkText* text, GtkAdjustment* adj); -static void scroll_up (GtkText* text, gint diff); -static void scroll_down (GtkText* text, gint diff); -static void scroll_int (GtkText* text, gint diff); - -static void process_exposes (GtkText *text); - -/* Cache Management. */ -static void free_cache (GtkText* text); -static GList* remove_cache_line (GtkText* text, GList* list); - -/* Key Motion. */ -static void move_cursor_buffer_ver (GtkText *text, int dir); -static void move_cursor_page_ver (GtkText *text, int dir); -static void move_cursor_ver (GtkText *text, int count); -static void move_cursor_hor (GtkText *text, int count); - -/* Binding actions */ -static void gtk_text_move_cursor (GtkOldEditable *old_editable, - gint x, - gint y); -static void gtk_text_move_word (GtkOldEditable *old_editable, - gint n); -static void gtk_text_move_page (GtkOldEditable *old_editable, - gint x, - gint y); -static void gtk_text_move_to_row (GtkOldEditable *old_editable, - gint row); -static void gtk_text_move_to_column (GtkOldEditable *old_editable, - gint row); -static void gtk_text_kill_char (GtkOldEditable *old_editable, - gint direction); -static void gtk_text_kill_word (GtkOldEditable *old_editable, - gint direction); -static void gtk_text_kill_line (GtkOldEditable *old_editable, - gint direction); - -/* To be removed */ -static void gtk_text_move_forward_character (GtkText *text); -static void gtk_text_move_backward_character (GtkText *text); -static void gtk_text_move_forward_word (GtkText *text); -static void gtk_text_move_backward_word (GtkText *text); -static void gtk_text_move_beginning_of_line (GtkText *text); -static void gtk_text_move_end_of_line (GtkText *text); -static void gtk_text_move_next_line (GtkText *text); -static void gtk_text_move_previous_line (GtkText *text); - -static void gtk_text_delete_forward_character (GtkText *text); -static void gtk_text_delete_backward_character (GtkText *text); -static void gtk_text_delete_forward_word (GtkText *text); -static void gtk_text_delete_backward_word (GtkText *text); -static void gtk_text_delete_line (GtkText *text); -static void gtk_text_delete_to_line_end (GtkText *text); -static void gtk_text_select_word (GtkText *text, - guint32 time); -static void gtk_text_select_line (GtkText *text, - guint32 time); - -static void gtk_text_set_position (GtkOldEditable *old_editable, - gint position); - -/* #define DEBUG_GTK_TEXT */ - -#if defined(DEBUG_GTK_TEXT) && defined(__GNUC__) -/* Debugging utilities. */ -static void gtk_text_assert_mark (GtkText *text, - GtkPropertyMark *mark, - GtkPropertyMark *before, - GtkPropertyMark *after, - const gchar *msg, - const gchar *where, - gint line); - -static void gtk_text_assert (GtkText *text, - const gchar *msg, - gint line); -static void gtk_text_show_cache_line (GtkText *text, GList *cache, - const char* what, const char* func, gint line); -static void gtk_text_show_cache (GtkText *text, const char* func, gint line); -static void gtk_text_show_adj (GtkText *text, - GtkAdjustment *adj, - const char* what, - const char* func, - gint line); -static void gtk_text_show_props (GtkText* test, - const char* func, - int line); - -#define TDEBUG(args) g_message args -#define TEXT_ASSERT(text) gtk_text_assert (text,__PRETTY_FUNCTION__,__LINE__) -#define TEXT_ASSERT_MARK(text,mark,msg) gtk_text_assert_mark (text,mark, \ - __PRETTY_FUNCTION__,msg,__LINE__) -#define TEXT_SHOW(text) gtk_text_show_cache (text, __PRETTY_FUNCTION__,__LINE__) -#define TEXT_SHOW_LINE(text,line,msg) gtk_text_show_cache_line (text,line,msg,\ - __PRETTY_FUNCTION__,__LINE__) -#define TEXT_SHOW_ADJ(text,adj,msg) gtk_text_show_adj (text,adj,msg, \ - __PRETTY_FUNCTION__,__LINE__) -#else -#define TDEBUG(args) -#define TEXT_ASSERT(text) -#define TEXT_ASSERT_MARK(text,mark,msg) -#define TEXT_SHOW(text) -#define TEXT_SHOW_LINE(text,line,msg) -#define TEXT_SHOW_ADJ(text,adj,msg) -#endif - -static GtkWidgetClass *parent_class = NULL; - -/**********************************************************************/ -/* Widget Crap */ -/**********************************************************************/ - -GtkType -gtk_text_get_type (void) -{ - static GtkType text_type = 0; - - if (!text_type) - { - static const GtkTypeInfo text_info = - { - "GtkText", - sizeof (GtkText), - sizeof (GtkTextClass), - (GtkClassInitFunc) gtk_text_class_init, - (GtkObjectInitFunc) gtk_text_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, - }; - - const GInterfaceInfo editable_info = - { - (GInterfaceInitFunc) gtk_text_editable_init, /* interface_init */ - NULL, /* interface_finalize */ - NULL /* interface_data */ - }; - - I_("GtkText"); - text_type = gtk_type_unique (GTK_TYPE_OLD_EDITABLE, &text_info); - g_type_add_interface_static (text_type, - GTK_TYPE_EDITABLE, - &editable_info); - } - - return text_type; -} - -static void -gtk_text_class_init (GtkTextClass *class) -{ - GObjectClass *gobject_class; - GtkObjectClass *object_class; - GtkWidgetClass *widget_class; - GtkOldEditableClass *old_editable_class; - - gobject_class = G_OBJECT_CLASS (class); - object_class = (GtkObjectClass*) class; - widget_class = (GtkWidgetClass*) class; - old_editable_class = (GtkOldEditableClass*) class; - parent_class = gtk_type_class (GTK_TYPE_OLD_EDITABLE); - - gobject_class->finalize = gtk_text_finalize; - gobject_class->set_property = gtk_text_set_property; - gobject_class->get_property = gtk_text_get_property; - - object_class->destroy = gtk_text_destroy; - - widget_class->realize = gtk_text_realize; - widget_class->unrealize = gtk_text_unrealize; - widget_class->style_set = gtk_text_style_set; - widget_class->state_changed = gtk_text_state_changed; - widget_class->size_request = gtk_text_size_request; - widget_class->size_allocate = gtk_text_size_allocate; - widget_class->expose_event = gtk_text_expose; - widget_class->button_press_event = gtk_text_button_press; - widget_class->button_release_event = gtk_text_button_release; - widget_class->motion_notify_event = gtk_text_motion_notify; - widget_class->key_press_event = gtk_text_key_press; - - old_editable_class->set_editable = gtk_text_real_set_editable; - - old_editable_class->move_cursor = gtk_text_move_cursor; - old_editable_class->move_word = gtk_text_move_word; - old_editable_class->move_page = gtk_text_move_page; - old_editable_class->move_to_row = gtk_text_move_to_row; - old_editable_class->move_to_column = gtk_text_move_to_column; - - old_editable_class->kill_char = gtk_text_kill_char; - old_editable_class->kill_word = gtk_text_kill_word; - old_editable_class->kill_line = gtk_text_kill_line; - - old_editable_class->update_text = gtk_text_update_text; - old_editable_class->get_chars = gtk_text_get_chars; - old_editable_class->set_selection = gtk_text_set_selection; - old_editable_class->set_position = gtk_text_set_position; - - class->set_scroll_adjustments = gtk_text_set_adjustments; - - g_object_class_install_property (gobject_class, - PROP_HADJUSTMENT, - g_param_spec_object ("hadjustment", - P_("Horizontal Adjustment"), - P_("Horizontal adjustment for the text widget"), - GTK_TYPE_ADJUSTMENT, - GTK_PARAM_READWRITE)); - - g_object_class_install_property (gobject_class, - PROP_VADJUSTMENT, - g_param_spec_object ("vadjustment", - P_("Vertical Adjustment"), - P_("Vertical adjustment for the text widget"), - GTK_TYPE_ADJUSTMENT, - GTK_PARAM_READWRITE)); - - g_object_class_install_property (gobject_class, - PROP_LINE_WRAP, - g_param_spec_boolean ("line-wrap", - P_("Line Wrap"), - P_("Whether lines are wrapped at widget edges"), - TRUE, - GTK_PARAM_READWRITE)); - - g_object_class_install_property (gobject_class, - PROP_WORD_WRAP, - g_param_spec_boolean ("word-wrap", - P_("Word Wrap"), - P_("Whether words are wrapped at widget edges"), - FALSE, - GTK_PARAM_READWRITE)); - - widget_class->set_scroll_adjustments_signal = - gtk_signal_new (I_("set-scroll-adjustments"), - GTK_RUN_LAST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkTextClass, set_scroll_adjustments), - _gtk_marshal_VOID__OBJECT_OBJECT, - GTK_TYPE_NONE, 2, GTK_TYPE_ADJUSTMENT, GTK_TYPE_ADJUSTMENT); -} - -static void -gtk_text_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - GtkText *text; - - text = GTK_TEXT (object); - - switch (prop_id) - { - case PROP_HADJUSTMENT: - gtk_text_set_adjustments (text, - g_value_get_object (value), - text->vadj); - break; - case PROP_VADJUSTMENT: - gtk_text_set_adjustments (text, - text->hadj, - g_value_get_object (value)); - break; - case PROP_LINE_WRAP: - gtk_text_set_line_wrap (text, g_value_get_boolean (value)); - break; - case PROP_WORD_WRAP: - gtk_text_set_word_wrap (text, g_value_get_boolean (value)); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -gtk_text_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - GtkText *text; - - text = GTK_TEXT (object); - - switch (prop_id) - { - case PROP_HADJUSTMENT: - g_value_set_object (value, text->hadj); - break; - case PROP_VADJUSTMENT: - g_value_set_object (value, text->vadj); - break; - case PROP_LINE_WRAP: - g_value_set_boolean (value, text->line_wrap); - break; - case PROP_WORD_WRAP: - g_value_set_boolean (value, text->word_wrap); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -gtk_text_editable_init (GtkEditableClass *iface) -{ - iface->insert_text = gtk_text_insert_text; - iface->delete_text = gtk_text_delete_text; -} - -static void -gtk_text_init (GtkText *text) -{ - gtk_widget_set_can_focus (GTK_WIDGET (text), TRUE); - - text->text_area = NULL; - text->hadj = NULL; - text->vadj = NULL; - text->gc = NULL; - text->bg_gc = NULL; - text->line_wrap_bitmap = NULL; - text->line_arrow_bitmap = NULL; - - text->use_wchar = FALSE; - text->text.ch = g_new (guchar, INITIAL_BUFFER_SIZE); - text->text_len = INITIAL_BUFFER_SIZE; - - text->scratch_buffer.ch = NULL; - text->scratch_buffer_len = 0; - - text->freeze_count = 0; - - text->default_tab_width = 4; - text->tab_stops = NULL; - - text->tab_stops = g_list_prepend (text->tab_stops, (void*)8); - text->tab_stops = g_list_prepend (text->tab_stops, (void*)8); - - text->line_start_cache = NULL; - text->first_cut_pixels = 0; - - text->line_wrap = TRUE; - text->word_wrap = FALSE; - - text->timer = 0; - text->button = 0; - - text->current_font = NULL; - - init_properties (text); - - GTK_OLD_EDITABLE (text)->editable = FALSE; - - gtk_text_set_adjustments (text, NULL, NULL); - gtk_editable_set_position (GTK_EDITABLE (text), 0); -} - -GtkWidget* -gtk_text_new (GtkAdjustment *hadj, - GtkAdjustment *vadj) -{ - GtkWidget *text; - - if (hadj) - g_return_val_if_fail (GTK_IS_ADJUSTMENT (hadj), NULL); - if (vadj) - g_return_val_if_fail (GTK_IS_ADJUSTMENT (vadj), NULL); - - text = g_object_new (GTK_TYPE_TEXT, - "hadjustment", hadj, - "vadjustment", vadj, - NULL); - - return text; -} - -void -gtk_text_set_word_wrap (GtkText *text, - gboolean word_wrap) -{ - g_return_if_fail (GTK_IS_TEXT (text)); - - text->word_wrap = (word_wrap != FALSE); - - if (gtk_widget_get_realized (GTK_WIDGET (text))) - { - recompute_geometry (text); - gtk_widget_queue_draw (GTK_WIDGET (text)); - } - - g_object_notify (G_OBJECT (text), "word-wrap"); -} - -void -gtk_text_set_line_wrap (GtkText *text, - gboolean line_wrap) -{ - g_return_if_fail (GTK_IS_TEXT (text)); - - text->line_wrap = (line_wrap != FALSE); - - if (gtk_widget_get_realized (GTK_WIDGET (text))) - { - recompute_geometry (text); - gtk_widget_queue_draw (GTK_WIDGET (text)); - } - - g_object_notify (G_OBJECT (text), "line-wrap"); -} - -void -gtk_text_set_editable (GtkText *text, - gboolean is_editable) -{ - g_return_if_fail (GTK_IS_TEXT (text)); - - gtk_editable_set_editable (GTK_EDITABLE (text), is_editable); -} - -static void -gtk_text_real_set_editable (GtkOldEditable *old_editable, - gboolean is_editable) -{ - GtkText *text; - - g_return_if_fail (GTK_IS_TEXT (old_editable)); - - text = GTK_TEXT (old_editable); - - old_editable->editable = (is_editable != FALSE); - - if (is_editable) - draw_cursor (text, TRUE); - else - undraw_cursor (text, TRUE); -} - -void -gtk_text_set_adjustments (GtkText *text, - GtkAdjustment *hadj, - GtkAdjustment *vadj) -{ - g_return_if_fail (GTK_IS_TEXT (text)); - if (hadj) - g_return_if_fail (GTK_IS_ADJUSTMENT (hadj)); - else - hadj = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0)); - if (vadj) - g_return_if_fail (GTK_IS_ADJUSTMENT (vadj)); - else - vadj = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0)); - - if (text->hadj && (text->hadj != hadj)) - { - gtk_signal_disconnect_by_data (GTK_OBJECT (text->hadj), text); - g_object_unref (text->hadj); - } - - if (text->vadj && (text->vadj != vadj)) - { - gtk_signal_disconnect_by_data (GTK_OBJECT (text->vadj), text); - g_object_unref (text->vadj); - } - - g_object_freeze_notify (G_OBJECT (text)); - if (text->hadj != hadj) - { - text->hadj = hadj; - g_object_ref_sink (text->hadj); - - gtk_signal_connect (GTK_OBJECT (text->hadj), "changed", - G_CALLBACK (gtk_text_adjustment), - text); - gtk_signal_connect (GTK_OBJECT (text->hadj), "value-changed", - G_CALLBACK (gtk_text_adjustment), - text); - gtk_signal_connect (GTK_OBJECT (text->hadj), "destroy", - G_CALLBACK (gtk_text_adjustment_destroyed), - text); - gtk_text_adjustment (hadj, text); - - g_object_notify (G_OBJECT (text), "hadjustment"); - } - - if (text->vadj != vadj) - { - text->vadj = vadj; - g_object_ref_sink (text->vadj); - - gtk_signal_connect (GTK_OBJECT (text->vadj), "changed", - G_CALLBACK (gtk_text_adjustment), - text); - gtk_signal_connect (GTK_OBJECT (text->vadj), "value-changed", - G_CALLBACK (gtk_text_adjustment), - text); - gtk_signal_connect (GTK_OBJECT (text->vadj), "destroy", - G_CALLBACK (gtk_text_adjustment_destroyed), - text); - gtk_text_adjustment (vadj, text); - - g_object_notify (G_OBJECT (text), "vadjustment"); - } - g_object_thaw_notify (G_OBJECT (text)); -} - -void -gtk_text_set_point (GtkText *text, - guint index) -{ - g_return_if_fail (GTK_IS_TEXT (text)); - g_return_if_fail (index <= TEXT_LENGTH (text)); - - text->point = find_mark (text, index); -} - -guint -gtk_text_get_point (GtkText *text) -{ - g_return_val_if_fail (GTK_IS_TEXT (text), 0); - - return text->point.index; -} - -guint -gtk_text_get_length (GtkText *text) -{ - g_return_val_if_fail (GTK_IS_TEXT (text), 0); - - return TEXT_LENGTH (text); -} - -void -gtk_text_freeze (GtkText *text) -{ - g_return_if_fail (GTK_IS_TEXT (text)); - - text->freeze_count++; -} - -void -gtk_text_thaw (GtkText *text) -{ - g_return_if_fail (GTK_IS_TEXT (text)); - - if (text->freeze_count) - if (!(--text->freeze_count) && gtk_widget_get_realized (GTK_WIDGET (text))) - { - recompute_geometry (text); - gtk_widget_queue_draw (GTK_WIDGET (text)); - } -} - -void -gtk_text_insert (GtkText *text, - GdkFont *font, - const GdkColor *fore, - const GdkColor *back, - const char *chars, - gint nchars) -{ - GtkOldEditable *old_editable = GTK_OLD_EDITABLE (text); - gboolean frozen = FALSE; - - gint new_line_count = 1; - guint old_height = 0; - guint length; - guint i; - gint numwcs; - - g_return_if_fail (GTK_IS_TEXT (text)); - - if (nchars < 0) - length = strlen (chars); - else - length = nchars; - - if (length == 0) - return; - - if (!text->freeze_count && (length > FREEZE_LENGTH)) - { - gtk_text_freeze (text); - frozen = TRUE; - } - - if (!text->freeze_count && (text->line_start_cache != NULL)) - { - find_line_containing_point (text, text->point.index, TRUE); - old_height = total_line_height (text, text->current_line, 1); - } - - if ((TEXT_LENGTH (text) == 0) && (text->use_wchar == FALSE)) - { - GtkWidget *widget = GTK_WIDGET (text); - - gtk_widget_ensure_style (widget); - if ((widget->style) && - (gtk_style_get_font (widget->style)->type == GDK_FONT_FONTSET)) - { - text->use_wchar = TRUE; - g_free (text->text.ch); - text->text.wc = g_new (GdkWChar, INITIAL_BUFFER_SIZE); - text->text_len = INITIAL_BUFFER_SIZE; - g_free (text->scratch_buffer.ch); - text->scratch_buffer.wc = NULL; - text->scratch_buffer_len = 0; - } - } - - move_gap (text, text->point.index); - make_forward_space (text, length); - - if (text->use_wchar) - { - char *chars_nt = (char *)chars; - if (nchars > 0) - { - chars_nt = g_new (char, length+1); - memcpy (chars_nt, chars, length); - chars_nt[length] = 0; - } - numwcs = gdk_mbstowcs (text->text.wc + text->gap_position, chars_nt, - length); - if (chars_nt != chars) - g_free(chars_nt); - if (numwcs < 0) - numwcs = 0; - } - else - { - numwcs = length; - memcpy(text->text.ch + text->gap_position, chars, length); - } - - if (!text->freeze_count && (text->line_start_cache != NULL)) - { - if (text->use_wchar) - { - for (i=0; itext.wc[text->gap_position + i] == '\n') - new_line_count++; - } - else - { - for (i=0; itext.ch[text->gap_position + i] == '\n') - new_line_count++; - } - } - - if (numwcs > 0) - { - insert_text_property (text, font, fore, back, numwcs); - - text->gap_size -= numwcs; - text->gap_position += numwcs; - - if (text->point.index < text->first_line_start_index) - text->first_line_start_index += numwcs; - if (text->point.index < old_editable->selection_start_pos) - old_editable->selection_start_pos += numwcs; - if (text->point.index < old_editable->selection_end_pos) - old_editable->selection_end_pos += numwcs; - /* We'll reset the cursor later anyways if we aren't frozen */ - if (text->point.index < text->cursor_mark.index) - text->cursor_mark.index += numwcs; - - advance_mark_n (&text->point, numwcs); - - if (!text->freeze_count && (text->line_start_cache != NULL)) - insert_expose (text, old_height, numwcs, new_line_count); - } - - if (frozen) - gtk_text_thaw (text); -} - -gboolean -gtk_text_backward_delete (GtkText *text, - guint nchars) -{ - g_return_val_if_fail (GTK_IS_TEXT (text), FALSE); - - if (nchars > text->point.index || nchars <= 0) - return FALSE; - - gtk_text_set_point (text, text->point.index - nchars); - - return gtk_text_forward_delete (text, nchars); -} - -gboolean -gtk_text_forward_delete (GtkText *text, - guint nchars) -{ - guint old_lines = 0, old_height = 0; - GtkOldEditable *old_editable = GTK_OLD_EDITABLE (text); - gboolean frozen = FALSE; - - g_return_val_if_fail (GTK_IS_TEXT (text), FALSE); - - if (text->point.index + nchars > TEXT_LENGTH (text) || nchars <= 0) - return FALSE; - - if (!text->freeze_count && nchars > FREEZE_LENGTH) - { - gtk_text_freeze (text); - frozen = TRUE; - } - - if (!text->freeze_count && text->line_start_cache != NULL) - { - /* We need to undraw the cursor here, since we may later - * delete the cursor's property - */ - undraw_cursor (text, FALSE); - find_line_containing_point (text, text->point.index, TRUE); - compute_lines_pixels (text, nchars, &old_lines, &old_height); - } - - /* FIXME, or resizing after deleting will be odd */ - if (text->point.index < text->first_line_start_index) - { - if (text->point.index + nchars >= text->first_line_start_index) - { - text->first_line_start_index = text->point.index; - while ((text->first_line_start_index > 0) && - (GTK_TEXT_INDEX (text, text->first_line_start_index - 1) - != LINE_DELIM)) - text->first_line_start_index -= 1; - - } - else - text->first_line_start_index -= nchars; - } - - if (text->point.index < old_editable->selection_start_pos) - old_editable->selection_start_pos -= - MIN(nchars, old_editable->selection_start_pos - text->point.index); - if (text->point.index < old_editable->selection_end_pos) - old_editable->selection_end_pos -= - MIN(nchars, old_editable->selection_end_pos - text->point.index); - /* We'll reset the cursor later anyways if we aren't frozen */ - if (text->point.index < text->cursor_mark.index) - move_mark_n (&text->cursor_mark, - -MIN(nchars, text->cursor_mark.index - text->point.index)); - - move_gap (text, text->point.index); - - text->gap_size += nchars; - - delete_text_property (text, nchars); - - if (!text->freeze_count && (text->line_start_cache != NULL)) - { - delete_expose (text, nchars, old_lines, old_height); - draw_cursor (text, FALSE); - } - - if (frozen) - gtk_text_thaw (text); - - return TRUE; -} - -static void -gtk_text_set_position (GtkOldEditable *old_editable, - gint position) -{ - GtkText *text = (GtkText *) old_editable; - - if (position < 0) - position = gtk_text_get_length (text); - - undraw_cursor (text, FALSE); - text->cursor_mark = find_mark (text, position); - find_cursor (text, TRUE); - draw_cursor (text, FALSE); - gtk_editable_select_region (GTK_EDITABLE (old_editable), 0, 0); -} - -static gchar * -gtk_text_get_chars (GtkOldEditable *old_editable, - gint start_pos, - gint end_pos) -{ - GtkText *text; - - gchar *retval; - - g_return_val_if_fail (GTK_IS_TEXT (old_editable), NULL); - text = GTK_TEXT (old_editable); - - if (end_pos < 0) - end_pos = TEXT_LENGTH (text); - - if ((start_pos < 0) || - (end_pos > TEXT_LENGTH (text)) || - (end_pos < start_pos)) - return NULL; - - move_gap (text, TEXT_LENGTH (text)); - make_forward_space (text, 1); - - if (text->use_wchar) - { - GdkWChar ch; - ch = text->text.wc[end_pos]; - text->text.wc[end_pos] = 0; - retval = gdk_wcstombs (text->text.wc + start_pos); - text->text.wc[end_pos] = ch; - } - else - { - guchar ch; - ch = text->text.ch[end_pos]; - text->text.ch[end_pos] = 0; - retval = g_strdup ((gchar *)(text->text.ch + start_pos)); - text->text.ch[end_pos] = ch; - } - - return retval; -} - - -static void -gtk_text_destroy (GtkObject *object) -{ - GtkText *text = GTK_TEXT (object); - - if (text->hadj) - { - gtk_signal_disconnect_by_data (GTK_OBJECT (text->hadj), text); - g_object_unref (text->hadj); - text->hadj = NULL; - } - if (text->vadj) - { - gtk_signal_disconnect_by_data (GTK_OBJECT (text->vadj), text); - g_object_unref (text->vadj); - text->vadj = NULL; - } - - if (text->timer) - { - g_source_remove (text->timer); - text->timer = 0; - } - - GTK_OBJECT_CLASS(parent_class)->destroy (object); -} - -static void -gtk_text_finalize (GObject *object) -{ - GtkText *text = GTK_TEXT (object); - GList *tmp_list; - - /* Clean up the internal structures */ - if (text->use_wchar) - g_free (text->text.wc); - else - g_free (text->text.ch); - - tmp_list = text->text_properties; - while (tmp_list) - { - destroy_text_property (tmp_list->data); - tmp_list = tmp_list->next; - } - - if (text->current_font) - text_font_unref (text->current_font); - - g_list_free (text->text_properties); - - if (text->use_wchar) - { - g_free (text->scratch_buffer.wc); - } - else - { - g_free (text->scratch_buffer.ch); - } - - g_list_free (text->tab_stops); - - G_OBJECT_CLASS (parent_class)->finalize (object); -} - -static void -gtk_text_realize (GtkWidget *widget) -{ - GtkText *text = GTK_TEXT (widget); - GtkOldEditable *old_editable = GTK_OLD_EDITABLE (widget); - GdkWindowAttr attributes; - gint attributes_mask; - - gtk_widget_set_realized (widget, TRUE); - - 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_OUTPUT; - attributes.visual = gtk_widget_get_visual (widget); - attributes.colormap = gtk_widget_get_colormap (widget); - attributes.event_mask = gtk_widget_get_events (widget); - attributes.event_mask |= (GDK_EXPOSURE_MASK | - GDK_BUTTON_PRESS_MASK | - GDK_BUTTON_RELEASE_MASK | - GDK_BUTTON_MOTION_MASK | - GDK_ENTER_NOTIFY_MASK | - GDK_LEAVE_NOTIFY_MASK | - GDK_KEY_PRESS_MASK); - attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP; - - widget->window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask); - gdk_window_set_user_data (widget->window, text); - - attributes.x = (widget->style->xthickness + TEXT_BORDER_ROOM); - attributes.y = (widget->style->ythickness + TEXT_BORDER_ROOM); - attributes.width = MAX (1, (gint)widget->allocation.width - (gint)attributes.x * 2); - attributes.height = MAX (1, (gint)widget->allocation.height - (gint)attributes.y * 2); - - attributes.cursor = gdk_cursor_new_for_display (gtk_widget_get_display (widget), GDK_XTERM); - attributes_mask |= GDK_WA_CURSOR; - - text->text_area = gdk_window_new (widget->window, &attributes, attributes_mask); - gdk_window_set_user_data (text->text_area, text); - - gdk_cursor_unref (attributes.cursor); /* The X server will keep it around as long as necessary */ - - widget->style = gtk_style_attach (widget->style, widget->window); - - /* Can't call gtk_style_set_background here because it's handled specially */ - gdk_window_set_background (widget->window, &widget->style->base[gtk_widget_get_state (widget)]); - gdk_window_set_background (text->text_area, &widget->style->base[gtk_widget_get_state (widget)]); - - if (widget->style->bg_pixmap[GTK_STATE_NORMAL]) - text->bg_gc = create_bg_gc (text); - - text->line_wrap_bitmap = gdk_bitmap_create_from_data (text->text_area, - (gchar*) line_wrap_bits, - line_wrap_width, - line_wrap_height); - - text->line_arrow_bitmap = gdk_bitmap_create_from_data (text->text_area, - (gchar*) line_arrow_bits, - line_arrow_width, - line_arrow_height); - - text->gc = gdk_gc_new (text->text_area); - gdk_gc_set_exposures (text->gc, TRUE); - gdk_gc_set_foreground (text->gc, &widget->style->text[GTK_STATE_NORMAL]); - - realize_properties (text); - gdk_window_show (text->text_area); - init_properties (text); - - if (old_editable->selection_start_pos != old_editable->selection_end_pos) - gtk_old_editable_claim_selection (old_editable, TRUE, GDK_CURRENT_TIME); - - recompute_geometry (text); -} - -static void -gtk_text_style_set (GtkWidget *widget, - GtkStyle *previous_style) -{ - GtkText *text = GTK_TEXT (widget); - - if (gtk_widget_get_realized (widget)) - { - gdk_window_set_background (widget->window, &widget->style->base[gtk_widget_get_state (widget)]); - gdk_window_set_background (text->text_area, &widget->style->base[gtk_widget_get_state (widget)]); - - if (text->bg_gc) - { - g_object_unref (text->bg_gc); - text->bg_gc = NULL; - } - - if (widget->style->bg_pixmap[GTK_STATE_NORMAL]) - text->bg_gc = create_bg_gc (text); - - recompute_geometry (text); - } - - if (text->current_font) - text_font_unref (text->current_font); - text->current_font = get_text_font (gtk_style_get_font (widget->style)); -} - -static void -gtk_text_state_changed (GtkWidget *widget, - GtkStateType previous_state) -{ - GtkText *text = GTK_TEXT (widget); - - if (gtk_widget_get_realized (widget)) - { - gdk_window_set_background (widget->window, &widget->style->base[gtk_widget_get_state (widget)]); - gdk_window_set_background (text->text_area, &widget->style->base[gtk_widget_get_state (widget)]); - } -} - -static void -gtk_text_unrealize (GtkWidget *widget) -{ - GtkText *text = GTK_TEXT (widget); - - gdk_window_set_user_data (text->text_area, NULL); - gdk_window_destroy (text->text_area); - text->text_area = NULL; - - g_object_unref (text->gc); - text->gc = NULL; - - if (text->bg_gc) - { - g_object_unref (text->bg_gc); - text->bg_gc = NULL; - } - - g_object_unref (text->line_wrap_bitmap); - g_object_unref (text->line_arrow_bitmap); - - unrealize_properties (text); - - free_cache (text); - - GTK_WIDGET_CLASS (parent_class)->unrealize (widget); -} - -static void -clear_focus_area (GtkText *text, gint area_x, gint area_y, gint area_width, gint area_height) -{ - GtkWidget *widget = GTK_WIDGET (text); - GdkGC *gc; - - gint ythick = TEXT_BORDER_ROOM + widget->style->ythickness; - gint xthick = TEXT_BORDER_ROOM + widget->style->xthickness; - - gint width, height; - - if (area_width == 0 || area_height == 0) - return; - - if (widget->style->bg_pixmap[GTK_STATE_NORMAL]) - { - gdk_drawable_get_size (widget->style->bg_pixmap[GTK_STATE_NORMAL], &width, &height); - - gdk_gc_set_ts_origin (text->bg_gc, - (- text->first_onscreen_hor_pixel + xthick) % width, - (- text->first_onscreen_ver_pixel + ythick) % height); - - gc = text->bg_gc; - } - else - gc = widget->style->base_gc[widget->state]; - - gdk_draw_rectangle (GTK_WIDGET (text)->window, gc, TRUE, - area_x, area_y, area_width, area_height); -} - -static void -gtk_text_draw_focus (GtkWidget *widget) -{ - GtkText *text; - gint width, height; - gint x, y; - - g_return_if_fail (GTK_IS_TEXT (widget)); - - text = GTK_TEXT (widget); - - if (GTK_WIDGET_DRAWABLE (widget)) - { - gint ythick = widget->style->ythickness; - gint xthick = widget->style->xthickness; - gint xextra = TEXT_BORDER_ROOM; - gint yextra = TEXT_BORDER_ROOM; - - TDEBUG (("in gtk_text_draw_focus\n")); - - x = 0; - y = 0; - width = widget->allocation.width; - height = widget->allocation.height; - - if (gtk_widget_has_focus (widget)) - { - x += 1; - y += 1; - width -= 2; - height -= 2; - xextra -= 1; - yextra -= 1; - - gtk_paint_focus (widget->style, widget->window, gtk_widget_get_state (widget), - NULL, widget, "text", - 0, 0, - widget->allocation.width, - widget->allocation.height); - } - - gtk_paint_shadow (widget->style, widget->window, - GTK_STATE_NORMAL, GTK_SHADOW_IN, - NULL, widget, "text", - x, y, width, height); - - x += xthick; - y += ythick; - width -= 2 * xthick; - height -= 2 * ythick; - - /* top rect */ - clear_focus_area (text, x, y, width, yextra); - /* left rect */ - clear_focus_area (text, x, y + yextra, - xextra, y + height - 2 * yextra); - /* right rect */ - clear_focus_area (text, x + width - xextra, y + yextra, - xextra, height - 2 * ythick); - /* bottom rect */ - clear_focus_area (text, x, x + height - yextra, width, yextra); - } - else - { - TDEBUG (("in gtk_text_draw_focus (undrawable !!!)\n")); - } -} - -static void -gtk_text_size_request (GtkWidget *widget, - GtkRequisition *requisition) -{ - GdkFont *font; - gint xthickness; - gint ythickness; - gint char_height; - gint char_width; - - xthickness = widget->style->xthickness + TEXT_BORDER_ROOM; - ythickness = widget->style->ythickness + TEXT_BORDER_ROOM; - - font = gtk_style_get_font (widget->style); - - char_height = MIN_TEXT_HEIGHT_LINES * (font->ascent + - font->descent); - - char_width = MIN_TEXT_WIDTH_LINES * (gdk_text_width (font, - "ABCDEFGHIJKLMNOPQRSTUVWXYZ", - 26) - / 26); - - requisition->width = char_width + xthickness * 2; - requisition->height = char_height + ythickness * 2; -} - -static void -gtk_text_size_allocate (GtkWidget *widget, - GtkAllocation *allocation) -{ - GtkText *text = GTK_TEXT (widget); - - widget->allocation = *allocation; - if (gtk_widget_get_realized (widget)) - { - gdk_window_move_resize (widget->window, - allocation->x, allocation->y, - allocation->width, allocation->height); - - gdk_window_move_resize (text->text_area, - widget->style->xthickness + TEXT_BORDER_ROOM, - widget->style->ythickness + TEXT_BORDER_ROOM, - MAX (1, (gint)widget->allocation.width - (gint)(widget->style->xthickness + - (gint)TEXT_BORDER_ROOM) * 2), - MAX (1, (gint)widget->allocation.height - (gint)(widget->style->ythickness + - (gint)TEXT_BORDER_ROOM) * 2)); - - recompute_geometry (text); - } -} - -static gint -gtk_text_expose (GtkWidget *widget, - GdkEventExpose *event) -{ - if (event->window == GTK_TEXT (widget)->text_area) - { - TDEBUG (("in gtk_text_expose (expose)\n")); - expose_text (GTK_TEXT (widget), &event->area, TRUE); - } - else if (event->count == 0) - { - TDEBUG (("in gtk_text_expose (focus)\n")); - gtk_text_draw_focus (widget); - } - - return FALSE; -} - -static gint -gtk_text_scroll_timeout (gpointer data) -{ - GtkText *text; - gint x, y; - GdkModifierType mask; - - text = GTK_TEXT (data); - - text->timer = 0; - gdk_window_get_pointer (text->text_area, &x, &y, &mask); - - if (mask & (GDK_BUTTON1_MASK | GDK_BUTTON3_MASK)) - { - GdkEvent *event = gdk_event_new (GDK_MOTION_NOTIFY); - - event->motion.is_hint = 0; - event->motion.x = x; - event->motion.y = y; - event->motion.state = mask; - - gtk_text_motion_notify (GTK_WIDGET (text), (GdkEventMotion *)event); - - gdk_event_free (event); - } - - return FALSE; -} - -static gint -gtk_text_button_press (GtkWidget *widget, - GdkEventButton *event) -{ - GtkText *text = GTK_TEXT (widget); - GtkOldEditable *old_editable = GTK_OLD_EDITABLE (widget); - - if (text->button && (event->button != text->button)) - return FALSE; - - text->button = event->button; - - if (!gtk_widget_has_focus (widget)) - gtk_widget_grab_focus (widget); - - if (event->button == 1) - { - switch (event->type) - { - case GDK_BUTTON_PRESS: - gtk_grab_add (widget); - - undraw_cursor (text, FALSE); - find_mouse_cursor (text, (gint)event->x, (gint)event->y); - draw_cursor (text, FALSE); - - /* Set it now, so we display things right. We'll unset it - * later if things don't work out */ - old_editable->has_selection = TRUE; - gtk_text_set_selection (GTK_OLD_EDITABLE (text), - text->cursor_mark.index, - text->cursor_mark.index); - - break; - - case GDK_2BUTTON_PRESS: - gtk_text_select_word (text, event->time); - break; - - case GDK_3BUTTON_PRESS: - gtk_text_select_line (text, event->time); - break; - - default: - break; - } - } - else if (event->type == GDK_BUTTON_PRESS) - { - if ((event->button == 2) && old_editable->editable) - { - if (old_editable->selection_start_pos == old_editable->selection_end_pos || - old_editable->has_selection) - { - undraw_cursor (text, FALSE); - find_mouse_cursor (text, (gint)event->x, (gint)event->y); - draw_cursor (text, FALSE); - - } - - gtk_selection_convert (widget, GDK_SELECTION_PRIMARY, - gdk_atom_intern_static_string ("UTF8_STRING"), - event->time); - } - else - { - GdkDisplay *display = gtk_widget_get_display (widget); - - gtk_grab_add (widget); - - undraw_cursor (text, FALSE); - find_mouse_cursor (text, event->x, event->y); - draw_cursor (text, FALSE); - - gtk_text_set_selection (GTK_OLD_EDITABLE (text), - text->cursor_mark.index, - text->cursor_mark.index); - - old_editable->has_selection = FALSE; - if (gdk_selection_owner_get_for_display (display, - GDK_SELECTION_PRIMARY) == widget->window) - gtk_selection_owner_set_for_display (display, - NULL, - GDK_SELECTION_PRIMARY, - event->time); - } - } - - return TRUE; -} - -static gint -gtk_text_button_release (GtkWidget *widget, - GdkEventButton *event) -{ - GtkText *text = GTK_TEXT (widget); - GtkOldEditable *old_editable; - GdkDisplay *display; - - gtk_grab_remove (widget); - - if (text->button != event->button) - return FALSE; - - text->button = 0; - - if (text->timer) - { - g_source_remove (text->timer); - text->timer = 0; - } - - if (event->button == 1) - { - text = GTK_TEXT (widget); - old_editable = GTK_OLD_EDITABLE (widget); - display = gtk_widget_get_display (widget); - - gtk_grab_remove (widget); - - old_editable->has_selection = FALSE; - if (old_editable->selection_start_pos != old_editable->selection_end_pos) - { - if (gtk_selection_owner_set_for_display (display, - widget, - GDK_SELECTION_PRIMARY, - event->time)) - old_editable->has_selection = TRUE; - else - gtk_text_update_text (old_editable, old_editable->selection_start_pos, - old_editable->selection_end_pos); - } - else - { - if (gdk_selection_owner_get_for_display (display, - GDK_SELECTION_PRIMARY) == widget->window) - gtk_selection_owner_set_for_display (display, - NULL, - GDK_SELECTION_PRIMARY, - event->time); - } - } - else if (event->button == 3) - { - gtk_grab_remove (widget); - } - - undraw_cursor (text, FALSE); - find_cursor (text, TRUE); - draw_cursor (text, FALSE); - - return TRUE; -} - -static gint -gtk_text_motion_notify (GtkWidget *widget, - GdkEventMotion *event) -{ - GtkText *text = GTK_TEXT (widget); - gint x, y; - gint height; - GdkModifierType mask; - - x = event->x; - y = event->y; - mask = event->state; - if (event->is_hint || (text->text_area != event->window)) - { - gdk_window_get_pointer (text->text_area, &x, &y, &mask); - } - - if ((text->button == 0) || - !(mask & (GDK_BUTTON1_MASK | GDK_BUTTON3_MASK))) - return FALSE; - - gdk_drawable_get_size (text->text_area, NULL, &height); - - if ((y < 0) || (y > height)) - { - if (text->timer == 0) - { - text->timer = gdk_threads_add_timeout (SCROLL_TIME, - gtk_text_scroll_timeout, - text); - - if (y < 0) - scroll_int (text, y/2); - else - scroll_int (text, (y - height)/2); - } - else - return FALSE; - } - - undraw_cursor (GTK_TEXT (widget), FALSE); - find_mouse_cursor (GTK_TEXT (widget), x, y); - draw_cursor (GTK_TEXT (widget), FALSE); - - gtk_text_set_selection (GTK_OLD_EDITABLE (text), - GTK_OLD_EDITABLE (text)->selection_start_pos, - text->cursor_mark.index); - - return FALSE; -} - -static void -gtk_text_insert_text (GtkEditable *editable, - const gchar *new_text, - gint new_text_length, - gint *position) -{ - GtkText *text = GTK_TEXT (editable); - GdkFont *font; - GdkColor *fore, *back; - - TextProperty *property; - - gtk_text_set_point (text, *position); - - property = MARK_CURRENT_PROPERTY (&text->point); - font = property->flags & PROPERTY_FONT ? property->font->gdk_font : NULL; - fore = property->flags & PROPERTY_FOREGROUND ? &property->fore_color : NULL; - back = property->flags & PROPERTY_BACKGROUND ? &property->back_color : NULL; - - gtk_text_insert (text, font, fore, back, new_text, new_text_length); - - *position = text->point.index; -} - -static void -gtk_text_delete_text (GtkEditable *editable, - gint start_pos, - gint end_pos) -{ - GtkText *text = GTK_TEXT (editable); - - g_return_if_fail (start_pos >= 0); - - gtk_text_set_point (text, start_pos); - if (end_pos < 0) - end_pos = TEXT_LENGTH (text); - - if (end_pos > start_pos) - gtk_text_forward_delete (text, end_pos - start_pos); -} - -static gint -gtk_text_key_press (GtkWidget *widget, - GdkEventKey *event) -{ - GtkText *text = GTK_TEXT (widget); - GtkOldEditable *old_editable = GTK_OLD_EDITABLE (widget); - gchar key; - gint return_val; - gint position; - - key = event->keyval; - return_val = TRUE; - - if ((GTK_OLD_EDITABLE(text)->editable == FALSE)) - { - switch (event->keyval) - { - case GDK_Home: - case GDK_KP_Home: - if (event->state & GDK_CONTROL_MASK) - scroll_int (text, -text->vadj->value); - else - return_val = FALSE; - break; - case GDK_End: - case GDK_KP_End: - if (event->state & GDK_CONTROL_MASK) - scroll_int (text, +text->vadj->upper); - else - return_val = FALSE; - break; - case GDK_KP_Page_Up: - case GDK_Page_Up: scroll_int (text, -text->vadj->page_increment); break; - case GDK_KP_Page_Down: - case GDK_Page_Down: scroll_int (text, +text->vadj->page_increment); break; - case GDK_KP_Up: - case GDK_Up: scroll_int (text, -KEY_SCROLL_PIXELS); break; - 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"); - else - return_val = FALSE; - break; - default: - return_val = FALSE; - break; - } - } - else - { - gint extend_selection; - gint extend_start; - guint initial_pos = old_editable->current_pos; - - text->point = find_mark (text, text->cursor_mark.index); - - extend_selection = event->state & GDK_SHIFT_MASK; - extend_start = FALSE; - - if (extend_selection) - { - old_editable->has_selection = TRUE; - - if (old_editable->selection_start_pos == old_editable->selection_end_pos) - { - old_editable->selection_start_pos = text->point.index; - old_editable->selection_end_pos = text->point.index; - } - - extend_start = (text->point.index == old_editable->selection_start_pos); - } - - switch (event->keyval) - { - case GDK_KP_Home: - case GDK_Home: - if (event->state & GDK_CONTROL_MASK) - move_cursor_buffer_ver (text, -1); - else - gtk_text_move_beginning_of_line (text); - break; - case GDK_KP_End: - case GDK_End: - if (event->state & GDK_CONTROL_MASK) - move_cursor_buffer_ver (text, +1); - else - gtk_text_move_end_of_line (text); - break; - case GDK_KP_Page_Up: - case GDK_Page_Up: move_cursor_page_ver (text, -1); break; - case GDK_KP_Page_Down: - case GDK_Page_Down: move_cursor_page_ver (text, +1); break; - /* CUA has Ctrl-Up/Ctrl-Down as paragraph up down */ - case GDK_KP_Up: - case GDK_Up: move_cursor_ver (text, -1); break; - case GDK_KP_Down: - case GDK_Down: move_cursor_ver (text, +1); break; - case GDK_KP_Left: - case GDK_Left: - if (event->state & GDK_CONTROL_MASK) - gtk_text_move_backward_word (text); - else - move_cursor_hor (text, -1); - break; - case GDK_KP_Right: - case GDK_Right: - if (event->state & GDK_CONTROL_MASK) - gtk_text_move_forward_word (text); - else - move_cursor_hor (text, +1); - break; - - case GDK_BackSpace: - if (event->state & GDK_CONTROL_MASK) - gtk_text_delete_backward_word (text); - else - gtk_text_delete_backward_character (text); - break; - case GDK_Clear: - gtk_text_delete_line (text); - break; - case GDK_KP_Insert: - case GDK_Insert: - if (event->state & GDK_SHIFT_MASK) - { - extend_selection = FALSE; - gtk_editable_paste_clipboard (GTK_EDITABLE (old_editable)); - } - else if (event->state & GDK_CONTROL_MASK) - { - gtk_editable_copy_clipboard (GTK_EDITABLE (old_editable)); - } - else - { - /* gtk_toggle_insert(text) -- IMPLEMENT */ - } - break; - case GDK_Delete: - case GDK_KP_Delete: - if (event->state & GDK_CONTROL_MASK) - gtk_text_delete_forward_word (text); - else if (event->state & GDK_SHIFT_MASK) - { - extend_selection = FALSE; - gtk_editable_cut_clipboard (GTK_EDITABLE (old_editable)); - } - else - gtk_text_delete_forward_character (text); - break; - case GDK_Tab: - case GDK_ISO_Left_Tab: - case GDK_KP_Tab: - position = text->point.index; - 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"); - else - { - position = text->point.index; - gtk_editable_insert_text (GTK_EDITABLE (old_editable), "\n", 1, &position); - } - break; - case GDK_Escape: - /* Don't insert literally */ - return_val = FALSE; - break; - - default: - return_val = FALSE; - - if (event->state & GDK_CONTROL_MASK) - { - return_val = TRUE; - if ((key >= 'A') && (key <= 'Z')) - key -= 'A' - 'a'; - - switch (key) - { - case 'a': - gtk_text_move_beginning_of_line (text); - break; - case 'b': - gtk_text_move_backward_character (text); - break; - case 'c': - gtk_editable_copy_clipboard (GTK_EDITABLE (text)); - break; - case 'd': - gtk_text_delete_forward_character (text); - break; - case 'e': - gtk_text_move_end_of_line (text); - break; - case 'f': - gtk_text_move_forward_character (text); - break; - case 'h': - gtk_text_delete_backward_character (text); - break; - case 'k': - gtk_text_delete_to_line_end (text); - break; - case 'n': - gtk_text_move_next_line (text); - break; - case 'p': - gtk_text_move_previous_line (text); - break; - case 'u': - gtk_text_delete_line (text); - break; - case 'v': - gtk_editable_paste_clipboard (GTK_EDITABLE (text)); - break; - case 'w': - gtk_text_delete_backward_word (text); - break; - case 'x': - gtk_editable_cut_clipboard (GTK_EDITABLE (text)); - break; - default: - return_val = FALSE; - } - - break; - } - else if (event->state & GDK_MOD1_MASK) - { - return_val = TRUE; - if ((key >= 'A') && (key <= 'Z')) - key -= 'A' - 'a'; - - switch (key) - { - case 'b': - gtk_text_move_backward_word (text); - break; - case 'd': - gtk_text_delete_forward_word (text); - break; - case 'f': - gtk_text_move_forward_word (text); - break; - default: - return_val = FALSE; - } - - break; - } - else if (event->length > 0) - { - extend_selection = FALSE; - - gtk_editable_delete_selection (GTK_EDITABLE (old_editable)); - position = text->point.index; - gtk_editable_insert_text (GTK_EDITABLE (old_editable), event->string, event->length, &position); - - return_val = TRUE; - } - } - - if (return_val && (old_editable->current_pos != initial_pos)) - { - if (extend_selection) - { - if (old_editable->current_pos < old_editable->selection_start_pos) - gtk_text_set_selection (old_editable, old_editable->current_pos, - old_editable->selection_end_pos); - else if (old_editable->current_pos > old_editable->selection_end_pos) - gtk_text_set_selection (old_editable, old_editable->selection_start_pos, - old_editable->current_pos); - else - { - if (extend_start) - gtk_text_set_selection (old_editable, old_editable->current_pos, - old_editable->selection_end_pos); - else - gtk_text_set_selection (old_editable, old_editable->selection_start_pos, - old_editable->current_pos); - } - } - else - gtk_text_set_selection (old_editable, 0, 0); - - gtk_old_editable_claim_selection (old_editable, - old_editable->selection_start_pos != old_editable->selection_end_pos, - event->time); - } - } - - return return_val; -} - -static void -gtk_text_adjustment (GtkAdjustment *adjustment, - GtkText *text) -{ - g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment)); - g_return_if_fail (GTK_IS_TEXT (text)); - - /* Just ignore it if we haven't been size-allocated and realized yet */ - if (text->line_start_cache == NULL) - return; - - if (adjustment == text->hadj) - { - g_warning ("horizontal scrolling not implemented"); - } - else - { - gint diff = ((gint)adjustment->value) - text->last_ver_value; - - if (diff != 0) - { - undraw_cursor (text, FALSE); - - if (diff > 0) - scroll_down (text, diff); - else /* if (diff < 0) */ - scroll_up (text, diff); - - draw_cursor (text, FALSE); - - text->last_ver_value = adjustment->value; - } - } -} - -static void -gtk_text_adjustment_destroyed (GtkAdjustment *adjustment, - GtkText *text) -{ - g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment)); - g_return_if_fail (GTK_IS_TEXT (text)); - - if (adjustment == text->hadj) - gtk_text_set_adjustments (text, NULL, text->vadj); - if (adjustment == text->vadj) - gtk_text_set_adjustments (text, text->hadj, NULL); -} - - -static GtkPropertyMark -find_this_line_start_mark (GtkText* text, guint point_position, const GtkPropertyMark* near) -{ - GtkPropertyMark mark; - - mark = find_mark_near (text, point_position, near); - - while (mark.index > 0 && - GTK_TEXT_INDEX (text, mark.index - 1) != LINE_DELIM) - decrement_mark (&mark); - - return mark; -} - -static void -init_tab_cont (GtkText* text, PrevTabCont* tab_cont) -{ - tab_cont->pixel_offset = 0; - tab_cont->tab_start.tab_stops = text->tab_stops; - tab_cont->tab_start.to_next_tab = (gintptr) text->tab_stops->data; - - if (!tab_cont->tab_start.to_next_tab) - tab_cont->tab_start.to_next_tab = text->default_tab_width; -} - -static void -line_params_iterate (GtkText* text, - const GtkPropertyMark* mark0, - const PrevTabCont* tab_mark0, - gint8 alloc, - void* data, - LineIteratorFunction iter) - /* mark0 MUST be a real line start. if ALLOC, allocate line params - * from a mem chunk. DATA is passed to ITER_CALL, which is called - * for each line following MARK, iteration continues unless ITER_CALL - * returns TRUE. */ -{ - GtkPropertyMark mark = *mark0; - PrevTabCont tab_conts[2]; - LineParams *lp, lpbuf; - gint tab_cont_index = 0; - - if (tab_mark0) - tab_conts[0] = *tab_mark0; - else - init_tab_cont (text, tab_conts); - - for (;;) - { - if (alloc) - lp = g_slice_new (LineParams); - else - lp = &lpbuf; - - *lp = find_line_params (text, &mark, tab_conts + tab_cont_index, - tab_conts + (tab_cont_index + 1) % 2); - - if ((*iter) (text, lp, data)) - return; - - if (LAST_INDEX (text, lp->end)) - break; - - mark = lp->end; - advance_mark (&mark); - tab_cont_index = (tab_cont_index + 1) % 2; - } -} - -static gint -fetch_lines_iterator (GtkText* text, LineParams* lp, void* data) -{ - FetchLinesData *fldata = (FetchLinesData*) data; - - fldata->new_lines = g_list_prepend (fldata->new_lines, lp); - - switch (fldata->fl_type) - { - case FetchLinesCount: - if (!text->line_wrap || !lp->wraps) - fldata->data += 1; - - if (fldata->data >= fldata->data_max) - return TRUE; - - break; - case FetchLinesPixels: - - fldata->data += LINE_HEIGHT(*lp); - - if (fldata->data >= fldata->data_max) - return TRUE; - - break; - } - - return FALSE; -} - -static GList* -fetch_lines (GtkText* text, - const GtkPropertyMark* mark0, - const PrevTabCont* tab_cont0, - FLType fl_type, - gint data) -{ - FetchLinesData fl_data; - - fl_data.new_lines = NULL; - fl_data.data = 0; - fl_data.data_max = data; - fl_data.fl_type = fl_type; - - line_params_iterate (text, mark0, tab_cont0, TRUE, &fl_data, fetch_lines_iterator); - - return g_list_reverse (fl_data.new_lines); -} - -static void -fetch_lines_backward (GtkText* text) -{ - GList *new_line_start; - GtkPropertyMark mark; - - if (CACHE_DATA(text->line_start_cache).start.index == 0) - return; - - mark = find_this_line_start_mark (text, - CACHE_DATA(text->line_start_cache).start.index - 1, - &CACHE_DATA(text->line_start_cache).start); - - new_line_start = fetch_lines (text, &mark, NULL, FetchLinesCount, 1); - - while (new_line_start->next) - new_line_start = new_line_start->next; - - new_line_start->next = text->line_start_cache; - text->line_start_cache->prev = new_line_start; -} - -static void -fetch_lines_forward (GtkText* text, gint line_count) -{ - GtkPropertyMark mark; - GList* line = text->line_start_cache; - - while(line->next) - line = line->next; - - mark = CACHE_DATA(line).end; - - if (LAST_INDEX (text, mark)) - return; - - advance_mark(&mark); - - line->next = fetch_lines (text, &mark, &CACHE_DATA(line).tab_cont_next, FetchLinesCount, line_count); - - if (line->next) - line->next->prev = line; -} - -/* Compute the number of lines, and vertical pixels for n characters - * starting from the point - */ -static void -compute_lines_pixels (GtkText* text, guint char_count, - guint *lines, guint *pixels) -{ - GList *line = text->current_line; - gint chars_left = char_count; - - *lines = 0; - *pixels = 0; - - /* If chars_left == 0, that means we're joining two lines in a - * deletion, so add in the values for the next line as well - */ - for (; line && chars_left >= 0; line = line->next) - { - *pixels += LINE_HEIGHT(CACHE_DATA(line)); - - if (line == text->current_line) - chars_left -= CACHE_DATA(line).end.index - text->point.index + 1; - else - chars_left -= CACHE_DATA(line).end.index - CACHE_DATA(line).start.index + 1; - - if (!text->line_wrap || !CACHE_DATA(line).wraps) - *lines += 1; - else - if (chars_left < 0) - chars_left = 0; /* force another loop */ - - if (!line->next) - fetch_lines_forward (text, 1); - } -} - -static gint -total_line_height (GtkText* text, GList* line, gint line_count) -{ - gint height = 0; - - for (; line && line_count > 0; line = line->next) - { - height += LINE_HEIGHT(CACHE_DATA(line)); - - if (!text->line_wrap || !CACHE_DATA(line).wraps) - line_count -= 1; - - if (!line->next) - fetch_lines_forward (text, line_count); - } - - return height; -} - -static void -swap_lines (GtkText* text, GList* old, GList* new, guint old_line_count) -{ - if (old == text->line_start_cache) - { - GList* last; - - for (; old_line_count > 0; old_line_count -= 1) - { - while (text->line_start_cache && - text->line_wrap && - CACHE_DATA(text->line_start_cache).wraps) - remove_cache_line(text, text->line_start_cache); - - remove_cache_line(text, text->line_start_cache); - } - - last = g_list_last (new); - - last->next = text->line_start_cache; - - if (text->line_start_cache) - text->line_start_cache->prev = last; - - text->line_start_cache = new; - } - else - { - GList *last; - - g_assert (old->prev); - - last = old->prev; - - for (; old_line_count > 0; old_line_count -= 1) - { - while (old && text->line_wrap && CACHE_DATA(old).wraps) - old = remove_cache_line (text, old); - - old = remove_cache_line (text, old); - } - - last->next = new; - new->prev = last; - - last = g_list_last (new); - - last->next = old; - - if (old) - old->prev = last; - } -} - -static void -correct_cache_delete (GtkText* text, gint nchars, gint lines) -{ - GList* cache = text->current_line; - gint i; - - for (i = 0; cache && i < lines; i += 1, cache = cache->next) - /* nothing */; - - for (; cache; cache = cache->next) - { - GtkPropertyMark *start = &CACHE_DATA(cache).start; - GtkPropertyMark *end = &CACHE_DATA(cache).end; - - start->index -= nchars; - end->index -= nchars; - - if (LAST_INDEX (text, text->point) && - start->index == text->point.index) - *start = text->point; - else if (start->property == text->point.property) - start->offset = start->index - (text->point.index - text->point.offset); - - if (LAST_INDEX (text, text->point) && - end->index == text->point.index) - *end = text->point; - if (end->property == text->point.property) - end->offset = end->index - (text->point.index - text->point.offset); - - /*TEXT_ASSERT_MARK(text, start, "start");*/ - /*TEXT_ASSERT_MARK(text, end, "end");*/ - } -} - -static void -delete_expose (GtkText* text, guint nchars, guint old_lines, guint old_pixels) -{ - GtkWidget *widget = GTK_WIDGET (text); - - gint pixel_height; - guint new_pixels = 0; - GdkRectangle rect; - GList* new_line = NULL; - gint width, height; - - text->cursor_virtual_x = 0; - - correct_cache_delete (text, nchars, old_lines); - - pixel_height = pixel_height_of(text, text->current_line) - - LINE_HEIGHT(CACHE_DATA(text->current_line)); - - if (CACHE_DATA(text->current_line).start.index == text->point.index) - CACHE_DATA(text->current_line).start = text->point; - - new_line = fetch_lines (text, - &CACHE_DATA(text->current_line).start, - &CACHE_DATA(text->current_line).tab_cont, - FetchLinesCount, - 1); - - swap_lines (text, text->current_line, new_line, old_lines); - - text->current_line = new_line; - - new_pixels = total_line_height (text, new_line, 1); - - gdk_drawable_get_size (text->text_area, &width, &height); - - if (old_pixels != new_pixels) - { - if (!widget->style->bg_pixmap[GTK_STATE_NORMAL]) - { - gdk_draw_drawable (text->text_area, - text->gc, - text->text_area, - 0, - pixel_height + old_pixels, - 0, - pixel_height + new_pixels, - width, - height); - } - text->vadj->upper += new_pixels; - text->vadj->upper -= old_pixels; - adjust_adj (text, text->vadj); - } - - rect.x = 0; - rect.y = pixel_height; - rect.width = width; - rect.height = new_pixels; - - expose_text (text, &rect, FALSE); - gtk_text_draw_focus ( (GtkWidget *) text); - - text->cursor_mark = text->point; - - find_cursor (text, TRUE); - - if (old_pixels != new_pixels) - { - if (widget->style->bg_pixmap[GTK_STATE_NORMAL]) - { - rect.x = 0; - rect.y = pixel_height + new_pixels; - rect.width = width; - rect.height = height - rect.y; - - expose_text (text, &rect, FALSE); - } - else - process_exposes (text); - } - - TEXT_ASSERT (text); - TEXT_SHOW(text); -} - -/* note, the point has already been moved forward */ -static void -correct_cache_insert (GtkText* text, gint nchars) -{ - GList *cache; - GtkPropertyMark *start; - GtkPropertyMark *end; - gboolean was_split = FALSE; - - /* We need to distinguish whether the property was split in the - * insert or not, so we check if the point (which points after - * the insertion here), points to the same character as the - * point before. Ugh. - */ - if (nchars > 0) - { - GtkPropertyMark tmp_mark = text->point; - move_mark_n (&tmp_mark, -1); - - if (tmp_mark.property != text->point.property) - was_split = TRUE; - } - - /* If we inserted a property exactly at the beginning of the - * line, we have to correct here, or fetch_lines will - * fetch junk. - */ - start = &CACHE_DATA(text->current_line).start; - - /* Check if if we split exactly at the beginning of the line: - * (was_split won't be set if we are inserting at the end of the text, - * so we don't check) - */ - if (start->offset == MARK_CURRENT_PROPERTY (start)->length) - SET_PROPERTY_MARK (start, start->property->next, 0); - /* Check if we inserted a property at the beginning of the text: */ - else if (was_split && - (start->property == text->point.property) && - (start->index == text->point.index - nchars)) - SET_PROPERTY_MARK (start, start->property->prev, 0); - - /* Now correct the offsets, and check for start or end marks that - * are after the point, yet point to a property before the point's - * property. This indicates that they are meant to point to the - * second half of a property we split in insert_text_property(), so - * we fix them up that way. - */ - cache = text->current_line->next; - - for (; cache; cache = cache->next) - { - start = &CACHE_DATA(cache).start; - end = &CACHE_DATA(cache).end; - - if (LAST_INDEX (text, text->point) && - start->index == text->point.index) - *start = text->point; - else if (start->index >= text->point.index - nchars) - { - if (!was_split && start->property == text->point.property) - move_mark_n(start, nchars); - else - { - if (start->property->next && - (start->property->next->next == text->point.property)) - { - g_assert (start->offset >= MARK_CURRENT_PROPERTY (start)->length); - start->offset -= MARK_CURRENT_PROPERTY (start)->length; - start->property = text->point.property; - } - start->index += nchars; - } - } - - if (LAST_INDEX (text, text->point) && - end->index == text->point.index) - *end = text->point; - if (end->index >= text->point.index - nchars) - { - if (!was_split && end->property == text->point.property) - move_mark_n(end, nchars); - else - { - if (end->property->next && - (end->property->next->next == text->point.property)) - { - g_assert (end->offset >= MARK_CURRENT_PROPERTY (end)->length); - end->offset -= MARK_CURRENT_PROPERTY (end)->length; - end->property = text->point.property; - } - end->index += nchars; - } - } - - /*TEXT_ASSERT_MARK(text, start, "start");*/ - /*TEXT_ASSERT_MARK(text, end, "end");*/ - } -} - - -static void -insert_expose (GtkText* text, guint old_pixels, gint nchars, - guint new_line_count) -{ - GtkWidget *widget = GTK_WIDGET (text); - - gint pixel_height; - guint new_pixels = 0; - GdkRectangle rect; - GList* new_lines = NULL; - gint width, height; - - text->cursor_virtual_x = 0; - - undraw_cursor (text, FALSE); - - correct_cache_insert (text, nchars); - - TEXT_SHOW_ADJ (text, text->vadj, "vadj"); - - pixel_height = pixel_height_of(text, text->current_line) - - LINE_HEIGHT(CACHE_DATA(text->current_line)); - - new_lines = fetch_lines (text, - &CACHE_DATA(text->current_line).start, - &CACHE_DATA(text->current_line).tab_cont, - FetchLinesCount, - new_line_count); - - swap_lines (text, text->current_line, new_lines, 1); - - text->current_line = new_lines; - - new_pixels = total_line_height (text, new_lines, new_line_count); - - gdk_drawable_get_size (text->text_area, &width, &height); - - if (old_pixels != new_pixels) - { - if (!widget->style->bg_pixmap[GTK_STATE_NORMAL]) - { - gdk_draw_drawable (text->text_area, - text->gc, - text->text_area, - 0, - pixel_height + old_pixels, - 0, - pixel_height + new_pixels, - width, - height + (old_pixels - new_pixels) - pixel_height); - - } - text->vadj->upper += new_pixels; - text->vadj->upper -= old_pixels; - adjust_adj (text, text->vadj); - } - - rect.x = 0; - rect.y = pixel_height; - rect.width = width; - rect.height = new_pixels; - - expose_text (text, &rect, FALSE); - gtk_text_draw_focus ( (GtkWidget *) text); - - text->cursor_mark = text->point; - - find_cursor (text, TRUE); - - draw_cursor (text, FALSE); - - if (old_pixels != new_pixels) - { - if (widget->style->bg_pixmap[GTK_STATE_NORMAL]) - { - rect.x = 0; - rect.y = pixel_height + new_pixels; - rect.width = width; - rect.height = height - rect.y; - - expose_text (text, &rect, FALSE); - } - else - process_exposes (text); - } - - TEXT_SHOW_ADJ (text, text->vadj, "vadj"); - TEXT_ASSERT (text); - TEXT_SHOW(text); -} - -/* Text property functions */ - -static guint -font_hash (gconstpointer font) -{ - return gdk_font_id ((const GdkFont*) font); -} - -static GHashTable *font_cache_table = NULL; - -static GtkTextFont* -get_text_font (GdkFont* gfont) -{ - GtkTextFont* tf; - gint i; - - if (!font_cache_table) - font_cache_table = g_hash_table_new (font_hash, (GEqualFunc) gdk_font_equal); - - tf = g_hash_table_lookup (font_cache_table, gfont); - - if (tf) - { - tf->ref_count++; - return tf; - } - - tf = g_new (GtkTextFont, 1); - tf->ref_count = 1; - - tf->gdk_font = gfont; - gdk_font_ref (gfont); - - for(i = 0; i < 256; i += 1) - tf->char_widths[i] = gdk_char_width (gfont, (char)i); - - g_hash_table_insert (font_cache_table, gfont, tf); - - return tf; -} - -static void -text_font_unref (GtkTextFont *text_font) -{ - text_font->ref_count--; - if (text_font->ref_count == 0) - { - g_hash_table_remove (font_cache_table, text_font->gdk_font); - gdk_font_unref (text_font->gdk_font); - g_free (text_font); - } -} - -static gint -text_properties_equal (TextProperty* prop, GdkFont* font, const GdkColor *fore, const GdkColor *back) -{ - if (prop->flags & PROPERTY_FONT) - { - gboolean retval; - GtkTextFont *text_font; - - if (!font) - return FALSE; - - text_font = get_text_font (font); - - retval = (prop->font == text_font); - text_font_unref (text_font); - - if (!retval) - return FALSE; - } - else - if (font != NULL) - return FALSE; - - if (prop->flags & PROPERTY_FOREGROUND) - { - if (!fore || !gdk_color_equal (&prop->fore_color, fore)) - return FALSE; - } - else - if (fore != NULL) - return FALSE; - - if (prop->flags & PROPERTY_BACKGROUND) - { - if (!back || !gdk_color_equal (&prop->back_color, back)) - return FALSE; - } - else - if (back != NULL) - return FALSE; - - return TRUE; -} - -static void -realize_property (GtkText *text, TextProperty *prop) -{ - GdkColormap *colormap = gtk_widget_get_colormap (GTK_WIDGET (text)); - - if (prop->flags & PROPERTY_FOREGROUND) - gdk_colormap_alloc_color (colormap, &prop->fore_color, FALSE, FALSE); - - if (prop->flags & PROPERTY_BACKGROUND) - gdk_colormap_alloc_color (colormap, &prop->back_color, FALSE, FALSE); -} - -static void -realize_properties (GtkText *text) -{ - GList *tmp_list = text->text_properties; - - while (tmp_list) - { - realize_property (text, tmp_list->data); - - tmp_list = tmp_list->next; - } -} - -static void -unrealize_property (GtkText *text, TextProperty *prop) -{ - GdkColormap *colormap = gtk_widget_get_colormap (GTK_WIDGET (text)); - - if (prop->flags & PROPERTY_FOREGROUND) - gdk_colormap_free_colors (colormap, &prop->fore_color, 1); - - if (prop->flags & PROPERTY_BACKGROUND) - gdk_colormap_free_colors (colormap, &prop->back_color, 1); -} - -static void -unrealize_properties (GtkText *text) -{ - GList *tmp_list = text->text_properties; - - while (tmp_list) - { - unrealize_property (text, tmp_list->data); - - tmp_list = tmp_list->next; - } -} - -static TextProperty* -new_text_property (GtkText *text, GdkFont *font, const GdkColor* fore, - const GdkColor* back, guint length) -{ - TextProperty *prop; - - prop = g_slice_new (TextProperty); - - prop->flags = 0; - if (font) - { - prop->flags |= PROPERTY_FONT; - prop->font = get_text_font (font); - } - else - prop->font = NULL; - - if (fore) - { - prop->flags |= PROPERTY_FOREGROUND; - prop->fore_color = *fore; - } - - if (back) - { - prop->flags |= PROPERTY_BACKGROUND; - prop->back_color = *back; - } - - prop->length = length; - - if (gtk_widget_get_realized (GTK_WIDGET (text))) - realize_property (text, prop); - - return prop; -} - -static void -destroy_text_property (TextProperty *prop) -{ - if (prop->font) - text_font_unref (prop->font); - - g_slice_free (TextProperty, prop); -} - -/* Flop the memory between the point and the gap around like a - * dead fish. */ -static void -move_gap (GtkText* text, guint index) -{ - if (text->gap_position < index) - { - gint diff = index - text->gap_position; - - if (text->use_wchar) - g_memmove (text->text.wc + text->gap_position, - text->text.wc + text->gap_position + text->gap_size, - diff*sizeof (GdkWChar)); - else - g_memmove (text->text.ch + text->gap_position, - text->text.ch + text->gap_position + text->gap_size, - diff); - - text->gap_position = index; - } - else if (text->gap_position > index) - { - gint diff = text->gap_position - index; - - if (text->use_wchar) - g_memmove (text->text.wc + index + text->gap_size, - text->text.wc + index, - diff*sizeof (GdkWChar)); - else - g_memmove (text->text.ch + index + text->gap_size, - text->text.ch + index, - diff); - - text->gap_position = index; - } -} - -/* Increase the gap size. */ -static void -make_forward_space (GtkText* text, guint len) -{ - if (text->gap_size < len) - { - guint sum = MAX(2*len, MIN_GAP_SIZE) + text->text_end; - - if (sum >= text->text_len) - { - guint i = 1; - - while (i <= sum) i <<= 1; - - if (text->use_wchar) - text->text.wc = (GdkWChar *)g_realloc(text->text.wc, - i*sizeof(GdkWChar)); - else - text->text.ch = (guchar *)g_realloc(text->text.ch, i); - text->text_len = i; - } - - if (text->use_wchar) - g_memmove (text->text.wc + text->gap_position + text->gap_size + 2*len, - text->text.wc + text->gap_position + text->gap_size, - (text->text_end - (text->gap_position + text->gap_size)) - *sizeof(GdkWChar)); - else - g_memmove (text->text.ch + text->gap_position + text->gap_size + 2*len, - text->text.ch + text->gap_position + text->gap_size, - text->text_end - (text->gap_position + text->gap_size)); - - text->text_end += len*2; - text->gap_size += len*2; - } -} - -/* Inserts into the text property list a list element that guarantees - * that for len characters following the point, text has the correct - * property. does not move point. adjusts text_properties_point and - * text_properties_point_offset relative to the current value of - * point. */ -static void -insert_text_property (GtkText* text, GdkFont* font, - const GdkColor *fore, const GdkColor* back, guint len) -{ - GtkPropertyMark *mark = &text->point; - TextProperty* forward_prop = MARK_CURRENT_PROPERTY(mark); - TextProperty* backward_prop = MARK_PREV_PROPERTY(mark); - - if (MARK_OFFSET(mark) == 0) - { - /* Point is on the boundary of two properties. - * If it is the same as either, grow, else insert - * a new one. */ - - if (text_properties_equal(forward_prop, font, fore, back)) - { - /* Grow the property in front of us. */ - - MARK_PROPERTY_LENGTH(mark) += len; - } - else if (backward_prop && - text_properties_equal(backward_prop, font, fore, back)) - { - /* Grow property behind us, point property and offset - * change. */ - - SET_PROPERTY_MARK (&text->point, - MARK_PREV_LIST_PTR (mark), - backward_prop->length); - - backward_prop->length += len; - } - else if ((MARK_NEXT_LIST_PTR(mark) == NULL) && - (forward_prop->length == 1)) - { - /* Next property just has last position, take it over */ - - if (gtk_widget_get_realized (GTK_WIDGET (text))) - unrealize_property (text, forward_prop); - - forward_prop->flags = 0; - if (font) - { - forward_prop->flags |= PROPERTY_FONT; - forward_prop->font = get_text_font (font); - } - else - forward_prop->font = NULL; - - if (fore) - { - forward_prop->flags |= PROPERTY_FOREGROUND; - forward_prop->fore_color = *fore; - } - if (back) - { - forward_prop->flags |= PROPERTY_BACKGROUND; - forward_prop->back_color = *back; - } - forward_prop->length += len; - - if (gtk_widget_get_realized (GTK_WIDGET (text))) - realize_property (text, forward_prop); - } - else - { - /* Splice a new property into the list. */ - - GList* new_prop = g_list_alloc(); - - new_prop->next = MARK_LIST_PTR(mark); - new_prop->prev = MARK_PREV_LIST_PTR(mark); - new_prop->next->prev = new_prop; - - if (new_prop->prev) - new_prop->prev->next = new_prop; - - new_prop->data = new_text_property (text, font, fore, back, len); - - SET_PROPERTY_MARK (mark, new_prop, 0); - } - } - else - { - /* The following will screw up the line_start cache, - * we'll fix it up in correct_cache_insert - */ - - /* In the middle of forward_prop, if properties are equal, - * just add to its length, else split it into two and splice - * in a new one. */ - if (text_properties_equal (forward_prop, font, fore, back)) - { - forward_prop->length += len; - } - else if ((MARK_NEXT_LIST_PTR(mark) == NULL) && - (MARK_OFFSET(mark) + 1 == forward_prop->length)) - { - /* Inserting before only the last position in the text */ - - GList* new_prop; - forward_prop->length -= 1; - - new_prop = g_list_alloc(); - new_prop->data = new_text_property (text, font, fore, back, len+1); - new_prop->prev = MARK_LIST_PTR(mark); - new_prop->next = NULL; - MARK_NEXT_LIST_PTR(mark) = new_prop; - - SET_PROPERTY_MARK (mark, new_prop, 0); - } - else - { - GList* new_prop = g_list_alloc(); - GList* new_prop_forward = g_list_alloc(); - gint old_length = forward_prop->length; - GList* next = MARK_NEXT_LIST_PTR(mark); - - /* Set the new lengths according to where they are split. Construct - * two new properties. */ - forward_prop->length = MARK_OFFSET(mark); - - new_prop_forward->data = - new_text_property(text, - forward_prop->flags & PROPERTY_FONT ? - forward_prop->font->gdk_font : NULL, - forward_prop->flags & PROPERTY_FOREGROUND ? - &forward_prop->fore_color : NULL, - forward_prop->flags & PROPERTY_BACKGROUND ? - &forward_prop->back_color : NULL, - old_length - forward_prop->length); - - new_prop->data = new_text_property(text, font, fore, back, len); - - /* Now splice things in. */ - MARK_NEXT_LIST_PTR(mark) = new_prop; - new_prop->prev = MARK_LIST_PTR(mark); - - new_prop->next = new_prop_forward; - new_prop_forward->prev = new_prop; - - new_prop_forward->next = next; - - if (next) - next->prev = new_prop_forward; - - SET_PROPERTY_MARK (mark, new_prop, 0); - } - } - - while (text->text_properties_end->next) - text->text_properties_end = text->text_properties_end->next; - - while (text->text_properties->prev) - text->text_properties = text->text_properties->prev; -} - -static void -delete_text_property (GtkText* text, guint nchars) -{ - /* Delete nchars forward from point. */ - - /* Deleting text properties is problematical, because we - * might be storing around marks pointing to a property. - * - * The marks in question and how we handle them are: - * - * point: We know the new value, since it will be at the - * end of the deleted text, and we move it there - * first. - * cursor: We just remove the mark and set it equal to the - * point after the operation. - * line-start cache: We replace most affected lines. - * The current line gets used to fetch the new - * lines so, if necessary, (delete at the beginning - * of a line) we fix it up by setting it equal to the - * point. - */ - - TextProperty *prop; - GList *tmp; - gint is_first; - - for(; nchars; nchars -= 1) - { - prop = MARK_CURRENT_PROPERTY(&text->point); - - prop->length -= 1; - - if (prop->length == 0) - { - tmp = MARK_LIST_PTR (&text->point); - - is_first = tmp == text->text_properties; - - MARK_LIST_PTR (&text->point) = g_list_remove_link (tmp, tmp); - text->point.offset = 0; - - if (gtk_widget_get_realized (GTK_WIDGET (text))) - unrealize_property (text, prop); - - destroy_text_property (prop); - g_list_free_1 (tmp); - - prop = MARK_CURRENT_PROPERTY (&text->point); - - if (is_first) - text->text_properties = MARK_LIST_PTR (&text->point); - - g_assert (prop->length != 0); - } - else if (prop->length == text->point.offset) - { - MARK_LIST_PTR (&text->point) = MARK_NEXT_LIST_PTR (&text->point); - text->point.offset = 0; - } - } - - /* Check to see if we have just the single final position remaining - * along in a property; if so, combine it with the previous property - */ - if (LAST_INDEX (text, text->point) && - (MARK_OFFSET (&text->point) == 0) && - (MARK_PREV_LIST_PTR(&text->point) != NULL)) - { - tmp = MARK_LIST_PTR (&text->point); - prop = MARK_CURRENT_PROPERTY(&text->point); - - MARK_LIST_PTR (&text->point) = MARK_PREV_LIST_PTR (&text->point); - MARK_CURRENT_PROPERTY(&text->point)->length += 1; - MARK_NEXT_LIST_PTR(&text->point) = NULL; - - text->point.offset = MARK_CURRENT_PROPERTY(&text->point)->length - 1; - - if (gtk_widget_get_realized (GTK_WIDGET (text))) - unrealize_property (text, prop); - - destroy_text_property (prop); - g_list_free_1 (tmp); - } -} - -static void -init_properties (GtkText *text) -{ - if (!text->text_properties) - { - text->text_properties = g_list_alloc(); - text->text_properties->next = NULL; - text->text_properties->prev = NULL; - text->text_properties->data = new_text_property (text, NULL, NULL, NULL, 1); - text->text_properties_end = text->text_properties; - - SET_PROPERTY_MARK (&text->point, text->text_properties, 0); - - text->point.index = 0; - } -} - - -/**********************************************************************/ -/* Property Movement */ -/**********************************************************************/ - -static void -move_mark_n (GtkPropertyMark* mark, gint n) -{ - if (n > 0) - advance_mark_n(mark, n); - else if (n < 0) - decrement_mark_n(mark, -n); -} - -static void -advance_mark (GtkPropertyMark* mark) -{ - TextProperty* prop = MARK_CURRENT_PROPERTY (mark); - - mark->index += 1; - - if (prop->length > mark->offset + 1) - mark->offset += 1; - else - { - mark->property = MARK_NEXT_LIST_PTR (mark); - mark->offset = 0; - } -} - -static void -advance_mark_n (GtkPropertyMark* mark, gint n) -{ - gint i; - TextProperty* prop; - - g_assert (n > 0); - - i = 0; /* otherwise it migth not be init. */ - prop = MARK_CURRENT_PROPERTY(mark); - - if ((prop->length - mark->offset - 1) < n) { /* if we need to change prop. */ - /* to make it easier */ - n += (mark->offset); - mark->index -= mark->offset; - mark->offset = 0; - /* first we take seven-mile-leaps to get to the right text - * property. */ - while ((n-i) > prop->length - 1) { - i += prop->length; - mark->index += prop->length; - mark->property = MARK_NEXT_LIST_PTR (mark); - prop = MARK_CURRENT_PROPERTY (mark); - } - } - - /* and then the rest */ - mark->index += n - i; - mark->offset += n - i; -} - -static void -decrement_mark (GtkPropertyMark* mark) -{ - mark->index -= 1; - - if (mark->offset > 0) - mark->offset -= 1; - else - { - mark->property = MARK_PREV_LIST_PTR (mark); - mark->offset = MARK_CURRENT_PROPERTY (mark)->length - 1; - } -} - -static void -decrement_mark_n (GtkPropertyMark* mark, gint n) -{ - g_assert (n > 0); - - while (mark->offset < n) { - /* jump to end of prev */ - n -= mark->offset + 1; - mark->index -= mark->offset + 1; - mark->property = MARK_PREV_LIST_PTR (mark); - mark->offset = MARK_CURRENT_PROPERTY (mark)->length - 1; - } - - /* and the rest */ - mark->index -= n; - mark->offset -= n; -} - -static GtkPropertyMark -find_mark (GtkText* text, guint mark_position) -{ - return find_mark_near (text, mark_position, &text->point); -} - -/* - * You can also start from the end, what a drag. - */ -static GtkPropertyMark -find_mark_near (GtkText* text, guint mark_position, const GtkPropertyMark* near) -{ - gint diffa; - gint diffb; - - GtkPropertyMark mark; - - if (!near) - diffa = mark_position + 1; - else - diffa = mark_position - near->index; - - diffb = mark_position; - - if (diffa < 0) - diffa = -diffa; - - if (diffa <= diffb) - { - mark = *near; - } - else - { - mark.index = 0; - mark.property = text->text_properties; - mark.offset = 0; - } - - move_mark_n (&mark, mark_position - mark.index); - - return mark; -} - -/* This routine must be called with scroll == FALSE, only when - * point is at least partially on screen - */ - -static void -find_line_containing_point (GtkText* text, guint point, - gboolean scroll) -{ - GList* cache; - gint height; - - text->current_line = NULL; - - TEXT_SHOW (text); - - /* Scroll backwards until the point is on screen - */ - while (CACHE_DATA(text->line_start_cache).start.index > point) - scroll_int (text, - LINE_HEIGHT(CACHE_DATA(text->line_start_cache))); - - /* Now additionally try to make sure that the point is fully on screen - */ - if (scroll) - { - while (text->first_cut_pixels != 0 && - text->line_start_cache->next && - CACHE_DATA(text->line_start_cache->next).start.index > point) - scroll_int (text, - LINE_HEIGHT(CACHE_DATA(text->line_start_cache->next))); - } - - gdk_drawable_get_size (text->text_area, NULL, &height); - - for (cache = text->line_start_cache; cache; cache = cache->next) - { - guint lph; - - if (CACHE_DATA(cache).end.index >= point || - LAST_INDEX(text, CACHE_DATA(cache).end)) - { - text->current_line = cache; /* LOOK HERE, this proc has an - * important side effect. */ - return; - } - - TEXT_SHOW_LINE (text, cache, "cache"); - - if (cache->next == NULL) - fetch_lines_forward (text, 1); - - if (scroll) - { - lph = pixel_height_of (text, cache->next); - - /* Scroll the bottom of the line is on screen, or until - * the line is the first onscreen line. - */ - while (cache->next != text->line_start_cache && lph > height) - { - TEXT_SHOW_LINE (text, cache, "cache"); - TEXT_SHOW_LINE (text, cache->next, "cache->next"); - scroll_int (text, LINE_HEIGHT(CACHE_DATA(cache->next))); - lph = pixel_height_of (text, cache->next); - } - } - } - - g_assert_not_reached (); /* Must set text->current_line here */ -} - -static guint -pixel_height_of (GtkText* text, GList* cache_line) -{ - gint pixels = - text->first_cut_pixels; - GList *cache = text->line_start_cache; - - while (TRUE) { - pixels += LINE_HEIGHT (CACHE_DATA(cache)); - - if (cache->data == cache_line->data) - break; - - cache = cache->next; - } - - return pixels; -} - -/**********************************************************************/ -/* Search and Placement */ -/**********************************************************************/ - -static gint -find_char_width (GtkText* text, const GtkPropertyMark *mark, const TabStopMark *tab_mark) -{ - GdkWChar ch; - gint16* char_widths; - - if (LAST_INDEX (text, *mark)) - return 0; - - ch = GTK_TEXT_INDEX (text, mark->index); - char_widths = MARK_CURRENT_TEXT_FONT (text, mark)->char_widths; - - if (ch == '\t') - { - return tab_mark->to_next_tab * char_widths[' ']; - } - else if (ch < 256) - { - return char_widths[ch]; - } - else - { - return gdk_char_width_wc(MARK_CURRENT_TEXT_FONT(text, mark)->gdk_font, ch); - } -} - -static void -advance_tab_mark (GtkText* text, TabStopMark* tab_mark, GdkWChar ch) -{ - if (tab_mark->to_next_tab == 1 || ch == '\t') - { - if (tab_mark->tab_stops->next) - { - tab_mark->tab_stops = tab_mark->tab_stops->next; - tab_mark->to_next_tab = (gintptr) tab_mark->tab_stops->data; - } - else - { - tab_mark->to_next_tab = text->default_tab_width; - } - } - else - { - tab_mark->to_next_tab -= 1; - } -} - -static void -advance_tab_mark_n (GtkText* text, TabStopMark* tab_mark, gint n) - /* No tabs! */ -{ - while (n--) - advance_tab_mark (text, tab_mark, 0); -} - -static void -find_cursor_at_line (GtkText* text, const LineParams* start_line, gint pixel_height) -{ - GdkWChar ch; - - GtkPropertyMark mark = start_line->start; - TabStopMark tab_mark = start_line->tab_cont.tab_start; - gint pixel_width = LINE_START_PIXEL (*start_line); - - while (mark.index < text->cursor_mark.index) - { - pixel_width += find_char_width (text, &mark, &tab_mark); - - advance_tab_mark (text, &tab_mark, GTK_TEXT_INDEX(text, mark.index)); - advance_mark (&mark); - } - - text->cursor_pos_x = pixel_width; - text->cursor_pos_y = pixel_height; - text->cursor_char_offset = start_line->font_descent; - text->cursor_mark = mark; - - ch = LAST_INDEX (text, mark) ? - LINE_DELIM : GTK_TEXT_INDEX (text, mark.index); - - if ((text->use_wchar) ? gdk_iswspace (ch) : isspace (ch)) - text->cursor_char = 0; - else - text->cursor_char = ch; -} - -static void -find_cursor (GtkText* text, gboolean scroll) -{ - if (gtk_widget_get_realized (GTK_WIDGET (text))) - { - find_line_containing_point (text, text->cursor_mark.index, scroll); - - if (text->current_line) - find_cursor_at_line (text, - &CACHE_DATA(text->current_line), - pixel_height_of(text, text->current_line)); - } - - GTK_OLD_EDITABLE (text)->current_pos = text->cursor_mark.index; -} - -static void -find_mouse_cursor_at_line (GtkText *text, const LineParams* lp, - guint line_pixel_height, - gint button_x) -{ - GtkPropertyMark mark = lp->start; - TabStopMark tab_mark = lp->tab_cont.tab_start; - - gint char_width = find_char_width(text, &mark, &tab_mark); - gint pixel_width = LINE_START_PIXEL (*lp) + (char_width+1)/2; - - text->cursor_pos_y = line_pixel_height; - - for (;;) - { - GdkWChar ch = LAST_INDEX (text, mark) ? - LINE_DELIM : GTK_TEXT_INDEX (text, mark.index); - - if (button_x < pixel_width || mark.index == lp->end.index) - { - text->cursor_pos_x = pixel_width - (char_width+1)/2; - text->cursor_mark = mark; - text->cursor_char_offset = lp->font_descent; - - if ((text->use_wchar) ? gdk_iswspace (ch) : isspace (ch)) - text->cursor_char = 0; - else - text->cursor_char = ch; - - break; - } - - advance_tab_mark (text, &tab_mark, ch); - advance_mark (&mark); - - pixel_width += char_width/2; - - char_width = find_char_width (text, &mark, &tab_mark); - - pixel_width += (char_width+1)/2; - } -} - -static void -find_mouse_cursor (GtkText* text, gint x, gint y) -{ - gint pixel_height; - GList* cache = text->line_start_cache; - - g_assert (cache); - - pixel_height = - text->first_cut_pixels; - - for (; cache; cache = cache->next) - { - pixel_height += LINE_HEIGHT(CACHE_DATA(cache)); - - if (y < pixel_height || !cache->next) - { - find_mouse_cursor_at_line (text, &CACHE_DATA(cache), pixel_height, x); - - find_cursor (text, FALSE); - - return; - } - } -} - -/**********************************************************************/ -/* Cache Manager */ -/**********************************************************************/ - -static void -free_cache (GtkText* text) -{ - GList* cache = text->line_start_cache; - - if (cache) - { - while (cache->prev) - cache = cache->prev; - - text->line_start_cache = cache; - } - - for (; cache; cache = cache->next) - g_slice_free (LineParams, cache->data); - - g_list_free (text->line_start_cache); - - text->line_start_cache = NULL; -} - -static GList* -remove_cache_line (GtkText* text, GList* member) -{ - GList *list; - - if (member == NULL) - return NULL; - - if (member == text->line_start_cache) - text->line_start_cache = text->line_start_cache->next; - - if (member->prev) - member->prev->next = member->next; - - if (member->next) - member->next->prev = member->prev; - - list = member->next; - - g_slice_free (LineParams, member->data); - g_list_free_1 (member); - - return list; -} - -/**********************************************************************/ -/* Key Motion */ -/**********************************************************************/ - -static void -move_cursor_buffer_ver (GtkText *text, int dir) -{ - undraw_cursor (text, FALSE); - - if (dir > 0) - { - scroll_int (text, text->vadj->upper); - text->cursor_mark = find_this_line_start_mark (text, - TEXT_LENGTH (text), - &text->cursor_mark); - } - else - { - scroll_int (text, - text->vadj->value); - text->cursor_mark = find_this_line_start_mark (text, - 0, - &text->cursor_mark); - } - - find_cursor (text, TRUE); - draw_cursor (text, FALSE); -} - -static void -move_cursor_page_ver (GtkText *text, int dir) -{ - scroll_int (text, dir * text->vadj->page_increment); -} - -static void -move_cursor_ver (GtkText *text, int count) -{ - gint i; - GtkPropertyMark mark; - gint offset; - - mark = find_this_line_start_mark (text, text->cursor_mark.index, &text->cursor_mark); - offset = text->cursor_mark.index - mark.index; - - if (offset > text->cursor_virtual_x) - text->cursor_virtual_x = offset; - - if (count < 0) - { - if (mark.index == 0) - return; - - decrement_mark (&mark); - mark = find_this_line_start_mark (text, mark.index, &mark); - } - else - { - mark = text->cursor_mark; - - while (!LAST_INDEX(text, mark) && GTK_TEXT_INDEX(text, mark.index) != LINE_DELIM) - advance_mark (&mark); - - if (LAST_INDEX(text, mark)) - return; - - advance_mark (&mark); - } - - for (i=0; i < text->cursor_virtual_x; i += 1, advance_mark(&mark)) - if (LAST_INDEX(text, mark) || - GTK_TEXT_INDEX(text, mark.index) == LINE_DELIM) - break; - - undraw_cursor (text, FALSE); - - text->cursor_mark = mark; - - find_cursor (text, TRUE); - - draw_cursor (text, FALSE); -} - -static void -move_cursor_hor (GtkText *text, int count) -{ - /* count should be +-1. */ - if ( (count > 0 && text->cursor_mark.index + count > TEXT_LENGTH(text)) || - (count < 0 && text->cursor_mark.index < (- count)) || - (count == 0) ) - return; - - text->cursor_virtual_x = 0; - - undraw_cursor (text, FALSE); - - move_mark_n (&text->cursor_mark, count); - - find_cursor (text, TRUE); - - draw_cursor (text, FALSE); -} - -static void -gtk_text_move_cursor (GtkOldEditable *old_editable, - gint x, - gint y) -{ - if (x > 0) - { - while (x-- != 0) - move_cursor_hor (GTK_TEXT (old_editable), 1); - } - else if (x < 0) - { - while (x++ != 0) - move_cursor_hor (GTK_TEXT (old_editable), -1); - } - - if (y > 0) - { - while (y-- != 0) - move_cursor_ver (GTK_TEXT (old_editable), 1); - } - else if (y < 0) - { - while (y++ != 0) - move_cursor_ver (GTK_TEXT (old_editable), -1); - } -} - -static void -gtk_text_move_forward_character (GtkText *text) -{ - move_cursor_hor (text, 1); -} - -static void -gtk_text_move_backward_character (GtkText *text) -{ - move_cursor_hor (text, -1); -} - -static void -gtk_text_move_next_line (GtkText *text) -{ - move_cursor_ver (text, 1); -} - -static void -gtk_text_move_previous_line (GtkText *text) -{ - move_cursor_ver (text, -1); -} - -static void -gtk_text_move_word (GtkOldEditable *old_editable, - gint n) -{ - if (n > 0) - { - while (n-- != 0) - gtk_text_move_forward_word (GTK_TEXT (old_editable)); - } - else if (n < 0) - { - while (n++ != 0) - gtk_text_move_backward_word (GTK_TEXT (old_editable)); - } -} - -static void -gtk_text_move_forward_word (GtkText *text) -{ - text->cursor_virtual_x = 0; - - undraw_cursor (text, FALSE); - - if (text->use_wchar) - { - while (!LAST_INDEX (text, text->cursor_mark) && - !gdk_iswalnum (GTK_TEXT_INDEX(text, text->cursor_mark.index))) - advance_mark (&text->cursor_mark); - - while (!LAST_INDEX (text, text->cursor_mark) && - gdk_iswalnum (GTK_TEXT_INDEX(text, text->cursor_mark.index))) - advance_mark (&text->cursor_mark); - } - else - { - while (!LAST_INDEX (text, text->cursor_mark) && - !isalnum (GTK_TEXT_INDEX(text, text->cursor_mark.index))) - advance_mark (&text->cursor_mark); - - while (!LAST_INDEX (text, text->cursor_mark) && - isalnum (GTK_TEXT_INDEX(text, text->cursor_mark.index))) - advance_mark (&text->cursor_mark); - } - - find_cursor (text, TRUE); - draw_cursor (text, FALSE); -} - -static void -gtk_text_move_backward_word (GtkText *text) -{ - text->cursor_virtual_x = 0; - - undraw_cursor (text, FALSE); - - if (text->use_wchar) - { - while ((text->cursor_mark.index > 0) && - !gdk_iswalnum (GTK_TEXT_INDEX(text, text->cursor_mark.index-1))) - decrement_mark (&text->cursor_mark); - - while ((text->cursor_mark.index > 0) && - gdk_iswalnum (GTK_TEXT_INDEX(text, text->cursor_mark.index-1))) - decrement_mark (&text->cursor_mark); - } - else - { - while ((text->cursor_mark.index > 0) && - !isalnum (GTK_TEXT_INDEX(text, text->cursor_mark.index-1))) - decrement_mark (&text->cursor_mark); - - while ((text->cursor_mark.index > 0) && - isalnum (GTK_TEXT_INDEX(text, text->cursor_mark.index-1))) - decrement_mark (&text->cursor_mark); - } - - find_cursor (text, TRUE); - draw_cursor (text, FALSE); -} - -static void -gtk_text_move_page (GtkOldEditable *old_editable, - gint x, - gint y) -{ - if (y != 0) - scroll_int (GTK_TEXT (old_editable), - y * GTK_TEXT(old_editable)->vadj->page_increment); -} - -static void -gtk_text_move_to_row (GtkOldEditable *old_editable, - gint row) -{ -} - -static void -gtk_text_move_to_column (GtkOldEditable *old_editable, - gint column) -{ - GtkText *text; - - text = GTK_TEXT (old_editable); - - text->cursor_virtual_x = 0; /* FIXME */ - - undraw_cursor (text, FALSE); - - /* Move to the beginning of the line */ - while ((text->cursor_mark.index > 0) && - (GTK_TEXT_INDEX (text, text->cursor_mark.index - 1) != LINE_DELIM)) - decrement_mark (&text->cursor_mark); - - while (!LAST_INDEX (text, text->cursor_mark) && - (GTK_TEXT_INDEX (text, text->cursor_mark.index) != LINE_DELIM)) - { - if (column > 0) - column--; - else if (column == 0) - break; - - advance_mark (&text->cursor_mark); - } - - find_cursor (text, TRUE); - draw_cursor (text, FALSE); -} - -static void -gtk_text_move_beginning_of_line (GtkText *text) -{ - gtk_text_move_to_column (GTK_OLD_EDITABLE (text), 0); - -} - -static void -gtk_text_move_end_of_line (GtkText *text) -{ - gtk_text_move_to_column (GTK_OLD_EDITABLE (text), -1); -} - -static void -gtk_text_kill_char (GtkOldEditable *old_editable, - gint direction) -{ - GtkText *text; - - text = GTK_TEXT (old_editable); - - if (old_editable->selection_start_pos != old_editable->selection_end_pos) - gtk_editable_delete_selection (GTK_EDITABLE (old_editable)); - else - { - if (direction >= 0) - { - if (text->point.index + 1 <= TEXT_LENGTH (text)) - gtk_editable_delete_text (GTK_EDITABLE (old_editable), text->point.index, text->point.index + 1); - } - else - { - if (text->point.index > 0) - gtk_editable_delete_text (GTK_EDITABLE (old_editable), text->point.index - 1, text->point.index); - } - } -} - -static void -gtk_text_delete_forward_character (GtkText *text) -{ - gtk_text_kill_char (GTK_OLD_EDITABLE (text), 1); -} - -static void -gtk_text_delete_backward_character (GtkText *text) -{ - gtk_text_kill_char (GTK_OLD_EDITABLE (text), -1); -} - -static void -gtk_text_kill_word (GtkOldEditable *old_editable, - gint direction) -{ - if (old_editable->selection_start_pos != old_editable->selection_end_pos) - gtk_editable_delete_selection (GTK_EDITABLE (old_editable)); - else - { - gint old_pos = old_editable->current_pos; - if (direction >= 0) - { - gtk_text_move_word (old_editable, 1); - gtk_editable_delete_text (GTK_EDITABLE (old_editable), old_pos, old_editable->current_pos); - } - else - { - gtk_text_move_word (old_editable, -1); - gtk_editable_delete_text (GTK_EDITABLE (old_editable), old_editable->current_pos, old_pos); - } - } -} - -static void -gtk_text_delete_forward_word (GtkText *text) -{ - gtk_text_kill_word (GTK_OLD_EDITABLE (text), 1); -} - -static void -gtk_text_delete_backward_word (GtkText *text) -{ - gtk_text_kill_word (GTK_OLD_EDITABLE (text), -1); -} - -static void -gtk_text_kill_line (GtkOldEditable *old_editable, - gint direction) -{ - gint old_pos = old_editable->current_pos; - if (direction >= 0) - { - gtk_text_move_to_column (old_editable, -1); - gtk_editable_delete_text (GTK_EDITABLE (old_editable), old_pos, old_editable->current_pos); - } - else - { - gtk_text_move_to_column (old_editable, 0); - gtk_editable_delete_text (GTK_EDITABLE (old_editable), old_editable->current_pos, old_pos); - } -} - -static void -gtk_text_delete_line (GtkText *text) -{ - gtk_text_move_to_column (GTK_OLD_EDITABLE (text), 0); - gtk_text_kill_line (GTK_OLD_EDITABLE (text), 1); -} - -static void -gtk_text_delete_to_line_end (GtkText *text) -{ - gtk_text_kill_line (GTK_OLD_EDITABLE (text), 1); -} - -static void -gtk_text_select_word (GtkText *text, guint32 time) -{ - gint start_pos; - gint end_pos; - - GtkOldEditable *old_editable; - old_editable = GTK_OLD_EDITABLE (text); - - gtk_text_move_backward_word (text); - start_pos = text->cursor_mark.index; - - gtk_text_move_forward_word (text); - end_pos = text->cursor_mark.index; - - old_editable->has_selection = TRUE; - gtk_text_set_selection (old_editable, start_pos, end_pos); - gtk_old_editable_claim_selection (old_editable, start_pos != end_pos, time); -} - -static void -gtk_text_select_line (GtkText *text, guint32 time) -{ - gint start_pos; - gint end_pos; - - GtkOldEditable *old_editable; - old_editable = GTK_OLD_EDITABLE (text); - - gtk_text_move_beginning_of_line (text); - start_pos = text->cursor_mark.index; - - gtk_text_move_end_of_line (text); - gtk_text_move_forward_character (text); - end_pos = text->cursor_mark.index; - - old_editable->has_selection = TRUE; - gtk_text_set_selection (old_editable, start_pos, end_pos); - gtk_old_editable_claim_selection (old_editable, start_pos != end_pos, time); -} - -/**********************************************************************/ -/* Scrolling */ -/**********************************************************************/ - -static void -adjust_adj (GtkText* text, GtkAdjustment* adj) -{ - gint height; - - gdk_drawable_get_size (text->text_area, NULL, &height); - - adj->step_increment = MIN (adj->upper, SCROLL_PIXELS); - adj->page_increment = MIN (adj->upper, height - KEY_SCROLL_PIXELS); - adj->page_size = MIN (adj->upper, height); - adj->value = MIN (adj->value, adj->upper - adj->page_size); - adj->value = MAX (adj->value, 0.0); - - gtk_signal_emit_by_name (GTK_OBJECT (adj), "changed"); -} - -static gint -set_vertical_scroll_iterator (GtkText* text, LineParams* lp, void* data) -{ - SetVerticalScrollData *svdata = (SetVerticalScrollData *) data; - - if ((text->first_line_start_index >= lp->start.index) && - (text->first_line_start_index <= lp->end.index)) - { - svdata->mark = lp->start; - - if (text->first_line_start_index == lp->start.index) - { - text->first_onscreen_ver_pixel = svdata->pixel_height + text->first_cut_pixels; - } - else - { - text->first_onscreen_ver_pixel = svdata->pixel_height; - text->first_cut_pixels = 0; - } - - text->vadj->value = text->first_onscreen_ver_pixel; - } - - svdata->pixel_height += LINE_HEIGHT (*lp); - - return FALSE; -} - -static gint -set_vertical_scroll_find_iterator (GtkText* text, LineParams* lp, void* data) -{ - SetVerticalScrollData *svdata = (SetVerticalScrollData *) data; - gint return_val; - - if (svdata->pixel_height <= (gint) text->vadj->value && - svdata->pixel_height + LINE_HEIGHT(*lp) > (gint) text->vadj->value) - { - svdata->mark = lp->start; - - text->first_cut_pixels = (gint)text->vadj->value - svdata->pixel_height; - text->first_onscreen_ver_pixel = svdata->pixel_height; - text->first_line_start_index = lp->start.index; - - return_val = TRUE; - } - else - { - svdata->pixel_height += LINE_HEIGHT (*lp); - - return_val = FALSE; - } - - return return_val; -} - -static GtkPropertyMark -set_vertical_scroll (GtkText* text) -{ - GtkPropertyMark mark = find_mark (text, 0); - SetVerticalScrollData data; - gint height; - gint orig_value; - - data.pixel_height = 0; - line_params_iterate (text, &mark, NULL, FALSE, &data, set_vertical_scroll_iterator); - - text->vadj->upper = data.pixel_height; - orig_value = (gint) text->vadj->value; - - gdk_drawable_get_size (text->text_area, NULL, &height); - - text->vadj->step_increment = MIN (text->vadj->upper, SCROLL_PIXELS); - text->vadj->page_increment = MIN (text->vadj->upper, height - KEY_SCROLL_PIXELS); - text->vadj->page_size = MIN (text->vadj->upper, height); - text->vadj->value = MIN (text->vadj->value, text->vadj->upper - text->vadj->page_size); - text->vadj->value = MAX (text->vadj->value, 0.0); - - text->last_ver_value = (gint)text->vadj->value; - - gtk_signal_emit_by_name (GTK_OBJECT (text->vadj), "changed"); - - if (text->vadj->value != orig_value) - { - /* We got clipped, and don't really know which line to put first. */ - data.pixel_height = 0; - data.last_didnt_wrap = TRUE; - - line_params_iterate (text, &mark, NULL, - FALSE, &data, - set_vertical_scroll_find_iterator); - } - - return data.mark; -} - -static void -scroll_int (GtkText* text, gint diff) -{ - gdouble upper; - - text->vadj->value += diff; - - upper = text->vadj->upper - text->vadj->page_size; - text->vadj->value = MIN (text->vadj->value, upper); - text->vadj->value = MAX (text->vadj->value, 0.0); - - gtk_signal_emit_by_name (GTK_OBJECT (text->vadj), "value-changed"); -} - -static void -process_exposes (GtkText *text) -{ - GdkEvent *event; - - /* Make sure graphics expose events are processed before scrolling - * again */ - - while ((event = gdk_event_get_graphics_expose (text->text_area)) != NULL) - { - gtk_widget_send_expose (GTK_WIDGET (text), event); - if (event->expose.count == 0) - { - gdk_event_free (event); - break; - } - gdk_event_free (event); - } -} - -static gint last_visible_line_height (GtkText* text) -{ - GList *cache = text->line_start_cache; - gint height; - - gdk_drawable_get_size (text->text_area, NULL, &height); - - for (; cache->next; cache = cache->next) - if (pixel_height_of(text, cache->next) > height) - break; - - if (cache) - return pixel_height_of(text, cache) - 1; - else - return 0; -} - -static gint first_visible_line_height (GtkText* text) -{ - if (text->first_cut_pixels) - return pixel_height_of(text, text->line_start_cache) + 1; - else - return 1; -} - -static void -scroll_down (GtkText* text, gint diff0) -{ - GdkRectangle rect; - gint real_diff = 0; - gint width, height; - - text->first_onscreen_ver_pixel += diff0; - - while (diff0-- > 0) - { - g_assert (text->line_start_cache); - - if (text->first_cut_pixels < LINE_HEIGHT(CACHE_DATA(text->line_start_cache)) - 1) - { - text->first_cut_pixels += 1; - } - else - { - text->first_cut_pixels = 0; - - text->line_start_cache = text->line_start_cache->next; - - text->first_line_start_index = - CACHE_DATA(text->line_start_cache).start.index; - - if (!text->line_start_cache->next) - fetch_lines_forward (text, 1); - } - - real_diff += 1; - } - - gdk_drawable_get_size (text->text_area, &width, &height); - if (height > real_diff) - gdk_draw_drawable (text->text_area, - text->gc, - text->text_area, - 0, - real_diff, - 0, - 0, - width, - height - real_diff); - - rect.x = 0; - rect.y = MAX (0, height - real_diff); - rect.width = width; - rect.height = MIN (height, real_diff); - - expose_text (text, &rect, FALSE); - gtk_text_draw_focus ( (GtkWidget *) text); - - if (text->current_line) - { - gint cursor_min; - - text->cursor_pos_y -= real_diff; - cursor_min = drawn_cursor_min(text); - - if (cursor_min < 0) - find_mouse_cursor (text, text->cursor_pos_x, - first_visible_line_height (text)); - } - - if (height > real_diff) - process_exposes (text); -} - -static void -scroll_up (GtkText* text, gint diff0) -{ - gint real_diff = 0; - GdkRectangle rect; - gint width, height; - - text->first_onscreen_ver_pixel += diff0; - - while (diff0++ < 0) - { - g_assert (text->line_start_cache); - - if (text->first_cut_pixels > 0) - { - text->first_cut_pixels -= 1; - } - else - { - if (!text->line_start_cache->prev) - fetch_lines_backward (text); - - text->line_start_cache = text->line_start_cache->prev; - - text->first_line_start_index = - CACHE_DATA(text->line_start_cache).start.index; - - text->first_cut_pixels = LINE_HEIGHT(CACHE_DATA(text->line_start_cache)) - 1; - } - - real_diff += 1; - } - - gdk_drawable_get_size (text->text_area, &width, &height); - if (height > real_diff) - gdk_draw_drawable (text->text_area, - text->gc, - text->text_area, - 0, - 0, - 0, - real_diff, - width, - height - real_diff); - - rect.x = 0; - rect.y = 0; - rect.width = width; - rect.height = MIN (height, real_diff); - - expose_text (text, &rect, FALSE); - gtk_text_draw_focus ( (GtkWidget *) text); - - if (text->current_line) - { - gint cursor_max; - gint height; - - text->cursor_pos_y += real_diff; - cursor_max = drawn_cursor_max(text); - gdk_drawable_get_size (text->text_area, NULL, &height); - - if (cursor_max >= height) - find_mouse_cursor (text, text->cursor_pos_x, - last_visible_line_height (text)); - } - - if (height > real_diff) - process_exposes (text); -} - -/**********************************************************************/ -/* Display Code */ -/**********************************************************************/ - -/* Assumes mark starts a line. Calculates the height, width, and - * displayable character count of a single DISPLAYABLE line. That - * means that in line-wrap mode, this does may not compute the - * properties of an entire line. */ -static LineParams -find_line_params (GtkText* text, - const GtkPropertyMark* mark, - const PrevTabCont *tab_cont, - PrevTabCont *next_cont) -{ - LineParams lp; - TabStopMark tab_mark = tab_cont->tab_start; - guint max_display_pixels; - GdkWChar ch; - gint ch_width; - GdkFont *font; - - gdk_drawable_get_size (text->text_area, (gint*) &max_display_pixels, NULL); - max_display_pixels -= LINE_WRAP_ROOM; - - lp.wraps = 0; - lp.tab_cont = *tab_cont; - lp.start = *mark; - lp.end = *mark; - lp.pixel_width = tab_cont->pixel_offset; - lp.displayable_chars = 0; - lp.font_ascent = 0; - lp.font_descent = 0; - - init_tab_cont (text, next_cont); - - while (!LAST_INDEX(text, lp.end)) - { - g_assert (lp.end.property); - - ch = GTK_TEXT_INDEX (text, lp.end.index); - font = MARK_CURRENT_FONT (text, &lp.end); - - if (ch == LINE_DELIM) - { - /* Newline doesn't count in computation of line height, even - * if its in a bigger font than the rest of the line. Unless, - * of course, there are no other characters. */ - - if (!lp.font_ascent && !lp.font_descent) - { - lp.font_ascent = font->ascent; - lp.font_descent = font->descent; - } - - lp.tab_cont_next = *next_cont; - - return lp; - } - - ch_width = find_char_width (text, &lp.end, &tab_mark); - - if ((ch_width + lp.pixel_width > max_display_pixels) && - (lp.end.index > lp.start.index)) - { - lp.wraps = 1; - - if (text->line_wrap) - { - next_cont->tab_start = tab_mark; - next_cont->pixel_offset = 0; - - if (ch == '\t') - { - /* Here's the tough case, a tab is wrapping. */ - gint pixels_avail = max_display_pixels - lp.pixel_width; - gint space_width = MARK_CURRENT_TEXT_FONT(text, &lp.end)->char_widths[' ']; - gint spaces_avail = pixels_avail / space_width; - - if (spaces_avail == 0) - { - decrement_mark (&lp.end); - } - else - { - advance_tab_mark (text, &next_cont->tab_start, '\t'); - next_cont->pixel_offset = space_width * (tab_mark.to_next_tab - - spaces_avail); - lp.displayable_chars += 1; - } - } - else - { - if (text->word_wrap) - { - GtkPropertyMark saved_mark = lp.end; - guint saved_characters = lp.displayable_chars; - - lp.displayable_chars += 1; - - if (text->use_wchar) - { - while (!gdk_iswspace (GTK_TEXT_INDEX (text, lp.end.index)) && - (lp.end.index > lp.start.index)) - { - decrement_mark (&lp.end); - lp.displayable_chars -= 1; - } - } - else - { - while (!isspace(GTK_TEXT_INDEX (text, lp.end.index)) && - (lp.end.index > lp.start.index)) - { - decrement_mark (&lp.end); - lp.displayable_chars -= 1; - } - } - - /* If whole line is one word, revert to char wrapping */ - if (lp.end.index == lp.start.index) - { - lp.end = saved_mark; - lp.displayable_chars = saved_characters; - decrement_mark (&lp.end); - } - } - else - { - /* Don't include this character, it will wrap. */ - decrement_mark (&lp.end); - } - } - - lp.tab_cont_next = *next_cont; - - return lp; - } - } - else - { - lp.displayable_chars += 1; - } - - lp.font_ascent = MAX (font->ascent, lp.font_ascent); - lp.font_descent = MAX (font->descent, lp.font_descent); - lp.pixel_width += ch_width; - - advance_mark(&lp.end); - advance_tab_mark (text, &tab_mark, ch); - } - - if (LAST_INDEX(text, lp.start)) - { - /* Special case, empty last line. */ - font = MARK_CURRENT_FONT (text, &lp.end); - - lp.font_ascent = font->ascent; - lp.font_descent = font->descent; - } - - lp.tab_cont_next = *next_cont; - - return lp; -} - -static void -expand_scratch_buffer (GtkText* text, guint len) -{ - if (len >= text->scratch_buffer_len) - { - guint i = 1; - - while (i <= len && i < MIN_GAP_SIZE) i <<= 1; - - if (text->use_wchar) - { - if (text->scratch_buffer.wc) - text->scratch_buffer.wc = g_new (GdkWChar, i); - else - text->scratch_buffer.wc = g_realloc (text->scratch_buffer.wc, - i*sizeof (GdkWChar)); - } - else - { - if (text->scratch_buffer.ch) - text->scratch_buffer.ch = g_new (guchar, i); - else - text->scratch_buffer.ch = g_realloc (text->scratch_buffer.ch, i); - } - - text->scratch_buffer_len = i; - } -} - -/* Side effect: modifies text->gc - */ -static void -draw_bg_rect (GtkText* text, GtkPropertyMark *mark, - gint x, gint y, gint width, gint height, - gboolean already_cleared) -{ - GtkOldEditable *old_editable = GTK_OLD_EDITABLE (text); - - if ((mark->index >= MIN(old_editable->selection_start_pos, old_editable->selection_end_pos) && - mark->index < MAX(old_editable->selection_start_pos, old_editable->selection_end_pos))) - { - gtk_paint_flat_box(GTK_WIDGET(text)->style, text->text_area, - old_editable->has_selection ? - GTK_STATE_SELECTED : GTK_STATE_ACTIVE, - GTK_SHADOW_NONE, - NULL, GTK_WIDGET(text), "text", - x, y, width, height); - } - else if (!gdk_color_equal(MARK_CURRENT_BACK (text, mark), - >K_WIDGET(text)->style->base[gtk_widget_get_state (GTK_WIDGET (text))])) - { - gdk_gc_set_foreground (text->gc, MARK_CURRENT_BACK (text, mark)); - - gdk_draw_rectangle (text->text_area, - text->gc, - TRUE, x, y, width, height); - } - else if (GTK_WIDGET (text)->style->bg_pixmap[GTK_STATE_NORMAL]) - { - GdkRectangle rect; - - rect.x = x; - rect.y = y; - rect.width = width; - rect.height = height; - - clear_area (text, &rect); - } - else if (!already_cleared) - gdk_window_clear_area (text->text_area, x, y, width, height); -} - -static void -draw_line (GtkText* text, - gint pixel_start_height, - LineParams* lp) -{ - GdkGCValues gc_values; - gint i; - gint len = 0; - guint running_offset = lp->tab_cont.pixel_offset; - union { GdkWChar *wc; guchar *ch; } buffer; - GdkGC *fg_gc; - - GtkOldEditable *old_editable = GTK_OLD_EDITABLE (text); - - guint selection_start_pos = MIN (old_editable->selection_start_pos, old_editable->selection_end_pos); - guint selection_end_pos = MAX (old_editable->selection_start_pos, old_editable->selection_end_pos); - - GtkPropertyMark mark = lp->start; - TabStopMark tab_mark = lp->tab_cont.tab_start; - gint pixel_height = pixel_start_height + lp->font_ascent; - guint chars = lp->displayable_chars; - - /* First provide a contiguous segment of memory. This makes reading - * the code below *much* easier, and only incurs the cost of copying - * when the line being displayed spans the gap. */ - if (mark.index <= text->gap_position && - mark.index + chars > text->gap_position) - { - expand_scratch_buffer (text, chars); - - if (text->use_wchar) - { - for (i = 0; i < chars; i += 1) - text->scratch_buffer.wc[i] = GTK_TEXT_INDEX(text, mark.index + i); - buffer.wc = text->scratch_buffer.wc; - } - else - { - for (i = 0; i < chars; i += 1) - text->scratch_buffer.ch[i] = GTK_TEXT_INDEX(text, mark.index + i); - buffer.ch = text->scratch_buffer.ch; - } - } - else - { - if (text->use_wchar) - { - if (mark.index >= text->gap_position) - buffer.wc = text->text.wc + mark.index + text->gap_size; - else - buffer.wc = text->text.wc + mark.index; - } - else - { - if (mark.index >= text->gap_position) - buffer.ch = text->text.ch + mark.index + text->gap_size; - else - buffer.ch = text->text.ch + mark.index; - } - } - - - if (running_offset > 0) - { - draw_bg_rect (text, &mark, 0, pixel_start_height, running_offset, - LINE_HEIGHT (*lp), TRUE); - } - - while (chars > 0) - { - len = 0; - if ((text->use_wchar && buffer.wc[0] != '\t') || - (!text->use_wchar && buffer.ch[0] != '\t')) - { - union { GdkWChar *wc; guchar *ch; } next_tab; - gint pixel_width; - GdkFont *font; - - next_tab.wc = NULL; - if (text->use_wchar) - for (i=0; ilength - mark.offset, chars); - - if (text->use_wchar) - { - if (next_tab.wc) - len = MIN (len, next_tab.wc - buffer.wc); - } - else - { - if (next_tab.ch) - len = MIN (len, next_tab.ch - buffer.ch); - } - - if (mark.index < selection_start_pos) - len = MIN (len, selection_start_pos - mark.index); - else if (mark.index < selection_end_pos) - len = MIN (len, selection_end_pos - mark.index); - - font = MARK_CURRENT_FONT (text, &mark); - if (font->type == GDK_FONT_FONT) - { - gdk_gc_set_font (text->gc, font); - gdk_gc_get_values (text->gc, &gc_values); - if (text->use_wchar) - pixel_width = gdk_text_width_wc (gc_values.font, - buffer.wc, len); - else - pixel_width = gdk_text_width (gc_values.font, - (gchar *)buffer.ch, len); - } - else - { - if (text->use_wchar) - pixel_width = gdk_text_width_wc (font, buffer.wc, len); - else - pixel_width = gdk_text_width (font, (gchar *)buffer.ch, len); - } - - draw_bg_rect (text, &mark, running_offset, pixel_start_height, - pixel_width, LINE_HEIGHT (*lp), TRUE); - - if ((mark.index >= selection_start_pos) && - (mark.index < selection_end_pos)) - { - if (old_editable->has_selection) - fg_gc = GTK_WIDGET(text)->style->text_gc[GTK_STATE_SELECTED]; - else - fg_gc = GTK_WIDGET(text)->style->text_gc[GTK_STATE_ACTIVE]; - } - else - { - gdk_gc_set_foreground (text->gc, MARK_CURRENT_FORE (text, &mark)); - fg_gc = text->gc; - } - - if (text->use_wchar) - gdk_draw_text_wc (text->text_area, MARK_CURRENT_FONT (text, &mark), - fg_gc, - running_offset, - pixel_height, - buffer.wc, - len); - else - gdk_draw_text (text->text_area, MARK_CURRENT_FONT (text, &mark), - fg_gc, - running_offset, - pixel_height, - (gchar *)buffer.ch, - len); - - running_offset += pixel_width; - - advance_tab_mark_n (text, &tab_mark, len); - } - else - { - gint pixels_remaining; - gint space_width; - gint spaces_avail; - - len = 1; - - gdk_drawable_get_size (text->text_area, &pixels_remaining, NULL); - pixels_remaining -= (LINE_WRAP_ROOM + running_offset); - - space_width = MARK_CURRENT_TEXT_FONT(text, &mark)->char_widths[' ']; - - spaces_avail = pixels_remaining / space_width; - spaces_avail = MIN (spaces_avail, tab_mark.to_next_tab); - - draw_bg_rect (text, &mark, running_offset, pixel_start_height, - spaces_avail * space_width, LINE_HEIGHT (*lp), TRUE); - - running_offset += tab_mark.to_next_tab * - MARK_CURRENT_TEXT_FONT(text, &mark)->char_widths[' ']; - - advance_tab_mark (text, &tab_mark, '\t'); - } - - advance_mark_n (&mark, len); - if (text->use_wchar) - buffer.wc += len; - else - buffer.ch += len; - chars -= len; - } -} - -static void -draw_line_wrap (GtkText* text, guint height /* baseline height */) -{ - gint width; - GdkPixmap *bitmap; - gint bitmap_width; - gint bitmap_height; - - if (text->line_wrap) - { - bitmap = text->line_wrap_bitmap; - bitmap_width = line_wrap_width; - bitmap_height = line_wrap_height; - } - else - { - bitmap = text->line_arrow_bitmap; - bitmap_width = line_arrow_width; - bitmap_height = line_arrow_height; - } - - gdk_drawable_get_size (text->text_area, &width, NULL); - width -= LINE_WRAP_ROOM; - - gdk_gc_set_stipple (text->gc, - bitmap); - - gdk_gc_set_fill (text->gc, GDK_STIPPLED); - - gdk_gc_set_foreground (text->gc, >K_WIDGET (text)->style->text[GTK_STATE_NORMAL]); - - gdk_gc_set_ts_origin (text->gc, - width + 1, - height - bitmap_height - 1); - - gdk_draw_rectangle (text->text_area, - text->gc, - TRUE, - width + 1, - height - bitmap_height - 1 /* one pixel above the baseline. */, - bitmap_width, - bitmap_height); - - gdk_gc_set_ts_origin (text->gc, 0, 0); - - gdk_gc_set_fill (text->gc, GDK_SOLID); -} - -static void -undraw_cursor (GtkText* text, gint absolute) -{ - GtkOldEditable *old_editable = (GtkOldEditable *) text; - - TDEBUG (("in undraw_cursor\n")); - - if (absolute) - text->cursor_drawn_level = 0; - - if ((text->cursor_drawn_level ++ == 0) && - (old_editable->selection_start_pos == old_editable->selection_end_pos) && - GTK_WIDGET_DRAWABLE (text) && text->line_start_cache) - { - GdkFont* font; - - g_assert(text->cursor_mark.property); - - font = MARK_CURRENT_FONT(text, &text->cursor_mark); - - draw_bg_rect (text, &text->cursor_mark, - text->cursor_pos_x, - text->cursor_pos_y - text->cursor_char_offset - font->ascent, - 1, font->ascent + 1, FALSE); - - if (text->cursor_char) - { - if (font->type == GDK_FONT_FONT) - gdk_gc_set_font (text->gc, font); - - gdk_gc_set_foreground (text->gc, MARK_CURRENT_FORE (text, &text->cursor_mark)); - - gdk_draw_text_wc (text->text_area, font, - text->gc, - text->cursor_pos_x, - text->cursor_pos_y - text->cursor_char_offset, - &text->cursor_char, - 1); - } - } -} - -static gint -drawn_cursor_min (GtkText* text) -{ - GdkFont* font; - - g_assert(text->cursor_mark.property); - - font = MARK_CURRENT_FONT(text, &text->cursor_mark); - - return text->cursor_pos_y - text->cursor_char_offset - font->ascent; -} - -static gint -drawn_cursor_max (GtkText* text) -{ - g_assert(text->cursor_mark.property); - - return text->cursor_pos_y - text->cursor_char_offset; -} - -static void -draw_cursor (GtkText* text, gint absolute) -{ - GtkOldEditable *old_editable = (GtkOldEditable *)text; - - TDEBUG (("in draw_cursor\n")); - - if (absolute) - text->cursor_drawn_level = 1; - - if ((--text->cursor_drawn_level == 0) && - old_editable->editable && - (old_editable->selection_start_pos == old_editable->selection_end_pos) && - GTK_WIDGET_DRAWABLE (text) && text->line_start_cache) - { - GdkFont* font; - - g_assert (text->cursor_mark.property); - - font = MARK_CURRENT_FONT (text, &text->cursor_mark); - - gdk_gc_set_foreground (text->gc, >K_WIDGET (text)->style->text[GTK_STATE_NORMAL]); - - gdk_draw_line (text->text_area, text->gc, text->cursor_pos_x, - text->cursor_pos_y - text->cursor_char_offset, - text->cursor_pos_x, - text->cursor_pos_y - text->cursor_char_offset - font->ascent); - } -} - -static GdkGC * -create_bg_gc (GtkText *text) -{ - GdkGCValues values; - - values.tile = GTK_WIDGET (text)->style->bg_pixmap[GTK_STATE_NORMAL]; - values.fill = GDK_TILED; - - return gdk_gc_new_with_values (text->text_area, &values, - GDK_GC_FILL | GDK_GC_TILE); -} - -static void -clear_area (GtkText *text, GdkRectangle *area) -{ - GtkWidget *widget = GTK_WIDGET (text); - - if (text->bg_gc) - { - gint width, height; - - gdk_drawable_get_size (widget->style->bg_pixmap[GTK_STATE_NORMAL], &width, &height); - - gdk_gc_set_ts_origin (text->bg_gc, - (- text->first_onscreen_hor_pixel) % width, - (- text->first_onscreen_ver_pixel) % height); - - gdk_draw_rectangle (text->text_area, text->bg_gc, TRUE, - area->x, area->y, area->width, area->height); - } - else - gdk_window_clear_area (text->text_area, area->x, area->y, area->width, area->height); -} - -static void -expose_text (GtkText* text, GdkRectangle *area, gboolean cursor) -{ - GList *cache = text->line_start_cache; - gint pixels = - text->first_cut_pixels; - gint min_y = MAX (0, area->y); - gint max_y = MAX (0, area->y + area->height); - gint height; - - gdk_drawable_get_size (text->text_area, NULL, &height); - max_y = MIN (max_y, height); - - TDEBUG (("in expose x=%d y=%d w=%d h=%d\n", area->x, area->y, area->width, area->height)); - - clear_area (text, area); - - for (; pixels < height; cache = cache->next) - { - if (pixels < max_y && (pixels + (gint)LINE_HEIGHT(CACHE_DATA(cache))) >= min_y) - { - draw_line (text, pixels, &CACHE_DATA(cache)); - - if (CACHE_DATA(cache).wraps) - draw_line_wrap (text, pixels + CACHE_DATA(cache).font_ascent); - } - - if (cursor && gtk_widget_has_focus (GTK_WIDGET (text))) - { - if (CACHE_DATA(cache).start.index <= text->cursor_mark.index && - CACHE_DATA(cache).end.index >= text->cursor_mark.index) - { - /* We undraw and draw the cursor here to get the drawn - * level right ... FIXME - maybe the second parameter - * of draw_cursor should work differently - */ - undraw_cursor (text, FALSE); - draw_cursor (text, FALSE); - } - } - - pixels += LINE_HEIGHT(CACHE_DATA(cache)); - - if (!cache->next) - { - fetch_lines_forward (text, 1); - - if (!cache->next) - break; - } - } -} - -static void -gtk_text_update_text (GtkOldEditable *old_editable, - gint start_pos, - gint end_pos) -{ - GtkText *text = GTK_TEXT (old_editable); - - GList *cache = text->line_start_cache; - gint pixels = - text->first_cut_pixels; - GdkRectangle area; - gint width; - gint height; - - if (end_pos < 0) - end_pos = TEXT_LENGTH (text); - - if (end_pos < start_pos) - return; - - gdk_drawable_get_size (text->text_area, &width, &height); - area.x = 0; - area.y = -1; - area.width = width; - area.height = 0; - - TDEBUG (("in expose span start=%d stop=%d\n", start_pos, end_pos)); - - for (; pixels < height; cache = cache->next) - { - if (CACHE_DATA(cache).start.index < end_pos) - { - if (CACHE_DATA(cache).end.index >= start_pos) - { - if (area.y < 0) - area.y = MAX(0,pixels); - area.height = pixels + LINE_HEIGHT(CACHE_DATA(cache)) - area.y; - } - } - else - break; - - pixels += LINE_HEIGHT(CACHE_DATA(cache)); - - if (!cache->next) - { - fetch_lines_forward (text, 1); - - if (!cache->next) - break; - } - } - - if (area.y >= 0) - expose_text (text, &area, TRUE); -} - -static void -recompute_geometry (GtkText* text) -{ - GtkPropertyMark mark, start_mark; - GList *new_lines; - gint height; - gint width; - - free_cache (text); - - mark = start_mark = set_vertical_scroll (text); - - /* We need a real start of a line when calling fetch_lines(). - * not the start of a wrapped line. - */ - while (mark.index > 0 && - GTK_TEXT_INDEX (text, mark.index - 1) != LINE_DELIM) - decrement_mark (&mark); - - gdk_drawable_get_size (text->text_area, &width, &height); - - /* Fetch an entire line, to make sure that we get all the text - * we backed over above, in addition to enough text to fill up - * the space vertically - */ - - new_lines = fetch_lines (text, - &mark, - NULL, - FetchLinesCount, - 1); - - mark = CACHE_DATA (g_list_last (new_lines)).end; - if (!LAST_INDEX (text, mark)) - { - advance_mark (&mark); - - new_lines = g_list_concat (new_lines, - fetch_lines (text, - &mark, - NULL, - FetchLinesPixels, - height + text->first_cut_pixels)); - } - - /* Now work forward to the actual first onscreen line */ - - while (CACHE_DATA (new_lines).start.index < start_mark.index) - new_lines = new_lines->next; - - text->line_start_cache = new_lines; - - find_cursor (text, TRUE); -} - -/**********************************************************************/ -/* Selection */ -/**********************************************************************/ - -static void -gtk_text_set_selection (GtkOldEditable *old_editable, - gint start, - gint end) -{ - GtkText *text = GTK_TEXT (old_editable); - - guint start1, end1, start2, end2; - - if (end < 0) - end = TEXT_LENGTH (text); - - start1 = MIN(start,end); - end1 = MAX(start,end); - start2 = MIN(old_editable->selection_start_pos, old_editable->selection_end_pos); - end2 = MAX(old_editable->selection_start_pos, old_editable->selection_end_pos); - - if (start2 < start1) - { - guint tmp; - - tmp = start1; start1 = start2; start2 = tmp; - tmp = end1; end1 = end2; end2 = tmp; - } - - undraw_cursor (text, FALSE); - old_editable->selection_start_pos = start; - old_editable->selection_end_pos = end; - draw_cursor (text, FALSE); - - /* Expose only what changed */ - - if (start1 < start2) - gtk_text_update_text (old_editable, start1, MIN(end1, start2)); - - if (end2 > end1) - gtk_text_update_text (old_editable, MAX(end1, start2), end2); - else if (end2 < end1) - gtk_text_update_text (old_editable, end2, end1); -} - - -/**********************************************************************/ -/* Debug */ -/**********************************************************************/ - -#ifdef DEBUG_GTK_TEXT -static void -gtk_text_show_cache_line (GtkText *text, GList *cache, - const char* what, const char* func, gint line) -{ - LineParams *lp = &CACHE_DATA(cache); - gint i; - - if (cache == text->line_start_cache) - g_message ("Line Start Cache: "); - - if (cache == text->current_line) - g_message("Current Line: "); - - g_message ("%s:%d: cache line %s s=%d,e=%d,lh=%d (", - func, - line, - what, - lp->start.index, - lp->end.index, - LINE_HEIGHT(*lp)); - - for (i = lp->start.index; i < (lp->end.index + lp->wraps); i += 1) - g_message ("%c", GTK_TEXT_INDEX (text, i)); - - g_message (")\n"); -} - -static void -gtk_text_show_cache (GtkText *text, const char* func, gint line) -{ - GList *l = text->line_start_cache; - - if (!l) { - return; - } - - /* back up to the absolute beginning of the line cache */ - while (l->prev) - l = l->prev; - - g_message ("*** line cache ***\n"); - for (; l; l = l->next) - gtk_text_show_cache_line (text, l, "all", func, line); -} - -static void -gtk_text_assert_mark (GtkText *text, - GtkPropertyMark *mark, - GtkPropertyMark *before, - GtkPropertyMark *after, - const gchar *msg, - const gchar *where, - gint line) -{ - GtkPropertyMark correct_mark = find_mark (text, mark->index); - - if (mark->offset != correct_mark.offset || - mark->property != correct_mark.property) - g_warning ("incorrect %s text property marker in %s:%d, index %d -- bad!", where, msg, line, mark->index); -} - -static void -gtk_text_assert (GtkText *text, - const gchar *msg, - gint line) -{ - GList* cache = text->line_start_cache; - GtkPropertyMark* before_mark = NULL; - GtkPropertyMark* after_mark = NULL; - - gtk_text_show_props (text, msg, line); - - for (; cache->prev; cache = cache->prev) - /* nothing */; - - g_message ("*** line markers ***\n"); - - for (; cache; cache = cache->next) - { - after_mark = &CACHE_DATA(cache).end; - gtk_text_assert_mark (text, &CACHE_DATA(cache).start, before_mark, after_mark, msg, "start", line); - before_mark = &CACHE_DATA(cache).start; - - if (cache->next) - after_mark = &CACHE_DATA(cache->next).start; - else - after_mark = NULL; - - gtk_text_assert_mark (text, &CACHE_DATA(cache).end, before_mark, after_mark, msg, "end", line); - before_mark = &CACHE_DATA(cache).end; - } -} - -static void -gtk_text_show_adj (GtkText *text, - GtkAdjustment *adj, - const char* what, - const char* func, - gint line) -{ - g_message ("*** adjustment ***\n"); - - g_message ("%s:%d: %s adjustment l=%.1f u=%.1f v=%.1f si=%.1f pi=%.1f ps=%.1f\n", - func, - line, - what, - adj->lower, - adj->upper, - adj->value, - adj->step_increment, - adj->page_increment, - adj->page_size); -} - -static void -gtk_text_show_props (GtkText *text, - const char* msg, - int line) -{ - GList* props = text->text_properties; - int proplen = 0; - - g_message ("%s:%d: ", msg, line); - - for (; props; props = props->next) - { - TextProperty *p = (TextProperty*)props->data; - - proplen += p->length; - - g_message ("[%d,%p,", p->length, p); - if (p->flags & PROPERTY_FONT) - g_message ("%p,", p->font); - else - g_message ("-,"); - if (p->flags & PROPERTY_FOREGROUND) - g_message ("%ld, ", p->fore_color.pixel); - else - g_message ("-,"); - if (p->flags & PROPERTY_BACKGROUND) - g_message ("%ld] ", p->back_color.pixel); - else - g_message ("-] "); - } - - g_message ("\n"); - - if (proplen - 1 != TEXT_LENGTH(text)) - g_warning ("incorrect property list length in %s:%d -- bad!", msg, line); -} -#endif - -#define __GTK_TEXT_C__ -#include "gtkaliasdef.c" diff --git a/gtk/gtktext.h b/gtk/gtktext.h deleted file mode 100644 index 8bfa71aa21..0000000000 --- a/gtk/gtktext.h +++ /dev/null @@ -1,217 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#ifdef GTK_ENABLE_BROKEN - -#ifndef __GTK_TEXT_H__ -#define __GTK_TEXT_H__ - - -#include - - -G_BEGIN_DECLS - -#define GTK_TYPE_TEXT (gtk_text_get_type ()) -#define GTK_TEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TEXT, GtkText)) -#define GTK_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TEXT, GtkTextClass)) -#define GTK_IS_TEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TEXT)) -#define GTK_IS_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TEXT)) -#define GTK_TEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TEXT, GtkTextClass)) - - -typedef struct _GtkTextFont GtkTextFont; -typedef struct _GtkPropertyMark GtkPropertyMark; -typedef struct _GtkText GtkText; -typedef struct _GtkTextClass GtkTextClass; - -struct _GtkPropertyMark -{ - /* Position in list. */ - GList* property; - - /* Offset into that property. */ - guint offset; - - /* Current index. */ - guint index; -}; - -struct _GtkText -{ - GtkOldEditable old_editable; - - GdkWindow *text_area; - - GtkAdjustment *hadj; - GtkAdjustment *vadj; - - GdkGC *gc; - - GdkPixmap* line_wrap_bitmap; - GdkPixmap* line_arrow_bitmap; - - /* GAPPED TEXT SEGMENT */ - - /* The text, a single segment of text a'la emacs, with a gap - * where insertion occurs. */ - union { GdkWChar *wc; guchar *ch; } text; - /* The allocated length of the text segment. */ - guint text_len; - /* The gap position, index into address where a char - * should be inserted. */ - guint gap_position; - /* The gap size, s.t. *(text + gap_position + gap_size) is - * the first valid character following the gap. */ - guint gap_size; - /* The last character position, index into address where a - * character should be appeneded. Thus, text_end - gap_size - * is the length of the actual data. */ - guint text_end; - /* LINE START CACHE */ - - /* A cache of line-start information. Data is a LineParam*. */ - GList *line_start_cache; - /* Index to the start of the first visible line. */ - guint first_line_start_index; - /* The number of pixels cut off of the top line. */ - guint first_cut_pixels; - /* First visible horizontal pixel. */ - guint first_onscreen_hor_pixel; - /* First visible vertical pixel. */ - guint first_onscreen_ver_pixel; - - /* FLAGS */ - - /* True iff this buffer is wrapping lines, otherwise it is using a - * horizontal scrollbar. */ - guint line_wrap : 1; - guint word_wrap : 1; - /* If a fontset is supplied for the widget, use_wchar become true, - * and we use GdkWchar as the encoding of text. */ - guint use_wchar : 1; - - /* Frozen, don't do updates. @@@ fixme */ - guint freeze_count; - /* TEXT PROPERTIES */ - - /* A doubly-linked-list containing TextProperty objects. */ - GList *text_properties; - /* The end of this list. */ - GList *text_properties_end; - /* The first node before or on the point along with its offset to - * the point and the buffer's current point. This is the only - * PropertyMark whose index is guaranteed to remain correct - * following a buffer insertion or deletion. */ - GtkPropertyMark point; - - /* SCRATCH AREA */ - - union { GdkWChar *wc; guchar *ch; } scratch_buffer; - guint scratch_buffer_len; - - /* SCROLLING */ - - gint last_ver_value; - - /* CURSOR */ - - gint cursor_pos_x; /* Position of cursor. */ - gint cursor_pos_y; /* Baseline of line cursor is drawn on. */ - GtkPropertyMark cursor_mark; /* Where it is in the buffer. */ - GdkWChar cursor_char; /* Character to redraw. */ - gchar cursor_char_offset; /* Distance from baseline of the font. */ - gint cursor_virtual_x; /* Where it would be if it could be. */ - gint cursor_drawn_level; /* How many people have undrawn. */ - - /* Current Line */ - - GList *current_line; - - /* Tab Stops */ - - GList *tab_stops; - gint default_tab_width; - - GtkTextFont *current_font; /* Text font for current style */ - - /* Timer used for auto-scrolling off ends */ - gint timer; - - guint button; /* currently pressed mouse button */ - GdkGC *bg_gc; /* gc for drawing background pixmap */ -}; - -struct _GtkTextClass -{ - GtkOldEditableClass parent_class; - - void (*set_scroll_adjustments) (GtkText *text, - GtkAdjustment *hadjustment, - GtkAdjustment *vadjustment); -}; - - -GType gtk_text_get_type (void) G_GNUC_CONST; -GtkWidget* gtk_text_new (GtkAdjustment *hadj, - GtkAdjustment *vadj); -void gtk_text_set_editable (GtkText *text, - gboolean editable); -void gtk_text_set_word_wrap (GtkText *text, - gboolean word_wrap); -void gtk_text_set_line_wrap (GtkText *text, - gboolean line_wrap); -void gtk_text_set_adjustments (GtkText *text, - GtkAdjustment *hadj, - GtkAdjustment *vadj); -void gtk_text_set_point (GtkText *text, - guint index); -guint gtk_text_get_point (GtkText *text); -guint gtk_text_get_length (GtkText *text); -void gtk_text_freeze (GtkText *text); -void gtk_text_thaw (GtkText *text); -void gtk_text_insert (GtkText *text, - GdkFont *font, - const GdkColor *fore, - const GdkColor *back, - const char *chars, - gint length); -gboolean gtk_text_backward_delete (GtkText *text, - guint nchars); -gboolean gtk_text_forward_delete (GtkText *text, - guint nchars); - -#define GTK_TEXT_INDEX(t, index) (((t)->use_wchar) \ - ? ((index) < (t)->gap_position ? (t)->text.wc[index] : \ - (t)->text.wc[(index)+(t)->gap_size]) \ - : ((index) < (t)->gap_position ? (t)->text.ch[index] : \ - (t)->text.ch[(index)+(t)->gap_size])) - -G_END_DECLS - -#endif /* __GTK_TEXT_H__ */ - -#endif /* GTK_ENABLE_BROKEN */ diff --git a/gtk/gtktextbuffer.c b/gtk/gtktextbuffer.c index dca5686e46..44cb322e0a 100644 --- a/gtk/gtktextbuffer.c +++ b/gtk/gtktextbuffer.c @@ -2083,7 +2083,7 @@ gtk_text_buffer_set_mark (GtkTextBuffer *buffer, * Emits the "mark-set" signal as notification of the mark's initial * placement. * - * Return value: the new #GtkTextMark object + * Return value: (transfer none): the new #GtkTextMark object **/ GtkTextMark* gtk_text_buffer_create_mark (GtkTextBuffer *buffer, diff --git a/gtk/gtktextbuffer.h b/gtk/gtktextbuffer.h index d160c49065..3a773e50ea 100644 --- a/gtk/gtktextbuffer.h +++ b/gtk/gtktextbuffer.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtktextbufferrichtext.h b/gtk/gtktextbufferrichtext.h index bbbf6e2b0d..614b43dcfd 100644 --- a/gtk/gtktextbufferrichtext.h +++ b/gtk/gtktextbufferrichtext.h @@ -19,7 +19,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtktextchild.h b/gtk/gtktextchild.h index 20cee010bc..7835e68f91 100644 --- a/gtk/gtktextchild.h +++ b/gtk/gtktextchild.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtktextiter.c b/gtk/gtktextiter.c index aa5fbc442d..752db11f6d 100644 --- a/gtk/gtktextiter.c +++ b/gtk/gtktextiter.c @@ -34,6 +34,18 @@ #include "gtkalias.h" #include + +/** + * SECTION:gtktextiter + * @Short_description: Text buffer iterator + * @Title: GtkTextIter + * + * You may wish to begin by reading the text widget + * conceptual overview which gives an overview of all the objects and data + * types related to the text widget and how they work together. + */ + + #define FIX_OVERFLOWS(varname) if ((varname) == G_MININT) (varname) = G_MININT + 1 typedef struct _GtkTextRealIter GtkTextRealIter; diff --git a/gtk/gtktextiter.h b/gtk/gtktextiter.h index 44ba8721e7..046d436802 100644 --- a/gtk/gtktextiter.h +++ b/gtk/gtktextiter.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtktextmark.h b/gtk/gtktextmark.h index 87118df7ec..5bddf92739 100644 --- a/gtk/gtktextmark.h +++ b/gtk/gtktextmark.h @@ -47,7 +47,7 @@ * */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtktexttag.h b/gtk/gtktexttag.h index 406cc393c7..39c9f73d92 100644 --- a/gtk/gtktexttag.h +++ b/gtk/gtktexttag.h @@ -47,7 +47,7 @@ * */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtktexttagtable.h b/gtk/gtktexttagtable.h index ecc172d1c9..f33ae8f797 100644 --- a/gtk/gtktexttagtable.h +++ b/gtk/gtktexttagtable.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index 282aee2525..f835f67e47 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -109,6 +109,7 @@ struct _GtkTextViewPrivate guint blink_time; /* time in msec the cursor has blinked since last user event */ guint im_spot_idle; gchar *im_module; + GdkDevice *grab_device; guint scroll_after_paste : 1; }; @@ -297,7 +298,6 @@ static void gtk_text_view_set_attributes_from_style (GtkTextView *tex static void gtk_text_view_ensure_layout (GtkTextView *text_view); static void gtk_text_view_destroy_layout (GtkTextView *text_view); static void gtk_text_view_check_keymap_direction (GtkTextView *text_view); -static void gtk_text_view_reset_im_context (GtkTextView *text_view); static void gtk_text_view_start_selection_drag (GtkTextView *text_view, const GtkTextIter *iter, GdkEventButton *event); @@ -1549,7 +1549,7 @@ gtk_text_view_get_buffer (GtkTextView *text_view) /** * gtk_text_view_get_iter_at_location: * @text_view: a #GtkTextView - * @iter: a #GtkTextIter + * @iter: (out): a #GtkTextIter * @x: x position, in buffer coordinates * @y: y position, in buffer coordinates * @@ -1577,8 +1577,8 @@ gtk_text_view_get_iter_at_location (GtkTextView *text_view, /** * gtk_text_view_get_iter_at_position: * @text_view: a #GtkTextView - * @iter: a #GtkTextIter - * @trailing: if non-%NULL, location to store an integer indicating where + * @iter: (out): a #GtkTextIter + * @trailing: (out) (allow-none): if non-%NULL, location to store an integer indicating where * in the grapheme the user clicked. It will either be * zero, or the number of characters in the grapheme. * 0 represents the trailing edge of the grapheme. @@ -1618,7 +1618,7 @@ gtk_text_view_get_iter_at_position (GtkTextView *text_view, * gtk_text_view_get_iter_location: * @text_view: a #GtkTextView * @iter: a #GtkTextIter - * @location: bounds of the character at @iter + * @location: (out): bounds of the character at @iter * * Gets a rectangle which roughly contains the character at @iter. * The rectangle position is in buffer coordinates; use @@ -1642,8 +1642,8 @@ gtk_text_view_get_iter_location (GtkTextView *text_view, * gtk_text_view_get_line_yrange: * @text_view: a #GtkTextView * @iter: a #GtkTextIter - * @y: return location for a y coordinate - * @height: return location for a height + * @y: (out): return location for a y coordinate + * @height: (out): return location for a height * * Gets the y coordinate of the top of the line containing @iter, * and the height of the line. The coordinate is a buffer coordinate; @@ -1669,9 +1669,9 @@ gtk_text_view_get_line_yrange (GtkTextView *text_view, /** * gtk_text_view_get_line_at_y: * @text_view: a #GtkTextView - * @target_iter: a #GtkTextIter + * @target_iter: (out): a #GtkTextIter * @y: a y coordinate - * @line_top: return location for top coordinate of the line + * @line_top: (out): return location for top coordinate of the line * * Gets the #GtkTextIter at the start of the line containing * the coordinate @y. @y is in buffer coordinates, convert from @@ -4085,7 +4085,12 @@ static void gtk_text_view_grab_notify (GtkWidget *widget, gboolean was_grabbed) { - if (!was_grabbed) + GtkTextViewPrivate *priv; + + priv = GTK_TEXT_VIEW_GET_PRIVATE (widget); + + if (priv->grab_device && + gtk_widget_device_is_shadowed (widget, priv->grab_device)) { gtk_text_view_end_selection_drag (GTK_TEXT_VIEW (widget)); gtk_text_view_unobscure_mouse_cursor (GTK_TEXT_VIEW (widget)); @@ -5993,6 +5998,7 @@ gtk_text_view_unselect (GtkTextView *text_view) static void get_iter_at_pointer (GtkTextView *text_view, + GdkDevice *device, GtkTextIter *iter, gint *x, gint *y) @@ -6000,9 +6006,9 @@ get_iter_at_pointer (GtkTextView *text_view, gint xcoord, ycoord; GdkModifierType state; - gdk_window_get_pointer (text_view->text_window->bin_window, - &xcoord, &ycoord, &state); - + gdk_window_get_device_position (text_view->text_window->bin_window, + device, &xcoord, &ycoord, &state); + gtk_text_layout_get_iter_at_pixel (text_view->layout, iter, xcoord + text_view->xoffset, @@ -6016,12 +6022,13 @@ get_iter_at_pointer (GtkTextView *text_view, static void move_mark_to_pointer_and_scroll (GtkTextView *text_view, - const gchar *mark_name) + const gchar *mark_name, + GdkDevice *device) { GtkTextIter newplace; GtkTextMark *mark; - get_iter_at_pointer (text_view, &newplace, NULL, NULL); + get_iter_at_pointer (text_view, device, &newplace, NULL, NULL); mark = gtk_text_buffer_get_mark (get_buffer (text_view), mark_name); @@ -6046,7 +6053,6 @@ selection_scan_timeout (gpointer data) text_view = GTK_TEXT_VIEW (data); - DV(g_print (G_STRLOC": calling move_mark_to_pointer_and_scroll\n")); gtk_text_view_scroll_mark_onscreen (text_view, gtk_text_buffer_get_insert (get_buffer (text_view))); @@ -6075,10 +6081,12 @@ drag_scan_timeout (gpointer data) GtkTextIter newplace; gint x, y, width, height; gdouble pointer_xoffset, pointer_yoffset; + GdkDevice *device; text_view = GTK_TEXT_VIEW (data); + device = gdk_display_get_core_pointer (gtk_widget_get_display (GTK_WIDGET (data))); - get_iter_at_pointer (text_view, &newplace, &x, &y); + get_iter_at_pointer (text_view, device, &newplace, &x, &y); gdk_drawable_get_size (text_view->text_window->bin_window, &width, &height); gtk_text_buffer_move_mark (get_buffer (text_view), @@ -6215,11 +6223,17 @@ selection_motion_event_handler (GtkTextView *text_view, GdkEventMotion *event, SelectionData *data) { + GtkTextViewPrivate *priv; + + priv = GTK_TEXT_VIEW_GET_PRIVATE (text_view); gdk_event_request_motions (event); + if (priv->grab_device != event->device) + return FALSE; + if (data->granularity == SELECT_CHARACTERS) { - move_mark_to_pointer_and_scroll (text_view, "insert"); + move_mark_to_pointer_and_scroll (text_view, "insert", event->device); } else { @@ -6232,7 +6246,7 @@ selection_motion_event_handler (GtkTextView *text_view, gtk_text_buffer_get_iter_at_mark (buffer, &orig_start, data->orig_start); gtk_text_buffer_get_iter_at_mark (buffer, &orig_end, data->orig_end); - get_iter_at_pointer (text_view, &cursor, NULL, NULL); + get_iter_at_pointer (text_view, event->device, &cursor, NULL, NULL); start = cursor; extend_selection (text_view, data->granularity, &start, &end); @@ -6266,6 +6280,7 @@ gtk_text_view_start_selection_drag (GtkTextView *text_view, const GtkTextIter *iter, GdkEventButton *button) { + GtkTextViewPrivate *priv; GtkTextIter cursor, ins, bound; GtkTextIter orig_start, orig_end; GtkTextBuffer *buffer; @@ -6273,7 +6288,8 @@ gtk_text_view_start_selection_drag (GtkTextView *text_view, if (text_view->selection_drag_handler != 0) return; - + + priv = GTK_TEXT_VIEW_GET_PRIVATE (text_view); data = g_new0 (SelectionData, 1); if (button->type == GDK_2BUTTON_PRESS) @@ -6283,7 +6299,10 @@ gtk_text_view_start_selection_drag (GtkTextView *text_view, else data->granularity = SELECT_CHARACTERS; - gtk_grab_add (GTK_WIDGET (text_view)); + priv->grab_device = button->device; + gtk_device_grab_add (GTK_WIDGET (text_view), + priv->grab_device, + TRUE); buffer = get_buffer (text_view); @@ -6333,7 +6352,6 @@ gtk_text_view_start_selection_drag (GtkTextView *text_view, &orig_start, TRUE); data->orig_end = gtk_text_buffer_create_mark (buffer, NULL, &orig_end, TRUE); - gtk_text_view_check_cursor_blink (text_view); text_view->selection_drag_handler = g_signal_connect_data (text_view, @@ -6347,6 +6365,13 @@ gtk_text_view_start_selection_drag (GtkTextView *text_view, static gboolean gtk_text_view_end_selection_drag (GtkTextView *text_view) { + GtkTextViewPrivate *priv; + + priv = GTK_TEXT_VIEW_GET_PRIVATE (text_view); + + if (!priv->grab_device) + return FALSE; + if (text_view->selection_drag_handler == 0) return FALSE; @@ -6359,7 +6384,9 @@ gtk_text_view_end_selection_drag (GtkTextView *text_view) text_view->scroll_timeout = 0; } - gtk_grab_remove (GTK_WIDGET (text_view)); + gtk_device_grab_remove (GTK_WIDGET (text_view), + priv->grab_device); + priv->grab_device = NULL; return TRUE; } @@ -6574,9 +6601,22 @@ gtk_text_view_destroy_layout (GtkTextView *text_view) } } -static void +/** + * gtk_text_view_reset_im_context: + * @text_view: a #GtkTextView + * + * Reset the input method context of the text view if needed. + * + * This can be necessary in the case where modifying the buffer + * would confuse on-going input method behavior. + * + * Since: 2.22 + */ +void gtk_text_view_reset_im_context (GtkTextView *text_view) { + g_return_if_fail (GTK_IS_TEXT_VIEW (text_view)); + if (text_view->need_im_reset) { text_view->need_im_reset = FALSE; @@ -6584,6 +6624,51 @@ gtk_text_view_reset_im_context (GtkTextView *text_view) } } +/** + * gtk_text_view_im_context_filter_keypress: + * @text_view: a #GtkTextView + * @event: the key event + * + * Allow the #GtkTextView input method to internally handle key press + * and release events. If this function returns %TRUE, then no further + * processing should be done for this key event. See + * gtk_im_context_filter_keypress(). + * + * Note that you are expected to call this function from your handler + * when overriding key event handling. This is needed in the case when + * you need to insert your own key handling between the input method + * and the default key event handling of the #GtkTextView. + * + * |[ + * static gboolean + * gtk_foo_bar_key_press_event (GtkWidget *widget, + * GdkEventKey *event) + * { + * if ((key->keyval == GDK_Return || key->keyval == GDK_KP_Enter)) + * { + * if (gtk_text_view_im_context_filter_keypress (GTK_TEXT_VIEW (view), event)) + * return TRUE; + * } + * + * /* Do some stuff */ + * + * return GTK_WIDGET_CLASS (gtk_foo_bar_parent_class)->key_press_event (widget, event); + * } + * ]| + * + * Return value: %TRUE if the input method handled the key event. + * + * Since: 2.22 + */ +gboolean +gtk_text_view_im_context_filter_keypress (GtkTextView *text_view, + GdkEventKey *event) +{ + g_return_val_if_fail (GTK_IS_TEXT_VIEW (text_view), FALSE); + + return gtk_im_context_filter_keypress (text_view->im_context, event); +} + /* * DND feature */ @@ -7037,6 +7122,42 @@ gtk_text_view_drag_data_received (GtkWidget *widget, } } +/** + * gtk_text_view_get_hadjustment: + * @text_view: a #GtkTextView + * + * Gets the horizontal-scrolling #GtkAdjustment. + * + * Returns: (transfer none): pointer to the horizontal #GtkAdjustment + * + * Since: 2.22 + **/ +GtkAdjustment* +gtk_text_view_get_hadjustment (GtkTextView *text_view) +{ + g_return_val_if_fail (GTK_IS_TEXT_VIEW (text_view), NULL); + + return get_hadjustment (text_view); +} + +/** + * gtk_text_view_get_vadjustment: + * @text_view: a #GtkTextView + * + * Gets the vertical-scrolling #GtkAdjustment. + * + * Returns: (transfer none): pointer to the vertical #GtkAdjustment + * + * Since: 2.22 + **/ +GtkAdjustment* +gtk_text_view_get_vadjustment (GtkTextView *text_view) +{ + g_return_val_if_fail (GTK_IS_TEXT_VIEW (text_view), NULL); + + return get_vadjustment (text_view); +} + static GtkAdjustment* get_hadjustment (GtkTextView *text_view) { @@ -8441,8 +8562,8 @@ buffer_to_text_window (GtkTextView *text_view, * @win: a #GtkTextWindowType except #GTK_TEXT_WINDOW_PRIVATE * @buffer_x: buffer x coordinate * @buffer_y: buffer y coordinate - * @window_x: window x coordinate return location - * @window_y: window y coordinate return location + * @window_x: (out) (allow-none): window x coordinate return location or %NULL + * @window_y: (out) (allow-none): window y coordinate return location or %NULL * * Converts coordinate (@buffer_x, @buffer_y) to coordinates for the window * @win, and stores the result in (@window_x, @window_y). @@ -8581,8 +8702,8 @@ text_window_to_buffer (GtkTextView *text_view, * @win: a #GtkTextWindowType except #GTK_TEXT_WINDOW_PRIVATE * @window_x: window x coordinate * @window_y: window y coordinate - * @buffer_x: buffer x coordinate return location - * @buffer_y: buffer y coordinate return location + * @buffer_x: (out) (allow-none): buffer x coordinate return location or %NULL + * @buffer_y: (out) (allow-none): buffer y coordinate return location or %NULL * * Converts coordinates on the window identified by @win to buffer * coordinates, storing the result in (@buffer_x,@buffer_y). diff --git a/gtk/gtktextview.h b/gtk/gtktextview.h index 2dfe23ff42..a8d65dc360 100644 --- a/gtk/gtktextview.h +++ b/gtk/gtktextview.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -279,6 +279,9 @@ void gtk_text_view_window_to_buffer_coords (GtkTextView *text_view, gint *buffer_x, gint *buffer_y); +GtkAdjustment* gtk_text_view_get_hadjustment (GtkTextView *text_view); +GtkAdjustment* gtk_text_view_get_vadjustment (GtkTextView *text_view); + GdkWindow* gtk_text_view_get_window (GtkTextView *text_view, GtkTextWindowType win); GtkTextWindowType gtk_text_view_get_window_type (GtkTextView *text_view, @@ -304,6 +307,10 @@ gboolean gtk_text_view_move_visually (GtkTextView *text_v GtkTextIter *iter, gint count); +gboolean gtk_text_view_im_context_filter_keypress (GtkTextView *text_view, + GdkEventKey *event); +void gtk_text_view_reset_im_context (GtkTextView *text_view); + /* Adding child widgets */ void gtk_text_view_add_child_at_anchor (GtkTextView *text_view, GtkWidget *child, diff --git a/gtk/gtktipsquery.c b/gtk/gtktipsquery.c deleted file mode 100644 index 4963de2288..0000000000 --- a/gtk/gtktipsquery.c +++ /dev/null @@ -1,524 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * GtkQueryTips: Query onscreen widgets for their tooltips - * Copyright (C) 1998 Tim Janik - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#undef GTK_DISABLE_DEPRECATED - -#include "config.h" -#include "gtktipsquery.h" -#include "gtksignal.h" -#include "gtktooltips.h" -#include "gtkmain.h" -#include "gtkmarshalers.h" -#include "gtkintl.h" - -#include "gtkalias.h" - - - -/* --- arguments --- */ -enum { - ARG_0, - ARG_EMIT_ALWAYS, - ARG_CALLER, - ARG_LABEL_INACTIVE, - ARG_LABEL_NO_TIP -}; - - -/* --- signals --- */ -enum -{ - SIGNAL_START_QUERY, - SIGNAL_STOP_QUERY, - SIGNAL_WIDGET_ENTERED, - SIGNAL_WIDGET_SELECTED, - SIGNAL_LAST -}; - -/* --- prototypes --- */ -static void gtk_tips_query_class_init (GtkTipsQueryClass *class); -static void gtk_tips_query_init (GtkTipsQuery *tips_query); -static void gtk_tips_query_destroy (GtkObject *object); -static gint gtk_tips_query_event (GtkWidget *widget, - GdkEvent *event); -static void gtk_tips_query_set_arg (GtkObject *object, - GtkArg *arg, - guint arg_id); -static void gtk_tips_query_get_arg (GtkObject *object, - GtkArg *arg, - guint arg_id); -static void gtk_tips_query_real_start_query (GtkTipsQuery *tips_query); -static void gtk_tips_query_real_stop_query (GtkTipsQuery *tips_query); -static void gtk_tips_query_widget_entered (GtkTipsQuery *tips_query, - GtkWidget *widget, - const gchar *tip_text, - const gchar *tip_private); - - -/* --- variables --- */ -static GtkLabelClass *parent_class = NULL; -static guint tips_query_signals[SIGNAL_LAST] = { 0 }; - - -/* --- functions --- */ -GtkType -gtk_tips_query_get_type (void) -{ - static GtkType tips_query_type = 0; - - if (!tips_query_type) - { - static const GtkTypeInfo tips_query_info = - { - "GtkTipsQuery", - sizeof (GtkTipsQuery), - sizeof (GtkTipsQueryClass), - (GtkClassInitFunc) gtk_tips_query_class_init, - (GtkObjectInitFunc) gtk_tips_query_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, - }; - - I_("GtkTipsQuery"); - tips_query_type = gtk_type_unique (gtk_label_get_type (), &tips_query_info); - } - - return tips_query_type; -} - -static void -gtk_tips_query_class_init (GtkTipsQueryClass *class) -{ - GtkObjectClass *object_class; - GtkWidgetClass *widget_class; - - object_class = (GtkObjectClass*) class; - widget_class = (GtkWidgetClass*) class; - - parent_class = gtk_type_class (gtk_label_get_type ()); - - - object_class->set_arg = gtk_tips_query_set_arg; - object_class->get_arg = gtk_tips_query_get_arg; - object_class->destroy = gtk_tips_query_destroy; - - widget_class->event = gtk_tips_query_event; - - class->start_query = gtk_tips_query_real_start_query; - class->stop_query = gtk_tips_query_real_stop_query; - class->widget_entered = gtk_tips_query_widget_entered; - class->widget_selected = NULL; - - gtk_object_add_arg_type ("GtkTipsQuery::emit-always", GTK_TYPE_BOOL, GTK_ARG_READWRITE | G_PARAM_STATIC_NAME, ARG_EMIT_ALWAYS); - gtk_object_add_arg_type ("GtkTipsQuery::caller", GTK_TYPE_WIDGET, GTK_ARG_READWRITE | G_PARAM_STATIC_NAME, ARG_CALLER); - gtk_object_add_arg_type ("GtkTipsQuery::label-inactive", GTK_TYPE_STRING, GTK_ARG_READWRITE | G_PARAM_STATIC_NAME, ARG_LABEL_INACTIVE); - gtk_object_add_arg_type ("GtkTipsQuery::label-no-tip", GTK_TYPE_STRING, GTK_ARG_READWRITE | G_PARAM_STATIC_NAME, ARG_LABEL_NO_TIP); - - tips_query_signals[SIGNAL_START_QUERY] = - gtk_signal_new (I_("start-query"), - GTK_RUN_FIRST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkTipsQueryClass, start_query), - _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); - tips_query_signals[SIGNAL_STOP_QUERY] = - gtk_signal_new (I_("stop-query"), - GTK_RUN_FIRST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkTipsQueryClass, stop_query), - _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); - tips_query_signals[SIGNAL_WIDGET_ENTERED] = - gtk_signal_new (I_("widget-entered"), - GTK_RUN_LAST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkTipsQueryClass, widget_entered), - _gtk_marshal_VOID__OBJECT_STRING_STRING, - GTK_TYPE_NONE, 3, - GTK_TYPE_WIDGET, - GTK_TYPE_STRING, - GTK_TYPE_STRING); - tips_query_signals[SIGNAL_WIDGET_SELECTED] = - g_signal_new (I_("widget-selected"), - G_TYPE_FROM_CLASS(object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET(GtkTipsQueryClass, widget_selected), - _gtk_boolean_handled_accumulator, NULL, - _gtk_marshal_BOOLEAN__OBJECT_STRING_STRING_BOXED, - G_TYPE_BOOLEAN, 4, - GTK_TYPE_WIDGET, - G_TYPE_STRING, - G_TYPE_STRING, - GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); -} - -static void -gtk_tips_query_init (GtkTipsQuery *tips_query) -{ - tips_query->emit_always = FALSE; - tips_query->in_query = FALSE; - tips_query->label_inactive = g_strdup (""); - tips_query->label_no_tip = g_strdup (_("--- No Tip ---")); - tips_query->caller = NULL; - tips_query->last_crossed = NULL; - tips_query->query_cursor = NULL; - - gtk_label_set_text (GTK_LABEL (tips_query), tips_query->label_inactive); -} - -static void -gtk_tips_query_set_arg (GtkObject *object, - GtkArg *arg, - guint arg_id) -{ - GtkTipsQuery *tips_query; - - tips_query = GTK_TIPS_QUERY (object); - - switch (arg_id) - { - case ARG_EMIT_ALWAYS: - tips_query->emit_always = (GTK_VALUE_BOOL (*arg) != FALSE); - break; - case ARG_CALLER: - gtk_tips_query_set_caller (tips_query, GTK_WIDGET (GTK_VALUE_OBJECT (*arg))); - break; - case ARG_LABEL_INACTIVE: - gtk_tips_query_set_labels (tips_query, GTK_VALUE_STRING (*arg), tips_query->label_no_tip); - break; - case ARG_LABEL_NO_TIP: - gtk_tips_query_set_labels (tips_query, tips_query->label_inactive, GTK_VALUE_STRING (*arg)); - break; - default: - break; - } -} - -static void -gtk_tips_query_get_arg (GtkObject *object, - GtkArg *arg, - guint arg_id) -{ - GtkTipsQuery *tips_query; - - tips_query = GTK_TIPS_QUERY (object); - - switch (arg_id) - { - case ARG_EMIT_ALWAYS: - GTK_VALUE_BOOL (*arg) = tips_query->emit_always; - break; - case ARG_CALLER: - GTK_VALUE_OBJECT (*arg) = (GtkObject*) tips_query->caller; - break; - case ARG_LABEL_INACTIVE: - GTK_VALUE_STRING (*arg) = g_strdup (tips_query->label_inactive); - break; - case ARG_LABEL_NO_TIP: - GTK_VALUE_STRING (*arg) = g_strdup (tips_query->label_no_tip); - break; - default: - arg->type = GTK_TYPE_INVALID; - break; - } -} - -static void -gtk_tips_query_destroy (GtkObject *object) -{ - GtkTipsQuery *tips_query = GTK_TIPS_QUERY (object); - - if (tips_query->in_query) - gtk_tips_query_stop_query (tips_query); - - gtk_tips_query_set_caller (tips_query, NULL); - - g_free (tips_query->label_inactive); - tips_query->label_inactive = NULL; - g_free (tips_query->label_no_tip); - tips_query->label_no_tip = NULL; - - GTK_OBJECT_CLASS (parent_class)->destroy (object); -} - -GtkWidget* -gtk_tips_query_new (void) -{ - GtkTipsQuery *tips_query; - - tips_query = gtk_type_new (gtk_tips_query_get_type ()); - - return GTK_WIDGET (tips_query); -} - -void -gtk_tips_query_set_labels (GtkTipsQuery *tips_query, - const gchar *label_inactive, - const gchar *label_no_tip) -{ - gchar *old; - - g_return_if_fail (GTK_IS_TIPS_QUERY (tips_query)); - g_return_if_fail (label_inactive != NULL); - g_return_if_fail (label_no_tip != NULL); - - old = tips_query->label_inactive; - tips_query->label_inactive = g_strdup (label_inactive); - g_free (old); - old = tips_query->label_no_tip; - tips_query->label_no_tip = g_strdup (label_no_tip); - g_free (old); -} - -void -gtk_tips_query_set_caller (GtkTipsQuery *tips_query, - GtkWidget *caller) -{ - g_return_if_fail (GTK_IS_TIPS_QUERY (tips_query)); - g_return_if_fail (tips_query->in_query == FALSE); - if (caller) - g_return_if_fail (GTK_IS_WIDGET (caller)); - - if (caller) - g_object_ref (caller); - - if (tips_query->caller) - g_object_unref (tips_query->caller); - - tips_query->caller = caller; -} - -void -gtk_tips_query_start_query (GtkTipsQuery *tips_query) -{ - g_return_if_fail (GTK_IS_TIPS_QUERY (tips_query)); - g_return_if_fail (tips_query->in_query == FALSE); - g_return_if_fail (gtk_widget_get_realized (GTK_WIDGET (tips_query))); - - tips_query->in_query = TRUE; - gtk_signal_emit (GTK_OBJECT (tips_query), tips_query_signals[SIGNAL_START_QUERY]); -} - -void -gtk_tips_query_stop_query (GtkTipsQuery *tips_query) -{ - g_return_if_fail (GTK_IS_TIPS_QUERY (tips_query)); - g_return_if_fail (tips_query->in_query == TRUE); - - gtk_signal_emit (GTK_OBJECT (tips_query), tips_query_signals[SIGNAL_STOP_QUERY]); - tips_query->in_query = FALSE; -} - -static void -gtk_tips_query_real_start_query (GtkTipsQuery *tips_query) -{ - gint failure; - - g_return_if_fail (GTK_IS_TIPS_QUERY (tips_query)); - - tips_query->query_cursor = gdk_cursor_new_for_display (gtk_widget_get_display (GTK_WIDGET (tips_query)), - GDK_QUESTION_ARROW); - failure = gdk_pointer_grab (GTK_WIDGET (tips_query)->window, - TRUE, - GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | - GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK, - NULL, - tips_query->query_cursor, - GDK_CURRENT_TIME); - if (failure) - { - gdk_cursor_unref (tips_query->query_cursor); - tips_query->query_cursor = NULL; - } - gtk_grab_add (GTK_WIDGET (tips_query)); -} - -static void -gtk_tips_query_real_stop_query (GtkTipsQuery *tips_query) -{ - g_return_if_fail (GTK_IS_TIPS_QUERY (tips_query)); - - gtk_grab_remove (GTK_WIDGET (tips_query)); - if (tips_query->query_cursor) - { - gdk_display_pointer_ungrab (gtk_widget_get_display (GTK_WIDGET (tips_query)), - GDK_CURRENT_TIME); - gdk_cursor_unref (tips_query->query_cursor); - tips_query->query_cursor = NULL; - } - if (tips_query->last_crossed) - { - g_object_unref (tips_query->last_crossed); - tips_query->last_crossed = NULL; - } - - gtk_label_set_text (GTK_LABEL (tips_query), tips_query->label_inactive); -} - -static void -gtk_tips_query_widget_entered (GtkTipsQuery *tips_query, - GtkWidget *widget, - const gchar *tip_text, - const gchar *tip_private) -{ - g_return_if_fail (GTK_IS_TIPS_QUERY (tips_query)); - - if (!tip_text) - tip_text = tips_query->label_no_tip; - - if (!g_str_equal (GTK_LABEL (tips_query)->label, (gchar*) tip_text)) - gtk_label_set_text (GTK_LABEL (tips_query), tip_text); -} - -static void -gtk_tips_query_emit_widget_entered (GtkTipsQuery *tips_query, - GtkWidget *widget) -{ - GtkTooltipsData *tdata; - - if (widget == (GtkWidget*) tips_query) - widget = NULL; - - if (widget) - tdata = gtk_tooltips_data_get (widget); - else - tdata = NULL; - - if (!widget && tips_query->last_crossed) - { - gtk_signal_emit (GTK_OBJECT (tips_query), - tips_query_signals[SIGNAL_WIDGET_ENTERED], - NULL, - NULL, - NULL); - g_object_unref (tips_query->last_crossed); - tips_query->last_crossed = NULL; - } - else if (widget && widget != tips_query->last_crossed) - { - g_object_ref (widget); - if (tdata || tips_query->emit_always) - gtk_signal_emit (GTK_OBJECT (tips_query), - tips_query_signals[SIGNAL_WIDGET_ENTERED], - widget, - tdata ? tdata->tip_text : NULL, - tdata ? tdata->tip_private : NULL); - if (tips_query->last_crossed) - g_object_unref (tips_query->last_crossed); - tips_query->last_crossed = widget; - } -} - -static gint -gtk_tips_query_event (GtkWidget *widget, - GdkEvent *event) -{ - GtkTipsQuery *tips_query; - GtkWidget *event_widget; - gboolean event_handled; - - g_return_val_if_fail (GTK_IS_TIPS_QUERY (widget), FALSE); - - tips_query = GTK_TIPS_QUERY (widget); - if (!tips_query->in_query) - { - if (GTK_WIDGET_CLASS (parent_class)->event) - return GTK_WIDGET_CLASS (parent_class)->event (widget, event); - else - return FALSE; - } - - event_widget = gtk_get_event_widget (event); - - event_handled = FALSE; - switch (event->type) - { - GdkWindow *pointer_window; - - case GDK_LEAVE_NOTIFY: - if (event_widget) - pointer_window = gdk_window_get_pointer (event_widget->window, NULL, NULL, NULL); - else - pointer_window = NULL; - event_widget = NULL; - if (pointer_window) - { - gpointer event_widget_ptr; - gdk_window_get_user_data (pointer_window, &event_widget_ptr); - event_widget = event_widget_ptr; - } - gtk_tips_query_emit_widget_entered (tips_query, event_widget); - event_handled = TRUE; - break; - - case GDK_ENTER_NOTIFY: - gtk_tips_query_emit_widget_entered (tips_query, event_widget); - event_handled = TRUE; - break; - - case GDK_BUTTON_PRESS: - case GDK_BUTTON_RELEASE: - if (event_widget) - { - if (event_widget == (GtkWidget*) tips_query || - event_widget == tips_query->caller) - gtk_tips_query_stop_query (tips_query); - else - { - gint stop; - GtkTooltipsData *tdata; - - stop = TRUE; - tdata = gtk_tooltips_data_get (event_widget); - if (tdata || tips_query->emit_always) - gtk_signal_emit (GTK_OBJECT (tips_query), - tips_query_signals[SIGNAL_WIDGET_SELECTED], - event_widget, - tdata ? tdata->tip_text : NULL, - tdata ? tdata->tip_private : NULL, - event, - &stop); - - if (stop) - gtk_tips_query_stop_query (tips_query); - } - } - event_handled = TRUE; - break; - - default: - break; - } - - return event_handled; -} - -#define __GTK_TIPS_QUERY_C__ -#include "gtkaliasdef.c" diff --git a/gtk/gtktipsquery.h b/gtk/gtktipsquery.h deleted file mode 100644 index b792d81219..0000000000 --- a/gtk/gtktipsquery.h +++ /dev/null @@ -1,110 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * GtkQueryTips: Query onscreen widgets for their tooltips - * Copyright (C) 1998 Tim Janik - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#ifndef GTK_DISABLE_DEPRECATED - -#ifndef __GTK_TIPS_QUERY_H__ -#define __GTK_TIPS_QUERY_H__ - - -#include - - -G_BEGIN_DECLS - -/* --- type macros --- */ -#define GTK_TYPE_TIPS_QUERY (gtk_tips_query_get_type ()) -#define GTK_TIPS_QUERY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TIPS_QUERY, GtkTipsQuery)) -#define GTK_TIPS_QUERY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TIPS_QUERY, GtkTipsQueryClass)) -#define GTK_IS_TIPS_QUERY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TIPS_QUERY)) -#define GTK_IS_TIPS_QUERY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TIPS_QUERY)) -#define GTK_TIPS_QUERY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TIPS_QUERY, GtkTipsQueryClass)) - - -/* --- typedefs --- */ -typedef struct _GtkTipsQuery GtkTipsQuery; -typedef struct _GtkTipsQueryClass GtkTipsQueryClass; - - -/* --- structures --- */ -struct _GtkTipsQuery -{ - GtkLabel label; - - guint emit_always : 1; - guint in_query : 1; - gchar *label_inactive; - gchar *label_no_tip; - - GtkWidget *caller; - GtkWidget *last_crossed; - - GdkCursor *query_cursor; -}; - -struct _GtkTipsQueryClass -{ - GtkLabelClass parent_class; - - void (*start_query) (GtkTipsQuery *tips_query); - void (*stop_query) (GtkTipsQuery *tips_query); - void (*widget_entered) (GtkTipsQuery *tips_query, - GtkWidget *widget, - const gchar *tip_text, - const gchar *tip_private); - gint (*widget_selected) (GtkTipsQuery *tips_query, - GtkWidget *widget, - const gchar *tip_text, - const gchar *tip_private, - GdkEventButton *event); - - /* Padding for future expansion */ - void (*_gtk_reserved1) (void); - void (*_gtk_reserved2) (void); - void (*_gtk_reserved3) (void); - void (*_gtk_reserved4) (void); -}; - - -/* --- prototypes --- */ -GType gtk_tips_query_get_type (void) G_GNUC_CONST; -GtkWidget* gtk_tips_query_new (void); -void gtk_tips_query_start_query (GtkTipsQuery *tips_query); -void gtk_tips_query_stop_query (GtkTipsQuery *tips_query); -void gtk_tips_query_set_caller (GtkTipsQuery *tips_query, - GtkWidget *caller); -void gtk_tips_query_set_labels (GtkTipsQuery *tips_query, - const gchar *label_inactive, - const gchar *label_no_tip); - -G_END_DECLS - -#endif /* __GTK_TIPS_QUERY_H__ */ - -#endif /* GTK_DISABLE_DEPRECATED */ diff --git a/gtk/gtktoggleaction.c b/gtk/gtktoggleaction.c index 6e464d72e9..5a144bb42d 100644 --- a/gtk/gtktoggleaction.c +++ b/gtk/gtktoggleaction.c @@ -39,6 +39,17 @@ #include "gtkprivate.h" #include "gtkalias.h" + +/** + * SECTION:gtktoggleaction + * @Short_description: An action which can be toggled between two states + * @Title: GtkToggleAction + * + * A #GtkToggleAction corresponds roughly to a #GtkCheckMenuItem. It has an + * "active" state specifying whether the action has been checked or not. + */ + + enum { TOGGLED, @@ -120,7 +131,13 @@ gtk_toggle_action_class_init (GtkToggleActionClass *klass) P_("If the toggle action should be active in or not"), FALSE, GTK_PARAM_READWRITE)); - + /** + * GtkToggleAction::toggled: + * @toggleaction: the object which received the signal. + * + * Should be connected if you wish to perform an action + * whenever the #GtkToggleAction state is changed. + */ action_signals[TOGGLED] = g_signal_new (I_("toggled"), G_OBJECT_CLASS_TYPE (klass), @@ -275,7 +292,7 @@ gtk_toggle_action_set_active (GtkToggleAction *action, * @action: the action object * * Returns the checked state of the toggle action. - + * * Returns: the checked state of the toggle action * * Since: 2.4 diff --git a/gtk/gtktoggleaction.h b/gtk/gtktoggleaction.h index 5f72546326..2cdf3fd184 100644 --- a/gtk/gtktoggleaction.h +++ b/gtk/gtktoggleaction.h @@ -28,7 +28,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtktogglebutton.h b/gtk/gtktogglebutton.h index 686dab8614..321b472ffb 100644 --- a/gtk/gtktogglebutton.h +++ b/gtk/gtktogglebutton.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -88,10 +88,6 @@ void gtk_toggle_button_set_inconsistent (GtkToggleButton *toggle_button, gboolean gtk_toggle_button_get_inconsistent (GtkToggleButton *toggle_button); -#ifndef GTK_DISABLE_DEPRECATED -#define gtk_toggle_button_set_state gtk_toggle_button_set_active -#endif /* GTK_DISABLE_DEPRECATED */ - G_END_DECLS #endif /* __GTK_TOGGLE_BUTTON_H__ */ diff --git a/gtk/gtktoggletoolbutton.h b/gtk/gtktoggletoolbutton.h index bc04d1e45e..90314327c9 100644 --- a/gtk/gtktoggletoolbutton.h +++ b/gtk/gtktoggletoolbutton.h @@ -20,7 +20,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c index b56abdf462..7042d47be0 100644 --- a/gtk/gtktoolbar.c +++ b/gtk/gtktoolbar.c @@ -29,7 +29,6 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#undef GTK_DISABLE_DEPRECATED #include "config.h" @@ -80,9 +79,6 @@ typedef struct _ToolbarContent ToolbarContent; #define SLIDE_SPEED 600.0 /* How fast the items slide, in pixels per second */ #define ACCEL_THRESHOLD 0.18 /* After how much time in seconds will items start speeding up */ -#define MIXED_API_WARNING \ - "Mixing deprecated and non-deprecated GtkToolbar API is not allowed" - /* Properties */ enum { @@ -111,18 +107,6 @@ enum { LAST_SIGNAL }; -/* API mode */ -typedef enum { - DONT_KNOW, - OLD_API, - NEW_API -} ApiMode; - -typedef enum { - TOOL_ITEM, - COMPATIBILITY -} ContentType; - typedef enum { NOT_ALLOCATED, NORMAL, @@ -139,7 +123,6 @@ struct _GtkToolbarPrivate GtkMenu * menu; GdkWindow * event_window; - ApiMode api_mode; GtkSettings * settings; int idle_id; GtkToolItem * highlight_tool_item; @@ -219,39 +202,18 @@ static void gtk_toolbar_arrow_button_clicked (GtkWidget *button, GtkToolbar *toolbar); static void gtk_toolbar_update_button_relief (GtkToolbar *toolbar); static gboolean gtk_toolbar_popup_menu (GtkWidget *toolbar); -static GtkWidget *internal_insert_element (GtkToolbar *toolbar, - GtkToolbarChildType type, - GtkWidget *widget, - const char *text, - const char *tooltip_text, - const char *tooltip_private_text, - GtkWidget *icon, - GCallback callback, - gpointer user_data, - gint position, - gboolean use_stock); static void gtk_toolbar_reconfigured (GtkToolbar *toolbar); -static gboolean gtk_toolbar_check_new_api (GtkToolbar *toolbar); -static gboolean gtk_toolbar_check_old_api (GtkToolbar *toolbar); static GtkReliefStyle get_button_relief (GtkToolbar *toolbar); static gint get_internal_padding (GtkToolbar *toolbar); static gint get_max_child_expand (GtkToolbar *toolbar); static GtkShadowType get_shadow_type (GtkToolbar *toolbar); -static gint get_space_size (GtkToolbar *toolbar); -static GtkToolbarSpaceStyle get_space_style (GtkToolbar *toolbar); /* methods on ToolbarContent 'class' */ static ToolbarContent *toolbar_content_new_tool_item (GtkToolbar *toolbar, GtkToolItem *item, gboolean is_placeholder, gint pos); -static ToolbarContent *toolbar_content_new_compatibility (GtkToolbar *toolbar, - GtkToolbarChildType type, - GtkWidget *widget, - GtkWidget *icon, - GtkWidget *label, - gint pos); static void toolbar_content_remove (ToolbarContent *content, GtkToolbar *toolbar); static void toolbar_content_free (ToolbarContent *content); @@ -503,23 +465,6 @@ gtk_toolbar_class_init (GtkToolbarClass *klass) P_("If an arrow should be shown if the toolbar doesn't fit"), TRUE, GTK_PARAM_READWRITE)); - - - /** - * GtkToolbar:tooltips: - * - * If the tooltips of the toolbar should be active or not. - * - * Since: 2.8 - */ - g_object_class_install_property (gobject_class, - PROP_TOOLTIPS, - g_param_spec_boolean ("tooltips", - P_("Tooltips"), - P_("If the tooltips of the toolbar should be active or not"), - TRUE, - GTK_PARAM_READWRITE)); - /** * GtkToolbar:icon-size: @@ -676,9 +621,7 @@ gtk_toolbar_init (GtkToolbar *toolbar) toolbar->style = DEFAULT_TOOLBAR_STYLE; toolbar->icon_size = DEFAULT_ICON_SIZE; priv->animation = DEFAULT_ANIMATION_STATE; - toolbar->tooltips = gtk_tooltips_new (); - g_object_ref_sink (toolbar->tooltips); - + priv->arrow_button = gtk_toggle_button_new (); g_signal_connect (priv->arrow_button, "button-press-event", G_CALLBACK (gtk_toolbar_arrow_button_press), toolbar); @@ -687,8 +630,6 @@ gtk_toolbar_init (GtkToolbar *toolbar) gtk_button_set_relief (GTK_BUTTON (priv->arrow_button), get_button_relief (toolbar)); - priv->api_mode = DONT_KNOW; - gtk_button_set_focus_on_click (GTK_BUTTON (priv->arrow_button), FALSE); priv->arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_NONE); @@ -728,9 +669,6 @@ gtk_toolbar_set_property (GObject *object, case PROP_SHOW_ARROW: gtk_toolbar_set_show_arrow (toolbar, g_value_get_boolean (value)); break; - case PROP_TOOLTIPS: - gtk_toolbar_set_tooltips (toolbar, g_value_get_boolean (value)); - break; case PROP_ICON_SIZE: gtk_toolbar_set_icon_size (toolbar, g_value_get_int (value)); break; @@ -766,9 +704,6 @@ gtk_toolbar_get_property (GObject *object, case PROP_SHOW_ARROW: g_value_set_boolean (value, priv->show_arrow); break; - case PROP_TOOLTIPS: - g_value_set_boolean (value, gtk_toolbar_get_tooltips (toolbar)); - break; case PROP_ICON_SIZE: g_value_set_int (value, gtk_toolbar_get_icon_size (toolbar)); break; @@ -968,7 +903,7 @@ gtk_toolbar_size_request (GtkWidget *widget, pack_front_size += size; } - if (priv->show_arrow && priv->api_mode == NEW_API) + if (priv->show_arrow) { gtk_widget_size_request (priv->arrow_button, &arrow_requisition); @@ -1533,7 +1468,6 @@ gtk_toolbar_size_allocate (GtkWidget *widget, if (needed_size > available_size && !need_arrow && priv->show_arrow && - priv->api_mode == NEW_API && toolbar_content_has_proxy_menu_item (content) && !toolbar_content_is_separator (content)) { @@ -1718,7 +1652,7 @@ gtk_toolbar_size_allocate (GtkWidget *widget, new_states[i] != NORMAL) { /* an item disappeared and we didn't change size, so begin sliding */ - if (!size_changed && priv->api_mode == NEW_API) + if (!size_changed) gtk_toolbar_begin_sliding (toolbar); } } @@ -2283,8 +2217,6 @@ gtk_toolbar_set_drop_highlight_item (GtkToolbar *toolbar, g_return_if_fail (GTK_IS_TOOLBAR (toolbar)); g_return_if_fail (tool_item == NULL || GTK_IS_TOOL_ITEM (tool_item)); - gtk_toolbar_check_new_api (toolbar); - priv = GTK_TOOLBAR_GET_PRIVATE (toolbar); if (!tool_item) @@ -2466,10 +2398,7 @@ gtk_toolbar_add (GtkContainer *container, { GtkToolbar *toolbar = GTK_TOOLBAR (container); - if (GTK_IS_TOOL_ITEM (widget)) - gtk_toolbar_insert (toolbar, GTK_TOOL_ITEM (widget), -1); - else - gtk_toolbar_append_widget (toolbar, widget, NULL, NULL); + gtk_toolbar_insert (toolbar, GTK_TOOL_ITEM (widget), -1); } static void @@ -2763,9 +2692,6 @@ gtk_toolbar_insert (GtkToolbar *toolbar, g_return_if_fail (GTK_IS_TOOLBAR (toolbar)); g_return_if_fail (GTK_IS_TOOL_ITEM (item)); - if (!gtk_toolbar_check_new_api (toolbar)) - return; - if (pos >= 0) pos = logical_to_physical (toolbar, pos); @@ -2796,9 +2722,6 @@ gtk_toolbar_get_item_index (GtkToolbar *toolbar, g_return_val_if_fail (GTK_IS_TOOL_ITEM (item), -1); g_return_val_if_fail (GTK_WIDGET (item)->parent == GTK_WIDGET (toolbar), -1); - if (!gtk_toolbar_check_new_api (toolbar)) - return -1; - priv = GTK_TOOLBAR_GET_PRIVATE (toolbar); n = 0; @@ -2818,43 +2741,6 @@ gtk_toolbar_get_item_index (GtkToolbar *toolbar, return physical_to_logical (toolbar, n); } -/** - * gtk_toolbar_set_orientation: - * @toolbar: a #GtkToolbar. - * @orientation: a new #GtkOrientation. - * - * Sets whether a toolbar should appear horizontally or vertically. - * - * Deprecated: 2.16: Use gtk_orientable_set_orientation() instead. - **/ -void -gtk_toolbar_set_orientation (GtkToolbar *toolbar, - GtkOrientation orientation) -{ - g_return_if_fail (GTK_IS_TOOLBAR (toolbar)); - - g_signal_emit (toolbar, toolbar_signals[ORIENTATION_CHANGED], 0, orientation); -} - -/** - * gtk_toolbar_get_orientation: - * @toolbar: a #GtkToolbar - * - * Retrieves the current orientation of the toolbar. See - * gtk_toolbar_set_orientation(). - * - * Return value: the orientation - * - * Deprecated: 2.16: Use gtk_orientable_get_orientation() instead. - **/ -GtkOrientation -gtk_toolbar_get_orientation (GtkToolbar *toolbar) -{ - g_return_val_if_fail (GTK_IS_TOOLBAR (toolbar), GTK_ORIENTATION_HORIZONTAL); - - return toolbar->orientation; -} - /** * gtk_toolbar_set_style: * @toolbar: a #GtkToolbar. @@ -2921,50 +2807,6 @@ gtk_toolbar_unset_style (GtkToolbar *toolbar) } } -/** - * gtk_toolbar_set_tooltips: - * @toolbar: a #GtkToolbar. - * @enable: set to %FALSE to disable the tooltips, or %TRUE to enable them. - * - * Sets if the tooltips of a toolbar should be active or not. - * - * Deprecated: 2.14: The toolkit-wide #GtkSettings:gtk-enable-tooltips property - * is now used instead. - **/ -void -gtk_toolbar_set_tooltips (GtkToolbar *toolbar, - gboolean enable) -{ - g_return_if_fail (GTK_IS_TOOLBAR (toolbar)); - - if (enable) - gtk_tooltips_enable (toolbar->tooltips); - else - gtk_tooltips_disable (toolbar->tooltips); - - g_object_notify (G_OBJECT (toolbar), "tooltips"); -} - -/** - * gtk_toolbar_get_tooltips: - * @toolbar: a #GtkToolbar - * - * Retrieves whether tooltips are enabled. See - * gtk_toolbar_set_tooltips(). - * - * Return value: %TRUE if tooltips are enabled - * - * Deprecated: 2.14: The toolkit-wide #GtkSettings:gtk-enable-tooltips property - * is now used instead. - **/ -gboolean -gtk_toolbar_get_tooltips (GtkToolbar *toolbar) -{ - g_return_val_if_fail (GTK_IS_TOOLBAR (toolbar), FALSE); - - return TRUE; -} - /** * gtk_toolbar_get_n_items: * @toolbar: a #GtkToolbar @@ -2982,9 +2824,6 @@ gtk_toolbar_get_n_items (GtkToolbar *toolbar) g_return_val_if_fail (GTK_IS_TOOLBAR (toolbar), -1); - if (!gtk_toolbar_check_new_api (toolbar)) - return -1; - priv = GTK_TOOLBAR_GET_PRIVATE (toolbar); return physical_to_logical (toolbar, g_list_length (priv->content)); @@ -3013,9 +2852,6 @@ gtk_toolbar_get_nth_item (GtkToolbar *toolbar, g_return_val_if_fail (GTK_IS_TOOLBAR (toolbar), NULL); - if (!gtk_toolbar_check_new_api (toolbar)) - return NULL; - n_items = gtk_toolbar_get_n_items (toolbar); if (n < 0 || n >= n_items) @@ -3120,9 +2956,6 @@ gtk_toolbar_get_show_arrow (GtkToolbar *toolbar) g_return_val_if_fail (GTK_IS_TOOLBAR (toolbar), FALSE); - if (!gtk_toolbar_check_new_api (toolbar)) - return FALSE; - priv = GTK_TOOLBAR_GET_PRIVATE (toolbar); return priv->show_arrow; @@ -3152,9 +2985,6 @@ gtk_toolbar_get_drop_index (GtkToolbar *toolbar, { g_return_val_if_fail (GTK_IS_TOOLBAR (toolbar), -1); - if (!gtk_toolbar_check_new_api (toolbar)) - return -1; - return physical_to_logical (toolbar, find_drop_index (toolbar, x, y)); } @@ -3165,9 +2995,6 @@ gtk_toolbar_finalize (GObject *object) GtkToolbar *toolbar = GTK_TOOLBAR (object); GtkToolbarPrivate *priv = GTK_TOOLBAR_GET_PRIVATE (toolbar); - if (toolbar->tooltips) - g_object_unref (toolbar->tooltips); - if (priv->arrow_button) gtk_widget_unparent (priv->arrow_button); @@ -3269,628 +3096,6 @@ gtk_toolbar_unset_icon_size (GtkToolbar *toolbar) } } -/* - * Deprecated API - */ - -/** - * gtk_toolbar_append_item: - * @toolbar: a #GtkToolbar. - * @text: give your toolbar button a label. - * @tooltip_text: a string that appears when the user holds the mouse over this item. - * @tooltip_private_text: use with #GtkTipsQuery. - * @icon: a #GtkWidget that should be used as the button's icon. - * @callback: the function to be executed when the button is pressed. - * @user_data: a pointer to any data you wish to be passed to the callback. - * - * Inserts a new item into the toolbar. You must specify the position - * in the toolbar where it will be inserted. - * - * @callback must be a pointer to a function taking a #GtkWidget and a gpointer as - * arguments. Use G_CALLBACK() to cast the function to #GCallback. - * - * Return value: the new toolbar item as a #GtkWidget. - * - * Deprecated: 2.4: Use gtk_toolbar_insert() instead. - **/ -GtkWidget * -gtk_toolbar_append_item (GtkToolbar *toolbar, - const char *text, - const char *tooltip_text, - const char *tooltip_private_text, - GtkWidget *icon, - GCallback callback, - gpointer user_data) -{ - return gtk_toolbar_insert_element (toolbar, GTK_TOOLBAR_CHILD_BUTTON, - NULL, text, - tooltip_text, tooltip_private_text, - icon, callback, user_data, - toolbar->num_children); -} - -/** - * gtk_toolbar_prepend_item: - * @toolbar: a #GtkToolbar. - * @text: give your toolbar button a label. - * @tooltip_text: a string that appears when the user holds the mouse over this item. - * @tooltip_private_text: use with #GtkTipsQuery. - * @icon: a #GtkWidget that should be used as the button's icon. - * @callback: the function to be executed when the button is pressed. - * @user_data: a pointer to any data you wish to be passed to the callback. - * - * Adds a new button to the beginning (top or left edges) of the given toolbar. - * - * @callback must be a pointer to a function taking a #GtkWidget and a gpointer as - * arguments. Use G_CALLBACK() to cast the function to #GCallback. - * - * Return value: the new toolbar item as a #GtkWidget. - * - * Deprecated: 2.4: Use gtk_toolbar_insert() instead. - **/ -GtkWidget * -gtk_toolbar_prepend_item (GtkToolbar *toolbar, - const char *text, - const char *tooltip_text, - const char *tooltip_private_text, - GtkWidget *icon, - GCallback callback, - gpointer user_data) -{ - return gtk_toolbar_insert_element (toolbar, GTK_TOOLBAR_CHILD_BUTTON, - NULL, text, - tooltip_text, tooltip_private_text, - icon, callback, user_data, - 0); -} - -/** - * gtk_toolbar_insert_item: - * @toolbar: a #GtkToolbar. - * @text: give your toolbar button a label. - * @tooltip_text: a string that appears when the user holds the mouse over this item. - * @tooltip_private_text: use with #GtkTipsQuery. - * @icon: a #GtkWidget that should be used as the button's icon. - * @callback: the function to be executed when the button is pressed. - * @user_data: a pointer to any data you wish to be passed to the callback. - * @position: the number of widgets to insert this item after. - * - * Inserts a new item into the toolbar. You must specify the position in the - * toolbar where it will be inserted. - * - * @callback must be a pointer to a function taking a #GtkWidget and a gpointer as - * arguments. Use G_CALLBACK() to cast the function to #GCallback. - * - * Return value: the new toolbar item as a #GtkWidget. - * - * Deprecated: 2.4: Use gtk_toolbar_insert() instead. - **/ -GtkWidget * -gtk_toolbar_insert_item (GtkToolbar *toolbar, - const char *text, - const char *tooltip_text, - const char *tooltip_private_text, - GtkWidget *icon, - GCallback callback, - gpointer user_data, - gint position) -{ - return gtk_toolbar_insert_element (toolbar, GTK_TOOLBAR_CHILD_BUTTON, - NULL, text, - tooltip_text, tooltip_private_text, - icon, callback, user_data, - position); -} - -/** - * gtk_toolbar_insert_stock: - * @toolbar: A #GtkToolbar - * @stock_id: The id of the stock item you want to insert - * @tooltip_text: The text in the tooltip of the toolbar button - * @tooltip_private_text: The private text of the tooltip - * @callback: The callback called when the toolbar button is clicked. - * @user_data: user data passed to callback - * @position: The position the button shall be inserted at. - * -1 means at the end. - * - * Inserts a stock item at the specified position of the toolbar. If - * @stock_id is not a known stock item ID, it's inserted verbatim, - * except that underscores used to mark mnemonics are removed. - * - * @callback must be a pointer to a function taking a #GtkWidget and a gpointer as - * arguments. Use G_CALLBACK() to cast the function to #GCallback. - * - * Returns: the inserted widget - * - * Deprecated: 2.4: Use gtk_toolbar_insert() instead. - */ -GtkWidget* -gtk_toolbar_insert_stock (GtkToolbar *toolbar, - const gchar *stock_id, - const char *tooltip_text, - const char *tooltip_private_text, - GCallback callback, - gpointer user_data, - gint position) -{ - return internal_insert_element (toolbar, GTK_TOOLBAR_CHILD_BUTTON, - NULL, stock_id, - tooltip_text, tooltip_private_text, - NULL, callback, user_data, - position, TRUE); -} - -/** - * gtk_toolbar_append_space: - * @toolbar: a #GtkToolbar. - * - * Adds a new space to the end of the toolbar. - * - * Deprecated: 2.4: Use gtk_toolbar_insert() instead. - **/ -void -gtk_toolbar_append_space (GtkToolbar *toolbar) -{ - gtk_toolbar_insert_element (toolbar, GTK_TOOLBAR_CHILD_SPACE, - NULL, NULL, - NULL, NULL, - NULL, NULL, NULL, - toolbar->num_children); -} - -/** - * gtk_toolbar_prepend_space: - * @toolbar: a #GtkToolbar. - * - * Adds a new space to the beginning of the toolbar. - * - * Deprecated: 2.4: Use gtk_toolbar_insert() instead. - **/ -void -gtk_toolbar_prepend_space (GtkToolbar *toolbar) -{ - gtk_toolbar_insert_element (toolbar, GTK_TOOLBAR_CHILD_SPACE, - NULL, NULL, - NULL, NULL, - NULL, NULL, NULL, - 0); -} - -/** - * gtk_toolbar_insert_space: - * @toolbar: a #GtkToolbar - * @position: the number of widgets after which a space should be inserted. - * - * Inserts a new space in the toolbar at the specified position. - * - * Deprecated: 2.4: Use gtk_toolbar_insert() instead. - **/ -void -gtk_toolbar_insert_space (GtkToolbar *toolbar, - gint position) -{ - gtk_toolbar_insert_element (toolbar, GTK_TOOLBAR_CHILD_SPACE, - NULL, NULL, - NULL, NULL, - NULL, NULL, NULL, - position); -} - -/** - * gtk_toolbar_remove_space: - * @toolbar: a #GtkToolbar. - * @position: the index of the space to remove. - * - * Removes a space from the specified position. - * - * Deprecated: 2.4: Use gtk_toolbar_insert() instead. - **/ -void -gtk_toolbar_remove_space (GtkToolbar *toolbar, - gint position) -{ - GtkToolbarPrivate *priv; - ToolbarContent *content; - - g_return_if_fail (GTK_IS_TOOLBAR (toolbar)); - - if (!gtk_toolbar_check_old_api (toolbar)) - return; - - priv = GTK_TOOLBAR_GET_PRIVATE (toolbar); - - content = g_list_nth_data (priv->content, position); - - if (!content) - { - g_warning ("Toolbar position %d doesn't exist", position); - return; - } - - if (!toolbar_content_is_separator (content)) - { - g_warning ("Toolbar position %d is not a space", position); - return; - } - - toolbar_content_remove (content, toolbar); - toolbar_content_free (content); -} - -/** - * gtk_toolbar_append_widget: - * @toolbar: a #GtkToolbar. - * @widget: a #GtkWidget to add to the toolbar. - * @tooltip_text: (allow-none): the element's tooltip. - * @tooltip_private_text: (allow-none): used for context-sensitive help about this toolbar element. - * - * Adds a widget to the end of the given toolbar. - * - * Deprecated: 2.4: Use gtk_toolbar_insert() instead. - **/ -void -gtk_toolbar_append_widget (GtkToolbar *toolbar, - GtkWidget *widget, - const gchar *tooltip_text, - const gchar *tooltip_private_text) -{ - gtk_toolbar_insert_element (toolbar, GTK_TOOLBAR_CHILD_WIDGET, - widget, NULL, - tooltip_text, tooltip_private_text, - NULL, NULL, NULL, - toolbar->num_children); -} - -/** - * gtk_toolbar_prepend_widget: - * @toolbar: a #GtkToolbar. - * @widget: a #GtkWidget to add to the toolbar. - * @tooltip_text: (allow-none): the element's tooltip. - * @tooltip_private_text: (allow-none): used for context-sensitive help about this toolbar element. - * - * Adds a widget to the beginning of the given toolbar. - * - * Deprecated: 2.4: Use gtk_toolbar_insert() instead. - **/ -void -gtk_toolbar_prepend_widget (GtkToolbar *toolbar, - GtkWidget *widget, - const gchar *tooltip_text, - const gchar *tooltip_private_text) -{ - gtk_toolbar_insert_element (toolbar, GTK_TOOLBAR_CHILD_WIDGET, - widget, NULL, - tooltip_text, tooltip_private_text, - NULL, NULL, NULL, - 0); -} - -/** - * gtk_toolbar_insert_widget: - * @toolbar: a #GtkToolbar. - * @widget: a #GtkWidget to add to the toolbar. - * @tooltip_text: (allow-none): the element's tooltip. - * @tooltip_private_text: (allow-none): used for context-sensitive help about this toolbar element. - * @position: the number of widgets to insert this widget after. - * - * Inserts a widget in the toolbar at the given position. - * - * Deprecated: 2.4: Use gtk_toolbar_insert() instead. - **/ -void -gtk_toolbar_insert_widget (GtkToolbar *toolbar, - GtkWidget *widget, - const char *tooltip_text, - const char *tooltip_private_text, - gint position) -{ - gtk_toolbar_insert_element (toolbar, GTK_TOOLBAR_CHILD_WIDGET, - widget, NULL, - tooltip_text, tooltip_private_text, - NULL, NULL, NULL, - position); -} - -/** - * gtk_toolbar_append_element: - * @toolbar: a #GtkToolbar. - * @type: a value of type #GtkToolbarChildType that determines what @widget will be. - * @widget: (allow-none): a #GtkWidget, or %NULL. - * @text: the element's label. - * @tooltip_text: the element's tooltip. - * @tooltip_private_text: used for context-sensitive help about this toolbar element. - * @icon: a #GtkWidget that provides pictorial representation of the element's function. - * @callback: the function to be executed when the button is pressed. - * @user_data: any data you wish to pass to the callback. - * - * Adds a new element to the end of a toolbar. - * - * If @type == %GTK_TOOLBAR_CHILD_WIDGET, @widget is used as the new element. - * If @type == %GTK_TOOLBAR_CHILD_RADIOBUTTON, @widget is used to determine - * the radio group for the new element. In all other cases, @widget must - * be %NULL. - * - * @callback must be a pointer to a function taking a #GtkWidget and a gpointer as - * arguments. Use G_CALLBACK() to cast the function to #GCallback. - * - * Return value: the new toolbar element as a #GtkWidget. - * - * Deprecated: 2.4: Use gtk_toolbar_insert() instead. - **/ -GtkWidget* -gtk_toolbar_append_element (GtkToolbar *toolbar, - GtkToolbarChildType type, - GtkWidget *widget, - const char *text, - const char *tooltip_text, - const char *tooltip_private_text, - GtkWidget *icon, - GCallback callback, - gpointer user_data) -{ - return gtk_toolbar_insert_element (toolbar, type, widget, text, - tooltip_text, tooltip_private_text, - icon, callback, user_data, - toolbar->num_children); -} - -/** - * gtk_toolbar_prepend_element: - * @toolbar: a #GtkToolbar. - * @type: a value of type #GtkToolbarChildType that determines what @widget will be. - * @widget: (allow-none): a #GtkWidget, or %NULL - * @text: the element's label. - * @tooltip_text: the element's tooltip. - * @tooltip_private_text: used for context-sensitive help about this toolbar element. - * @icon: a #GtkWidget that provides pictorial representation of the element's function. - * @callback: the function to be executed when the button is pressed. - * @user_data: any data you wish to pass to the callback. - * - * Adds a new element to the beginning of a toolbar. - * - * If @type == %GTK_TOOLBAR_CHILD_WIDGET, @widget is used as the new element. - * If @type == %GTK_TOOLBAR_CHILD_RADIOBUTTON, @widget is used to determine - * the radio group for the new element. In all other cases, @widget must - * be %NULL. - * - * @callback must be a pointer to a function taking a #GtkWidget and a gpointer as - * arguments. Use G_CALLBACK() to cast the function to #GCallback. - * - * Return value: the new toolbar element as a #GtkWidget. - * - * Deprecated: 2.4: Use gtk_toolbar_insert() instead. - **/ -GtkWidget * -gtk_toolbar_prepend_element (GtkToolbar *toolbar, - GtkToolbarChildType type, - GtkWidget *widget, - const char *text, - const char *tooltip_text, - const char *tooltip_private_text, - GtkWidget *icon, - GCallback callback, - gpointer user_data) -{ - return gtk_toolbar_insert_element (toolbar, type, widget, text, - tooltip_text, tooltip_private_text, - icon, callback, user_data, 0); -} - -/** - * gtk_toolbar_insert_element: - * @toolbar: a #GtkToolbar. - * @type: a value of type #GtkToolbarChildType that determines what @widget - * will be. - * @widget: (allow-none): a #GtkWidget, or %NULL. - * @text: the element's label. - * @tooltip_text: the element's tooltip. - * @tooltip_private_text: used for context-sensitive help about this toolbar element. - * @icon: a #GtkWidget that provides pictorial representation of the element's function. - * @callback: the function to be executed when the button is pressed. - * @user_data: any data you wish to pass to the callback. - * @position: the number of widgets to insert this element after. - * - * Inserts a new element in the toolbar at the given position. - * - * If @type == %GTK_TOOLBAR_CHILD_WIDGET, @widget is used as the new element. - * If @type == %GTK_TOOLBAR_CHILD_RADIOBUTTON, @widget is used to determine - * the radio group for the new element. In all other cases, @widget must - * be %NULL. - * - * @callback must be a pointer to a function taking a #GtkWidget and a gpointer as - * arguments. Use G_CALLBACK() to cast the function to #GCallback. - * - * Return value: the new toolbar element as a #GtkWidget. - * - * Deprecated: 2.4: Use gtk_toolbar_insert() instead. - **/ -GtkWidget * -gtk_toolbar_insert_element (GtkToolbar *toolbar, - GtkToolbarChildType type, - GtkWidget *widget, - const char *text, - const char *tooltip_text, - const char *tooltip_private_text, - GtkWidget *icon, - GCallback callback, - gpointer user_data, - gint position) -{ - return internal_insert_element (toolbar, type, widget, text, - tooltip_text, tooltip_private_text, - icon, callback, user_data, position, FALSE); -} - -static void -set_child_packing_and_visibility(GtkToolbar *toolbar, - GtkToolbarChild *child) -{ - GtkWidget *box; - gboolean expand; - - box = gtk_bin_get_child (GTK_BIN (child->widget)); - - g_return_if_fail (GTK_IS_BOX (box)); - - if (child->label) - { - expand = (toolbar->style != GTK_TOOLBAR_BOTH); - - gtk_box_set_child_packing (GTK_BOX (box), child->label, - expand, expand, 0, GTK_PACK_END); - - if (toolbar->style != GTK_TOOLBAR_ICONS) - gtk_widget_show (child->label); - else - gtk_widget_hide (child->label); - } - - if (child->icon) - { - expand = (toolbar->style != GTK_TOOLBAR_BOTH_HORIZ); - - gtk_box_set_child_packing (GTK_BOX (box), child->icon, - expand, expand, 0, GTK_PACK_END); - - if (toolbar->style != GTK_TOOLBAR_TEXT) - gtk_widget_show (child->icon); - else - gtk_widget_hide (child->icon); - } -} - -static GtkWidget * -internal_insert_element (GtkToolbar *toolbar, - GtkToolbarChildType type, - GtkWidget *widget, - const char *text, - const char *tooltip_text, - const char *tooltip_private_text, - GtkWidget *icon, - GCallback callback, - gpointer user_data, - gint position, - gboolean use_stock) -{ - GtkWidget *box; - ToolbarContent *content; - char *free_me = NULL; - - GtkWidget *child_widget; - GtkWidget *child_label; - GtkWidget *child_icon; - - g_return_val_if_fail (GTK_IS_TOOLBAR (toolbar), NULL); - if (type == GTK_TOOLBAR_CHILD_WIDGET) - g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); - else if (type != GTK_TOOLBAR_CHILD_RADIOBUTTON) - g_return_val_if_fail (widget == NULL, NULL); - if (GTK_IS_TOOL_ITEM (widget)) - g_warning (MIXED_API_WARNING); - - if (!gtk_toolbar_check_old_api (toolbar)) - return NULL; - - child_widget = NULL; - child_label = NULL; - child_icon = NULL; - - switch (type) - { - case GTK_TOOLBAR_CHILD_SPACE: - break; - - case GTK_TOOLBAR_CHILD_WIDGET: - child_widget = widget; - break; - - case GTK_TOOLBAR_CHILD_BUTTON: - case GTK_TOOLBAR_CHILD_TOGGLEBUTTON: - case GTK_TOOLBAR_CHILD_RADIOBUTTON: - if (type == GTK_TOOLBAR_CHILD_BUTTON) - { - child_widget = gtk_button_new (); - } - else if (type == GTK_TOOLBAR_CHILD_TOGGLEBUTTON) - { - child_widget = gtk_toggle_button_new (); - gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (child_widget), FALSE); - } - else /* type == GTK_TOOLBAR_CHILD_RADIOBUTTON */ - { - GSList *group = NULL; - - if (widget) - group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (widget)); - - child_widget = gtk_radio_button_new (group); - gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (child_widget), FALSE); - } - - gtk_button_set_relief (GTK_BUTTON (child_widget), get_button_relief (toolbar)); - gtk_button_set_focus_on_click (GTK_BUTTON (child_widget), FALSE); - - if (callback) - { - g_signal_connect (child_widget, "clicked", - callback, user_data); - } - - if (toolbar->style == GTK_TOOLBAR_BOTH_HORIZ) - box = gtk_hbox_new (FALSE, 0); - else - box = gtk_vbox_new (FALSE, 0); - - gtk_container_add (GTK_CONTAINER (child_widget), box); - gtk_widget_show (box); - - if (text && use_stock) - { - GtkStockItem stock_item; - if (gtk_stock_lookup (text, &stock_item)) - { - if (!icon) - icon = gtk_image_new_from_stock (text, toolbar->icon_size); - - text = free_me = _gtk_toolbar_elide_underscores (stock_item.label); - } - } - - if (text) - { - child_label = gtk_label_new (text); - - gtk_container_add (GTK_CONTAINER (box), child_label); - } - - if (icon) - { - child_icon = GTK_WIDGET (icon); - gtk_container_add (GTK_CONTAINER (box), child_icon); - } - - gtk_widget_show (child_widget); - break; - - default: - g_assert_not_reached (); - break; - } - - if ((type != GTK_TOOLBAR_CHILD_SPACE) && tooltip_text) - { - gtk_tooltips_set_tip (toolbar->tooltips, child_widget, - tooltip_text, tooltip_private_text); - } - - content = toolbar_content_new_compatibility (toolbar, type, child_widget, - child_icon, child_label, position); - - g_free (free_me); - - return child_widget; -} - /* * ToolbarContent methods */ @@ -3902,28 +3107,14 @@ typedef enum { struct _ToolbarContent { - ContentType type; - ItemState state; - - union - { - struct - { - GtkToolItem * item; - GtkAllocation start_allocation; - GtkAllocation goal_allocation; - guint is_placeholder : 1; - guint disappearing : 1; - guint has_menu : 2; - } tool_item; - - struct - { - GtkToolbarChild child; - GtkAllocation space_allocation; - guint space_visible : 1; - } compatibility; - } u; + ItemState state; + + GtkToolItem *item; + GtkAllocation start_allocation; + GtkAllocation goal_allocation; + guint is_placeholder : 1; + guint disappearing : 1; + guint has_menu : 2; }; static ToolbarContent * @@ -3937,10 +3128,9 @@ toolbar_content_new_tool_item (GtkToolbar *toolbar, content = g_slice_new0 (ToolbarContent); - content->type = TOOL_ITEM; content->state = NOT_ALLOCATED; - content->u.tool_item.item = item; - content->u.tool_item.is_placeholder = is_placeholder; + content->item = item; + content->is_placeholder = is_placeholder; gtk_widget_set_parent (GTK_WIDGET (item), GTK_WIDGET (toolbar)); @@ -3959,83 +3149,15 @@ toolbar_content_new_tool_item (GtkToolbar *toolbar, return content; } -static ToolbarContent * -toolbar_content_new_compatibility (GtkToolbar *toolbar, - GtkToolbarChildType type, - GtkWidget *widget, - GtkWidget *icon, - GtkWidget *label, - gint pos) -{ - ToolbarContent *content; - GtkToolbarChild *child; - GtkToolbarPrivate *priv = GTK_TOOLBAR_GET_PRIVATE (toolbar); - - content = g_slice_new0 (ToolbarContent); - - child = &(content->u.compatibility.child); - - content->type = COMPATIBILITY; - child->type = type; - child->widget = widget; - child->icon = icon; - child->label = label; - - if (type != GTK_TOOLBAR_CHILD_SPACE) - { - gtk_widget_set_parent (child->widget, GTK_WIDGET (toolbar)); - } - else - { - content->u.compatibility.space_visible = TRUE; - gtk_widget_queue_resize (GTK_WIDGET (toolbar)); - } - - if (type == GTK_TOOLBAR_CHILD_BUTTON || - type == GTK_TOOLBAR_CHILD_TOGGLEBUTTON || - type == GTK_TOOLBAR_CHILD_RADIOBUTTON) - { - set_child_packing_and_visibility (toolbar, child); - } - - priv->content = g_list_insert (priv->content, content, pos); - toolbar->children = g_list_insert (toolbar->children, child, pos); - priv->need_rebuild = TRUE; - - toolbar->num_children++; - - return content; -} - static void toolbar_content_remove (ToolbarContent *content, GtkToolbar *toolbar) { - GtkToolbarChild *child; GtkToolbarPrivate *priv; priv = GTK_TOOLBAR_GET_PRIVATE (toolbar); - - switch (content->type) - { - case TOOL_ITEM: - gtk_widget_unparent (GTK_WIDGET (content->u.tool_item.item)); - break; - - case COMPATIBILITY: - child = &(content->u.compatibility.child); - - if (child->type != GTK_TOOLBAR_CHILD_SPACE) - { - g_object_ref (child->widget); - gtk_widget_unparent (child->widget); - gtk_widget_destroy (child->widget); - g_object_unref (child->widget); - } - - toolbar->children = g_list_remove (toolbar->children, child); - break; - } + + gtk_widget_unparent (GTK_WIDGET (content->item)); priv->content = g_list_remove (priv->content, content); @@ -4074,34 +3196,11 @@ toolbar_content_expose (ToolbarContent *content, GtkContainer *container, GdkEventExpose *expose) { - GtkToolbar *toolbar = GTK_TOOLBAR (container); - GtkToolbarChild *child; - GtkWidget *widget = NULL; /* quiet gcc */ - - switch (content->type) - { - case TOOL_ITEM: - if (!content->u.tool_item.is_placeholder) - widget = GTK_WIDGET (content->u.tool_item.item); - break; - - case COMPATIBILITY: - child = &(content->u.compatibility.child); - - if (child->type == GTK_TOOLBAR_CHILD_SPACE) - { - if (content->u.compatibility.space_visible && - get_space_style (toolbar) == GTK_TOOLBAR_SPACE_LINE) - _gtk_toolbar_paint_space_line (GTK_WIDGET (toolbar), toolbar, - &expose->area, - &content->u.compatibility.space_allocation); - return; - } - - widget = child->widget; - break; - } - + GtkWidget *widget; + + if (!content->is_placeholder) + widget = GTK_WIDGET (content->item); + if (widget) gtk_container_propagate_expose (container, widget, expose); } @@ -4111,35 +3210,20 @@ toolbar_content_visible (ToolbarContent *content, GtkToolbar *toolbar) { GtkToolItem *item; - - switch (content->type) - { - case TOOL_ITEM: - item = content->u.tool_item.item; + + item = content->item; + + if (!gtk_widget_get_visible (GTK_WIDGET (item))) + return FALSE; + + if (toolbar->orientation == GTK_ORIENTATION_HORIZONTAL && + gtk_tool_item_get_visible_horizontal (item)) + return TRUE; + + if (toolbar->orientation == GTK_ORIENTATION_VERTICAL && + gtk_tool_item_get_visible_vertical (item)) + return TRUE; - if (!gtk_widget_get_visible (GTK_WIDGET (item))) - return FALSE; - - if (toolbar->orientation == GTK_ORIENTATION_HORIZONTAL && - gtk_tool_item_get_visible_horizontal (item)) - return TRUE; - - if ((toolbar->orientation == GTK_ORIENTATION_VERTICAL && - gtk_tool_item_get_visible_vertical (item))) - return TRUE; - - return FALSE; - break; - - case COMPATIBILITY: - if (content->u.compatibility.child.type != GTK_TOOLBAR_CHILD_SPACE) - return gtk_widget_get_visible (content->u.compatibility.child.widget); - else - return TRUE; - break; - } - - g_assert_not_reached (); return FALSE; } @@ -4148,44 +3232,13 @@ toolbar_content_size_request (ToolbarContent *content, GtkToolbar *toolbar, GtkRequisition *requisition) { - gint space_size; - - switch (content->type) + gtk_widget_size_request (GTK_WIDGET (content->item), + requisition); + if (content->is_placeholder && + content->disappearing) { - case TOOL_ITEM: - gtk_widget_size_request (GTK_WIDGET (content->u.tool_item.item), - requisition); - if (content->u.tool_item.is_placeholder && - content->u.tool_item.disappearing) - { - requisition->width = 0; - requisition->height = 0; - } - break; - - case COMPATIBILITY: - space_size = get_space_size (toolbar); - - if (content->u.compatibility.child.type != GTK_TOOLBAR_CHILD_SPACE) - { - gtk_widget_size_request (content->u.compatibility.child.widget, - requisition); - } - else - { - if (toolbar->orientation == GTK_ORIENTATION_HORIZONTAL) - { - requisition->width = space_size; - requisition->height = 0; - } - else - { - requisition->height = space_size; - requisition->width = 0; - } - } - - break; + requisition->width = 0; + requisition->height = 0; } } @@ -4193,9 +3246,9 @@ static gboolean toolbar_content_is_homogeneous (ToolbarContent *content, GtkToolbar *toolbar) { - gboolean result = FALSE; /* quiet gcc */ GtkRequisition requisition; GtkToolbarPrivate *priv = GTK_TOOLBAR_GET_PRIVATE (toolbar); + gboolean result; if (priv->max_homogeneous_pixels < 0) { @@ -4207,42 +3260,24 @@ toolbar_content_is_homogeneous (ToolbarContent *content, if (requisition.width > priv->max_homogeneous_pixels) return FALSE; - - switch (content->type) + + result = gtk_tool_item_get_homogeneous (content->item) && + !GTK_IS_SEPARATOR_TOOL_ITEM (content->item); + + if (gtk_tool_item_get_is_important (content->item) && + toolbar->style == GTK_TOOLBAR_BOTH_HORIZ && + toolbar->orientation == GTK_ORIENTATION_HORIZONTAL) { - case TOOL_ITEM: - result = gtk_tool_item_get_homogeneous (content->u.tool_item.item) && - !GTK_IS_SEPARATOR_TOOL_ITEM (content->u.tool_item.item); - - if (gtk_tool_item_get_is_important (content->u.tool_item.item) && - toolbar->style == GTK_TOOLBAR_BOTH_HORIZ && - toolbar->orientation == GTK_ORIENTATION_HORIZONTAL) - { - result = FALSE; - } - break; - - case COMPATIBILITY: - if (content->u.compatibility.child.type == GTK_TOOLBAR_CHILD_BUTTON || - content->u.compatibility.child.type == GTK_TOOLBAR_CHILD_RADIOBUTTON || - content->u.compatibility.child.type == GTK_TOOLBAR_CHILD_TOGGLEBUTTON) - { - result = TRUE; - } - else - { - result = FALSE; - } - break; + result = FALSE; } - + return result; } static gboolean toolbar_content_is_placeholder (ToolbarContent *content) { - if (content->type == TOOL_ITEM && content->u.tool_item.is_placeholder) + if (content->is_placeholder) return TRUE; return FALSE; @@ -4251,7 +3286,7 @@ toolbar_content_is_placeholder (ToolbarContent *content) static gboolean toolbar_content_disappearing (ToolbarContent *content) { - if (content->type == TOOL_ITEM && content->u.tool_item.disappearing) + if (content->disappearing) return TRUE; return FALSE; @@ -4266,104 +3301,37 @@ toolbar_content_get_state (ToolbarContent *content) static gboolean toolbar_content_child_visible (ToolbarContent *content) { - switch (content->type) - { - case TOOL_ITEM: - return GTK_WIDGET_CHILD_VISIBLE (content->u.tool_item.item); - break; - - case COMPATIBILITY: - if (content->u.compatibility.child.type != GTK_TOOLBAR_CHILD_SPACE) - { - return GTK_WIDGET_CHILD_VISIBLE (content->u.compatibility.child.widget); - } - else - { - return content->u.compatibility.space_visible; - } - break; - } - - return FALSE; /* quiet gcc */ + return GTK_WIDGET_CHILD_VISIBLE (content->item); } static void toolbar_content_get_goal_allocation (ToolbarContent *content, GtkAllocation *allocation) { - switch (content->type) - { - case TOOL_ITEM: - *allocation = content->u.tool_item.goal_allocation; - break; - - case COMPATIBILITY: - /* Goal allocations are only relevant when we are - * using the new API, so we should never get here - */ - g_assert_not_reached (); - break; - - default: - g_assert_not_reached (); - break; - } + *allocation = content->goal_allocation; } static void toolbar_content_get_allocation (ToolbarContent *content, GtkAllocation *allocation) { - GtkToolbarChild *child; - - switch (content->type) - { - case TOOL_ITEM: - *allocation = GTK_WIDGET (content->u.tool_item.item)->allocation; - break; - - case COMPATIBILITY: - child = &(content->u.compatibility.child); - - if (child->type == GTK_TOOLBAR_CHILD_SPACE) - *allocation = content->u.compatibility.space_allocation; - else - *allocation = child->widget->allocation; - break; - - default: - g_assert_not_reached (); - break; - } + gtk_widget_get_allocation (GTK_WIDGET (content->item), allocation); } static void toolbar_content_set_start_allocation (ToolbarContent *content, GtkAllocation *allocation) { - switch (content->type) - { - case TOOL_ITEM: - content->u.tool_item.start_allocation = *allocation; - break; - - case COMPATIBILITY: - /* start_allocation is only relevant when using the new API */ - g_assert_not_reached (); - break; - } + content->start_allocation = *allocation; } static gboolean toolbar_content_get_expand (ToolbarContent *content) { - if (content->type == TOOL_ITEM && - gtk_tool_item_get_expand (content->u.tool_item.item) && - !content->u.tool_item.disappearing) - { - return TRUE; - } - + if (!content->disappearing && + gtk_tool_item_get_expand (content->item)) + return TRUE; + return FALSE; } @@ -4371,17 +3339,7 @@ static void toolbar_content_set_goal_allocation (ToolbarContent *content, GtkAllocation *allocation) { - switch (content->type) - { - case TOOL_ITEM: - content->u.tool_item.goal_allocation = *allocation; - break; - - case COMPATIBILITY: - /* Only relevant when using new API */ - g_assert_not_reached (); - break; - } + content->goal_allocation = *allocation; } static void @@ -4389,74 +3347,23 @@ toolbar_content_set_child_visible (ToolbarContent *content, GtkToolbar *toolbar, gboolean visible) { - GtkToolbarChild *child; - - switch (content->type) - { - case TOOL_ITEM: - gtk_widget_set_child_visible (GTK_WIDGET (content->u.tool_item.item), - visible); - break; - - case COMPATIBILITY: - child = &(content->u.compatibility.child); - - if (child->type != GTK_TOOLBAR_CHILD_SPACE) - { - gtk_widget_set_child_visible (child->widget, visible); - } - else - { - if (content->u.compatibility.space_visible != visible) - { - content->u.compatibility.space_visible = visible; - gtk_widget_queue_draw (GTK_WIDGET (toolbar)); - } - } - break; - } + gtk_widget_set_child_visible (GTK_WIDGET (content->item), + visible); } static void toolbar_content_get_start_allocation (ToolbarContent *content, GtkAllocation *start_allocation) { - switch (content->type) - { - case TOOL_ITEM: - *start_allocation = content->u.tool_item.start_allocation; - break; - - case COMPATIBILITY: - /* Only relevant for new API */ - g_assert_not_reached (); - break; - } + *start_allocation = content->start_allocation; } static void toolbar_content_size_allocate (ToolbarContent *content, GtkAllocation *allocation) { - switch (content->type) - { - case TOOL_ITEM: - gtk_widget_size_allocate (GTK_WIDGET (content->u.tool_item.item), - allocation); - break; - - case COMPATIBILITY: - if (content->u.compatibility.child.type != GTK_TOOLBAR_CHILD_SPACE) - { - gtk_widget_size_allocate (content->u.compatibility.child.widget, - allocation); - } - else - { - content->u.compatibility.space_allocation = *allocation; - } - break; - } + gtk_widget_size_allocate (GTK_WIDGET (content->item), + allocation); } static void @@ -4469,41 +3376,15 @@ toolbar_content_set_state (ToolbarContent *content, static GtkWidget * toolbar_content_get_widget (ToolbarContent *content) { - GtkToolbarChild *child; - - switch (content->type) - { - case TOOL_ITEM: - return GTK_WIDGET (content->u.tool_item.item); - break; - - case COMPATIBILITY: - child = &(content->u.compatibility.child); - if (child->type != GTK_TOOLBAR_CHILD_SPACE) - return child->widget; - else - return NULL; - break; - } - - return NULL; + return GTK_WIDGET (content->item); } + static void toolbar_content_set_disappearing (ToolbarContent *content, gboolean disappearing) { - switch (content->type) - { - case TOOL_ITEM: - content->u.tool_item.disappearing = disappearing; - break; - - case COMPATIBILITY: - /* Only relevant for new API */ - g_assert_not_reached (); - break; - } + content->disappearing = disappearing; } static void @@ -4511,209 +3392,57 @@ toolbar_content_set_size_request (ToolbarContent *content, gint width, gint height) { - switch (content->type) - { - case TOOL_ITEM: - gtk_widget_set_size_request (GTK_WIDGET (content->u.tool_item.item), - width, height); - break; - - case COMPATIBILITY: - /* Setting size requests only happens with sliding, - * so not relevant here - */ - g_assert_not_reached (); - break; - } -} - -static void -toolbar_child_reconfigure (GtkToolbar *toolbar, - GtkToolbarChild *child) -{ - GtkWidget *box; - GtkImage *image; - GtkToolbarStyle style; - GtkIconSize icon_size; - GtkReliefStyle relief; - gchar *stock_id; - - style = gtk_toolbar_get_style (toolbar); - icon_size = gtk_toolbar_get_icon_size (toolbar); - relief = gtk_toolbar_get_relief_style (toolbar); - - /* style */ - if (child->type == GTK_TOOLBAR_CHILD_BUTTON || - child->type == GTK_TOOLBAR_CHILD_RADIOBUTTON || - child->type == GTK_TOOLBAR_CHILD_TOGGLEBUTTON) - { - box = gtk_bin_get_child (GTK_BIN (child->widget)); - - if (style == GTK_TOOLBAR_BOTH && GTK_IS_HBOX (box)) - { - GtkWidget *vbox; - - vbox = gtk_vbox_new (FALSE, 0); - - if (child->label) - gtk_widget_reparent (child->label, vbox); - if (child->icon) - gtk_widget_reparent (child->icon, vbox); - - gtk_widget_destroy (box); - gtk_container_add (GTK_CONTAINER (child->widget), vbox); - - gtk_widget_show (vbox); - } - else if (style == GTK_TOOLBAR_BOTH_HORIZ && GTK_IS_VBOX (box)) - { - GtkWidget *hbox; - - hbox = gtk_hbox_new (FALSE, 0); - - if (child->label) - gtk_widget_reparent (child->label, hbox); - if (child->icon) - gtk_widget_reparent (child->icon, hbox); - - gtk_widget_destroy (box); - gtk_container_add (GTK_CONTAINER (child->widget), hbox); - - gtk_widget_show (hbox); - } - - set_child_packing_and_visibility (toolbar, child); - } - - /* icon size */ - - if ((child->type == GTK_TOOLBAR_CHILD_BUTTON || - child->type == GTK_TOOLBAR_CHILD_TOGGLEBUTTON || - child->type == GTK_TOOLBAR_CHILD_RADIOBUTTON) && - GTK_IS_IMAGE (child->icon)) - { - image = GTK_IMAGE (child->icon); - if (gtk_image_get_storage_type (image) == GTK_IMAGE_STOCK) - { - gtk_image_get_stock (image, &stock_id, NULL); - stock_id = g_strdup (stock_id); - gtk_image_set_from_stock (image, - stock_id, - icon_size); - g_free (stock_id); - } - } - - /* relief */ - if (child->type == GTK_TOOLBAR_CHILD_BUTTON || - child->type == GTK_TOOLBAR_CHILD_RADIOBUTTON || - child->type == GTK_TOOLBAR_CHILD_TOGGLEBUTTON) - { - gtk_button_set_relief (GTK_BUTTON (child->widget), relief); - } + gtk_widget_set_size_request (GTK_WIDGET (content->item), + width, height); } static void toolbar_content_toolbar_reconfigured (ToolbarContent *content, GtkToolbar *toolbar) { - switch (content->type) - { - case TOOL_ITEM: - gtk_tool_item_toolbar_reconfigured (content->u.tool_item.item); - break; - - case COMPATIBILITY: - toolbar_child_reconfigure (toolbar, &(content->u.compatibility.child)); - break; - } + gtk_tool_item_toolbar_reconfigured (content->item); } static GtkWidget * toolbar_content_retrieve_menu_item (ToolbarContent *content) { - if (content->type == TOOL_ITEM) - return gtk_tool_item_retrieve_proxy_menu_item (content->u.tool_item.item); - - /* FIXME - we might actually be able to do something meaningful here */ - return NULL; + return gtk_tool_item_retrieve_proxy_menu_item (content->item); } static gboolean toolbar_content_has_proxy_menu_item (ToolbarContent *content) { - if (content->type == TOOL_ITEM) - { - GtkWidget *menu_item; + GtkWidget *menu_item; - if (content->u.tool_item.has_menu == YES) - return TRUE; - else if (content->u.tool_item.has_menu == NO) - return FALSE; + if (content->has_menu == YES) + return TRUE; + else if (content->has_menu == NO) + return FALSE; - menu_item = toolbar_content_retrieve_menu_item (content); + menu_item = toolbar_content_retrieve_menu_item (content); - content->u.tool_item.has_menu = menu_item? YES : NO; - - return menu_item != NULL; - } - else - { - return FALSE; - } + content->has_menu = menu_item? YES : NO; + + return menu_item != NULL; } static void toolbar_content_set_unknown_menu_status (ToolbarContent *content) { - if (content->type == TOOL_ITEM) - content->u.tool_item.has_menu = UNKNOWN; + content->has_menu = UNKNOWN; } static gboolean toolbar_content_is_separator (ToolbarContent *content) { - GtkToolbarChild *child; - - switch (content->type) - { - case TOOL_ITEM: - return GTK_IS_SEPARATOR_TOOL_ITEM (content->u.tool_item.item); - break; - - case COMPATIBILITY: - child = &(content->u.compatibility.child); - return (child->type == GTK_TOOLBAR_CHILD_SPACE); - break; - } - - return FALSE; + return GTK_IS_SEPARATOR_TOOL_ITEM (content->item); } static void toolbar_content_set_expand (ToolbarContent *content, - gboolean expand) + gboolean expand) { - if (content->type == TOOL_ITEM) - gtk_tool_item_set_expand (content->u.tool_item.item, expand); -} - -static gboolean -ignore_show_and_hide_all (ToolbarContent *content) -{ - if (content->type == COMPATIBILITY) - { - GtkToolbarChildType type = content->u.compatibility.child.type; - - if (type == GTK_TOOLBAR_CHILD_BUTTON || - type == GTK_TOOLBAR_CHILD_TOGGLEBUTTON || - type == GTK_TOOLBAR_CHILD_RADIOBUTTON) - { - return TRUE; - } - } - - return FALSE; + gtk_tool_item_set_expand (content->item, expand); } static void @@ -4721,9 +3450,6 @@ toolbar_content_show_all (ToolbarContent *content) { GtkWidget *widget; - if (ignore_show_and_hide_all (content)) - return; - widget = toolbar_content_get_widget (content); if (widget) gtk_widget_show_all (widget); @@ -4734,9 +3460,6 @@ toolbar_content_hide_all (ToolbarContent *content) { GtkWidget *widget; - if (ignore_show_and_hide_all (content)) - return; - widget = toolbar_content_get_widget (content); if (widget) gtk_widget_hide_all (widget); @@ -4745,36 +3468,6 @@ toolbar_content_hide_all (ToolbarContent *content) /* * Getters */ -static gint -get_space_size (GtkToolbar *toolbar) -{ - gint space_size = DEFAULT_SPACE_SIZE; - - if (toolbar) - { - gtk_widget_style_get (GTK_WIDGET (toolbar), - "space-size", &space_size, - NULL); - } - - return space_size; -} - -static GtkToolbarSpaceStyle -get_space_style (GtkToolbar *toolbar) -{ - GtkToolbarSpaceStyle space_style = DEFAULT_SPACE_STYLE; - - if (toolbar) - { - gtk_widget_style_get (GTK_WIDGET (toolbar), - "space-style", &space_style, - NULL); - } - - return space_style; -} - static GtkReliefStyle get_button_relief (GtkToolbar *toolbar) { @@ -4824,39 +3517,6 @@ get_shadow_type (GtkToolbar *toolbar) return shadow_type; } -/* - * API checks - */ -static gboolean -gtk_toolbar_check_old_api (GtkToolbar *toolbar) -{ - GtkToolbarPrivate *priv = GTK_TOOLBAR_GET_PRIVATE (toolbar); - - if (priv->api_mode == NEW_API) - { - g_warning (MIXED_API_WARNING); - return FALSE; - } - - priv->api_mode = OLD_API; - return TRUE; -} - -static gboolean -gtk_toolbar_check_new_api (GtkToolbar *toolbar) -{ - GtkToolbarPrivate *priv = GTK_TOOLBAR_GET_PRIVATE (toolbar); - - if (priv->api_mode == OLD_API) - { - g_warning (MIXED_API_WARNING); - return FALSE; - } - - priv->api_mode = NEW_API; - return TRUE; -} - /* GTK+ internal methods */ gint diff --git a/gtk/gtktoolbar.h b/gtk/gtktoolbar.h index 333b328871..795a4d2ae6 100644 --- a/gtk/gtktoolbar.h +++ b/gtk/gtktoolbar.h @@ -29,7 +29,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -38,19 +38,11 @@ #include -#include #include -#ifndef GTK_DISABLE_DEPRECATED - -/* Not needed, retained for compatibility -Yosh */ -#include -#include - -#endif /* GTK_DISABLE_DEPRECATED */ - G_BEGIN_DECLS + #define GTK_TYPE_TOOLBAR (gtk_toolbar_get_type ()) #define GTK_TOOLBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TOOLBAR, GtkToolbar)) #define GTK_TOOLBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TOOLBAR, GtkToolbarClass)) @@ -58,28 +50,6 @@ G_BEGIN_DECLS #define GTK_IS_TOOLBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TOOLBAR)) #define GTK_TOOLBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TOOLBAR, GtkToolbarClass)) -#ifndef GTK_DISABLE_DEPRECATED -typedef enum -{ - GTK_TOOLBAR_CHILD_SPACE, - GTK_TOOLBAR_CHILD_BUTTON, - GTK_TOOLBAR_CHILD_TOGGLEBUTTON, - GTK_TOOLBAR_CHILD_RADIOBUTTON, - GTK_TOOLBAR_CHILD_WIDGET -} GtkToolbarChildType; - -typedef struct _GtkToolbarChild GtkToolbarChild; - -struct _GtkToolbarChild -{ - GtkToolbarChildType type; - GtkWidget *widget; - GtkWidget *icon; - GtkWidget *label; -}; - -#endif /* GTK_DISABLE_DEPRECATED */ - typedef enum { GTK_TOOLBAR_SPACE_EMPTY, @@ -101,12 +71,6 @@ struct _GtkToolbar GtkToolbarStyle GSEAL (style); GtkIconSize GSEAL (icon_size); -#ifndef GTK_DISABLE_DEPRECATED - GtkTooltips *GSEAL (tooltips); -#else - gpointer GSEAL (_tooltips); -#endif - /*< private >*/ gint GSEAL (button_maxw); /* maximum width of homogeneous children */ gint GSEAL (button_maxh); /* maximum height of homogeneous children */ @@ -183,106 +147,6 @@ void _gtk_toolbar_paint_space_line (GtkWidget *widget gint _gtk_toolbar_get_default_space_size (void); - -#ifndef GTK_DISABLE_DEPRECATED - -GtkOrientation gtk_toolbar_get_orientation (GtkToolbar *toolbar); -void gtk_toolbar_set_orientation (GtkToolbar *toolbar, - GtkOrientation orientation); -gboolean gtk_toolbar_get_tooltips (GtkToolbar *toolbar); -void gtk_toolbar_set_tooltips (GtkToolbar *toolbar, - gboolean enable); - -/* Simple button items */ -GtkWidget* gtk_toolbar_append_item (GtkToolbar *toolbar, - const char *text, - const char *tooltip_text, - const char *tooltip_private_text, - GtkWidget *icon, - GCallback callback, - gpointer user_data); -GtkWidget* gtk_toolbar_prepend_item (GtkToolbar *toolbar, - const char *text, - const char *tooltip_text, - const char *tooltip_private_text, - GtkWidget *icon, - GCallback callback, - gpointer user_data); -GtkWidget* gtk_toolbar_insert_item (GtkToolbar *toolbar, - const char *text, - const char *tooltip_text, - const char *tooltip_private_text, - GtkWidget *icon, - GCallback callback, - gpointer user_data, - gint position); - -/* Stock Items */ -GtkWidget* gtk_toolbar_insert_stock (GtkToolbar *toolbar, - const gchar *stock_id, - const char *tooltip_text, - const char *tooltip_private_text, - GCallback callback, - gpointer user_data, - gint position); - -/* Space Items */ -void gtk_toolbar_append_space (GtkToolbar *toolbar); -void gtk_toolbar_prepend_space (GtkToolbar *toolbar); -void gtk_toolbar_insert_space (GtkToolbar *toolbar, - gint position); -void gtk_toolbar_remove_space (GtkToolbar *toolbar, - gint position); -/* Any element type */ -GtkWidget* gtk_toolbar_append_element (GtkToolbar *toolbar, - GtkToolbarChildType type, - GtkWidget *widget, - const char *text, - const char *tooltip_text, - const char *tooltip_private_text, - GtkWidget *icon, - GCallback callback, - gpointer user_data); - -GtkWidget* gtk_toolbar_prepend_element (GtkToolbar *toolbar, - GtkToolbarChildType type, - GtkWidget *widget, - const char *text, - const char *tooltip_text, - const char *tooltip_private_text, - GtkWidget *icon, - GCallback callback, - gpointer user_data); - -GtkWidget* gtk_toolbar_insert_element (GtkToolbar *toolbar, - GtkToolbarChildType type, - GtkWidget *widget, - const char *text, - const char *tooltip_text, - const char *tooltip_private_text, - GtkWidget *icon, - GCallback callback, - gpointer user_data, - gint position); - -/* Generic Widgets */ -void gtk_toolbar_append_widget (GtkToolbar *toolbar, - GtkWidget *widget, - const char *tooltip_text, - const char *tooltip_private_text); -void gtk_toolbar_prepend_widget (GtkToolbar *toolbar, - GtkWidget *widget, - const char *tooltip_text, - const char *tooltip_private_text); -void gtk_toolbar_insert_widget (GtkToolbar *toolbar, - GtkWidget *widget, - const char *tooltip_text, - const char *tooltip_private_text, - gint position); - -#endif /* GTK_DISABLE_DEPRECATED */ - - G_END_DECLS #endif /* __GTK_TOOLBAR_H__ */ diff --git a/gtk/gtktoolbutton.c b/gtk/gtktoolbutton.c index a0e16b98ed..0e6ae592a9 100644 --- a/gtk/gtktoolbutton.c +++ b/gtk/gtktoolbutton.c @@ -470,11 +470,11 @@ gtk_tool_button_construct_contents (GtkToolItem *tool_item) gtk_widget_show (icon); } - if (icon && text_orientation == GTK_ORIENTATION_HORIZONTAL) + if (GTK_IS_MISC (icon) && text_orientation == GTK_ORIENTATION_HORIZONTAL) gtk_misc_set_alignment (GTK_MISC (icon), 1.0 - gtk_tool_item_get_text_alignment (GTK_TOOL_ITEM (button)), 0.5); - else if (icon) + else if (GTK_IS_MISC (icon)) gtk_misc_set_alignment (GTK_MISC (icon), 0.5, gtk_tool_item_get_text_alignment (GTK_TOOL_ITEM (button))); @@ -928,7 +928,7 @@ gtk_tool_button_new_from_stock (const gchar *stock_id) /** * gtk_tool_button_new: * @label: (allow-none): a string that will be used as label, or %NULL - * @icon_widget: (allow-none): a widget that will be used as icon widget, or %NULL + * @icon_widget: (allow-none): a #GtkMisc widget that will be used as icon widget, or %NULL * * Creates a new %GtkToolButton using @icon_widget as icon and @label as * label. @@ -943,6 +943,8 @@ gtk_tool_button_new (GtkWidget *icon_widget, { GtkToolButton *button; + g_return_val_if_fail (icon_widget == NULL || GTK_IS_MISC (icon_widget), NULL); + button = g_object_new (GTK_TYPE_TOOL_BUTTON, "label", label, "icon-widget", icon_widget, diff --git a/gtk/gtktoolbutton.h b/gtk/gtktoolbutton.h index cacabe1700..e9ba386a16 100644 --- a/gtk/gtktoolbutton.h +++ b/gtk/gtktoolbutton.h @@ -20,7 +20,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtktoolitem.c b/gtk/gtktoolitem.c index 606ce1e847..eba147a66f 100644 --- a/gtk/gtktoolitem.c +++ b/gtk/gtktoolitem.c @@ -24,8 +24,6 @@ #include -#undef GTK_DISABLE_DEPRECATED /* GtkTooltips */ - #include "gtktoolitem.h" #include "gtkmarshalers.h" #include "gtktoolshell.h" @@ -39,6 +37,7 @@ /** * SECTION:gtktoolitem * @short_description: The base class of widgets that can be added to GtkToolShell + * @Title: GtkToolItem * @see_also: * * #GtkToolbar @@ -78,7 +77,6 @@ enum { CREATE_MENU_PROXY, TOOLBAR_RECONFIGURED, - SET_TOOLTIP, LAST_SIGNAL }; @@ -138,10 +136,6 @@ static void gtk_tool_item_size_request (GtkWidget *widget, GtkRequisition *requisition); static void gtk_tool_item_size_allocate (GtkWidget *widget, GtkAllocation *allocation); -static gboolean gtk_tool_item_real_set_tooltip (GtkToolItem *tool_item, - GtkTooltips *tooltips, - const gchar *tip_text, - const gchar *tip_private); static void gtk_tool_item_activatable_interface_init (GtkActivatableIface *iface); static void gtk_tool_item_update (GtkActivatable *activatable, @@ -184,7 +178,6 @@ gtk_tool_item_class_init (GtkToolItemClass *klass) widget_class->parent_set = gtk_tool_item_parent_set; klass->create_menu_proxy = _gtk_tool_item_create_menu_proxy; - klass->set_tooltip = gtk_tool_item_real_set_tooltip; g_object_class_install_property (object_class, PROP_VISIBLE_HORIZONTAL, @@ -274,33 +267,6 @@ gtk_tool_item_class_init (GtkToolItemClass *klass) NULL, NULL, _gtk_marshal_VOID__VOID, G_TYPE_NONE, 0); -/** - * GtkToolItem::set-tooltip: - * @tool_item: the object the signal was emitted on - * @tooltips: the #GtkTooltips - * @tip_text: the tooltip text - * @tip_private: the tooltip private text - * - * This signal is emitted when the toolitem's tooltip changes. - * Application developers can use gtk_tool_item_set_tooltip() to - * set the item's tooltip. - * - * Return value: %TRUE if the signal was handled, %FALSE if not - * - * Deprecated: 2.12: With the new tooltip API, there is no - * need to use this signal anymore. - **/ - toolitem_signals[SET_TOOLTIP] = - g_signal_new (I_("set-tooltip"), - G_OBJECT_CLASS_TYPE (klass), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GtkToolItemClass, set_tooltip), - _gtk_boolean_handled_accumulator, NULL, - _gtk_marshal_BOOLEAN__OBJECT_STRING_STRING, - G_TYPE_BOOLEAN, 3, - GTK_TYPE_TOOLTIPS, - G_TYPE_STRING, - G_TYPE_STRING); g_type_class_add_private (object_class, sizeof (GtkToolItemPrivate)); } @@ -1077,51 +1043,6 @@ gtk_tool_item_set_is_important (GtkToolItem *tool_item, gboolean is_important) } } -static gboolean -gtk_tool_item_real_set_tooltip (GtkToolItem *tool_item, - GtkTooltips *tooltips, - const gchar *tip_text, - const gchar *tip_private) -{ - GtkWidget *child = GTK_BIN (tool_item)->child; - - if (!child) - return FALSE; - - gtk_widget_set_tooltip_text (child, tip_text); - - return TRUE; -} - -/** - * gtk_tool_item_set_tooltip: - * @tool_item: a #GtkToolItem - * @tooltips: The #GtkTooltips object to be used - * @tip_text: (allow-none): text to be used as tooltip text for @tool_item - * @tip_private: (allow-none): text to be used as private tooltip text - * - * Sets the #GtkTooltips object to be used for @tool_item, the - * text to be displayed as tooltip on the item and the private text - * to be used. See gtk_tooltips_set_tip(). - * - * Since: 2.4 - * - * Deprecated: 2.12: Use gtk_tool_item_set_tooltip_text() instead. - **/ -void -gtk_tool_item_set_tooltip (GtkToolItem *tool_item, - GtkTooltips *tooltips, - const gchar *tip_text, - const gchar *tip_private) -{ - gboolean retval; - - g_return_if_fail (GTK_IS_TOOL_ITEM (tool_item)); - - g_signal_emit (tool_item, toolitem_signals[SET_TOOLTIP], 0, - tooltips, tip_text, tip_private, &retval); -} - /** * gtk_tool_item_set_tooltip_text: * @tool_item: a #GtkToolItem diff --git a/gtk/gtktoolitem.h b/gtk/gtktoolitem.h index 7f8d9ada18..1e1ecbfc3d 100644 --- a/gtk/gtktoolitem.h +++ b/gtk/gtktoolitem.h @@ -20,7 +20,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -28,7 +28,6 @@ #define __GTK_TOOL_ITEM_H__ #include -#include #include #include @@ -60,14 +59,6 @@ struct _GtkToolItemClass /* signals */ gboolean (* create_menu_proxy) (GtkToolItem *tool_item); void (* toolbar_reconfigured) (GtkToolItem *tool_item); -#ifndef GTK_DISABLE_DEPRECATED - gboolean (* set_tooltip) (GtkToolItem *tool_item, - GtkTooltips *tooltips, - const gchar *tip_text, - const gchar *tip_private); -#else - gpointer _set_tooltip; -#endif /* Padding for future expansion */ void (* _gtk_reserved1) (void); @@ -86,13 +77,6 @@ gboolean gtk_tool_item_get_homogeneous (GtkToolItem *tool_item); void gtk_tool_item_set_expand (GtkToolItem *tool_item, gboolean expand); gboolean gtk_tool_item_get_expand (GtkToolItem *tool_item); - -#ifndef GTK_DISABLE_DEPRECATED -void gtk_tool_item_set_tooltip (GtkToolItem *tool_item, - GtkTooltips *tooltips, - const gchar *tip_text, - const gchar *tip_private); -#endif /* GTK_DISABLE_DEPRECATED */ void gtk_tool_item_set_tooltip_text (GtkToolItem *tool_item, const gchar *text); void gtk_tool_item_set_tooltip_markup (GtkToolItem *tool_item, diff --git a/gtk/gtktoolshell.c b/gtk/gtktoolshell.c index ac7b84e569..11f886ed6c 100644 --- a/gtk/gtktoolshell.c +++ b/gtk/gtktoolshell.c @@ -166,7 +166,7 @@ gtk_tool_shell_rebuild_menu (GtkToolShell *shell) * * Return value: the current text orientation of @shell * - * Since: 2.14 + * Since: 2.20 **/ GtkOrientation gtk_tool_shell_get_text_orientation (GtkToolShell *shell) @@ -189,7 +189,7 @@ gtk_tool_shell_get_text_orientation (GtkToolShell *shell) * * Return value: the current text alignment of @shell * - * Since: 2.14 + * Since: 2.20 **/ gfloat gtk_tool_shell_get_text_alignment (GtkToolShell *shell) @@ -212,7 +212,7 @@ gtk_tool_shell_get_text_alignment (GtkToolShell *shell) * * Return value: the current ellipsize mode of @shell * - * Since: 2.14 + * Since: 2.20 **/ PangoEllipsizeMode gtk_tool_shell_get_ellipsize_mode (GtkToolShell *shell) @@ -235,7 +235,7 @@ gtk_tool_shell_get_ellipsize_mode (GtkToolShell *shell) * * Return value: the current text size group of @shell * - * Since: 2.14 + * Since: 2.20 **/ GtkSizeGroup * gtk_tool_shell_get_text_size_group (GtkToolShell *shell) diff --git a/gtk/gtktooltip.c b/gtk/gtktooltip.c index 5cc2334c31..67c2f6c9a0 100644 --- a/gtk/gtktooltip.c +++ b/gtk/gtktooltip.c @@ -647,14 +647,18 @@ window_to_alloc (GtkWidget *dest_widget, /* Translates coordinates from window relative (x, y) to * allocation relative (x, y) of the returned widget. */ -static GtkWidget * -find_widget_under_pointer (GdkWindow *window, - gint *x, - gint *y) +GtkWidget * +_gtk_widget_find_at_coords (GdkWindow *window, + gint window_x, + gint window_y, + gint *widget_x, + gint *widget_y) { GtkWidget *event_widget; struct ChildLocation child_loc = { NULL, NULL, 0, 0 }; + g_return_val_if_fail (GDK_IS_WINDOW (window), NULL); + gdk_window_get_user_data (window, (void **)&event_widget); if (!event_widget) @@ -663,12 +667,12 @@ find_widget_under_pointer (GdkWindow *window, #ifdef DEBUG_TOOLTIP g_print ("event window %p (belonging to %p (%s)) (%d, %d)\n", window, event_widget, gtk_widget_get_name (event_widget), - *x, *y); + window_x, window_y); #endif /* Coordinates are relative to event window */ - child_loc.x = *x; - child_loc.y = *y; + child_loc.x = window_x; + child_loc.y = window_y; /* We go down the window hierarchy to the widget->window, * coordinates stay relative to the current window. @@ -725,14 +729,13 @@ find_widget_under_pointer (GdkWindow *window, gtk_widget_translate_coordinates (container, event_widget, child_loc.x, child_loc.y, &child_loc.x, &child_loc.y); - } /* We return (x, y) relative to the allocation of event_widget. */ - if (x) - *x = child_loc.x; - if (y) - *y = child_loc.y; + if (widget_x) + *widget_x = child_loc.x; + if (widget_y) + *widget_y = child_loc.y; return event_widget; } @@ -750,11 +753,9 @@ find_topmost_widget_coords_from_event (GdkEvent *event, GtkWidget *tmp; gdk_event_get_coords (event, &dx, &dy); - tx = dx; - ty = dy; /* Returns coordinates relative to tmp's allocation. */ - tmp = find_widget_under_pointer (event->any.window, &tx, &ty); + tmp = _gtk_widget_find_at_coords (event->any.window, dx, dy, &tx, &ty); if (!tmp) return NULL; @@ -903,53 +904,128 @@ gtk_tooltip_position (GtkTooltip *tooltip, { gint x, y; GdkScreen *screen; + gint monitor_num; + GdkRectangle monitor; + GtkRequisition requisition; + guint cursor_size; + GdkRectangle bounds; + +#define MAX_DISTANCE 32 tooltip->tooltip_widget = new_tooltip_widget; + screen = gtk_widget_get_screen (new_tooltip_widget); + + gtk_widget_size_request (GTK_WIDGET (tooltip->current_window), &requisition); + + monitor_num = gdk_screen_get_monitor_at_point (screen, + tooltip->last_x, + tooltip->last_y); + gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor); + + get_bounding_box (new_tooltip_widget, &bounds); + /* Position the tooltip */ - /* FIXME: should we swap this when RTL is enabled? */ + + cursor_size = gdk_display_get_default_cursor_size (display); + + /* Try below */ + x = bounds.x + bounds.width / 2 - requisition.width / 2; + y = bounds.y + bounds.height + 4; + + if (y + requisition.height <= monitor.y + monitor.height) + { + if (tooltip->keyboard_mode_enabled) + goto found; + + if (y <= tooltip->last_y + cursor_size + MAX_DISTANCE) + { + if (tooltip->last_x + cursor_size + MAX_DISTANCE < x) + x = tooltip->last_x + cursor_size + MAX_DISTANCE; + else if (x + requisition.width < tooltip->last_x - MAX_DISTANCE) + x = tooltip->last_x - MAX_DISTANCE - requisition.width; + + goto found; + } + } + + /* Try above */ + x = bounds.x + bounds.width / 2 - requisition.width / 2; + y = bounds.y - requisition.height - 4; + + if (y >= monitor.y) + { + if (tooltip->keyboard_mode_enabled) + goto found; + + if (y + requisition.height >= tooltip->last_y - MAX_DISTANCE) + { + if (tooltip->last_x + cursor_size + MAX_DISTANCE < x) + x = tooltip->last_x + cursor_size + MAX_DISTANCE; + else if (x + requisition.width < tooltip->last_x - MAX_DISTANCE) + x = tooltip->last_x - MAX_DISTANCE - requisition.width; + + goto found; + } + } + + /* Try right FIXME: flip on rtl ? */ + x = bounds.x + bounds.width + 4; + y = bounds.y + bounds.height / 2 - requisition.height / 2; + + if (x + requisition.width <= monitor.x + monitor.width) + { + if (tooltip->keyboard_mode_enabled) + goto found; + + if (x <= tooltip->last_x + cursor_size + MAX_DISTANCE) + { + if (tooltip->last_y + cursor_size + MAX_DISTANCE < y) + y = tooltip->last_y + cursor_size + MAX_DISTANCE; + else if (y + requisition.height < tooltip->last_y - MAX_DISTANCE) + y = tooltip->last_y - MAX_DISTANCE - requisition.height; + + goto found; + } + } + + /* Try left FIXME: flip on rtl ? */ + x = bounds.x - requisition.width - 4; + y = bounds.y + bounds.height / 2 - requisition.height / 2; + + if (x >= monitor.x) + { + if (tooltip->keyboard_mode_enabled) + goto found; + + if (x + requisition.width >= tooltip->last_x - MAX_DISTANCE) + { + if (tooltip->last_y + cursor_size + MAX_DISTANCE < y) + y = tooltip->last_y + cursor_size + MAX_DISTANCE; + else if (y + requisition.height < tooltip->last_y - MAX_DISTANCE) + y = tooltip->last_y - MAX_DISTANCE - requisition.height; + + goto found; + } + } + + /* Fallback */ if (tooltip->keyboard_mode_enabled) { - GdkRectangle bounds; - - get_bounding_box (new_tooltip_widget, &bounds); - - /* For keyboard mode we position the tooltip below the widget, - * right of the center of the widget. - */ - x = bounds.x + bounds.width / 2; + x = bounds.x + bounds.width / 2 - requisition.width / 2; y = bounds.y + bounds.height + 4; } else { - guint cursor_size; - - x = tooltip->last_x; - y = tooltip->last_y; - - /* For mouse mode, we position the tooltip right of the cursor, - * a little below the cursor's center. - */ - cursor_size = gdk_display_get_default_cursor_size (display); - x += cursor_size / 2; - y += cursor_size / 2; + /* At cursor */ + x = tooltip->last_x + cursor_size * 3 / 4; + y = tooltip->last_y + cursor_size * 3 / 4; } - screen = gtk_widget_get_screen (new_tooltip_widget); - +found: /* Show it */ if (tooltip->current_window) { - gint monitor_num; - GdkRectangle monitor; - GtkRequisition requisition; - - gtk_widget_size_request (GTK_WIDGET (tooltip->current_window), - &requisition); - - monitor_num = gdk_screen_get_monitor_at_point (screen, x, y); - gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor); - if (x + requisition.width > monitor.x + monitor.width) x -= x - (monitor.x + monitor.width) + requisition.width; else if (x < monitor.x) @@ -957,7 +1033,9 @@ gtk_tooltip_position (GtkTooltip *tooltip, if (y + requisition.height > monitor.y + monitor.height) y -= y - (monitor.y + monitor.height) + requisition.height; - + else if (y < monitor.y) + y = monitor.y; + if (!tooltip->keyboard_mode_enabled) { /* don't pop up under the pointer */ @@ -965,7 +1043,7 @@ gtk_tooltip_position (GtkTooltip *tooltip, y <= tooltip->last_y && tooltip->last_y < y + requisition.height) y = tooltip->last_y - requisition.height - 2; } - + gtk_window_move (GTK_WINDOW (tooltip->current_window), x, y); gtk_widget_show (GTK_WIDGET (tooltip->current_window)); } @@ -1007,8 +1085,9 @@ gtk_tooltip_show_tooltip (GdkDisplay *display) tooltip->last_x = tx; tooltip->last_y = ty; - pointer_widget = tooltip_widget = find_widget_under_pointer (window, - &x, &y); + pointer_widget = tooltip_widget = _gtk_widget_find_at_coords (window, + x, y, + &x, &y); } if (!tooltip_widget) @@ -1169,6 +1248,7 @@ _gtk_tooltip_focus_in (GtkWidget *widget) gboolean return_value = FALSE; GdkDisplay *display; GtkTooltip *tooltip; + GdkDevice *device; /* Get current tooltip for this display */ display = gtk_widget_get_display (widget); @@ -1179,12 +1259,23 @@ _gtk_tooltip_focus_in (GtkWidget *widget) if (!tooltip || !tooltip->keyboard_mode_enabled) return; + device = gtk_get_current_event_device (); + + if (device && device->source == GDK_SOURCE_KEYBOARD) + device = gdk_device_get_associated_device (device); + + /* This function should be called by either a focus in event, + * or a key binding. In either case there should be a device. + */ + if (!device) + return; + if (tooltip->keyboard_widget) g_object_unref (tooltip->keyboard_widget); tooltip->keyboard_widget = g_object_ref (widget); - gdk_window_get_pointer (widget->window, &x, &y, NULL); + gdk_window_get_device_position (widget->window, device, &x, &y, NULL); return_value = gtk_tooltip_run_requery (&widget, tooltip, &x, &y); if (!return_value) diff --git a/gtk/gtktooltip.h b/gtk/gtktooltip.h index cc16cb0454..7fa4a2203d 100644 --- a/gtk/gtktooltip.h +++ b/gtk/gtktooltip.h @@ -19,7 +19,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -66,6 +66,12 @@ void _gtk_tooltip_toggle_keyboard_mode (GtkWidget *widget); void _gtk_tooltip_handle_event (GdkEvent *event); void _gtk_tooltip_hide (GtkWidget *widget); +GtkWidget * _gtk_widget_find_at_coords (GdkWindow *window, + gint window_x, + gint window_y, + gint *widget_x, + gint *widget_y); + G_END_DECLS #endif /* __GTK_TOOLTIP_H__ */ diff --git a/gtk/gtktooltips.c b/gtk/gtktooltips.c deleted file mode 100644 index 6c9131073d..0000000000 --- a/gtk/gtktooltips.c +++ /dev/null @@ -1,338 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#include "config.h" - -#include -#include -#include - -#undef GTK_DISABLE_DEPRECATED - -#include "gtklabel.h" -#include "gtkmain.h" -#include "gtkmenuitem.h" -#include "gtkprivate.h" -#include "gtkwidget.h" -#include "gtkwindow.h" -#include "gtkstyle.h" -#include "gtktooltips.h" -#include "gtkintl.h" -#include "gtkalias.h" - - -#define DEFAULT_DELAY 500 /* Default delay in ms */ -#define STICKY_DELAY 0 /* Delay before popping up next tip - * if we're sticky - */ -#define STICKY_REVERT_DELAY 1000 /* Delay before sticky tooltips revert - * to normal - */ -#define GTK_TOOLTIPS_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_TOOLTIPS, GtkTooltipsPrivate)) - -typedef struct _GtkTooltipsPrivate GtkTooltipsPrivate; - -struct _GtkTooltipsPrivate -{ - GHashTable *tips_data_table; -}; - - -static void gtk_tooltips_finalize (GObject *object); -static void gtk_tooltips_destroy (GtkObject *object); - -static void gtk_tooltips_destroy_data (GtkTooltipsData *tooltipsdata); - -static void gtk_tooltips_widget_remove (GtkWidget *widget, - gpointer data); - -static const gchar tooltips_data_key[] = "_GtkTooltipsData"; -static const gchar tooltips_info_key[] = "_GtkTooltipsInfo"; - -G_DEFINE_TYPE (GtkTooltips, gtk_tooltips, GTK_TYPE_OBJECT) - -static void -gtk_tooltips_class_init (GtkTooltipsClass *class) -{ - GtkObjectClass *object_class = (GtkObjectClass *) class; - GObjectClass *gobject_class = (GObjectClass *) class; - - gobject_class->finalize = gtk_tooltips_finalize; - - object_class->destroy = gtk_tooltips_destroy; - - g_type_class_add_private (gobject_class, sizeof (GtkTooltipsPrivate)); -} - -static void -gtk_tooltips_init (GtkTooltips *tooltips) -{ - GtkTooltipsPrivate *private = GTK_TOOLTIPS_GET_PRIVATE (tooltips); - - tooltips->tip_window = NULL; - tooltips->active_tips_data = NULL; - tooltips->tips_data_list = NULL; - - tooltips->delay = DEFAULT_DELAY; - tooltips->enabled = TRUE; - tooltips->timer_tag = 0; - tooltips->use_sticky_delay = FALSE; - tooltips->last_popdown.tv_sec = -1; - tooltips->last_popdown.tv_usec = -1; - - private->tips_data_table = - g_hash_table_new_full (NULL, NULL, NULL, - (GDestroyNotify) gtk_tooltips_destroy_data); - - gtk_tooltips_force_window (tooltips); -} - -static void -gtk_tooltips_finalize (GObject *object) -{ - GtkTooltipsPrivate *private = GTK_TOOLTIPS_GET_PRIVATE (object); - - g_hash_table_destroy (private->tips_data_table); - - G_OBJECT_CLASS (gtk_tooltips_parent_class)->finalize (object); -} - -GtkTooltips * -gtk_tooltips_new (void) -{ - return g_object_new (GTK_TYPE_TOOLTIPS, NULL); -} - -static void -gtk_tooltips_destroy_data (GtkTooltipsData *tooltipsdata) -{ - g_free (tooltipsdata->tip_text); - g_free (tooltipsdata->tip_private); - - g_signal_handlers_disconnect_by_func (tooltipsdata->widget, - gtk_tooltips_widget_remove, - tooltipsdata); - - g_object_set_data (G_OBJECT (tooltipsdata->widget), I_(tooltips_data_key), NULL); - g_object_unref (tooltipsdata->widget); - g_free (tooltipsdata); -} - -static void -gtk_tooltips_destroy (GtkObject *object) -{ - GtkTooltips *tooltips = GTK_TOOLTIPS (object); - GtkTooltipsPrivate *private = GTK_TOOLTIPS_GET_PRIVATE (tooltips); - - if (tooltips->tip_window) - { - gtk_widget_destroy (tooltips->tip_window); - tooltips->tip_window = NULL; - } - - g_hash_table_remove_all (private->tips_data_table); - - GTK_OBJECT_CLASS (gtk_tooltips_parent_class)->destroy (object); -} - -void -gtk_tooltips_force_window (GtkTooltips *tooltips) -{ - g_return_if_fail (GTK_IS_TOOLTIPS (tooltips)); - - if (!tooltips->tip_window) - { - tooltips->tip_window = gtk_window_new (GTK_WINDOW_POPUP); - g_signal_connect (tooltips->tip_window, - "destroy", - G_CALLBACK (gtk_widget_destroyed), - &tooltips->tip_window); - - tooltips->tip_label = gtk_label_new (NULL); - gtk_container_add (GTK_CONTAINER (tooltips->tip_window), - tooltips->tip_label); - } -} - -void -gtk_tooltips_enable (GtkTooltips *tooltips) -{ - g_return_if_fail (tooltips != NULL); - - tooltips->enabled = TRUE; -} - -void -gtk_tooltips_disable (GtkTooltips *tooltips) -{ - g_return_if_fail (tooltips != NULL); - - tooltips->enabled = FALSE; -} - -void -gtk_tooltips_set_delay (GtkTooltips *tooltips, - guint delay) -{ - g_return_if_fail (tooltips != NULL); - - tooltips->delay = delay; -} - -GtkTooltipsData* -gtk_tooltips_data_get (GtkWidget *widget) -{ - g_return_val_if_fail (widget != NULL, NULL); - - return g_object_get_data (G_OBJECT (widget), tooltips_data_key); -} - - -/** - * gtk_tooltips_set_tip: - * @tooltips: a #GtkTooltips. - * @widget: the #GtkWidget you wish to associate the tip with. - * @tip_text: (allow-none): a string containing the tip itself. - * @tip_private: (allow-none): a string of any further information that may be useful if the user gets stuck. - * - * Adds a tooltip containing the message @tip_text to the specified #GtkWidget. - * Deprecated: 2.12: - */ -void -gtk_tooltips_set_tip (GtkTooltips *tooltips, - GtkWidget *widget, - const gchar *tip_text, - const gchar *tip_private) -{ - GtkTooltipsData *tooltipsdata; - - g_return_if_fail (GTK_IS_TOOLTIPS (tooltips)); - g_return_if_fail (widget != NULL); - - tooltipsdata = gtk_tooltips_data_get (widget); - - if (!tip_text) - { - if (tooltipsdata) - gtk_tooltips_widget_remove (tooltipsdata->widget, tooltipsdata); - return; - } - - if (tooltips->active_tips_data - && tooltipsdata - && tooltips->active_tips_data->widget == widget - && GTK_WIDGET_DRAWABLE (tooltips->active_tips_data->widget)) - { - g_free (tooltipsdata->tip_text); - g_free (tooltipsdata->tip_private); - - tooltipsdata->tip_text = g_strdup (tip_text); - tooltipsdata->tip_private = g_strdup (tip_private); - } - else - { - g_object_ref (widget); - - if (tooltipsdata) - gtk_tooltips_widget_remove (tooltipsdata->widget, tooltipsdata); - - tooltipsdata = g_new0 (GtkTooltipsData, 1); - - tooltipsdata->tooltips = tooltips; - tooltipsdata->widget = widget; - - tooltipsdata->tip_text = g_strdup (tip_text); - tooltipsdata->tip_private = g_strdup (tip_private); - - g_hash_table_insert (GTK_TOOLTIPS_GET_PRIVATE (tooltips)->tips_data_table, - widget, tooltipsdata); - - g_object_set_data (G_OBJECT (widget), I_(tooltips_data_key), - tooltipsdata); - - g_signal_connect (widget, "destroy", - G_CALLBACK (gtk_tooltips_widget_remove), - tooltipsdata); - } - - gtk_widget_set_tooltip_text (widget, tip_text); -} - -static void -gtk_tooltips_widget_remove (GtkWidget *widget, - gpointer data) -{ - GtkTooltipsData *tooltipsdata = (GtkTooltipsData*) data; - GtkTooltips *tooltips = tooltipsdata->tooltips; - GtkTooltipsPrivate *private = GTK_TOOLTIPS_GET_PRIVATE (tooltips); - - g_hash_table_remove (private->tips_data_table, tooltipsdata->widget); -} - -/** - * gtk_tooltips_get_info_from_tip_window: - * @tip_window: a #GtkWindow - * @tooltips: the return location for the tooltips which are displayed - * in @tip_window, or %NULL - * @current_widget: the return location for the widget whose tooltips - * are displayed, or %NULL - * - * Determines the tooltips and the widget they belong to from the window in - * which they are displayed. - * - * This function is mostly intended for use by accessibility technologies; - * applications should have little use for it. - * - * Return value: %TRUE if @tip_window is displaying tooltips, otherwise %FALSE. - * - * Since: 2.4 - * - * Deprecated: 2.12: - **/ -gboolean -gtk_tooltips_get_info_from_tip_window (GtkWindow *tip_window, - GtkTooltips **tooltips, - GtkWidget **current_widget) -{ - GtkTooltips *current_tooltips; - gboolean has_tips; - - g_return_val_if_fail (GTK_IS_WINDOW (tip_window), FALSE); - - current_tooltips = g_object_get_data (G_OBJECT (tip_window), tooltips_info_key); - - has_tips = current_tooltips != NULL; - - if (tooltips) - *tooltips = current_tooltips; - if (current_widget) - *current_widget = (has_tips && current_tooltips->active_tips_data) ? current_tooltips->active_tips_data->widget : NULL; - - return has_tips; -} - -#define __GTK_TOOLTIPS_C__ -#include "gtkaliasdef.c" diff --git a/gtk/gtktooltips.h b/gtk/gtktooltips.h deleted file mode 100644 index a86085652c..0000000000 --- a/gtk/gtktooltips.h +++ /dev/null @@ -1,109 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#ifndef GTK_DISABLE_DEPRECATED - -#ifndef __GTK_TOOLTIPS_H__ -#define __GTK_TOOLTIPS_H__ - -#include -#include - - -G_BEGIN_DECLS - -#define GTK_TYPE_TOOLTIPS (gtk_tooltips_get_type ()) -#define GTK_TOOLTIPS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TOOLTIPS, GtkTooltips)) -#define GTK_TOOLTIPS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TOOLTIPS, GtkTooltipsClass)) -#define GTK_IS_TOOLTIPS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TOOLTIPS)) -#define GTK_IS_TOOLTIPS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TOOLTIPS)) -#define GTK_TOOLTIPS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TOOLTIPS, GtkTooltipsClass)) - - -typedef struct _GtkTooltips GtkTooltips; -typedef struct _GtkTooltipsClass GtkTooltipsClass; -typedef struct _GtkTooltipsData GtkTooltipsData; - -struct _GtkTooltipsData -{ - GtkTooltips *tooltips; - GtkWidget *widget; - gchar *tip_text; - gchar *tip_private; -}; - -struct _GtkTooltips -{ - GtkObject parent_instance; - - /*< private >*/ - GtkWidget *tip_window; - GtkWidget *tip_label; - GtkTooltipsData *active_tips_data; - GList *tips_data_list; /* unused */ - - guint delay : 30; - guint enabled : 1; - guint have_grab : 1; - guint use_sticky_delay : 1; - gint timer_tag; - GTimeVal last_popdown; -}; - -struct _GtkTooltipsClass -{ - GtkObjectClass parent_class; - - /* Padding for future expansion */ - void (*_gtk_reserved1) (void); - void (*_gtk_reserved2) (void); - void (*_gtk_reserved3) (void); - void (*_gtk_reserved4) (void); -}; - -GType gtk_tooltips_get_type (void) G_GNUC_CONST; -GtkTooltips* gtk_tooltips_new (void); - -void gtk_tooltips_enable (GtkTooltips *tooltips); -void gtk_tooltips_disable (GtkTooltips *tooltips); -void gtk_tooltips_set_delay (GtkTooltips *tooltips, - guint delay); -void gtk_tooltips_set_tip (GtkTooltips *tooltips, - GtkWidget *widget, - const gchar *tip_text, - const gchar *tip_private); -GtkTooltipsData* gtk_tooltips_data_get (GtkWidget *widget); -void gtk_tooltips_force_window (GtkTooltips *tooltips); - -gboolean gtk_tooltips_get_info_from_tip_window (GtkWindow *tip_window, - GtkTooltips **tooltips, - GtkWidget **current_widget); - -G_END_DECLS - -#endif /* __GTK_TOOLTIPS_H__ */ - -#endif /* GTK_DISABLE_DEPRECATED */ diff --git a/gtk/gtktrayicon-x11.c b/gtk/gtktrayicon-x11.c index 8e7f7cbfcd..ae426b3765 100644 --- a/gtk/gtktrayicon-x11.c +++ b/gtk/gtktrayicon-x11.c @@ -43,7 +43,12 @@ enum { PROP_0, - PROP_ORIENTATION + PROP_ORIENTATION, + PROP_FG_COLOR, + PROP_ERROR_COLOR, + PROP_WARNING_COLOR, + PROP_SUCCESS_COLOR, + PROP_PADDING }; struct _GtkTrayIconPrivate @@ -55,11 +60,18 @@ struct _GtkTrayIconPrivate Atom system_tray_opcode_atom; Atom orientation_atom; Atom visual_atom; + Atom colors_atom; + Atom padding_atom; Window manager_window; GdkVisual *manager_visual; gboolean manager_visual_rgba; GtkOrientation orientation; + GdkColor fg_color; + GdkColor error_color; + GdkColor warning_color; + GdkColor success_color; + gint padding; }; static void gtk_tray_icon_constructed (GObject *object); @@ -75,7 +87,7 @@ static void gtk_tray_icon_style_set (GtkWidget *widget, GtkStyle *previous_style); static gboolean gtk_tray_icon_delete (GtkWidget *widget, GdkEventAny *event); -static gboolean gtk_tray_icon_expose (GtkWidget *widget, +static gboolean gtk_tray_icon_expose (GtkWidget *widget, GdkEventExpose *event); static void gtk_tray_icon_clear_manager_window (GtkTrayIcon *icon); @@ -113,6 +125,48 @@ gtk_tray_icon_class_init (GtkTrayIconClass *class) GTK_ORIENTATION_HORIZONTAL, GTK_PARAM_READABLE)); + g_object_class_install_property (gobject_class, + PROP_FG_COLOR, + g_param_spec_boxed ("fg-color", + P_("Foreground color"), + P_("Foreground color for symbolic icons"), + GDK_TYPE_COLOR, + GTK_PARAM_READABLE)); + + g_object_class_install_property (gobject_class, + PROP_ERROR_COLOR, + g_param_spec_boxed ("error-color", + P_("Error color"), + P_("Error color for symbolic icons"), + GDK_TYPE_COLOR, + GTK_PARAM_READABLE)); + + g_object_class_install_property (gobject_class, + PROP_WARNING_COLOR, + g_param_spec_boxed ("warning-color", + P_("Warning color"), + P_("Warning color for symbolic icons"), + GDK_TYPE_COLOR, + GTK_PARAM_READABLE)); + + g_object_class_install_property (gobject_class, + PROP_SUCCESS_COLOR, + g_param_spec_boxed ("success-color", + P_("Success color"), + P_("Success color for symbolic icons"), + GDK_TYPE_COLOR, + GTK_PARAM_READABLE)); + + g_object_class_install_property (gobject_class, + PROP_PADDING, + g_param_spec_int ("padding", + P_("Padding"), + P_("Padding that should be put around icons in the tray"), + 0, + G_MAXINT, + 0, + GTK_PARAM_READABLE)); + g_type_class_add_private (class, sizeof (GtkTrayIconPrivate)); } @@ -121,9 +175,22 @@ gtk_tray_icon_init (GtkTrayIcon *icon) { icon->priv = G_TYPE_INSTANCE_GET_PRIVATE (icon, GTK_TYPE_TRAY_ICON, GtkTrayIconPrivate); - + icon->priv->stamp = 1; icon->priv->orientation = GTK_ORIENTATION_HORIZONTAL; + icon->priv->fg_color.red = 0x0000; + icon->priv->fg_color.green = 0x0000; + icon->priv->fg_color.blue = 0x0000; + icon->priv->error_color.red = 0xcc00; + icon->priv->error_color.green = 0x0000; + icon->priv->error_color.blue = 0x0000; + icon->priv->warning_color.red = 0xf500; + icon->priv->warning_color.green = 0x7900; + icon->priv->warning_color.blue = 0x3e00; + icon->priv->success_color.red = 0x4e00; + icon->priv->success_color.green = 0x9a00; + icon->priv->success_color.blue = 0x0600; + icon->priv->padding = 0; gtk_widget_set_app_paintable (GTK_WIDGET (icon), TRUE); gtk_widget_add_events (GTK_WIDGET (icon), GDK_PROPERTY_CHANGE_MASK); @@ -161,6 +228,14 @@ gtk_tray_icon_constructed (GObject *object) "_NET_SYSTEM_TRAY_VISUAL", False); + icon->priv->colors_atom = XInternAtom (xdisplay, + "_NET_SYSTEM_TRAY_COLORS", + False); + + icon->priv->padding_atom = XInternAtom (xdisplay, + "_NET_SYSTEM_TRAY_PADDING", + False); + /* Add a root window filter so that we get changes on MANAGER */ gdk_window_add_filter (root_window, gtk_tray_icon_manager_filter, icon); @@ -212,6 +287,21 @@ gtk_tray_icon_get_property (GObject *object, case PROP_ORIENTATION: g_value_set_enum (value, icon->priv->orientation); break; + case PROP_FG_COLOR: + g_value_set_boxed (value, &icon->priv->fg_color); + break; + case PROP_ERROR_COLOR: + g_value_set_boxed (value, &icon->priv->error_color); + break; + case PROP_WARNING_COLOR: + g_value_set_boxed (value, &icon->priv->warning_color); + break; + case PROP_SUCCESS_COLOR: + g_value_set_boxed (value, &icon->priv->success_color); + break; + case PROP_PADDING: + g_value_set_int (value, icon->priv->padding); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -372,9 +462,152 @@ gtk_tray_icon_get_visual_property (GtkTrayIcon *icon) XFree (prop.prop); } +static void +gtk_tray_icon_get_colors_property (GtkTrayIcon *icon) +{ + GdkScreen *screen = gtk_widget_get_screen (GTK_WIDGET (icon)); + GdkDisplay *display = gdk_screen_get_display (screen); + Display *xdisplay = GDK_DISPLAY_XDISPLAY (display); + + Atom type; + int format; + union { + gulong *prop; + guchar *prop_ch; + } prop = { NULL }; + gulong nitems; + gulong bytes_after; + int error, result; + + g_assert (icon->priv->manager_window != None); + + gdk_error_trap_push (); + type = None; + result = XGetWindowProperty (xdisplay, + icon->priv->manager_window, + icon->priv->colors_atom, + 0, G_MAXLONG, FALSE, + XA_CARDINAL, + &type, &format, &nitems, + &bytes_after, &(prop.prop_ch)); + error = gdk_error_trap_pop (); + + if (error || result != Success) + return; + + if (type == XA_CARDINAL && nitems == 12 && format == 32) + { + GdkColor color; + + g_object_freeze_notify (G_OBJECT (icon)); + + color.red = prop.prop[0]; + color.green = prop.prop[1]; + color.blue = prop.prop[2]; + + if (!gdk_color_equal (&icon->priv->fg_color, &color)) + { + icon->priv->fg_color = color; + + g_object_notify (G_OBJECT (icon), "fg-color"); + } + + color.red = prop.prop[3]; + color.green = prop.prop[4]; + color.blue = prop.prop[5]; + + if (!gdk_color_equal (&icon->priv->error_color, &color)) + { + icon->priv->error_color = color; + + g_object_notify (G_OBJECT (icon), "error-color"); + } + + g_object_thaw_notify (G_OBJECT (icon)); + + color.red = prop.prop[6]; + color.green = prop.prop[7]; + color.blue = prop.prop[8]; + + if (!gdk_color_equal (&icon->priv->warning_color, &color)) + { + icon->priv->warning_color = color; + + g_object_notify (G_OBJECT (icon), "warning-color"); + } + + g_object_thaw_notify (G_OBJECT (icon)); + + color.red = prop.prop[9]; + color.green = prop.prop[10]; + color.blue = prop.prop[11]; + + if (!gdk_color_equal (&icon->priv->success_color, &color)) + { + icon->priv->success_color = color; + + g_object_notify (G_OBJECT (icon), "success-color"); + } + + g_object_thaw_notify (G_OBJECT (icon)); + } + + if (type != None) + XFree (prop.prop); +} + +static void +gtk_tray_icon_get_padding_property (GtkTrayIcon *icon) +{ + GdkScreen *screen = gtk_widget_get_screen (GTK_WIDGET (icon)); + GdkDisplay *display = gdk_screen_get_display (screen); + Display *xdisplay = GDK_DISPLAY_XDISPLAY (display); + + Atom type; + int format; + union { + gulong *prop; + guchar *prop_ch; + } prop = { NULL }; + gulong nitems; + gulong bytes_after; + int error, result; + + g_assert (icon->priv->manager_window != None); + + gdk_error_trap_push (); + type = None; + result = XGetWindowProperty (xdisplay, + icon->priv->manager_window, + icon->priv->padding_atom, + 0, G_MAXLONG, FALSE, + XA_CARDINAL, + &type, &format, &nitems, + &bytes_after, &(prop.prop_ch)); + error = gdk_error_trap_pop (); + + if (!error && result == Success && + type == XA_CARDINAL && nitems == 1 && format == 32) + { + gint padding; + + padding = prop.prop[0]; + + if (icon->priv->padding != padding) + { + icon->priv->padding = padding; + + g_object_notify (G_OBJECT (icon), "padding"); + } + } + + if (type != None) + XFree (prop.prop); +} + static GdkFilterReturn -gtk_tray_icon_manager_filter (GdkXEvent *xevent, - GdkEvent *event, +gtk_tray_icon_manager_filter (GdkXEvent *xevent, + GdkEvent *event, gpointer user_data) { GtkTrayIcon *icon = user_data; @@ -399,6 +632,19 @@ gtk_tray_icon_manager_filter (GdkXEvent *xevent, gtk_tray_icon_get_orientation_property (icon); } + else if (xev->xany.type == PropertyNotify && + xev->xproperty.atom == icon->priv->colors_atom) + { + GTK_NOTE (PLUGSOCKET, + g_print ("GtkStatusIcon %p: got PropertyNotify on manager window for colors atom\n", icon)); + + gtk_tray_icon_get_colors_property (icon); + } + else if (xev->xany.type == PropertyNotify && + xev->xproperty.atom == icon->priv->padding_atom) + { + gtk_tray_icon_get_padding_property (icon); + } else if (xev->xany.type == DestroyNotify) { GTK_NOTE (PLUGSOCKET, @@ -504,6 +750,8 @@ gtk_tray_icon_update_manager_window (GtkTrayIcon *icon) gtk_tray_icon_get_orientation_property (icon); gtk_tray_icon_get_visual_property (icon); + gtk_tray_icon_get_colors_property (icon); + gtk_tray_icon_get_padding_property (icon); if (gtk_widget_get_realized (GTK_WIDGET (icon))) { @@ -742,6 +990,13 @@ _gtk_tray_icon_get_orientation (GtkTrayIcon *icon) return icon->priv->orientation; } +gint +_gtk_tray_icon_get_padding (GtkTrayIcon *icon) +{ + g_return_val_if_fail (GTK_IS_TRAY_ICON (icon), 0); + + return icon->priv->padding; +} #define __GTK_TRAY_ICON_X11_C__ #include "gtkaliasdef.c" diff --git a/gtk/gtktrayicon.h b/gtk/gtktrayicon.h index 4c1e18489f..6dc98521fa 100644 --- a/gtk/gtktrayicon.h +++ b/gtk/gtktrayicon.h @@ -69,7 +69,8 @@ void _gtk_tray_icon_cancel_message (GtkTrayIcon *icon, guint id); GtkOrientation _gtk_tray_icon_get_orientation (GtkTrayIcon *icon); - +gint _gtk_tray_icon_get_padding (GtkTrayIcon *icon); + G_END_DECLS #endif /* __GTK_TRAY_ICON_H__ */ diff --git a/gtk/gtktree.c b/gtk/gtktree.c deleted file mode 100644 index 7d842c1378..0000000000 --- a/gtk/gtktree.c +++ /dev/null @@ -1,1136 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#undef GTK_DISABLE_DEPRECATED - -#include "config.h" -#include "gtkmain.h" -#include "gtkmarshalers.h" -#include "gtksignal.h" -#include "gtklist.h" - -#define GTK_ENABLE_BROKEN -#include "gtktree.h" -#include "gtktreeitem.h" -#include "gtkintl.h" - -#include "gtkalias.h" - -enum { - SELECTION_CHANGED, - SELECT_CHILD, - UNSELECT_CHILD, - LAST_SIGNAL -}; - -static void gtk_tree_class_init (GtkTreeClass *klass); -static void gtk_tree_init (GtkTree *tree); -static void gtk_tree_destroy (GtkObject *object); -static void gtk_tree_map (GtkWidget *widget); -static void gtk_tree_parent_set (GtkWidget *widget, - GtkWidget *previous_parent); -static void gtk_tree_unmap (GtkWidget *widget); -static void gtk_tree_realize (GtkWidget *widget); -static gint gtk_tree_motion_notify (GtkWidget *widget, - GdkEventMotion *event); -static gint gtk_tree_button_press (GtkWidget *widget, - GdkEventButton *event); -static gint gtk_tree_button_release (GtkWidget *widget, - GdkEventButton *event); -static void gtk_tree_size_request (GtkWidget *widget, - GtkRequisition *requisition); -static void gtk_tree_size_allocate (GtkWidget *widget, - GtkAllocation *allocation); -static void gtk_tree_add (GtkContainer *container, - GtkWidget *widget); -static void gtk_tree_forall (GtkContainer *container, - gboolean include_internals, - GtkCallback callback, - gpointer callback_data); - -static void gtk_real_tree_select_child (GtkTree *tree, - GtkWidget *child); -static void gtk_real_tree_unselect_child (GtkTree *tree, - GtkWidget *child); - -static GtkType gtk_tree_child_type (GtkContainer *container); - -static GtkContainerClass *parent_class = NULL; -static guint tree_signals[LAST_SIGNAL] = { 0 }; - -GtkType -gtk_tree_get_type (void) -{ - static GtkType tree_type = 0; - - if (!tree_type) - { - static const GtkTypeInfo tree_info = - { - "GtkTree", - sizeof (GtkTree), - sizeof (GtkTreeClass), - (GtkClassInitFunc) gtk_tree_class_init, - (GtkObjectInitFunc) gtk_tree_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, - }; - - I_("GtkTree"); - tree_type = gtk_type_unique (gtk_container_get_type (), &tree_info); - } - - return tree_type; -} - -static void -gtk_tree_class_init (GtkTreeClass *class) -{ - GtkObjectClass *object_class; - GtkWidgetClass *widget_class; - GtkContainerClass *container_class; - - object_class = (GtkObjectClass*) class; - widget_class = (GtkWidgetClass*) class; - container_class = (GtkContainerClass*) class; - - parent_class = gtk_type_class (gtk_container_get_type ()); - - - object_class->destroy = gtk_tree_destroy; - - widget_class->map = gtk_tree_map; - widget_class->unmap = gtk_tree_unmap; - widget_class->parent_set = gtk_tree_parent_set; - widget_class->realize = gtk_tree_realize; - widget_class->motion_notify_event = gtk_tree_motion_notify; - widget_class->button_press_event = gtk_tree_button_press; - widget_class->button_release_event = gtk_tree_button_release; - widget_class->size_request = gtk_tree_size_request; - widget_class->size_allocate = gtk_tree_size_allocate; - - container_class->add = gtk_tree_add; - container_class->remove = - (void (*)(GtkContainer *, GtkWidget *)) gtk_tree_remove_item; - container_class->forall = gtk_tree_forall; - container_class->child_type = gtk_tree_child_type; - - class->selection_changed = NULL; - class->select_child = gtk_real_tree_select_child; - class->unselect_child = gtk_real_tree_unselect_child; - - tree_signals[SELECTION_CHANGED] = - gtk_signal_new (I_("selection-changed"), - GTK_RUN_FIRST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkTreeClass, selection_changed), - _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); - tree_signals[SELECT_CHILD] = - gtk_signal_new (I_("select-child"), - GTK_RUN_FIRST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkTreeClass, select_child), - _gtk_marshal_VOID__OBJECT, - GTK_TYPE_NONE, 1, - GTK_TYPE_WIDGET); - tree_signals[UNSELECT_CHILD] = - gtk_signal_new (I_("unselect-child"), - GTK_RUN_FIRST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkTreeClass, unselect_child), - _gtk_marshal_VOID__OBJECT, - GTK_TYPE_NONE, 1, - GTK_TYPE_WIDGET); -} - -static GtkType -gtk_tree_child_type (GtkContainer *container) -{ - return GTK_TYPE_TREE_ITEM; -} - -static void -gtk_tree_init (GtkTree *tree) -{ - tree->children = NULL; - tree->root_tree = tree; - tree->selection = NULL; - tree->tree_owner = NULL; - tree->selection_mode = GTK_SELECTION_SINGLE; - tree->indent_value = 9; - tree->current_indent = 0; - tree->level = 0; - tree->view_mode = GTK_TREE_VIEW_LINE; - tree->view_line = TRUE; -} - -GtkWidget* -gtk_tree_new (void) -{ - return GTK_WIDGET (gtk_type_new (gtk_tree_get_type ())); -} - -void -gtk_tree_append (GtkTree *tree, - GtkWidget *tree_item) -{ - g_return_if_fail (GTK_IS_TREE (tree)); - g_return_if_fail (GTK_IS_TREE_ITEM (tree_item)); - - gtk_tree_insert (tree, tree_item, -1); -} - -void -gtk_tree_prepend (GtkTree *tree, - GtkWidget *tree_item) -{ - g_return_if_fail (GTK_IS_TREE (tree)); - g_return_if_fail (GTK_IS_TREE_ITEM (tree_item)); - - gtk_tree_insert (tree, tree_item, 0); -} - -void -gtk_tree_insert (GtkTree *tree, - GtkWidget *tree_item, - gint position) -{ - gint nchildren; - - g_return_if_fail (GTK_IS_TREE (tree)); - g_return_if_fail (GTK_IS_TREE_ITEM (tree_item)); - - nchildren = g_list_length (tree->children); - - if ((position < 0) || (position > nchildren)) - position = nchildren; - - if (position == nchildren) - tree->children = g_list_append (tree->children, tree_item); - else - tree->children = g_list_insert (tree->children, tree_item, position); - - gtk_widget_set_parent (tree_item, GTK_WIDGET (tree)); -} - -static void -gtk_tree_add (GtkContainer *container, - GtkWidget *child) -{ - GtkTree *tree; - - g_return_if_fail (GTK_IS_TREE (container)); - g_return_if_fail (GTK_IS_TREE_ITEM (child)); - - tree = GTK_TREE (container); - - tree->children = g_list_append (tree->children, child); - - gtk_widget_set_parent (child, GTK_WIDGET (container)); - - if (!tree->selection && (tree->selection_mode == GTK_SELECTION_BROWSE)) - gtk_tree_select_child (tree, child); -} - -static gint -gtk_tree_button_press (GtkWidget *widget, - GdkEventButton *event) -{ - GtkTree *tree; - GtkWidget *item; - - g_return_val_if_fail (GTK_IS_TREE (widget), FALSE); - g_return_val_if_fail (event != NULL, FALSE); - - tree = GTK_TREE (widget); - item = gtk_get_event_widget ((GdkEvent*) event); - - while (item && !GTK_IS_TREE_ITEM (item)) - item = item->parent; - - if (!item || (item->parent != widget)) - return FALSE; - - switch(event->button) - { - case 1: - gtk_tree_select_child (tree, item); - break; - case 2: - if(GTK_TREE_ITEM(item)->subtree) gtk_tree_item_expand(GTK_TREE_ITEM(item)); - break; - case 3: - if(GTK_TREE_ITEM(item)->subtree) gtk_tree_item_collapse(GTK_TREE_ITEM(item)); - break; - } - - return TRUE; -} - -static gint -gtk_tree_button_release (GtkWidget *widget, - GdkEventButton *event) -{ - GtkTree *tree; - GtkWidget *item; - - g_return_val_if_fail (GTK_IS_TREE (widget), FALSE); - g_return_val_if_fail (event != NULL, FALSE); - - tree = GTK_TREE (widget); - item = gtk_get_event_widget ((GdkEvent*) event); - - return TRUE; -} - -gint -gtk_tree_child_position (GtkTree *tree, - GtkWidget *child) -{ - GList *children; - gint pos; - - - g_return_val_if_fail (GTK_IS_TREE (tree), -1); - g_return_val_if_fail (child != NULL, -1); - - pos = 0; - children = tree->children; - - while (children) - { - if (child == GTK_WIDGET (children->data)) - return pos; - - pos += 1; - children = children->next; - } - - - return -1; -} - -void -gtk_tree_clear_items (GtkTree *tree, - gint start, - gint end) -{ - GtkWidget *widget; - GList *clear_list; - GList *tmp_list; - guint nchildren; - guint index; - - g_return_if_fail (GTK_IS_TREE (tree)); - - nchildren = g_list_length (tree->children); - - if (nchildren > 0) - { - if ((end < 0) || (end > nchildren)) - end = nchildren; - - if (start >= end) - return; - - tmp_list = g_list_nth (tree->children, start); - clear_list = NULL; - index = start; - while (tmp_list && index <= end) - { - widget = tmp_list->data; - tmp_list = tmp_list->next; - index++; - - clear_list = g_list_prepend (clear_list, widget); - } - - gtk_tree_remove_items (tree, clear_list); - } -} - -static void -gtk_tree_destroy (GtkObject *object) -{ - GtkTree *tree; - GtkWidget *child; - GList *children; - - g_return_if_fail (GTK_IS_TREE (object)); - - tree = GTK_TREE (object); - - children = tree->children; - while (children) - { - child = children->data; - children = children->next; - - g_object_ref (child); - gtk_widget_unparent (child); - gtk_widget_destroy (child); - g_object_unref (child); - } - - g_list_free (tree->children); - tree->children = NULL; - - if (tree->root_tree == tree) - { - GList *node; - for (node = tree->selection; node; node = node->next) - g_object_unref (node->data); - g_list_free (tree->selection); - tree->selection = NULL; - } - - GTK_OBJECT_CLASS (parent_class)->destroy (object); -} - -static void -gtk_tree_forall (GtkContainer *container, - gboolean include_internals, - GtkCallback callback, - gpointer callback_data) -{ - GtkTree *tree; - GtkWidget *child; - GList *children; - - - g_return_if_fail (GTK_IS_TREE (container)); - g_return_if_fail (callback != NULL); - - tree = GTK_TREE (container); - children = tree->children; - - while (children) - { - child = children->data; - children = children->next; - - (* callback) (child, callback_data); - } -} - -static void -gtk_tree_unselect_all (GtkTree *tree) -{ - GList *tmp_list, *selection; - GtkWidget *tmp_item; - - selection = tree->selection; - tree->selection = NULL; - - tmp_list = selection; - while (tmp_list) - { - tmp_item = selection->data; - - if (tmp_item->parent && - GTK_IS_TREE (tmp_item->parent) && - GTK_TREE (tmp_item->parent)->root_tree == tree) - gtk_tree_item_deselect (GTK_TREE_ITEM (tmp_item)); - - g_object_unref (tmp_item); - - tmp_list = tmp_list->next; - } - - g_list_free (selection); -} - -static void -gtk_tree_parent_set (GtkWidget *widget, - GtkWidget *previous_parent) -{ - GtkTree *tree = GTK_TREE (widget); - GtkWidget *child; - GList *children; - - if (GTK_IS_TREE (widget->parent)) - { - gtk_tree_unselect_all (tree); - - /* set root tree for this tree */ - tree->root_tree = GTK_TREE(widget->parent)->root_tree; - - tree->level = GTK_TREE(GTK_WIDGET(tree)->parent)->level+1; - tree->indent_value = GTK_TREE(GTK_WIDGET(tree)->parent)->indent_value; - tree->current_indent = GTK_TREE(GTK_WIDGET(tree)->parent)->current_indent + - tree->indent_value; - tree->view_mode = GTK_TREE(GTK_WIDGET(tree)->parent)->view_mode; - tree->view_line = GTK_TREE(GTK_WIDGET(tree)->parent)->view_line; - } - else - { - tree->root_tree = tree; - - tree->level = 0; - tree->current_indent = 0; - } - - children = tree->children; - while (children) - { - child = children->data; - children = children->next; - - if (GTK_TREE_ITEM (child)->subtree) - gtk_tree_parent_set (GTK_TREE_ITEM (child)->subtree, child); - } -} - -static void -gtk_tree_map (GtkWidget *widget) -{ - GtkTree *tree = GTK_TREE (widget); - GtkWidget *child; - GList *children; - - gtk_widget_set_mapped (widget, TRUE); - - children = tree->children; - while (children) - { - child = children->data; - children = children->next; - - if (gtk_widget_get_visible (child) && - !gtk_widget_get_mapped (child)) - gtk_widget_map (child); - - if (GTK_TREE_ITEM (child)->subtree) - { - child = GTK_WIDGET (GTK_TREE_ITEM (child)->subtree); - - if (gtk_widget_get_visible (child) && !gtk_widget_get_mapped (child)) - gtk_widget_map (child); - } - } - - gdk_window_show (widget->window); -} - -static gint -gtk_tree_motion_notify (GtkWidget *widget, - GdkEventMotion *event) -{ - g_return_val_if_fail (GTK_IS_TREE (widget), FALSE); - g_return_val_if_fail (event != NULL, FALSE); - -#ifdef TREE_DEBUG - g_message("gtk_tree_motion_notify\n"); -#endif /* TREE_DEBUG */ - - return FALSE; -} - -static void -gtk_tree_realize (GtkWidget *widget) -{ - GdkWindowAttr attributes; - gint attributes_mask; - - - g_return_if_fail (GTK_IS_TREE (widget)); - - gtk_widget_set_realized (widget, TRUE); - - 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_OUTPUT; - attributes.visual = gtk_widget_get_visual (widget); - attributes.colormap = gtk_widget_get_colormap (widget); - attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK; - - attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP; - - widget->window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask); - gdk_window_set_user_data (widget->window, widget); - - widget->style = gtk_style_attach (widget->style, widget->window); - gdk_window_set_background (widget->window, - &widget->style->base[GTK_STATE_NORMAL]); -} - -void -gtk_tree_remove_item (GtkTree *container, - GtkWidget *widget) -{ - GList *item_list; - - g_return_if_fail (GTK_IS_TREE (container)); - g_return_if_fail (widget != NULL); - g_return_if_fail (container == GTK_TREE (widget->parent)); - - item_list = g_list_append (NULL, widget); - - gtk_tree_remove_items (GTK_TREE (container), item_list); - - g_list_free (item_list); -} - -/* used by gtk_tree_remove_items to make the function independent of - order in list of items to remove. - Sort item by depth in tree */ -static gint -gtk_tree_sort_item_by_depth(GtkWidget* a, GtkWidget* b) -{ - if((GTK_TREE(a->parent)->level) < (GTK_TREE(b->parent)->level)) - return 1; - if((GTK_TREE(a->parent)->level) > (GTK_TREE(b->parent)->level)) - return -1; - - return 0; -} - -void -gtk_tree_remove_items (GtkTree *tree, - GList *items) -{ - GtkWidget *widget; - GList *selected_widgets; - GList *tmp_list; - GList *sorted_list; - GtkTree *real_tree; - GtkTree *root_tree; - - g_return_if_fail (GTK_IS_TREE (tree)); - -#ifdef TREE_DEBUG - g_message("+ gtk_tree_remove_items [ tree %#x items list %#x ]\n", (int)tree, (int)items); -#endif /* TREE_DEBUG */ - - /* We may not yet be mapped, so we actively have to find our - * root tree - */ - if (tree->root_tree) - root_tree = tree->root_tree; - else - { - GtkWidget *tmp = GTK_WIDGET (tree); - while (GTK_IS_TREE (tmp->parent)) - tmp = tmp->parent; - - root_tree = GTK_TREE (tmp); - } - - tmp_list = items; - selected_widgets = NULL; - sorted_list = NULL; - widget = NULL; - -#ifdef TREE_DEBUG - g_message("* sort list by depth\n"); -#endif /* TREE_DEBUG */ - - while (tmp_list) - { - -#ifdef TREE_DEBUG - g_message ("* item [%#x] depth [%d]\n", - (int)tmp_list->data, - (int)GTK_TREE(GTK_WIDGET(tmp_list->data)->parent)->level); -#endif /* TREE_DEBUG */ - - sorted_list = g_list_insert_sorted(sorted_list, - tmp_list->data, - (GCompareFunc)gtk_tree_sort_item_by_depth); - tmp_list = g_list_next(tmp_list); - } - -#ifdef TREE_DEBUG - /* print sorted list */ - g_message("* sorted list result\n"); - tmp_list = sorted_list; - while(tmp_list) - { - g_message("* item [%#x] depth [%d]\n", - (int)tmp_list->data, - (int)GTK_TREE(GTK_WIDGET(tmp_list->data)->parent)->level); - tmp_list = g_list_next(tmp_list); - } -#endif /* TREE_DEBUG */ - -#ifdef TREE_DEBUG - g_message("* scan sorted list\n"); -#endif /* TREE_DEBUG */ - - tmp_list = sorted_list; - while (tmp_list) - { - widget = tmp_list->data; - tmp_list = tmp_list->next; - -#ifdef TREE_DEBUG - g_message("* item [%#x] subtree [%#x]\n", - (int)widget, (int)GTK_TREE_ITEM_SUBTREE(widget)); -#endif /* TREE_DEBUG */ - - /* get real owner of this widget */ - real_tree = GTK_TREE(widget->parent); -#ifdef TREE_DEBUG - g_message("* subtree having this widget [%#x]\n", (int)real_tree); -#endif /* TREE_DEBUG */ - - - if (widget->state == GTK_STATE_SELECTED) - { - selected_widgets = g_list_prepend (selected_widgets, widget); -#ifdef TREE_DEBUG - g_message("* selected widget - adding it in selected list [%#x]\n", - (int)selected_widgets); -#endif /* TREE_DEBUG */ - } - - /* remove this item from its real parent */ -#ifdef TREE_DEBUG - g_message("* remove widget from its owner tree\n"); -#endif /* TREE_DEBUG */ - real_tree->children = g_list_remove (real_tree->children, widget); - - /* remove subtree associate at this item if it exist */ - if(GTK_TREE_ITEM(widget)->subtree) - { -#ifdef TREE_DEBUG - g_message("* remove subtree associate at this item [%#x]\n", - (int) GTK_TREE_ITEM(widget)->subtree); -#endif /* TREE_DEBUG */ - if (gtk_widget_get_mapped (GTK_TREE_ITEM(widget)->subtree)) - gtk_widget_unmap (GTK_TREE_ITEM(widget)->subtree); - - gtk_widget_unparent (GTK_TREE_ITEM(widget)->subtree); - GTK_TREE_ITEM(widget)->subtree = NULL; - } - - /* really remove widget for this item */ -#ifdef TREE_DEBUG - g_message("* unmap and unparent widget [%#x]\n", (int)widget); -#endif /* TREE_DEBUG */ - if (gtk_widget_get_mapped (widget)) - gtk_widget_unmap (widget); - - gtk_widget_unparent (widget); - - /* delete subtree if there is no children in it */ - if(real_tree->children == NULL && - real_tree != root_tree) - { -#ifdef TREE_DEBUG - g_message("* owner tree don't have children ... destroy it\n"); -#endif /* TREE_DEBUG */ - gtk_tree_item_remove_subtree(GTK_TREE_ITEM(real_tree->tree_owner)); - } - -#ifdef TREE_DEBUG - g_message("* next item in list\n"); -#endif /* TREE_DEBUG */ - } - - if (selected_widgets) - { -#ifdef TREE_DEBUG - g_message("* scan selected item list\n"); -#endif /* TREE_DEBUG */ - tmp_list = selected_widgets; - while (tmp_list) - { - widget = tmp_list->data; - tmp_list = tmp_list->next; - -#ifdef TREE_DEBUG - g_message("* widget [%#x] subtree [%#x]\n", - (int)widget, (int)GTK_TREE_ITEM_SUBTREE(widget)); -#endif /* TREE_DEBUG */ - - /* remove widget of selection */ - root_tree->selection = g_list_remove (root_tree->selection, widget); - - /* unref it to authorize is destruction */ - g_object_unref (widget); - } - - /* emit only one selection_changed signal */ - gtk_signal_emit (GTK_OBJECT (root_tree), - tree_signals[SELECTION_CHANGED]); - } - -#ifdef TREE_DEBUG - g_message("* free selected_widgets list\n"); -#endif /* TREE_DEBUG */ - g_list_free (selected_widgets); - g_list_free (sorted_list); - - if (root_tree->children && !root_tree->selection && - (root_tree->selection_mode == GTK_SELECTION_BROWSE)) - { -#ifdef TREE_DEBUG - g_message("* BROWSE mode, select another item\n"); -#endif /* TREE_DEBUG */ - widget = root_tree->children->data; - gtk_tree_select_child (root_tree, widget); - } - - if (gtk_widget_get_visible (GTK_WIDGET (root_tree))) - { -#ifdef TREE_DEBUG - g_message("* query queue resizing for root_tree\n"); -#endif /* TREE_DEBUG */ - gtk_widget_queue_resize (GTK_WIDGET (root_tree)); - } -} - -void -gtk_tree_select_child (GtkTree *tree, - GtkWidget *tree_item) -{ - g_return_if_fail (GTK_IS_TREE (tree)); - g_return_if_fail (GTK_IS_TREE_ITEM (tree_item)); - - gtk_signal_emit (GTK_OBJECT (tree), tree_signals[SELECT_CHILD], tree_item); -} - -void -gtk_tree_select_item (GtkTree *tree, - gint item) -{ - GList *tmp_list; - - g_return_if_fail (GTK_IS_TREE (tree)); - - tmp_list = g_list_nth (tree->children, item); - if (tmp_list) - gtk_tree_select_child (tree, GTK_WIDGET (tmp_list->data)); - -} - -static void -gtk_tree_size_allocate (GtkWidget *widget, - GtkAllocation *allocation) -{ - GtkTree *tree; - GtkWidget *child, *subtree; - GtkAllocation child_allocation; - GList *children; - - - g_return_if_fail (GTK_IS_TREE (widget)); - g_return_if_fail (allocation != NULL); - - tree = GTK_TREE (widget); - - widget->allocation = *allocation; - if (gtk_widget_get_realized (widget)) - gdk_window_move_resize (widget->window, - allocation->x, allocation->y, - allocation->width, allocation->height); - - if (tree->children) - { - child_allocation.x = GTK_CONTAINER (tree)->border_width; - child_allocation.y = GTK_CONTAINER (tree)->border_width; - child_allocation.width = MAX (1, (gint)allocation->width - child_allocation.x * 2); - - children = tree->children; - - while (children) - { - child = children->data; - children = children->next; - - if (gtk_widget_get_visible (child)) - { - GtkRequisition child_requisition; - gtk_widget_get_child_requisition (child, &child_requisition); - - child_allocation.height = child_requisition.height; - - gtk_widget_size_allocate (child, &child_allocation); - - child_allocation.y += child_allocation.height; - - if((subtree = GTK_TREE_ITEM(child)->subtree)) - if(gtk_widget_get_visible (subtree)) - { - child_allocation.height = subtree->requisition.height; - gtk_widget_size_allocate (subtree, &child_allocation); - child_allocation.y += child_allocation.height; - } - } - } - } - -} - -static void -gtk_tree_size_request (GtkWidget *widget, - GtkRequisition *requisition) -{ - GtkTree *tree; - GtkWidget *child, *subtree; - GList *children; - GtkRequisition child_requisition; - - - g_return_if_fail (GTK_IS_TREE (widget)); - g_return_if_fail (requisition != NULL); - - tree = GTK_TREE (widget); - requisition->width = 0; - requisition->height = 0; - - children = tree->children; - while (children) - { - child = children->data; - children = children->next; - - if (gtk_widget_get_visible (child)) - { - gtk_widget_size_request (child, &child_requisition); - - requisition->width = MAX (requisition->width, child_requisition.width); - requisition->height += child_requisition.height; - - if((subtree = GTK_TREE_ITEM(child)->subtree) && - gtk_widget_get_visible (subtree)) - { - gtk_widget_size_request (subtree, &child_requisition); - - requisition->width = MAX (requisition->width, - child_requisition.width); - - requisition->height += child_requisition.height; - } - } - } - - requisition->width += GTK_CONTAINER (tree)->border_width * 2; - requisition->height += GTK_CONTAINER (tree)->border_width * 2; - - requisition->width = MAX (requisition->width, 1); - requisition->height = MAX (requisition->height, 1); - -} - -static void -gtk_tree_unmap (GtkWidget *widget) -{ - - g_return_if_fail (GTK_IS_TREE (widget)); - - gtk_widget_set_mapped (widget, FALSE); - gdk_window_hide (widget->window); - -} - -void -gtk_tree_unselect_child (GtkTree *tree, - GtkWidget *tree_item) -{ - g_return_if_fail (GTK_IS_TREE (tree)); - g_return_if_fail (GTK_IS_TREE_ITEM (tree_item)); - - gtk_signal_emit (GTK_OBJECT (tree), tree_signals[UNSELECT_CHILD], tree_item); -} - -void -gtk_tree_unselect_item (GtkTree *tree, - gint item) -{ - GList *tmp_list; - - g_return_if_fail (GTK_IS_TREE (tree)); - - tmp_list = g_list_nth (tree->children, item); - if (tmp_list) - gtk_tree_unselect_child (tree, GTK_WIDGET (tmp_list->data)); - -} - -static void -gtk_real_tree_select_child (GtkTree *tree, - GtkWidget *child) -{ - GList *selection, *root_selection; - GList *tmp_list; - GtkWidget *tmp_item; - - g_return_if_fail (GTK_IS_TREE (tree)); - g_return_if_fail (GTK_IS_TREE_ITEM (child)); - - root_selection = tree->root_tree->selection; - - switch (tree->root_tree->selection_mode) - { - case GTK_SELECTION_SINGLE: - - selection = root_selection; - - /* remove old selection list */ - while (selection) - { - tmp_item = selection->data; - - if (tmp_item != child) - { - gtk_tree_item_deselect (GTK_TREE_ITEM (tmp_item)); - - tmp_list = selection; - selection = selection->next; - - root_selection = g_list_remove_link (root_selection, tmp_list); - g_object_unref (tmp_item); - - g_list_free (tmp_list); - } - else - selection = selection->next; - } - - if (child->state == GTK_STATE_NORMAL) - { - gtk_tree_item_select (GTK_TREE_ITEM (child)); - root_selection = g_list_prepend (root_selection, child); - g_object_ref (child); - } - else if (child->state == GTK_STATE_SELECTED) - { - gtk_tree_item_deselect (GTK_TREE_ITEM (child)); - root_selection = g_list_remove (root_selection, child); - g_object_unref (child); - } - - tree->root_tree->selection = root_selection; - - gtk_signal_emit (GTK_OBJECT (tree->root_tree), - tree_signals[SELECTION_CHANGED]); - break; - - - case GTK_SELECTION_BROWSE: - selection = root_selection; - - while (selection) - { - tmp_item = selection->data; - - if (tmp_item != child) - { - gtk_tree_item_deselect (GTK_TREE_ITEM (tmp_item)); - - tmp_list = selection; - selection = selection->next; - - root_selection = g_list_remove_link (root_selection, tmp_list); - g_object_unref (tmp_item); - - g_list_free (tmp_list); - } - else - selection = selection->next; - } - - tree->root_tree->selection = root_selection; - - if (child->state == GTK_STATE_NORMAL) - { - gtk_tree_item_select (GTK_TREE_ITEM (child)); - root_selection = g_list_prepend (root_selection, child); - g_object_ref (child); - tree->root_tree->selection = root_selection; - gtk_signal_emit (GTK_OBJECT (tree->root_tree), - tree_signals[SELECTION_CHANGED]); - } - break; - - case GTK_SELECTION_MULTIPLE: - break; - } -} - -static void -gtk_real_tree_unselect_child (GtkTree *tree, - GtkWidget *child) -{ - g_return_if_fail (GTK_IS_TREE (tree)); - g_return_if_fail (GTK_IS_TREE_ITEM (child)); - - switch (tree->selection_mode) - { - case GTK_SELECTION_SINGLE: - case GTK_SELECTION_BROWSE: - if (child->state == GTK_STATE_SELECTED) - { - GtkTree* root_tree = GTK_TREE_ROOT_TREE(tree); - gtk_tree_item_deselect (GTK_TREE_ITEM (child)); - root_tree->selection = g_list_remove (root_tree->selection, child); - g_object_unref (child); - gtk_signal_emit (GTK_OBJECT (tree->root_tree), - tree_signals[SELECTION_CHANGED]); - } - break; - - case GTK_SELECTION_MULTIPLE: - break; - } -} - -void -gtk_tree_set_selection_mode (GtkTree *tree, - GtkSelectionMode mode) -{ - g_return_if_fail (GTK_IS_TREE (tree)); - - tree->selection_mode = mode; -} - -void -gtk_tree_set_view_mode (GtkTree *tree, - GtkTreeViewMode mode) -{ - g_return_if_fail (GTK_IS_TREE (tree)); - - tree->view_mode = mode; -} - -void -gtk_tree_set_view_lines (GtkTree *tree, - gboolean flag) -{ - g_return_if_fail (GTK_IS_TREE (tree)); - - tree->view_line = flag; -} - -#define __GTK_TREE_C__ -#include "gtkaliasdef.c" diff --git a/gtk/gtktree.h b/gtk/gtktree.h deleted file mode 100644 index 1d0e1f7343..0000000000 --- a/gtk/gtktree.h +++ /dev/null @@ -1,132 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#ifdef GTK_ENABLE_BROKEN - -#ifndef __GTK_TREE_H__ -#define __GTK_TREE_H__ - - -#include - - -G_BEGIN_DECLS - -/* set this flag to enable tree debugging output */ -/* #define TREE_DEBUG */ - -#define GTK_TYPE_TREE (gtk_tree_get_type ()) -#define GTK_TREE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TREE, GtkTree)) -#define GTK_TREE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TREE, GtkTreeClass)) -#define GTK_IS_TREE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TREE)) -#define GTK_IS_TREE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TREE)) -#define GTK_TREE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TREE, GtkTreeClass)) - - -#define GTK_IS_ROOT_TREE(obj) ((GtkObject*) GTK_TREE(obj)->root_tree == (GtkObject*)obj) -#define GTK_TREE_ROOT_TREE(obj) (GTK_TREE(obj)->root_tree ? GTK_TREE(obj)->root_tree : GTK_TREE(obj)) -#define GTK_TREE_SELECTION_OLD(obj) (GTK_TREE_ROOT_TREE(obj)->selection) - -typedef enum -{ - GTK_TREE_VIEW_LINE, /* default view mode */ - GTK_TREE_VIEW_ITEM -} GtkTreeViewMode; - -typedef struct _GtkTree GtkTree; -typedef struct _GtkTreeClass GtkTreeClass; - -struct _GtkTree -{ - GtkContainer container; - - GList *children; - - GtkTree* root_tree; /* owner of selection list */ - GtkWidget* tree_owner; - GList *selection; - guint level; - guint indent_value; - guint current_indent; - guint selection_mode : 2; - guint view_mode : 1; - guint view_line : 1; -}; - -struct _GtkTreeClass -{ - GtkContainerClass parent_class; - - void (* selection_changed) (GtkTree *tree); - void (* select_child) (GtkTree *tree, - GtkWidget *child); - void (* unselect_child) (GtkTree *tree, - GtkWidget *child); -}; - - -GType gtk_tree_get_type (void) G_GNUC_CONST; -GtkWidget* gtk_tree_new (void); -void gtk_tree_append (GtkTree *tree, - GtkWidget *tree_item); -void gtk_tree_prepend (GtkTree *tree, - GtkWidget *tree_item); -void gtk_tree_insert (GtkTree *tree, - GtkWidget *tree_item, - gint position); -void gtk_tree_remove_items (GtkTree *tree, - GList *items); -void gtk_tree_clear_items (GtkTree *tree, - gint start, - gint end); -void gtk_tree_select_item (GtkTree *tree, - gint item); -void gtk_tree_unselect_item (GtkTree *tree, - gint item); -void gtk_tree_select_child (GtkTree *tree, - GtkWidget *tree_item); -void gtk_tree_unselect_child (GtkTree *tree, - GtkWidget *tree_item); -gint gtk_tree_child_position (GtkTree *tree, - GtkWidget *child); -void gtk_tree_set_selection_mode (GtkTree *tree, - GtkSelectionMode mode); -void gtk_tree_set_view_mode (GtkTree *tree, - GtkTreeViewMode mode); -void gtk_tree_set_view_lines (GtkTree *tree, - gboolean flag); - -/* deprecated function, use gtk_container_remove instead. - */ -void gtk_tree_remove_item (GtkTree *tree, - GtkWidget *child); - - -G_END_DECLS - -#endif /* __GTK_TREE_H__ */ - -#endif /* GTK_ENABLE_BROKEN */ diff --git a/gtk/gtktreednd.c b/gtk/gtktreednd.c index 7e079457e9..9a1c87fbea 100644 --- a/gtk/gtktreednd.c +++ b/gtk/gtktreednd.c @@ -23,6 +23,30 @@ #include "gtkintl.h" #include "gtkalias.h" + +/** + * SECTION:gtktreednd + * @Short_description: Interfaces for drag-and-drop support in GtkTreeView + * @Title: GtkTreeView drag-and-drop + * + * GTK+ supports Drag-and-Drop in tree views with a high-level and a low-level + * API. + * + * The low-level API consists of the GTK+ DND API, augmented by some treeview + * utility functions: gtk_tree_view_set_drag_dest_row(), + * gtk_tree_view_get_drag_dest_row(), gtk_tree_view_get_dest_row_at_pos(), + * gtk_tree_view_create_row_drag_icon(), gtk_tree_set_row_drag_data() and + * gtk_tree_get_row_drag_data(). This API leaves a lot of flexibility, but + * nothing is done automatically, and implementing advanced features like + * hover-to-open-rows or autoscrolling on top of this API is a lot of work. + * + * On the other hand, if you write to the high-level API, then all the + * bookkeeping of rows is done for you, as well as things like hover-to-open + * and auto-scroll, but your models have to implement the + * #GtkTreeDragSource and #GtkTreeDragDest interfaces. + */ + + GType gtk_tree_drag_source_get_type (void) { diff --git a/gtk/gtktreednd.h b/gtk/gtktreednd.h index 517ba50d2a..e0de421f90 100644 --- a/gtk/gtktreednd.h +++ b/gtk/gtktreednd.h @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtktreeitem.c b/gtk/gtktreeitem.c deleted file mode 100644 index a6ca505ffe..0000000000 --- a/gtk/gtktreeitem.c +++ /dev/null @@ -1,1000 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#undef GTK_DISABLE_DEPRECATED - -#include "config.h" - -#include "gtklabel.h" -#include "gtkeventbox.h" -#include "gtkpixmap.h" -#include "gtkmain.h" -#include "gtkmarshalers.h" -#include "gtksignal.h" -#define GTK_ENABLE_BROKEN -#include "gtktree.h" -#include "gtktreeitem.h" -#include "gtkintl.h" - -#include "gtkalias.h" - -#include "tree_plus.xpm" -#include "tree_minus.xpm" - -#define DEFAULT_DELTA 9 - -enum { - COLLAPSE_TREE, - EXPAND_TREE, - LAST_SIGNAL -}; - -typedef struct _GtkTreePixmaps GtkTreePixmaps; - -struct _GtkTreePixmaps { - gint refcount; - GdkColormap *colormap; - - GdkPixmap *pixmap_plus; - GdkPixmap *pixmap_minus; - GdkBitmap *mask_plus; - GdkBitmap *mask_minus; -}; - -static GList *pixmaps = NULL; - -static void gtk_tree_item_class_init (GtkTreeItemClass *klass); -static void gtk_tree_item_init (GtkTreeItem *tree_item); -static void gtk_tree_item_realize (GtkWidget *widget); -static void gtk_tree_item_size_request (GtkWidget *widget, - GtkRequisition *requisition); -static void gtk_tree_item_size_allocate (GtkWidget *widget, - GtkAllocation *allocation); -static void gtk_tree_item_paint (GtkWidget *widget, - GdkRectangle *area); -static gint gtk_tree_item_button_press (GtkWidget *widget, - GdkEventButton *event); -static gint gtk_tree_item_expose (GtkWidget *widget, - GdkEventExpose *event); -static void gtk_tree_item_forall (GtkContainer *container, - gboolean include_internals, - GtkCallback callback, - gpointer callback_data); - -static void gtk_real_tree_item_select (GtkItem *item); -static void gtk_real_tree_item_deselect (GtkItem *item); -static void gtk_real_tree_item_toggle (GtkItem *item); -static void gtk_real_tree_item_expand (GtkTreeItem *item); -static void gtk_real_tree_item_collapse (GtkTreeItem *item); -static void gtk_tree_item_destroy (GtkObject *object); -static gint gtk_tree_item_subtree_button_click (GtkWidget *widget); -static void gtk_tree_item_subtree_button_changed_state (GtkWidget *widget); - -static void gtk_tree_item_map(GtkWidget*); -static void gtk_tree_item_unmap(GtkWidget*); - -static void gtk_tree_item_add_pixmaps (GtkTreeItem *tree_item); -static void gtk_tree_item_remove_pixmaps (GtkTreeItem *tree_item); - -static GtkItemClass *parent_class = NULL; -static guint tree_item_signals[LAST_SIGNAL] = { 0 }; - -GtkType -gtk_tree_item_get_type (void) -{ - static GtkType tree_item_type = 0; - - if (!tree_item_type) - { - static const GtkTypeInfo tree_item_info = - { - "GtkTreeItem", - sizeof (GtkTreeItem), - sizeof (GtkTreeItemClass), - (GtkClassInitFunc) gtk_tree_item_class_init, - (GtkObjectInitFunc) gtk_tree_item_init, - /* reserved_1 */ NULL, - /* reserved_2 */ NULL, - (GtkClassInitFunc) NULL, - }; - - I_("GtkTreeItem"); - tree_item_type = gtk_type_unique (gtk_item_get_type (), &tree_item_info); - } - - return tree_item_type; -} - -static void -gtk_tree_item_class_init (GtkTreeItemClass *class) -{ - GtkObjectClass *object_class; - GtkWidgetClass *widget_class; - GtkContainerClass *container_class; - GtkItemClass *item_class; - - parent_class = gtk_type_class (GTK_TYPE_ITEM); - - object_class = (GtkObjectClass*) class; - widget_class = (GtkWidgetClass*) class; - item_class = (GtkItemClass*) class; - container_class = (GtkContainerClass*) class; - - object_class->destroy = gtk_tree_item_destroy; - - widget_class->realize = gtk_tree_item_realize; - widget_class->size_request = gtk_tree_item_size_request; - widget_class->size_allocate = gtk_tree_item_size_allocate; - widget_class->button_press_event = gtk_tree_item_button_press; - widget_class->expose_event = gtk_tree_item_expose; - widget_class->map = gtk_tree_item_map; - widget_class->unmap = gtk_tree_item_unmap; - - container_class->forall = gtk_tree_item_forall; - - item_class->select = gtk_real_tree_item_select; - item_class->deselect = gtk_real_tree_item_deselect; - item_class->toggle = gtk_real_tree_item_toggle; - - class->expand = gtk_real_tree_item_expand; - class->collapse = gtk_real_tree_item_collapse; - - tree_item_signals[EXPAND_TREE] = - gtk_signal_new (I_("expand"), - GTK_RUN_FIRST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkTreeItemClass, expand), - _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); - tree_item_signals[COLLAPSE_TREE] = - gtk_signal_new (I_("collapse"), - GTK_RUN_FIRST, - GTK_CLASS_TYPE (object_class), - GTK_SIGNAL_OFFSET (GtkTreeItemClass, collapse), - _gtk_marshal_VOID__VOID, - GTK_TYPE_NONE, 0); -} - -/* callback for event box mouse event */ -static gint -gtk_tree_item_subtree_button_click (GtkWidget *widget) -{ - GtkTreeItem* item; - - g_return_val_if_fail (GTK_IS_EVENT_BOX (widget), FALSE); - - item = (GtkTreeItem*) gtk_object_get_user_data (GTK_OBJECT (widget)); - if (!gtk_widget_is_sensitive (GTK_WIDGET (item))) - return FALSE; - - if (item->expanded) - gtk_tree_item_collapse (item); - else - gtk_tree_item_expand (item); - - return TRUE; -} - -/* callback for event box state changed */ -static void -gtk_tree_item_subtree_button_changed_state (GtkWidget *widget) -{ - g_return_if_fail (GTK_IS_EVENT_BOX (widget)); - - if (gtk_widget_get_visible (widget)) - { - - if (widget->state == GTK_STATE_NORMAL) - gdk_window_set_background (widget->window, &widget->style->base[widget->state]); - else - gdk_window_set_background (widget->window, &widget->style->bg[widget->state]); - - if (gtk_widget_is_drawable (widget)) - gdk_window_clear_area (widget->window, 0, 0, - widget->allocation.width, widget->allocation.height); - } -} - -static void -gtk_tree_item_init (GtkTreeItem *tree_item) -{ - GtkWidget *eventbox, *pixmapwid; - - tree_item->expanded = FALSE; - tree_item->subtree = NULL; - gtk_widget_set_can_focus (GTK_WIDGET (tree_item), TRUE); - - /* create an event box containing one pixmaps */ - eventbox = gtk_event_box_new(); - gtk_widget_set_events (eventbox, GDK_BUTTON_PRESS_MASK); - gtk_signal_connect(GTK_OBJECT(eventbox), "state-changed", - G_CALLBACK (gtk_tree_item_subtree_button_changed_state), - (gpointer)NULL); - gtk_signal_connect(GTK_OBJECT(eventbox), "realize", - G_CALLBACK (gtk_tree_item_subtree_button_changed_state), - (gpointer)NULL); - gtk_signal_connect(GTK_OBJECT(eventbox), "button-press-event", - G_CALLBACK (gtk_tree_item_subtree_button_click), - (gpointer)NULL); - gtk_object_set_user_data(GTK_OBJECT(eventbox), tree_item); - tree_item->pixmaps_box = eventbox; - - /* create pixmap for button '+' */ - pixmapwid = gtk_type_new (gtk_pixmap_get_type ()); - if (!tree_item->expanded) - gtk_container_add (GTK_CONTAINER (eventbox), pixmapwid); - gtk_widget_show (pixmapwid); - tree_item->plus_pix_widget = pixmapwid; - g_object_ref_sink (tree_item->plus_pix_widget); - - /* create pixmap for button '-' */ - pixmapwid = gtk_type_new (gtk_pixmap_get_type ()); - if (tree_item->expanded) - gtk_container_add (GTK_CONTAINER (eventbox), pixmapwid); - gtk_widget_show (pixmapwid); - tree_item->minus_pix_widget = pixmapwid; - g_object_ref_sink (tree_item->minus_pix_widget); - - gtk_widget_set_parent (eventbox, GTK_WIDGET (tree_item)); -} - - -GtkWidget* -gtk_tree_item_new (void) -{ - GtkWidget *tree_item; - - tree_item = GTK_WIDGET (gtk_type_new (gtk_tree_item_get_type ())); - - return tree_item; -} - -GtkWidget* -gtk_tree_item_new_with_label (const gchar *label) -{ - GtkWidget *tree_item; - GtkWidget *label_widget; - - tree_item = gtk_tree_item_new (); - label_widget = gtk_label_new (label); - gtk_misc_set_alignment (GTK_MISC (label_widget), 0.0, 0.5); - - gtk_container_add (GTK_CONTAINER (tree_item), label_widget); - gtk_widget_show (label_widget); - - - return tree_item; -} - -void -gtk_tree_item_set_subtree (GtkTreeItem *tree_item, - GtkWidget *subtree) -{ - g_return_if_fail (GTK_IS_TREE_ITEM (tree_item)); - g_return_if_fail (GTK_IS_TREE (subtree)); - - if (tree_item->subtree) - { - g_warning("there is already a subtree for this tree item\n"); - return; - } - - tree_item->subtree = subtree; - GTK_TREE (subtree)->tree_owner = GTK_WIDGET (tree_item); - - /* show subtree button */ - if (tree_item->pixmaps_box) - gtk_widget_show (tree_item->pixmaps_box); - - if (tree_item->expanded) - gtk_widget_show (subtree); - else - gtk_widget_hide (subtree); - - gtk_widget_set_parent (subtree, GTK_WIDGET (tree_item)->parent); -} - -void -gtk_tree_item_select (GtkTreeItem *tree_item) -{ - g_return_if_fail (GTK_IS_TREE_ITEM (tree_item)); - - gtk_item_select (GTK_ITEM (tree_item)); -} - -void -gtk_tree_item_deselect (GtkTreeItem *tree_item) -{ - g_return_if_fail (GTK_IS_TREE_ITEM (tree_item)); - - gtk_item_deselect (GTK_ITEM (tree_item)); -} - -void -gtk_tree_item_expand (GtkTreeItem *tree_item) -{ - g_return_if_fail (GTK_IS_TREE_ITEM (tree_item)); - - gtk_signal_emit (GTK_OBJECT (tree_item), tree_item_signals[EXPAND_TREE], NULL); -} - -void -gtk_tree_item_collapse (GtkTreeItem *tree_item) -{ - g_return_if_fail (GTK_IS_TREE_ITEM (tree_item)); - - gtk_signal_emit (GTK_OBJECT (tree_item), tree_item_signals[COLLAPSE_TREE], NULL); -} - -static void -gtk_tree_item_add_pixmaps (GtkTreeItem *tree_item) -{ - GList *tmp_list; - GdkColormap *colormap; - GtkTreePixmaps *pixmap_node = NULL; - - g_return_if_fail (GTK_IS_TREE_ITEM (tree_item)); - - if (tree_item->pixmaps) - return; - - colormap = gtk_widget_get_colormap (GTK_WIDGET (tree_item)); - - tmp_list = pixmaps; - while (tmp_list) - { - pixmap_node = (GtkTreePixmaps *)tmp_list->data; - - if (pixmap_node->colormap == colormap) - break; - - tmp_list = tmp_list->next; - } - - if (tmp_list) - { - pixmap_node->refcount++; - tree_item->pixmaps = tmp_list; - } - else - { - pixmap_node = g_new (GtkTreePixmaps, 1); - - pixmap_node->colormap = colormap; - g_object_ref (colormap); - - pixmap_node->refcount = 1; - - /* create pixmaps for plus icon */ - pixmap_node->pixmap_plus = - gdk_pixmap_create_from_xpm_d (GTK_WIDGET (tree_item)->window, - &pixmap_node->mask_plus, - NULL, - (gchar **)tree_plus); - - /* create pixmaps for minus icon */ - pixmap_node->pixmap_minus = - gdk_pixmap_create_from_xpm_d (GTK_WIDGET (tree_item)->window, - &pixmap_node->mask_minus, - NULL, - (gchar **)tree_minus); - - tree_item->pixmaps = pixmaps = g_list_prepend (pixmaps, pixmap_node); - } - - gtk_pixmap_set (GTK_PIXMAP (tree_item->plus_pix_widget), - pixmap_node->pixmap_plus, pixmap_node->mask_plus); - gtk_pixmap_set (GTK_PIXMAP (tree_item->minus_pix_widget), - pixmap_node->pixmap_minus, pixmap_node->mask_minus); -} - -static void -gtk_tree_item_remove_pixmaps (GtkTreeItem *tree_item) -{ - g_return_if_fail (GTK_IS_TREE_ITEM (tree_item)); - - if (tree_item->pixmaps) - { - GtkTreePixmaps *pixmap_node = (GtkTreePixmaps *)tree_item->pixmaps->data; - - g_assert (pixmap_node->refcount > 0); - - if (--pixmap_node->refcount == 0) - { - g_object_unref (pixmap_node->colormap); - g_object_unref (pixmap_node->pixmap_plus); - g_object_unref (pixmap_node->mask_plus); - g_object_unref (pixmap_node->pixmap_minus); - g_object_unref (pixmap_node->mask_minus); - - pixmaps = g_list_remove_link (pixmaps, tree_item->pixmaps); - g_list_free_1 (tree_item->pixmaps); - g_free (pixmap_node); - } - - tree_item->pixmaps = NULL; - } -} - -static void -gtk_tree_item_realize (GtkWidget *widget) -{ - GTK_WIDGET_CLASS (parent_class)->realize (widget); - - gdk_window_set_background (widget->window, - &widget->style->base[GTK_STATE_NORMAL]); - - gtk_tree_item_add_pixmaps (GTK_TREE_ITEM (widget)); -} - -static void -gtk_tree_item_size_request (GtkWidget *widget, - GtkRequisition *requisition) -{ - GtkBin *bin = GTK_BIN (widget); - GtkTreeItem *item = GTK_TREE_ITEM (widget); - GtkRequisition child_requisition; - - requisition->width = (GTK_CONTAINER (widget)->border_width + - widget->style->xthickness) * 2; - requisition->height = GTK_CONTAINER (widget)->border_width * 2; - - if (bin->child && gtk_widget_get_visible (bin->child)) - { - GtkRequisition pix_requisition; - - gtk_widget_size_request (bin->child, &child_requisition); - - requisition->width += child_requisition.width; - - gtk_widget_size_request (item->pixmaps_box, - &pix_requisition); - requisition->width += pix_requisition.width + DEFAULT_DELTA + - GTK_TREE (widget->parent)->current_indent; - - requisition->height += MAX (child_requisition.height, - pix_requisition.height); - } -} - -static void -gtk_tree_item_size_allocate (GtkWidget *widget, - GtkAllocation *allocation) -{ - GtkBin *bin = GTK_BIN (widget); - GtkTreeItem *item = GTK_TREE_ITEM (widget); - GtkAllocation child_allocation; - gint border_width; - int temp; - - widget->allocation = *allocation; - if (gtk_widget_get_realized (widget)) - gdk_window_move_resize (widget->window, - allocation->x, allocation->y, - allocation->width, allocation->height); - - if (bin->child) - { - border_width = (GTK_CONTAINER (widget)->border_width + - widget->style->xthickness); - - child_allocation.x = border_width + GTK_TREE(widget->parent)->current_indent; - child_allocation.y = GTK_CONTAINER (widget)->border_width; - - child_allocation.width = item->pixmaps_box->requisition.width; - child_allocation.height = item->pixmaps_box->requisition.height; - - temp = allocation->height - child_allocation.height; - child_allocation.y += ( temp / 2 ) + ( temp % 2 ); - - gtk_widget_size_allocate (item->pixmaps_box, &child_allocation); - - child_allocation.y = GTK_CONTAINER (widget)->border_width; - child_allocation.height = MAX (1, (gint)allocation->height - child_allocation.y * 2); - child_allocation.x += item->pixmaps_box->requisition.width+DEFAULT_DELTA; - - child_allocation.width = - MAX (1, (gint)allocation->width - ((gint)child_allocation.x + border_width)); - - gtk_widget_size_allocate (bin->child, &child_allocation); - } -} - -static void -gtk_tree_item_draw_lines (GtkWidget *widget) -{ - GtkTreeItem* item; - GtkTree* tree; - guint lx1, ly1, lx2, ly2; - GdkGC* gc; - - g_return_if_fail (GTK_IS_TREE_ITEM (widget)); - - item = GTK_TREE_ITEM(widget); - tree = GTK_TREE(widget->parent); - - if (!tree->view_line) - return; - - gc = widget->style->text_gc[GTK_STATE_NORMAL]; - - /* draw vertical line */ - lx1 = item->pixmaps_box->allocation.width; - lx1 = lx2 = ((lx1 / 2) + (lx1 % 2) + - GTK_CONTAINER (widget)->border_width + 1 + tree->current_indent); - ly1 = 0; - ly2 = widget->allocation.height; - - if (g_list_last (tree->children)->data == widget) - ly2 = (ly2 / 2) + (ly2 % 2); - - if (tree != tree->root_tree) - gdk_draw_line (widget->window, gc, lx1, ly1, lx2, ly2); - - /* draw vertical line for subtree connecting */ - if(g_list_last(tree->children)->data != (gpointer)widget) - ly2 = (ly2 / 2) + (ly2 % 2); - - lx2 += DEFAULT_DELTA; - - if (item->subtree && item->expanded) - gdk_draw_line (widget->window, gc, - lx2, ly2, lx2, widget->allocation.height); - - /* draw horizontal line */ - ly1 = ly2; - lx2 += 2; - - gdk_draw_line (widget->window, gc, lx1, ly1, lx2, ly2); - - lx2 -= DEFAULT_DELTA+2; - ly1 = 0; - ly2 = widget->allocation.height; - - if (tree != tree->root_tree) - { - item = GTK_TREE_ITEM (tree->tree_owner); - tree = GTK_TREE (GTK_WIDGET (tree)->parent); - while (tree != tree->root_tree) - { - lx1 = lx2 -= tree->indent_value; - - if (g_list_last (tree->children)->data != item) - gdk_draw_line (widget->window, gc, lx1, ly1, lx2, ly2); - item = GTK_TREE_ITEM (tree->tree_owner); - tree = GTK_TREE (GTK_WIDGET (tree)->parent); - } - } -} - -static void -gtk_tree_item_paint (GtkWidget *widget, - GdkRectangle *area) -{ - GdkRectangle child_area, item_area; - GtkTreeItem* tree_item; - - /* FIXME: We should honor tree->view_mode, here - I think - * the desired effect is that when the mode is VIEW_ITEM, - * only the subitem is drawn as selected, not the entire - * line. (Like the way that the tree in Windows Explorer - * works). - */ - if (gtk_widget_is_drawable (widget)) - { - tree_item = GTK_TREE_ITEM(widget); - - if (widget->state == GTK_STATE_NORMAL) - { - gdk_window_set_back_pixmap (widget->window, NULL, TRUE); - gdk_window_clear_area (widget->window, area->x, area->y, area->width, area->height); - } - else - { - if (!gtk_widget_is_sensitive (widget)) - gtk_paint_flat_box(widget->style, widget->window, - widget->state, GTK_SHADOW_NONE, - area, widget, "treeitem", - 0, 0, -1, -1); - else - gtk_paint_flat_box(widget->style, widget->window, - widget->state, GTK_SHADOW_ETCHED_OUT, - area, widget, "treeitem", - 0, 0, -1, -1); - } - - /* draw left size of tree item */ - item_area.x = 0; - item_area.y = 0; - item_area.width = (tree_item->pixmaps_box->allocation.width + DEFAULT_DELTA + - GTK_TREE (widget->parent)->current_indent + 2); - item_area.height = widget->allocation.height; - - - if (gdk_rectangle_intersect(&item_area, area, &child_area)) - { - - gtk_tree_item_draw_lines(widget); - - if (tree_item->pixmaps_box && - gtk_widget_get_visible(tree_item->pixmaps_box) && - gtk_widget_intersect (tree_item->pixmaps_box, area, &child_area)) - { - gtk_widget_queue_draw_area (tree_item->pixmaps_box, - child_area.x, child_area.y, - child_area.width, child_area.height); - gdk_window_process_updates (tree_item->pixmaps_box->window, TRUE); - } - } - - if (gtk_widget_has_focus (widget)) - gtk_paint_focus (widget->style, widget->window, gtk_widget_get_state (widget), - NULL, widget, "treeitem", - 0, 0, - widget->allocation.width, - widget->allocation.height); - - } -} - -static gint -gtk_tree_item_button_press (GtkWidget *widget, - GdkEventButton *event) -{ - if (event->type == GDK_BUTTON_PRESS - && gtk_widget_is_sensitive(widget) - && !gtk_widget_has_focus (widget)) - gtk_widget_grab_focus (widget); - - return (event->type == GDK_BUTTON_PRESS && gtk_widget_is_sensitive(widget)); -} - -static void -gtk_tree_item_expose_child (GtkWidget *child, - gpointer client_data) -{ - struct { - GtkWidget *container; - GdkEventExpose *event; - } *data = client_data; - - if (gtk_widget_is_drawable (child) && - !gtk_widget_get_has_window (child) && - (child->window == data->event->window)) - { - GdkEvent *child_event = gdk_event_new (GDK_EXPOSE); - child_event->expose = *data->event; - g_object_ref (child_event->expose.window); - - child_event->expose.region = gtk_widget_region_intersect (child, - data->event->region); - if (!gdk_region_empty (child_event->expose.region)) - { - gdk_region_get_clipbox (child_event->expose.region, &child_event->expose.area); - gtk_widget_send_expose (child, child_event); - } - gdk_event_free (child_event); - } -} - -static gint -gtk_tree_item_expose (GtkWidget *widget, - GdkEventExpose *event) -{ - struct { - GtkWidget *container; - GdkEventExpose *event; - } data; - - if (gtk_widget_is_drawable (widget)) - { - gtk_tree_item_paint (widget, &event->area); - - data.container = widget; - data.event = event; - - gtk_container_forall (GTK_CONTAINER (widget), - gtk_tree_item_expose_child, - &data); - } - - return FALSE; -} - -static void -gtk_real_tree_item_select (GtkItem *item) -{ - GtkWidget *widget; - - g_return_if_fail (GTK_IS_TREE_ITEM (item)); - - widget = GTK_WIDGET (item); - - gtk_widget_set_state (GTK_WIDGET (item), GTK_STATE_SELECTED); - - if (!widget->parent || GTK_TREE (widget->parent)->view_mode == GTK_TREE_VIEW_LINE) - gtk_widget_set_state (GTK_TREE_ITEM (item)->pixmaps_box, GTK_STATE_SELECTED); -} - -static void -gtk_real_tree_item_deselect (GtkItem *item) -{ - GtkTreeItem *tree_item; - GtkWidget *widget; - - g_return_if_fail (GTK_IS_TREE_ITEM (item)); - - tree_item = GTK_TREE_ITEM (item); - widget = GTK_WIDGET (item); - - gtk_widget_set_state (widget, GTK_STATE_NORMAL); - - if (!widget->parent || GTK_TREE (widget->parent)->view_mode == GTK_TREE_VIEW_LINE) - gtk_widget_set_state (tree_item->pixmaps_box, GTK_STATE_NORMAL); -} - -static void -gtk_real_tree_item_toggle (GtkItem *item) -{ - g_return_if_fail (GTK_IS_TREE_ITEM (item)); - - if(!gtk_widget_is_sensitive(GTK_WIDGET (item))) - return; - - if (GTK_IS_TREE (GTK_WIDGET (item)->parent)) - gtk_tree_select_child (GTK_TREE (GTK_WIDGET (item)->parent), - GTK_WIDGET (item)); - else - { - /* Should we really bother with this bit? A listitem not in a list? - * -Johannes Keukelaar - * yes, always be on the safe side! - * -timj - */ - if (GTK_WIDGET (item)->state == GTK_STATE_SELECTED) - gtk_widget_set_state (GTK_WIDGET (item), GTK_STATE_NORMAL); - else - gtk_widget_set_state (GTK_WIDGET (item), GTK_STATE_SELECTED); - } -} - -static void -gtk_real_tree_item_expand (GtkTreeItem *tree_item) -{ - GtkTree* tree; - - g_return_if_fail (GTK_IS_TREE_ITEM (tree_item)); - - if (tree_item->subtree && !tree_item->expanded) - { - tree = GTK_TREE (GTK_WIDGET (tree_item)->parent); - - /* hide subtree widget */ - gtk_widget_show (tree_item->subtree); - - /* hide button '+' and show button '-' */ - if (tree_item->pixmaps_box) - { - gtk_container_remove (GTK_CONTAINER (tree_item->pixmaps_box), - tree_item->plus_pix_widget); - gtk_container_add (GTK_CONTAINER (tree_item->pixmaps_box), - tree_item->minus_pix_widget); - } - if (tree->root_tree) - gtk_widget_queue_resize (GTK_WIDGET (tree->root_tree)); - tree_item->expanded = TRUE; - } -} - -static void -gtk_real_tree_item_collapse (GtkTreeItem *tree_item) -{ - GtkTree* tree; - - g_return_if_fail (GTK_IS_TREE_ITEM (tree_item)); - - if (tree_item->subtree && tree_item->expanded) - { - tree = GTK_TREE (GTK_WIDGET (tree_item)->parent); - - /* hide subtree widget */ - gtk_widget_hide (tree_item->subtree); - - /* hide button '-' and show button '+' */ - if (tree_item->pixmaps_box) - { - gtk_container_remove (GTK_CONTAINER (tree_item->pixmaps_box), - tree_item->minus_pix_widget); - gtk_container_add (GTK_CONTAINER (tree_item->pixmaps_box), - tree_item->plus_pix_widget); - } - if (tree->root_tree) - gtk_widget_queue_resize (GTK_WIDGET (tree->root_tree)); - tree_item->expanded = FALSE; - } -} - -static void -gtk_tree_item_destroy (GtkObject *object) -{ - GtkTreeItem* item = GTK_TREE_ITEM(object); - GtkWidget* child; - -#ifdef TREE_DEBUG - g_message("+ gtk_tree_item_destroy [object %#x]\n", (int)object); -#endif /* TREE_DEBUG */ - - /* free sub tree if it exist */ - child = item->subtree; - if (child) - { - g_object_ref (child); - gtk_widget_unparent (child); - gtk_widget_destroy (child); - g_object_unref (child); - item->subtree = NULL; - } - - /* free pixmaps box */ - child = item->pixmaps_box; - if (child) - { - g_object_ref (child); - gtk_widget_unparent (child); - gtk_widget_destroy (child); - g_object_unref (child); - item->pixmaps_box = NULL; - } - - - /* destroy plus pixmap */ - if (item->plus_pix_widget) - { - gtk_widget_destroy (item->plus_pix_widget); - g_object_unref (item->plus_pix_widget); - item->plus_pix_widget = NULL; - } - - /* destroy minus pixmap */ - if (item->minus_pix_widget) - { - gtk_widget_destroy (item->minus_pix_widget); - g_object_unref (item->minus_pix_widget); - item->minus_pix_widget = NULL; - } - - /* By removing the pixmaps here, and not in unrealize, we depend on - * the fact that a widget can never change colormap or visual. - */ - gtk_tree_item_remove_pixmaps (item); - - GTK_OBJECT_CLASS (parent_class)->destroy (object); - -#ifdef TREE_DEBUG - g_message("- gtk_tree_item_destroy\n"); -#endif /* TREE_DEBUG */ -} - -void -gtk_tree_item_remove_subtree (GtkTreeItem* item) -{ - g_return_if_fail (GTK_IS_TREE_ITEM(item)); - g_return_if_fail (item->subtree != NULL); - - if (GTK_TREE (item->subtree)->children) - { - /* The following call will remove the children and call - * gtk_tree_item_remove_subtree() again. So we are done. - */ - gtk_tree_remove_items (GTK_TREE (item->subtree), - GTK_TREE (item->subtree)->children); - return; - } - - if (gtk_widget_get_mapped (item->subtree)) - gtk_widget_unmap (item->subtree); - - gtk_widget_unparent (item->subtree); - - if (item->pixmaps_box) - gtk_widget_hide (item->pixmaps_box); - - item->subtree = NULL; - - if (item->expanded) - { - item->expanded = FALSE; - if (item->pixmaps_box) - { - gtk_container_remove (GTK_CONTAINER (item->pixmaps_box), - item->minus_pix_widget); - gtk_container_add (GTK_CONTAINER (item->pixmaps_box), - item->plus_pix_widget); - } - } -} - -static void -gtk_tree_item_map (GtkWidget *widget) -{ - GtkBin *bin = GTK_BIN (widget); - GtkTreeItem* item = GTK_TREE_ITEM(widget); - - gtk_widget_set_mapped (widget, TRUE); - - if(item->pixmaps_box && - gtk_widget_get_visible (item->pixmaps_box) && - !gtk_widget_get_mapped (item->pixmaps_box)) - gtk_widget_map (item->pixmaps_box); - - if (bin->child && - gtk_widget_get_visible (bin->child) && - !gtk_widget_get_mapped (bin->child)) - gtk_widget_map (bin->child); - - gdk_window_show (widget->window); -} - -static void -gtk_tree_item_unmap (GtkWidget *widget) -{ - GtkBin *bin = GTK_BIN (widget); - GtkTreeItem* item = GTK_TREE_ITEM(widget); - - gtk_widget_set_mapped (widget, FALSE); - - gdk_window_hide (widget->window); - - if(item->pixmaps_box && - gtk_widget_get_visible (item->pixmaps_box) && - gtk_widget_get_mapped (item->pixmaps_box)) - gtk_widget_unmap (bin->child); - - if (bin->child && - gtk_widget_get_visible (bin->child) && - gtk_widget_get_mapped (bin->child)) - gtk_widget_unmap (bin->child); -} - -static void -gtk_tree_item_forall (GtkContainer *container, - gboolean include_internals, - GtkCallback callback, - gpointer callback_data) -{ - GtkBin *bin = GTK_BIN (container); - GtkTreeItem *tree_item = GTK_TREE_ITEM (container); - - if (bin->child) - (* callback) (bin->child, callback_data); - if (include_internals && tree_item->subtree) - (* callback) (tree_item->subtree, callback_data); - if (include_internals && tree_item->pixmaps_box) - (* callback) (tree_item->pixmaps_box, callback_data); -} - -#define __GTK_TREE_ITEM_C__ -#include "gtkaliasdef.c" diff --git a/gtk/gtktreeitem.h b/gtk/gtktreeitem.h deleted file mode 100644 index 0e8dbaf1dd..0000000000 --- a/gtk/gtktreeitem.h +++ /dev/null @@ -1,90 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#ifdef GTK_ENABLE_BROKEN - -#ifndef __GTK_TREE_ITEM_H__ -#define __GTK_TREE_ITEM_H__ - - -#include - - -G_BEGIN_DECLS - -#define GTK_TYPE_TREE_ITEM (gtk_tree_item_get_type ()) -#define GTK_TREE_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TREE_ITEM, GtkTreeItem)) -#define GTK_TREE_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TREE_ITEM, GtkTreeItemClass)) -#define GTK_IS_TREE_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TREE_ITEM)) -#define GTK_IS_TREE_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TREE_ITEM)) -#define GTK_TREE_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TREE_ITEM, GtkTreeItemClass)) - - -#define GTK_TREE_ITEM_SUBTREE(obj) (GTK_TREE_ITEM(obj)->subtree) - - -typedef struct _GtkTreeItem GtkTreeItem; -typedef struct _GtkTreeItemClass GtkTreeItemClass; - -struct _GtkTreeItem -{ - GtkItem item; - - GtkWidget *subtree; - GtkWidget *pixmaps_box; - GtkWidget *plus_pix_widget, *minus_pix_widget; - - GList *pixmaps; /* pixmap node for this items color depth */ - - guint expanded : 1; -}; - -struct _GtkTreeItemClass -{ - GtkItemClass parent_class; - - void (* expand) (GtkTreeItem *tree_item); - void (* collapse) (GtkTreeItem *tree_item); -}; - - -GType gtk_tree_item_get_type (void) G_GNUC_CONST; -GtkWidget* gtk_tree_item_new (void); -GtkWidget* gtk_tree_item_new_with_label (const gchar *label); -void gtk_tree_item_set_subtree (GtkTreeItem *tree_item, - GtkWidget *subtree); -void gtk_tree_item_remove_subtree (GtkTreeItem *tree_item); -void gtk_tree_item_select (GtkTreeItem *tree_item); -void gtk_tree_item_deselect (GtkTreeItem *tree_item); -void gtk_tree_item_expand (GtkTreeItem *tree_item); -void gtk_tree_item_collapse (GtkTreeItem *tree_item); - - -G_END_DECLS - -#endif /* __GTK_TREE_ITEM_H__ */ - -#endif /* GTK_ENABLE_BROKEN */ diff --git a/gtk/gtktreemodel.c b/gtk/gtktreemodel.c index 5bdce35479..526d1688cf 100644 --- a/gtk/gtktreemodel.c +++ b/gtk/gtktreemodel.c @@ -622,6 +622,31 @@ gtk_tree_path_get_indices (GtkTreePath *path) return path->indices; } +/** + * gtk_tree_path_get_indices_with_depth: + * @path: A #GtkTreePath. + * @depth: Number of elements returned in the integer array + * + * Returns the current indices of @path. + * This is an array of integers, each representing a node in a tree. + * It also returns the number of elements in the array. + * The array should not be freed. + * + * Return value: (array length=depth): The current indices, or %NULL. + * + * Since: 3.0 + **/ +gint * +gtk_tree_path_get_indices_with_depth (GtkTreePath *path, gint *depth) +{ + g_return_val_if_fail (path != NULL, NULL); + + if (depth) + *depth = path->depth; + + return path->indices; +} + /** * gtk_tree_path_free: * @path: A #GtkTreePath. @@ -953,7 +978,7 @@ gtk_tree_model_get_n_columns (GtkTreeModel *tree_model) * * Returns the type of the column. * - * Return value: The type of the column. + * Return value: (transfer none): The type of the column. **/ GType gtk_tree_model_get_column_type (GtkTreeModel *tree_model, @@ -1123,7 +1148,7 @@ gtk_tree_model_get_path (GtkTreeModel *tree_model, * @tree_model: A #GtkTreeModel. * @iter: The #GtkTreeIter. * @column: The column to lookup the value at. - * @value: (inout) (transfer none) An empty #GValue to set. + * @value: (out) (transfer none) An empty #GValue to set. * * Initializes and sets @value to that at @column. * When done with @value, g_value_unset() needs to be called diff --git a/gtk/gtktreemodel.h b/gtk/gtktreemodel.h index b48e87b642..e7f59c672b 100644 --- a/gtk/gtktreemodel.h +++ b/gtk/gtktreemodel.h @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -134,6 +134,10 @@ void gtk_tree_path_prepend_index (GtkTreePath *path, gint index_); gint gtk_tree_path_get_depth (GtkTreePath *path); gint *gtk_tree_path_get_indices (GtkTreePath *path); + +gint *gtk_tree_path_get_indices_with_depth (GtkTreePath *path, + gint *depth); + void gtk_tree_path_free (GtkTreePath *path); GtkTreePath *gtk_tree_path_copy (const GtkTreePath *path); GType gtk_tree_path_get_type (void) G_GNUC_CONST; @@ -149,10 +153,6 @@ gboolean gtk_tree_path_is_ancestor (GtkTreePath *path, gboolean gtk_tree_path_is_descendant (GtkTreePath *path, GtkTreePath *ancestor); -#ifndef GTK_DISABLE_DEPRECATED -#define gtk_tree_path_new_root() gtk_tree_path_new_first() -#endif /* !GTK_DISABLE_DEPRECATED */ - /* Row reference (an object that tracks model changes so it refers to the same * row always; a path refers to a position, not a fixed row). You almost always * want to call gtk_tree_row_reference_new. @@ -241,11 +241,6 @@ void gtk_tree_model_foreach (GtkTreeModel *model GtkTreeModelForeachFunc func, gpointer user_data); - -#ifndef GTK_DISABLE_DEPRECATED -#define gtk_tree_model_get_iter_root(tree_model, iter) gtk_tree_model_get_iter_first(tree_model, iter) -#endif /* !GTK_DISABLE_DEPRECATED */ - /* Signals */ void gtk_tree_model_row_changed (GtkTreeModel *tree_model, GtkTreePath *path, diff --git a/gtk/gtktreemodelfilter.c b/gtk/gtktreemodelfilter.c index 139f68eff9..a5f5db7e49 100644 --- a/gtk/gtktreemodelfilter.c +++ b/gtk/gtktreemodelfilter.c @@ -234,6 +234,14 @@ static GtkTreePath *gtk_tree_model_filter_remove_root (GtkTr static void gtk_tree_model_filter_increment_stamp (GtkTreeModelFilter *filter); +static void gtk_tree_model_filter_real_modify (GtkTreeModelFilter *self, + GtkTreeModel *child_model, + GtkTreeIter *iter, + GValue *value, + gint column); +static gboolean gtk_tree_model_filter_real_visible (GtkTreeModelFilter *filter, + GtkTreeModel *child_model, + GtkTreeIter *child_iter); static gboolean gtk_tree_model_filter_visible (GtkTreeModelFilter *filter, GtkTreeIter *child_iter); static void gtk_tree_model_filter_clear_cache_helper (GtkTreeModelFilter *filter, @@ -311,6 +319,9 @@ gtk_tree_model_filter_class_init (GtkTreeModelFilterClass *filter_class) object_class->finalize = gtk_tree_model_filter_finalize; + filter_class->visible = gtk_tree_model_filter_real_visible; + filter_class->modify = gtk_tree_model_filter_real_modify; + /* Properties -- FIXME: disabled translations for now, until I can come up with a * better description */ @@ -756,12 +767,13 @@ gtk_tree_model_filter_increment_stamp (GtkTreeModelFilter *filter) } static gboolean -gtk_tree_model_filter_visible (GtkTreeModelFilter *filter, - GtkTreeIter *child_iter) +gtk_tree_model_filter_real_visible (GtkTreeModelFilter *filter, + GtkTreeModel *child_model, + GtkTreeIter *child_iter) { if (filter->priv->visible_func) { - return filter->priv->visible_func (filter->priv->child_model, + return filter->priv->visible_func (child_model, child_iter, filter->priv->visible_data) ? TRUE : FALSE; @@ -770,7 +782,7 @@ gtk_tree_model_filter_visible (GtkTreeModelFilter *filter, { GValue val = {0, }; - gtk_tree_model_get_value (filter->priv->child_model, child_iter, + gtk_tree_model_get_value (child_model, child_iter, filter->priv->visible_column, &val); if (g_value_get_boolean (&val)) @@ -787,6 +799,14 @@ gtk_tree_model_filter_visible (GtkTreeModelFilter *filter, return TRUE; } +static gboolean +gtk_tree_model_filter_visible (GtkTreeModelFilter *self, + GtkTreeIter *child_iter) +{ + return GTK_TREE_MODEL_FILTER_GET_CLASS (self)->visible (self, + self->priv->child_model, child_iter); +} + static void gtk_tree_model_filter_clear_cache_helper (GtkTreeModelFilter *filter, FilterLevel *level) @@ -2383,36 +2403,49 @@ gtk_tree_model_filter_get_path (GtkTreeModel *model, return retval; } +static void +gtk_tree_model_filter_real_modify (GtkTreeModelFilter *self, + GtkTreeModel *child_model, + GtkTreeIter *iter, + GValue *value, + gint column) +{ + if (self->priv->modify_func) + { + g_return_if_fail (column < self->priv->modify_n_columns); + + g_value_init (value, self->priv->modify_types[column]); + self->priv->modify_func (GTK_TREE_MODEL (self), + iter, + value, + column, + self->priv->modify_data); + } + else + { + GtkTreeIter child_iter; + + gtk_tree_model_filter_convert_iter_to_child_iter ( + GTK_TREE_MODEL_FILTER (self), &child_iter, iter); + gtk_tree_model_get_value (child_model, + &child_iter, column, value); + } +} + static void gtk_tree_model_filter_get_value (GtkTreeModel *model, GtkTreeIter *iter, gint column, GValue *value) { - GtkTreeIter child_iter; GtkTreeModelFilter *filter = GTK_TREE_MODEL_FILTER (model); g_return_if_fail (GTK_IS_TREE_MODEL_FILTER (model)); g_return_if_fail (GTK_TREE_MODEL_FILTER (model)->priv->child_model != NULL); g_return_if_fail (GTK_TREE_MODEL_FILTER (model)->priv->stamp == iter->stamp); - if (filter->priv->modify_func) - { - g_return_if_fail (column < filter->priv->modify_n_columns); - - g_value_init (value, filter->priv->modify_types[column]); - filter->priv->modify_func (model, - iter, - value, - column, - filter->priv->modify_data); - - return; - } - - gtk_tree_model_filter_convert_iter_to_child_iter (GTK_TREE_MODEL_FILTER (model), &child_iter, iter); - gtk_tree_model_get_value (GTK_TREE_MODEL_FILTER (model)->priv->child_model, - &child_iter, column, value); + GTK_TREE_MODEL_FILTER_GET_CLASS (model)->modify (filter, + filter->priv->child_model, iter, value, column); } static gboolean diff --git a/gtk/gtktreemodelfilter.h b/gtk/gtktreemodelfilter.h index 79e30fd31c..653e395a03 100644 --- a/gtk/gtktreemodelfilter.h +++ b/gtk/gtktreemodelfilter.h @@ -18,7 +18,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -62,11 +62,18 @@ struct _GtkTreeModelFilterClass { GObjectClass parent_class; + gboolean (* visible) (GtkTreeModelFilter *self, + GtkTreeModel *child_model, + GtkTreeIter *iter); + void (* modify) (GtkTreeModelFilter *self, + GtkTreeModel *child_model, + GtkTreeIter *iter, + GValue *value, + gint column); + /* Padding for future expansion */ void (*_gtk_reserved0) (void); void (*_gtk_reserved1) (void); - void (*_gtk_reserved2) (void); - void (*_gtk_reserved3) (void); }; /* base */ diff --git a/gtk/gtktreemodelsort.h b/gtk/gtktreemodelsort.h index 4823398579..e144b32c78 100644 --- a/gtk/gtktreemodelsort.h +++ b/gtk/gtktreemodelsort.h @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtktreeprivate.h b/gtk/gtktreeprivate.h index c44d61813d..e8887e0b17 100644 --- a/gtk/gtktreeprivate.h +++ b/gtk/gtktreeprivate.h @@ -406,7 +406,8 @@ void _gtk_tree_view_column_unset_tree_view (GtkTreeViewColumn *column); void _gtk_tree_view_column_set_width (GtkTreeViewColumn *column, gint width); void _gtk_tree_view_column_start_drag (GtkTreeView *tree_view, - GtkTreeViewColumn *column); + GtkTreeViewColumn *column, + GdkDevice *device); gboolean _gtk_tree_view_column_cell_event (GtkTreeViewColumn *tree_column, GtkCellEditable **editable_widget, GdkEvent *event, diff --git a/gtk/gtktreeselection.c b/gtk/gtktreeselection.c index 4a275da5c0..59ce8aea3a 100644 --- a/gtk/gtktreeselection.c +++ b/gtk/gtktreeselection.c @@ -327,7 +327,7 @@ gtk_tree_selection_get_tree_view (GtkTreeSelection *selection) /** * gtk_tree_selection_get_selected: * @selection: A #GtkTreeSelection. - * @model: (out) (allow-none): A pointer to set to the #GtkTreeModel, or NULL. + * @model: (out) (allow-none) (transfer none): A pointer to set to the #GtkTreeModel, or NULL. * @iter: (allow-none): The #GtkTreeIter, or NULL. * * Sets @iter to the currently selected node if @selection is set to diff --git a/gtk/gtktreeselection.h b/gtk/gtktreeselection.h index ece7ab8e6c..267a2af37e 100644 --- a/gtk/gtktreeselection.h +++ b/gtk/gtktreeselection.h @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtktreesortable.h b/gtk/gtktreesortable.h index a576e2dff0..52dea7199d 100644 --- a/gtk/gtktreesortable.h +++ b/gtk/gtktreesortable.h @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtktreestore.h b/gtk/gtktreestore.h index b47b1ecb33..aee9baca97 100644 --- a/gtk/gtktreestore.h +++ b/gtk/gtktreestore.h @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index 93bb688616..c7a5ad7fad 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -396,8 +396,9 @@ static void update_prelight (GtkTreeView /* interactive search */ static void gtk_tree_view_ensure_interactive_directory (GtkTreeView *tree_view); -static void gtk_tree_view_search_dialog_hide (GtkWidget *search_dialog, - GtkTreeView *tree_view); +static void gtk_tree_view_search_dialog_hide (GtkWidget *search_dialog, + GtkTreeView *tree_view, + GdkDevice *device); static void gtk_tree_view_search_position_func (GtkTreeView *tree_view, GtkWidget *search_dialog, gpointer user_data); @@ -457,6 +458,7 @@ static void gtk_tree_view_real_start_editing (GtkTreeView *tree_view, static void gtk_tree_view_stop_editing (GtkTreeView *tree_view, gboolean cancel_editing); static gboolean gtk_tree_view_real_start_interactive_search (GtkTreeView *tree_view, + GdkDevice *device, gboolean keybinding); static gboolean gtk_tree_view_start_interactive_search (GtkTreeView *tree_view); static GtkTreeViewColumn *gtk_tree_view_get_drop_column (GtkTreeView *tree_view, @@ -1811,6 +1813,8 @@ gtk_tree_view_realize (GtkWidget *widget) attributes.height = tree_view->priv->header_height; attributes.event_mask = (GDK_EXPOSURE_MASK | GDK_SCROLL_MASK | + GDK_ENTER_NOTIFY_MASK | + GDK_LEAVE_NOTIFY_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | @@ -3673,7 +3677,6 @@ gtk_tree_view_vertical_autoscroll (GtkTreeView *tree_view) GdkRectangle visible_rect; gint y; gint offset; - gfloat value; gdk_window_get_pointer (tree_view->priv->bin_window, NULL, &y, NULL); y += tree_view->priv->dy; @@ -3689,9 +3692,8 @@ gtk_tree_view_vertical_autoscroll (GtkTreeView *tree_view) return; } - value = CLAMP (tree_view->priv->vadjustment->value + offset, 0.0, - tree_view->priv->vadjustment->upper - tree_view->priv->vadjustment->page_size); - gtk_adjustment_set_value (tree_view->priv->vadjustment, value); + gtk_adjustment_set_value (tree_view->priv->vadjustment, + MAX (tree_view->priv->vadjustment->value + offset, 0.0)); } static gboolean @@ -3700,7 +3702,6 @@ gtk_tree_view_horizontal_autoscroll (GtkTreeView *tree_view) GdkRectangle visible_rect; gint x; gint offset; - gfloat value; gdk_window_get_pointer (tree_view->priv->bin_window, &x, NULL, NULL); @@ -3716,9 +3717,8 @@ gtk_tree_view_horizontal_autoscroll (GtkTreeView *tree_view) } offset = offset/3; - value = CLAMP (tree_view->priv->hadjustment->value + offset, - 0.0, tree_view->priv->hadjustment->upper - tree_view->priv->hadjustment->page_size); - gtk_adjustment_set_value (tree_view->priv->hadjustment, value); + gtk_adjustment_set_value (tree_view->priv->hadjustment, + MAX (tree_view->priv->hadjustment->value + offset, 0.0)); return TRUE; @@ -5495,7 +5495,9 @@ gtk_tree_view_key_press (GtkWidget *widget, if (tree_view->priv->imcontext_changed || /* we're in a preedit */ (retval && text_modified)) /* ...or the text was modified */ { - if (gtk_tree_view_real_start_interactive_search (tree_view, FALSE)) + if (gtk_tree_view_real_start_interactive_search (tree_view, + gdk_event_get_device ((GdkEvent *) event), + FALSE)) { gtk_widget_grab_focus (GTK_WIDGET (tree_view)); return TRUE; @@ -5604,7 +5606,8 @@ gtk_tree_view_focus_out (GtkWidget *widget, /* destroy interactive search dialog */ if (tree_view->priv->search_window) - gtk_tree_view_search_dialog_hide (tree_view->priv->search_window, tree_view); + gtk_tree_view_search_dialog_hide (tree_view->priv->search_window, tree_view, + gdk_event_get_device ((GdkEvent *) event)); return FALSE; } @@ -8936,11 +8939,7 @@ gtk_tree_view_clamp_column_visible (GtkTreeView *tree_view, } } - gtk_adjustment_set_value (tree_view->priv->hadjustment, - CLAMP (x, - tree_view->priv->hadjustment->lower, - tree_view->priv->hadjustment->upper - - tree_view->priv->hadjustment->page_size)); + gtk_adjustment_set_value (tree_view->priv->hadjustment, x); } else { @@ -9271,7 +9270,8 @@ gtk_tree_view_set_column_drag_info (GtkTreeView *tree_view, void _gtk_tree_view_column_start_drag (GtkTreeView *tree_view, - GtkTreeViewColumn *column) + GtkTreeViewColumn *column, + GdkDevice *device) { GdkEvent *send_event; GtkAllocation allocation; @@ -9320,6 +9320,7 @@ _gtk_tree_view_column_start_drag (GtkTreeView *tree_view, send_event->crossing.subwindow = NULL; send_event->crossing.detail = GDK_NOTIFY_ANCESTOR; send_event->crossing.time = GDK_CURRENT_TIME; + gdk_event_set_device (send_event, device); gtk_propagate_event (column->button, send_event); gdk_event_free (send_event); @@ -9333,9 +9334,9 @@ _gtk_tree_view_column_start_drag (GtkTreeView *tree_view, send_event->button.axes = NULL; send_event->button.state = 0; send_event->button.button = 1; - send_event->button.device = gdk_display_get_core_pointer (display); send_event->button.x_root = 0; send_event->button.y_root = 0; + gdk_event_set_device (send_event, device); gtk_propagate_event (column->button, send_event); gdk_event_free (send_event); @@ -10255,7 +10256,7 @@ gtk_tree_view_real_select_cursor_parent (GtkTreeView *tree_view) static gboolean gtk_tree_view_search_entry_flush_timeout (GtkTreeView *tree_view) { - gtk_tree_view_search_dialog_hide (tree_view->priv->search_window, tree_view); + gtk_tree_view_search_dialog_hide (tree_view->priv->search_window, tree_view, NULL); tree_view->priv->typeselect_flush_timeout = 0; return FALSE; @@ -10264,27 +10265,43 @@ gtk_tree_view_search_entry_flush_timeout (GtkTreeView *tree_view) /* Cut and paste from gtkwindow.c */ static void send_focus_change (GtkWidget *widget, + GdkDevice *device, gboolean in) { - GdkEvent *fevent = gdk_event_new (GDK_FOCUS_CHANGE); + GdkDeviceManager *device_manager; + GList *devices, *d; - g_object_ref (widget); - - if (in) - GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS); - else - GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS); + device_manager = gdk_display_get_device_manager (gtk_widget_get_display (widget)); + devices = gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_MASTER); + devices = g_list_concat (devices, gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_SLAVE)); + devices = g_list_concat (devices, gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_FLOATING)); - fevent->focus_change.type = GDK_FOCUS_CHANGE; - fevent->focus_change.window = g_object_ref (widget->window); - fevent->focus_change.in = in; - - gtk_widget_event (widget, fevent); - - g_object_notify (G_OBJECT (widget), "has-focus"); + for (d = devices; d; d = d->next) + { + GdkDevice *dev = d->data; + GdkEvent *fevent; - g_object_unref (widget); - gdk_event_free (fevent); + if (dev->source != GDK_SOURCE_KEYBOARD) + continue; + + /* Skip non-master keyboards that haven't + * selected for events from this window + */ + if (gdk_device_get_device_type (dev) != GDK_DEVICE_TYPE_MASTER && + !gdk_window_get_device_events (widget->window, dev)) + continue; + + fevent = gdk_event_new (GDK_FOCUS_CHANGE); + + fevent->focus_change.type = GDK_FOCUS_CHANGE; + fevent->focus_change.window = g_object_ref (widget->window); + fevent->focus_change.in = in; + gdk_event_set_device (fevent, device); + + gtk_widget_send_focus_change (widget, fevent); + + gdk_event_free (fevent); + } } static void @@ -10368,6 +10385,7 @@ gtk_tree_view_ensure_interactive_directory (GtkTreeView *tree_view) */ static gboolean gtk_tree_view_real_start_interactive_search (GtkTreeView *tree_view, + GdkDevice *device, gboolean keybinding) { /* We only start interactive search if we have focus or the columns @@ -10440,7 +10458,7 @@ gtk_tree_view_real_start_interactive_search (GtkTreeView *tree_view, (entry_parent_class->grab_focus) (tree_view->priv->search_entry); /* send focus-in event */ - send_focus_change (tree_view->priv->search_entry, TRUE); + send_focus_change (tree_view->priv->search_entry, device, TRUE); /* search first matching iter */ gtk_tree_view_search_init (tree_view->priv->search_entry, tree_view); @@ -10451,7 +10469,9 @@ gtk_tree_view_real_start_interactive_search (GtkTreeView *tree_view, static gboolean gtk_tree_view_start_interactive_search (GtkTreeView *tree_view) { - return gtk_tree_view_real_start_interactive_search (tree_view, TRUE); + return gtk_tree_view_real_start_interactive_search (tree_view, + gtk_get_current_event_device (), + TRUE); } /* this function returns the new width of the column being resized given @@ -10662,7 +10682,7 @@ gtk_tree_view_new_with_model (GtkTreeModel *model) * Returns the model the #GtkTreeView is based on. Returns %NULL if the * model is unset. * - * Return value: A #GtkTreeModel, or %NULL if none is currently being used. + * Return value: (transfer none): A #GtkTreeModel, or %NULL if none is currently being used. **/ GtkTreeModel * gtk_tree_view_get_model (GtkTreeView *tree_view) @@ -10830,7 +10850,7 @@ gtk_tree_view_set_model (GtkTreeView *tree_view, * * Gets the #GtkTreeSelection associated with @tree_view. * - * Return value: A #GtkTreeSelection object. + * Return value: (transfer none): A #GtkTreeSelection object. **/ GtkTreeSelection * gtk_tree_view_get_selection (GtkTreeView *tree_view) @@ -11604,9 +11624,9 @@ gtk_tree_view_scroll_to_point (GtkTreeView *tree_view, vadj = tree_view->priv->vadjustment; if (tree_x != -1) - gtk_adjustment_set_value (hadj, CLAMP (tree_x, hadj->lower, hadj->upper - hadj->page_size)); + gtk_adjustment_set_value (hadj, tree_x); if (tree_y != -1) - gtk_adjustment_set_value (vadj, CLAMP (tree_y, vadj->lower, vadj->upper - vadj->page_size)); + gtk_adjustment_set_value (vadj, tree_y); } /** @@ -12570,8 +12590,8 @@ gtk_tree_view_real_set_cursor (GtkTreeView *tree_view, /** * gtk_tree_view_get_cursor: * @tree_view: A #GtkTreeView - * @path: (allow-none): A pointer to be filled with the current cursor path, or %NULL - * @focus_column: (allow-none): A pointer to be filled with the current focus column, or %NULL + * @path: (out) (allow-none): A pointer to be filled with the current cursor path, or %NULL + * @focus_column: (out) (allow-none): A pointer to be filled with the current focus column, or %NULL * * Fills in @path and @focus_column with the current path and focus column. If * the cursor isn't currently set, then *@path will be %NULL. If no column @@ -13027,71 +13047,6 @@ gtk_tree_view_get_visible_rect (GtkTreeView *tree_view, } } -/** - * gtk_tree_view_widget_to_tree_coords: - * @tree_view: a #GtkTreeView - * @wx: X coordinate relative to bin_window - * @wy: Y coordinate relative to bin_window - * @tx: return location for tree X coordinate - * @ty: return location for tree Y coordinate - * - * Converts bin_window coordinates to coordinates for the - * tree (the full scrollable area of the tree). - * - * Deprecated: 2.12: Due to historial reasons the name of this function is - * incorrect. For converting coordinates relative to the widget to - * bin_window coordinates, please see - * gtk_tree_view_convert_widget_to_bin_window_coords(). - * - **/ -void -gtk_tree_view_widget_to_tree_coords (GtkTreeView *tree_view, - gint wx, - gint wy, - gint *tx, - gint *ty) -{ - g_return_if_fail (GTK_IS_TREE_VIEW (tree_view)); - - if (tx) - *tx = wx + tree_view->priv->hadjustment->value; - if (ty) - *ty = wy + tree_view->priv->dy; -} - -/** - * gtk_tree_view_tree_to_widget_coords: - * @tree_view: a #GtkTreeView - * @tx: tree X coordinate - * @ty: tree Y coordinate - * @wx: return location for X coordinate relative to bin_window - * @wy: return location for Y coordinate relative to bin_window - * - * Converts tree coordinates (coordinates in full scrollable area of the tree) - * to bin_window coordinates. - * - * Deprecated: 2.12: Due to historial reasons the name of this function is - * incorrect. For converting bin_window coordinates to coordinates relative - * to bin_window, please see - * gtk_tree_view_convert_bin_window_to_widget_coords(). - * - **/ -void -gtk_tree_view_tree_to_widget_coords (GtkTreeView *tree_view, - gint tx, - gint ty, - gint *wx, - gint *wy) -{ - g_return_if_fail (GTK_IS_TREE_VIEW (tree_view)); - - if (wx) - *wx = tx - tree_view->priv->hadjustment->value; - if (wy) - *wy = ty - tree_view->priv->dy; -} - - /** * gtk_tree_view_convert_widget_to_tree_coords: * @tree_view: a #GtkTreeView @@ -13557,8 +13512,8 @@ gtk_tree_view_set_drag_dest_row (GtkTreeView *tree_view, /** * gtk_tree_view_get_drag_dest_row: * @tree_view: a #GtkTreeView - * @path: (allow-none): Return location for the path of the highlighted row, or %NULL. - * @pos: (allow-none): Return location for the drop position, or %NULL + * @path: (out) (allow-none): Return location for the path of the highlighted row, or %NULL. + * @pos: (out) (allow-none): Return location for the drop position, or %NULL * * Gets information about the row that is highlighted for feedback. **/ @@ -13591,8 +13546,8 @@ gtk_tree_view_get_drag_dest_row (GtkTreeView *tree_view, * @tree_view: a #GtkTreeView * @drag_x: the position to determine the destination row for * @drag_y: the position to determine the destination row for - * @path: (allow-none): Return location for the path of the highlighted row, or %NULL. - * @pos: (allow-none): Return location for the drop position, or %NULL + * @path: (out) (allow-none): Return location for the path of the highlighted row, or %NULL. + * @pos: (out) (allow-none): Return location for the drop position, or %NULL * * Determines the destination row for a given position. @drag_x and * @drag_y are expected to be in widget coordinates. This function is only @@ -14156,7 +14111,8 @@ gtk_tree_view_get_search_position_func (GtkTreeView *tree_view) static void gtk_tree_view_search_dialog_hide (GtkWidget *search_dialog, - GtkTreeView *tree_view) + GtkTreeView *tree_view, + GdkDevice *device) { if (tree_view->priv->disable_popdown) return; @@ -14176,10 +14132,10 @@ gtk_tree_view_search_dialog_hide (GtkWidget *search_dialog, if (gtk_widget_get_visible (search_dialog)) { /* send focus-in event */ - send_focus_change (GTK_WIDGET (tree_view->priv->search_entry), FALSE); + send_focus_change (GTK_WIDGET (tree_view->priv->search_entry), device, FALSE); gtk_widget_hide (search_dialog); gtk_entry_set_text (GTK_ENTRY (tree_view->priv->search_entry), ""); - send_focus_change (GTK_WIDGET (tree_view), TRUE); + send_focus_change (GTK_WIDGET (tree_view), device, TRUE); } } @@ -14265,7 +14221,8 @@ gtk_tree_view_search_activate (GtkEntry *entry, GtkRBTree *tree; gtk_tree_view_search_dialog_hide (tree_view->priv->search_window, - tree_view); + tree_view, + gtk_get_current_event_device ()); /* If we have a row selected and it's the cursor row, we activate * the row XXX */ @@ -14306,7 +14263,7 @@ gtk_tree_view_search_delete_event (GtkWidget *widget, { g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE); - gtk_tree_view_search_dialog_hide (widget, tree_view); + gtk_tree_view_search_dialog_hide (widget, tree_view, NULL); return TRUE; } @@ -14316,9 +14273,12 @@ gtk_tree_view_search_button_press_event (GtkWidget *widget, GdkEventButton *event, GtkTreeView *tree_view) { + GdkDevice *keyb_device; + g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE); - gtk_tree_view_search_dialog_hide (widget, tree_view); + keyb_device = gdk_device_get_associated_device (event->device); + gtk_tree_view_search_dialog_hide (widget, tree_view, keyb_device); if (event->window == tree_view->priv->bin_window) gtk_tree_view_button_press (GTK_WIDGET (tree_view), event); @@ -14375,7 +14335,8 @@ gtk_tree_view_search_key_press_event (GtkWidget *widget, event->keyval == GDK_KP_Tab || event->keyval == GDK_ISO_Left_Tab)) { - gtk_tree_view_search_dialog_hide (widget, tree_view); + gtk_tree_view_search_dialog_hide (widget, tree_view, + gdk_event_get_device ((GdkEvent *) event)); return TRUE; } diff --git a/gtk/gtktreeview.h b/gtk/gtktreeview.h index 098ab5ce17..71734c941e 100644 --- a/gtk/gtktreeview.h +++ b/gtk/gtktreeview.h @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -260,19 +260,6 @@ void gtk_tree_view_get_background_area (GtkTreeView GdkRectangle *rect); void gtk_tree_view_get_visible_rect (GtkTreeView *tree_view, GdkRectangle *visible_rect); - -#ifndef GTK_DISABLE_DEPRECATED -void gtk_tree_view_widget_to_tree_coords (GtkTreeView *tree_view, - gint wx, - gint wy, - gint *tx, - gint *ty); -void gtk_tree_view_tree_to_widget_coords (GtkTreeView *tree_view, - gint tx, - gint ty, - gint *wx, - gint *wy); -#endif /* !GTK_DISABLE_DEPRECATED */ gboolean gtk_tree_view_get_visible_range (GtkTreeView *tree_view, GtkTreePath **start_path, GtkTreePath **end_path); diff --git a/gtk/gtktreeviewcolumn.c b/gtk/gtktreeviewcolumn.c index 348a9df98a..0d953de7af 100644 --- a/gtk/gtktreeviewcolumn.c +++ b/gtk/gtktreeviewcolumn.c @@ -1097,7 +1097,8 @@ gtk_tree_view_column_button_event (GtkWidget *widget, (gint) ((GdkEventMotion *)event)->y))) { column->maybe_reordered = FALSE; - _gtk_tree_view_column_start_drag (GTK_TREE_VIEW (column->tree_view), column); + _gtk_tree_view_column_start_drag (GTK_TREE_VIEW (column->tree_view), column, + event->motion.device); return TRUE; } if (column->clickable == FALSE) @@ -1586,23 +1587,6 @@ gtk_tree_view_column_cell_layout_get_cells (GtkCellLayout *layout) return retval; } -/** - * gtk_tree_view_column_get_cell_renderers: - * @tree_column: A #GtkTreeViewColumn - * - * Returns a newly-allocated #GList of all the cell renderers in the column, - * in no particular order. The list must be freed with g_list_free(). - * - * Return value: A list of #GtkCellRenderers - * - * Deprecated: 2.18: use gtk_cell_layout_get_cells() instead. - **/ -GList * -gtk_tree_view_column_get_cell_renderers (GtkTreeViewColumn *tree_column) -{ - return gtk_tree_view_column_cell_layout_get_cells (GTK_CELL_LAYOUT (tree_column)); -} - /** * gtk_tree_view_column_add_attribute: * @tree_column: A #GtkTreeViewColumn. diff --git a/gtk/gtktreeviewcolumn.h b/gtk/gtktreeviewcolumn.h index b06e845d9f..4e72235bc8 100644 --- a/gtk/gtktreeviewcolumn.h +++ b/gtk/gtktreeviewcolumn.h @@ -17,7 +17,7 @@ * Boston, MA 02111-1307, USA. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -135,9 +135,6 @@ void gtk_tree_view_column_pack_end (GtkTreeViewCol GtkCellRenderer *cell, gboolean expand); void gtk_tree_view_column_clear (GtkTreeViewColumn *tree_column); -#ifndef GTK_DISABLE_DEPRECATED -GList *gtk_tree_view_column_get_cell_renderers (GtkTreeViewColumn *tree_column); -#endif void gtk_tree_view_column_add_attribute (GtkTreeViewColumn *tree_column, GtkCellRenderer *cell_renderer, const gchar *attribute, diff --git a/gtk/gtktypebuiltins.c.template b/gtk/gtktypebuiltins.c.template index 648b5db1d0..e15106e8dc 100644 --- a/gtk/gtktypebuiltins.c.template +++ b/gtk/gtktypebuiltins.c.template @@ -1,6 +1,5 @@ /*** BEGIN file-header ***/ #undef GTK_DISABLE_DEPRECATED -#define GTK_ENABLE_BROKEN #include "gtk.h" #include "gtkprivate.h" #include "gtkalias.h" diff --git a/gtk/gtktypebuiltins.h.template b/gtk/gtktypebuiltins.h.template index 9b2538dc13..ae41837486 100644 --- a/gtk/gtktypebuiltins.h.template +++ b/gtk/gtktypebuiltins.h.template @@ -1,5 +1,5 @@ /*** BEGIN file-header ***/ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtktypeutils.c b/gtk/gtktypeutils.c index 6047d6f218..b66289d019 100644 --- a/gtk/gtktypeutils.c +++ b/gtk/gtktypeutils.c @@ -24,8 +24,6 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#undef GTK_DISABLE_DEPRECATED - #include "config.h" #include /* strcmp */ @@ -34,111 +32,6 @@ #include "gtkintl.h" #include "gtkalias.h" - -/* --- functions --- */ -GtkType -gtk_type_unique (GtkType parent_type, - const GtkTypeInfo *gtkinfo) -{ - GTypeInfo tinfo = { 0, }; - - g_return_val_if_fail (GTK_TYPE_IS_OBJECT (parent_type), 0); - g_return_val_if_fail (gtkinfo != NULL, 0); - g_return_val_if_fail (gtkinfo->type_name != NULL, 0); - g_return_val_if_fail (g_type_from_name (gtkinfo->type_name) == 0, 0); - - tinfo.class_size = gtkinfo->class_size; - tinfo.base_init = gtkinfo->base_class_init_func; - tinfo.base_finalize = NULL; - tinfo.class_init = (GClassInitFunc) gtkinfo->class_init_func; - tinfo.class_finalize = NULL; - tinfo.class_data = NULL; - tinfo.instance_size = gtkinfo->object_size; - tinfo.n_preallocs = 0; - tinfo.instance_init = gtkinfo->object_init_func; - - return g_type_register_static (parent_type, gtkinfo->type_name, &tinfo, 0); -} - -/** - * gtk_type_class - * @type: a #GtkType. - * - * Returns a pointer pointing to the class of @type or %NULL if there - * was any trouble identifying @type. Initializes the class if - * necessary. - * - * Returns: pointer to the class. - * - * Deprecated: 2.14: Use g_type_class_peek() or g_type_class_ref() instead. - **/ -gpointer -gtk_type_class (GtkType type) -{ - static GQuark quark_static_class = 0; - gpointer class; - - if (!G_TYPE_IS_ENUM (type) && !G_TYPE_IS_FLAGS (type)) - g_return_val_if_fail (G_TYPE_IS_OBJECT (type), NULL); - - /* ok, this is a bit ugly, GLib reference counts classes, - * and gtk_type_class() used to always return static classes. - * while we coud be faster with just peeking the glib class - * for the normal code path, we can't be sure that that - * class stays around (someone else might be holding the - * reference count and is going to drop it later). so to - * ensure that Gtk actually holds a static reference count - * on the class, we use GType qdata to store referenced - * classes, and only return those. - */ - - class = g_type_get_qdata (type, quark_static_class); - if (!class) - { - if (!quark_static_class) - quark_static_class = g_quark_from_static_string ("GtkStaticTypeClass"); - - class = g_type_class_ref (type); - g_assert (class != NULL); - g_type_set_qdata (type, quark_static_class, class); - } - - return class; -} - -gpointer -gtk_type_new (GtkType type) -{ - gpointer object; - - g_return_val_if_fail (GTK_TYPE_IS_OBJECT (type), NULL); - - object = g_object_new (type, NULL); - - return object; -} - -void -gtk_type_init (GTypeDebugFlags debug_flags) -{ - static gboolean initialized = FALSE; - - if (!initialized) - { - GType unused; - - initialized = TRUE; - - /* initialize GLib type system - */ - g_type_init_with_debug_flags (debug_flags); - - /* GTK_TYPE_OBJECT - */ - unused = gtk_object_get_type (); - } -} - GType gtk_identifier_get_type (void) { @@ -153,66 +46,5 @@ gtk_identifier_get_type (void) return our_type; } -GtkEnumValue* -gtk_type_enum_get_values (GtkType enum_type) -{ - GEnumClass *class; - - g_return_val_if_fail (G_TYPE_IS_ENUM (enum_type), NULL); - - class = gtk_type_class (enum_type); - - return class->values; -} - -GtkFlagValue* -gtk_type_flags_get_values (GtkType flags_type) -{ - GFlagsClass *class; - - g_return_val_if_fail (G_TYPE_IS_FLAGS (flags_type), NULL); - - class = gtk_type_class (flags_type); - - return class->values; -} - -GtkEnumValue* -gtk_type_enum_find_value (GtkType enum_type, - const gchar *value_name) -{ - GtkEnumValue *value; - GEnumClass *class; - - g_return_val_if_fail (G_TYPE_IS_ENUM (enum_type), NULL); - g_return_val_if_fail (value_name != NULL, NULL); - - class = gtk_type_class (enum_type); - value = g_enum_get_value_by_name (class, value_name); - if (!value) - value = g_enum_get_value_by_nick (class, value_name); - - return value; -} - -GtkFlagValue* -gtk_type_flags_find_value (GtkType flags_type, - const gchar *value_name) -{ - GtkFlagValue *value; - GFlagsClass *class; - - g_return_val_if_fail (G_TYPE_IS_FLAGS (flags_type), NULL); - g_return_val_if_fail (value_name != NULL, NULL); - - class = gtk_type_class (flags_type); - value = g_flags_get_value_by_name (class, value_name); - if (!value) - value = g_flags_get_value_by_nick (class, value_name); - - return value; -} - - #define __GTK_TYPE_UTILS_C__ #include "gtkaliasdef.c" diff --git a/gtk/gtktypeutils.h b/gtk/gtktypeutils.h index 48b664c2a7..75711a3f4a 100644 --- a/gtk/gtktypeutils.h +++ b/gtk/gtktypeutils.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -59,79 +59,7 @@ typedef void (*GtkCallbackMarshal) (GtkObject *object, typedef gchar * (*GtkTranslateFunc) (const gchar *path, gpointer func_data); - -/* Everything below is deprecated and superseded by GType API - */ - -#ifndef GTK_DISABLE_DEPRECATED - -/* Fundamental Types - * many of these are just aliases for GLib types to maintain - * compatibility - */ - -#define GTK_TYPE_INVALID G_TYPE_INVALID -#define GTK_TYPE_NONE G_TYPE_NONE -#define GTK_TYPE_ENUM G_TYPE_ENUM -#define GTK_TYPE_FLAGS G_TYPE_FLAGS - -/* GtkArg types */ -#define GTK_TYPE_CHAR G_TYPE_CHAR -#define GTK_TYPE_UCHAR G_TYPE_UCHAR -#define GTK_TYPE_BOOL G_TYPE_BOOLEAN -#define GTK_TYPE_INT G_TYPE_INT -#define GTK_TYPE_UINT G_TYPE_UINT -#define GTK_TYPE_LONG G_TYPE_LONG -#define GTK_TYPE_ULONG G_TYPE_ULONG -#define GTK_TYPE_FLOAT G_TYPE_FLOAT -#define GTK_TYPE_DOUBLE G_TYPE_DOUBLE -#define GTK_TYPE_STRING G_TYPE_STRING -#define GTK_TYPE_BOXED G_TYPE_BOXED -#define GTK_TYPE_POINTER G_TYPE_POINTER - -typedef GType GtkFundamentalType; - -/* --- type macros --- */ -#define GTK_CLASS_NAME(class) (g_type_name (G_TYPE_FROM_CLASS (class))) -#define GTK_CLASS_TYPE(class) (G_TYPE_FROM_CLASS (class)) -#define GTK_TYPE_IS_OBJECT(type) (g_type_is_a ((type), GTK_TYPE_OBJECT)) - -/* outdated macros that really shouldn't e used anymore, - * use the GLib type system instead - */ -#define GTK_TYPE_FUNDAMENTAL_LAST (G_TYPE_LAST_RESERVED_FUNDAMENTAL - 1) -#define GTK_TYPE_FUNDAMENTAL_MAX (G_TYPE_FUNDAMENTAL_MAX) - -#define GTK_FUNDAMENTAL_TYPE G_TYPE_FUNDAMENTAL -#define GTK_STRUCT_OFFSET G_STRUCT_OFFSET - -/* glib macro wrappers (compatibility) */ -#define GTK_CHECK_CAST G_TYPE_CHECK_INSTANCE_CAST -#define GTK_CHECK_CLASS_CAST G_TYPE_CHECK_CLASS_CAST -#define GTK_CHECK_GET_CLASS G_TYPE_INSTANCE_GET_CLASS -#define GTK_CHECK_TYPE G_TYPE_CHECK_INSTANCE_TYPE -#define GTK_CHECK_CLASS_TYPE G_TYPE_CHECK_CLASS_TYPE - -/* glib type wrappers (compatibility) */ - -typedef GType GtkType; -typedef GTypeInstance GtkTypeObject; -typedef GTypeClass GtkTypeClass; -typedef GBaseInitFunc GtkClassInitFunc; -typedef GInstanceInitFunc GtkObjectInitFunc; -typedef GSignalCMarshaller GtkSignalMarshaller; - -typedef void (*GtkDestroyNotify) (gpointer data); -typedef void (*GtkSignalFunc) (void); - -#define GTK_SIGNAL_FUNC(f) G_CALLBACK(f) - -#endif /* GTK_DISABLE_DEPRECATED */ - -#if !defined (GTK_DISABLE_DEPRECATED) || defined (GTK_COMPILATION) - -/* Used by gtk_container_foreach_unmarshal () */ - +#if defined (GTK_COMPILATION) /* GtkArg, used to hold differently typed values */ struct _GtkArg { @@ -166,96 +94,7 @@ struct _GtkArg } signal_data; } d; }; - -/* argument value access macros, these must not contain casts, - * to allow the usage of these macros in combination with the - * address operator, e.g. >K_VALUE_CHAR (*arg) - */ -#define GTK_VALUE_CHAR(a) ((a).d.char_data) -#define GTK_VALUE_UCHAR(a) ((a).d.uchar_data) -#define GTK_VALUE_BOOL(a) ((a).d.bool_data) -#define GTK_VALUE_INT(a) ((a).d.int_data) -#define GTK_VALUE_UINT(a) ((a).d.uint_data) -#define GTK_VALUE_LONG(a) ((a).d.long_data) -#define GTK_VALUE_ULONG(a) ((a).d.ulong_data) -#define GTK_VALUE_FLOAT(a) ((a).d.float_data) -#define GTK_VALUE_DOUBLE(a) ((a).d.double_data) -#define GTK_VALUE_STRING(a) ((a).d.string_data) -#define GTK_VALUE_ENUM(a) ((a).d.int_data) -#define GTK_VALUE_FLAGS(a) ((a).d.uint_data) -#define GTK_VALUE_BOXED(a) ((a).d.pointer_data) -#define GTK_VALUE_OBJECT(a) ((a).d.object_data) -#define GTK_VALUE_POINTER(a) ((a).d.pointer_data) -#define GTK_VALUE_SIGNAL(a) ((a).d.signal_data) - -#endif /* !GTK_DISABLE_DEPRECATED || GTK_COMPILATION */ - -#ifndef GTK_DISABLE_DEPRECATED - -/* return location macros, these all narrow down to - * pointer types, because return values need to be - * passed by reference - */ -#define GTK_RETLOC_CHAR(a) ((gchar*) (a).d.pointer_data) -#define GTK_RETLOC_UCHAR(a) ((guchar*) (a).d.pointer_data) -#define GTK_RETLOC_BOOL(a) ((gboolean*) (a).d.pointer_data) -#define GTK_RETLOC_INT(a) ((gint*) (a).d.pointer_data) -#define GTK_RETLOC_UINT(a) ((guint*) (a).d.pointer_data) -#define GTK_RETLOC_LONG(a) ((glong*) (a).d.pointer_data) -#define GTK_RETLOC_ULONG(a) ((gulong*) (a).d.pointer_data) -#define GTK_RETLOC_FLOAT(a) ((gfloat*) (a).d.pointer_data) -#define GTK_RETLOC_DOUBLE(a) ((gdouble*) (a).d.pointer_data) -#define GTK_RETLOC_STRING(a) ((gchar**) (a).d.pointer_data) -#define GTK_RETLOC_ENUM(a) ((gint*) (a).d.pointer_data) -#define GTK_RETLOC_FLAGS(a) ((guint*) (a).d.pointer_data) -#define GTK_RETLOC_BOXED(a) ((gpointer*) (a).d.pointer_data) -#define GTK_RETLOC_OBJECT(a) ((GtkObject**) (a).d.pointer_data) -#define GTK_RETLOC_POINTER(a) ((gpointer*) (a).d.pointer_data) -/* GTK_RETLOC_SIGNAL() - no such thing */ - -/* type registration, it is recommended to use - * g_type_register_static() or - * g_type_register_dynamic() instead - */ -typedef struct _GtkTypeInfo GtkTypeInfo; - -struct _GtkTypeInfo -{ - gchar *type_name; - guint object_size; - guint class_size; - GtkClassInitFunc class_init_func; - GtkObjectInitFunc object_init_func; - gpointer reserved_1; - gpointer reserved_2; - GtkClassInitFunc base_class_init_func; -}; - -void gtk_type_init (GTypeDebugFlags debug_flags); -GtkType gtk_type_unique (GtkType parent_type, - const GtkTypeInfo *gtkinfo); -gpointer gtk_type_class (GtkType type); -gpointer gtk_type_new (GtkType type); - -/* --- compatibility defines --- */ -#define gtk_type_name(type) g_type_name (type) -#define gtk_type_from_name(name) g_type_from_name (name) -#define gtk_type_parent(type) g_type_parent (type) -#define gtk_type_is_a(type, is_a_type) g_type_is_a ((type), (is_a_type)) - -/* enum/flags compatibility functions, we strongly - * recommend to use the glib enum/flags classes directly - */ -typedef GEnumValue GtkEnumValue; -typedef GFlagsValue GtkFlagValue; -GtkEnumValue* gtk_type_enum_get_values (GtkType enum_type); -GtkFlagValue* gtk_type_flags_get_values (GtkType flags_type); -GtkEnumValue* gtk_type_enum_find_value (GtkType enum_type, - const gchar *value_name); -GtkFlagValue* gtk_type_flags_find_value (GtkType flags_type, - const gchar *value_name); - -#endif /* GTK_DISABLE_DEPRECATED */ +#endif /* GTK_COMPILATION */ G_END_DECLS diff --git a/gtk/gtkuimanager.h b/gtk/gtkuimanager.h index e58c2912db..faaf9ef787 100644 --- a/gtk/gtkuimanager.h +++ b/gtk/gtkuimanager.h @@ -28,7 +28,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkvbbox.c b/gtk/gtkvbbox.c index 72ba3851b5..ef8ea6c352 100644 --- a/gtk/gtkvbbox.c +++ b/gtk/gtkvbbox.c @@ -30,8 +30,31 @@ #include "gtkintl.h" #include "gtkalias.h" +/** + * SECTION:gtkvbbox + * @Short_description: A container for arranging buttons vertically + * @Title: GtkVButtonBox + * @See_also: #GtkBox, #GtkButtonBox, #GtkHButtonBox + * + * A button box should be used to provide a consistent layout of buttons + * throughout your application. The layout/spacing can be altered by the + * programmer, or if desired, by the user to alter the 'feel' of a + * program to a small degree. + * + * A #GtkVButtonBox is created with gtk_vbutton_box_new(). Buttons are + * packed into a button box the same way widgets are added to any other + * container, using gtk_container_add(). You can also use + * gtk_box_pack_start() or gtk_box_pack_end(), but for button boxes both + * these functions work just like gtk_container_add(), ie., they pack the + * button in a way that depends on the current layout style and on + * whether the button has had gtk_button_box_set_child_secondary() called + * on it. + * + * The spacing between buttons can be set with gtk_box_set_spacing(). The + * arrangement and layout of the buttons can be changed with + * gtk_button_box_set_layout(). + */ -static gint default_spacing = 10; static GtkButtonBoxStyle default_layout_style = GTK_BUTTONBOX_EDGE; G_DEFINE_TYPE (GtkVButtonBox, gtk_vbutton_box, GTK_TYPE_BUTTON_BOX) @@ -48,6 +71,13 @@ gtk_vbutton_box_init (GtkVButtonBox *vbutton_box) GTK_ORIENTATION_VERTICAL); } +/** + * gtk_vbutton_box_new: + * + * Creates a new vertical button box. + * + * Returns: a new button box #GtkWidget. + */ GtkWidget * gtk_vbutton_box_new (void) { @@ -55,45 +85,6 @@ gtk_vbutton_box_new (void) } - -/* set default value for spacing */ - -void -gtk_vbutton_box_set_spacing_default (gint spacing) -{ - default_spacing = spacing; -} - - -/* set default value for layout style */ - -void -gtk_vbutton_box_set_layout_default (GtkButtonBoxStyle layout) -{ - g_return_if_fail (layout >= GTK_BUTTONBOX_DEFAULT_STYLE && - layout <= GTK_BUTTONBOX_CENTER); - - default_layout_style = layout; -} - -/* get default value for spacing */ - -gint -gtk_vbutton_box_get_spacing_default (void) -{ - return default_spacing; -} - - - -/* get default value for layout style */ - -GtkButtonBoxStyle -gtk_vbutton_box_get_layout_default (void) -{ - return default_layout_style; -} - GtkButtonBoxStyle _gtk_vbutton_box_get_layout_default (void) { diff --git a/gtk/gtkvbbox.h b/gtk/gtkvbbox.h index 996eb57a60..c21be52303 100644 --- a/gtk/gtkvbbox.h +++ b/gtk/gtkvbbox.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -63,20 +63,11 @@ struct _GtkVButtonBoxClass GType gtk_vbutton_box_get_type (void) G_GNUC_CONST; GtkWidget *gtk_vbutton_box_new (void); -/* buttons can be added by gtk_container_add() */ - -#ifndef GTK_DISABLE_DEPRECATED -gint gtk_vbutton_box_get_spacing_default (void); -void gtk_vbutton_box_set_spacing_default (gint spacing); - -GtkButtonBoxStyle gtk_vbutton_box_get_layout_default (void); -void gtk_vbutton_box_set_layout_default (GtkButtonBoxStyle layout); -#endif /* private API */ GtkButtonBoxStyle _gtk_vbutton_box_get_layout_default (void); + G_END_DECLS - #endif /* __GTK_VBBOX_H__ */ diff --git a/gtk/gtkvbox.h b/gtk/gtkvbox.h index 68b549a743..5cd7bb9551 100644 --- a/gtk/gtkvbox.h +++ b/gtk/gtkvbox.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkversion.h.in b/gtk/gtkversion.h.in index 9db6268840..e82f9c7886 100644 --- a/gtk/gtkversion.h.in +++ b/gtk/gtkversion.h.in @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkviewport.c b/gtk/gtkviewport.c index bfda9f28bf..248e17fa2e 100644 --- a/gtk/gtkviewport.c +++ b/gtk/gtkviewport.c @@ -26,11 +26,31 @@ #include "config.h" #include "gtkviewport.h" +#include "gtkextendedlayout.h" #include "gtkintl.h" #include "gtkmarshalers.h" #include "gtkprivate.h" #include "gtkalias.h" +/** + * SECTION:gtkviewport + * @Short_description: An adapter which makes widgets scrollable + * @Title: GtkViewport + * @See_also:#GtkScrolledWindow, #GtkAdjustment + * + * The #GtkViewport widget acts as an adaptor class, implementing + * scrollability for child widgets that lack their own scrolling + * capabilities. Use #GtkViewport to scroll child widgets such as + * #GtkTable, #GtkBox, and so on. + * + * If a widget has native scrolling abilities, such as #GtkTextView, + * #GtkTreeView or #GtkIconview, it can be added to a #GtkScrolledWindow + * with gtk_container_add(). If a widget does not, you must first add the + * widget to a #GtkViewport, then add the viewport to the scrolled window. + * The convenience function gtk_scrolled_window_add_with_viewport() does + * exactly this, so you can ignore the presence of the viewport. + */ + enum { PROP_0, PROP_HADJUSTMENT, @@ -60,8 +80,6 @@ static gint gtk_viewport_expose (GtkWidget *widget, GdkEventExpose *event); static void gtk_viewport_add (GtkContainer *container, GtkWidget *widget); -static void gtk_viewport_size_request (GtkWidget *widget, - GtkRequisition *requisition); static void gtk_viewport_size_allocate (GtkWidget *widget, GtkAllocation *allocation); static void gtk_viewport_adjustment_value_changed (GtkAdjustment *adjustment, @@ -69,7 +87,18 @@ static void gtk_viewport_adjustment_value_changed (GtkAdjustment *adjustment, static void gtk_viewport_style_set (GtkWidget *widget, GtkStyle *previous_style); -G_DEFINE_TYPE (GtkViewport, gtk_viewport, GTK_TYPE_BIN) +static void gtk_viewport_extended_layout_init (GtkExtendedLayoutIface *iface); +static void gtk_viewport_get_desired_width (GtkExtendedLayout *layout, + gint *minimum_size, + gint *natural_size); +static void gtk_viewport_get_desired_height (GtkExtendedLayout *layout, + gint *minimum_size, + gint *natural_size); + + +G_DEFINE_TYPE_WITH_CODE (GtkViewport, gtk_viewport, GTK_TYPE_BIN, + G_IMPLEMENT_INTERFACE (GTK_TYPE_EXTENDED_LAYOUT, + gtk_viewport_extended_layout_init)) static void gtk_viewport_class_init (GtkViewportClass *class) @@ -92,7 +121,6 @@ gtk_viewport_class_init (GtkViewportClass *class) widget_class->realize = gtk_viewport_realize; widget_class->unrealize = gtk_viewport_unrealize; widget_class->expose_event = gtk_viewport_expose; - widget_class->size_request = gtk_viewport_size_request; widget_class->size_allocate = gtk_viewport_size_allocate; widget_class->style_set = gtk_viewport_style_set; @@ -417,10 +445,13 @@ viewport_set_vadjustment_values (GtkViewport *viewport, if (bin->child && gtk_widget_get_visible (bin->child)) { - GtkRequisition child_requisition; + gint natural_height; - gtk_widget_get_child_requisition (bin->child, &child_requisition); - vadjustment->upper = MAX (child_requisition.height, view_allocation.height); + gtk_extended_layout_get_height_for_width (GTK_EXTENDED_LAYOUT (bin->child), + view_allocation.width, + NULL, + &natural_height); + vadjustment->upper = MAX (natural_height, view_allocation.height); } else vadjustment->upper = view_allocation.height; @@ -721,31 +752,6 @@ gtk_viewport_add (GtkContainer *container, GTK_CONTAINER_CLASS (gtk_viewport_parent_class)->add (container, child); } -static void -gtk_viewport_size_request (GtkWidget *widget, - GtkRequisition *requisition) -{ - GtkBin *bin = GTK_BIN (widget); - GtkRequisition child_requisition; - - requisition->width = GTK_CONTAINER (widget)->border_width; - - requisition->height = GTK_CONTAINER (widget)->border_width; - - if (GTK_VIEWPORT (widget)->shadow_type != GTK_SHADOW_NONE) - { - requisition->width += 2 * widget->style->xthickness; - requisition->height += 2 * widget->style->ythickness; - } - - if (bin->child && gtk_widget_get_visible (bin->child)) - { - gtk_widget_size_request (bin->child, &child_requisition); - requisition->width += child_requisition.width; - requisition->height += child_requisition.height; - } -} - static void gtk_viewport_size_allocate (GtkWidget *widget, GtkAllocation *allocation) @@ -849,5 +855,74 @@ gtk_viewport_style_set (GtkWidget *widget, } } + +static void +gtk_viewport_extended_layout_init (GtkExtendedLayoutIface *iface) +{ + iface->get_desired_width = gtk_viewport_get_desired_width; + iface->get_desired_height = gtk_viewport_get_desired_height; +} + +static void +gtk_viewport_get_desired_size (GtkExtendedLayout *layout, + GtkOrientation orientation, + gint *minimum_size, + gint *natural_size) +{ + GtkWidget *child; + gint child_min, child_nat; + gint minimum, natural; + + child = gtk_bin_get_child (GTK_BIN (layout)); + + /* XXX This should probably be (border_width * 2); but GTK+ has + * been doing this with a single border for a while now... + */ + minimum = GTK_CONTAINER (layout)->border_width; + + if (GTK_VIEWPORT (layout)->shadow_type != GTK_SHADOW_NONE) + { + if (orientation == GTK_ORIENTATION_HORIZONTAL) + minimum += 2 * GTK_WIDGET (layout)->style->xthickness; + else + minimum += 2 * GTK_WIDGET (layout)->style->ythickness; + } + + natural = minimum; + + if (child && gtk_widget_get_visible (child)) + { + if (orientation == GTK_ORIENTATION_HORIZONTAL) + gtk_extended_layout_get_desired_width (GTK_EXTENDED_LAYOUT (child), &child_min, &child_nat); + else + gtk_extended_layout_get_desired_height (GTK_EXTENDED_LAYOUT (child), &child_min, &child_nat); + + minimum += child_min; + natural += child_nat; + } + + if (minimum_size) + *minimum_size = minimum; + + if (natural_size) + *natural_size = natural; +} + +static void +gtk_viewport_get_desired_width (GtkExtendedLayout *layout, + gint *minimum_size, + gint *natural_size) +{ + gtk_viewport_get_desired_size (layout, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size); +} + +static void +gtk_viewport_get_desired_height (GtkExtendedLayout *layout, + gint *minimum_size, + gint *natural_size) +{ + gtk_viewport_get_desired_size (layout, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size); +} + #define __GTK_VIEWPORT_C__ #include "gtkaliasdef.c" diff --git a/gtk/gtkviewport.h b/gtk/gtkviewport.h index da6b97c8d5..15427e8801 100644 --- a/gtk/gtkviewport.h +++ b/gtk/gtkviewport.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkvolumebutton.c b/gtk/gtkvolumebutton.c index 0ea6a99819..4ae0c377ba 100644 --- a/gtk/gtkvolumebutton.c +++ b/gtk/gtkvolumebutton.c @@ -36,6 +36,16 @@ #include "gtkalias.h" +/** + * SECTION:gtkvolumebutton + * @Short_description: A button which pops up a volume control + * @Title: GtkVolumeButton + * + * #GtkVolumeButton is a subclass of #GtkScaleButton that has + * been tailored for use as a volume control widget with suitable + * icons, tooltips and accessible labels. + */ + #define EPSILON (1e-10) diff --git a/gtk/gtkvolumebutton.h b/gtk/gtkvolumebutton.h index 1fd9bd9074..d5afa8fa04 100644 --- a/gtk/gtkvolumebutton.h +++ b/gtk/gtkvolumebutton.h @@ -27,7 +27,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkvpaned.c b/gtk/gtkvpaned.c index 42bba68ede..7b9e38f16a 100644 --- a/gtk/gtkvpaned.c +++ b/gtk/gtkvpaned.c @@ -30,6 +30,17 @@ #include "gtkvpaned.h" #include "gtkalias.h" +/** + * SECTION:gtkvpaned + * @Short_description: A container with two panes arranged vertically + * @Title: GtkVPaned + * + * The VPaned widget is a container widget with two + * children arranged vertically. The division between + * the two panes is adjustable by the user by dragging + * a handle. See #GtkPaned for details. + */ + G_DEFINE_TYPE (GtkVPaned, gtk_vpaned, GTK_TYPE_PANED) static void @@ -44,6 +55,13 @@ gtk_vpaned_init (GtkVPaned *vpaned) GTK_ORIENTATION_VERTICAL); } +/** + * gtk_vpaned_new: + * + * Create a new #GtkVPaned + * + * Returns: the new #GtkVPaned + */ GtkWidget * gtk_vpaned_new (void) { diff --git a/gtk/gtkvpaned.h b/gtk/gtkvpaned.h index 49a1aec48b..a42efa3edc 100644 --- a/gtk/gtkvpaned.h +++ b/gtk/gtkvpaned.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkvruler.c b/gtk/gtkvruler.c index 7dc104b1af..5bff897ab4 100644 --- a/gtk/gtkvruler.c +++ b/gtk/gtkvruler.c @@ -30,6 +30,28 @@ #include "gtkvruler.h" #include "gtkalias.h" +/** + * SECTION:gtkvruler + * @Short_description: A vertical ruler + * @Title: GtkVRuler + * + * + * This widget is considered too specialized/little-used for + * GTK+, and will in the future be moved to some other package. If + * your application needs this widget, feel free to use it, as the + * widget does work and is useful in some applications; it's just not + * of general interest. However, we are not accepting new features for + * the widget, and it will eventually move out of the GTK+ + * distribution. + * + * + * The VRuler widget is a widget arranged vertically creating a ruler that is + * utilized around other widgets such as a text widget. The ruler is used to show + * the location of the mouse on the window and to show the size of the window in + * specified units. The available units of measurement are GTK_PIXELS, GTK_INCHES + * and GTK_CENTIMETERS. GTK_PIXELS is the default unit of measurement. + */ + G_DEFINE_TYPE (GtkVRuler, gtk_vruler, GTK_TYPE_RULER) static void @@ -44,6 +66,13 @@ gtk_vruler_init (GtkVRuler *vruler) GTK_ORIENTATION_VERTICAL); } +/** + * gtk_vruler_new: + * + * Creates a new vertical ruler + * + * Returns: a new #GtkVRuler. + */ GtkWidget * gtk_vruler_new (void) { diff --git a/gtk/gtkvruler.h b/gtk/gtkvruler.h index 4cade7ba66..b9c7829220 100644 --- a/gtk/gtkvruler.h +++ b/gtk/gtkvruler.h @@ -34,7 +34,7 @@ * distribution. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkvscale.h b/gtk/gtkvscale.h index cf67920596..ce4953e5ec 100644 --- a/gtk/gtkvscale.h +++ b/gtk/gtkvscale.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkvscrollbar.h b/gtk/gtkvscrollbar.h index 2cd2ec971c..ca2179075b 100644 --- a/gtk/gtkvscrollbar.h +++ b/gtk/gtkvscrollbar.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkvseparator.h b/gtk/gtkvseparator.h index a82ebfe10a..62c7bf50e1 100644 --- a/gtk/gtkvseparator.h +++ b/gtk/gtkvseparator.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 2ee01d9700..63b7cb050c 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -53,6 +53,7 @@ #include "gtkinvisible.h" #include "gtkbuildable.h" #include "gtkbuilderprivate.h" +#include "gtkextendedlayout.h" #include "gtkalias.h" /** @@ -344,6 +345,14 @@ static void gtk_widget_buildable_custom_finished (GtkBuildable static void gtk_widget_buildable_parser_finished (GtkBuildable *buildable, GtkBuilder *builder); +static void gtk_widget_extended_layout_init (GtkExtendedLayoutIface *iface); +static void gtk_widget_real_get_desired_width (GtkExtendedLayout *layout, + gint *minimum_size, + gint *natural_size); +static void gtk_widget_real_get_desired_height (GtkExtendedLayout *layout, + gint *minimum_size, + gint *natural_size); + static void gtk_widget_queue_tooltip_query (GtkWidget *widget); static void gtk_widget_set_usize_internal (GtkWidget *widget, @@ -367,6 +376,7 @@ static GQuark quark_aux_info = 0; static GQuark quark_accel_path = 0; static GQuark quark_accel_closures = 0; static GQuark quark_event_mask = 0; +static GQuark quark_device_event_mask = 0; static GQuark quark_extension_event_mode = 0; static GQuark quark_parent_window = 0; static GQuark quark_pointer_window = 0; @@ -419,6 +429,13 @@ gtk_widget_get_type (void) NULL /* interface data */ }; + const GInterfaceInfo layout_info = + { + (GInterfaceInitFunc) gtk_widget_extended_layout_init, + (GInterfaceFinalizeFunc) NULL, + NULL /* interface data */ + }; + widget_type = g_type_register_static (GTK_TYPE_OBJECT, "GtkWidget", &widget_info, G_TYPE_FLAG_ABSTRACT); @@ -426,7 +443,8 @@ gtk_widget_get_type (void) &accessibility_info) ; g_type_add_interface_static (widget_type, GTK_TYPE_BUILDABLE, &buildable_info) ; - + g_type_add_interface_static (widget_type, GTK_TYPE_EXTENDED_LAYOUT, + &layout_info) ; } return widget_type; @@ -455,6 +473,7 @@ gtk_widget_class_init (GtkWidgetClass *klass) quark_accel_path = g_quark_from_static_string ("gtk-accel-path"); quark_accel_closures = g_quark_from_static_string ("gtk-accel-closures"); quark_event_mask = g_quark_from_static_string ("gtk-event-mask"); + quark_device_event_mask = g_quark_from_static_string ("gtk-device-event-mask"); quark_extension_event_mode = g_quark_from_static_string ("gtk-extension-event-mode"); quark_parent_window = g_quark_from_static_string ("gtk-parent-window"); quark_pointer_window = g_quark_from_static_string ("gtk-pointer-window"); @@ -523,7 +542,7 @@ gtk_widget_class_init (GtkWidgetClass *klass) klass->unmap_event = NULL; klass->window_state_event = NULL; klass->property_notify_event = _gtk_selection_property_notify; - klass->selection_clear_event = gtk_selection_clear; + klass->selection_clear_event = _gtk_selection_clear; klass->selection_request_event = _gtk_selection_request; klass->selection_notify_event = _gtk_selection_notify; klass->selection_received = NULL; @@ -1559,9 +1578,13 @@ gtk_widget_class_init (GtkWidgetClass *klass) * @widget: the object which received the signal * @event: the #GdkEventAny which triggered this signal * - * The ::unmap-event signal will be emitted when the @widget's window is + * The ::unmap-event signal may be emitted when the @widget's window is * unmapped. A window is unmapped when it becomes invisible on the screen. * + * For performance reasons GTK+ may not emit ::unmap-event, so one + * should always also implement ::unrealize in order to release + * resources and disconnect signal handlers. + * * To receive this signal, the #GdkWindow associated to the widget needs * to enable the #GDK_STRUCTURE_MASK mask. GDK will enable this mask * automatically for all new windows. @@ -2153,8 +2176,8 @@ gtk_widget_class_init (GtkWidgetClass *klass) * @event: the #GdkEventNoExpose which triggered this signal * * The ::no-expose-event will be emitted when the @widget's window is - * drawn as a copy of another #GdkDrawable (with gdk_draw_drawable() or - * gdk_window_copy_area()) which was completely unobscured. If the source + * drawn as a copy of another #GdkDrawable (with gdk_draw_drawable()) + * which was completely unobscured. If the source * window was partially obscured #GdkEventExpose events will be generated * for those areas. * @@ -2836,6 +2859,8 @@ gtk_widget_init (GtkWidget *widget) GTK_PRIVATE_SET_FLAG (widget, GTK_REDRAW_ON_ALLOC); GTK_PRIVATE_SET_FLAG (widget, GTK_REQUEST_NEEDED); + GTK_PRIVATE_SET_FLAG (widget, GTK_WIDTH_REQUEST_NEEDED); + GTK_PRIVATE_SET_FLAG (widget, GTK_HEIGHT_REQUEST_NEEDED); GTK_PRIVATE_SET_FLAG (widget, GTK_ALLOC_NEEDED); widget->style = gtk_widget_get_default_style (); @@ -2983,31 +3008,6 @@ gtk_widget_new (GType type, return widget; } -/** - * gtk_widget_set: - * @widget: a #GtkWidget - * @first_property_name: name of first property to set - * @Varargs: value of first property, followed by more properties, - * %NULL-terminated - * - * Precursor of g_object_set(). - * - * Deprecated: 2.0: Use g_object_set() instead. - **/ -void -gtk_widget_set (GtkWidget *widget, - const gchar *first_property_name, - ...) -{ - va_list var_args; - - g_return_if_fail (GTK_IS_WIDGET (widget)); - - va_start (var_args, first_property_name); - g_object_set_valist (G_OBJECT (widget), first_property_name, var_args); - va_end (var_args); -} - static inline void gtk_widget_queue_draw_child (GtkWidget *widget) { @@ -3523,6 +3523,9 @@ gtk_widget_realize (GtkWidget *widget) mode = gtk_widget_get_extension_events (widget); if (mode != GDK_EXTENSION_EVENTS_NONE) gtk_widget_set_extension_events_internal (widget, mode, NULL); + + if ((GTK_WIDGET_FLAGS (widget) & GTK_MULTIDEVICE) != 0) + gdk_window_set_support_multidevice (widget->window, TRUE); } } @@ -3724,55 +3727,6 @@ gtk_widget_queue_draw (GtkWidget *widget) rect.width, rect.height); } -/* Invalidates the given area (allocation-relative-coordinates) - * in all of the widget's windows - */ -/** - * gtk_widget_queue_clear_area: - * @widget: a #GtkWidget - * @x: x coordinate of upper-left corner of rectangle to redraw - * @y: y coordinate of upper-left corner of rectangle to redraw - * @width: width of region to draw - * @height: height of region to draw - * - * This function is no longer different from - * gtk_widget_queue_draw_area(), though it once was. Now it just calls - * gtk_widget_queue_draw_area(). Originally - * gtk_widget_queue_clear_area() would force a redraw of the - * background for %GTK_NO_WINDOW widgets, and - * gtk_widget_queue_draw_area() would not. Now both functions ensure - * the background will be redrawn. - * - * Deprecated: 2.2: Use gtk_widget_queue_draw_area() instead. - **/ -void -gtk_widget_queue_clear_area (GtkWidget *widget, - gint x, - gint y, - gint width, - gint height) -{ - g_return_if_fail (GTK_IS_WIDGET (widget)); - - gtk_widget_queue_draw_area (widget, x, y, width, height); -} - -/** - * gtk_widget_queue_clear: - * @widget: a #GtkWidget - * - * This function does the same as gtk_widget_queue_draw(). - * - * Deprecated: 2.2: Use gtk_widget_queue_draw() instead. - **/ -void -gtk_widget_queue_clear (GtkWidget *widget) -{ - g_return_if_fail (GTK_IS_WIDGET (widget)); - - gtk_widget_queue_draw (widget); -} - /** * gtk_widget_queue_resize: * @widget: a #GtkWidget @@ -3811,43 +3765,10 @@ gtk_widget_queue_resize_no_redraw (GtkWidget *widget) _gtk_size_group_queue_resize (widget); } -/** - * gtk_widget_draw: - * @widget: a #GtkWidget - * @area: area to draw - * - * In GTK+ 1.2, this function would immediately render the - * region @area of a widget, by invoking the virtual draw method of a - * widget. In GTK+ 2.0, the draw method is gone, and instead - * gtk_widget_draw() simply invalidates the specified region of the - * widget, then updates the invalid region of the widget immediately. - * Usually you don't want to update the region immediately for - * performance reasons, so in general gtk_widget_queue_draw_area() is - * a better choice if you want to draw a region of a widget. - **/ -void -gtk_widget_draw (GtkWidget *widget, - const GdkRectangle *area) -{ - g_return_if_fail (GTK_IS_WIDGET (widget)); - - if (gtk_widget_is_drawable (widget)) - { - if (area) - gtk_widget_queue_draw_area (widget, - area->x, area->y, - area->width, area->height); - else - gtk_widget_queue_draw (widget); - - gdk_window_process_updates (widget->window, TRUE); - } -} - /** * gtk_widget_size_request: * @widget: a #GtkWidget - * @requisition: a #GtkRequisition to be filled in + * @requisition: (out): a #GtkRequisition to be filled in * * This function is typically used when implementing a #GtkContainer * subclass. Obtains the preferred size of a widget. The container @@ -3862,7 +3783,7 @@ gtk_widget_draw (GtkWidget *widget, * Also remember that the size request is not necessarily the size * a widget will actually be allocated. * - * See also gtk_widget_get_child_requisition(). + * Deprecated: 3.0: Use gtk_extended_layout_get_desired_size() instead. **/ void gtk_widget_size_request (GtkWidget *widget, @@ -3872,16 +3793,17 @@ gtk_widget_size_request (GtkWidget *widget, #ifdef G_ENABLE_DEBUG if (requisition == &widget->requisition) - g_warning ("gtk_widget_size_request() called on child widget with request equal\n to widget->requisition. gtk_widget_set_usize() may not work properly."); + g_warning ("gtk_widget_size_request() called on child widget with request equal\n" + "to widget->requisition. gtk_widget_set_usize() may not work properly."); #endif /* G_ENABLE_DEBUG */ - _gtk_size_group_compute_requisition (widget, requisition); + gtk_extended_layout_get_desired_size (GTK_EXTENDED_LAYOUT (widget), FALSE, requisition, NULL); } /** * gtk_widget_get_child_requisition: * @widget: a #GtkWidget - * @requisition: a #GtkRequisition to be filled in + * @requisition: (out): a #GtkRequisition to be filled in * * This function is only for use in widget implementations. Obtains * @widget->requisition, unless someone has forced a particular @@ -3901,12 +3823,15 @@ gtk_widget_size_request (GtkWidget *widget, * since the last time a resize was queued. In general, only container * implementations have this information; applications should use * gtk_widget_size_request(). + * + * + * Deprecated: 3.0: Use gtk_extended_layout_get_desired_size() instead. **/ void gtk_widget_get_child_requisition (GtkWidget *widget, GtkRequisition *requisition) { - _gtk_size_group_get_child_requisition (widget, requisition); + gtk_extended_layout_get_desired_size (GTK_EXTENDED_LAYOUT (widget), FALSE, requisition, NULL); } static gboolean @@ -3984,7 +3909,7 @@ gtk_widget_queue_shallow_draw (GtkWidget *widget) /** * gtk_widget_size_allocate: * @widget: a #GtkWidget - * @allocation: position and size to be allocated to @widget + * @allocation: (inout): position and size to be allocated to @widget * * This function is only used by #GtkContainer subclasses, to assign a size * and position to their child widgets. @@ -4627,7 +4552,7 @@ _gtk_widget_get_accel_path (GtkWidget *widget, apath = g_object_get_qdata (G_OBJECT (widget), quark_accel_path); if (locked) - *locked = apath ? apath->accel_group->lock_count > 0 : TRUE; + *locked = apath ? gtk_accel_group_get_is_locked (apath->accel_group) : TRUE; return apath ? g_quark_to_string (apath->path_quark) : NULL; } @@ -5612,6 +5537,16 @@ gtk_widget_has_default (GtkWidget *widget) return (GTK_OBJECT_FLAGS (widget) & GTK_HAS_DEFAULT) != 0; } +void +_gtk_widget_set_has_default (GtkWidget *widget, + gboolean has_default) +{ + if (has_default) + GTK_OBJECT_FLAGS (widget) |= GTK_HAS_DEFAULT; + else + GTK_OBJECT_FLAGS (widget) &= ~(GTK_HAS_DEFAULT); +} + /** * gtk_widget_grab_default: * @widget: a #GtkWidget @@ -5714,6 +5649,72 @@ gtk_widget_has_grab (GtkWidget *widget) return (GTK_OBJECT_FLAGS (widget) & GTK_HAS_GRAB) != 0; } +void +_gtk_widget_set_has_grab (GtkWidget *widget, + gboolean has_grab) +{ + if (has_grab) + GTK_OBJECT_FLAGS (widget) |= GTK_HAS_GRAB; + else + GTK_OBJECT_FLAGS (widget) &= ~(GTK_HAS_GRAB); +} + +/** + * gtk_widget_device_is_shadowed: + * @widget: a #GtkWidget + * @device: a #GdkDevice + * + * Returns %TRUE if @device has been shadowed by a GTK+ + * device grab on another widget, so it would stop sending + * events to @widget. This may be used in the + * #GtkWidget::grab-notify signal to check for specific + * devices. See gtk_device_grab_add(). + * + * Returns: %TRUE if there is an ongoing grab on @device + * by another #GtkWidget than @widget. + * + * Since: 3.0 + **/ +gboolean +gtk_widget_device_is_shadowed (GtkWidget *widget, + GdkDevice *device) +{ + GtkWindowGroup *group; + GtkWidget *grab_widget, *toplevel; + + g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE); + g_return_val_if_fail (GDK_IS_DEVICE (device), FALSE); + + if (!gtk_widget_get_realized (widget)) + return TRUE; + + toplevel = gtk_widget_get_toplevel (widget); + + if (GTK_IS_WINDOW (toplevel)) + group = gtk_window_get_group (GTK_WINDOW (toplevel)); + else + group = gtk_window_get_group (NULL); + + grab_widget = gtk_window_group_get_current_device_grab (group, device); + + /* Widget not inside the hierarchy of grab_widget */ + if (grab_widget && + widget != grab_widget && + !gtk_widget_is_ancestor (widget, grab_widget)) + return TRUE; + + if (group->grabs) + { + grab_widget = group->grabs->data; + + if (widget != grab_widget && + !gtk_widget_is_ancestor (widget, grab_widget)) + return TRUE; + } + + return FALSE; +} + /** * gtk_widget_set_name: * @widget: a #GtkWidget @@ -5943,6 +5944,16 @@ gtk_widget_is_toplevel (GtkWidget *widget) return (GTK_OBJECT_FLAGS (widget) & GTK_TOPLEVEL) != 0; } +void +_gtk_widget_set_is_toplevel (GtkWidget *widget, + gboolean is_toplevel) +{ + if (is_toplevel) + GTK_OBJECT_FLAGS (widget) |= GTK_TOPLEVEL; + else + GTK_OBJECT_FLAGS (widget) &= ~(GTK_TOPLEVEL); +} + /** * gtk_widget_is_drawable: * @widget: a #GtkWidget @@ -6653,6 +6664,32 @@ gtk_widget_modify_color_component (GtkWidget *widget, gtk_widget_modify_style (widget, rc_style); } +/** + * gtk_widget_modify_symbolic_color: + * @widget: a #GtkWidget + * @name: the name of the symbolic color to modify + * @color: (allow-none): the color to assign (does not need to be allocated), + * or %NULL to undo the effect of previous calls to + * of gtk_widget_modify_symbolic_color(). + * + * Sets a symbolic color for a widget. + * All other style values are left untouched. See also + * gtk_widget_modify_style(). + * + * Since: 3.0 + **/ +void +gtk_widget_modify_symbolic_color (GtkWidget *widget, + const gchar *name, + const GdkColor *color) +{ + GtkRcStyle *rc_style = gtk_widget_get_modifier_style (widget); + + _gtk_rc_style_set_symbolic_color (rc_style, name, color); + + gtk_widget_modify_style (widget, rc_style); +} + /** * gtk_widget_modify_fg: * @widget: a #GtkWidget @@ -7642,13 +7679,7 @@ gtk_widget_get_root_window (GtkWidget *widget) * outside the widget. If returning %TRUE, widgets normally * call gtk_widget_grab_focus() to place the focus accordingly; * if returning %FALSE, they don't modify the current focus location. - * - * This function replaces gtk_container_focus() from GTK+ 1.2. - * It was necessary to check that the child was visible, sensitive, - * and focusable before calling gtk_container_focus(). - * gtk_widget_child_focus() returns %FALSE if the widget is not - * currently in a focusable state, so there's no need for those checks. - * + * * Return value: %TRUE if focus ended up inside @widget **/ gboolean @@ -7769,76 +7800,6 @@ gtk_widget_error_bell (GtkWidget *widget) gdk_window_beep (widget->window); } -/** - * gtk_widget_set_uposition: - * @widget: a #GtkWidget - * @x: x position; -1 to unset x; -2 to leave x unchanged - * @y: y position; -1 to unset y; -2 to leave y unchanged - * - * - * Sets the position of a widget. The funny "u" in the name comes from - * the "user position" hint specified by the X Window System, and - * exists for legacy reasons. This function doesn't work if a widget - * is inside a container; it's only really useful on #GtkWindow. - * - * Don't use this function to center dialogs over the main application - * window; most window managers will do the centering on your behalf - * if you call gtk_window_set_transient_for(), and it's really not - * possible to get the centering to work correctly in all cases from - * application code. But if you insist, use gtk_window_set_position() - * to set #GTK_WIN_POS_CENTER_ON_PARENT, don't do the centering - * manually. - * - * Note that although @x and @y can be individually unset, the position - * is not honoured unless both @x and @y are set. - **/ -void -gtk_widget_set_uposition (GtkWidget *widget, - gint x, - gint y) -{ - /* FIXME this function is the only place that aux_info->x and - * aux_info->y are even used I believe, and this function is - * deprecated. Should be cleaned up. - * - * (Actually, size_allocate uses them) -Yosh - */ - - GtkWidgetAuxInfo *aux_info; - - g_return_if_fail (GTK_IS_WIDGET (widget)); - - aux_info =_gtk_widget_get_aux_info (widget, TRUE); - - if (x > -2) - { - if (x == -1) - aux_info->x_set = FALSE; - else - { - aux_info->x_set = TRUE; - aux_info->x = x; - } - } - - if (y > -2) - { - if (y == -1) - aux_info->y_set = FALSE; - else - { - aux_info->y_set = TRUE; - aux_info->y = y; - } - } - - if (GTK_IS_WINDOW (widget) && aux_info->x_set && aux_info->y_set) - _gtk_window_reposition (GTK_WINDOW (widget), aux_info->x, aux_info->y); - - if (gtk_widget_get_visible (widget) && widget->parent) - gtk_widget_size_allocate (widget, &widget->allocation); -} - static void gtk_widget_set_usize_internal (GtkWidget *widget, gint width, @@ -7870,42 +7831,6 @@ gtk_widget_set_usize_internal (GtkWidget *widget, g_object_thaw_notify (G_OBJECT (widget)); } -/** - * gtk_widget_set_usize: - * @widget: a #GtkWidget - * @width: minimum width, or -1 to unset - * @height: minimum height, or -1 to unset - * - * Sets the minimum size of a widget; that is, the widget's size - * request will be @width by @height. You can use this function to - * force a widget to be either larger or smaller than it is. The - * strange "usize" name dates from the early days of GTK+, and derives - * from X Window System terminology. In many cases, - * gtk_window_set_default_size() is a better choice for toplevel - * windows than this function; setting the default size will still - * allow users to shrink the window. Setting the usize will force them - * to leave the window at least as large as the usize. When dealing - * with window sizes, gtk_window_set_geometry_hints() can be a useful - * function as well. - * - * Note the inherent danger of setting any fixed size - themes, - * translations into other languages, different fonts, and user action - * can all change the appropriate size for a given widget. So, it's - * basically impossible to hardcode a size that will always be - * correct. - * - * Deprecated: 2.2: Use gtk_widget_set_size_request() instead. - **/ -void -gtk_widget_set_usize (GtkWidget *widget, - gint width, - gint height) -{ - g_return_if_fail (GTK_IS_WIDGET (widget)); - - gtk_widget_set_usize_internal (widget, width, height); -} - /** * gtk_widget_set_size_request: * @widget: a #GtkWidget @@ -8020,10 +7945,53 @@ gtk_widget_set_events (GtkWidget *widget, g_object_notify (G_OBJECT (widget), "events"); } +/** + * gtk_widget_set_device_events: + * @widget: a #GtkWidget + * @device: a #GdkDevice + * @events: event mask + * + * Sets the device event mask (see #GdkEventMask) for a widget. The event + * mask determines which events a widget will receive from @device. Keep + * in mind that different widgets have different default event masks, and by + * changing the event mask you may disrupt a widget's functionality, + * so be careful. This function must be called while a widget is + * unrealized. Consider gtk_widget_add_device_events() for widgets that are + * already realized, or if you want to preserve the existing event + * mask. This function can't be used with #GTK_NO_WINDOW widgets; + * to get events on those widgets, place them inside a #GtkEventBox + * and receive events on the event box. + * + * Since: 3.0 + **/ +void +gtk_widget_set_device_events (GtkWidget *widget, + GdkDevice *device, + GdkEventMask events) +{ + GHashTable *device_events; + + g_return_if_fail (GTK_IS_WIDGET (widget)); + g_return_if_fail (GDK_IS_DEVICE (device)); + g_return_if_fail (!gtk_widget_get_realized (widget)); + + device_events = g_object_get_qdata (G_OBJECT (widget), quark_device_event_mask); + + if (G_UNLIKELY (!device_events)) + { + device_events = g_hash_table_new (NULL, NULL); + g_object_set_qdata_full (G_OBJECT (widget), quark_device_event_mask, device_events, + (GDestroyNotify) g_hash_table_unref); + } + + g_hash_table_insert (device_events, device, GUINT_TO_POINTER (events)); +} + static void gtk_widget_add_events_internal (GtkWidget *widget, - gint events, - GList *window_list) + GdkDevice *device, + gint events, + GList *window_list) { GList *l; @@ -8034,15 +8002,18 @@ gtk_widget_add_events_internal (GtkWidget *widget, gdk_window_get_user_data (window, &user_data); if (user_data == widget) - { - GList *children; + { + GList *children; - gdk_window_set_events (window, gdk_window_get_events (window) | events); + if (device) + gdk_window_set_device_events (window, device, gdk_window_get_events (window) | events); + else + gdk_window_set_events (window, gdk_window_get_events (window) | events); - children = gdk_window_get_children (window); - gtk_widget_add_events_internal (widget, events, children); - g_list_free (children); - } + children = gdk_window_get_children (window); + gtk_widget_add_events_internal (widget, device, events, children); + g_list_free (children); + } } } @@ -8075,7 +8046,60 @@ gtk_widget_add_events (GtkWidget *widget, else window_list = g_list_prepend (NULL, widget->window); - gtk_widget_add_events_internal (widget, events, window_list); + gtk_widget_add_events_internal (widget, NULL, events, window_list); + + g_list_free (window_list); + } + + g_object_notify (G_OBJECT (widget), "events"); +} + +/** + * gtk_widget_add_device_events: + * @widget: a #GtkWidget + * @device: a #GdkDevice + * @events: an event mask, see #GdkEventMask + * + * Adds the device events in the bitfield @events to the event mask for + * @widget. See gtk_widget_set_device_events() for details. + * + * Since: 3.0 + **/ +void +gtk_widget_add_device_events (GtkWidget *widget, + GdkDevice *device, + GdkEventMask events) +{ + GdkEventMask old_events; + GHashTable *device_events; + + g_return_if_fail (GTK_IS_WIDGET (widget)); + g_return_if_fail (GDK_IS_DEVICE (device)); + + old_events = gtk_widget_get_device_events (widget, device); + + device_events = g_object_get_qdata (G_OBJECT (widget), quark_device_event_mask); + + if (G_UNLIKELY (!device_events)) + { + device_events = g_hash_table_new (NULL, NULL); + g_object_set_qdata_full (G_OBJECT (widget), quark_device_event_mask, device_events, + (GDestroyNotify) g_hash_table_unref); + } + + g_hash_table_insert (device_events, device, + GUINT_TO_POINTER (old_events | events)); + + if (gtk_widget_get_realized (widget)) + { + GList *window_list; + + if (!gtk_widget_get_has_window (widget)) + window_list = gdk_window_get_children (widget->window); + else + window_list = g_list_prepend (NULL, widget->window); + + gtk_widget_add_events_internal (widget, device, events, window_list); g_list_free (window_list); } @@ -8299,6 +8323,35 @@ gtk_widget_get_events (GtkWidget *widget) return GPOINTER_TO_INT (g_object_get_qdata (G_OBJECT (widget), quark_event_mask)); } +/** + * gtk_widget_get_device_events: + * @widget: a #GtkWidget + * @device: a #GdkDevice + * + * Returns the events mask for the widget corresponding to an specific device. These + * are the events that the widget will receive when @device operates on it. + * + * Returns: device event mask for @widget + * + * Since: 3.0 + **/ +GdkEventMask +gtk_widget_get_device_events (GtkWidget *widget, + GdkDevice *device) +{ + GHashTable *device_events; + + g_return_val_if_fail (GTK_IS_WIDGET (widget), 0); + g_return_val_if_fail (GDK_IS_DEVICE (device), 0); + + device_events = g_object_get_qdata (G_OBJECT (widget), quark_device_event_mask); + + if (!device_events) + return 0; + + return GPOINTER_TO_UINT (g_hash_table_lookup (device_events, device)); +} + /** * gtk_widget_get_extension_events: * @widget: a #GtkWidget @@ -8885,59 +8938,147 @@ _gtk_widget_peek_colormap (void) } /* - * _gtk_widget_set_pointer_window: + * _gtk_widget_set_device_window: * @widget: a #GtkWidget. - * @pointer_window: the new pointer window. + * @device: a #GdkDevice. + * @window: the new device window. * - * Sets pointer window for @widget. Does not ref @pointer_window. + * Sets pointer window for @widget and @device. Does not ref @window. * Actually stores it on the #GdkScreen, but you don't need to know that. */ void -_gtk_widget_set_pointer_window (GtkWidget *widget, - GdkWindow *pointer_window) +_gtk_widget_set_device_window (GtkWidget *widget, + GdkDevice *device, + GdkWindow *window) { + GdkScreen *screen; + GHashTable *device_window; + g_return_if_fail (GTK_IS_WIDGET (widget)); + g_return_if_fail (GDK_IS_DEVICE (device)); + g_return_if_fail (!window || GDK_IS_WINDOW (window)); - if (gtk_widget_get_realized (widget)) + if (!gtk_widget_get_realized (widget)) + return; + + screen = gdk_drawable_get_screen (widget->window); + device_window = g_object_get_qdata (G_OBJECT (screen), quark_pointer_window); + + if (G_UNLIKELY (!device_window)) { - GdkScreen *screen = gdk_drawable_get_screen (widget->window); - - g_object_set_qdata (G_OBJECT (screen), quark_pointer_window, - pointer_window); + device_window = g_hash_table_new (NULL, NULL); + g_object_set_qdata_full (G_OBJECT (screen), + quark_pointer_window, + device_window, + (GDestroyNotify) g_hash_table_destroy); } + + if (window) + g_hash_table_insert (device_window, device, window); + else + g_hash_table_remove (device_window, device); } /* - * _gtk_widget_get_pointer_window: + * _gtk_widget_get_device_window: * @widget: a #GtkWidget. + * @device: a #GdkDevice. * - * Return value: the pointer window set on the #GdkScreen @widget is attached + * Return value: the device window set on the #GdkScreen @widget is attached * to, or %NULL. */ GdkWindow * -_gtk_widget_get_pointer_window (GtkWidget *widget) +_gtk_widget_get_device_window (GtkWidget *widget, + GdkDevice *device) { + GdkScreen *screen; + GHashTable *device_window; + GdkWindow *window; + GtkWidget *w; + + g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); + g_return_val_if_fail (GDK_IS_DEVICE (device), NULL); + + if (!gtk_widget_get_realized (widget)) + return NULL; + + screen = gdk_drawable_get_screen (widget->window); + device_window = g_object_get_qdata (G_OBJECT (screen), quark_pointer_window); + + if (G_UNLIKELY (!device_window)) + return NULL; + + window = g_hash_table_lookup (device_window, device); + + if (!window) + return NULL; + + gdk_window_get_user_data (window, (gpointer *) &w); + + if (widget != w) + return NULL; + + return window; +} + +/* + * _gtk_widget_list_devices: + * @widget: a #GtkWidget. + * + * Returns the list of #GdkDevices that is currently on top of any widget #GdkWindow. + * Free the list with g_list_free(), the elements are owned by GTK+ and must not + * be freed. + */ +GList * +_gtk_widget_list_devices (GtkWidget *widget) +{ + GdkScreen *screen; + GHashTableIter iter; + GHashTable *device_window; + GList *devices = NULL; + gpointer key, value; + g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); - if (gtk_widget_get_realized (widget)) - { - GdkScreen *screen = gdk_drawable_get_screen (widget->window); + if (!gtk_widget_get_realized (widget)) + return NULL; - return g_object_get_qdata (G_OBJECT (screen), quark_pointer_window); + screen = gdk_drawable_get_screen (widget->window); + device_window = g_object_get_qdata (G_OBJECT (screen), quark_pointer_window); + + if (G_UNLIKELY (!device_window)) + return NULL; + + g_hash_table_iter_init (&iter, device_window); + + while (g_hash_table_iter_next (&iter, &key, &value)) + { + GdkDevice *device = key; + GdkWindow *window = value; + GtkWidget *w; + + if (window) + { + gdk_window_get_user_data (window, (gpointer *) &w); + + if (widget == w) + devices = g_list_prepend (devices, device); + } } - return NULL; + return devices; } static void -synth_crossing (GtkWidget *widget, - GdkEventType type, - GdkWindow *window, - GdkCrossingMode mode, - GdkNotifyType detail) +synth_crossing (GtkWidget *widget, + GdkEventType type, + GdkWindow *window, + GdkDevice *device, + GdkCrossingMode mode, + GdkNotifyType detail) { GdkEvent *event; - + event = gdk_event_new (type); event->crossing.window = g_object_ref (window); @@ -8950,6 +9091,7 @@ synth_crossing (GtkWidget *widget, event->crossing.detail = detail; event->crossing.focus = FALSE; event->crossing.state = 0; + gdk_event_set_device (event, device); if (!widget) widget = gtk_get_event_widget (event); @@ -8960,32 +9102,6 @@ synth_crossing (GtkWidget *widget, gdk_event_free (event); } -/* - * _gtk_widget_is_pointer_widget: - * @widget: a #GtkWidget - * - * Returns %TRUE if the pointer window belongs to @widget. - */ -gboolean -_gtk_widget_is_pointer_widget (GtkWidget *widget) -{ - if (GTK_WIDGET_HAS_POINTER (widget)) - { - GdkWindow *win; - GtkWidget *wid; - - win = _gtk_widget_get_pointer_window (widget); - if (win) - { - gdk_window_get_user_data (win, (gpointer *)&wid); - if (wid == widget) - return TRUE; - } - } - - return FALSE; -} - /* * _gtk_widget_synthesize_crossing: * @from: the #GtkWidget the virtual pointer is leaving. @@ -9018,20 +9134,30 @@ _gtk_widget_is_pointer_widget (GtkWidget *widget) * - enter notify on real pointer window, detail Ancestor */ void -_gtk_widget_synthesize_crossing (GtkWidget *from, - GtkWidget *to, - GdkCrossingMode mode) +_gtk_widget_synthesize_crossing (GtkWidget *from, + GtkWidget *to, + GdkDevice *device, + GdkCrossingMode mode) { GdkWindow *from_window = NULL, *to_window = NULL; g_return_if_fail (from != NULL || to != NULL); if (from != NULL) - from_window = GTK_WIDGET_HAS_POINTER (from) - ? _gtk_widget_get_pointer_window (from) : from->window; + { + from_window = _gtk_widget_get_device_window (from, device); + + if (!from_window) + from_window = from->window; + } + if (to != NULL) - to_window = GTK_WIDGET_HAS_POINTER (to) - ? _gtk_widget_get_pointer_window (to) : to->window; + { + to_window = _gtk_widget_get_device_window (to, device); + + if (!to_window) + to_window = to->window; + } if (from_window == NULL && to_window == NULL) ; @@ -9049,11 +9175,11 @@ _gtk_widget_synthesize_crossing (GtkWidget *from, } synth_crossing (from, GDK_LEAVE_NOTIFY, from_window, - mode, GDK_NOTIFY_ANCESTOR); + device, mode, GDK_NOTIFY_ANCESTOR); for (list = g_list_last (from_ancestors); list; list = list->prev) { synth_crossing (NULL, GDK_LEAVE_NOTIFY, (GdkWindow *) list->data, - mode, GDK_NOTIFY_VIRTUAL); + device, mode, GDK_NOTIFY_VIRTUAL); } /* XXX: enter/inferior on root window? */ @@ -9078,10 +9204,10 @@ _gtk_widget_synthesize_crossing (GtkWidget *from, for (list = to_ancestors; list; list = list->next) { synth_crossing (NULL, GDK_ENTER_NOTIFY, (GdkWindow *) list->data, - mode, GDK_NOTIFY_VIRTUAL); + device, mode, GDK_NOTIFY_VIRTUAL); } synth_crossing (to, GDK_ENTER_NOTIFY, to_window, - mode, GDK_NOTIFY_ANCESTOR); + device, mode, GDK_NOTIFY_ANCESTOR); g_list_free (to_ancestors); } @@ -9115,25 +9241,25 @@ _gtk_widget_synthesize_crossing (GtkWidget *from, { if (mode != GDK_CROSSING_GTK_UNGRAB) synth_crossing (from, GDK_LEAVE_NOTIFY, from_window, - mode, GDK_NOTIFY_INFERIOR); + device, mode, GDK_NOTIFY_INFERIOR); for (list = to_ancestors; list; list = list->next) synth_crossing (NULL, GDK_ENTER_NOTIFY, (GdkWindow *) list->data, - mode, GDK_NOTIFY_VIRTUAL); + device, mode, GDK_NOTIFY_VIRTUAL); synth_crossing (to, GDK_ENTER_NOTIFY, to_window, - mode, GDK_NOTIFY_ANCESTOR); + device, mode, GDK_NOTIFY_ANCESTOR); } else if (from_ancestor == to_window) { synth_crossing (from, GDK_LEAVE_NOTIFY, from_window, - mode, GDK_NOTIFY_ANCESTOR); + device, mode, GDK_NOTIFY_ANCESTOR); for (list = g_list_last (from_ancestors); list; list = list->prev) { synth_crossing (NULL, GDK_LEAVE_NOTIFY, (GdkWindow *) list->data, - mode, GDK_NOTIFY_VIRTUAL); + device, mode, GDK_NOTIFY_VIRTUAL); } if (mode != GDK_CROSSING_GTK_GRAB) synth_crossing (to, GDK_ENTER_NOTIFY, to_window, - mode, GDK_NOTIFY_INFERIOR); + device, mode, GDK_NOTIFY_INFERIOR); } else { @@ -9146,20 +9272,20 @@ _gtk_widget_synthesize_crossing (GtkWidget *from, } synth_crossing (from, GDK_LEAVE_NOTIFY, from_window, - mode, GDK_NOTIFY_NONLINEAR); + device, mode, GDK_NOTIFY_NONLINEAR); for (list = g_list_last (from_ancestors); list; list = list->prev) { synth_crossing (NULL, GDK_LEAVE_NOTIFY, (GdkWindow *) list->data, - mode, GDK_NOTIFY_NONLINEAR_VIRTUAL); + device, mode, GDK_NOTIFY_NONLINEAR_VIRTUAL); } for (list = to_ancestors; list; list = list->next) { synth_crossing (NULL, GDK_ENTER_NOTIFY, (GdkWindow *) list->data, - mode, GDK_NOTIFY_NONLINEAR_VIRTUAL); + device, mode, GDK_NOTIFY_NONLINEAR_VIRTUAL); } synth_crossing (to, GDK_ENTER_NOTIFY, to_window, - mode, GDK_NOTIFY_NONLINEAR); + device, mode, GDK_NOTIFY_NONLINEAR); } g_list_free (from_ancestors); g_list_free (to_ancestors); @@ -9221,15 +9347,41 @@ gtk_widget_propagate_state (GtkWidget *widget, g_signal_emit (widget, widget_signals[STATE_CHANGED], 0, old_state); - if (GTK_WIDGET_HAS_POINTER (widget) && !GTK_WIDGET_SHADOWED (widget)) - { - if (!gtk_widget_is_sensitive (widget)) - _gtk_widget_synthesize_crossing (widget, NULL, - GDK_CROSSING_STATE_CHANGED); - else if (old_state == GTK_STATE_INSENSITIVE) - _gtk_widget_synthesize_crossing (NULL, widget, - GDK_CROSSING_STATE_CHANGED); - } + if (!GTK_WIDGET_SHADOWED (widget)) + { + GList *event_windows = NULL; + GList *devices, *d; + + devices = _gtk_widget_list_devices (widget); + + for (d = devices; d; d = d->next) + { + GdkWindow *window; + GdkDevice *device; + + device = d->data; + window = _gtk_widget_get_device_window (widget, device); + + /* Do not propagate more than once to the + * same window if non-multidevice aware. + */ + if (!gdk_window_get_support_multidevice (window) && + g_list_find (event_windows, window)) + continue; + + if (!gtk_widget_is_sensitive (widget)) + _gtk_widget_synthesize_crossing (widget, NULL, d->data, + GDK_CROSSING_STATE_CHANGED); + else if (old_state == GTK_STATE_INSENSITIVE) + _gtk_widget_synthesize_crossing (NULL, widget, d->data, + GDK_CROSSING_STATE_CHANGED); + + event_windows = g_list_prepend (event_windows, window); + } + + g_list_free (event_windows); + g_list_free (devices); + } if (GTK_IS_CONTAINER (widget)) { @@ -9266,20 +9418,18 @@ _gtk_widget_get_aux_info (GtkWidget *widget, aux_info = g_object_get_qdata (G_OBJECT (widget), quark_aux_info); if (!aux_info && create) { - aux_info = g_slice_new (GtkWidgetAuxInfo); + aux_info = g_slice_new0 (GtkWidgetAuxInfo); aux_info->width = -1; aux_info->height = -1; - aux_info->x = 0; - aux_info->y = 0; - aux_info->x_set = FALSE; - aux_info->y_set = FALSE; + g_object_set_qdata (G_OBJECT (widget), quark_aux_info, aux_info); } return aux_info; } + /***************************************** * gtk_widget_aux_info_destroy: * @@ -9439,43 +9589,6 @@ gtk_widget_reset_shapes (GtkWidget *widget) gtk_reset_shapes_recurse (widget, widget->window); } -/** - * gtk_widget_ref: - * @widget: a #GtkWidget - * - * Adds a reference to a widget. This function is exactly the same - * as calling g_object_ref(), and exists mostly for historical - * reasons. It can still be convenient to avoid casting a widget - * to a #GObject, it saves a small amount of typing. - * - * Return value: the widget that was referenced - * - * Deprecated: 2.12: Use g_object_ref() instead. - **/ -GtkWidget* -gtk_widget_ref (GtkWidget *widget) -{ - g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); - - return (GtkWidget*) g_object_ref ((GObject*) widget); -} - -/** - * gtk_widget_unref: - * @widget: a #GtkWidget - * - * Inverse of gtk_widget_ref(). Equivalent to g_object_unref(). - * - * Deprecated: 2.12: Use g_object_unref() instead. - **/ -void -gtk_widget_unref (GtkWidget *widget) -{ - g_return_if_fail (GTK_IS_WIDGET (widget)); - - g_object_unref ((GObject*) widget); -} - static void expose_window (GdkWindow *window) { @@ -10125,13 +10238,13 @@ gtk_requisition_get_type (void) * @widget: a #GtkWidget * * Returns the accessible object that describes the widget to an - * assistive technology. - * - * If no accessibility library is loaded (i.e. no ATK implementation library is - * loaded via GTK_MODULES or via another application library, - * such as libgnome), then this #AtkObject instance may be a no-op. Likewise, - * if no class-specific #AtkObject implementation is available for the widget - * instance in question, it will inherit an #AtkObject implementation from the + * assistive technology. + * + * If no accessibility library is loaded (i.e. no ATK implementation library is + * loaded via GTK_MODULES or via another application library, + * such as libgnome), then this #AtkObject instance may be a no-op. Likewise, + * if no class-specific #AtkObject implementation is available for the widget + * instance in question, it will inherit an #AtkObject implementation from the * first ancestor class for which such an implementation is defined. * * The documentation of the ATK @@ -10712,7 +10825,67 @@ gtk_widget_buildable_custom_finished (GtkBuildable *buildable, } } +/* + * GtkExtendedLayout implementation + */ +static void +gtk_widget_real_get_desired_width (GtkExtendedLayout *layout, + gint *minimum_size, + gint *natural_size) +{ + /* Set the initial values so that unimplemented classes will fall back + * on the "size-request" collected values (see gtksizegroup.c:do_size_request()). + */ + if (minimum_size) + *minimum_size = GTK_WIDGET (layout)->requisition.width; + if (natural_size) + *natural_size = GTK_WIDGET (layout)->requisition.width; +} + +static void +gtk_widget_real_get_desired_height (GtkExtendedLayout *layout, + gint *minimum_size, + gint *natural_size) +{ + /* Set the initial values so that unimplemented classes will fall back + * on the "size-request" collected values (see gtksizegroup.c:do_size_request()). + */ + if (minimum_size) + *minimum_size = GTK_WIDGET (layout)->requisition.height; + + if (natural_size) + *natural_size = GTK_WIDGET (layout)->requisition.height; +} + +static void +gtk_widget_real_get_height_for_width (GtkExtendedLayout *layout, + gint width, + gint *minimum_height, + gint *natural_height) +{ + gtk_extended_layout_get_desired_height (layout, minimum_height, natural_height); +} + +static void +gtk_widget_real_get_width_for_height (GtkExtendedLayout *layout, + gint height, + gint *minimum_width, + gint *natural_width) +{ + gtk_extended_layout_get_desired_width (layout, minimum_width, natural_width); +} + +static void +gtk_widget_extended_layout_init (GtkExtendedLayoutIface *iface) +{ + iface->get_desired_width = gtk_widget_real_get_desired_width; + iface->get_desired_height = gtk_widget_real_get_desired_height; + iface->get_width_for_height = gtk_widget_real_get_width_for_height; + iface->get_height_for_width = gtk_widget_real_get_height_for_width; +} + + /** * gtk_widget_get_clipboard: * @widget: a #GtkWidget @@ -10739,7 +10912,7 @@ gtk_widget_get_clipboard (GtkWidget *widget, GdkAtom selection) { g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); g_return_val_if_fail (gtk_widget_has_screen (widget), NULL); - + return gtk_clipboard_get_for_display (gtk_widget_get_display (widget), selection); } @@ -10747,9 +10920,9 @@ gtk_widget_get_clipboard (GtkWidget *widget, GdkAtom selection) /** * gtk_widget_list_mnemonic_labels: * @widget: a #GtkWidget - * - * Returns a newly allocated list of the widgets, normally labels, for - * which this widget is a the target of a mnemonic (see for example, + * + * Returns a newly allocated list of the widgets, normally labels, for + * which this widget is the target of a mnemonic (see for example, * gtk_label_set_mnemonic_widget()). * The widgets in the list are not individually referenced. If you @@ -11272,7 +11445,7 @@ gtk_widget_set_window (GtkWidget *widget, * * Returns the widget's window if it is realized, %NULL otherwise * - * Return value: @widget's window. + * Return value: (transfer none): @widget's window. * * Since: 2.14 */ @@ -11284,5 +11457,121 @@ gtk_widget_get_window (GtkWidget *widget) return widget->window; } +/** + * gtk_widget_get_support_multidevice: + * @widget: a #GtkWidget + * + * Returns %TRUE if @widget is multiple pointer aware. See + * gtk_widget_set_support_multidevice() for more information. + * + * Returns: %TRUE is @widget is multidevice aware. + **/ +gboolean +gtk_widget_get_support_multidevice (GtkWidget *widget) +{ + g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE); + + return GTK_WIDGET_FLAGS (widget) & GTK_MULTIDEVICE; +} + +/** + * gtk_widget_set_support_multidevice: + * @widget: a #GtkWidget + * @support_multidevice: %TRUE to support input from multiple devices. + * + * Enables or disables multiple pointer awareness. If this setting is %TRUE, + * @widget will start receiving multiple, per device enter/leave events. Note + * that if custom #GdkWindows are created in #GtkWidget::realize, + * gdk_window_set_support_multidevice() will have to be called manually on them. + * + * Since: 3.0 + **/ +void +gtk_widget_set_support_multidevice (GtkWidget *widget, + gboolean support_multidevice) +{ + g_return_if_fail (GTK_IS_WIDGET (widget)); + + if (support_multidevice) + { + GTK_WIDGET_SET_FLAGS (widget, GTK_MULTIDEVICE); + gtk_widget_set_extension_events (widget, GDK_EXTENSION_EVENTS_ALL); + } + else + { + GTK_WIDGET_UNSET_FLAGS (widget, GTK_MULTIDEVICE); + gtk_widget_set_extension_events (widget, GDK_EXTENSION_EVENTS_NONE); + } + + if (gtk_widget_get_realized (widget)) + gdk_window_set_support_multidevice (widget->window, support_multidevice); +} + +static void +_gtk_widget_set_has_focus (GtkWidget *widget, + gboolean has_focus) +{ + if (has_focus) + GTK_OBJECT_FLAGS (widget) |= GTK_HAS_FOCUS; + else + GTK_OBJECT_FLAGS (widget) &= ~(GTK_HAS_FOCUS); +} + +/** + * gtk_widget_send_focus_change: + * @widget: a #GtkWidget + * @event: a #GdkEvent of type GDK_FOCUS_CHANGE + * + * Sends the focus change @event to @widget + * + * This function is not meant to be used by applications. The only time it + * should be used is when it is necessary for a #GtkWidget to assign focus + * to a widget that is semantically owned by the first widget even though + * it's not a direct child - for instance, a search entry in a floating + * window similar to the quick search in #GtkTreeView. + * + * An example of its usage is: + * + * |[ + * GdkEvent *fevent = gdk_event_new (GDK_FOCUS_CHANGE); + * + * fevent->focus_change.type = GDK_FOCUS_CHANGE; + * fevent->focus_change.in = TRUE; + * fevent->focus_change.window = gtk_widget_get_window (widget); + * if (fevent->focus_change.window != NULL) + * g_object_ref (fevent->focus_change.window); + * + * gtk_widget_send_focus_change (widget, fevent); + * + * gdk_event_free (event); + * ]| + * + * Return value: the return value from the event signal emission: %TRUE + * if the event was handled, and %FALSE otherwise + * + * Since: 2.20 + */ +gboolean +gtk_widget_send_focus_change (GtkWidget *widget, + GdkEvent *event) +{ + gboolean res; + + g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE); + g_return_val_if_fail (event != NULL && event->type == GDK_FOCUS_CHANGE, FALSE); + + g_object_ref (widget); + + _gtk_widget_set_has_focus (widget, event->focus_change.in); + + res = gtk_widget_event (widget, event); + + g_object_notify (G_OBJECT (widget), "has-focus"); + + g_object_unref (widget); + + return res; +} + #define __GTK_WIDGET_C__ #include "gtkaliasdef.c" diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h index 132079937e..92f6fe147f 100644 --- a/gtk/gtkwidget.h +++ b/gtk/gtkwidget.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -81,7 +81,6 @@ G_BEGIN_DECLS * defined through the rc mechanism. * @GTK_COMPOSITE_CHILD: Indicates that the widget is a composite child of its parent; see * gtk_widget_push_composite_child(), gtk_widget_pop_composite_child(). - * @GTK_NO_REPARENT: Unused since before GTK+ 1.2, will be removed in a future version. * @GTK_APP_PAINTABLE: Set and unset by gtk_widget_set_app_paintable(). * Must be set on widgets whose window the application directly draws on, * in order to keep GTK+ from overwriting the drawn stuff. See @@ -114,11 +113,11 @@ typedef enum GTK_HAS_GRAB = 1 << 15, GTK_RC_STYLE = 1 << 16, GTK_COMPOSITE_CHILD = 1 << 17, - GTK_NO_REPARENT = 1 << 18, - GTK_APP_PAINTABLE = 1 << 19, - GTK_RECEIVES_DEFAULT = 1 << 20, - GTK_DOUBLE_BUFFERED = 1 << 21, - GTK_NO_SHOW_ALL = 1 << 22 + GTK_APP_PAINTABLE = 1 << 18, + GTK_RECEIVES_DEFAULT = 1 << 19, + GTK_DOUBLE_BUFFERED = 1 << 20, + GTK_NO_SHOW_ALL = 1 << 21, + GTK_MULTIDEVICE = 1 << 22 } GtkWidgetFlags; /* Kinds of widget-specific help */ @@ -138,49 +137,6 @@ typedef enum #define GTK_IS_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_WIDGET)) #define GTK_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_WIDGET, GtkWidgetClass)) -/* Macros for extracting various fields from GtkWidget and GtkWidgetClass. - */ -#ifndef GTK_DISABLE_DEPRECATED -/** - * GTK_WIDGET_TYPE: - * @wid: a #GtkWidget. - * - * Gets the type of a widget. - * - * Deprecated: 2.20: Use G_OBJECT_TYPE() instead. - */ -#define GTK_WIDGET_TYPE(wid) (GTK_OBJECT_TYPE (wid)) -#endif - -#ifndef GTK_DISABLE_DEPRECATED -/** - * GTK_WIDGET_STATE: - * @wid: a #GtkWidget. - * - * Returns the current state of the widget, as a #GtkStateType. - * - * Deprecated: 2.20: Use gtk_widget_get_state() instead. - */ -#define GTK_WIDGET_STATE(wid) (GTK_WIDGET (wid)->state) -#endif - -#ifndef GTK_DISABLE_DEPRECATED -/** - * GTK_WIDGET_SAVED_STATE: - * @wid: a #GtkWidget. - * - * Returns the saved state of the widget, as a #GtkStateType. - * - * The saved state will be restored when a widget gets sensitive - * again, after it has been made insensitive with gtk_widget_set_state() - * or gtk_widget_set_sensitive(). - * - * Deprecated: 2.20: Do not used it. - */ -#define GTK_WIDGET_SAVED_STATE(wid) (GTK_WIDGET (wid)->saved_state) -#endif - - /* Macros for extracting the widget flags from GtkWidget. */ /** @@ -202,241 +158,6 @@ typedef enum #define GTK_WIDGET_FLAGS(wid) (GTK_OBJECT_FLAGS (wid)) /* FIXME: Deprecating GTK_WIDGET_FLAGS requires fixing GTK internals. */ -#ifndef GTK_DISABLE_DEPRECATED -/** - * GTK_WIDGET_TOPLEVEL: - * @wid: a #GtkWidget. - * - * Evaluates to %TRUE if the widget is a toplevel widget. - * - * Deprecated: 2.20: Use gtk_widget_is_toplevel() instead. - */ -#define GTK_WIDGET_TOPLEVEL(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_TOPLEVEL) != 0) -#endif - -#ifndef GTK_DISABLE_DEPRECATED -/** - * GTK_WIDGET_NO_WINDOW: - * @wid: a #GtkWidget. - * - * Evaluates to %TRUE if the widget doesn't have an own #GdkWindow. - * - * Deprecated: 2.20: Use gtk_widget_get_has_window() instead. - */ -#define GTK_WIDGET_NO_WINDOW(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_NO_WINDOW) != 0) -#endif - -#ifndef GTK_DISABLE_DEPRECATED -/** - * GTK_WIDGET_REALIZED: - * @wid: a #GtkWidget. - * - * Evaluates to %TRUE if the widget is realized. - * - * Deprecated: 2.20: Use gtk_widget_get_realized() instead. - */ -#define GTK_WIDGET_REALIZED(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_REALIZED) != 0) -#endif - -#ifndef GTK_DISABLE_DEPRECATED -/** - * GTK_WIDGET_MAPPED: - * @wid: a #GtkWidget. - * - * Evaluates to %TRUE if the widget is mapped. - * - * Deprecated: 2.20: Use gtk_widget_get_mapped() instead. - */ -#define GTK_WIDGET_MAPPED(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_MAPPED) != 0) -#endif - -#ifndef GTK_DISABLE_DEPRECATED -/** - * GTK_WIDGET_VISIBLE: - * @wid: a #GtkWidget. - * - * Evaluates to %TRUE if the widget is visible. - * - * Deprecated: 2.20: Use gtk_widget_get_visible() instead. - */ -#define GTK_WIDGET_VISIBLE(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_VISIBLE) != 0) -#endif - -#ifndef GTK_DISABLE_DEPRECATED -/** - * GTK_WIDGET_DRAWABLE: - * @wid: a #GtkWidget. - * - * Evaluates to %TRUE if the widget is mapped and visible. - * - * Deprecated: 2.20: Use gtk_widget_is_drawable() instead. - */ -#define GTK_WIDGET_DRAWABLE(wid) (GTK_WIDGET_VISIBLE (wid) && GTK_WIDGET_MAPPED (wid)) -#endif - -#ifndef GTK_DISABLE_DEPRECATED -/** - * GTK_WIDGET_SENSITIVE: - * @wid: a #GtkWidget. - * - * Evaluates to %TRUE if the #GTK_SENSITIVE flag has be set on the widget. - * - * Deprecated: 2.20: Use gtk_widget_get_sensitive() instead. - */ -#define GTK_WIDGET_SENSITIVE(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_SENSITIVE) != 0) -#endif - -#ifndef GTK_DISABLE_DEPRECATED -/** - * GTK_WIDGET_PARENT_SENSITIVE: - * @wid: a #GtkWidget. - * - * Evaluates to %TRUE if the #GTK_PARENT_SENSITIVE flag has be set on the widget. - * - * Deprecated: 2.20: Use gtk_widget_get_sensitive() on the parent widget instead. - */ -#define GTK_WIDGET_PARENT_SENSITIVE(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_PARENT_SENSITIVE) != 0) -#endif - -#ifndef GTK_DISABLE_DEPRECATED -/** - * GTK_WIDGET_IS_SENSITIVE: - * @wid: a #GtkWidget. - * - * Evaluates to %TRUE if the widget is effectively sensitive. - * - * Deprecated: 2.20: Use gtk_widget_is_sensitive() instead. - */ -#define GTK_WIDGET_IS_SENSITIVE(wid) (GTK_WIDGET_SENSITIVE (wid) && \ - GTK_WIDGET_PARENT_SENSITIVE (wid)) -#endif - -#ifndef GTK_DISABLE_DEPRECATED -/** - * GTK_WIDGET_CAN_FOCUS: - * @wid: a #GtkWidget. - * - * Evaluates to %TRUE if the widget is able to handle focus grabs. - * - * Deprecated: 2.20: Use gtk_widget_get_can_focus() instead. - */ -#define GTK_WIDGET_CAN_FOCUS(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_CAN_FOCUS) != 0) -#endif - -#ifndef GTK_DISABLE_DEPRECATED -/** - * GTK_WIDGET_HAS_FOCUS: - * @wid: a #GtkWidget. - * - * Evaluates to %TRUE if the widget has grabbed the focus and no other - * widget has done so more recently. - * - * Deprecated: 2.20: Use gtk_widget_has_focus() instead. - */ -#define GTK_WIDGET_HAS_FOCUS(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_HAS_FOCUS) != 0) -#endif - -#ifndef GTK_DISABLE_DEPRECATED -/** - * GTK_WIDGET_CAN_DEFAULT: - * @wid: a #GtkWidget. - * - * Evaluates to %TRUE if the widget is allowed to receive the default action - * via gtk_widget_grab_default(). - * - * Deprecated: 2.20: Use gtk_widget_get_can_default() instead. - */ -#define GTK_WIDGET_CAN_DEFAULT(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_CAN_DEFAULT) != 0) -#endif - -#ifndef GTK_DISABLE_DEPRECATED -/** - * GTK_WIDGET_HAS_DEFAULT: - * @wid: a #GtkWidget. - * - * Evaluates to %TRUE if the widget currently is receiving the default action. - * - * Deprecated: 2.20: Use gtk_widget_has_default() instead. - */ -#define GTK_WIDGET_HAS_DEFAULT(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_HAS_DEFAULT) != 0) -#endif - -#ifndef GTK_DISABLE_DEPRECATED -/** - * GTK_WIDGET_HAS_GRAB: - * @wid: a #GtkWidget. - * - * Evaluates to %TRUE if the widget is in the grab_widgets stack, and will be - * the preferred one for receiving events other than ones of cosmetic value. - * - * Deprecated: 2.20: Use gtk_widget_has_grab() instead. - */ -#define GTK_WIDGET_HAS_GRAB(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_HAS_GRAB) != 0) -#endif - -#ifndef GTK_DISABLE_DEPRECATED -/** - * GTK_WIDGET_RC_STYLE: - * @wid: a #GtkWidget. - * - * Evaluates to %TRUE if the widget's style has been looked up through the rc - * mechanism. - * - * Deprecated: 2.20: Use gtk_widget_has_rc_style() instead. - */ -#define GTK_WIDGET_RC_STYLE(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_RC_STYLE) != 0) -#endif - -#ifndef GTK_DISABLE_DEPRECATED -/** - * GTK_WIDGET_COMPOSITE_CHILD: - * @wid: a #GtkWidget. - * - * Evaluates to %TRUE if the widget is a composite child of its parent. - * - * Deprecated: 2.20: Use the #GtkWidget:composite-child property instead. - */ -#define GTK_WIDGET_COMPOSITE_CHILD(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_COMPOSITE_CHILD) != 0) -#endif - -#ifndef GTK_DISABLE_DEPRECATED -/** - * GTK_WIDGET_APP_PAINTABLE: - * @wid: a #GtkWidget. - * - * Evaluates to %TRUE if the #GTK_APP_PAINTABLE flag has been set on the widget. - * - * Deprecated: 2.20: Use gtk_widget_get_app_paintable() instead. - */ -#define GTK_WIDGET_APP_PAINTABLE(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_APP_PAINTABLE) != 0) -#endif - -#ifndef GTK_DISABLE_DEPRECATED -/** - * GTK_WIDGET_RECEIVES_DEFAULT: - * @wid: a #GtkWidget. - * - * Evaluates to %TRUE if the widget when focused will receive the default action - * even if there is a different widget set as default. - * - * Deprecated: 2.20: Use gtk_widget_get_receives_default() instead. - */ -#define GTK_WIDGET_RECEIVES_DEFAULT(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_RECEIVES_DEFAULT) != 0) -#endif - -#ifndef GTK_DISABLE_DEPRECATED -/** - * GTK_WIDGET_DOUBLE_BUFFERED: - * @wid: a #GtkWidget. - * - * Evaluates to %TRUE if the #GTK_DOUBLE_BUFFERED flag has been set on the widget. - * - * Deprecated: 2.20: Use gtk_widget_get_double_buffered() instead. - */ -#define GTK_WIDGET_DOUBLE_BUFFERED(wid) ((GTK_WIDGET_FLAGS (wid) & GTK_DOUBLE_BUFFERED) != 0) -#endif - - /* Macros for setting and clearing widget flags. */ /** @@ -445,8 +166,17 @@ typedef enum * @flag: the flags to set. * * Turns on certain widget flags. + * + * Deprecated: 2.22: Use the proper function instead: gtk_widget_set_app_paintable(), + * gtk_widget_set_can_default(), gtk_widget_set_can_focus(), + * gtk_widget_set_double_buffered(), gtk_widget_set_has_window(), + * gtk_widget_set_mapped(), gtk_widget_set_no_show_all(), + * gtk_widget_set_realized(), gtk_widget_set_receives_default(), + * gtk_widget_set_sensitive() or gtk_widget_set_visible(). + * */ #define GTK_WIDGET_SET_FLAGS(wid,flag) G_STMT_START{ (GTK_WIDGET_FLAGS (wid) |= (flag)); }G_STMT_END +/* FIXME: Deprecating GTK_WIDGET_SET_FLAGS requires fixing GTK internals. */ /** * GTK_WIDGET_UNSET_FLAGS: @@ -454,8 +184,11 @@ typedef enum * @flag: the flags to unset. * * Turns off certain widget flags. + * + * Deprecated: 2.22: Use the proper function instead. See GTK_WIDGET_SET_FLAGS(). */ #define GTK_WIDGET_UNSET_FLAGS(wid,flag) G_STMT_START{ (GTK_WIDGET_FLAGS (wid) &= ~(flag)); }G_STMT_END +/* FIXME: Deprecating GTK_WIDGET_UNSET_FLAGS requires fixing GTK internals. */ #define GTK_TYPE_REQUISITION (gtk_requisition_get_type ()) @@ -470,6 +203,7 @@ typedef struct _GtkClipboard GtkClipboard; typedef struct _GtkTooltip GtkTooltip; typedef struct _GtkWindow GtkWindow; + /** * GtkAllocation: * @x: the X position of the widget's area relative to its parents allocation. @@ -805,6 +539,7 @@ struct _GtkWidgetAuxInfo gint y; gint width; gint height; + guint x_set : 1; guint y_set : 1; }; @@ -823,13 +558,6 @@ GtkWidget* gtk_widget_new (GType type, void gtk_widget_destroy (GtkWidget *widget); void gtk_widget_destroyed (GtkWidget *widget, GtkWidget **widget_pointer); -#ifndef GTK_DISABLE_DEPRECATED -GtkWidget* gtk_widget_ref (GtkWidget *widget); -void gtk_widget_unref (GtkWidget *widget); -void gtk_widget_set (GtkWidget *widget, - const gchar *first_property_name, - ...) G_GNUC_NULL_TERMINATED; -#endif /* GTK_DISABLE_DEPRECATED */ void gtk_widget_unparent (GtkWidget *widget); void gtk_widget_show (GtkWidget *widget); void gtk_widget_show_now (GtkWidget *widget); @@ -851,22 +579,8 @@ void gtk_widget_queue_draw_area (GtkWidget *widget, gint y, gint width, gint height); -#ifndef GTK_DISABLE_DEPRECATED -void gtk_widget_queue_clear (GtkWidget *widget); -void gtk_widget_queue_clear_area (GtkWidget *widget, - gint x, - gint y, - gint width, - gint height); -#endif /* GTK_DISABLE_DEPRECATED */ - - void gtk_widget_queue_resize (GtkWidget *widget); void gtk_widget_queue_resize_no_redraw (GtkWidget *widget); -#ifndef GTK_DISABLE_DEPRECATED -void gtk_widget_draw (GtkWidget *widget, - const GdkRectangle *area); -#endif /* GTK_DISABLE_DEPRECATED */ void gtk_widget_size_request (GtkWidget *widget, GtkRequisition *requisition); void gtk_widget_size_allocate (GtkWidget *widget, @@ -897,6 +611,8 @@ gboolean gtk_widget_event (GtkWidget *widget, GdkEvent *event); gint gtk_widget_send_expose (GtkWidget *widget, GdkEvent *event); +gboolean gtk_widget_send_focus_change (GtkWidget *widget, + GdkEvent *event); gboolean gtk_widget_activate (GtkWidget *widget); gboolean gtk_widget_set_scroll_adjustments (GtkWidget *widget, @@ -935,6 +651,10 @@ gboolean gtk_widget_get_receives_default (GtkWidget *widget); gboolean gtk_widget_has_grab (GtkWidget *widget); +gboolean gtk_widget_device_is_shadowed (GtkWidget *widget, + GdkDevice *device); + + void gtk_widget_set_name (GtkWidget *widget, const gchar *name); G_CONST_RETURN gchar* gtk_widget_get_name (GtkWidget *widget); @@ -1012,19 +732,16 @@ void gtk_widget_set_size_request (GtkWidget *widget, void gtk_widget_get_size_request (GtkWidget *widget, gint *width, gint *height); -#ifndef GTK_DISABLE_DEPRECATED -void gtk_widget_set_uposition (GtkWidget *widget, - gint x, - gint y); -void gtk_widget_set_usize (GtkWidget *widget, - gint width, - gint height); -#endif - void gtk_widget_set_events (GtkWidget *widget, gint events); void gtk_widget_add_events (GtkWidget *widget, gint events); +void gtk_widget_set_device_events (GtkWidget *widget, + GdkDevice *device, + GdkEventMask events); +void gtk_widget_add_device_events (GtkWidget *widget, + GdkDevice *device, + GdkEventMask events); void gtk_widget_set_extension_events (GtkWidget *widget, GdkExtensionMode mode); @@ -1045,41 +762,10 @@ GtkClipboard *gtk_widget_get_clipboard (GtkWidget *widget, GdkPixmap * gtk_widget_get_snapshot (GtkWidget *widget, GdkRectangle *clip_rect); -#ifndef GTK_DISABLE_DEPRECATED - -/** - * gtk_widget_set_visual: - * @widget: a #GtkWidget - * @visual: a visual - * - * This function is deprecated; it does nothing. - */ -#define gtk_widget_set_visual(widget,visual) ((void) 0) - -/** - * gtk_widget_push_visual: - * @visual: a visual - * - * This function is deprecated; it does nothing. - */ -#define gtk_widget_push_visual(visual) ((void) 0) - -/** - * gtk_widget_pop_visual: - * - * This function is deprecated; it does nothing. - */ -#define gtk_widget_pop_visual() ((void) 0) - -/** - * gtk_widget_set_default_visual: - * @visual: a visual - * - * This function is deprecated; it does nothing. - */ -#define gtk_widget_set_default_visual(visual) ((void) 0) - -#endif /* GTK_DISABLE_DEPRECATED */ +/* Multidevice support */ +gboolean gtk_widget_get_support_multidevice (GtkWidget *widget); +void gtk_widget_set_support_multidevice (GtkWidget *widget, + gboolean support_multidevice); /* Accessibility support */ AtkObject* gtk_widget_get_accessible (GtkWidget *widget); @@ -1094,6 +780,8 @@ void gtk_widget_set_colormap (GtkWidget *widget, GdkColormap *colormap); gint gtk_widget_get_events (GtkWidget *widget); +GdkEventMask gtk_widget_get_device_events (GtkWidget *widget, + GdkDevice *device); void gtk_widget_get_pointer (GtkWidget *widget, gint *x, gint *y); @@ -1114,7 +802,7 @@ gboolean gtk_widget_hide_on_delete (GtkWidget *widget); /* Widget styles. */ -void gtk_widget_style_attach (GtkWidget *style); +void gtk_widget_style_attach (GtkWidget *widget); gboolean gtk_widget_has_rc_style (GtkWidget *widget); void gtk_widget_set_style (GtkWidget *widget, @@ -1142,29 +830,9 @@ void gtk_widget_modify_cursor (GtkWidget *widget, const GdkColor *secondary); void gtk_widget_modify_font (GtkWidget *widget, PangoFontDescription *font_desc); - -#ifndef GTK_DISABLE_DEPRECATED - -/** - * gtk_widget_set_rc_style: - * @widget: a #GtkWidget. - * - * Equivalent to gtk_widget_set_style (widget, NULL). - * - * Deprecated: 2.0: Use gtk_widget_set_style() with a %NULL @style argument instead. - */ -#define gtk_widget_set_rc_style(widget) (gtk_widget_set_style (widget, NULL)) - -/** - * gtk_widget_restore_default_style: - * @widget: a #GtkWidget. - * - * Equivalent to gtk_widget_set_style (widget, NULL). - * - * Deprecated: 2.0: Use gtk_widget_set_style() with a %NULL @style argument instead. - */ -#define gtk_widget_restore_default_style(widget) (gtk_widget_set_style (widget, NULL)) -#endif +void gtk_widget_modify_symbolic_color (GtkWidget *widget, + const gchar *name, + const GdkColor *color); PangoContext *gtk_widget_create_pango_context (GtkWidget *widget); PangoContext *gtk_widget_get_pango_context (GtkWidget *widget); @@ -1289,10 +957,12 @@ GType gtk_requisition_get_type (void) G_GNUC_CONST; GtkRequisition *gtk_requisition_copy (const GtkRequisition *requisition); void gtk_requisition_free (GtkRequisition *requisition); -#if defined (GTK_TRACE_OBJECTS) && defined (__GNUC__) -# define gtk_widget_ref g_object_ref -# define gtk_widget_unref g_object_unref -#endif /* GTK_TRACE_OBJECTS && __GNUC__ */ +void _gtk_widget_set_has_default (GtkWidget *widget, + gboolean has_default); +void _gtk_widget_set_has_grab (GtkWidget *widget, + gboolean has_grab); +void _gtk_widget_set_is_toplevel (GtkWidget *widget, + gboolean is_toplevel); void _gtk_widget_grab_notify (GtkWidget *widget, gboolean was_grabbed); @@ -1305,12 +975,16 @@ void _gtk_widget_propagate_screen_changed (GtkWidget *widget, GdkScreen *previous_screen); void _gtk_widget_propagate_composited_changed (GtkWidget *widget); -void _gtk_widget_set_pointer_window (GtkWidget *widget, +void _gtk_widget_set_device_window (GtkWidget *widget, + GdkDevice *device, GdkWindow *pointer_window); -GdkWindow *_gtk_widget_get_pointer_window (GtkWidget *widget); -gboolean _gtk_widget_is_pointer_widget (GtkWidget *widget); +GdkWindow *_gtk_widget_get_device_window (GtkWidget *widget, + GdkDevice *device); +GList * _gtk_widget_list_devices (GtkWidget *widget); + void _gtk_widget_synthesize_crossing (GtkWidget *from, GtkWidget *to, + GdkDevice *device, GdkCrossingMode mode); GdkColormap* _gtk_widget_peek_colormap (void); diff --git a/gtk/gtkwin32embedwidget.c b/gtk/gtkwin32embedwidget.c index 2e1a6b1b64..9c276ea3b4 100644 --- a/gtk/gtkwin32embedwidget.c +++ b/gtk/gtkwin32embedwidget.c @@ -85,7 +85,7 @@ gtk_win32_embed_widget_init (GtkWin32EmbedWidget *embed_widget) window->type = GTK_WINDOW_TOPLEVEL; - GTK_WIDGET_SET_FLAGS (embed_widget, GTK_TOPLEVEL); + _gtk_widget_set_is_toplevel (GTK_WIDGET (embed_widget), TRUE); gtk_container_set_resize_mode (GTK_CONTAINER (embed_widget), GTK_RESIZE_QUEUE); } diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index f0830a9424..f706f3ef5b 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -39,6 +39,7 @@ #include "gtkrc.h" #include "gtkbutton.h" #include "gtkeventbox.h" +#include "gtkextendedlayout.h" #include "gtkwindow.h" #include "gtklabel.h" #include "gtkbindings.h" @@ -192,6 +193,7 @@ struct _GtkWindowGeometryInfo }; #define GTK_WINDOW_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_WINDOW, GtkWindowPrivate)) +#define GTK_WINDOW_GROUP_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_WINDOW_GROUP, GtkWindowGroupPrivate)) typedef struct _GtkWindowPrivate GtkWindowPrivate; @@ -245,6 +247,21 @@ struct _GtkWindowPrivate GdkCursor *default_cursor; }; +typedef struct _GtkDeviceGrabInfo GtkDeviceGrabInfo; +typedef struct _GtkWindowGroupPrivate GtkWindowGroupPrivate; + +struct _GtkDeviceGrabInfo +{ + GtkWidget *widget; + GdkDevice *device; + guint block_others : 1; +}; + +struct _GtkWindowGroupPrivate +{ + GSList *device_grabs; +}; + static void gtk_window_dispose (GObject *object); static void gtk_window_destroy (GtkObject *object); static void gtk_window_finalize (GObject *object); @@ -254,8 +271,6 @@ static void gtk_window_map (GtkWidget *widget); static void gtk_window_unmap (GtkWidget *widget); static void gtk_window_realize (GtkWidget *widget); static void gtk_window_unrealize (GtkWidget *widget); -static void gtk_window_size_request (GtkWidget *widget, - GtkRequisition *requisition); static void gtk_window_size_allocate (GtkWidget *widget, GtkAllocation *allocation); static gboolean gtk_window_map_event (GtkWidget *widget, @@ -426,9 +441,19 @@ static void gtk_window_forall (GtkContainer *container, static void gtk_window_remove (GtkContainer *container, GtkWidget *child); +static void gtk_window_extended_layout_init (GtkExtendedLayoutIface *iface); +static void gtk_window_get_desired_width (GtkExtendedLayout *layout, + gint *minimum_size, + gint *natural_size); +static void gtk_window_get_desired_height (GtkExtendedLayout *layout, + gint *minimum_size, + gint *natural_size); + G_DEFINE_TYPE_WITH_CODE (GtkWindow, gtk_window, GTK_TYPE_BIN, G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE, - gtk_window_buildable_interface_init)) + gtk_window_buildable_interface_init) + G_IMPLEMENT_INTERFACE (GTK_TYPE_EXTENDED_LAYOUT, + gtk_window_extended_layout_init)) static void add_tab_bindings (GtkBindingSet *binding_set, @@ -540,7 +565,6 @@ gtk_window_class_init (GtkWindowClass *klass) widget_class->unmap = gtk_window_unmap; widget_class->realize = gtk_window_realize; widget_class->unrealize = gtk_window_unrealize; - widget_class->size_request = gtk_window_size_request; widget_class->size_allocate = gtk_window_size_allocate; widget_class->configure_event = gtk_window_configure_event; widget_class->window_state_event = gtk_window_state_event; @@ -1076,7 +1100,7 @@ gtk_window_class_init (GtkWindowClass *klass) * GtkWindow::activate-focus: * @window: the window which received the signal * - * The ::activate-default signal is a + * The ::activate-focus signal is a * keybinding signal * which gets emitted when the user activates the currently * focused widget of @window. @@ -1163,7 +1187,7 @@ gtk_window_init (GtkWindow *window) GdkColormap *colormap; gtk_widget_set_has_window (GTK_WIDGET (window), TRUE); - GTK_WIDGET_SET_FLAGS (window, GTK_TOPLEVEL); + _gtk_widget_set_is_toplevel (GTK_WIDGET (window), TRUE); GTK_PRIVATE_SET_FLAG (window, GTK_ANCHORED); @@ -2327,7 +2351,7 @@ gtk_window_set_default (GtkWindow *window, if (window->focus_widget != window->default_widget || !gtk_widget_get_receives_default (window->default_widget)) - GTK_WIDGET_UNSET_FLAGS (window->default_widget, GTK_HAS_DEFAULT); + _gtk_widget_set_has_default (window->default_widget, FALSE); gtk_widget_queue_draw (window->default_widget); } @@ -2337,7 +2361,7 @@ gtk_window_set_default (GtkWindow *window, { if (window->focus_widget == NULL || !gtk_widget_get_receives_default (window->focus_widget)) - GTK_WIDGET_SET_FLAGS (window->default_widget, GTK_HAS_DEFAULT); + _gtk_widget_set_has_default (window->default_widget, TRUE); gtk_widget_queue_draw (window->default_widget); } @@ -2389,17 +2413,6 @@ gtk_window_set_policy_internal (GtkWindow *window, gtk_widget_queue_resize_no_redraw (GTK_WIDGET (window)); } -void -gtk_window_set_policy (GtkWindow *window, - gboolean allow_shrink, - gboolean allow_grow, - gboolean auto_shrink) -{ - g_return_if_fail (GTK_IS_WINDOW (window)); - - gtk_window_set_policy_internal (window, allow_shrink, allow_grow, auto_shrink); -} - static gboolean handle_keys_changed (gpointer data) { @@ -3499,8 +3512,8 @@ gtk_window_get_geometry_info (GtkWindow *window, /** * gtk_window_set_geometry_hints: * @window: a #GtkWindow - * @geometry_widget: widget the geometry hints will be applied to - * @geometry: struct containing geometry information + * @geometry_widget: (allow-none): widget the geometry hints will be applied to or %NULL + * @geometry: (allow-none): struct containing geometry information or %NULL * @geom_mask: mask indicating which struct fields should be paid attention to * * This function sets up hints about how a window can be resized by @@ -4127,7 +4140,7 @@ gtk_window_unrealize_icon (GtkWindow *window) /** * gtk_window_set_icon_list: * @window: a #GtkWindow - * @list: list of #GdkPixbuf + * @list: (element-type GdkPixbuf) (transfer container): list of #GdkPixbuf * * Sets up the icon representing a #GtkWindow. The icon is used when * the window is minimized (also known as iconified). Some window @@ -4420,7 +4433,7 @@ gtk_window_set_icon_from_file (GtkWindow *window, /** * gtk_window_set_default_icon_list: - * @list: a list of #GdkPixbuf + * @list: (element-type GdkPixbuf) (transfer container) a list of #GdkPixbuf * * Sets an icon list to be used as fallback for windows that haven't * had gtk_window_set_icon_list() called on them to set up a @@ -4601,7 +4614,7 @@ gtk_window_set_default_icon_from_file (const gchar *filename, * but the pixbufs in the list have not had their reference count * incremented. * - * Return value: copy of default icon list + * Return value: (element-type GdkPixbuf) (transfer container): copy of default icon list **/ GList* gtk_window_get_default_icon_list (void) @@ -4709,8 +4722,8 @@ gtk_window_set_default_size (GtkWindow *window, /** * gtk_window_get_default_size: * @window: a #GtkWindow - * @width: (allow-none): location to store the default width, or %NULL - * @height: (allow-none): location to store the default height, or %NULL + * @width: (out) (allow-none): location to store the default width, or %NULL + * @height: (out) (allow-none): location to store the default height, or %NULL * * Gets the default size of the window. A value of -1 for the width or * height indicates that a default size has not been explicitly set @@ -4974,8 +4987,8 @@ gtk_window_move (GtkWindow *window, /** * gtk_window_get_position: * @window: a #GtkWindow - * @root_x: return location for X coordinate of gravity-determined reference point - * @root_y: return location for Y coordinate of gravity-determined reference point + * @root_x: (out): return location for X coordinate of gravity-determined reference point + * @root_y: (out): return location for Y coordinate of gravity-determined reference point * * This function returns the position you need to pass to * gtk_window_move() to keep @window in its current position. This @@ -6709,31 +6722,43 @@ static void do_focus_change (GtkWidget *widget, gboolean in) { - GdkEvent *fevent = gdk_event_new (GDK_FOCUS_CHANGE); + GdkDeviceManager *device_manager; + GList *devices, *d; - g_object_ref (widget); + device_manager = gdk_display_get_device_manager (gtk_widget_get_display (widget)); + devices = gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_MASTER); + devices = g_list_concat (devices, gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_SLAVE)); + devices = g_list_concat (devices, gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_FLOATING)); - if (in) + for (d = devices; d; d = d->next) { - GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS); - } - else - { - GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS); - } + GdkDevice *dev = d->data; + GdkEvent *fevent; - fevent->focus_change.type = GDK_FOCUS_CHANGE; - fevent->focus_change.window = widget->window; - if (widget->window) - g_object_ref (widget->window); - fevent->focus_change.in = in; - - gtk_widget_event (widget, fevent); - - g_object_notify (G_OBJECT (widget), "has-focus"); + if (dev->source != GDK_SOURCE_KEYBOARD) + continue; - g_object_unref (widget); - gdk_event_free (fevent); + /* Skip non-master keyboards that haven't + * selected for events from this window + */ + if (gdk_device_get_device_type (dev) != GDK_DEVICE_TYPE_MASTER && + widget->window && + !gdk_window_get_device_events (widget->window, dev)) + continue; + + fevent = gdk_event_new (GDK_FOCUS_CHANGE); + + fevent->focus_change.type = GDK_FOCUS_CHANGE; + fevent->focus_change.window = widget->window; + if (widget->window) + g_object_ref (widget->window); + fevent->focus_change.in = in; + gdk_event_set_device (fevent, dev); + + gtk_widget_send_focus_change (widget, fevent); + + gdk_event_free (fevent); + } } static void @@ -7092,11 +7117,11 @@ gtk_window_real_set_focus (GtkWindow *window, if (gtk_widget_get_receives_default (window->focus_widget) && (window->focus_widget != window->default_widget)) { - GTK_WIDGET_UNSET_FLAGS (window->focus_widget, GTK_HAS_DEFAULT); + _gtk_widget_set_has_default (window->focus_widget, FALSE); gtk_widget_queue_draw (window->focus_widget); if (window->default_widget) - GTK_WIDGET_SET_FLAGS (window->default_widget, GTK_HAS_DEFAULT); + _gtk_widget_set_has_default (window->default_widget, TRUE); } window->focus_widget = NULL; @@ -7118,10 +7143,10 @@ gtk_window_real_set_focus (GtkWindow *window, (window->focus_widget != window->default_widget)) { if (gtk_widget_get_can_default (window->focus_widget)) - GTK_WIDGET_SET_FLAGS (window->focus_widget, GTK_HAS_DEFAULT); + _gtk_widget_set_has_default (window->focus_widget, TRUE); if (window->default_widget) - GTK_WIDGET_UNSET_FLAGS (window->default_widget, GTK_HAS_DEFAULT); + _gtk_widget_set_has_default (window->default_widget, FALSE); } if (window->has_focus) @@ -7158,6 +7183,64 @@ gtk_window_real_set_focus (GtkWindow *window, } } + +static void +gtk_window_extended_layout_init (GtkExtendedLayoutIface *iface) +{ + iface->get_desired_width = gtk_window_get_desired_width; + iface->get_desired_height = gtk_window_get_desired_height; +} + + +static void +gtk_window_get_desired_width (GtkExtendedLayout *layout, + gint *minimum_size, + gint *natural_size) +{ + GtkWindow *window; + GtkWidget *child; + + window = GTK_WINDOW (layout); + child = gtk_bin_get_child (GTK_BIN (window)); + + *minimum_size = GTK_CONTAINER (window)->border_width * 2; + *natural_size = GTK_CONTAINER (window)->border_width * 2; + + if (child && gtk_widget_get_visible (child)) + { + gint child_min, child_nat; + gtk_extended_layout_get_desired_width (GTK_EXTENDED_LAYOUT (child), &child_min, &child_nat); + + *minimum_size += child_min; + *natural_size += child_nat; + } +} + +static void +gtk_window_get_desired_height (GtkExtendedLayout *layout, + gint *minimum_size, + gint *natural_size) +{ + GtkWindow *window; + GtkWidget *child; + + window = GTK_WINDOW (layout); + child = gtk_bin_get_child (GTK_BIN (window)); + + *minimum_size = GTK_CONTAINER (window)->border_width * 2; + *natural_size = GTK_CONTAINER (window)->border_width * 2; + + if (child && gtk_widget_get_visible (child)) + { + gint child_min, child_nat; + gtk_extended_layout_get_desired_height (GTK_EXTENDED_LAYOUT (child), &child_min, &child_nat); + + *minimum_size += child_min; + *natural_size += child_nat; + } +} + + /** * _gtk_window_unset_focus_and_default: * @window: a #GtkWindow @@ -7445,11 +7528,16 @@ get_monitor_containing_pointer (GtkWindow *window) gint monitor_num; GdkScreen *window_screen; GdkScreen *pointer_screen; + GdkDisplay *display; + GdkDevice *pointer; window_screen = gtk_window_check_screen (window); - gdk_display_get_pointer (gdk_screen_get_display (window_screen), - &pointer_screen, - &px, &py, NULL); + display = gdk_screen_get_display (window_screen); + pointer = gdk_display_get_core_pointer (display); + + gdk_display_get_device_state (display, pointer, + &pointer_screen, + &px, &py, NULL); if (pointer_screen == window_screen) monitor_num = gdk_screen_get_monitor_at_point (pointer_screen, px, py); @@ -7632,12 +7720,16 @@ gtk_window_compute_configure_request (GtkWindow *window, gint screen_height = gdk_screen_get_height (screen); gint monitor_num; GdkRectangle monitor; + GdkDisplay *display; + GdkDevice *pointer; GdkScreen *pointer_screen; gint px, py; - - gdk_display_get_pointer (gdk_screen_get_display (screen), - &pointer_screen, - &px, &py, NULL); + + display = gdk_screen_get_display (screen); + pointer = gdk_display_get_core_pointer (display); + gdk_display_get_device_state (display, pointer, + &pointer_screen, + &px, &py, NULL); if (pointer_screen == screen) monitor_num = gdk_screen_get_monitor_at_point (screen, px, py); @@ -9125,10 +9217,10 @@ gtk_window_begin_resize_drag (GtkWindow *window, /** * gtk_window_get_frame_dimensions: * @window: a #GtkWindow - * @left: (allow-none): location to store the width of the frame at the left, or %NULL - * @top: (allow-none): location to store the height of the frame at the top, or %NULL - * @right: (allow-none): location to store the width of the frame at the returns, or %NULL - * @bottom: (allow-none): location to store the height of the frame at the bottom, or %NULL + * @left: (allow-none) (out): location to store the width of the frame at the left, or %NULL + * @top: (allow-none) (out): location to store the height of the frame at the top, or %NULL + * @right: (allow-none) (out): location to store the width of the frame at the returns, or %NULL + * @bottom: (allow-none) (out): location to store the height of the frame at the bottom, or %NULL * * (Note: this is a special-purpose function intended for the * framebuffer port; see gtk_window_set_has_frame(). It will not @@ -9342,6 +9434,7 @@ gtk_window_has_toplevel_focus (GtkWindow *window) static void gtk_window_group_class_init (GtkWindowGroupClass *klass) { + g_type_class_add_private (klass, sizeof (GtkWindowGroupPrivate)); } GType @@ -9389,6 +9482,8 @@ static void window_group_cleanup_grabs (GtkWindowGroup *group, GtkWindow *window) { + GtkWindowGroupPrivate *priv; + GtkDeviceGrabInfo *info; GSList *tmp_list; GSList *to_remove = NULL; @@ -9406,6 +9501,27 @@ window_group_cleanup_grabs (GtkWindowGroup *group, g_object_unref (to_remove->data); to_remove = g_slist_delete_link (to_remove, to_remove); } + + priv = GTK_WINDOW_GROUP_GET_PRIVATE (group); + tmp_list = priv->device_grabs; + + while (tmp_list) + { + info = tmp_list->data; + + if (gtk_widget_get_toplevel (info->widget) == (GtkWidget *) window) + to_remove = g_slist_prepend (to_remove, info); + + tmp_list = tmp_list->next; + } + + while (to_remove) + { + info = to_remove->data; + + gtk_device_grab_remove (info->widget, info->device); + to_remove = g_slist_delete_link (to_remove, to_remove); + } } /** @@ -9522,6 +9638,24 @@ gtk_window_get_group (GtkWindow *window) } } +/** + * gtk_window_has_group: + * @window: a #GtkWindow + * + * Returns whether @window has an explicit window group. + * + * Return value: %TRUE if @window has an explicit window group. + * + * Since 2.22 + **/ +gboolean +gtk_window_has_group (GtkWindow *window) +{ + g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE); + + return window->group != NULL; +} + /* Return the current grab widget of the given group */ GtkWidget * @@ -9532,6 +9666,131 @@ _gtk_window_group_get_current_grab (GtkWindowGroup *window_group) return NULL; } +void +_gtk_window_group_add_device_grab (GtkWindowGroup *window_group, + GtkWidget *widget, + GdkDevice *device, + gboolean block_others) +{ + GtkWindowGroupPrivate *priv; + GtkDeviceGrabInfo *info; + + priv = GTK_WINDOW_GROUP_GET_PRIVATE (window_group); + + info = g_slice_new0 (GtkDeviceGrabInfo); + info->widget = widget; + info->device = device; + info->block_others = block_others; + + priv->device_grabs = g_slist_prepend (priv->device_grabs, info); +} + +void +_gtk_window_group_remove_device_grab (GtkWindowGroup *window_group, + GtkWidget *widget, + GdkDevice *device) +{ + GtkWindowGroupPrivate *priv; + GtkDeviceGrabInfo *info; + GSList *list, *node = NULL; + GdkDevice *other_device; + + priv = GTK_WINDOW_GROUP_GET_PRIVATE (window_group); + other_device = gdk_device_get_associated_device (device); + list = priv->device_grabs; + + while (list) + { + info = list->data; + + if (info->widget == widget && + (info->device == device || + info->device == other_device)) + { + node = list; + break; + } + + list = list->next; + } + + if (node) + { + info = node->data; + + priv->device_grabs = g_slist_delete_link (priv->device_grabs, node); + g_slice_free (GtkDeviceGrabInfo, info); + } +} + +/** + * gtk_window_group_get_current_device_grab: + * @window_group: a #GtkWindowGroup + * @device: a #GdkDevice + * + * Returns the current grab widget for @device, or %NULL if none. + * + * Returns: The grab widget, or %NULL + **/ +GtkWidget * +gtk_window_group_get_current_device_grab (GtkWindowGroup *window_group, + GdkDevice *device) +{ + GtkWindowGroupPrivate *priv; + GtkDeviceGrabInfo *info; + GdkDevice *other_device; + GSList *list; + + priv = GTK_WINDOW_GROUP_GET_PRIVATE (window_group); + list = priv->device_grabs; + other_device = gdk_device_get_associated_device (device); + + while (list) + { + info = list->data; + list = list->next; + + if (info->device == device || + info->device == other_device) + return info->widget; + } + + return NULL; +} + +gboolean +_gtk_window_group_widget_is_blocked_for_device (GtkWindowGroup *window_group, + GtkWidget *widget, + GdkDevice *device) +{ + GtkWindowGroupPrivate *priv; + GtkDeviceGrabInfo *info; + GdkDevice *other_device; + GSList *list; + + priv = GTK_WINDOW_GROUP_GET_PRIVATE (window_group); + other_device = gdk_device_get_associated_device (device); + list = priv->device_grabs; + + while (list) + { + info = list->data; + list = list->next; + + /* Look for blocking grabs on other device pairs + * that have the passed widget within the GTK+ grab. + */ + if (info->block_others && + info->device != device && + info->device != other_device && + (info->widget == widget || + gtk_widget_is_ancestor (widget, info->widget))) + return TRUE; + } + + return FALSE; +} + /* Derived from XParseGeometry() in XFree86 @@ -9915,9 +10174,9 @@ _gtk_window_keys_foreach (GtkWindow *window, GtkAccelGroup *group = groups->data; gint i; - for (i = 0; i < group->n_accels; i++) + for (i = 0; i < group->priv->n_accels; i++) { - GtkAccelKey *key = &group->priv_accels[i].key; + GtkAccelKey *key = &group->priv->priv_accels[i].key; if (key->accel_key) (*func) (window, key->accel_key, key->accel_mods, FALSE, func_data); @@ -10158,22 +10417,26 @@ void _gtk_window_set_is_toplevel (GtkWindow *window, gboolean is_toplevel) { - if (gtk_widget_is_toplevel (GTK_WIDGET (window))) + GtkWidget *widget; + + widget = GTK_WIDGET (window); + + if (gtk_widget_is_toplevel (widget)) g_assert (g_slist_find (toplevel_list, window) != NULL); else g_assert (g_slist_find (toplevel_list, window) == NULL); - if (is_toplevel == gtk_widget_is_toplevel (GTK_WIDGET (window))) + if (is_toplevel == gtk_widget_is_toplevel (widget)) return; if (is_toplevel) { - GTK_WIDGET_SET_FLAGS (window, GTK_TOPLEVEL); + _gtk_widget_set_is_toplevel (widget, TRUE); toplevel_list = g_slist_prepend (toplevel_list, window); } else { - GTK_WIDGET_UNSET_FLAGS (window, GTK_TOPLEVEL); + _gtk_widget_set_is_toplevel (widget, FALSE); toplevel_list = g_slist_remove (toplevel_list, window); } } @@ -10243,7 +10506,8 @@ gtk_window_get_window_type (GtkWindow *window) return window->type; } -/* gtk_window_get_mnemonics_visible: +/** + * gtk_window_get_mnemonics_visible: * @window: a #GtkWindow * * Gets the value of the #GtkWindow:mnemonics-visible property. diff --git a/gtk/gtkwindow.h b/gtk/gtkwindow.h index 0fc17a2406..069d5d950f 100644 --- a/gtk/gtkwindow.h +++ b/gtk/gtkwindow.h @@ -24,7 +24,7 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) +#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only can be included directly." #endif @@ -35,6 +35,8 @@ #include #include +#include "gtk/gtkaccelgroupprivate.h" + G_BEGIN_DECLS @@ -352,14 +354,6 @@ void gtk_window_begin_move_drag (GtkWindow *window, gint root_y, guint32 timestamp); -#ifndef GTK_DISABLE_DEPRECATED -void gtk_window_set_policy (GtkWindow *window, - gint allow_shrink, - gint allow_grow, - gint auto_shrink); -#define gtk_window_position gtk_window_set_position -#endif /* GTK_DISABLE_DEPRECATED */ - /* Set initial default size of the window (does not constrain user * resize operations) */ @@ -384,6 +378,7 @@ void gtk_window_get_position (GtkWindow *window, gboolean gtk_window_parse_geometry (GtkWindow *window, const gchar *geometry); GtkWindowGroup *gtk_window_get_group (GtkWindow *window); +gboolean gtk_window_has_group (GtkWindow *window); /* Ignore this unless you are writing a GUI builder */ void gtk_window_reshow_with_initial_size (GtkWindow *window); @@ -401,6 +396,9 @@ void gtk_window_group_remove_window (GtkWindowGroup *window_grou GtkWindow *window); GList * gtk_window_group_list_windows (GtkWindowGroup *window_group); +GtkWidget * gtk_window_group_get_current_device_grab (GtkWindowGroup *window_group, + GdkDevice *device); + /* --- internal functions --- */ void _gtk_window_internal_set_focus (GtkWindow *window, @@ -418,6 +416,17 @@ void _gtk_window_constrain_size (GtkWindow *window, gint *new_width, gint *new_height); GtkWidget *_gtk_window_group_get_current_grab (GtkWindowGroup *window_group); +void _gtk_window_group_add_device_grab (GtkWindowGroup *window_group, + GtkWidget *widget, + GdkDevice *device, + gboolean block_others); +void _gtk_window_group_remove_device_grab (GtkWindowGroup *window_group, + GtkWidget *widget, + GdkDevice *device); + +gboolean _gtk_window_group_widget_is_blocked_for_device (GtkWindowGroup *window_group, + GtkWidget *widget, + GdkDevice *device); void _gtk_window_set_has_toplevel_focus (GtkWindow *window, gboolean has_toplevel_focus); diff --git a/gtk/makefile.msc.in b/gtk/makefile.msc.in index bb6ac9999e..73bedddcf0 100644 --- a/gtk/makefile.msc.in +++ b/gtk/makefile.msc.in @@ -114,8 +114,6 @@ gtk_OBJECTS_deprecated = \ gtkprogress.obj \ gtktipsquery.obj \ gtkshow.obj \ - gtksignal.obj \ - gtkpixmap.obj \ gtkpreview.obj \ gtkseparatortoolitem.obj \ gtktypeutils.obj \ @@ -469,7 +467,6 @@ gtk_public_h_sources = \ gtkpagesetup.h \ gtkpaned.h \ gtkpapersize.h \ - gtkpixmap.h \ gtkplug.h \ gtkpreview.h \ gtkprintcontext.h \ @@ -502,7 +499,6 @@ gtk_public_h_sources = \ gtkseparatormenuitem.h \ gtkseparatortoolitem.h \ gtksettings.h \ - gtksignal.h \ gtksizegroup.h \ gtksocket.h \ gtkspinbutton.h \ @@ -618,8 +614,6 @@ gtkmarshal.c : gtkmarshal.list gtktypefuncs.c : makefile.msc echo /*none*/ > gtktypefuncs.c -gtksignal.obj : gtksignal.c gtkmarshal.c gtkmarshal.h - $(CC) $(CFLAGS) -GD -c -DGTK_COMPILATION -DG_LOG_DOMAIN=\"Gtk\" gtksignal.c gtk-win32.res : gtk-win32.rc rc -DBUILDNUMBER=0 -r -fo gtk-win32.res gtk-win32.rc diff --git a/gtk/queryimmodules.c b/gtk/queryimmodules.c index 5369c7f9bd..f8fd501192 100644 --- a/gtk/queryimmodules.c +++ b/gtk/queryimmodules.c @@ -1,7 +1,7 @@ /* GTK+ * querymodules.c: * - * Copyright (C) 2000 Red Hat Software + * Copyright (C) 2000-2010 Red Hat Software * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -10,7 +10,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public @@ -41,55 +41,53 @@ #include "gtk/gtkimmodule.h" #include "gtk/gtkversion.h" -static char * -escape_string (const char *str) +static void +escape_string (GString *contents, const char *str) { - GString *result = g_string_new (NULL); - while (TRUE) { char c = *str++; - + switch (c) - { - case '\0': - goto done; - case '\n': - g_string_append (result, "\\n"); - break; - case '\"': - g_string_append (result, "\\\""); - break; + { + case '\0': + goto done; + case '\n': + g_string_append (contents, "\\n"); + break; + case '\"': + g_string_append (contents, "\\\""); + break; #ifdef G_OS_WIN32 - /* Replace backslashes in path with forward slashes, so that - * it reads in without problems. - */ - case '\\': - g_string_append (result, "/"); - break; -#endif - default: - g_string_append_c (result, c); - } + /* Replace backslashes in path with forward slashes, so that + * it reads in without problems. + */ + case '\\': + g_string_append (contents, "/"); + break; +#endif + default: + g_string_append_c (contents, c); + } } - done: - return g_string_free (result, FALSE); + done:; } static void -print_escaped (const char *str) +print_escaped (GString *contents, const char *str) { - char *tmp = escape_string (str); - g_printf ("\"%s\" ", tmp); - g_free (tmp); + g_string_append_c (contents, '"'); + escape_string (contents, str); + g_string_append_c (contents, '"'); + g_string_append_c (contents, ' '); } static gboolean -query_module (const char *dir, const char *name) +query_module (const char *dir, const char *name, GString *contents) { void (*list) (const GtkIMContextInfo ***contexts, - guint *n_contexts); + guint *n_contexts); void (*init) (GTypeModule *type_module); void (*exit) (void); GtkIMContext *(*create) (const gchar *context_id); @@ -107,7 +105,7 @@ query_module (const char *dir, const char *name) path = g_strdup (name); else path = g_build_filename (dir, name, NULL); - + module = g_module_open (path, 0); if (!module) @@ -115,7 +113,7 @@ query_module (const char *dir, const char *name) g_fprintf (stderr, "Cannot load module %s: %s\n", path, g_module_error()); error = TRUE; } - + if (module && g_module_symbol (module, "im_module_list", &list_ptr) && g_module_symbol (module, "im_module_init", &init_ptr) && @@ -131,26 +129,26 @@ query_module (const char *dir, const char *name) exit = exit_ptr; create = create_ptr; - print_escaped (path); - fputs ("\n", stdout); + print_escaped (contents, path); + g_string_append_c (contents, '\n'); (*list) (&contexts, &n_contexts); - for (i=0; icontext_id); - print_escaped (contexts[i]->context_name); - print_escaped (contexts[i]->domain); - print_escaped (contexts[i]->domain_dirname); - print_escaped (contexts[i]->default_locales); - fputs ("\n", stdout); - } - fputs ("\n", stdout); + for (i = 0; i < n_contexts; i++) + { + print_escaped (contents, contexts[i]->context_id); + print_escaped (contents, contexts[i]->context_name); + print_escaped (contents, contexts[i]->domain); + print_escaped (contents, contexts[i]->domain_dirname); + print_escaped (contents, contexts[i]->default_locales); + g_string_append_c (contents, '\n'); + } + g_string_append_c (contents, '\n'); } else { g_fprintf (stderr, "%s does not export GTK+ IM module API: %s\n", path, - g_module_error ()); + g_module_error ()); error = TRUE; } @@ -159,7 +157,7 @@ query_module (const char *dir, const char *name) g_module_close (module); return error; -} +} int main (int argc, char **argv) { @@ -167,16 +165,26 @@ int main (int argc, char **argv) int i; char *path; gboolean error = FALSE; + gchar *cache_file = NULL; + gint first_file = 1; + GString *contents; - g_printf ("# GTK+ Input Method Modules file\n" - "# Automatically generated file, do not edit\n" - "# Created by %s from gtk+-%d.%d.%d\n" - "#\n", - argv[0], - GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); + if (argc > 1 && strcmp (argv[1], "--update-cache") == 0) + { + cache_file = gtk_rc_get_im_module_file (); + first_file = 2; + } + contents = g_string_new (""); + g_string_append_printf (contents, + "# GTK+ Input Method Modules file\n" + "# Automatically generated file, do not edit\n" + "# Created by %s from gtk+-%d.%d.%d\n" + "#\n", + argv[0], + GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); - if (argc == 1) /* No arguments given */ + if (argc == first_file) /* No file arguments given */ { char **dirs; int i; @@ -184,27 +192,27 @@ int main (int argc, char **argv) path = gtk_rc_get_im_module_path (); - g_printf ("# ModulesPath = %s\n#\n", path); + g_string_append_printf (contents, "# ModulesPath = %s\n#\n", path); dirs = pango_split_file_list (path); dirs_done = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, NULL); - for (i=0; dirs[i]; i++) + for (i = 0; dirs[i]; i++) if (!g_hash_table_lookup (dirs_done, dirs[i])) { - GDir *dir = g_dir_open (dirs[i], 0, NULL); - if (dir) - { - const char *dent; + GDir *dir = g_dir_open (dirs[i], 0, NULL); + if (dir) + { + const char *dent; - while ((dent = g_dir_read_name (dir))) - { - if (g_str_has_suffix (dent, SOEXT)) - error |= query_module (dirs[i], dent); - } - - g_dir_close (dir); - } + while ((dent = g_dir_read_name (dir))) + { + if (g_str_has_suffix (dent, SOEXT)) + error |= query_module (dirs[i], dent, contents); + } + + g_dir_close (dir); + } g_hash_table_insert (dirs_done, dirs[i], GUINT_TO_POINTER (TRUE)); } @@ -214,12 +222,29 @@ int main (int argc, char **argv) else { cwd = g_get_current_dir (); - - for (i=1; istr, -1, &err)) + { + g_fprintf (stderr, "%s\n", err->message); + error = 1; + } + } + else + g_print ("%s\n", contents->str); + } + return error ? 1 : 0; } diff --git a/gtk/tests/Makefile.am b/gtk/tests/Makefile.am index d257f2b316..803314f026 100644 --- a/gtk/tests/Makefile.am +++ b/gtk/tests/Makefile.am @@ -20,7 +20,7 @@ progs_ldadd = \ $(top_builddir)/gtk/$(gtktargetlib) \ $(GTK_DEP_LIBS) -noinst_PROGRAMS = $(TEST_PROGS) +noinst_PROGRAMS = $(TEST_PROGS) $(SAMPLE_PROGS) TEST_PROGS += testing @@ -62,11 +62,10 @@ object_LDADD = $(progs_ldadd) crossingevents_SOURCES = crossingevents.c crossingevents_LDADD = $(progs_ldadd) -# this doesn't work in make distcheck, since it doesn't -# find file-chooser-test-dir -# TEST_PROGS += filechooser -filechooser_SOURCES = filechooser.c pixbuf-init.c -filechooser_LDADD = $(progs_ldadd) +# Should be ported to new API's +#TEST_PROGS += filechooser +#filechooser_SOURCES = filechooser.c pixbuf-init.c +#filechooser_LDADD = $(progs_ldadd) TEST_PROGS += builder builder_SOURCES = builder.c @@ -76,7 +75,7 @@ builder_LDFLAGS = -export-dynamic if OS_UNIX TEST_PROGS += defaultvalue endif -defaultvalue_SOURCES = defaultvalue.c pixbuf-init.c +defaultvalue_SOURCES = defaultvalue.c pixbuf-init.c defaultvalue_LDADD = $(progs_ldadd) TEST_PROGS += textbuffer @@ -95,4 +94,13 @@ TEST_PROGS += action action_SOURCES = action.c action_LDADD = $(progs_ldadd) +SAMPLE_PROGS = gtk-example-application +gtk_example_application_SOURCES = gtk-example-application.c +gtk_example_application_LDADD = $(progs_ldadd) + + +EXTRA_DIST += \ + file-chooser-test-dir/empty \ + file-chooser-test-dir/text.txt + -include $(top_srcdir)/git.mk diff --git a/gtk/tests/builder.c b/gtk/tests/builder.c index 1e2d86a6de..33f2f84f9b 100644 --- a/gtk/tests/builder.c +++ b/gtk/tests/builder.c @@ -2420,10 +2420,10 @@ test_menus (void) gtk_accel_label_refetch (GTK_ACCEL_LABEL (sample_accel_label)); gtk_accel_label_refetch (GTK_ACCEL_LABEL (item_accel_label)); - g_assert (GTK_ACCEL_LABEL (sample_accel_label)->accel_string != NULL); - g_assert (GTK_ACCEL_LABEL (item_accel_label)->accel_string != NULL); - g_assert (strcmp (GTK_ACCEL_LABEL (item_accel_label)->accel_string, - GTK_ACCEL_LABEL (sample_accel_label)->accel_string) == 0); + g_assert (gtk_label_get_text (GTK_LABEL (sample_accel_label)) != NULL); + g_assert (gtk_label_get_text (GTK_LABEL (item_accel_label)) != NULL); + g_assert (strcmp (gtk_label_get_text (GTK_LABEL (item_accel_label)), + gtk_label_get_text (GTK_LABEL (sample_accel_label))) == 0); /* Check the menu hierarchy worked here */ g_assert (get_parent_menubar (item)); diff --git a/gtk/tests/defaultvalue.c b/gtk/tests/defaultvalue.c index 5253884b98..bab518e48b 100644 --- a/gtk/tests/defaultvalue.c +++ b/gtk/tests/defaultvalue.c @@ -18,8 +18,6 @@ * Boston, MA 02111-1307, USA. */ -#undef GTK_DISABLE_DEPRECATED -#define GTK_ENABLE_BROKEN #include #include #include @@ -81,13 +79,6 @@ test_type (gconstpointer data) g_type_is_a (type, gdk_pixbuf_simple_anim_iter_get_type ())) return; - /* The gtk_arg compat wrappers can't set up default values */ - if (g_type_is_a (type, GTK_TYPE_CLIST) || - g_type_is_a (type, GTK_TYPE_CTREE) || - g_type_is_a (type, GTK_TYPE_LIST) || - g_type_is_a (type, GTK_TYPE_TIPS_QUERY)) - return; - klass = g_type_class_ref (type); if (g_type_is_a (type, GTK_TYPE_SETTINGS)) @@ -177,11 +168,6 @@ test_type (gconstpointer data) strcmp (pspec->name, "buffer") == 0)) continue; - /* Gets set to the cwd */ - if (g_type_is_a (type, GTK_TYPE_FILE_SELECTION) && - strcmp (pspec->name, "filename") == 0) - continue; - if (g_type_is_a (type, GTK_TYPE_FONT_SELECTION) && strcmp (pspec->name, "font") == 0) continue; @@ -195,6 +181,10 @@ test_type (gconstpointer data) strcmp (pspec->name, "image") == 0) continue; + if (g_type_is_a (type, GTK_TYPE_PANED) && + strcmp (pspec->name, "max-position") == 0) + continue; + if (g_type_is_a (type, GTK_TYPE_PRINT_OPERATION) && strcmp (pspec->name, "job-name") == 0) continue; @@ -269,11 +259,6 @@ test_type (gconstpointer data) strcmp (pspec->name, "font-desc") == 0)) continue; - if (g_type_is_a (type, GTK_TYPE_TEXT) && - (strcmp (pspec->name, "hadjustment") == 0 || - strcmp (pspec->name, "vadjustment") == 0)) - continue; - if (g_type_is_a (type, GTK_TYPE_TEXT_VIEW) && strcmp (pspec->name, "buffer") == 0) continue; diff --git a/tests/file-chooser-test-dir/empty b/gtk/tests/file-chooser-test-dir/empty similarity index 100% rename from tests/file-chooser-test-dir/empty rename to gtk/tests/file-chooser-test-dir/empty diff --git a/tests/file-chooser-test-dir/text.txt b/gtk/tests/file-chooser-test-dir/text.txt similarity index 100% rename from tests/file-chooser-test-dir/text.txt rename to gtk/tests/file-chooser-test-dir/text.txt diff --git a/gtk/tests/filechooser.c b/gtk/tests/filechooser.c index c1811f3a18..424436cd35 100644 --- a/gtk/tests/filechooser.c +++ b/gtk/tests/filechooser.c @@ -29,8 +29,6 @@ * - More tests! */ -#define GTK_FILE_SYSTEM_ENABLE_UNSUPPORTED -#undef GTK_DISABLE_DEPRECATED #define SLEEP_DURATION 100 #include "config.h" diff --git a/gtk/tests/floating.c b/gtk/tests/floating.c index d0682cf5d2..832a4dcc2e 100644 --- a/gtk/tests/floating.c +++ b/gtk/tests/floating.c @@ -16,8 +16,7 @@ * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ -#undef GTK_DISABLE_DEPRECATED -#include "../gtk/gtk.h" +#include static gboolean destroyed = FALSE; static void @@ -32,28 +31,15 @@ floating_tests (void) GtkWidget *widget = g_object_new (GTK_TYPE_LABEL, NULL); g_object_connect (widget, "signal::destroy", destroy, NULL, NULL); - g_assert (GTK_OBJECT_FLOATING (widget)); - g_assert (g_object_is_floating (widget)); - - GTK_OBJECT_UNSET_FLAGS (widget, GTK_FLOATING); - g_assert (!GTK_OBJECT_FLOATING (widget)); - g_assert (!g_object_is_floating (widget)); - - GTK_OBJECT_SET_FLAGS (widget, GTK_FLOATING); - g_assert (GTK_OBJECT_FLOATING (widget)); g_assert (g_object_is_floating (widget)); g_object_ref_sink (widget); - g_assert (!GTK_OBJECT_FLOATING (widget)); g_assert (!g_object_is_floating (widget)); g_object_force_floating (G_OBJECT (widget)); - g_assert (GTK_OBJECT_FLOATING (widget)); g_assert (g_object_is_floating (widget)); - g_object_ref (widget); - gtk_object_sink (GTK_OBJECT (widget)); - g_assert (!GTK_OBJECT_FLOATING (widget)); + g_object_ref_sink (widget); g_assert (!g_object_is_floating (widget)); g_assert (!destroyed); diff --git a/gtk/tests/gtk-example-application.c b/gtk/tests/gtk-example-application.c new file mode 100644 index 0000000000..4248e0ef2b --- /dev/null +++ b/gtk/tests/gtk-example-application.c @@ -0,0 +1,60 @@ +#include + +static const char *builder_data = +"" +"" +" Example Application" +" http://www.gtk.org" +"" +"" +" " +" " +" About" +" gtk-about" +" " +" " +"" +""; + +static GtkWidget *about_dialog; + +static void +about_activate (GtkAction *action, + gpointer user_data) +{ + gtk_dialog_run (GTK_DIALOG (about_dialog)); + gtk_widget_hide (GTK_WIDGET (about_dialog)); +} + +int +main (int argc, char **argv) +{ + GtkApplication *app; + GtkWindow *window; + GtkBuilder *builder; + GtkAction *action; + GtkActionGroup *actions; + + app = gtk_application_new (&argc, &argv, "org.gtk.Example"); + builder = gtk_builder_new (); + if (!gtk_builder_add_from_string (builder, builder_data, -1, NULL)) + g_error ("failed to parse UI"); + actions = GTK_ACTION_GROUP (gtk_builder_get_object (builder, "actions")); + gtk_application_set_action_group (app, actions); + + action = gtk_action_group_get_action (actions, "About"); + g_signal_connect (action, "activate", G_CALLBACK (about_activate), app); + + about_dialog = GTK_WIDGET (gtk_builder_get_object (builder, "about_dialog")); + + gtk_builder_connect_signals (builder, app); + g_object_unref (builder); + + window = gtk_application_get_window (app); + gtk_container_add (GTK_CONTAINER (window), gtk_label_new ("Hello world")); + gtk_widget_show_all (GTK_WIDGET (window)); + + gtk_application_run (app); + + return 0; +} diff --git a/gtk/tests/object.c b/gtk/tests/object.c index 4b77e93466..feb724adad 100644 --- a/gtk/tests/object.c +++ b/gtk/tests/object.c @@ -55,7 +55,6 @@ list_ignore_properties (gboolean buglist) { /* currently untestable properties */ static const IgnoreProperty ignore_properties[] = { - { "GtkCurve", "", NULL, }, /* Just ignore it, not worth fixing */ { "GtkContainer", "child", NULL, }, /* needs working child widget */ { "GtkRadioMenuItem", "group", NULL, }, /* needs working sibling */ { "GtkWidget", "parent", NULL, }, /* needs working parent widget */ diff --git a/gtk/tests/pixbuf-init.c b/gtk/tests/pixbuf-init.c index 47573abc04..b5ab4f4b19 100644 --- a/gtk/tests/pixbuf-init.c +++ b/gtk/tests/pixbuf-init.c @@ -16,5 +16,5 @@ void pixbuf_init (void) { if (file_exists ("../../gdk-pixbuf/libpixbufloader-pnm.la")) - g_setenv ("GDK_PIXBUF_MODULE_FILE", "../../gdk-pixbuf/gdk-pixbuf.loaders", TRUE); + g_setenv ("GDK_PIXBUF_MODULE_FILE", "../../gdk-pixbuf/loaders.cache", TRUE); } diff --git a/gtk/tests/testing.c b/gtk/tests/testing.c index dcc2d02706..6208ac6181 100644 --- a/gtk/tests/testing.c +++ b/gtk/tests/testing.c @@ -98,13 +98,12 @@ test_slider_ranges (void) static void test_text_access (void) { - const int N_WIDGETS = 4; + const int N_WIDGETS = 3; GtkWidget *widgets[N_WIDGETS]; int i = 0; widgets[i++] = gtk_test_create_widget (GTK_TYPE_LABEL, NULL); widgets[i++] = gtk_test_create_widget (GTK_TYPE_ENTRY, NULL); widgets[i++] = gtk_test_create_widget (GTK_TYPE_TEXT_VIEW, NULL); - widgets[i++] = gtk_test_create_widget (g_type_from_name ("GtkText"), NULL); g_assert (i == N_WIDGETS); for (i = 0; i < N_WIDGETS; i++) gtk_test_text_set (widgets[i], "foobar"); diff --git a/m4macros/Makefile.am b/m4macros/Makefile.am index 82cd07ea66..c053ced4d2 100644 --- a/m4macros/Makefile.am +++ b/m4macros/Makefile.am @@ -1,6 +1,6 @@ include $(top_srcdir)/Makefile.decl -installed_m4= gtk-2.0.m4 +installed_m4= gtk-3.0.m4 EXTRA_DIST += $(installed_m4) diff --git a/m4macros/gtk-2.0.m4 b/m4macros/gtk-3.0.m4 similarity index 93% rename from m4macros/gtk-2.0.m4 rename to m4macros/gtk-3.0.m4 index 88596a969e..b24258654f 100644 --- a/m4macros/gtk-2.0.m4 +++ b/m4macros/gtk-3.0.m4 @@ -1,22 +1,22 @@ # Configure paths for GTK+ # Owen Taylor 1997-2001 -dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) +dnl AM_PATH_GTK_3_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES, dnl pass to pkg-config dnl -AC_DEFUN([AM_PATH_GTK_2_0], +AC_DEFUN([AM_PATH_GTK_3_0], [dnl dnl Get the cflags and libraries from pkg-config dnl AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program], , enable_gtktest=yes) - pkg_config_args=gtk+-2.0 + pkg_config_args=gtk+-3.0 for module in . $4 do case "$module" in - gthread) + gthread) pkg_config_args="$pkg_config_args gthread-2.0" ;; esac @@ -38,7 +38,7 @@ AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run no_gtk=yes fi - min_gtk_version=ifelse([$1], ,2.0.0,$1) + min_gtk_version=ifelse([$1], ,3.0.0,$1) AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version) if test x$PKG_CONFIG != xno ; then @@ -58,11 +58,11 @@ AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run if test x"$no_gtk" = x ; then GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags` GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs` - gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ + gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-3.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ + gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-3.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ + gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-3.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_gtktest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" @@ -98,7 +98,7 @@ main () (gtk_minor_version != $gtk_config_minor_version) || (gtk_micro_version != $gtk_config_micro_version)) { - printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", + printf("\n*** 'pkg-config --modversion gtk+-3.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, gtk_major_version, gtk_minor_version, gtk_micro_version); printf ("*** was found! If pkg-config was correct, then it is best\n"); @@ -152,7 +152,7 @@ main () fi if test "x$no_gtk" = x ; then AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version)) - ifelse([$2], , :, [$2]) + ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$PKG_CONFIG" = "no" ; then diff --git a/modules/engines/ms-windows/Makefile.am b/modules/engines/ms-windows/Makefile.am index 541bf9e8b2..663616deab 100644 --- a/modules/engines/ms-windows/Makefile.am +++ b/modules/engines/ms-windows/Makefile.am @@ -13,12 +13,12 @@ INCLUDES = \ LDADDS = \ - $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-2.0.la \ + $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-3.0.la \ $(top_builddir)/gdk/$(gdktargetlib) \ $(top_builddir)/gtk/$(gtktargetlib) \ $(GTK_DEP_LIBS) -enginedir = $(libdir)/gtk-2.0/$(GTK_BINARY_VERSION)/engines +enginedir = $(libdir)/gtk-3.0/$(GTK_BINARY_VERSION)/engines engine_LTLIBRARIES = libwimp.la diff --git a/modules/engines/ms-windows/Theme/Makefile.am b/modules/engines/ms-windows/Theme/Makefile.am index e7fad20372..dcb2dac4f0 100644 --- a/modules/engines/ms-windows/Theme/Makefile.am +++ b/modules/engines/ms-windows/Theme/Makefile.am @@ -1,5 +1,5 @@ include $(top_srcdir)/Makefile.decl -SUBDIRS=gtk-2.0 +SUBDIRS=gtk-3.0 -include $(top_srcdir)/git.mk diff --git a/modules/engines/ms-windows/Theme/gtk-2.0/Makefile.am b/modules/engines/ms-windows/Theme/gtk-3.0/Makefile.am similarity index 100% rename from modules/engines/ms-windows/Theme/gtk-2.0/Makefile.am rename to modules/engines/ms-windows/Theme/gtk-3.0/Makefile.am diff --git a/modules/engines/ms-windows/Theme/gtk-2.0/gtkrc b/modules/engines/ms-windows/Theme/gtk-3.0/gtkrc similarity index 100% rename from modules/engines/ms-windows/Theme/gtk-2.0/gtkrc rename to modules/engines/ms-windows/Theme/gtk-3.0/gtkrc diff --git a/modules/engines/ms-windows/msw_style.c b/modules/engines/ms-windows/msw_style.c index c69d1c7bb4..b9fb0dd0f2 100755 --- a/modules/engines/ms-windows/msw_style.c +++ b/modules/engines/ms-windows/msw_style.c @@ -2024,7 +2024,7 @@ draw_box (GtkStyle *style, if (detail && (!strcmp (detail, "button") || !strcmp (detail, "buttondefault"))) { - if (GTK_IS_TREE_VIEW (widget->parent) || GTK_IS_CLIST (widget->parent)) + if (GTK_IS_TREE_VIEW (widget->parent)) { if (xp_theme_draw (window, XP_THEME_ELEMENT_LIST_HEADER, style, x, y, @@ -3489,8 +3489,7 @@ draw_focus (GtkStyle *style, { return; } - if (GTK_IS_TREE_VIEW (widget->parent) /* list view bheader */ - || GTK_IS_CLIST (widget->parent)) + if (GTK_IS_TREE_VIEW (widget->parent) /* list view bheader */) { return; } diff --git a/modules/engines/pixbuf/Makefile.am b/modules/engines/pixbuf/Makefile.am index f90bdd5532..05f6ebb6ef 100644 --- a/modules/engines/pixbuf/Makefile.am +++ b/modules/engines/pixbuf/Makefile.am @@ -12,12 +12,12 @@ INCLUDES = \ $(GTK_DEP_CFLAGS) LDADDS = \ - $(GTK_DEP_LIBS) \ - $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-2.0.la \ - $(top_builddir)/gdk/$(gdktargetlib) \ - $(top_builddir)/gtk/$(gtktargetlib) + $(GTK_DEP_LIBS) \ + $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la \ + $(top_builddir)/gdk/$(gdktargetlib) \ + $(top_builddir)/gtk/$(gtktargetlib) -enginedir = $(libdir)/gtk-2.0/$(GTK_BINARY_VERSION)/engines +enginedir = $(libdir)/gtk-3.0/$(GTK_BINARY_VERSION)/engines engine_LTLIBRARIES = libpixmap.la diff --git a/modules/engines/pixbuf/pixbuf-draw.c b/modules/engines/pixbuf/pixbuf-draw.c index 38f2761232..f9188a2b86 100644 --- a/modules/engines/pixbuf/pixbuf-draw.c +++ b/modules/engines/pixbuf/pixbuf-draw.c @@ -586,44 +586,6 @@ draw_diamond (GtkStyle *style, x, y, width, height); } -static void -draw_string (GtkStyle * style, - GdkWindow * window, - GtkStateType state, - GdkRectangle * area, - GtkWidget * widget, - const gchar *detail, - gint x, - gint y, - const gchar * string) -{ - g_return_if_fail(style != NULL); - g_return_if_fail(window != NULL); - - if (state == GTK_STATE_INSENSITIVE) - { - if (area) - { - gdk_gc_set_clip_rectangle(style->white_gc, area); - gdk_gc_set_clip_rectangle(style->fg_gc[state], area); - } - - gdk_draw_string(window, gtk_style_get_font (style), style->fg_gc[state], x, y, string); - - if (area) - { - gdk_gc_set_clip_rectangle(style->white_gc, NULL); - gdk_gc_set_clip_rectangle(style->fg_gc[state], NULL); - } - } - else - { - gdk_gc_set_clip_rectangle(style->fg_gc[state], area); - gdk_draw_string(window, gtk_style_get_font (style), style->fg_gc[state], x, y, string); - gdk_gc_set_clip_rectangle(style->fg_gc[state], NULL); - } -} - static void draw_box (GtkStyle *style, GdkWindow *window, @@ -1094,7 +1056,6 @@ pixbuf_style_class_init (PixbufStyleClass *klass) style_class->draw_shadow = draw_shadow; style_class->draw_arrow = draw_arrow; style_class->draw_diamond = draw_diamond; - style_class->draw_string = draw_string; style_class->draw_box = draw_box; style_class->draw_flat_box = draw_flat_box; style_class->draw_check = draw_check; diff --git a/modules/input/Makefile.am b/modules/input/Makefile.am index 9a1bf2e861..01248fed04 100644 --- a/modules/input/Makefile.am +++ b/modules/input/Makefile.am @@ -27,7 +27,7 @@ LDADDS = \ $(top_builddir)/gtk/$(gtktargetlib) \ $(GTK_DEP_LIBS) -moduledir = $(libdir)/gtk-2.0/$(GTK_BINARY_VERSION)/immodules +moduledir = $(libdir)/gtk-3.0/$(GTK_BINARY_VERSION)/immodules im_xim_la_LDFLAGS = -rpath $(moduledir) -avoid-version -module $(no_undefined) im_xim_la_SOURCES = \ @@ -40,7 +40,7 @@ if HAVE_X11R6 if INCLUDE_IM_XIM STATIC_XIM_MODULE = libstatic-im-xim.la else -XIM_MODULE=im-xim.la +XIM_MODULE=im-xim.la endif endif @@ -152,7 +152,7 @@ if USE_WIN32 if INCLUDE_IM_IME STATIC_IME_MODULE = libstatic-im-ime.la else -IME_MODULE=im-ime.la +IME_MODULE=im-ime.la endif endif @@ -172,7 +172,7 @@ else MULTIPRESS_MODULE = im-multipress.la endif -imconffiledir = $(sysconfdir)/gtk-2.0 +imconffiledir = $(sysconfdir)/gtk-3.0 dist_imconffile_DATA = im-multipress.conf if CROSS_COMPILING @@ -189,21 +189,21 @@ endif # after the libraries are installed in their final locations. install-data-hook: @if $(RUN_QUERY_IMMODULES_TEST) ; then \ - echo $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/gtk-2.0 ; \ - $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/gtk-2.0 ; \ - echo "$(top_builddir)/gtk/gtk-query-immodules-2.0 > $(DESTDIR)$(sysconfdir)/gtk-2.0/gtk.immodules" ; \ - $(top_builddir)/gtk/gtk-query-immodules-2.0 > $(DESTDIR)$(sysconfdir)/gtk-2.0/gtk.immodules ; \ + echo $(mkinstalldirs) $(DESTDIR)$(libdir)/gtk-3.0/3.0.0 ; \ + $(mkinstalldirs) $(DESTDIR)$(libdir)/gtk-3.0/3.0.0 ; \ + echo "$(top_builddir)/gtk/gtk-query-immodules-3.0 > $(DESTDIR)$(libdir)/gtk-3.0/3.0.0/immodules.cache" ; \ + $(top_builddir)/gtk/gtk-query-immodules-3.0 > $(DESTDIR)$(libdir)/gtk-3.0/3.0.0/immodules.cache ; \ else \ echo "***" ; \ - echo "*** Warning: gtk.immodules not built" ; \ + echo "*** Warning: immodules.cache not built" ; \ echo "***" ; \ echo "*** Generate this file manually on host" ; \ - echo "*** system using gtk-query-immodules-2.0" ; \ + echo "*** system using gtk-query-immodules-3.0" ; \ echo "***" ; \ fi uninstall-local: - rm -f $(DESTDIR)$(sysconfdir)/gtk-2.0/gtk.immodules + rm -f $(DESTDIR)$(libdir)/gtk-3.0/3.0.0/immodules.cache if BUILD_DYNAMIC_MODULES @@ -239,14 +239,14 @@ noinst_LTLIBRARIES = \ included-modules: $(noinst_LTLIBRARIES) -gtk.immodules: Makefile.am $(module_LTLIBRARIES) - $(top_builddir)/gtk/gtk-query-immodules-2.0 $(module_LTLIBRARIES) > gtk.immodules +immodules.cache: Makefile.am $(module_LTLIBRARIES) + $(top_builddir)/gtk/gtk-query-immodules-3.0 $(module_LTLIBRARIES) > immodules.cache -CLEANFILES = gtk.immodules +CLEANFILES = immodules.cache if CROSS_COMPILING else -all-local: gtk.immodules +all-local: immodules.cache endif -include $(top_srcdir)/git.mk diff --git a/modules/other/gail/Makefile.am b/modules/other/gail/Makefile.am index 6ffe591db2..533207f131 100644 --- a/modules/other/gail/Makefile.am +++ b/modules/other/gail/Makefile.am @@ -6,7 +6,7 @@ if PLATFORM_WIN32 no_undefined = -no-undefined endif -moduledir = $(libdir)/gtk-2.0/modules +moduledir = $(libdir)/gtk-3.0/modules module_LTLIBRARIES = libgail.la gail_c_sources = \ @@ -22,9 +22,6 @@ gail_c_sources = \ gailcellparent.c \ gailcheckmenuitem.c \ gailchecksubmenuitem.c \ - gailclist.c \ - gailclistcell.c \ - gailcombo.c \ gailcombobox.c \ gailcontainer.c \ gailcontainercell.c \ @@ -35,16 +32,13 @@ gail_c_sources = \ gailimagecell.c \ gailitem.c \ gaillabel.c \ - gaillist.c \ gailmenu.c \ gailmenushell.c \ gailmenuitem.c \ gailnotebook.c \ gailnotebookpage.c \ gailobject.c \ - gailoptionmenu.c \ gailpaned.c \ - gailpixmap.c \ gailprogressbar.c \ gailradiobutton.c \ gailradiomenuitem.c \ @@ -68,7 +62,7 @@ gail_c_sources = \ gailwidget.c \ gailwindow.c -libgailincludedir=$(includedir)/gail-1.0/gail +libgailincludedir=$(includedir)/gail-3.0/gail gail_private_h_sources = \ gail.h \ @@ -82,9 +76,6 @@ gail_private_h_sources = \ gailcellparent.h \ gailcheckmenuitem.h \ gailchecksubmenuitem.h \ - gailclist.h \ - gailclistcell.h \ - gailcombo.h \ gailcombobox.h \ gailcontainercell.h \ gailcontainer.h \ @@ -96,16 +87,13 @@ gail_private_h_sources = \ gailimagecell.h \ gailitem.h \ gaillabel.h \ - gaillist.h \ gailmenu.h \ gailmenushell.h \ gailmenuitem.h \ gailnotebook.h \ gailnotebookpage.h \ gailobject.h \ - gailoptionmenu.h \ gailpaned.h \ - gailpixmap.h \ gailprogressbar.h \ gailradiobutton.h \ gailradiomenuitem.h \ @@ -160,7 +148,7 @@ libgail_la_LIBADD = \ $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la \ $(top_builddir)/gdk/$(gdktargetlib) \ $(top_builddir)/gtk/$(gtktargetlib) \ - $(top_builddir)/modules/other/gail/libgail-util/libgailutil.la \ + $(top_builddir)/modules/other/gail/libgail-util/libgailutil-3.0.la \ $(GTK_DEP_LIBS) \ $(INTLLIBS) diff --git a/modules/other/gail/gail.c b/modules/other/gail/gail.c index 133952c2bd..bea1e00357 100644 --- a/modules/other/gail/gail.c +++ b/modules/other/gail/gail.c @@ -22,8 +22,6 @@ #include #include -#undef GTK_DISABLE_DEPRECATED - #include #include "gail.h" #include "gailfactory.h" @@ -82,7 +80,6 @@ GAIL_IMPLEMENT_FACTORY_WITH_FUNC (GAIL_TYPE_MENU_ITEM, GailMenuItem, gail_menu_i GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_TOGGLE_BUTTON, GailToggleButton, gail_toggle_button, GTK_TYPE_TOGGLE_BUTTON) GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_IMAGE, GailImage, gail_image, GTK_TYPE_IMAGE) GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_TEXT_VIEW, GailTextView, gail_text_view, GTK_TYPE_TEXT_VIEW) -GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_COMBO, GailCombo, gail_combo, GTK_TYPE_COMBO) GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_COMBO_BOX, GailComboBox, gail_combo_box, GTK_TYPE_COMBO_BOX) GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_ENTRY, GailEntry, gail_entry, GTK_TYPE_ENTRY) GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_MENU_SHELL, GailMenuShell, gail_menu_shell, GTK_TYPE_MENU_SHELL) @@ -91,7 +88,6 @@ GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_WINDOW, GailWindow, gail_window, GTK_TYPE_BIN) GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_RANGE, GailRange, gail_range, GTK_TYPE_RANGE) GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_SCALE, GailScale, gail_scale, GTK_TYPE_SCALE) GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_SCALE_BUTTON, GailScaleButton, gail_scale_button, GTK_TYPE_SCALE_BUTTON) -GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_CLIST, GailCList, gail_clist, GTK_TYPE_CLIST) GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_LABEL, GailLabel, gail_label, GTK_TYPE_LABEL) GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_STATUSBAR, GailStatusbar, gail_statusbar, GTK_TYPE_STATUSBAR) GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_NOTEBOOK, GailNotebook, gail_notebook, GTK_TYPE_NOTEBOOK) @@ -102,14 +98,11 @@ GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_TREE_VIEW, GailTreeView, gail_tree_view, GTK_T GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_FRAME, GailFrame, gail_frame, GTK_TYPE_FRAME) GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_RADIO_BUTTON, GailRadioButton, gail_radio_button, GTK_TYPE_RADIO_BUTTON) GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_ARROW, GailArrow, gail_arrow, GTK_TYPE_ARROW) -GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_PIXMAP, GailPixmap, gail_pixmap, GTK_TYPE_PIXMAP) GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_SEPARATOR, GailSeparator, gail_separator, GTK_TYPE_SEPARATOR) GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_BOX, GailBox, gail_box, GTK_TYPE_BOX) GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_SCROLLED_WINDOW, GailScrolledWindow, gail_scrolled_window, GTK_TYPE_SCROLLED_WINDOW) -GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_LIST, GailList, gail_list, GTK_TYPE_LIST) GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_PANED, GailPaned, gail_paned, GTK_TYPE_PANED) GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_SCROLLBAR, GailScrollbar, gail_scrollbar, GTK_TYPE_SCROLLBAR) -GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_OPTION_MENU, GailOptionMenu, gail_option_menu, GTK_TYPE_OPTION_MENU) GAIL_IMPLEMENT_FACTORY_WITH_FUNC (GAIL_TYPE_CHECK_MENU_ITEM, GailCheckMenuItem, gail_check_menu_item, gail_check_menu_item_new) GAIL_IMPLEMENT_FACTORY_WITH_FUNC (GAIL_TYPE_RADIO_MENU_ITEM, GailRadioMenuItem, gail_radio_menu_item, gail_radio_menu_item_new) GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_EXPANDER, GailExpander, gail_expander, GTK_TYPE_EXPANDER) @@ -132,14 +125,7 @@ gail_get_accessible_for_widget (GtkWidget *widget, return NULL; if (GTK_IS_ENTRY (widget)) - { - GtkWidget *other_widget = widget->parent; - if (GTK_IS_COMBO (other_widget)) - { - gail_set_focus_widget (other_widget, widget); - widget = other_widget; - } - } + ; else if (GTK_IS_NOTEBOOK (widget)) { GtkNotebook *notebook; @@ -160,7 +146,7 @@ gail_get_accessible_for_widget (GtkWidget *widget, g_object_unref (obj); } } - else if (GTK_CHECK_TYPE ((widget), gnome_canvas)) + else if (G_TYPE_CHECK_INSTANCE_TYPE ((widget), gnome_canvas)) { GObject *focused_item; GValue value = {0, }; @@ -896,7 +882,6 @@ gail_accessibility_module_init (void) GAIL_WIDGET_SET_FACTORY (GTK_TYPE_TOGGLE_BUTTON, gail_toggle_button); GAIL_WIDGET_SET_FACTORY (GTK_TYPE_IMAGE, gail_image); GAIL_WIDGET_SET_FACTORY (GTK_TYPE_TEXT_VIEW, gail_text_view); - GAIL_WIDGET_SET_FACTORY (GTK_TYPE_COMBO, gail_combo); GAIL_WIDGET_SET_FACTORY (GTK_TYPE_COMBO_BOX, gail_combo_box); GAIL_WIDGET_SET_FACTORY (GTK_TYPE_ENTRY, gail_entry); GAIL_WIDGET_SET_FACTORY (GTK_TYPE_MENU_BAR, gail_menu_shell); @@ -905,7 +890,6 @@ gail_accessibility_module_init (void) GAIL_WIDGET_SET_FACTORY (GTK_TYPE_RANGE, gail_range); GAIL_WIDGET_SET_FACTORY (GTK_TYPE_SCALE, gail_scale); GAIL_WIDGET_SET_FACTORY (GTK_TYPE_SCALE_BUTTON, gail_scale_button); - GAIL_WIDGET_SET_FACTORY (GTK_TYPE_CLIST, gail_clist); GAIL_WIDGET_SET_FACTORY (GTK_TYPE_LABEL, gail_label); GAIL_WIDGET_SET_FACTORY (GTK_TYPE_STATUSBAR, gail_statusbar); GAIL_WIDGET_SET_FACTORY (GTK_TYPE_NOTEBOOK, gail_notebook); @@ -920,14 +904,11 @@ gail_accessibility_module_init (void) GAIL_WIDGET_SET_FACTORY (GTK_TYPE_CELL_RENDERER, gail_renderer_cell); GAIL_WIDGET_SET_FACTORY (GTK_TYPE_RADIO_BUTTON, gail_radio_button); GAIL_WIDGET_SET_FACTORY (GTK_TYPE_ARROW, gail_arrow); - GAIL_WIDGET_SET_FACTORY (GTK_TYPE_PIXMAP, gail_pixmap); GAIL_WIDGET_SET_FACTORY (GTK_TYPE_SEPARATOR, gail_separator); GAIL_WIDGET_SET_FACTORY (GTK_TYPE_BOX, gail_box); GAIL_WIDGET_SET_FACTORY (GTK_TYPE_SCROLLED_WINDOW, gail_scrolled_window); - GAIL_WIDGET_SET_FACTORY (GTK_TYPE_LIST, gail_list); GAIL_WIDGET_SET_FACTORY (GTK_TYPE_PANED, gail_paned); GAIL_WIDGET_SET_FACTORY (GTK_TYPE_SCROLLBAR, gail_scrollbar); - GAIL_WIDGET_SET_FACTORY (GTK_TYPE_OPTION_MENU, gail_option_menu); GAIL_WIDGET_SET_FACTORY (GTK_TYPE_CHECK_MENU_ITEM, gail_check_menu_item); GAIL_WIDGET_SET_FACTORY (GTK_TYPE_RADIO_MENU_ITEM, gail_radio_menu_item); GAIL_WIDGET_SET_FACTORY (GTK_TYPE_EXPANDER, gail_expander); diff --git a/modules/other/gail/gail.h b/modules/other/gail/gail.h index 97da104c3d..03ed72afaf 100644 --- a/modules/other/gail/gail.h +++ b/modules/other/gail/gail.h @@ -6,9 +6,6 @@ #include #include #include -#include -#include -#include #include #include #include @@ -19,15 +16,12 @@ #include #include #include -#include #include #include #include #include #include -#include #include -#include #include #include #include diff --git a/modules/other/gail/gailbooleancell.c b/modules/other/gail/gailbooleancell.c index 5c86d043e0..0aefcfa792 100644 --- a/modules/other/gail/gailbooleancell.c +++ b/modules/other/gail/gailbooleancell.c @@ -36,8 +36,7 @@ gchar *gail_boolean_cell_property_list[] = { NULL }; -G_DEFINE_TYPE_WITH_CODE (GailBooleanCell, gail_boolean_cell, GAIL_TYPE_RENDERER_CELL, - gail_cell_type_add_action_interface (g_define_type_id)) +G_DEFINE_TYPE (GailBooleanCell, gail_boolean_cell, GAIL_TYPE_RENDERER_CELL) static void gail_boolean_cell_class_init (GailBooleanCellClass *klass) diff --git a/modules/other/gail/gailcell.c b/modules/other/gail/gailcell.c index 35e531eefc..bc8dd131f4 100644 --- a/modules/other/gail/gailcell.c +++ b/modules/other/gail/gailcell.c @@ -37,7 +37,7 @@ static gint gail_cell_get_index_in_parent (AtkObject *obj); /* AtkAction */ -static void gail_cell_atk_action_interface_init +static void atk_action_interface_init (AtkActionIface *iface); static ActionInfo * _gail_cell_get_action_info (GailCell *cell, gint index); @@ -76,6 +76,7 @@ static void gail_cell_get_extents (AtkComponent *componen static gboolean gail_cell_grab_focus (AtkComponent *component); G_DEFINE_TYPE_WITH_CODE (GailCell, gail_cell, ATK_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_interface_init) G_IMPLEMENT_INTERFACE (ATK_TYPE_COMPONENT, atk_component_interface_init)) static void @@ -285,7 +286,7 @@ gail_cell_get_index_in_parent (AtkObject *obj) } static void -gail_cell_atk_action_interface_init (AtkActionIface *iface) +atk_action_interface_init (AtkActionIface *iface) { iface->get_n_actions = gail_cell_action_get_n_actions; iface->do_action = gail_cell_action_do_action; @@ -298,14 +299,6 @@ gail_cell_atk_action_interface_init (AtkActionIface *iface) void gail_cell_type_add_action_interface (GType type) { - const GInterfaceInfo atk_action_info = - { - (GInterfaceInitFunc) gail_cell_atk_action_interface_init, - (GInterfaceFinalizeFunc) NULL, - NULL - }; - g_type_add_interface_static (type, ATK_TYPE_ACTION, - &atk_action_info); } gboolean diff --git a/modules/other/gail/gailcheckmenuitem.c b/modules/other/gail/gailcheckmenuitem.c index 45c3c5b786..e203e189c7 100644 --- a/modules/other/gail/gailcheckmenuitem.c +++ b/modules/other/gail/gailcheckmenuitem.c @@ -138,7 +138,19 @@ gail_check_menu_item_real_notify_gtk (GObject *obj, if (strcmp (pspec->name, "inconsistent") == 0) atk_object_notify_state_change (atk_obj, ATK_STATE_ENABLED, - !gtk_check_menu_item_get_inconsistent (check_menu_item)); + (gtk_widget_get_sensitive (GTK_WIDGET (check_menu_item)) && + !gtk_check_menu_item_get_inconsistent (check_menu_item))); + else if (strcmp (pspec->name, "sensitive") == 0) + { + /* Need to override gailwidget behavior of notifying for ENABLED */ + gboolean sensitive; + gboolean enabled; + sensitive = gtk_widget_get_sensitive (GTK_WIDGET (check_menu_item)); + enabled = sensitive && + !gtk_check_menu_item_get_inconsistent (check_menu_item); + atk_object_notify_state_change (atk_obj, ATK_STATE_SENSITIVE, sensitive); + atk_object_notify_state_change (atk_obj, ATK_STATE_ENABLED, enabled); + } else GAIL_WIDGET_CLASS (gail_check_menu_item_parent_class)->notify_gtk (obj, pspec); } diff --git a/modules/other/gail/gailchecksubmenuitem.c b/modules/other/gail/gailchecksubmenuitem.c index fe400d79b9..d643268c9a 100644 --- a/modules/other/gail/gailchecksubmenuitem.c +++ b/modules/other/gail/gailchecksubmenuitem.c @@ -135,7 +135,19 @@ gail_check_sub_menu_item_real_notify_gtk (GObject *obj, if (strcmp (pspec->name, "inconsistent") == 0) atk_object_notify_state_change (atk_obj, ATK_STATE_ENABLED, - !gtk_check_menu_item_get_inconsistent (check_menu_item)); + (gtk_widget_get_sensitive (GTK_WIDGET (check_menu_item)) && + !gtk_check_menu_item_get_inconsistent (check_menu_item))); + else if (strcmp (pspec->name, "sensitive") == 0) + { + /* Need to override gailwidget behavior of notifying for ENABLED */ + gboolean sensitive; + gboolean enabled; + sensitive = gtk_widget_get_sensitive (GTK_WIDGET (check_menu_item)); + enabled = sensitive && + !gtk_check_menu_item_get_inconsistent (check_menu_item); + atk_object_notify_state_change (atk_obj, ATK_STATE_SENSITIVE, sensitive); + atk_object_notify_state_change (atk_obj, ATK_STATE_ENABLED, enabled); + } else GAIL_WIDGET_CLASS (gail_check_sub_menu_item_parent_class)->notify_gtk (obj, pspec); } diff --git a/modules/other/gail/gailclist.c b/modules/other/gail/gailclist.c deleted file mode 100644 index 6a68ffe8aa..0000000000 --- a/modules/other/gail/gailclist.c +++ /dev/null @@ -1,1609 +0,0 @@ -/* GAIL - The GNOME Accessibility Implementation Library - * Copyright 2001 Sun Microsystems Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include "config.h" - -#include - -#undef GTK_DISABLE_DEPRECATED - -#include -#include "gailclist.h" -#include "gailclistcell.h" -#include "gailcellparent.h" - -/* Copied from gtkclist.c */ -/* this defigns the base grid spacing */ -#define CELL_SPACING 1 - -/* added the horizontal space at the beginning and end of a row*/ -#define COLUMN_INSET 3 - - -/* gives the top pixel of the given row in context of - * the clist's voffset */ -#define ROW_TOP_YPIXEL(clist, row) (((clist)->row_height * (row)) + \ - (((row) + 1) * CELL_SPACING) + \ - (clist)->voffset) - -/* returns the row index from a y pixel location in the - * context of the clist's voffset */ -#define ROW_FROM_YPIXEL(clist, y) (((y) - (clist)->voffset) / \ - ((clist)->row_height + CELL_SPACING)) -/* gives the left pixel of the given column in context of - * the clist's hoffset */ -#define COLUMN_LEFT_XPIXEL(clist, colnum) ((clist)->column[(colnum)].area.x + \ - (clist)->hoffset) - -/* returns the column index from a x pixel location in the - * context of the clist's hoffset */ -static inline gint -COLUMN_FROM_XPIXEL (GtkCList * clist, - gint x) -{ - gint i, cx; - - for (i = 0; i < clist->columns; i++) - if (clist->column[i].visible) - { - cx = clist->column[i].area.x + clist->hoffset; - - if (x >= (cx - (COLUMN_INSET + CELL_SPACING)) && - x <= (cx + clist->column[i].area.width + COLUMN_INSET)) - return i; - } - - /* no match */ - return -1; -} - -/* returns the top pixel of the given row in the context of - * the list height */ -#define ROW_TOP(clist, row) (((clist)->row_height + CELL_SPACING) * (row)) - -/* returns the left pixel of the given column in the context of - * the list width */ -#define COLUMN_LEFT(clist, colnum) ((clist)->column[(colnum)].area.x) - -/* returns the total height of the list */ -#define LIST_HEIGHT(clist) (((clist)->row_height * ((clist)->rows)) + \ - (CELL_SPACING * ((clist)->rows + 1))) - -static inline gint -LIST_WIDTH (GtkCList * clist) -{ - gint last_column; - - for (last_column = clist->columns - 1; - last_column >= 0 && !clist->column[last_column].visible; last_column--); - - if (last_column >= 0) - return (clist->column[last_column].area.x + - clist->column[last_column].area.width + - COLUMN_INSET + CELL_SPACING); - return 0; -} - -/* returns the GList item for the nth row */ -#define ROW_ELEMENT(clist, row) (((row) == (clist)->rows - 1) ? \ - (clist)->row_list_end : \ - g_list_nth ((clist)->row_list, (row))) - -typedef struct _GailCListRow GailCListRow; -typedef struct _GailCListCellData GailCListCellData; - - -static void gail_clist_class_init (GailCListClass *klass); -static void gail_clist_init (GailCList *clist); -static void gail_clist_real_initialize (AtkObject *obj, - gpointer data); -static void gail_clist_finalize (GObject *object); - -static gint gail_clist_get_n_children (AtkObject *obj); -static AtkObject* gail_clist_ref_child (AtkObject *obj, - gint i); -static AtkStateSet* gail_clist_ref_state_set (AtkObject *obj); - - -static void atk_selection_interface_init (AtkSelectionIface *iface); -static gboolean gail_clist_clear_selection (AtkSelection *selection); - -static AtkObject* gail_clist_ref_selection (AtkSelection *selection, - gint i); -static gint gail_clist_get_selection_count (AtkSelection *selection); -static gboolean gail_clist_is_child_selected (AtkSelection *selection, - gint i); -static gboolean gail_clist_select_all_selection (AtkSelection *selection); - -static void atk_table_interface_init (AtkTableIface *iface); -static gint gail_clist_get_index_at (AtkTable *table, - gint row, - gint column); -static gint gail_clist_get_column_at_index (AtkTable *table, - gint index); -static gint gail_clist_get_row_at_index (AtkTable *table, - gint index); -static AtkObject* gail_clist_ref_at (AtkTable *table, - gint row, - gint column); -static AtkObject* gail_clist_ref_at_actual (AtkTable *table, - gint row, - gint column); -static AtkObject* - gail_clist_get_caption (AtkTable *table); - -static gint gail_clist_get_n_columns (AtkTable *table); -static gint gail_clist_get_n_actual_columns (GtkCList *clist); - -static G_CONST_RETURN gchar* - gail_clist_get_column_description(AtkTable *table, - gint column); -static AtkObject* gail_clist_get_column_header (AtkTable *table, - gint column); -static gint gail_clist_get_n_rows (AtkTable *table); -static G_CONST_RETURN gchar* - gail_clist_get_row_description (AtkTable *table, - gint row); -static AtkObject* gail_clist_get_row_header (AtkTable *table, - gint row); -static AtkObject* gail_clist_get_summary (AtkTable *table); -static gboolean gail_clist_add_row_selection (AtkTable *table, - gint row); -static gboolean gail_clist_remove_row_selection (AtkTable *table, - gint row); -static gint gail_clist_get_selected_rows (AtkTable *table, - gint **rows_selected); -static gboolean gail_clist_is_row_selected (AtkTable *table, - gint row); -static gboolean gail_clist_is_selected (AtkTable *table, - gint row, - gint column); -static void gail_clist_set_caption (AtkTable *table, - AtkObject *caption); -static void gail_clist_set_column_description(AtkTable *table, - gint column, - const gchar *description); -static void gail_clist_set_column_header (AtkTable *table, - gint column, - AtkObject *header); -static void gail_clist_set_row_description (AtkTable *table, - gint row, - const gchar *description); -static void gail_clist_set_row_header (AtkTable *table, - gint row, - AtkObject *header); -static void gail_clist_set_summary (AtkTable *table, - AtkObject *accessible); - -/* gailcellparent.h */ - -static void gail_cell_parent_interface_init (GailCellParentIface *iface); -static void gail_clist_get_cell_extents (GailCellParent *parent, - GailCell *cell, - gint *x, - gint *y, - gint *width, - gint *height, - AtkCoordType coord_type); - -static void gail_clist_get_cell_area (GailCellParent *parent, - GailCell *cell, - GdkRectangle *cell_rect); - -static void gail_clist_select_row_gtk (GtkCList *clist, - int row, - int column, - GdkEvent *event, - gpointer data); -static void gail_clist_unselect_row_gtk (GtkCList *clist, - int row, - int column, - GdkEvent *event, - gpointer data); -static gint gail_clist_get_visible_column (AtkTable *table, - int column); -static gint gail_clist_get_actual_column (AtkTable *table, - int visible_column); -static void gail_clist_set_row_data (AtkTable *table, - gint row, - const gchar *description, - AtkObject *header, - gboolean is_header); -static GailCListRow* - gail_clist_get_row_data (AtkTable *table, - gint row); -static void gail_clist_get_visible_rect (GtkCList *clist, - GdkRectangle *clist_rect); -static gboolean gail_clist_is_cell_visible (GdkRectangle *cell_rect, - GdkRectangle *visible_rect); -static void gail_clist_cell_data_new (GailCList *clist, - GailCell *cell, - gint column, - gint row); -static void gail_clist_cell_destroyed (gpointer data); -static void gail_clist_cell_data_remove (GailCList *clist, - GailCell *cell); -static GailCell* gail_clist_find_cell (GailCList *clist, - gint index); -static void gail_clist_adjustment_changed (GtkAdjustment *adjustment, - GtkCList *clist); - -struct _GailCListColumn -{ - gchar *description; - AtkObject *header; -}; - -struct _GailCListRow -{ - GtkCListRow *row_data; - int row_number; - gchar *description; - AtkObject *header; -}; - -struct _GailCListCellData -{ - GtkCell *gtk_cell; - GailCell *gail_cell; - int row_number; - int column_number; -}; - -G_DEFINE_TYPE_WITH_CODE (GailCList, gail_clist, GAIL_TYPE_CONTAINER, - G_IMPLEMENT_INTERFACE (ATK_TYPE_TABLE, atk_table_interface_init) - G_IMPLEMENT_INTERFACE (ATK_TYPE_SELECTION, atk_selection_interface_init) - G_IMPLEMENT_INTERFACE (GAIL_TYPE_CELL_PARENT, gail_cell_parent_interface_init)) - -static void -gail_clist_class_init (GailCListClass *klass) -{ - AtkObjectClass *class = ATK_OBJECT_CLASS (klass); - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - - class->get_n_children = gail_clist_get_n_children; - class->ref_child = gail_clist_ref_child; - class->ref_state_set = gail_clist_ref_state_set; - class->initialize = gail_clist_real_initialize; - - gobject_class->finalize = gail_clist_finalize; -} - -static void -gail_clist_init (GailCList *clist) -{ -} - -static void -gail_clist_real_initialize (AtkObject *obj, - gpointer data) -{ - GailCList *clist; - GtkCList *gtk_clist; - gint i; - - ATK_OBJECT_CLASS (gail_clist_parent_class)->initialize (obj, data); - - obj->role = ATK_ROLE_TABLE; - - clist = GAIL_CLIST (obj); - - clist->caption = NULL; - clist->summary = NULL; - clist->row_data = NULL; - clist->cell_data = NULL; - clist->previous_selected_cell = NULL; - - gtk_clist = GTK_CLIST (data); - - clist->n_cols = gtk_clist->columns; - clist->columns = g_new (GailCListColumn, gtk_clist->columns); - for (i = 0; i < gtk_clist->columns; i++) - { - clist->columns[i].description = NULL; - clist->columns[i].header = NULL; - } - /* - * Set up signal handlers for select-row and unselect-row - */ - g_signal_connect (gtk_clist, - "select-row", - G_CALLBACK (gail_clist_select_row_gtk), - obj); - g_signal_connect (gtk_clist, - "unselect-row", - G_CALLBACK (gail_clist_unselect_row_gtk), - obj); - /* - * Adjustment callbacks - */ - if (gtk_clist->hadjustment) - { - g_signal_connect (gtk_clist->hadjustment, - "value_changed", - G_CALLBACK (gail_clist_adjustment_changed), - gtk_clist); - } - if (gtk_clist->vadjustment) - { - g_signal_connect (gtk_clist->vadjustment, - "value_changed", - G_CALLBACK (gail_clist_adjustment_changed), - gtk_clist); - } -} - -static void -gail_clist_finalize (GObject *object) -{ - GailCList *clist = GAIL_CLIST (object); - gint i; - GArray *array; - - if (clist->caption) - g_object_unref (clist->caption); - if (clist->summary) - g_object_unref (clist->summary); - - for (i = 0; i < clist->n_cols; i++) - { - g_free (clist->columns[i].description); - if (clist->columns[i].header) - g_object_unref (clist->columns[i].header); - } - g_free (clist->columns); - - array = clist->row_data; - - if (clist->previous_selected_cell) - g_object_unref (clist->previous_selected_cell); - - if (array) - { - for (i = 0; i < array->len; i++) - { - GailCListRow *row_data; - - row_data = g_array_index (array, GailCListRow*, i); - - if (row_data->header) - g_object_unref (row_data->header); - g_free (row_data->description); - } - } - - if (clist->cell_data) - { - GList *temp_list; - - for (temp_list = clist->cell_data; temp_list; temp_list = temp_list->next) - { - g_list_free (temp_list->data); - } - g_list_free (clist->cell_data); - } - - G_OBJECT_CLASS (gail_clist_parent_class)->finalize (object); -} - -static gint -gail_clist_get_n_children (AtkObject *obj) -{ - GtkWidget *widget; - gint row, col; - - g_return_val_if_fail (GAIL_IS_CLIST (obj), 0); - - widget = GTK_ACCESSIBLE (obj)->widget; - if (widget == NULL) - /* - * State is defunct - */ - return 0; - - row = gail_clist_get_n_rows (ATK_TABLE (obj)); - col = gail_clist_get_n_actual_columns (GTK_CLIST (widget)); - return (row * col); -} - -static AtkObject* -gail_clist_ref_child (AtkObject *obj, - gint i) -{ - GtkWidget *widget; - gint row, col; - gint n_columns; - - g_return_val_if_fail (GAIL_IS_CLIST (obj), NULL); - g_return_val_if_fail (i >= 0, NULL); - - widget = GTK_ACCESSIBLE (obj)->widget; - if (widget == NULL) - /* - * State is defunct - */ - return NULL; - - n_columns = gail_clist_get_n_actual_columns (GTK_CLIST (widget)); - if (!n_columns) - return NULL; - - row = i / n_columns; - col = i % n_columns; - return gail_clist_ref_at_actual (ATK_TABLE (obj), row, col); -} - -static AtkStateSet* -gail_clist_ref_state_set (AtkObject *obj) -{ - AtkStateSet *state_set; - GtkWidget *widget; - - state_set = ATK_OBJECT_CLASS (gail_clist_parent_class)->ref_state_set (obj); - widget = GTK_ACCESSIBLE (obj)->widget; - - if (widget != NULL) - atk_state_set_add_state (state_set, ATK_STATE_MANAGES_DESCENDANTS); - - return state_set; -} - -static void -atk_selection_interface_init (AtkSelectionIface *iface) -{ - iface->clear_selection = gail_clist_clear_selection; - iface->ref_selection = gail_clist_ref_selection; - iface->get_selection_count = gail_clist_get_selection_count; - iface->is_child_selected = gail_clist_is_child_selected; - iface->select_all_selection = gail_clist_select_all_selection; -} - -static gboolean -gail_clist_clear_selection (AtkSelection *selection) -{ - GtkCList *clist; - GtkWidget *widget; - - widget = GTK_ACCESSIBLE (selection)->widget; - if (widget == NULL) - /* State is defunct */ - return FALSE; - - clist = GTK_CLIST (widget); - gtk_clist_unselect_all(clist); - return TRUE; -} - -static AtkObject* -gail_clist_ref_selection (AtkSelection *selection, - gint i) -{ - gint visible_columns; - gint selected_row; - gint selected_column; - gint *selected_rows; - - if ( i < 0 && i >= gail_clist_get_selection_count (selection)) - return NULL; - - visible_columns = gail_clist_get_n_columns (ATK_TABLE (selection)); - gail_clist_get_selected_rows (ATK_TABLE (selection), &selected_rows); - selected_row = selected_rows[i / visible_columns]; - g_free (selected_rows); - selected_column = gail_clist_get_actual_column (ATK_TABLE (selection), - i % visible_columns); - - return gail_clist_ref_at (ATK_TABLE (selection), selected_row, - selected_column); -} - -static gint -gail_clist_get_selection_count (AtkSelection *selection) -{ - gint n_rows_selected; - - n_rows_selected = gail_clist_get_selected_rows (ATK_TABLE (selection), NULL); - - if (n_rows_selected > 0) - /* - * The number of cells selected is the number of columns - * times the number of selected rows - */ - return gail_clist_get_n_columns (ATK_TABLE (selection)) * n_rows_selected; - return 0; -} - -static gboolean -gail_clist_is_child_selected (AtkSelection *selection, - gint i) -{ - gint row; - - row = atk_table_get_row_at_index (ATK_TABLE (selection), i); - - if (row == 0 && i >= gail_clist_get_n_columns (ATK_TABLE (selection))) - return FALSE; - return gail_clist_is_row_selected (ATK_TABLE (selection), row); -} - -static gboolean -gail_clist_select_all_selection (AtkSelection *selection) -{ - GtkCList *clist; - GtkWidget *widget; - /* GtkArg arg; */ - - widget = GTK_ACCESSIBLE (selection)->widget; - if (widget == NULL) - /* State is defunct */ - return FALSE; - - clist = GTK_CLIST (widget); - gtk_clist_select_all(clist); - - return TRUE; -} - -static void -atk_table_interface_init (AtkTableIface *iface) -{ - iface->ref_at = gail_clist_ref_at; - iface->get_index_at = gail_clist_get_index_at; - iface->get_column_at_index = gail_clist_get_column_at_index; - iface->get_row_at_index = gail_clist_get_row_at_index; - iface->get_caption = gail_clist_get_caption; - iface->get_n_columns = gail_clist_get_n_columns; - iface->get_column_description = gail_clist_get_column_description; - iface->get_column_header = gail_clist_get_column_header; - iface->get_n_rows = gail_clist_get_n_rows; - iface->get_row_description = gail_clist_get_row_description; - iface->get_row_header = gail_clist_get_row_header; - iface->get_summary = gail_clist_get_summary; - iface->add_row_selection = gail_clist_add_row_selection; - iface->remove_row_selection = gail_clist_remove_row_selection; - iface->get_selected_rows = gail_clist_get_selected_rows; - iface->is_row_selected = gail_clist_is_row_selected; - iface->is_selected = gail_clist_is_selected; - iface->set_caption = gail_clist_set_caption; - iface->set_column_description = gail_clist_set_column_description; - iface->set_column_header = gail_clist_set_column_header; - iface->set_row_description = gail_clist_set_row_description; - iface->set_row_header = gail_clist_set_row_header; - iface->set_summary = gail_clist_set_summary; -} - -static AtkObject* -gail_clist_ref_at (AtkTable *table, - gint row, - gint column) -{ - GtkWidget *widget; - gint actual_column; - - widget = GTK_ACCESSIBLE (table)->widget; - if (widget == NULL) - /* State is defunct */ - return NULL; - - actual_column = gail_clist_get_actual_column (table, column); - return gail_clist_ref_at_actual (table, row, actual_column); -} - - -static AtkObject* -gail_clist_ref_at_actual (AtkTable *table, - gint row, - gint column) -{ - /* - * The column number pased to this function is the actual column number - * whereas the column number passed to gail_clist_ref_at is the - * visible column number - */ - GtkCList *clist; - GtkWidget *widget; - GtkCellType cellType; - AtkObject *return_object; - gint n_rows, n_columns; - gint index; - GailCell *cell; - - g_return_val_if_fail (GTK_IS_ACCESSIBLE (table), NULL); - - widget = GTK_ACCESSIBLE (table)->widget; - if (widget == NULL) - /* State is defunct */ - return NULL; - - clist = GTK_CLIST (widget); - n_rows = gail_clist_get_n_rows (table); - n_columns = gail_clist_get_n_actual_columns (clist); - - if (row < 0 || row >= n_rows) - return NULL; - if (column < 0 || column >= n_columns) - return NULL; - - /* - * Check whether the child is cached - */ - index = column + row * n_columns; - cell = gail_clist_find_cell (GAIL_CLIST (table), index); - if (cell) - { - g_object_ref (cell); - return ATK_OBJECT (cell); - } - cellType = gtk_clist_get_cell_type(clist, row, column); - switch (cellType) - { - case GTK_CELL_TEXT: - case GTK_CELL_PIXTEXT: - return_object = gail_clist_cell_new (); - break; - case GTK_CELL_PIXMAP: - return_object = NULL; - break; - default: - /* Don't handle GTK_CELL_EMPTY or GTK_CELL_WIDGET, return NULL */ - return_object = NULL; - break; - } - if (return_object) - { - cell = GAIL_CELL (return_object); - - g_return_val_if_fail (ATK_IS_OBJECT (table), NULL); - - gail_cell_initialise (cell, widget, ATK_OBJECT (table), - index); - /* - * Store the cell in a cache - */ - gail_clist_cell_data_new (GAIL_CLIST (table), cell, column, row); - /* - * If the column is visible, sets the cell's state - */ - if (clist->column[column].visible) - { - GdkRectangle cell_rect, visible_rect; - - gail_clist_get_cell_area (GAIL_CELL_PARENT (table), cell, &cell_rect); - gail_clist_get_visible_rect (clist, &visible_rect); - gail_cell_add_state (cell, ATK_STATE_VISIBLE, FALSE); - if (gail_clist_is_cell_visible (&cell_rect, &visible_rect)) - gail_cell_add_state (cell, ATK_STATE_SHOWING, FALSE); - } - /* - * If a row is selected, all cells in the row are selected - */ - if (gail_clist_is_row_selected (table, row)) - { - gail_cell_add_state (cell, ATK_STATE_SELECTED, FALSE); - if (clist->columns == 1) - gail_cell_add_state (cell, ATK_STATE_FOCUSED, FALSE); - } - } - - return return_object; -} - -static gint -gail_clist_get_index_at (AtkTable *table, - gint row, - gint column) -{ - gint n_cols, n_rows; - - n_cols = atk_table_get_n_columns (table); - n_rows = atk_table_get_n_rows (table); - - g_return_val_if_fail (row < n_rows, 0); - g_return_val_if_fail (column < n_cols, 0); - - return row * n_cols + column; -} - -static gint -gail_clist_get_column_at_index (AtkTable *table, - gint index) -{ - gint n_cols; - - n_cols = atk_table_get_n_columns (table); - - if (n_cols == 0) - return 0; - else - return (gint) (index % n_cols); -} - -static gint -gail_clist_get_row_at_index (AtkTable *table, - gint index) -{ - gint n_cols; - - n_cols = atk_table_get_n_columns (table); - - if (n_cols == 0) - return 0; - else - return (gint) (index / n_cols); -} - -static AtkObject* -gail_clist_get_caption (AtkTable *table) -{ - GailCList* obj = GAIL_CLIST (table); - - return obj->caption; -} - -static gint -gail_clist_get_n_columns (AtkTable *table) -{ - GtkWidget *widget; - GtkCList *clist; - - widget = GTK_ACCESSIBLE (table)->widget; - if (widget == NULL) - /* State is defunct */ - return 0; - - clist = GTK_CLIST (widget); - - return gail_clist_get_visible_column (table, - gail_clist_get_n_actual_columns (clist)); -} - -static gint -gail_clist_get_n_actual_columns (GtkCList *clist) -{ - return clist->columns; -} - -static G_CONST_RETURN gchar* -gail_clist_get_column_description (AtkTable *table, - gint column) -{ - GailCList *clist = GAIL_CLIST (table); - GtkWidget *widget; - gint actual_column; - - if (column < 0 || column >= gail_clist_get_n_columns (table)) - return NULL; - - actual_column = gail_clist_get_actual_column (table, column); - if (clist->columns[actual_column].description) - return (clist->columns[actual_column].description); - - widget = GTK_ACCESSIBLE (clist)->widget; - if (widget == NULL) - return NULL; - - return gtk_clist_get_column_title (GTK_CLIST (widget), actual_column); -} - -static AtkObject* -gail_clist_get_column_header (AtkTable *table, - gint column) -{ - GailCList *clist = GAIL_CLIST (table); - GtkWidget *widget; - GtkWidget *return_widget; - gint actual_column; - - if (column < 0 || column >= gail_clist_get_n_columns (table)) - return NULL; - - actual_column = gail_clist_get_actual_column (table, column); - - if (clist->columns[actual_column].header) - return (clist->columns[actual_column].header); - - widget = GTK_ACCESSIBLE (clist)->widget; - if (widget == NULL) - return NULL; - - return_widget = gtk_clist_get_column_widget (GTK_CLIST (widget), - actual_column); - if (return_widget == NULL) - return NULL; - - g_return_val_if_fail (GTK_IS_BIN (return_widget), NULL); - return_widget = gtk_bin_get_child (GTK_BIN(return_widget)); - - return gtk_widget_get_accessible (return_widget); -} - -static gint -gail_clist_get_n_rows (AtkTable *table) -{ - GtkWidget *widget; - GtkCList *clist; - - widget = GTK_ACCESSIBLE (table)->widget; - if (widget == NULL) - /* State is defunct */ - return 0; - - clist = GTK_CLIST (widget); - return clist->rows; -} - -static G_CONST_RETURN gchar* -gail_clist_get_row_description (AtkTable *table, - gint row) -{ - GailCListRow* row_data; - - row_data = gail_clist_get_row_data (table, row); - if (row_data == NULL) - return NULL; - return row_data->description; -} - -static AtkObject* -gail_clist_get_row_header (AtkTable *table, - gint row) -{ - GailCListRow* row_data; - - row_data = gail_clist_get_row_data (table, row); - if (row_data == NULL) - return NULL; - return row_data->header; -} - -static AtkObject* -gail_clist_get_summary (AtkTable *table) -{ - GailCList* obj = GAIL_CLIST (table); - - return obj->summary; -} - -static gboolean -gail_clist_add_row_selection (AtkTable *table, - gint row) -{ - GtkWidget *widget; - GtkCList *clist; - - widget = GTK_ACCESSIBLE (table)->widget; - if (widget == NULL) - /* State is defunct */ - return 0; - - clist = GTK_CLIST (widget); - gtk_clist_select_row (clist, row, -1); - if (gail_clist_is_row_selected (table, row)) - return TRUE; - - return FALSE; -} - -static gboolean -gail_clist_remove_row_selection (AtkTable *table, - gint row) -{ - GtkWidget *widget; - GtkCList *clist; - - widget = GTK_ACCESSIBLE (table)->widget; - if (widget == NULL) - /* State is defunct */ - return 0; - - clist = GTK_CLIST (widget); - if (gail_clist_is_row_selected (table, row)) - { - gtk_clist_select_row (clist, row, -1); - return TRUE; - } - return FALSE; -} - -static gint -gail_clist_get_selected_rows (AtkTable *table, - gint **rows_selected) -{ - GtkWidget *widget; - GtkCList *clist; - GList *list; - gint n_selected; - gint i; - - widget = GTK_ACCESSIBLE (table)->widget; - if (widget == NULL) - /* State is defunct */ - return 0; - - clist = GTK_CLIST (widget); - - n_selected = g_list_length (clist->selection); - - if (n_selected == 0) - return 0; - - if (rows_selected) - { - gint *selected_rows; - - selected_rows = (gint*) g_malloc (sizeof (gint) * n_selected); - list = clist->selection; - - i = 0; - while (list) - { - selected_rows[i++] = GPOINTER_TO_INT (list->data); - list = list->next; - } - *rows_selected = selected_rows; - } - return n_selected; -} - -static gboolean -gail_clist_is_row_selected (AtkTable *table, - gint row) -{ - GList *elem; - GtkWidget *widget; - GtkCList *clist; - GtkCListRow *clist_row; - - widget = GTK_ACCESSIBLE (table)->widget; - if (widget == NULL) - /* State is defunct */ - return FALSE; - - clist = GTK_CLIST (widget); - - if (row < 0 || row >= clist->rows) - return FALSE; - - elem = ROW_ELEMENT (clist, row); - if (!elem) - return FALSE; - clist_row = elem->data; - - return (clist_row->state == GTK_STATE_SELECTED); -} - -static gboolean -gail_clist_is_selected (AtkTable *table, - gint row, - gint column) -{ - return gail_clist_is_row_selected (table, row); -} - -static void -gail_clist_set_caption (AtkTable *table, - AtkObject *caption) -{ - GailCList* obj = GAIL_CLIST (table); - AtkPropertyValues values = { NULL }; - AtkObject *old_caption; - - old_caption = obj->caption; - obj->caption = caption; - if (obj->caption) - g_object_ref (obj->caption); - - g_value_init (&values.old_value, G_TYPE_POINTER); - g_value_set_pointer (&values.old_value, old_caption); - g_value_init (&values.new_value, G_TYPE_POINTER); - g_value_set_pointer (&values.new_value, obj->caption); - - values.property_name = "accessible-table-caption"; - g_signal_emit_by_name (table, - "property_change::accessible-table-caption", - &values, NULL); - if (old_caption) - g_object_unref (old_caption); -} - -static void -gail_clist_set_column_description (AtkTable *table, - gint column, - const gchar *description) -{ - GailCList *clist = GAIL_CLIST (table); - AtkPropertyValues values = { NULL }; - gint actual_column; - - if (column < 0 || column >= gail_clist_get_n_columns (table)) - return; - - if (description == NULL) - return; - - actual_column = gail_clist_get_actual_column (table, column); - g_free (clist->columns[actual_column].description); - clist->columns[actual_column].description = g_strdup (description); - - g_value_init (&values.new_value, G_TYPE_INT); - g_value_set_int (&values.new_value, column); - - values.property_name = "accessible-table-column-description"; - g_signal_emit_by_name (table, - "property_change::accessible-table-column-description", - &values, NULL); - -} - -static void -gail_clist_set_column_header (AtkTable *table, - gint column, - AtkObject *header) -{ - GailCList *clist = GAIL_CLIST (table); - AtkPropertyValues values = { NULL }; - gint actual_column; - - if (column < 0 || column >= gail_clist_get_n_columns (table)) - return; - - actual_column = gail_clist_get_actual_column (table, column); - if (clist->columns[actual_column].header) - g_object_unref (clist->columns[actual_column].header); - if (header) - g_object_ref (header); - clist->columns[actual_column].header = header; - - g_value_init (&values.new_value, G_TYPE_INT); - g_value_set_int (&values.new_value, column); - - values.property_name = "accessible-table-column-header"; - g_signal_emit_by_name (table, - "property_change::accessible-table-column-header", - &values, NULL); -} - -static void -gail_clist_set_row_description (AtkTable *table, - gint row, - const gchar *description) -{ - gail_clist_set_row_data (table, row, description, NULL, FALSE); -} - -static void -gail_clist_set_row_header (AtkTable *table, - gint row, - AtkObject *header) -{ - gail_clist_set_row_data (table, row, NULL, header, TRUE); -} - -static void -gail_clist_set_summary (AtkTable *table, - AtkObject *accessible) -{ - GailCList* obj = GAIL_CLIST (table); - AtkPropertyValues values = { 0, }; - AtkObject *old_summary; - - old_summary = obj->summary; - obj->summary = accessible; - if (obj->summary) - g_object_ref (obj->summary); - - g_value_init (&values.old_value, G_TYPE_POINTER); - g_value_set_pointer (&values.old_value, old_summary); - g_value_init (&values.new_value, G_TYPE_POINTER); - g_value_set_pointer (&values.new_value, obj->summary); - - values.property_name = "accessible-table-summary"; - g_signal_emit_by_name (table, - "property_change::accessible-table-summary", - &values, NULL); - if (old_summary) - g_object_unref (old_summary); -} - - -static void gail_cell_parent_interface_init (GailCellParentIface *iface) -{ - iface->get_cell_extents = gail_clist_get_cell_extents; - iface->get_cell_area = gail_clist_get_cell_area; -} - -static void -gail_clist_get_cell_extents (GailCellParent *parent, - GailCell *cell, - gint *x, - gint *y, - gint *width, - gint *height, - AtkCoordType coord_type) -{ - GtkWidget* widget; - GtkCList *clist; - gint widget_x, widget_y, widget_width, widget_height; - GdkRectangle cell_rect; - GdkRectangle visible_rect; - - widget = GTK_ACCESSIBLE (parent)->widget; - if (widget == NULL) - return; - clist = GTK_CLIST (widget); - - atk_component_get_extents (ATK_COMPONENT (parent), &widget_x, &widget_y, - &widget_width, &widget_height, - coord_type); - - gail_clist_get_cell_area (parent, cell, &cell_rect); - *width = cell_rect.width; - *height = cell_rect.height; - gail_clist_get_visible_rect (clist, &visible_rect); - if (gail_clist_is_cell_visible (&cell_rect, &visible_rect)) - { - *x = cell_rect.x + widget_x; - *y = cell_rect.y + widget_y; - } - else - { - *x = G_MININT; - *y = G_MININT; - } -} - -static void -gail_clist_get_cell_area (GailCellParent *parent, - GailCell *cell, - GdkRectangle *cell_rect) -{ - GtkWidget* widget; - GtkCList *clist; - gint column, row, n_columns; - - widget = GTK_ACCESSIBLE (parent)->widget; - if (widget == NULL) - return; - clist = GTK_CLIST (widget); - - n_columns = gail_clist_get_n_actual_columns (clist); - g_return_if_fail (n_columns > 0); - column = cell->index % n_columns; - row = cell->index / n_columns; - cell_rect->x = COLUMN_LEFT (clist, column); - cell_rect->y = ROW_TOP (clist, row); - cell_rect->width = clist->column[column].area.width; - cell_rect->height = clist->row_height; -} - -static void -gail_clist_select_row_gtk (GtkCList *clist, - gint row, - gint column, - GdkEvent *event, - gpointer data) -{ - GailCList *gail_clist; - GList *temp_list; - AtkObject *selected_cell; - - gail_clist = GAIL_CLIST (data); - - for (temp_list = gail_clist->cell_data; temp_list; temp_list = temp_list->next) - { - GailCListCellData *cell_data; - - cell_data = (GailCListCellData *) (temp_list->data); - - if (row == cell_data->row_number) - { - /* - * Row is selected - */ - gail_cell_add_state (cell_data->gail_cell, ATK_STATE_SELECTED, TRUE); - } - } - if (clist->columns == 1) - { - selected_cell = gail_clist_ref_at (ATK_TABLE (data), row, 1); - if (selected_cell) - { - if (gail_clist->previous_selected_cell) - g_object_unref (gail_clist->previous_selected_cell); - gail_clist->previous_selected_cell = selected_cell; - gail_cell_add_state (GAIL_CELL (selected_cell), ATK_STATE_FOCUSED, FALSE); - g_signal_emit_by_name (gail_clist, - "active-descendant-changed", - selected_cell); - } - } - - g_signal_emit_by_name (gail_clist, "selection_changed"); -} - -static void -gail_clist_unselect_row_gtk (GtkCList *clist, - gint row, - gint column, - GdkEvent *event, - gpointer data) -{ - GailCList *gail_clist; - GList *temp_list; - - gail_clist = GAIL_CLIST (data); - - for (temp_list = gail_clist->cell_data; temp_list; temp_list = temp_list->next) - { - GailCListCellData *cell_data; - - cell_data = (GailCListCellData *) (temp_list->data); - - if (row == cell_data->row_number) - { - /* - * Row is unselected - */ - gail_cell_add_state (cell_data->gail_cell, ATK_STATE_FOCUSED, FALSE); - gail_cell_remove_state (cell_data->gail_cell, ATK_STATE_SELECTED, TRUE); - } - } - - g_signal_emit_by_name (gail_clist, "selection_changed"); -} - -/* - * This function determines the number of visible columns - * up to and including the specified column - */ -static gint -gail_clist_get_visible_column (AtkTable *table, - int column) -{ - GtkWidget *widget; - GtkCList *clist; - gint i; - gint vis_columns; - - widget = GTK_ACCESSIBLE (table)->widget; - if (widget == NULL) - /* State is defunct */ - return 0; - - clist = GTK_CLIST (widget); - for (i = 0, vis_columns = 0; i < column; i++) - if (clist->column[i].visible) - vis_columns++; - - return vis_columns; -} - -static gint -gail_clist_get_actual_column (AtkTable *table, - int visible_column) -{ - GtkWidget *widget; - GtkCList *clist; - gint i; - gint vis_columns; - - widget = GTK_ACCESSIBLE (table)->widget; - if (widget == NULL) - /* State is defunct */ - return 0; - - clist = GTK_CLIST (widget); - for (i = 0, vis_columns = 0; i < clist->columns; i++) - { - if (clist->column[i].visible) - { - if (visible_column == vis_columns) - return i; - vis_columns++; - } - } - return 0; -} - -static void -gail_clist_set_row_data (AtkTable *table, - gint row, - const gchar *description, - AtkObject *header, - gboolean is_header) -{ - GtkWidget *widget; - GtkCList *gtk_clist; - GailCList *gail_clist; - GArray *array; - GailCListRow* row_data; - gint i; - gboolean found = FALSE; - AtkPropertyValues values = { NULL }; - gchar *signal_name; - - widget = GTK_ACCESSIBLE (table)->widget; - if (widget == NULL) - /* State is defunct */ - return; - - gtk_clist = GTK_CLIST (widget); - if (row < 0 || row >= gtk_clist->rows) - return; - - gail_clist = GAIL_CLIST (table); - - if (gail_clist->row_data == NULL) - gail_clist->row_data = g_array_sized_new (FALSE, TRUE, - sizeof (GailCListRow *), 0); - - array = gail_clist->row_data; - - for (i = 0; i < array->len; i++) - { - row_data = g_array_index (array, GailCListRow*, i); - - if (row == row_data->row_number) - { - found = TRUE; - if (is_header) - { - if (row_data->header) - g_object_unref (row_data->header); - row_data->header = header; - if (row_data->header) - g_object_ref (row_data->header); - } - else - { - g_free (row_data->description); - row_data->description = g_strdup (row_data->description); - } - break; - } - } - if (!found) - { - GList *elem; - - elem = ROW_ELEMENT (gtk_clist, row); - g_return_if_fail (elem != NULL); - - row_data = g_new (GailCListRow, 1); - row_data->row_number = row; - row_data->row_data = elem->data; - if (is_header) - { - row_data->header = header; - if (row_data->header) - g_object_ref (row_data->header); - row_data->description = NULL; - } - else - { - row_data->description = g_strdup (row_data->description); - row_data->header = NULL; - } - g_array_append_val (array, row_data); - } - - g_value_init (&values.new_value, G_TYPE_INT); - g_value_set_int (&values.new_value, row); - - if (is_header) - { - values.property_name = "accessible-table-row-header"; - signal_name = "property_change::accessible-table-row-header"; - } - else - { - values.property_name = "accessible-table-row-description"; - signal_name = "property_change::accessible-table-row-description"; - } - g_signal_emit_by_name (table, - signal_name, - &values, NULL); - -} - -static GailCListRow* -gail_clist_get_row_data (AtkTable *table, - gint row) -{ - GtkWidget *widget; - GtkCList *clist; - GailCList *obj; - GArray *array; - GailCListRow* row_data; - gint i; - - widget = GTK_ACCESSIBLE (table)->widget; - if (widget == NULL) - /* State is defunct */ - return NULL; - - clist = GTK_CLIST (widget); - if (row < 0 || row >= clist->rows) - return NULL; - - obj = GAIL_CLIST (table); - - if (obj->row_data == NULL) - return NULL; - - array = obj->row_data; - - for (i = 0; i < array->len; i++) - { - row_data = g_array_index (array, GailCListRow*, i); - - if (row == row_data->row_number) - return row_data; - } - - return NULL; -} - -static void -gail_clist_get_visible_rect (GtkCList *clist, - GdkRectangle *clist_rect) -{ - clist_rect->x = - clist->hoffset; - clist_rect->y = - clist->voffset; - clist_rect->width = clist->clist_window_width; - clist_rect->height = clist->clist_window_height; -} - -static gboolean -gail_clist_is_cell_visible (GdkRectangle *cell_rect, - GdkRectangle *visible_rect) -{ - /* - * A cell is reported as visible if any part of the cell is visible - */ - if (((cell_rect->x + cell_rect->width) < visible_rect->x) || - ((cell_rect->y + cell_rect->height) < visible_rect->y) || - (cell_rect->x > (visible_rect->x + visible_rect->width)) || - (cell_rect->y > (visible_rect->y + visible_rect->height))) - return FALSE; - else - return TRUE; -} - -static void -gail_clist_cell_data_new (GailCList *clist, - GailCell *cell, - gint column, - gint row) -{ - GList *elem; - GailCListCellData *cell_data; - GtkCList *gtk_clist; - GtkCListRow *clist_row; - - gtk_clist = GTK_CLIST (GTK_ACCESSIBLE (clist)->widget); - elem = g_list_nth (gtk_clist->row_list, row); - g_return_if_fail (elem != NULL); - clist_row = (GtkCListRow *) elem->data; - cell_data = g_new (GailCListCellData, 1); - cell_data->gail_cell = cell; - cell_data->gtk_cell = &(clist_row->cell[column]); - cell_data->column_number = column; - cell_data->row_number = row; - clist->cell_data = g_list_append (clist->cell_data, cell_data); - - g_object_weak_ref (G_OBJECT (cell), - (GWeakNotify) gail_clist_cell_destroyed, - cell); -} - -static void -gail_clist_cell_destroyed (gpointer data) -{ - GailCell *cell = GAIL_CELL (data); - AtkObject* parent; - - parent = atk_object_get_parent (ATK_OBJECT (cell)); - - gail_clist_cell_data_remove (GAIL_CLIST (parent), cell); -} - -static void -gail_clist_cell_data_remove (GailCList *clist, - GailCell *cell) -{ - GList *temp_list; - - for (temp_list = clist->cell_data; temp_list; temp_list = temp_list->next) - { - GailCListCellData *cell_data; - - cell_data = (GailCListCellData *) temp_list->data; - if (cell_data->gail_cell == cell) - { - clist->cell_data = g_list_remove_link (clist->cell_data, temp_list); - g_free (cell_data); - return; - } - } - g_warning ("No cell removed in gail_clist_cell_data_remove\n"); -} - -static GailCell* -gail_clist_find_cell (GailCList *clist, - gint index) -{ - GList *temp_list; - gint n_cols; - - n_cols = clist->n_cols; - - for (temp_list = clist->cell_data; temp_list; temp_list = temp_list->next) - { - GailCListCellData *cell_data; - gint real_index; - - cell_data = (GailCListCellData *) (temp_list->data); - - real_index = cell_data->column_number + n_cols * cell_data->row_number; - if (real_index == index) - return cell_data->gail_cell; - } - return NULL; -} - -static void -gail_clist_adjustment_changed (GtkAdjustment *adjustment, - GtkCList *clist) -{ - AtkObject *atk_obj; - GdkRectangle visible_rect; - GdkRectangle cell_rect; - GailCList* obj; - GList *temp_list; - - /* - * The scrollbars have changed - */ - atk_obj = gtk_widget_get_accessible (GTK_WIDGET (clist)); - obj = GAIL_CLIST (atk_obj); - - /* Get the currently visible area */ - gail_clist_get_visible_rect (clist, &visible_rect); - - /* loop over the cells and report if they are visible or not. */ - /* Must loop through them all */ - for (temp_list = obj->cell_data; temp_list; temp_list = temp_list->next) - { - GailCell *cell; - GailCListCellData *cell_data; - - cell_data = (GailCListCellData *) (temp_list->data); - cell = cell_data->gail_cell; - - gail_clist_get_cell_area (GAIL_CELL_PARENT (atk_obj), - cell, &cell_rect); - if (gail_clist_is_cell_visible (&cell_rect, &visible_rect)) - gail_cell_add_state (cell, ATK_STATE_SHOWING, TRUE); - else - gail_cell_remove_state (cell, ATK_STATE_SHOWING, TRUE); - } - g_signal_emit_by_name (atk_obj, "visible_data_changed"); -} - diff --git a/modules/other/gail/gailclist.h b/modules/other/gail/gailclist.h deleted file mode 100644 index 44eba4d17f..0000000000 --- a/modules/other/gail/gailclist.h +++ /dev/null @@ -1,64 +0,0 @@ -/* GAIL - The GNOME Accessibility Implementation Library - * Copyright 2001 Sun Microsystems Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __GAIL_CLIST_H__ -#define __GAIL_CLIST_H__ - -#include - -G_BEGIN_DECLS - -#define GAIL_TYPE_CLIST (gail_clist_get_type ()) -#define GAIL_CLIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_CLIST, GailCList)) -#define GAIL_CLIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAIL_TYPE_CLIST, GailCListClass)) -#define GAIL_IS_CLIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_CLIST)) -#define GAIL_IS_CLIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_CLIST)) -#define GAIL_CLIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_CLIST, GailCListClass)) - -typedef struct _GailCList GailCList; -typedef struct _GailCListClass GailCListClass; - -typedef struct _GailCListColumn GailCListColumn; - -struct _GailCList -{ - GailContainer parent; - - AtkObject* caption; - AtkObject* summary; - - /* dynamically allocated array of column structures */ - GailCListColumn *columns; - /* private */ - gint n_cols; - GArray *row_data; - GList *cell_data; - AtkObject *previous_selected_cell; -}; - -GType gail_clist_get_type (void); - -struct _GailCListClass -{ - GailContainerClass parent_class; -}; - -G_END_DECLS - -#endif /* __GAIL_CLIST_H__ */ diff --git a/modules/other/gail/gailclistcell.c b/modules/other/gail/gailclistcell.c deleted file mode 100644 index b683fa70e9..0000000000 --- a/modules/other/gail/gailclistcell.c +++ /dev/null @@ -1,106 +0,0 @@ -/* GAIL - The GNOME Accessibility Implementation Library - * Copyright 2001 Sun Microsystems Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include "config.h" - -#undef GTK_DISABLE_DEPRECATED - -#include -#include "gailclistcell.h" - -static void gail_clist_cell_class_init (GailCListCellClass *klass); -static void gail_clist_cell_init (GailCListCell *cell); - -static G_CONST_RETURN gchar* gail_clist_cell_get_name (AtkObject *accessible); - -G_DEFINE_TYPE (GailCListCell, gail_clist_cell, GAIL_TYPE_CELL) - -static void -gail_clist_cell_class_init (GailCListCellClass *klass) -{ - AtkObjectClass *class = ATK_OBJECT_CLASS (klass); - - class->get_name = gail_clist_cell_get_name; -} - -static void -gail_clist_cell_init (GailCListCell *cell) -{ -} - -AtkObject* -gail_clist_cell_new (void) -{ - GObject *object; - AtkObject *atk_object; - - object = g_object_new (GAIL_TYPE_CLIST_CELL, NULL); - - g_return_val_if_fail (object != NULL, NULL); - - atk_object = ATK_OBJECT (object); - atk_object->role = ATK_ROLE_TABLE_CELL; - - g_return_val_if_fail (!ATK_IS_TEXT (atk_object), NULL); - - return atk_object; -} - -static G_CONST_RETURN gchar* -gail_clist_cell_get_name (AtkObject *accessible) -{ - if (accessible->name) - return accessible->name; - else - { - /* - * Get the cell's text if it exists - */ - GailCell *cell = GAIL_CELL (accessible); - GtkWidget* widget = cell->widget; - GtkCellType cell_type; - GtkCList *clist; - gchar *text = NULL; - gint row, column; - - if (widget == NULL) - /* - * State is defunct - */ - return NULL; - - clist = GTK_CLIST (widget); - g_return_val_if_fail (clist->columns, NULL); - row = cell->index / clist->columns; - column = cell->index % clist->columns; - cell_type = gtk_clist_get_cell_type (clist, row, column); - switch (cell_type) - { - case GTK_CELL_TEXT: - gtk_clist_get_text (clist, row, column, &text); - break; - case GTK_CELL_PIXTEXT: - gtk_clist_get_pixtext (clist, row, column, &text, NULL, NULL, NULL); - break; - default: - break; - } - return text; - } -} diff --git a/modules/other/gail/gailclistcell.h b/modules/other/gail/gailclistcell.h deleted file mode 100644 index fca0620706..0000000000 --- a/modules/other/gail/gailclistcell.h +++ /dev/null @@ -1,54 +0,0 @@ -/* GAIL - The GNOME Accessibility Implementation Library - * Copyright 2001 Sun Microsystems Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __GAIL_CLIST_CELL_H__ -#define __GAIL_CLIST_CELL_H__ - -#include -#include - -G_BEGIN_DECLS - -#define GAIL_TYPE_CLIST_CELL (gail_clist_cell_get_type ()) -#define GAIL_CLIST_CELL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_CLIST_CELL, GailCListCell)) -#define GAIL_CLIST_CELL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAIL_TYPE_CLIST_CELL, GailCListCellClass)) -#define GAIL_IS_CLIST_CELL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_CLIST_CELL)) -#define GAIL_IS_CLIST_CELL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_CLIST_CELL)) -#define GAIL_CLIST_CELL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_CLIST_CELL, GailCListCellClass)) - -typedef struct _GailCListCell GailCListCell; -typedef struct _GailCListCellClass GailCListCellClass; - -struct _GailCListCell -{ - GailCell parent; -}; - -GType gail_clist_cell_get_type (void); - -struct _GailCListCellClass -{ - GailCellClass parent_class; -}; - -AtkObject *gail_clist_cell_new (void); - -G_END_DECLS - -#endif /* __GAIL_CLIST_CELL_H__ */ diff --git a/modules/other/gail/gailcombo.c b/modules/other/gail/gailcombo.c deleted file mode 100644 index 3f4213050c..0000000000 --- a/modules/other/gail/gailcombo.c +++ /dev/null @@ -1,639 +0,0 @@ -/* GAIL - The GNOME Accessibility Implementation Library - * Copyright 2001, 2002, 2003 Sun Microsystems Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include "config.h" - -#undef GTK_DISABLE_DEPRECATED - -#include -#include "gailcombo.h" - -static void gail_combo_class_init (GailComboClass *klass); -static void gail_combo_init (GailCombo *combo); -static void gail_combo_real_initialize (AtkObject *obj, - gpointer data); - -static void gail_combo_selection_changed_gtk (GtkWidget *widget, - gpointer data); - -static gint gail_combo_get_n_children (AtkObject *obj); -static AtkObject* gail_combo_ref_child (AtkObject *obj, - gint i); -static void gail_combo_finalize (GObject *object); -static void atk_action_interface_init (AtkActionIface *iface); - -static gboolean gail_combo_do_action (AtkAction *action, - gint i); -static gboolean idle_do_action (gpointer data); -static gint gail_combo_get_n_actions (AtkAction *action) -; -static G_CONST_RETURN gchar* gail_combo_get_description(AtkAction *action, - gint i); -static G_CONST_RETURN gchar* gail_combo_get_name (AtkAction *action, - gint i); -static gboolean gail_combo_set_description(AtkAction *action, - gint i, - const gchar *desc); - -static void atk_selection_interface_init (AtkSelectionIface *iface); -static gboolean gail_combo_add_selection (AtkSelection *selection, - gint i); -static gboolean gail_combo_clear_selection (AtkSelection *selection); -static AtkObject* gail_combo_ref_selection (AtkSelection *selection, - gint i); -static gint gail_combo_get_selection_count (AtkSelection *selection); -static gboolean gail_combo_is_child_selected (AtkSelection *selection, - gint i); -static gboolean gail_combo_remove_selection (AtkSelection *selection, - gint i); - -static gint _gail_combo_button_release (gpointer data); -static gint _gail_combo_popup_release (gpointer data); - - -G_DEFINE_TYPE_WITH_CODE (GailCombo, gail_combo, GAIL_TYPE_CONTAINER, - G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_interface_init) - G_IMPLEMENT_INTERFACE (ATK_TYPE_SELECTION, atk_selection_interface_init)) - -static void -gail_combo_class_init (GailComboClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - AtkObjectClass *class = ATK_OBJECT_CLASS (klass); - - gobject_class->finalize = gail_combo_finalize; - - class->get_n_children = gail_combo_get_n_children; - class->ref_child = gail_combo_ref_child; - class->initialize = gail_combo_real_initialize; -} - -static void -gail_combo_init (GailCombo *combo) -{ - combo->press_description = NULL; - combo->old_selection = NULL; - combo->deselect_idle_handler = 0; - combo->select_idle_handler = 0; -} - -static void -gail_combo_real_initialize (AtkObject *obj, - gpointer data) -{ - GtkCombo *combo; - GtkList *list; - GList *slist; - GailCombo *gail_combo; - - ATK_OBJECT_CLASS (gail_combo_parent_class)->initialize (obj, data); - - combo = GTK_COMBO (data); - - list = GTK_LIST (combo->list); - slist = list->selection; - - gail_combo = GAIL_COMBO (obj); - if (slist && slist->data) - { - gail_combo->old_selection = slist->data; - } - g_signal_connect (combo->list, - "selection_changed", - G_CALLBACK (gail_combo_selection_changed_gtk), - data); - atk_object_set_parent (gtk_widget_get_accessible (combo->entry), obj); - atk_object_set_parent (gtk_widget_get_accessible (combo->popup), obj); - - obj->role = ATK_ROLE_COMBO_BOX; -} - -static gboolean -notify_deselect (gpointer data) -{ - GailCombo *combo; - - combo = GAIL_COMBO (data); - - combo->old_selection = NULL; - combo->deselect_idle_handler = 0; - g_signal_emit_by_name (data, "selection_changed"); - - return FALSE; -} - -static gboolean -notify_select (gpointer data) -{ - GailCombo *combo; - - combo = GAIL_COMBO (data); - - combo->select_idle_handler = 0; - g_signal_emit_by_name (data, "selection_changed"); - - return FALSE; -} - -static void -gail_combo_selection_changed_gtk (GtkWidget *widget, - gpointer data) -{ - GtkCombo *combo; - GtkList *list; - GList *slist; - AtkObject *obj; - GailCombo *gail_combo; - - combo = GTK_COMBO (data); - list = GTK_LIST (combo->list); - - slist = list->selection; - - obj = gtk_widget_get_accessible (GTK_WIDGET (data)); - gail_combo = GAIL_COMBO (obj); - if (slist && slist->data) - { - if (slist->data != gail_combo->old_selection) - { - gail_combo->old_selection = slist->data; - if (gail_combo->select_idle_handler == 0) - gail_combo->select_idle_handler = gdk_threads_add_idle (notify_select, gail_combo); - } - if (gail_combo->deselect_idle_handler) - { - g_source_remove (gail_combo->deselect_idle_handler); - gail_combo->deselect_idle_handler = 0; - } - } - else - { - if (gail_combo->deselect_idle_handler == 0) - gail_combo->deselect_idle_handler = gdk_threads_add_idle (notify_deselect, gail_combo); - if (gail_combo->select_idle_handler) - { - g_source_remove (gail_combo->select_idle_handler); - gail_combo->select_idle_handler = 0; - } - } -} - -/* - * The children of a GailCombo are the list of items and the entry field - */ -static gint -gail_combo_get_n_children (AtkObject* obj) -{ - gint n_children = 2; - GtkWidget *widget; - - g_return_val_if_fail (GAIL_IS_COMBO (obj), 0); - - widget = GTK_ACCESSIBLE (obj)->widget; - if (widget == NULL) - /* - * State is defunct - */ - return 0; - - return n_children; -} - -static AtkObject* -gail_combo_ref_child (AtkObject *obj, - gint i) -{ - AtkObject *accessible; - GtkWidget *widget; - - g_return_val_if_fail (GAIL_IS_COMBO (obj), NULL); - - if (i < 0 || i > 1) - return NULL; - - widget = GTK_ACCESSIBLE (obj)->widget; - if (widget == NULL) - /* - * State is defunct - */ - return NULL; - - if (i == 0) - accessible = gtk_widget_get_accessible (GTK_COMBO (widget)->popup); - else - accessible = gtk_widget_get_accessible (GTK_COMBO (widget)->entry); - - g_object_ref (accessible); - return accessible; -} - -static void -atk_action_interface_init (AtkActionIface *iface) -{ - iface->do_action = gail_combo_do_action; - iface->get_n_actions = gail_combo_get_n_actions; - iface->get_description = gail_combo_get_description; - iface->get_name = gail_combo_get_name; - iface->set_description = gail_combo_set_description; -} - -static gboolean -gail_combo_do_action (AtkAction *action, - gint i) -{ - GailCombo *combo; - GtkWidget *widget; - - widget = GTK_ACCESSIBLE (action)->widget; - if (widget == NULL) - /* - * State is defunct - */ - return FALSE; - - if (!gtk_widget_get_sensitive (widget) || !gtk_widget_get_visible (widget)) - return FALSE; - - combo = GAIL_COMBO (action); - if (i == 0) - { - if (combo->action_idle_handler) - return FALSE; - - combo->action_idle_handler = gdk_threads_add_idle (idle_do_action, combo); - return TRUE; - } - else - return FALSE; -} - -/* - * This action is the pressing of the button on the combo box. - * The behavior is different depending on whether the list is being - * displayed or removed. - * - * A button press event is simulated on the appropriate widget and - * a button release event is simulated in an idle function. - */ -static gboolean -idle_do_action (gpointer data) -{ - GtkCombo *combo; - GtkWidget *action_widget; - GtkWidget *widget; - GailCombo *gail_combo; - gboolean do_popup; - GdkEvent tmp_event; - - gail_combo = GAIL_COMBO (data); - gail_combo->action_idle_handler = 0; - widget = GTK_ACCESSIBLE (gail_combo)->widget; - if (widget == NULL /* State is defunct */ || - !gtk_widget_get_sensitive (widget) || !gtk_widget_get_visible (widget)) - return FALSE; - - combo = GTK_COMBO (widget); - - do_popup = !gtk_widget_get_mapped (combo->popwin); - - tmp_event.button.type = GDK_BUTTON_PRESS; - tmp_event.button.window = widget->window; - tmp_event.button.button = 1; - tmp_event.button.send_event = TRUE; - tmp_event.button.time = GDK_CURRENT_TIME; - tmp_event.button.axes = NULL; - - if (do_popup) - { - /* Pop up list */ - action_widget = combo->button; - - gtk_widget_event (action_widget, &tmp_event); - - /* FIXME !*/ - g_idle_add (_gail_combo_button_release, combo); - } - else - { - /* Pop down list */ - tmp_event.button.window = combo->list->window; - gdk_window_set_user_data (combo->list->window, combo->button); - action_widget = combo->popwin; - - gtk_widget_event (action_widget, &tmp_event); - /* FIXME !*/ - g_idle_add (_gail_combo_popup_release, combo); - } - - return FALSE; -} - -static gint -gail_combo_get_n_actions (AtkAction *action) -{ - /* - * The default behavior of a combo box is to have one action - - */ - return 1; -} - -static G_CONST_RETURN gchar* -gail_combo_get_description (AtkAction *action, - gint i) -{ - if (i == 0) - { - GailCombo *combo; - - combo = GAIL_COMBO (action); - return combo->press_description; - } - else - return NULL; -} - -static G_CONST_RETURN gchar* -gail_combo_get_name (AtkAction *action, - gint i) -{ - if (i == 0) - return "press"; - else - return NULL; -} - -static void -atk_selection_interface_init (AtkSelectionIface *iface) -{ - iface->add_selection = gail_combo_add_selection; - iface->clear_selection = gail_combo_clear_selection; - iface->ref_selection = gail_combo_ref_selection; - iface->get_selection_count = gail_combo_get_selection_count; - iface->is_child_selected = gail_combo_is_child_selected; - iface->remove_selection = gail_combo_remove_selection; - /* - * select_all_selection does not make sense for a combo box - * so no implementation is provided. - */ -} - -static gboolean -gail_combo_add_selection (AtkSelection *selection, - gint i) -{ - GtkCombo *combo; - GtkWidget *widget; - - widget = GTK_ACCESSIBLE (selection)->widget; - if (widget == NULL) - /* - * State is defunct - */ - return FALSE; - - combo = GTK_COMBO (widget); - - gtk_list_select_item (GTK_LIST (combo->list), i); - return TRUE; -} - -static gboolean -gail_combo_clear_selection (AtkSelection *selection) -{ - GtkCombo *combo; - GtkWidget *widget; - - widget = GTK_ACCESSIBLE (selection)->widget; - if (widget == NULL) - /* - * State is defunct - */ - return FALSE; - - combo = GTK_COMBO (widget); - - gtk_list_unselect_all (GTK_LIST (combo->list)); - return TRUE; -} - -static AtkObject* -gail_combo_ref_selection (AtkSelection *selection, - gint i) -{ - GtkCombo *combo; - GList * list; - GtkWidget *item; - AtkObject *obj; - GtkWidget *widget; - - widget = GTK_ACCESSIBLE (selection)->widget; - if (widget == NULL) - /* - * State is defunct - */ - return NULL; - - combo = GTK_COMBO (widget); - - /* - * A combo box can have only one selection. - */ - if (i != 0) - return NULL; - - list = GTK_LIST (combo->list)->selection; - - if (list == NULL) - return NULL; - - item = GTK_WIDGET (list->data); - - obj = gtk_widget_get_accessible (item); - g_object_ref (obj); - return obj; -} - -static gint -gail_combo_get_selection_count (AtkSelection *selection) -{ - GtkCombo *combo; - GList * list; - GtkWidget *widget; - - widget = GTK_ACCESSIBLE (selection)->widget; - if (widget == NULL) - /* - * State is defunct - */ - return 0; - - combo = GTK_COMBO (widget); - - /* - * The number of children currently selected is either 1 or 0 so we - * do not bother to count the elements of the selected list. - */ - list = GTK_LIST (combo->list)->selection; - - if (list == NULL) - return 0; - else - return 1; -} - -static gboolean -gail_combo_is_child_selected (AtkSelection *selection, - gint i) -{ - GtkCombo *combo; - GList * list; - GtkWidget *item; - gint j; - GtkWidget *widget; - - widget = GTK_ACCESSIBLE (selection)->widget; - if (widget == NULL) - /* - * State is defunct - */ - return FALSE; - - combo = GTK_COMBO (widget); - - list = GTK_LIST (combo->list)->selection; - - if (list == NULL) - return FALSE; - - item = GTK_WIDGET (list->data); - - j = g_list_index (GTK_LIST (combo->list)->children, item); - - return (j == i); -} - -static gboolean -gail_combo_remove_selection (AtkSelection *selection, - gint i) -{ - if (atk_selection_is_child_selected (selection, i)) - atk_selection_clear_selection (selection); - - return TRUE; -} - -static gint -_gail_combo_popup_release (gpointer data) -{ - GtkCombo *combo; - GtkWidget *action_widget; - GdkEvent tmp_event; - - GDK_THREADS_ENTER (); - - combo = GTK_COMBO (data); - if (combo->current_button == 0) - { - GDK_THREADS_LEAVE (); - return FALSE; - } - - tmp_event.button.type = GDK_BUTTON_RELEASE; - tmp_event.button.button = 1; - tmp_event.button.time = GDK_CURRENT_TIME; - action_widget = combo->button; - - gtk_widget_event (action_widget, &tmp_event); - - GDK_THREADS_LEAVE (); - - return FALSE; -} - -static gint -_gail_combo_button_release (gpointer data) -{ - GtkCombo *combo; - GtkWidget *action_widget; - GdkEvent tmp_event; - - GDK_THREADS_ENTER (); - - combo = GTK_COMBO (data); - if (combo->current_button == 0) - { - GDK_THREADS_LEAVE (); - return FALSE; - } - - tmp_event.button.type = GDK_BUTTON_RELEASE; - tmp_event.button.button = 1; - tmp_event.button.window = combo->list->window; - tmp_event.button.time = GDK_CURRENT_TIME; - gdk_window_set_user_data (combo->list->window, combo->button); - action_widget = combo->list; - - gtk_widget_event (action_widget, &tmp_event); - - GDK_THREADS_LEAVE (); - - return FALSE; -} - -static gboolean -gail_combo_set_description (AtkAction *action, - gint i, - const gchar *desc) -{ - if (i == 0) - { - GailCombo *combo; - - combo = GAIL_COMBO (action); - g_free (combo->press_description); - combo->press_description = g_strdup (desc); - return TRUE; - } - else - return FALSE; -} - -static void -gail_combo_finalize (GObject *object) -{ - GailCombo *combo = GAIL_COMBO (object); - - g_free (combo->press_description); - if (combo->action_idle_handler) - { - g_source_remove (combo->action_idle_handler); - combo->action_idle_handler = 0; - } - if (combo->deselect_idle_handler) - { - g_source_remove (combo->deselect_idle_handler); - combo->deselect_idle_handler = 0; - } - if (combo->select_idle_handler) - { - g_source_remove (combo->select_idle_handler); - combo->select_idle_handler = 0; - } - G_OBJECT_CLASS (gail_combo_parent_class)->finalize (object); -} diff --git a/modules/other/gail/gailcombo.h b/modules/other/gail/gailcombo.h deleted file mode 100644 index e7155e87df..0000000000 --- a/modules/other/gail/gailcombo.h +++ /dev/null @@ -1,58 +0,0 @@ -/* GAIL - The GNOME Accessibility Implementation Library - * Copyright 2001 Sun Microsystems Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __GAIL_COMBO_H__ -#define __GAIL_COMBO_H__ - -#include - -G_BEGIN_DECLS - -#define GAIL_TYPE_COMBO (gail_combo_get_type ()) -#define GAIL_COMBO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_COMBO, GailCombo)) -#define GAIL_COMBO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAIL_TYPE_COMBO, GailComboClass)) -#define GAIL_IS_COMBO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_COMBO)) -#define GAIL_IS_COMBO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_COMBO)) -#define GAIL_COMBO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_COMBO, GailComboClass)) - -typedef struct _GailCombo GailCombo; -typedef struct _GailComboClass GailComboClass; - -struct _GailCombo -{ - GailContainer parent; - - gpointer old_selection; - gchar *press_description; - - guint action_idle_handler; - guint select_idle_handler; - guint deselect_idle_handler; -}; - -GType gail_combo_get_type (void); - -struct _GailComboClass -{ - GailContainerClass parent_class; -}; - -G_END_DECLS - -#endif /* __GAIL_COMBO_H__ */ diff --git a/modules/other/gail/gailentry.c b/modules/other/gail/gailentry.c index 9da1f45175..33009eac99 100644 --- a/modules/other/gail/gailentry.c +++ b/modules/other/gail/gailentry.c @@ -23,7 +23,6 @@ #include #include #include "gailentry.h" -#include "gailcombo.h" #include "gailcombobox.h" #include @@ -361,8 +360,7 @@ gail_entry_get_index_in_parent (AtkObject *accessible) * otherwise do the normal thing. */ if (accessible->accessible_parent) - if (GAIL_IS_COMBO (accessible->accessible_parent) || - GAIL_IS_COMBO_BOX (accessible->accessible_parent)) + if (GAIL_IS_COMBO_BOX (accessible->accessible_parent)) return 1; return ATK_OBJECT_CLASS (gail_entry_parent_class)->get_index_in_parent (accessible); @@ -1022,6 +1020,12 @@ gail_entry_idle_notify_insert (gpointer data) static void gail_entry_notify_insert (GailEntry *entry) { + GtkWidget *widget; + + widget = GTK_ACCESSIBLE (entry)->widget; + if (gtk_entry_get_text_length (GTK_ENTRY (widget)) == 0) + return; + if (entry->signal_name_insert) { g_signal_emit_by_name (entry, @@ -1045,6 +1049,9 @@ _gail_entry_insert_text_cb (GtkEntry *entry, GailEntry *gail_entry; gint *position = (gint *) arg3; + if (arg2 == 0) + return; + accessible = gtk_widget_get_accessible (GTK_WIDGET (entry)); gail_entry = GAIL_ENTRY (accessible); if (!gail_entry->signal_name_insert) diff --git a/modules/other/gail/gailitem.c b/modules/other/gail/gailitem.c index 308e1618de..531710a724 100644 --- a/modules/other/gail/gailitem.c +++ b/modules/other/gail/gailitem.c @@ -21,8 +21,6 @@ #include -#undef GTK_DISABLE_DEPRECATED - #include #include "gailitem.h" #include @@ -233,13 +231,6 @@ gail_item_get_name (AtkObject *obj) if (GTK_IS_MENU (parent)) { attach = gtk_menu_get_attach_widget (GTK_MENU (parent)); - - if (GTK_IS_OPTION_MENU (attach)) - { - label = get_label_from_container (attach); - if (GTK_IS_LABEL (label)) - return gtk_label_get_text (GTK_LABEL(label)); - } list = gtk_container_get_children (GTK_CONTAINER (parent)); index = g_list_index (list, widget); diff --git a/modules/other/gail/gaillabel.c b/modules/other/gail/gaillabel.c index b7e06eb45b..158a718203 100644 --- a/modules/other/gail/gaillabel.c +++ b/modules/other/gail/gaillabel.c @@ -21,8 +21,6 @@ #include -#undef GTK_DISABLE_DEPRECATED - #include #include "gaillabel.h" #include "gailwindow.h" @@ -457,7 +455,7 @@ gail_label_ref_relation_set (AtkObject *obj) * * The relation set is not updated if the mnemonic widget is changed */ - GtkWidget *mnemonic_widget = GTK_LABEL (widget)->mnemonic_widget; + GtkWidget *mnemonic_widget = gtk_label_get_mnemonic_widget (GTK_LABEL (widget)); if (mnemonic_widget) { @@ -513,10 +511,6 @@ gail_label_ref_relation_set (AtkObject *obj) temp_widget = GTK_WIDGET (list->data); g_list_free (list); list = gtk_container_get_children (GTK_CONTAINER (temp_widget)); - if (GTK_IS_COMBO (list->data)) - { - mnemonic_widget = GTK_WIDGET (list->data); - } } } g_list_free (list); @@ -730,7 +724,7 @@ gail_label_set_caret_offset (AtkText *text, if (gtk_label_get_selectable (label) && offset >= 0 && - offset <= g_utf8_strlen (label->text, -1)) + offset <= g_utf8_strlen (gtk_label_get_text (label), -1)) { gtk_label_select_region (label, offset, offset); return TRUE; @@ -900,6 +894,7 @@ gail_label_get_character_extents (AtkText *text, GtkWidget *widget; GtkLabel *label; PangoRectangle char_rect; + const gchar *label_text; gint index, x_layout, y_layout; widget = GTK_ACCESSIBLE (text)->widget; @@ -911,7 +906,8 @@ gail_label_get_character_extents (AtkText *text, label = GTK_LABEL (widget); gtk_label_get_layout_offsets (label, &x_layout, &y_layout); - index = g_utf8_offset_to_pointer (label->text, offset) - label->text; + label_text = gtk_label_get_text (label); + index = g_utf8_offset_to_pointer (label_text, offset) - label_text; pango_layout_index_to_pos (gtk_label_get_layout (label), index, &char_rect); gail_misc_get_extents_from_pango_rectangle (widget, &char_rect, @@ -926,6 +922,7 @@ gail_label_get_offset_at_point (AtkText *text, { GtkWidget *widget; GtkLabel *label; + const gchar *label_text; gint index, x_layout, y_layout; widget = GTK_ACCESSIBLE (text)->widget; @@ -939,15 +936,16 @@ gail_label_get_offset_at_point (AtkText *text, index = gail_misc_get_index_at_point_in_layout (widget, gtk_label_get_layout (label), x_layout, y_layout, x, y, coords); + label_text = gtk_label_get_text (label); if (index == -1) { if (coords == ATK_XY_WINDOW || coords == ATK_XY_SCREEN) - return g_utf8_strlen (label->text, -1); + return g_utf8_strlen (label_text, -1); return index; } else - return g_utf8_pointer_to_offset (label->text, label->text + index); + return g_utf8_pointer_to_offset (label_text, label_text + index); } static AtkAttributeSet* @@ -987,7 +985,7 @@ gail_label_get_run_attributes (AtkText *text, at_set = gail_misc_layout_get_run_attributes (at_set, gtk_label_get_layout (label), - label->text, + gtk_label_get_text (label), offset, start_offset, end_offset); diff --git a/modules/other/gail/gaillist.c b/modules/other/gail/gaillist.c deleted file mode 100644 index baa5a6649a..0000000000 --- a/modules/other/gail/gaillist.c +++ /dev/null @@ -1,242 +0,0 @@ -/* GAIL - The GNOME Accessibility Enabling Library - * Copyright 2001 Sun Microsystems Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include "config.h" - -#undef GTK_DISABLE_DEPRECATED - -#include -#include "gaillist.h" -#include "gailcombo.h" - -static void gail_list_class_init (GailListClass *klass); - -static void gail_list_init (GailList *list); - -static void gail_list_initialize (AtkObject *accessible, - gpointer data); - -static gint gail_list_get_index_in_parent (AtkObject *accessible); - -static void atk_selection_interface_init (AtkSelectionIface *iface); -static gboolean gail_list_add_selection (AtkSelection *selection, - gint i); -static gboolean gail_list_clear_selection (AtkSelection *selection); -static AtkObject* gail_list_ref_selection (AtkSelection *selection, - gint i); -static gint gail_list_get_selection_count (AtkSelection *selection); -static gboolean gail_list_is_child_selected (AtkSelection *selection, - gint i); -static gboolean gail_list_remove_selection (AtkSelection *selection, - gint i); - - -G_DEFINE_TYPE_WITH_CODE (GailList, gail_list, GAIL_TYPE_CONTAINER, - G_IMPLEMENT_INTERFACE (ATK_TYPE_SELECTION, atk_selection_interface_init)) - -static void -gail_list_class_init (GailListClass *klass) -{ - AtkObjectClass *class = ATK_OBJECT_CLASS (klass); - - class->initialize = gail_list_initialize; - class->get_index_in_parent = gail_list_get_index_in_parent; -} - -static void -gail_list_init (GailList *list) -{ -} - -static void -gail_list_initialize (AtkObject *accessible, - gpointer data) -{ - ATK_OBJECT_CLASS (gail_list_parent_class)->initialize (accessible, data); - - accessible->role = ATK_ROLE_LIST; -} - -static gint -gail_list_get_index_in_parent (AtkObject *accessible) -{ - /* - * If the parent widget is a combo box then the index is 0 - * otherwise do the normal thing. - */ - if (accessible->accessible_parent) - { - if (GAIL_IS_COMBO (accessible->accessible_parent)) - return 0; - } - return ATK_OBJECT_CLASS (gail_list_parent_class)->get_index_in_parent (accessible); -} - -static void -atk_selection_interface_init (AtkSelectionIface *iface) -{ - iface->add_selection = gail_list_add_selection; - iface->clear_selection = gail_list_clear_selection; - iface->ref_selection = gail_list_ref_selection; - iface->get_selection_count = gail_list_get_selection_count; - iface->is_child_selected = gail_list_is_child_selected; - iface->remove_selection = gail_list_remove_selection; - /* - * select_all_selection does not make sense for a combo box - * so no implementation is provided. - */ -} - -static gboolean -gail_list_add_selection (AtkSelection *selection, - gint i) -{ - GtkList *list; - GtkWidget *widget; - - widget = GTK_ACCESSIBLE (selection)->widget; - if (widget == NULL) - /* - * State is defunct - */ - return FALSE; - - list = GTK_LIST (widget); - - gtk_list_select_item (list, i); - return TRUE; -} - -static gboolean -gail_list_clear_selection (AtkSelection *selection) -{ - GtkList *list; - GtkWidget *widget; - - widget = GTK_ACCESSIBLE (selection)->widget; - if (widget == NULL) - /* - * State is defunct - */ - return FALSE; - - list = GTK_LIST (widget); - - gtk_list_unselect_all (list); - return TRUE; -} - -static AtkObject* -gail_list_ref_selection (AtkSelection *selection, - gint i) -{ - GtkList *list; - GList *g_list; - GtkWidget *item; - AtkObject *obj; - GtkWidget *widget; - - widget = GTK_ACCESSIBLE (selection)->widget; - if (widget == NULL) - /* - * State is defunct - */ - return NULL; - - list = GTK_LIST (widget); - - /* - * A combo box can have only one selection. - */ - if (i != 0) - return NULL; - - g_list = list->selection; - - if (g_list == NULL) - return NULL; - - item = GTK_WIDGET (g_list->data); - - obj = gtk_widget_get_accessible (item); - g_object_ref (obj); - return obj; -} - -static gint -gail_list_get_selection_count (AtkSelection *selection) -{ - GtkList *list; - GList *g_list; - GtkWidget *widget; - - widget = GTK_ACCESSIBLE (selection)->widget; - if (widget == NULL) - /* - * State is defunct - */ - return 0; - - list = GTK_LIST (widget); - - g_list = list->selection; - - return g_list_length (g_list);; -} - -static gboolean -gail_list_is_child_selected (AtkSelection *selection, - gint i) -{ - GtkList *list; - GList *g_list; - GtkWidget *item; - gint j; - GtkWidget *widget; - - widget = GTK_ACCESSIBLE (selection)->widget; - if (widget == NULL) - /* - * State is defunct - */ - return FALSE; - - list = GTK_LIST (widget); - - g_list = list->selection; - - if (g_list == NULL) - return FALSE; - - item = GTK_WIDGET (g_list->data); - - j = g_list_index (list->children, item); - - return (j == i); -} - -static gboolean -gail_list_remove_selection (AtkSelection *selection, - gint i) -{ - if (atk_selection_is_child_selected (selection, i)) - atk_selection_clear_selection (selection); - - return TRUE; -} diff --git a/modules/other/gail/gaillist.h b/modules/other/gail/gaillist.h deleted file mode 100644 index e33e87cbc1..0000000000 --- a/modules/other/gail/gaillist.h +++ /dev/null @@ -1,51 +0,0 @@ -/* GAIL - The GNOME Accessibility Implementation Library - * Copyright 2001 Sun Microsystems Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __GAIL_LIST_H__ -#define __GAIL_LIST_H__ - -#include - -G_BEGIN_DECLS - -#define GAIL_TYPE_LIST (gail_list_get_type ()) -#define GAIL_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_LIST, GailList)) -#define GAIL_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAIL_TYPE_LIST, GailListClass)) -#define GAIL_IS_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_LIST)) -#define GAIL_IS_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_LIST)) -#define GAIL_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_LIST, GailListClass)) - -typedef struct _GailList GailList; -typedef struct _GailListClass GailListClass; - -struct _GailList -{ - GailContainer parent; -}; - -GType gail_list_get_type (void); - -struct _GailListClass -{ - GailContainerClass parent_class; -}; - -G_END_DECLS - -#endif /* __GAIL_LIST_H__ */ diff --git a/modules/other/gail/gailmenu.c b/modules/other/gail/gailmenu.c index 0a928c4cc4..0c559ef2d7 100644 --- a/modules/other/gail/gailmenu.c +++ b/modules/other/gail/gailmenu.c @@ -19,8 +19,6 @@ #include "config.h" -#undef GTK_DISABLE_DEPRECATED - #include "gailmenu.h" static void gail_menu_class_init (GailMenuClass *klass); @@ -92,7 +90,7 @@ gail_menu_get_parent (AtkObject *accessible) */ parent_widget = gtk_menu_get_attach_widget (GTK_MENU (widget)); - if (!GTK_IS_MENU_ITEM (parent_widget) && !GTK_IS_BUTTON (parent_widget) && !GTK_IS_COMBO_BOX (parent_widget) && !GTK_IS_OPTION_MENU (parent_widget)) + if (!GTK_IS_MENU_ITEM (parent_widget) && !GTK_IS_BUTTON (parent_widget) && !GTK_IS_COMBO_BOX (parent_widget)) parent_widget = widget->parent; if (parent_widget == NULL) diff --git a/modules/other/gail/gailmenuitem.c b/modules/other/gail/gailmenuitem.c index 28095930f1..0e61a0b31c 100644 --- a/modules/other/gail/gailmenuitem.c +++ b/modules/other/gail/gailmenuitem.c @@ -527,13 +527,17 @@ gail_menu_item_get_keybinding (AtkAction *action, if (GTK_IS_ACCEL_LABEL (child)) { GtkAccelLabel *accel_label; + GClosure *accel_closure; accel_label = GTK_ACCEL_LABEL (child); - if (accel_label->accel_closure) + g_object_get (accel_label, + "accel-closure", &accel_closure, + NULL); + if (accel_closure) { - key = gtk_accel_group_find (accel_label->accel_group, + key = gtk_accel_group_find (gtk_accel_group_from_accel_closure (accel_closure), find_accel_new, - accel_label->accel_closure); + accel_closure); } } diff --git a/modules/other/gail/gailoptionmenu.c b/modules/other/gail/gailoptionmenu.c deleted file mode 100644 index 680ab20de3..0000000000 --- a/modules/other/gail/gailoptionmenu.c +++ /dev/null @@ -1,356 +0,0 @@ -/* GAIL - The GNOME Accessibility Implementation Library - * Copyright 2001, 2002, 2003 Sun Microsystems Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include "config.h" - -#include - -#undef GTK_DISABLE_DEPRECATED - -#include -#include - -#include "gailoptionmenu.h" - -static void gail_option_menu_class_init (GailOptionMenuClass *klass); -static void gail_option_menu_init (GailOptionMenu *menu); -static void gail_option_menu_real_initialize (AtkObject *obj, - gpointer data); - -static gint gail_option_menu_get_n_children (AtkObject *obj); -static AtkObject* gail_option_menu_ref_child (AtkObject *obj, - gint i); -static gint gail_option_menu_real_add_gtk (GtkContainer *container, - GtkWidget *widget, - gpointer data); -static gint gail_option_menu_real_remove_gtk (GtkContainer *container, - GtkWidget *widget, - gpointer data); - - -static void atk_action_interface_init (AtkActionIface *iface); - -static gboolean gail_option_menu_do_action (AtkAction *action, - gint i); -static gboolean idle_do_action (gpointer data); -static gint gail_option_menu_get_n_actions (AtkAction *action); -static G_CONST_RETURN gchar* gail_option_menu_get_description (AtkAction *action, - gint i); -static G_CONST_RETURN gchar* gail_option_menu_action_get_name (AtkAction *action, - gint i); -static gboolean gail_option_menu_set_description (AtkAction *action, - gint i, - const gchar *desc); -static void gail_option_menu_changed (GtkOptionMenu *option_menu); - -G_DEFINE_TYPE_WITH_CODE (GailOptionMenu, gail_option_menu, GAIL_TYPE_BUTTON, - G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_interface_init)) - -static void -gail_option_menu_class_init (GailOptionMenuClass *klass) -{ - AtkObjectClass *class = ATK_OBJECT_CLASS (klass); - GailContainerClass *container_class; - - container_class = (GailContainerClass *) klass; - - class->get_n_children = gail_option_menu_get_n_children; - class->ref_child = gail_option_menu_ref_child; - class->initialize = gail_option_menu_real_initialize; - - container_class->add_gtk = gail_option_menu_real_add_gtk; - container_class->remove_gtk = gail_option_menu_real_remove_gtk; -} - -static void -gail_option_menu_init (GailOptionMenu *menu) -{ -} - -static void -gail_option_menu_real_initialize (AtkObject *obj, - gpointer data) -{ - GtkOptionMenu *option_menu; - - ATK_OBJECT_CLASS (gail_option_menu_parent_class)->initialize (obj, data); - - option_menu = GTK_OPTION_MENU (data); - - g_signal_connect (option_menu, "changed", - G_CALLBACK (gail_option_menu_changed), NULL); - - obj->role = ATK_ROLE_COMBO_BOX; -} - -static gint -gail_option_menu_get_n_children (AtkObject *obj) -{ - GtkWidget *widget; - GtkOptionMenu *option_menu; - gint n_children = 0; - - g_return_val_if_fail (GAIL_IS_OPTION_MENU (obj), 0); - - widget = GTK_ACCESSIBLE (obj)->widget; - if (widget == NULL) - /* - * State is defunct - */ - return 0; - - option_menu = GTK_OPTION_MENU (widget); - if (gtk_option_menu_get_menu (option_menu)) - n_children++; - - return n_children;; -} - -static AtkObject* -gail_option_menu_ref_child (AtkObject *obj, - gint i) -{ - GtkWidget *widget; - AtkObject *accessible; - - g_return_val_if_fail (GAIL_IS_OPTION_MENU (obj), NULL); - - widget = GTK_ACCESSIBLE (obj)->widget; - if (widget == NULL) - /* - * State is defunct - */ - return NULL; - - - if (i == 0) - accessible = g_object_ref (gtk_widget_get_accessible (gtk_option_menu_get_menu (GTK_OPTION_MENU (widget)))); - else - accessible = NULL; - - return accessible; -} - -static gint -gail_option_menu_real_add_gtk (GtkContainer *container, - GtkWidget *widget, - gpointer data) -{ - AtkObject* atk_parent = ATK_OBJECT (data); - AtkObject* atk_child = gtk_widget_get_accessible (widget); - - GAIL_CONTAINER_CLASS (gail_option_menu_parent_class)->add_gtk (container, widget, data); - - g_object_notify (G_OBJECT (atk_child), "accessible_parent"); - - g_signal_emit_by_name (atk_parent, "children_changed::add", - 1, atk_child, NULL); - - return 1; -} - -static gint -gail_option_menu_real_remove_gtk (GtkContainer *container, - GtkWidget *widget, - gpointer data) -{ - AtkPropertyValues values = { NULL }; - AtkObject* atk_parent = ATK_OBJECT (data); - AtkObject *atk_child = gtk_widget_get_accessible (widget); - - g_value_init (&values.old_value, G_TYPE_POINTER); - g_value_set_pointer (&values.old_value, atk_parent); - - values.property_name = "accessible-parent"; - g_signal_emit_by_name (atk_child, - "property_change::accessible-parent", &values, NULL); - g_signal_emit_by_name (atk_parent, "children_changed::remove", - 1, atk_child, NULL); - - return 1; -} - -static void -atk_action_interface_init (AtkActionIface *iface) -{ - iface->do_action = gail_option_menu_do_action; - iface->get_n_actions = gail_option_menu_get_n_actions; - iface->get_description = gail_option_menu_get_description; - iface->get_name = gail_option_menu_action_get_name; - iface->set_description = gail_option_menu_set_description; -} - -static gboolean -gail_option_menu_do_action (AtkAction *action, - gint i) -{ - GtkWidget *widget; - GailButton *button; - gboolean return_value = TRUE; - - button = GAIL_BUTTON (action); - widget = GTK_ACCESSIBLE (action)->widget; - if (widget == NULL) - /* - * State is defunct - */ - return FALSE; - - if (!gtk_widget_get_sensitive (widget) || !gtk_widget_get_visible (widget)) - return FALSE; - - switch (i) - { - case 0: - if (button->action_idle_handler) - return_value = FALSE; - else - button->action_idle_handler = gdk_threads_add_idle (idle_do_action, button); - break; - default: - return_value = FALSE; - break; - } - return return_value; -} - -static gboolean -idle_do_action (gpointer data) -{ - GtkButton *button; - GtkWidget *widget; - GdkEvent tmp_event; - GailButton *gail_button; - - gail_button = GAIL_BUTTON (data); - gail_button->action_idle_handler = 0; - - widget = GTK_ACCESSIBLE (gail_button)->widget; - if (widget == NULL /* State is defunct */ || - !gtk_widget_get_sensitive (widget) || !gtk_widget_get_visible (widget)) - return FALSE; - - button = GTK_BUTTON (widget); - - button->in_button = TRUE; - g_signal_emit_by_name (button, "enter"); - /* - * Simulate a button press event. calling gtk_button_pressed() does - * not get the job done for a GtkOptionMenu. - */ - tmp_event.button.type = GDK_BUTTON_PRESS; - tmp_event.button.window = widget->window; - tmp_event.button.button = 1; - tmp_event.button.send_event = TRUE; - tmp_event.button.time = GDK_CURRENT_TIME; - tmp_event.button.axes = NULL; - - gtk_widget_event (widget, &tmp_event); - - return FALSE; -} - -static gint -gail_option_menu_get_n_actions (AtkAction *action) -{ - return 1; -} - -static G_CONST_RETURN gchar* -gail_option_menu_get_description (AtkAction *action, - gint i) -{ - GailButton *button; - G_CONST_RETURN gchar *return_value; - - button = GAIL_BUTTON (action); - - switch (i) - { - case 0: - return_value = button->press_description; - break; - default: - return_value = NULL; - break; - } - return return_value; -} - -static G_CONST_RETURN gchar* -gail_option_menu_action_get_name (AtkAction *action, - gint i) -{ - G_CONST_RETURN gchar *return_value; - - switch (i) - { - case 0: - /* - * This action simulates a button press by simulating moving the - * mouse into the button followed by pressing the left mouse button. - */ - return_value = "press"; - break; - default: - return_value = NULL; - break; - } - return return_value; -} - -static gboolean -gail_option_menu_set_description (AtkAction *action, - gint i, - const gchar *desc) -{ - GailButton *button; - gchar **value; - - button = GAIL_BUTTON (action); - - switch (i) - { - case 0: - value = &button->press_description; - break; - default: - value = NULL; - break; - } - - if (value) - { - g_free (*value); - *value = g_strdup (desc); - return TRUE; - } - else - return FALSE; -} - -static void -gail_option_menu_changed (GtkOptionMenu *option_menu) -{ - GailOptionMenu *gail_option_menu; - - gail_option_menu = GAIL_OPTION_MENU (gtk_widget_get_accessible (GTK_WIDGET (option_menu))); - g_object_notify (G_OBJECT (gail_option_menu), "accessible-name"); -} - diff --git a/modules/other/gail/gailoptionmenu.h b/modules/other/gail/gailoptionmenu.h deleted file mode 100644 index 1939a9aaed..0000000000 --- a/modules/other/gail/gailoptionmenu.h +++ /dev/null @@ -1,51 +0,0 @@ -/* GAIL - The GNOME Accessibility Implementation Library - * Copyright 2001 Sun Microsystems Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __GAIL_OPTION_MENU_H__ -#define __GAIL_OPTION_MENU_H__ - -#include - -G_BEGIN_DECLS - -#define GAIL_TYPE_OPTION_MENU (gail_option_menu_get_type ()) -#define GAIL_OPTION_MENU(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_OPTION_MENU, GailOptionMenu)) -#define GAIL_OPTION_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAIL_TYPE_OPTION_MENU, GailOptionMenuClass)) -#define GAIL_IS_OPTION_MENU(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_OPTION_MENU)) -#define GAIL_IS_OPTION_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_OPTION_MENU)) -#define GAIL_OPTION_MENU_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_OPTION_MENU, GailOptionMenuClass)) - -typedef struct _GailOptionMenu GailOptionMenu; -typedef struct _GailOptionMenuClass GailOptionMenuClass; - -struct _GailOptionMenu -{ - GailButton parent; -}; - -GType gail_option_menu_get_type (void); - -struct _GailOptionMenuClass -{ - GailButtonClass parent_class; -}; - -G_END_DECLS - -#endif /* __GAIL_OPTION_MENU_H__ */ diff --git a/modules/other/gail/gailpixmap.c b/modules/other/gail/gailpixmap.c deleted file mode 100644 index 0e9c926aa7..0000000000 --- a/modules/other/gail/gailpixmap.c +++ /dev/null @@ -1,158 +0,0 @@ -/* GAIL - The GNOME Accessibility Implementation Library - * Copyright 2001 Sun Microsystems Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include "config.h" - -#undef GTK_DISABLE_DEPRECATED - -#include - -#include "gailpixmap.h" - -static void gail_pixmap_class_init (GailPixmapClass *klass); -static void gail_pixmap_init (GailPixmap *pixmap); -static void gail_pixmap_initialize (AtkObject *accessible, - gpointer data); - -/* AtkImage */ -static void atk_image_interface_init (AtkImageIface *iface); -static G_CONST_RETURN gchar* gail_pixmap_get_image_description - (AtkImage *obj); -static void gail_pixmap_get_image_position - (AtkImage *obj, - gint *x, - gint *y, - AtkCoordType coord_type); -static void gail_pixmap_get_image_size (AtkImage *obj, - gint *width, - gint *height); -static gboolean gail_pixmap_set_image_description - (AtkImage *obj, - const gchar *description); -static void gail_pixmap_finalize (GObject *object); - -G_DEFINE_TYPE_WITH_CODE (GailPixmap, gail_pixmap, GAIL_TYPE_WIDGET, - G_IMPLEMENT_INTERFACE (ATK_TYPE_IMAGE, atk_image_interface_init)) - -static void -gail_pixmap_class_init (GailPixmapClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - AtkObjectClass *atk_object_class = ATK_OBJECT_CLASS (klass); - - atk_object_class->initialize = gail_pixmap_initialize; - - gobject_class->finalize = gail_pixmap_finalize; -} - -static void -gail_pixmap_init (GailPixmap *pixmap) -{ - pixmap->image_description = NULL; -} - -static void -gail_pixmap_initialize (AtkObject *accessible, - gpointer data) -{ - ATK_OBJECT_CLASS (gail_pixmap_parent_class)->initialize (accessible, data); - - accessible->role = ATK_ROLE_ICON; -} - -static void -atk_image_interface_init (AtkImageIface *iface) -{ - iface->get_image_description = gail_pixmap_get_image_description; - iface->get_image_position = gail_pixmap_get_image_position; - iface->get_image_size = gail_pixmap_get_image_size; - iface->set_image_description = gail_pixmap_set_image_description; -} - -static G_CONST_RETURN gchar* -gail_pixmap_get_image_description (AtkImage *obj) -{ - GailPixmap* pixmap; - - g_return_val_if_fail (GAIL_IS_PIXMAP (obj), NULL); - - pixmap = GAIL_PIXMAP (obj); - - return pixmap->image_description; -} - -static void -gail_pixmap_get_image_position (AtkImage *obj, - gint *x, - gint *y, - AtkCoordType coord_type) -{ - atk_component_get_position (ATK_COMPONENT (obj), x, y, coord_type); -} - -static void -gail_pixmap_get_image_size (AtkImage *obj, - gint *width, - gint *height) -{ - GtkWidget *widget; - GtkPixmap *pixmap; - - *width = -1; - *height = -1; - - g_return_if_fail (GAIL_IS_PIXMAP (obj)); - - widget = GTK_ACCESSIBLE (obj)->widget; - if (widget == 0) - /* State is defunct */ - return; - - g_return_if_fail (GTK_IS_PIXMAP (widget)); - - pixmap = GTK_PIXMAP (widget); - - if (pixmap->pixmap) - gdk_drawable_get_size (pixmap->pixmap, width, height); -} - -static gboolean -gail_pixmap_set_image_description (AtkImage *obj, - const gchar *description) -{ - GailPixmap* pixmap; - - g_return_val_if_fail (GAIL_IS_PIXMAP (obj), FALSE); - - pixmap = GAIL_PIXMAP (obj); - g_free (pixmap->image_description); - - pixmap->image_description = g_strdup (description); - - return TRUE; -} - -static void -gail_pixmap_finalize (GObject *object) -{ - GailPixmap *pixmap = GAIL_PIXMAP (object); - - g_free (pixmap->image_description); - G_OBJECT_CLASS (gail_pixmap_parent_class)->finalize (object); -} diff --git a/modules/other/gail/gailpixmap.h b/modules/other/gail/gailpixmap.h deleted file mode 100644 index 41cdcd8f02..0000000000 --- a/modules/other/gail/gailpixmap.h +++ /dev/null @@ -1,54 +0,0 @@ -/* GAIL - The GNOME Accessibility Implementation Library - * Copyright 2001 Sun Microsystems Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __GAIL_PIXMAP_H__ -#define __GAIL_PIXMAP_H__ - -#include - -G_BEGIN_DECLS - -#define GAIL_TYPE_PIXMAP (gail_pixmap_get_type ()) -#define GAIL_PIXMAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_PIXMAP, GailPixmap)) -#define GAIL_PIXMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GAIL_TYPE_PIXMAP, GailPixmapClass)) -#define GAIL_IS_PIXMAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_PIXMAP)) -#define GAIL_IS_PIXMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_PIXMAP)) -#define GAIL_PIXMAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_PIXMAP, GailPixmapClass)) - -typedef struct _GailPixmap GailPixmap; -typedef struct _GailPixmapClass GailPixmapClass; - -struct _GailPixmap -{ - GailWidget parent; - - gchar* image_description; - -}; - -GType gail_pixmap_get_type (void); - -struct _GailPixmapClass -{ - GailWidgetClass parent_class; -}; - -G_END_DECLS - -#endif /* __GAIL_PIXMAP_H__ */ diff --git a/modules/other/gail/gailtogglebutton.c b/modules/other/gail/gailtogglebutton.c index beed9a8309..94f9f59658 100644 --- a/modules/other/gail/gailtogglebutton.c +++ b/modules/other/gail/gailtogglebutton.c @@ -122,7 +122,19 @@ gail_toggle_button_real_notify_gtk (GObject *obj, if (strcmp (pspec->name, "inconsistent") == 0) atk_object_notify_state_change (atk_obj, ATK_STATE_ENABLED, - !gtk_toggle_button_get_inconsistent (toggle_button)); + (gtk_widget_get_sensitive (GTK_WIDGET (toggle_button)) && + !gtk_toggle_button_get_inconsistent (toggle_button))); + else if (strcmp (pspec->name, "sensitive") == 0) + { + /* Need to override gailwidget behavior of notifying for ENABLED */ + gboolean sensitive; + gboolean enabled; + sensitive = gtk_widget_get_sensitive (GTK_WIDGET (toggle_button)); + enabled = sensitive && + !gtk_toggle_button_get_inconsistent (toggle_button); + atk_object_notify_state_change (atk_obj, ATK_STATE_SENSITIVE, sensitive); + atk_object_notify_state_change (atk_obj, ATK_STATE_ENABLED, enabled); + } else GAIL_WIDGET_CLASS (gail_toggle_button_parent_class)->notify_gtk (obj, pspec); } diff --git a/modules/other/gail/gailtoplevel.c b/modules/other/gail/gailtoplevel.c index 7f458fbd82..afbd5b366b 100644 --- a/modules/other/gail/gailtoplevel.c +++ b/modules/other/gail/gailtoplevel.c @@ -22,8 +22,6 @@ #include #include -#undef GTK_DISABLE_DEPRECATED - #include #include "gailtoplevel.h" @@ -335,7 +333,6 @@ is_attached_menu_window (GtkWidget *widget) attach = gtk_menu_get_attach_widget (GTK_MENU (child)); /* Allow for menu belonging to the Panel Menu, which is a GtkButton */ if (GTK_IS_MENU_ITEM (attach) || - GTK_IS_OPTION_MENU (attach) || GTK_IS_BUTTON (attach)) ret = TRUE; } @@ -365,8 +362,6 @@ is_combo_window (GtkWidget *widget) obj = gtk_widget_get_accessible (child); obj = atk_object_get_parent (obj); accessible = GTK_ACCESSIBLE (obj); - if (GTK_IS_COMBO (accessible->widget)) - return TRUE; return FALSE; } diff --git a/modules/other/gail/gailwidget.c b/modules/other/gail/gailwidget.c index 4d550f0ea7..c92c3c6663 100644 --- a/modules/other/gail/gailwidget.c +++ b/modules/other/gail/gailwidget.c @@ -21,8 +21,6 @@ #include -#undef GTK_DISABLE_DEPRECATED - #include #ifdef GDK_WINDOWING_X11 #include @@ -382,7 +380,7 @@ gail_widget_ref_relation_set (AtkObject *obj) relation_set = ATK_OBJECT_CLASS (gail_widget_parent_class)->ref_relation_set (obj); - if (GTK_IS_BOX (widget) && !GTK_IS_COMBO (widget)) + if (GTK_IS_BOX (widget)) /* * Do not report labelled-by for a GtkBox which could be a * GnomeFileEntry. @@ -417,26 +415,6 @@ gail_widget_ref_relation_set (AtkObject *obj) } } } - else if (GTK_IS_COMBO (widget)) - /* - * Handle the case when GnomeFileEntry is the mnemonic widget. - * The GnomeEntry which is a grandchild of the GnomeFileEntry - * should be the mnemonic widget. See bug #137584. - */ - { - GtkWidget *temp_widget; - - temp_widget = gtk_widget_get_parent (widget); - - if (GTK_IS_HBOX (temp_widget)) - { - temp_widget = gtk_widget_get_parent (temp_widget); - if (GTK_IS_BOX (temp_widget)) - { - label = find_label (temp_widget); - } - } - } else if (GTK_IS_COMBO_BOX (widget)) /* * Handle the case when GtkFileChooserButton is the mnemonic @@ -791,14 +769,14 @@ gail_widget_set_extents (AtkComponent *component, return FALSE; else { - gtk_widget_set_uposition (widget, x_current, y_current); + gtk_window_move (GTK_WINDOW (widget), x_current, y_current); gtk_widget_set_size_request (widget, width, height); return TRUE; } } else if (coord_type == ATK_XY_SCREEN) - { - gtk_widget_set_uposition (widget, x, y); + { + gtk_window_move (GTK_WINDOW (widget), x, y); gtk_widget_set_size_request (widget, width, height); return TRUE; } @@ -835,13 +813,13 @@ gail_widget_set_position (AtkComponent *component, return FALSE; else { - gtk_widget_set_uposition (widget, x_current, y_current); + gtk_window_move (GTK_WINDOW (widget), x_current, y_current); return TRUE; } } else if (coord_type == ATK_XY_SCREEN) - { - gtk_widget_set_uposition (widget, x, y); + { + gtk_window_move (GTK_WINDOW (widget), x, y); return TRUE; } } @@ -997,6 +975,9 @@ gail_widget_real_notify_gtk (GObject *obj, return; atk_object_notify_state_change (atk_obj, state, value); + if (state == ATK_STATE_SENSITIVE) + atk_object_notify_state_change (atk_obj, ATK_STATE_ENABLED, value); + } static void diff --git a/modules/other/gail/gailwindow.c b/modules/other/gail/gailwindow.c index 5582b3a541..a4947e6020 100644 --- a/modules/other/gail/gailwindow.c +++ b/modules/other/gail/gailwindow.c @@ -21,8 +21,6 @@ #include -#undef GTK_DISABLE_DEPRECATED - #include #include "gailwindow.h" @@ -210,7 +208,7 @@ gail_window_real_initialize (AtkObject *obj, g_object_set_data (G_OBJECT (obj), "atk-component-layer", GINT_TO_POINTER (ATK_LAYER_WINDOW)); - if (GTK_IS_FILE_SELECTION (widget)) + if (GTK_IS_FILE_CHOOSER_DIALOG (widget)) obj->role = ATK_ROLE_FILE_CHOOSER; else if (GTK_IS_COLOR_SELECTION_DIALOG (widget)) obj->role = ATK_ROLE_COLOR_CHOOSER; diff --git a/modules/other/gail/libgail-util/Makefile.am b/modules/other/gail/libgail-util/Makefile.am index 3145719b56..37e3b2de96 100644 --- a/modules/other/gail/libgail-util/Makefile.am +++ b/modules/other/gail/libgail-util/Makefile.am @@ -29,26 +29,26 @@ uninstall-ms-lib: endif -lib_LTLIBRARIES = libgailutil.la +lib_LTLIBRARIES = libgailutil-3.0.la util_c_sources = \ gailmisc.c \ gailtextutil.c -libgailutilincludedir=$(includedir)/gail-1.0/libgail-util +libgailutilincludedir=$(includedir)/gail-3.0/libgail-util util_public_h_sources = \ gailmisc.h \ gailtextutil.h \ gail-util.h -libgailutil_la_SOURCES = \ +libgailutil_3_0_la_SOURCES = \ $(util_c_sources) libgailutilinclude_HEADERS = \ $(util_public_h_sources) -libgailutil_la_CPPFLAGS = \ +libgailutil_3_0_la_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_srcdir)/gdk \ -I$(top_builddir)/gdk \ @@ -58,24 +58,24 @@ libgailutil_la_CPPFLAGS = \ -DGDK_DISABLE_DEPRECATED\ -DGTK_DISABLE_DEPRECATED -libgailutil_la_CFLAGS = \ +libgailutil_3_0_la_CFLAGS = \ $(GTK_DEP_CFLAGS) \ $(GTK_DEBUG_FLAGS) \ $(AM_CFLAGS) -libgailutil_la_LIBADD = \ +libgailutil_3_0_la_LIBADD = \ $(top_builddir)/gtk/$(gtktargetlib) \ $(top_builddir)/gdk/$(gdktargetlib) \ $(GTK_DEP_LIBS) -libgailutil_la_LDFLAGS = \ +libgailutil_3_0_la_LDFLAGS = \ -version-info $(GAIL_LT_VERSION_INFO) \ $(no_undefined) \ $(export_symbols) \ $(LDFLAGS) -gailutil.lib: libgailutil.la gailutil.def - lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgailutil-$(GAIL_LT_CURRENT_MINUS_AGE).dll -def:gailutil.def -out:$@ +gailutil.lib: libgailutil-3.0.la gailutil.def + lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgailutil-3.0-$(GAIL_LT_CURRENT_MINUS_AGE).dll -def:gailutil.def -out:$@ install-data-local: install-ms-lib install-def-file diff --git a/modules/other/gail/libgail-util/gailmisc.c b/modules/other/gail/libgail-util/gailmisc.c index ade1288bb4..81b1382199 100644 --- a/modules/other/gail/libgail-util/gailmisc.c +++ b/modules/other/gail/libgail-util/gailmisc.c @@ -27,6 +27,18 @@ * code for AtkUtil - for that code, please see gail/gail.c. */ +/** + * SECTION:gailmisc + * @Short_description: GailMisc is a set of utility functions which may be + * useful to implementors of Atk interfaces for custom widgets. + * @Title: GailMisc + * + * GailMisc is a set of utility function which are used in the implemementation + * of Atk interfaces for GTK+ widgets. They may be useful to implementors of + * Atk interfaces for custom widgets. + */ + + /** * gail_misc_get_extents_from_pango_rectangle: * @widget: The widget that contains the PangoLayout, that contains diff --git a/modules/other/gail/libgail-util/gailtextutil.c b/modules/other/gail/libgail-util/gailtextutil.c index 5ef7f69a0a..ecfd8ef785 100644 --- a/modules/other/gail/libgail-util/gailtextutil.c +++ b/modules/other/gail/libgail-util/gailtextutil.c @@ -22,6 +22,21 @@ #include #include "gailtextutil.h" +/** + * SECTION:gailtextutil + * @Short_description: GailTextUtil is a utility class which can be used to + * implement some of the #AtkText functions for accessible objects + * which implement #AtkText. + * @Title: GailTextUtil + * + * GailTextUtil is a utility class which can be used to implement the + * #AtkText functions which get text for accessible objects which implement + * #AtkText. + * + * In GAIL it is used by the accsesible objects for #GnomeCanvasText, #GtkEntry, + * #GtkLabel, #GtkCellRendererText and #GtkTextView. + */ + static void gail_text_util_class_init (GailTextUtilClass *klass); static void gail_text_util_init (GailTextUtil *textutil); diff --git a/modules/other/gail/tests/Makefile.am b/modules/other/gail/tests/Makefile.am index 993249558a..fdafe787b0 100644 --- a/modules/other/gail/tests/Makefile.am +++ b/modules/other/gail/tests/Makefile.am @@ -5,7 +5,7 @@ if PLATFORM_WIN32 no_undefined = -no-undefined endif -moduledir = $(libdir)/gtk-2.0/modules +moduledir = $(libdir)/gtk-3.0/modules if !OS_WIN32 module_LTLIBRARIES = \ @@ -21,7 +21,6 @@ noinst_LTLIBRARIES = \ libtestnotebook.la \ libtestobject.la \ libtestmenuitem.la \ - libtestoptionmenu.la \ libtestpaned.la \ libtestprops.la \ libtestselection.la \ @@ -152,18 +151,6 @@ libtestobject_la_LDFLAGS = \ $(GTK_DEP_LIBS) \ $(LDFLAGS) -libtestoptionmenu_la_SOURCES = \ - testlib.c \ - testlib.h \ - testoptionmenu.c - -libtestoptionmenu_la_LDFLAGS = \ - -rpath $(moduledir) -module -avoid-version $(no_undefined) \ - $(top_builddir)/gtk/$(gtktargetlib) \ - $(top_builddir)/gdk/$(gdktargetlib) \ - $(GTK_DEP_LIBS) \ - $(LDFLAGS) - libtestpaned_la_SOURCES = \ testlib.c \ testlib.h \ diff --git a/modules/other/gail/tests/README b/modules/other/gail/tests/README index 7a6fdcba4e..3ab350ec54 100644 --- a/modules/other/gail/tests/README +++ b/modules/other/gail/tests/README @@ -199,14 +199,6 @@ interface in atkobject.h in the GAIL library. It is normally used with the GTK+ test program testgtk. -testoptionmenu -============== - -This is a GTK+ module used to test the implementation of the ATK interfaces -for GtkOptionmenu. It should be used with the GTK+ test program testgtk and -its file selection dialog. - - testpaned ========= diff --git a/modules/other/gail/tests/ferret.c b/modules/other/gail/tests/ferret.c index 4cde9a7b48..2dfa914c44 100644 --- a/modules/other/gail/tests/ferret.c +++ b/modules/other/gail/tests/ferret.c @@ -1,6 +1,4 @@ #define MAX_BUFFER 256 -#undef GTK_DISABLE_DEPRECATED -#define GTK_ENABLE_BROKEN #define MAX_GROUPS 20 #define MAX_NAME_VALUE 20 @@ -1666,7 +1664,6 @@ _create_window (void) { window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_widget_set_name (window, "Ferret Window"); - gtk_window_set_policy (GTK_WINDOW(window), TRUE, TRUE, FALSE); g_signal_connect (GTK_OBJECT (window), "destroy", G_CALLBACK (gtk_widget_destroyed), @@ -1684,7 +1681,7 @@ _create_window (void) gtk_box_pack_start (GTK_BOX (vbox1), menubar, FALSE, TRUE, 0); gtk_widget_show (menubar); menutop = gtk_menu_item_new_with_label("Menu"); - gtk_menu_bar_append(GTK_MENU_BAR(menubar), menutop); + gtk_menu_shell_append (GTK_MENU_SHELL (menubar), menutop); gtk_widget_show (menutop); menu = gtk_menu_new(); gtk_menu_item_set_submenu (GTK_MENU_ITEM (menutop), menu); @@ -1978,7 +1975,7 @@ _get_name_value(GroupInfo *group, const gchar *label, name_value->label = GTK_LABEL(gtk_label_new(label)); name_value->string = gtk_label_new (NULL); name_value->boolean = gtk_check_button_new (); - name_value->text = gtk_entry_new_with_max_length (1000); + gtk_entry_buffer_set_max_length (gtk_entry_get_buffer (GTK_ENTRY (name_value->text)), 1000); name_value->button = GTK_BUTTON(gtk_button_new ()); gtk_box_pack_end(GTK_BOX(name_value->column1), diff --git a/modules/other/gail/tests/testcombo.c b/modules/other/gail/tests/testcombo.c index 7291fa0c99..f34a812577 100644 --- a/modules/other/gail/tests/testcombo.c +++ b/modules/other/gail/tests/testcombo.c @@ -1,5 +1,3 @@ -#undef GTK_DISABLE_DEPRECATED - #include #include "testlib.h" @@ -114,10 +112,12 @@ static void _check_combo_box (AtkObject *obj) } if (g_getenv ("TEST_ACCESSIBLE_COMBO_NOEDIT") != NULL) { + GtkWidget *combo; GtkEntry *entry; - entry = GTK_ENTRY (GTK_COMBO (GTK_ACCESSIBLE (combo_obj)->widget)->entry); - gtk_entry_set_editable (entry, FALSE); + combo = GTK_ACCESSIBLE (combo_obj)->widget; + entry = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (combo))); + gtk_editable_set_editable (GTK_EDITABLE (entry), FALSE); } _check_children (combo_obj); _test_selection (combo_obj); @@ -133,7 +133,7 @@ static void _check_combo_box (AtkObject *obj) if (!done) { - gtk_idle_add (_open_combo_list, obj); + g_idle_add ((GSourceFunc)_open_combo_list, obj); done = TRUE; } else @@ -148,7 +148,7 @@ static gint _open_combo_list (gpointer data) g_print ("_open_combo_list\n"); atk_action_do_action (ATK_ACTION (obj), 0); - gtk_timeout_add (5000, _close_combo_list, obj); + g_timeout_add (5000, _close_combo_list, obj); return FALSE; } diff --git a/modules/other/gail/tests/testoptionmenu.c b/modules/other/gail/tests/testoptionmenu.c deleted file mode 100644 index 6c1de3925a..0000000000 --- a/modules/other/gail/tests/testoptionmenu.c +++ /dev/null @@ -1,157 +0,0 @@ -#undef GTK_DISABLE_DEPRECATED - -#include - -#include "testlib.h" - -/* - * This module is used to test the accessible implementation for GtkOptionMenu - * - * When the GtkOption menu in the FileSelectionDialog is tabbed to, the menu - * is opened and the second item in the menu is selected which causes the - * menu to be closed and the item in the GtkOptionMenu to be updated. - */ -#define NUM_VALID_ROLES 1 - -static void _create_event_watcher (void); -static void _check_object (AtkObject *obj); -static gint _do_menu_item_action (gpointer data); -static gboolean doing_action = FALSE; - -static void -_check_object (AtkObject *obj) -{ - AtkRole role; - static G_CONST_RETURN char *name = NULL; - static gboolean first_time = TRUE; - - role = atk_object_get_role (obj); - if (role == ATK_ROLE_PUSH_BUTTON) - /* - * Find the specified optionmenu item - */ - { - AtkRole valid_roles[NUM_VALID_ROLES]; - AtkObject *atk_option_menu; - GtkWidget *widget; - - if (name == NULL) - { - name = g_getenv ("TEST_ACCESSIBLE_NAME"); - if (name == NULL) - name = "foo"; - } - valid_roles[0] = ATK_ROLE_PUSH_BUTTON; - atk_option_menu = find_object_by_accessible_name_and_role (obj, name, - valid_roles, NUM_VALID_ROLES); - - if (atk_option_menu == NULL) - { - g_print ("Object not found for %s\n", name); - return; - } - else - { - g_print ("Object found for %s\n", name); - } - - - g_assert (GTK_IS_ACCESSIBLE (atk_option_menu)); - widget = GTK_ACCESSIBLE (atk_option_menu)->widget; - g_assert (GTK_IS_OPTION_MENU (widget)); - - if (first_time) - first_time = FALSE; - else - return; - - /* - * This action opens the GtkOptionMenu whose name is "foo" or whatever - * was specified in the environment variable TEST_ACCESSIBLE_NAME - */ - atk_action_do_action (ATK_ACTION (atk_option_menu), 0); - } - else if ((role == ATK_ROLE_MENU_ITEM) || - (role == ATK_ROLE_CHECK_MENU_ITEM) || - (role == ATK_ROLE_RADIO_MENU_ITEM) || - (role == ATK_ROLE_TEAR_OFF_MENU_ITEM)) - { - AtkObject *parent, *child; - AtkRole parent_role; - - /* - * If we receive focus while waiting for the menu to be closed - * we return immediately - */ - if (doing_action) - return; - - parent = atk_object_get_parent (obj); - parent_role = atk_object_get_role (parent); - g_assert (parent_role == ATK_ROLE_MENU); - - child = atk_object_ref_accessible_child (parent, 1); - doing_action = TRUE; - g_timeout_add (5000, _do_menu_item_action, child); - } - else - { - G_CONST_RETURN char *accessible_name; - - accessible_name = atk_object_get_name (obj); - if (accessible_name) - { - g_print ("Name: %s\n", accessible_name); - } - else if (GTK_IS_ACCESSIBLE (obj)) - { - GtkWidget *widget = GTK_ACCESSIBLE (obj)->widget; - g_print ("Type: %s\n", g_type_name (G_OBJECT_TYPE (widget))); - } - if (role == ATK_ROLE_TABLE) - { - gint n_cols, i; - - n_cols = atk_table_get_n_columns (ATK_TABLE (obj)); - g_print ("Number of Columns: %d\n", n_cols); - - for (i = 0; i < n_cols; i++) - { - AtkObject *header; - - header = atk_table_get_column_header (ATK_TABLE (obj), i); - g_print ("header: %s %s\n", - g_type_name (G_OBJECT_TYPE (header)), - atk_object_get_name (header)); - } - } - } -} - -static gint _do_menu_item_action (gpointer data) -{ - AtkObject *obj = ATK_OBJECT (data); - - atk_action_do_action (ATK_ACTION (obj), 0); - doing_action = FALSE; - - g_object_unref (obj); - - return FALSE; -} - -static void -_create_event_watcher (void) -{ - atk_add_focus_tracker (_check_object); -} - -int -gtk_module_init(gint argc, char* argv[]) -{ - g_print("testoptionmenu Module loaded\n"); - - _create_event_watcher(); - - return 0; -} diff --git a/modules/printbackends/cups/Makefile.am b/modules/printbackends/cups/Makefile.am index 463199e829..de4d77477d 100644 --- a/modules/printbackends/cups/Makefile.am +++ b/modules/printbackends/cups/Makefile.am @@ -20,7 +20,7 @@ LDADDS = \ $(top_builddir)/gdk/$(gdktargetlib) \ $(GTK_DEP_LIBS) -backenddir = $(libdir)/gtk-2.0/$(GTK_BINARY_VERSION)/printbackends +backenddir = $(libdir)/gtk-3.0/$(GTK_BINARY_VERSION)/printbackends backend_LTLIBRARIES = libprintbackend-cups.la diff --git a/modules/printbackends/cups/gtkcupsutils.c b/modules/printbackends/cups/gtkcupsutils.c index cd97f10efd..1023da09e6 100644 --- a/modules/printbackends/cups/gtkcupsutils.c +++ b/modules/printbackends/cups/gtkcupsutils.c @@ -1502,6 +1502,7 @@ gtk_cups_connection_test_new (const char *server) result->socket = -1; result->current_addr = NULL; + result->last_wrong_addr = NULL; result->at_init = GTK_CUPS_CONNECTION_NOT_AVAILABLE; result->at_init = gtk_cups_connection_test_get_state (result); @@ -1540,7 +1541,14 @@ gtk_cups_connection_test_get_state (GtkCupsConnectionTest *test) { if (test->socket == -1) { - iter = test->addrlist; + if (test->last_wrong_addr != NULL && test->last_wrong_addr->next != NULL) + iter = test->last_wrong_addr->next; + else + { + test->last_wrong_addr = NULL; + iter = test->addrlist; + } + while (iter) { test->socket = socket (iter->addr.addr.sa_family, @@ -1584,7 +1592,12 @@ gtk_cups_connection_test_get_state (GtkCupsConnectionTest *test) if (error_code == EALREADY || error_code == EINPROGRESS) result = GTK_CUPS_CONNECTION_IN_PROGRESS; else - result = GTK_CUPS_CONNECTION_NOT_AVAILABLE; + { + close (test->socket); + test->socket = -1; + test->last_wrong_addr = test->current_addr; + result = GTK_CUPS_CONNECTION_NOT_AVAILABLE; + } } } @@ -1605,6 +1618,7 @@ gtk_cups_connection_test_free (GtkCupsConnectionTest *test) #ifdef HAVE_CUPS_API_1_2 test->current_addr = NULL; + test->last_wrong_addr = NULL; httpAddrFreeList (test->addrlist); if (test->socket != -1) { diff --git a/modules/printbackends/cups/gtkcupsutils.h b/modules/printbackends/cups/gtkcupsutils.h index ba43f875f7..2438b86696 100644 --- a/modules/printbackends/cups/gtkcupsutils.h +++ b/modules/printbackends/cups/gtkcupsutils.h @@ -111,6 +111,7 @@ struct _GtkCupsConnectionTest GtkCupsConnectionState at_init; http_addrlist_t *addrlist; http_addrlist_t *current_addr; + http_addrlist_t *last_wrong_addr; gint socket; #endif }; diff --git a/modules/printbackends/cups/gtkprintbackendcups.c b/modules/printbackends/cups/gtkprintbackendcups.c index 8cb2e1a1f4..4b26cba5d3 100644 --- a/modules/printbackends/cups/gtkprintbackendcups.c +++ b/modules/printbackends/cups/gtkprintbackendcups.c @@ -116,6 +116,7 @@ struct _GtkPrintBackendCups guint got_default_printer : 1; guint default_printer_poll; GtkCupsConnectionTest *cups_connection_test; + gint reading_ppds; char **covers; int number_of_covers; @@ -588,6 +589,7 @@ gtk_print_backend_cups_init (GtkPrintBackendCups *backend_cups) backend_cups->got_default_printer = FALSE; backend_cups->list_printers_pending = FALSE; backend_cups->list_printers_attempts = 0; + backend_cups->reading_ppds = 0; backend_cups->requests = NULL; backend_cups->auth = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, overwrite_and_free); @@ -1246,6 +1248,7 @@ cups_request_execute (GtkPrintBackendCups *print_backend, dispatch = (GtkPrintCupsDispatchWatch *) g_source_new (&_cups_dispatch_watch_funcs, sizeof (GtkPrintCupsDispatchWatch)); + g_source_set_name (dispatch, "GTK+ CUPS backend"); GTK_NOTE (PRINTING, g_print ("CUPS Backend: %s - Executing cups request on server '%s' and resource '%s'\n", G_STRFUNC, dispatch, request->server, request->resource)); @@ -2142,7 +2145,7 @@ cups_request_printer_list (GtkPrintBackendCups *cups_backend) "auth-info-required" }; - if (cups_backend->list_printers_pending) + if (cups_backend->reading_ppds > 0 || cups_backend->list_printers_pending) return TRUE; state = gtk_cups_connection_test_get_state (cups_backend->cups_connection_test); @@ -2240,6 +2243,7 @@ cups_request_ppd_cb (GtkPrintBackendCups *print_backend, printer = GTK_PRINTER (data->printer); GTK_PRINTER_CUPS (printer)->reading_ppd = FALSE; + print_backend->reading_ppds--; if (gtk_cups_result_is_error (result)) { @@ -2386,6 +2390,7 @@ cups_request_ppd (GtkPrinter *printer) cups_printer->reading_ppd = TRUE; + GTK_PRINT_BACKEND_CUPS (print_backend)->reading_ppds++; cups_request_execute (GTK_PRINT_BACKEND_CUPS (print_backend), request, diff --git a/modules/printbackends/file/Makefile.am b/modules/printbackends/file/Makefile.am index 904f7687d4..30469e981b 100644 --- a/modules/printbackends/file/Makefile.am +++ b/modules/printbackends/file/Makefile.am @@ -4,7 +4,7 @@ if PLATFORM_WIN32 no_undefined = -no-undefined endif -backenddir = $(libdir)/gtk-2.0/$(GTK_BINARY_VERSION)/printbackends +backenddir = $(libdir)/gtk-3.0/$(GTK_BINARY_VERSION)/printbackends backend_LTLIBRARIES = libprintbackend-file.la diff --git a/modules/printbackends/lpr/Makefile.am b/modules/printbackends/lpr/Makefile.am index 12b7fcefd6..379fa4964a 100644 --- a/modules/printbackends/lpr/Makefile.am +++ b/modules/printbackends/lpr/Makefile.am @@ -16,9 +16,9 @@ INCLUDES = \ LDADDS = \ $(GTK_DEP_LIBS) \ - $(top_builddir)/gtk/$(gtktargetlib) + $(top_builddir)/gtk/$(gtktargetlib) -backenddir = $(libdir)/gtk-2.0/$(GTK_BINARY_VERSION)/printbackends +backenddir = $(libdir)/gtk-3.0/$(GTK_BINARY_VERSION)/printbackends backend_LTLIBRARIES = libprintbackend-lpr.la diff --git a/modules/printbackends/test/Makefile.am b/modules/printbackends/test/Makefile.am index 20904fa517..2f61165e0e 100644 --- a/modules/printbackends/test/Makefile.am +++ b/modules/printbackends/test/Makefile.am @@ -4,7 +4,7 @@ if PLATFORM_WIN32 no_undefined = -no-undefined endif -backenddir = $(libdir)/gtk-2.0/$(GTK_BINARY_VERSION)/printbackends +backenddir = $(libdir)/gtk-3.0/$(GTK_BINARY_VERSION)/printbackends backend_LTLIBRARIES = libprintbackend-test.la diff --git a/perf/Makefile.am b/perf/Makefile.am index 5662b32df2..68d18185d6 100644 --- a/perf/Makefile.am +++ b/perf/Makefile.am @@ -63,7 +63,7 @@ stamp-marshalers.h: @REBUILD@ marshalers.list $(GLIB_GENMARSHAL) --prefix=_gtk_marshal $(srcdir)/marshalers.list --header >> xgen-gmlh \ && (cmp -s xgen-gmlh marshalers.h || cp xgen-gmlh marshalers.h) \ && rm -f xgen-gmlh \ - && echo timestamp > $(@F) + && echo timestamp > $(@F) marshalers.c: @REBUILD@ marshalers.list $(GLIB_GENMARSHAL) --prefix=_gtk_marshal $(srcdir)/marshalers.list --body >> xgen-gmlc \ && cp xgen-gmlc marshalers.c \ diff --git a/po-properties/Makefile.in.in b/po-properties/Makefile.in.in index db1b638778..886b60aa08 100644 --- a/po-properties/Makefile.in.in +++ b/po-properties/Makefile.in.in @@ -28,6 +28,7 @@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datadir = @datadir@ +datarootdir = @datarootdir@ libdir = @libdir@ localedir = $(libdir)/locale gnulocaledir = $(datadir)/locale diff --git a/po-properties/POTFILES.in b/po-properties/POTFILES.in index 7d88064ada..ce14baab3d 100644 --- a/po-properties/POTFILES.in +++ b/po-properties/POTFILES.in @@ -71,16 +71,12 @@ gtk/gtkcheckbutton.c gtk/gtkcheckmenuitem.c gtk/gtkclipboard-quartz.c gtk/gtkclipboard.c -gtk/gtkclist.c gtk/gtkcolorbutton.c gtk/gtkcolorsel.c gtk/gtkcolorseldialog.c -gtk/gtkcombo.c gtk/gtkcombobox.c gtk/gtkcomboboxentry.c gtk/gtkcontainer.c -gtk/gtkctree.c -gtk/gtkcurve.c gtk/gtkcustompaperunixdialog.c gtk/gtkdialog.c gtk/gtkdnd-quartz.c @@ -102,14 +98,12 @@ gtk/gtkfilechoosersettings.c gtk/gtkfilechooserutils.c gtk/gtkfilechooserwidget.c gtk/gtkfilefilter.c -gtk/gtkfilesel.c gtk/gtkfilesystem.c gtk/gtkfilesystemmodel.c gtk/gtkfixed.c gtk/gtkfontbutton.c gtk/gtkfontsel.c gtk/gtkframe.c -gtk/gtkgamma.c gtk/gtkgc.c gtk/gtkhandlebox.c gtk/gtkhbbox.c @@ -130,15 +124,11 @@ gtk/gtkimcontextsimple.c gtk/gtkimmodule.c gtk/gtkimmulticontext.c gtk/gtkinfobar.c -gtk/gtkinputdialog.c gtk/gtkinvisible.c gtk/gtkitem.c -gtk/gtkitemfactory.c gtk/gtklabel.c gtk/gtklayout.c gtk/gtklinkbutton.c -gtk/gtklist.c -gtk/gtklistitem.c gtk/gtkliststore.c gtk/gtkmain.c gtk/gtkmenu.c @@ -154,17 +144,13 @@ gtk/gtkmountoperation-stub.c gtk/gtkmountoperation-x11.c gtk/gtknotebook.c gtk/gtkobject.c -gtk/gtkoldeditable.c -gtk/gtkoptionmenu.c gtk/gtkorientable.c gtk/gtkpagesetup.c gtk/gtkpagesetupunixdialog.c gtk/gtkpaned.c gtk/gtkpapersize.c gtk/gtkpathbar.c -gtk/gtkpixmap.c gtk/gtkplug.c -gtk/gtkpreview.c gtk/gtkprintbackend.c gtk/gtkprinter.c gtk/gtkprinteroptionwidget.c @@ -206,7 +192,6 @@ gtk/gtkstock.c gtk/gtkstyle.c gtk/gtktable.c gtk/gtktearoffmenuitem.c -gtk/gtktext.c gtk/gtktextbuffer.c gtk/gtktextbufferrichtext.c gtk/gtktextbufferserialize.c @@ -220,7 +205,6 @@ gtk/gtktexttagtable.c gtk/gtktextutil.c gtk/gtktextview.c gtk/gtkthemes.c -gtk/gtktipsquery.c gtk/gtktoggleaction.c gtk/gtktogglebutton.c gtk/gtktoggletoolbutton.c @@ -230,11 +214,8 @@ gtk/gtktoolitem.c gtk/gtktoolitemgroup.c gtk/gtktoolpalette.c gtk/gtktoolshell.c -gtk/gtktooltips.c gtk/gtktrayicon-x11.c -gtk/gtktree.c gtk/gtktreednd.c -gtk/gtktreeitem.c gtk/gtktreemodel.c gtk/gtktreemodelfilter.c gtk/gtktreemodelsort.c diff --git a/po-properties/af.po b/po-properties/af.po index a2ae344e2f..274afe47e9 100644 --- a/po-properties/af.po +++ b/po-properties/af.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: gtk+-properties 2.6-branch\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-03-22 23:35-0400\n" +"POT-Creation-Date: 2010-05-25 20:10-0400\n" "PO-Revision-Date: 2004-03-30 17:02+0200\n" "Last-Translator: Zuza Software Foundation \n" "Language-Team: Afrikaans \n" @@ -58,7 +58,7 @@ msgstr "Bisse per monster" msgid "The number of bits per sample" msgstr "Die getal bisse per monster" -#: gdk-pixbuf/gdk-pixbuf.c:132 gtk/gtklayout.c:633 gtk/gtktreeviewcolumn.c:208 +#: gdk-pixbuf/gdk-pixbuf.c:132 gtk/gtklayout.c:597 gtk/gtktreeviewcolumn.c:208 msgid "Width" msgstr "Wydte" @@ -66,7 +66,7 @@ msgstr "Wydte" msgid "The number of columns of the pixbuf" msgstr "Die getal kolomme in die pixbuf" -#: gdk-pixbuf/gdk-pixbuf.c:142 gtk/gtklayout.c:642 +#: gdk-pixbuf/gdk-pixbuf.c:142 gtk/gtklayout.c:606 msgid "Height" msgstr "Hoogte" @@ -101,7 +101,7 @@ msgid "The default display for GDK" msgstr "Die verstekvertoon vir GDK" #: gdk/gdkpango.c:538 gtk/gtkinvisible.c:86 gtk/gtkmountoperation.c:176 -#: gtk/gtkstatusicon.c:280 gtk/gtkwindow.c:626 +#: gtk/gtkstatusicon.c:285 gtk/gtkwindow.c:650 msgid "Screen" msgstr "Skerm" @@ -130,7 +130,7 @@ msgstr "Fontpunte" msgid "The resolution for fonts on the screen" msgstr "Hoe die strekking op die skerm moet bygewerk word" -#: gdk/gdkwindow.c:496 gdk/gdkwindow.c:497 +#: gdk/gdkwindow.c:565 gdk/gdkwindow.c:566 #, fuzzy msgid "Cursor" msgstr "Wyserflonker" @@ -254,128 +254,128 @@ msgstr "Omvoumodusstel" msgid "Whether to wrap the license text." msgstr "Of die teks deurgehaal moet word" -#: gtk/gtkaccellabel.c:178 +#: gtk/gtkaccellabel.c:189 msgid "Accelerator Closure" msgstr "Versnellerafsluiting" -#: gtk/gtkaccellabel.c:179 +#: gtk/gtkaccellabel.c:190 msgid "The closure to be monitored for accelerator changes" msgstr "Die afsluiting wat vir versnellerveranderinge gemonitor word" -#: gtk/gtkaccellabel.c:185 +#: gtk/gtkaccellabel.c:196 msgid "Accelerator Widget" msgstr "Versnellerdingesie" -#: gtk/gtkaccellabel.c:186 +#: gtk/gtkaccellabel.c:197 msgid "The widget to be monitored for accelerator changes" msgstr "Die dingesie wat vir versnellerveranderinge gemonitor moet word" -#: gtk/gtkaction.c:181 gtk/gtkactiongroup.c:170 gtk/gtkprinter.c:111 +#: gtk/gtkaction.c:220 gtk/gtkactiongroup.c:170 gtk/gtkprinter.c:130 #: gtk/gtktextmark.c:89 msgid "Name" msgstr "Naam" -#: gtk/gtkaction.c:182 +#: gtk/gtkaction.c:221 msgid "A unique name for the action." msgstr "n Unieke naam vir die aksie." -#: gtk/gtkaction.c:200 gtk/gtkbutton.c:219 gtk/gtkexpander.c:195 -#: gtk/gtkframe.c:105 gtk/gtklabel.c:506 gtk/gtkmenuitem.c:305 -#: gtk/gtktoolbutton.c:204 gtk/gtktoolitemgroup.c:1535 +#: gtk/gtkaction.c:239 gtk/gtkbutton.c:227 gtk/gtkexpander.c:195 +#: gtk/gtkframe.c:114 gtk/gtklabel.c:528 gtk/gtkmenuitem.c:305 +#: gtk/gtktoolbutton.c:204 gtk/gtktoolitemgroup.c:1543 msgid "Label" msgstr "Etiket" -#: gtk/gtkaction.c:201 +#: gtk/gtkaction.c:240 msgid "The label used for menu items and buttons that activate this action." msgstr "" "Die etiket gebruik vir kieslysitems en -knoppies wat hierdie aksie aktiveer." -#: gtk/gtkaction.c:217 +#: gtk/gtkaction.c:256 msgid "Short label" msgstr "Kort etiket" -#: gtk/gtkaction.c:218 +#: gtk/gtkaction.c:257 msgid "A shorter label that may be used on toolbar buttons." msgstr "'n Korter etiket wat op nutsbalkknoppies gebruik kan word." -#: gtk/gtkaction.c:226 +#: gtk/gtkaction.c:265 msgid "Tooltip" msgstr "Nutswenk" -#: gtk/gtkaction.c:227 +#: gtk/gtkaction.c:266 msgid "A tooltip for this action." msgstr "'n Nutswenk vir hierdie aksie." -#: gtk/gtkaction.c:242 +#: gtk/gtkaction.c:281 msgid "Stock Icon" msgstr "Stapelikoon" -#: gtk/gtkaction.c:243 +#: gtk/gtkaction.c:282 msgid "The stock icon displayed in widgets representing this action." msgstr "Die stapelikon vertoon in dingesies wat hierdie aksie verteenwoordig." -#: gtk/gtkaction.c:263 gtk/gtkstatusicon.c:253 +#: gtk/gtkaction.c:302 gtk/gtkstatusicon.c:258 #, fuzzy msgid "GIcon" msgstr "Ikon" -#: gtk/gtkaction.c:264 gtk/gtkcellrendererpixbuf.c:206 gtk/gtkimage.c:339 -#: gtk/gtkstatusicon.c:254 +#: gtk/gtkaction.c:303 gtk/gtkcellrendererpixbuf.c:206 gtk/gtkimage.c:344 +#: gtk/gtkstatusicon.c:259 #, fuzzy msgid "The GIcon being displayed" msgstr "Ikonstel wat vertoon moet word" -#: gtk/gtkaction.c:284 gtk/gtkcellrendererpixbuf.c:171 gtk/gtkimage.c:321 -#: gtk/gtkprinter.c:160 gtk/gtkstatusicon.c:237 gtk/gtkwindow.c:618 +#: gtk/gtkaction.c:323 gtk/gtkcellrendererpixbuf.c:171 gtk/gtkimage.c:326 +#: gtk/gtkprinter.c:179 gtk/gtkstatusicon.c:242 gtk/gtkwindow.c:642 #, fuzzy msgid "Icon Name" msgstr "Fontnaam" -#: gtk/gtkaction.c:285 gtk/gtkcellrendererpixbuf.c:172 gtk/gtkimage.c:322 -#: gtk/gtkstatusicon.c:238 +#: gtk/gtkaction.c:324 gtk/gtkcellrendererpixbuf.c:172 gtk/gtkimage.c:327 +#: gtk/gtkstatusicon.c:243 #, fuzzy msgid "The name of the icon from the icon theme" msgstr "Die naam van die geselekteerde font" -#: gtk/gtkaction.c:292 gtk/gtktoolitem.c:192 +#: gtk/gtkaction.c:331 gtk/gtktoolitem.c:185 msgid "Visible when horizontal" msgstr "Sigbaar wanneer horisontaal" -#: gtk/gtkaction.c:293 gtk/gtktoolitem.c:193 +#: gtk/gtkaction.c:332 gtk/gtktoolitem.c:186 msgid "" "Whether the toolbar item is visible when the toolbar is in a horizontal " "orientation." msgstr "" "Of die nutsbalkitem sigbaar is wanneer die nutsbalk horisontaal gerig is." -#: gtk/gtkaction.c:308 +#: gtk/gtkaction.c:347 #, fuzzy msgid "Visible when overflown" msgstr "Sigbaar wanneer vertikaal" -#: gtk/gtkaction.c:309 +#: gtk/gtkaction.c:348 #, fuzzy msgid "" "When TRUE, toolitem proxies for this action are represented in the toolbar " "overflow menu." msgstr "Wanneer WAAR, word leë kieslysinstaners vir hierdie aksie verskuil." -#: gtk/gtkaction.c:316 gtk/gtktoolitem.c:199 +#: gtk/gtkaction.c:355 gtk/gtktoolitem.c:192 msgid "Visible when vertical" msgstr "Sigbaar wanneer vertikaal" -#: gtk/gtkaction.c:317 gtk/gtktoolitem.c:200 +#: gtk/gtkaction.c:356 gtk/gtktoolitem.c:193 msgid "" "Whether the toolbar item is visible when the toolbar is in a vertical " "orientation." msgstr "" "Of die nutsbalkitem sigbaar is wanneer die nutsbalk vertikaal gerig is." -#: gtk/gtkaction.c:324 gtk/gtktoolitem.c:206 +#: gtk/gtkaction.c:363 gtk/gtktoolitem.c:199 msgid "Is important" msgstr "Is belangrik" -#: gtk/gtkaction.c:325 +#: gtk/gtkaction.c:364 msgid "" "Whether the action is considered important. When TRUE, toolitem proxies for " "this action show text in GTK_TOOLBAR_BOTH_HORIZ mode." @@ -383,37 +383,37 @@ msgstr "" "Of die aksie as belangrik beskou word. Wanneer WAAR, wys nutsiteminstaners " "teks vir hierdie aksie in GTK_TOOLBAR_BOTH_HORIZ-modus." -#: gtk/gtkaction.c:333 +#: gtk/gtkaction.c:372 msgid "Hide if empty" msgstr "Verskuil indien leeg" -#: gtk/gtkaction.c:334 +#: gtk/gtkaction.c:373 msgid "When TRUE, empty menu proxies for this action are hidden." msgstr "Wanneer WAAR, word leë kieslysinstaners vir hierdie aksie verskuil." -#: gtk/gtkaction.c:340 gtk/gtkactiongroup.c:177 gtk/gtkcellrenderer.c:193 -#: gtk/gtkwidget.c:593 +#: gtk/gtkaction.c:379 gtk/gtkactiongroup.c:177 gtk/gtkcellrenderer.c:193 +#: gtk/gtkwidget.c:613 msgid "Sensitive" msgstr "Sensitief" -#: gtk/gtkaction.c:341 +#: gtk/gtkaction.c:380 msgid "Whether the action is enabled." msgstr "Of die aksie in werking gestel is." -#: gtk/gtkaction.c:347 gtk/gtkactiongroup.c:184 gtk/gtkstatusicon.c:296 -#: gtk/gtktreeviewcolumn.c:192 gtk/gtkwidget.c:586 +#: gtk/gtkaction.c:386 gtk/gtkactiongroup.c:184 gtk/gtkstatusicon.c:301 +#: gtk/gtktreeviewcolumn.c:192 gtk/gtkwidget.c:606 msgid "Visible" msgstr "Sigbaar" -#: gtk/gtkaction.c:348 +#: gtk/gtkaction.c:387 msgid "Whether the action is visible." msgstr "Of die aksie sigbaar is." -#: gtk/gtkaction.c:354 +#: gtk/gtkaction.c:393 msgid "Action Group" msgstr "Aksiegroep" -#: gtk/gtkaction.c:355 +#: gtk/gtkaction.c:394 msgid "" "The GtkActionGroup this GtkAction is associated with, or NULL (for internal " "use)." @@ -421,11 +421,11 @@ msgstr "" "Die GtkActionGroup waarmee hierdie GtkAction geassosieer is, of NULL (vir " "interne gebruik)." -#: gtk/gtkaction.c:373 gtk/gtkimagemenuitem.c:169 +#: gtk/gtkaction.c:412 gtk/gtkimagemenuitem.c:169 msgid "Always show image" msgstr "" -#: gtk/gtkaction.c:374 gtk/gtkimagemenuitem.c:170 +#: gtk/gtkaction.c:413 gtk/gtkimagemenuitem.c:170 #, fuzzy msgid "Whether the image will always be shown" msgstr "Of die dingesie sigbaar is" @@ -461,7 +461,7 @@ msgid "Whether to use the related actions appearance properties" msgstr "Of die etiketteks met die muis gekies kan word" #: gtk/gtkadjustment.c:93 gtk/gtkcellrendererprogress.c:128 -#: gtk/gtkscalebutton.c:206 gtk/gtkspinbutton.c:269 +#: gtk/gtkscalebutton.c:222 gtk/gtkspinbutton.c:269 msgid "Value" msgstr "Waarde" @@ -509,11 +509,11 @@ msgstr "Bladsygrootte" msgid "The page size of the adjustment" msgstr "Die bladsygrootte van die aanpassing" -#: gtk/gtkalignment.c:90 +#: gtk/gtkalignment.c:117 msgid "Horizontal alignment" msgstr "Horisontale gerigtheid" -#: gtk/gtkalignment.c:91 gtk/gtkbutton.c:270 +#: gtk/gtkalignment.c:118 gtk/gtkbutton.c:278 msgid "" "Horizontal position of child in available space. 0.0 is left aligned, 1.0 is " "right aligned" @@ -521,11 +521,11 @@ msgstr "" "Horisontale posisie van kind in beskikbare ruimte. 0.0 is linksgerig, 1.0 is " "\vregsgerig" -#: gtk/gtkalignment.c:100 +#: gtk/gtkalignment.c:127 msgid "Vertical alignment" msgstr "Vertikale gerigtheid" -#: gtk/gtkalignment.c:101 gtk/gtkbutton.c:289 +#: gtk/gtkalignment.c:128 gtk/gtkbutton.c:297 msgid "" "Vertical position of child in available space. 0.0 is top aligned, 1.0 is " "bottom aligned" @@ -533,11 +533,11 @@ msgstr "" "Vertikale posisie van kind in beskikbare ruimte. 0.0 is bokantgerig, 1.0 is " "\vonderkantgerig" -#: gtk/gtkalignment.c:109 +#: gtk/gtkalignment.c:136 msgid "Horizontal scale" msgstr "Horisontale skaal" -#: gtk/gtkalignment.c:110 +#: gtk/gtkalignment.c:137 msgid "" "If available horizontal space is bigger than needed for the child, how much " "of it to use for the child. 0.0 means none, 1.0 means all" @@ -545,11 +545,11 @@ msgstr "" "As beskikbare horisontale ruimte groter is as nodig vir die kind, hoeveel " "daarvan moet vir die kind gebruik word. 0.0 beteken niks, 1.0 beteken alles" -#: gtk/gtkalignment.c:118 +#: gtk/gtkalignment.c:145 msgid "Vertical scale" msgstr "Vertikale skaal" -#: gtk/gtkalignment.c:119 +#: gtk/gtkalignment.c:146 msgid "" "If available vertical space is bigger than needed for the child, how much of " "it to use for the child. 0.0 means none, 1.0 means all" @@ -557,200 +557,200 @@ msgstr "" "As beskikbare vertikale ruimte groter is as benodig vir die kind, hoeveel " "daarvan moet vir die kind gebruik word. 0.0 beteken niks, 1.0 beteken alles" -#: gtk/gtkalignment.c:136 +#: gtk/gtkalignment.c:163 msgid "Top Padding" msgstr "Bokantopvulling" -#: gtk/gtkalignment.c:137 +#: gtk/gtkalignment.c:164 msgid "The padding to insert at the top of the widget." msgstr "Die opvulling wat bokant die dingesie ingevoeg moet word." -#: gtk/gtkalignment.c:153 +#: gtk/gtkalignment.c:180 msgid "Bottom Padding" msgstr "Onderkantopvulling" -#: gtk/gtkalignment.c:154 +#: gtk/gtkalignment.c:181 msgid "The padding to insert at the bottom of the widget." msgstr "Die opvulling wat onderkant die dingesie ingevoeg moet word." -#: gtk/gtkalignment.c:170 +#: gtk/gtkalignment.c:197 msgid "Left Padding" msgstr "Linkeropvulling" -#: gtk/gtkalignment.c:171 +#: gtk/gtkalignment.c:198 msgid "The padding to insert at the left of the widget." msgstr "Die opvulling wat links van die dingesie ingevoeg moet word." -#: gtk/gtkalignment.c:187 +#: gtk/gtkalignment.c:214 msgid "Right Padding" msgstr "Regterkantopvulling" -#: gtk/gtkalignment.c:188 +#: gtk/gtkalignment.c:215 msgid "The padding to insert at the right of the widget." msgstr "Die opvulling wat regs van die dingesie ingevoeg moet word." -#: gtk/gtkarrow.c:75 +#: gtk/gtkarrow.c:95 msgid "Arrow direction" msgstr "Pyltjierigting" -#: gtk/gtkarrow.c:76 +#: gtk/gtkarrow.c:96 msgid "The direction the arrow should point" msgstr "Die rigting waarin die pyltjie moet wys" -#: gtk/gtkarrow.c:84 +#: gtk/gtkarrow.c:104 msgid "Arrow shadow" msgstr "Pyltjieskadu" -#: gtk/gtkarrow.c:85 +#: gtk/gtkarrow.c:105 msgid "Appearance of the shadow surrounding the arrow" msgstr "Vertoon van die skadu wat die pyltjie omring" -#: gtk/gtkarrow.c:92 gtk/gtkmenu.c:711 gtk/gtkmenuitem.c:368 +#: gtk/gtkarrow.c:112 gtk/gtkmenu.c:718 gtk/gtkmenuitem.c:368 #, fuzzy msgid "Arrow Scaling" msgstr "Ryspasiëring" -#: gtk/gtkarrow.c:93 +#: gtk/gtkarrow.c:113 msgid "Amount of space used up by arrow" msgstr "" -#: gtk/gtkaspectframe.c:79 +#: gtk/gtkaspectframe.c:93 msgid "Horizontal Alignment" msgstr "Horisontale gerigtheid" -#: gtk/gtkaspectframe.c:80 +#: gtk/gtkaspectframe.c:94 msgid "X alignment of the child" msgstr "X-gerigtheid van die kind" -#: gtk/gtkaspectframe.c:86 +#: gtk/gtkaspectframe.c:100 msgid "Vertical Alignment" msgstr "Vertikale gerigtheid" -#: gtk/gtkaspectframe.c:87 +#: gtk/gtkaspectframe.c:101 msgid "Y alignment of the child" msgstr "Y-gerigtheid van die kind" -#: gtk/gtkaspectframe.c:93 +#: gtk/gtkaspectframe.c:107 msgid "Ratio" msgstr "Ratio" -#: gtk/gtkaspectframe.c:94 +#: gtk/gtkaspectframe.c:108 msgid "Aspect ratio if obey_child is FALSE" msgstr "Aspekratio as gehoorsaam_kind VALS is" -#: gtk/gtkaspectframe.c:100 +#: gtk/gtkaspectframe.c:114 msgid "Obey child" msgstr "Gehoorsaam kind" -#: gtk/gtkaspectframe.c:101 +#: gtk/gtkaspectframe.c:115 msgid "Force aspect ratio to match that of the frame's child" msgstr "Forseer aspekratio om by die raam se kind s'n te pas" -#: gtk/gtkassistant.c:284 +#: gtk/gtkassistant.c:306 #, fuzzy msgid "Header Padding" msgstr "Linkeropvulling" -#: gtk/gtkassistant.c:285 +#: gtk/gtkassistant.c:307 #, fuzzy msgid "Number of pixels around the header." msgstr "Styl skuinskant rondom die kieslysstaaf" -#: gtk/gtkassistant.c:292 +#: gtk/gtkassistant.c:314 #, fuzzy msgid "Content Padding" msgstr "Onderkantopvulling" -#: gtk/gtkassistant.c:293 +#: gtk/gtkassistant.c:315 #, fuzzy msgid "Number of pixels around the content pages." msgstr "Styl van skuinskant rondom die inhoud" -#: gtk/gtkassistant.c:309 +#: gtk/gtkassistant.c:331 #, fuzzy msgid "Page type" msgstr "Paksoort" -#: gtk/gtkassistant.c:310 +#: gtk/gtkassistant.c:332 #, fuzzy msgid "The type of the assistant page" msgstr "Die soort boodskap" -#: gtk/gtkassistant.c:327 +#: gtk/gtkassistant.c:349 #, fuzzy msgid "Page title" msgstr "Bladsygrootte" -#: gtk/gtkassistant.c:328 +#: gtk/gtkassistant.c:350 #, fuzzy msgid "The title of the assistant page" msgstr "Die titel van die venster" -#: gtk/gtkassistant.c:344 +#: gtk/gtkassistant.c:366 #, fuzzy msgid "Header image" msgstr "Koppe kliekbaar" -#: gtk/gtkassistant.c:345 +#: gtk/gtkassistant.c:367 msgid "Header image for the assistant page" msgstr "" -#: gtk/gtkassistant.c:361 +#: gtk/gtkassistant.c:383 #, fuzzy msgid "Sidebar image" msgstr "Die waarde" -#: gtk/gtkassistant.c:362 +#: gtk/gtkassistant.c:384 msgid "Sidebar image for the assistant page" msgstr "" -#: gtk/gtkassistant.c:377 +#: gtk/gtkassistant.c:399 #, fuzzy msgid "Page complete" msgstr "Bladsyinkrement" -#: gtk/gtkassistant.c:378 +#: gtk/gtkassistant.c:400 msgid "Whether all required fields on the page have been filled out" msgstr "" -#: gtk/gtkbbox.c:101 +#: gtk/gtkbbox.c:129 msgid "Minimum child width" msgstr "minimum kindwydte" -#: gtk/gtkbbox.c:102 +#: gtk/gtkbbox.c:130 msgid "Minimum width of buttons inside the box" msgstr "minimum wydte van knoppies in die kassie" -#: gtk/gtkbbox.c:110 +#: gtk/gtkbbox.c:138 msgid "Minimum child height" msgstr "minimum kindhoogte" -#: gtk/gtkbbox.c:111 +#: gtk/gtkbbox.c:139 msgid "Minimum height of buttons inside the box" msgstr "minimum hoogte van knoppies in die kassie" -#: gtk/gtkbbox.c:119 +#: gtk/gtkbbox.c:147 msgid "Child internal width padding" msgstr "Kind-binnewydteopvulling" -#: gtk/gtkbbox.c:120 +#: gtk/gtkbbox.c:148 msgid "Amount to increase child's size on either side" msgstr "Hoeveelheid om kind se grootte aan ieder kant te vergroot" -#: gtk/gtkbbox.c:128 +#: gtk/gtkbbox.c:156 msgid "Child internal height padding" msgstr "Kind-binnehoogteopvulling" -#: gtk/gtkbbox.c:129 +#: gtk/gtkbbox.c:157 msgid "Amount to increase child's size on the top and bottom" msgstr "" "Hoeveelheid wat kind se grootte aan bo- en onderkant vergroot moet word" -#: gtk/gtkbbox.c:137 +#: gtk/gtkbbox.c:165 msgid "Layout style" msgstr "Uitlegstyl" -#: gtk/gtkbbox.c:138 +#: gtk/gtkbbox.c:166 msgid "" "How to layout the buttons in the box. Possible values are default, spread, " "edge, start and end" @@ -758,11 +758,11 @@ msgstr "" "Hoe om die knoppies in die kassie uit te lê. Moontlike waardes is default " "(verstek), spread (versprei), \vedge (rand), start (begin) en end (einde)" -#: gtk/gtkbbox.c:146 +#: gtk/gtkbbox.c:174 msgid "Secondary" msgstr "Sekondêre" -#: gtk/gtkbbox.c:147 +#: gtk/gtkbbox.c:175 msgid "" "If TRUE, the child appears in a secondary group of children, suitable for, e." "g., help buttons" @@ -770,39 +770,38 @@ msgstr "" "Indien WAAR, verskyn die kind in 'n sekondêre groep kinders, geskik vir " "byvoorbeeld hulpknoppies" -#: gtk/gtkbox.c:130 gtk/gtkexpander.c:219 gtk/gtkiconview.c:665 +#: gtk/gtkbox.c:217 gtk/gtkexpander.c:219 gtk/gtkiconview.c:667 #: gtk/gtktreeviewcolumn.c:217 msgid "Spacing" msgstr "Spasiëring" -#: gtk/gtkbox.c:131 +#: gtk/gtkbox.c:218 msgid "The amount of space between children" msgstr "Die hoeveelheid ruimte tussen kinders" -#: gtk/gtkbox.c:140 gtk/gtknotebook.c:657 gtk/gtktable.c:165 -#: gtk/gtktoolbar.c:573 gtk/gtktoolitemgroup.c:1588 +#: gtk/gtkbox.c:227 gtk/gtktable.c:165 gtk/gtktoolbar.c:518 +#: gtk/gtktoolitemgroup.c:1596 msgid "Homogeneous" msgstr "Homogeen" -#: gtk/gtkbox.c:141 +#: gtk/gtkbox.c:228 msgid "Whether the children should all be the same size" msgstr "Of die kinders almal dieselfde grootte moet wees" -#: gtk/gtkbox.c:148 gtk/gtkpreview.c:101 gtk/gtktoolbar.c:565 -#: gtk/gtktoolitemgroup.c:1595 gtk/gtktoolpalette.c:1052 -#: gtk/gtktreeviewcolumn.c:273 +#: gtk/gtkbox.c:235 gtk/gtktoolbar.c:510 gtk/gtktoolitemgroup.c:1603 +#: gtk/gtktoolpalette.c:1053 gtk/gtktreeviewcolumn.c:273 msgid "Expand" msgstr "Uitvou" -#: gtk/gtkbox.c:149 +#: gtk/gtkbox.c:236 msgid "Whether the child should receive extra space when the parent grows" msgstr "Of die kind ekstra ruimte moet kry wanneer die ouer groei" -#: gtk/gtkbox.c:155 gtk/gtktoolitemgroup.c:1602 +#: gtk/gtkbox.c:242 gtk/gtktoolitemgroup.c:1610 msgid "Fill" msgstr "Vul" -#: gtk/gtkbox.c:156 +#: gtk/gtkbox.c:243 msgid "" "Whether extra space given to the child should be allocated to the child or " "used as padding" @@ -810,19 +809,19 @@ msgstr "" "Of ekstra ruimte wat aan die kind toegeken word, aan die kind of aan die " "opvulling toegeken moet word" -#: gtk/gtkbox.c:162 +#: gtk/gtkbox.c:249 gtk/gtktrayicon-x11.c:163 msgid "Padding" msgstr "Opvulling" -#: gtk/gtkbox.c:163 +#: gtk/gtkbox.c:250 msgid "Extra space to put between the child and its neighbors, in pixels" msgstr "Ekstra ruimte wat tussen die kind en sy bure moet kom, in pixels" -#: gtk/gtkbox.c:169 +#: gtk/gtkbox.c:256 msgid "Pack type" msgstr "Paksoort" -#: gtk/gtkbox.c:170 gtk/gtknotebook.c:724 +#: gtk/gtkbox.c:257 gtk/gtknotebook.c:667 msgid "" "A GtkPackType indicating whether the child is packed with reference to the " "start or end of the parent" @@ -830,24 +829,24 @@ msgstr "" "'n GtkPackType wat aandui of die kind met betrekking tot die begin of die " "einde van die ouer gepak moet word" -#: gtk/gtkbox.c:176 gtk/gtknotebook.c:702 gtk/gtkpaned.c:241 -#: gtk/gtkruler.c:148 gtk/gtktoolitemgroup.c:1616 +#: gtk/gtkbox.c:263 gtk/gtknotebook.c:645 gtk/gtkpaned.c:242 +#: gtk/gtkruler.c:148 gtk/gtktoolitemgroup.c:1624 msgid "Position" msgstr "Posisie" -#: gtk/gtkbox.c:177 gtk/gtknotebook.c:703 +#: gtk/gtkbox.c:264 gtk/gtknotebook.c:646 msgid "The index of the child in the parent" msgstr "Die indeks van die kind in die ouer" -#: gtk/gtkbuilder.c:96 +#: gtk/gtkbuilder.c:314 msgid "Translation Domain" msgstr "" -#: gtk/gtkbuilder.c:97 +#: gtk/gtkbuilder.c:315 msgid "The translation domain used by gettext" msgstr "" -#: gtk/gtkbutton.c:220 +#: gtk/gtkbutton.c:228 msgid "" "Text of the label widget inside the button, if the button contains a label " "widget" @@ -855,12 +854,12 @@ msgstr "" "Teks van die etiketdingesie binne-in die knoppie, indien die knoppie 'n " "etiketdingesie bevat" -#: gtk/gtkbutton.c:227 gtk/gtkexpander.c:203 gtk/gtklabel.c:527 +#: gtk/gtkbutton.c:235 gtk/gtkexpander.c:203 gtk/gtklabel.c:549 #: gtk/gtkmenuitem.c:320 gtk/gtktoolbutton.c:211 msgid "Use underline" msgstr "Gebruik onderstreep" -#: gtk/gtkbutton.c:228 gtk/gtkexpander.c:204 gtk/gtklabel.c:528 +#: gtk/gtkbutton.c:236 gtk/gtkexpander.c:204 gtk/gtklabel.c:550 #: gtk/gtkmenuitem.c:321 msgid "" "If set, an underline in the text indicates the next character should be used " @@ -869,74 +868,74 @@ msgstr "" "Indien gestel beteken 'n onderstreepkarakter in die teks dat die volgende " "karakter as mnemoniese snelsleutel gebruik moet word" -#: gtk/gtkbutton.c:235 gtk/gtkimagemenuitem.c:150 +#: gtk/gtkbutton.c:243 gtk/gtkimagemenuitem.c:150 msgid "Use stock" msgstr "Gebruik stapel" -#: gtk/gtkbutton.c:236 +#: gtk/gtkbutton.c:244 msgid "" "If set, the label is used to pick a stock item instead of being displayed" msgstr "" "Indien gestel, word die etiket gebruik om 'n stapelitem te kies in plaas " "daarvan om vertoon te word" -#: gtk/gtkbutton.c:243 gtk/gtkcombobox.c:796 gtk/gtkfilechooserbutton.c:393 +#: gtk/gtkbutton.c:251 gtk/gtkcombobox.c:799 gtk/gtkfilechooserbutton.c:393 msgid "Focus on click" msgstr "Fokus op kliek" -#: gtk/gtkbutton.c:244 gtk/gtkfilechooserbutton.c:394 +#: gtk/gtkbutton.c:252 gtk/gtkfilechooserbutton.c:394 msgid "Whether the button grabs focus when it is clicked with the mouse" msgstr "Of 'n knoppie die fokus gryp wanneer dit met die muis gekliek word" -#: gtk/gtkbutton.c:251 +#: gtk/gtkbutton.c:259 msgid "Border relief" msgstr "Grensreliëf" -#: gtk/gtkbutton.c:252 +#: gtk/gtkbutton.c:260 msgid "The border relief style" msgstr "Die grensreliëf-styl" -#: gtk/gtkbutton.c:269 +#: gtk/gtkbutton.c:277 msgid "Horizontal alignment for child" msgstr "Horisontale gerigtheid vir kind" -#: gtk/gtkbutton.c:288 +#: gtk/gtkbutton.c:296 msgid "Vertical alignment for child" msgstr "Vertikale gerigtheid vir kind" -#: gtk/gtkbutton.c:305 gtk/gtkimagemenuitem.c:135 +#: gtk/gtkbutton.c:313 gtk/gtkimagemenuitem.c:135 msgid "Image widget" msgstr "Beelddingesie" -#: gtk/gtkbutton.c:306 +#: gtk/gtkbutton.c:314 #, fuzzy msgid "Child widget to appear next to the button text" msgstr "Kinddingesie wat langs die kieslysteks moet verskyn" -#: gtk/gtkbutton.c:320 +#: gtk/gtkbutton.c:328 #, fuzzy msgid "Image position" msgstr "Handvatsel-posisie" -#: gtk/gtkbutton.c:321 +#: gtk/gtkbutton.c:329 #, fuzzy msgid "The position of the image relative to the text" msgstr "Posisie van die handvatsel met betrekking tot die kinddingesie" -#: gtk/gtkbutton.c:441 +#: gtk/gtkbutton.c:449 msgid "Default Spacing" msgstr "Verstekspasiëring" -#: gtk/gtkbutton.c:442 +#: gtk/gtkbutton.c:450 #, fuzzy msgid "Extra space to add for GTK_CAN_DEFAULT buttons" msgstr "Ekstra spasie vir byvoeg by CAN_DEFAULT-knoppies" -#: gtk/gtkbutton.c:456 +#: gtk/gtkbutton.c:464 msgid "Default Outside Spacing" msgstr "Verstekbuitespasiëring" -#: gtk/gtkbutton.c:457 +#: gtk/gtkbutton.c:465 #, fuzzy msgid "" "Extra space to add for GTK_CAN_DEFAULT buttons that is always drawn outside " @@ -945,61 +944,61 @@ msgstr "" "Ekstra spasie vir byvoeg by CAN_DEFAULT-knoppies wat altyd buite die grens " "getrek word" -#: gtk/gtkbutton.c:462 +#: gtk/gtkbutton.c:470 msgid "Child X Displacement" msgstr "Kind-X-verplasing" -#: gtk/gtkbutton.c:463 +#: gtk/gtkbutton.c:471 msgid "" "How far in the x direction to move the child when the button is depressed" msgstr "" "Hoe ver in die x-rigting die kind moet skuif wanneer die knoppie gedruk word" -#: gtk/gtkbutton.c:470 +#: gtk/gtkbutton.c:478 msgid "Child Y Displacement" msgstr "Kind-Y-verplasing" -#: gtk/gtkbutton.c:471 +#: gtk/gtkbutton.c:479 msgid "" "How far in the y direction to move the child when the button is depressed" msgstr "" "Hoe ver in die y-rigting die kind moet skuif wanneer die knoppie gedruk word" -#: gtk/gtkbutton.c:487 +#: gtk/gtkbutton.c:495 #, fuzzy msgid "Displace focus" msgstr "Is fokus" -#: gtk/gtkbutton.c:488 +#: gtk/gtkbutton.c:496 msgid "" "Whether the child_displacement_x/_y properties should also affect the focus " "rectangle" msgstr "" -#: gtk/gtkbutton.c:501 gtk/gtkentry.c:695 gtk/gtkentry.c:1740 +#: gtk/gtkbutton.c:509 gtk/gtkentry.c:697 gtk/gtkentry.c:1742 #, fuzzy msgid "Inner Border" msgstr "Oortjiegrens" -#: gtk/gtkbutton.c:502 +#: gtk/gtkbutton.c:510 msgid "Border between button edges and child." msgstr "" -#: gtk/gtkbutton.c:515 +#: gtk/gtkbutton.c:523 #, fuzzy msgid "Image spacing" msgstr "Waardespasiëring" -#: gtk/gtkbutton.c:516 +#: gtk/gtkbutton.c:524 #, fuzzy msgid "Spacing in pixels between the image and label" msgstr "Ruimte wat tussen die etiket en die kind moet kom" -#: gtk/gtkbutton.c:530 +#: gtk/gtkbutton.c:538 msgid "Show button images" msgstr "Toon knoppiebeelde" -#: gtk/gtkbutton.c:531 +#: gtk/gtkbutton.c:539 #, fuzzy msgid "Whether images should be shown on buttons" msgstr "Of beelde in kieslyste vertoon moet word" @@ -1094,12 +1093,12 @@ msgstr "Toon kop" msgid "If TRUE, details are shown" msgstr "Indien WAAR word dagname vertoon" -#: gtk/gtkcelleditable.c:76 +#: gtk/gtkcelleditable.c:43 #, fuzzy msgid "Editing Canceled" msgstr "Skalering" -#: gtk/gtkcelleditable.c:77 +#: gtk/gtkcelleditable.c:44 msgid "Indicates that editing has been canceled" msgstr "" @@ -1222,40 +1221,40 @@ msgstr "Selagtergrondstel" msgid "Whether this tag affects the cell background color" msgstr "Of hierdie merker 'n uitwerking op die selagtergrondkleur het" -#: gtk/gtkcellrendereraccel.c:114 +#: gtk/gtkcellrendereraccel.c:124 #, fuzzy msgid "Accelerator key" msgstr "Versnellerdingesie" -#: gtk/gtkcellrendereraccel.c:115 +#: gtk/gtkcellrendereraccel.c:125 #, fuzzy msgid "The keyval of the accelerator" msgstr "Die waarde van die aanpassing" -#: gtk/gtkcellrendereraccel.c:131 +#: gtk/gtkcellrendereraccel.c:141 #, fuzzy msgid "Accelerator modifiers" msgstr "Versnellerdingesie" -#: gtk/gtkcellrendereraccel.c:132 +#: gtk/gtkcellrendereraccel.c:142 msgid "The modifier mask of the accelerator" msgstr "" -#: gtk/gtkcellrendereraccel.c:149 +#: gtk/gtkcellrendereraccel.c:159 #, fuzzy msgid "Accelerator keycode" msgstr "Versnellerdingesie" -#: gtk/gtkcellrendereraccel.c:150 +#: gtk/gtkcellrendereraccel.c:160 msgid "The hardware keycode of the accelerator" msgstr "" -#: gtk/gtkcellrendereraccel.c:169 +#: gtk/gtkcellrendereraccel.c:179 #, fuzzy msgid "Accelerator Mode" msgstr "Versnellerdingesie" -#: gtk/gtkcellrendereraccel.c:170 +#: gtk/gtkcellrendereraccel.c:180 #, fuzzy msgid "The type of accelerators" msgstr "Die soort boodskap" @@ -1310,7 +1309,7 @@ msgstr "Pixbuf-uitvouer geslote" msgid "Pixbuf for closed expander" msgstr "Pixbuf vir geslote uitvouer" -#: gtk/gtkcellrendererpixbuf.c:135 gtk/gtkimage.c:263 gtk/gtkstatusicon.c:229 +#: gtk/gtkcellrendererpixbuf.c:135 gtk/gtkimage.c:268 gtk/gtkstatusicon.c:234 msgid "Stock ID" msgstr "Stapel-ID" @@ -1319,7 +1318,7 @@ msgid "The stock ID of the stock icon to render" msgstr "Die stapel-ID van die stapelikon om weer te gee" #: gtk/gtkcellrendererpixbuf.c:143 gtk/gtkcellrendererspinner.c:158 -#: gtk/gtkrecentmanager.c:245 gtk/gtkstatusicon.c:270 +#: gtk/gtkrecentmanager.c:245 gtk/gtkstatusicon.c:275 msgid "Size" msgstr "Grootte" @@ -1344,7 +1343,7 @@ msgstr "" msgid "Whether the rendered pixbuf should be colorized according to the state" msgstr "Of die grens vertoon moet word of nie" -#: gtk/gtkcellrendererpixbuf.c:205 gtk/gtkimage.c:338 gtk/gtkwindow.c:595 +#: gtk/gtkcellrendererpixbuf.c:205 gtk/gtkimage.c:343 gtk/gtkwindow.c:619 msgid "Icon" msgstr "Ikon" @@ -1354,8 +1353,8 @@ msgid "Value of the progress bar" msgstr "Teks wat in die vorderingstaaf vertoon moet word" #: gtk/gtkcellrendererprogress.c:146 gtk/gtkcellrenderertext.c:195 -#: gtk/gtkentry.c:738 gtk/gtkentrybuffer.c:353 gtk/gtkmessagedialog.c:153 -#: gtk/gtkprogressbar.c:184 gtk/gtktextbuffer.c:198 +#: gtk/gtkentry.c:740 gtk/gtkentrybuffer.c:353 gtk/gtkmessagedialog.c:200 +#: gtk/gtkprogressbar.c:137 gtk/gtktextbuffer.c:198 msgid "Text" msgstr "Teks" @@ -1395,18 +1394,18 @@ msgstr "Teks-y-belyning" msgid "The vertical text alignment, from 0 (top) to 1 (bottom)." msgstr "Die vertikale belyning, van 0 (bo) na 1 (onder)" -#: gtk/gtkcellrendererprogress.c:221 gtk/gtkiconview.c:729 -#: gtk/gtkorientable.c:74 gtk/gtkprogressbar.c:126 gtk/gtkstatusicon.c:328 -#: gtk/gtktrayicon-x11.c:110 +#: gtk/gtkcellrendererprogress.c:221 gtk/gtkiconview.c:731 +#: gtk/gtkorientable.c:63 gtk/gtkprogressbar.c:112 gtk/gtkstatusicon.c:333 +#: gtk/gtktrayicon-x11.c:122 msgid "Orientation" msgstr "Oriëntering" -#: gtk/gtkcellrendererprogress.c:222 gtk/gtkprogressbar.c:127 +#: gtk/gtkcellrendererprogress.c:222 gtk/gtkprogressbar.c:113 msgid "Orientation and growth direction of the progress bar" msgstr "Oriëntering en groeirigting van die vorderingstaaf" -#: gtk/gtkcellrendererspin.c:93 gtk/gtkprogressbar.c:118 gtk/gtkrange.c:367 -#: gtk/gtkscalebutton.c:225 gtk/gtkspinbutton.c:208 +#: gtk/gtkcellrendererspin.c:93 gtk/gtkrange.c:394 gtk/gtkscalebutton.c:241 +#: gtk/gtkspinbutton.c:208 msgid "Adjustment" msgstr "Verstelling" @@ -1433,7 +1432,7 @@ msgid "The number of decimal places to display" msgstr "Die getal desimale plekke om te vertoon" #: gtk/gtkcellrendererspinner.c:124 gtk/gtkcheckmenuitem.c:98 -#: gtk/gtkmenu.c:501 gtk/gtkspinner.c:128 gtk/gtktoggleaction.c:119 +#: gtk/gtkmenu.c:508 gtk/gtkspinner.c:128 gtk/gtktoggleaction.c:130 #: gtk/gtktogglebutton.c:115 gtk/gtktoggletoolbutton.c:114 msgid "Active" msgstr "Aktief" @@ -1465,7 +1464,7 @@ msgstr "Markering" msgid "Marked up text to render" msgstr "Gemarkeerde teks om weer te gee" -#: gtk/gtkcellrenderertext.c:211 gtk/gtklabel.c:513 +#: gtk/gtkcellrenderertext.c:211 gtk/gtklabel.c:535 msgid "Attributes" msgstr "Attribute" @@ -1506,6 +1505,7 @@ msgid "Foreground color as a string" msgstr "Voorgrondkleur as 'n string" #: gtk/gtkcellrenderertext.c:252 gtk/gtktexttag.c:225 +#: gtk/gtktrayicon-x11.c:131 msgid "Foreground color" msgstr "Voorgrondkleur" @@ -1513,7 +1513,7 @@ msgstr "Voorgrondkleur" msgid "Foreground color as a GdkColor" msgstr "Voorgrondkleur as 'n GdkColor" -#: gtk/gtkcellrenderertext.c:261 gtk/gtkentry.c:662 gtk/gtktexttag.c:251 +#: gtk/gtkcellrenderertext.c:261 gtk/gtkentry.c:664 gtk/gtktexttag.c:251 #: gtk/gtktextview.c:577 msgid "Editable" msgstr "Redigeerbaar" @@ -1625,7 +1625,7 @@ msgstr "" "gebruik wanneer die teks verbeeld word. As jy nie hierdie parameter verstaan " "nie, het jy dit waarskynlik nie nodig nie" -#: gtk/gtkcellrenderertext.c:411 gtk/gtklabel.c:638 gtk/gtkprogressbar.c:206 +#: gtk/gtkcellrenderertext.c:411 gtk/gtklabel.c:660 gtk/gtkprogressbar.c:159 msgid "Ellipsize" msgstr "" @@ -1636,12 +1636,12 @@ msgid "" msgstr "" #: gtk/gtkcellrenderertext.c:431 gtk/gtkfilechooserbutton.c:421 -#: gtk/gtklabel.c:658 +#: gtk/gtklabel.c:681 #, fuzzy msgid "Width In Characters" msgstr "Wydte in karakters" -#: gtk/gtkcellrenderertext.c:432 gtk/gtklabel.c:659 +#: gtk/gtkcellrenderertext.c:432 gtk/gtklabel.c:682 msgid "The desired width of the label, in characters" msgstr "" @@ -1655,7 +1655,7 @@ msgid "" "have enough room to display the entire string" msgstr "" -#: gtk/gtkcellrenderertext.c:470 gtk/gtkcombobox.c:685 +#: gtk/gtkcellrenderertext.c:470 gtk/gtkcombobox.c:688 msgid "Wrap width" msgstr "Vouwydte" @@ -1859,11 +1859,11 @@ msgstr "TreeView-model" msgid "The model for cell view" msgstr "Die model vir die boomaansig" -#: gtk/gtkcheckbutton.c:69 gtk/gtkcheckmenuitem.c:121 gtk/gtkoptionmenu.c:168 +#: gtk/gtkcheckbutton.c:69 gtk/gtkcheckmenuitem.c:121 msgid "Indicator Size" msgstr "Aanduiergrootte" -#: gtk/gtkcheckbutton.c:77 gtk/gtkexpander.c:245 gtk/gtkoptionmenu.c:174 +#: gtk/gtkcheckbutton.c:77 gtk/gtkexpander.c:245 msgid "Indicator Spacing" msgstr "Aanduierspasiëring" @@ -1900,7 +1900,7 @@ msgid "Whether or not to give the color an alpha value" msgstr "Of die kleur 'n alfawaarde gegee moet word" #: gtk/gtkcolorbutton.c:186 gtk/gtkfilechooserbutton.c:407 -#: gtk/gtkfontbutton.c:142 gtk/gtkprintjob.c:116 gtk/gtkstatusicon.c:424 +#: gtk/gtkfontbutton.c:142 gtk/gtkprintjob.c:116 gtk/gtkstatusicon.c:429 #: gtk/gtktreeviewcolumn.c:265 msgid "Title" msgstr "Titel" @@ -1909,7 +1909,7 @@ msgstr "Titel" msgid "The title of the color selection dialog" msgstr "Die titel van die kleurkies-dialoog" -#: gtk/gtkcolorbutton.c:201 gtk/gtkcolorsel.c:293 +#: gtk/gtkcolorbutton.c:201 gtk/gtkcolorsel.c:295 msgid "Current Color" msgstr "Huidige kleur" @@ -1917,7 +1917,7 @@ msgstr "Huidige kleur" msgid "The selected color" msgstr "Die geselekteerde kleur" -#: gtk/gtkcolorbutton.c:216 gtk/gtkcolorsel.c:300 +#: gtk/gtkcolorbutton.c:216 gtk/gtkcolorsel.c:302 msgid "Current Alpha" msgstr "Huidige alfa" @@ -1927,38 +1927,38 @@ msgstr "" "Die geselekteerde ondeursigtigheidswaarde (0 volledig deursigtig, 65535 " "volledig ondeursigtig)" -#: gtk/gtkcolorsel.c:279 +#: gtk/gtkcolorsel.c:281 msgid "Has Opacity Control" msgstr "Het ondeursigtigheidskontrole" -#: gtk/gtkcolorsel.c:280 +#: gtk/gtkcolorsel.c:282 msgid "Whether the color selector should allow setting opacity" msgstr "" "Of die kleurkieser toegelaat moet word om die ondeursigtigheid te verstel" -#: gtk/gtkcolorsel.c:286 +#: gtk/gtkcolorsel.c:288 msgid "Has palette" msgstr "Het palet" -#: gtk/gtkcolorsel.c:287 +#: gtk/gtkcolorsel.c:289 msgid "Whether a palette should be used" msgstr "Of 'n palet gebruik moet word" -#: gtk/gtkcolorsel.c:294 +#: gtk/gtkcolorsel.c:296 msgid "The current color" msgstr "Die huidige kleur" -#: gtk/gtkcolorsel.c:301 +#: gtk/gtkcolorsel.c:303 msgid "The current opacity value (0 fully transparent, 65535 fully opaque)" msgstr "" "Die huidige ondeursigtigheidswaarde (0 volledig deursigtig, 65535 volledig " "ondeursigtig)" -#: gtk/gtkcolorsel.c:315 +#: gtk/gtkcolorsel.c:317 msgid "Custom palette" msgstr "Doelgemaakte palet" -#: gtk/gtkcolorsel.c:316 +#: gtk/gtkcolorsel.c:318 msgid "Palette to use in the color selector" msgstr "Palet om in die kleurkieser te gebruik" @@ -2001,111 +2001,71 @@ msgstr "Boodskapknoppies" msgid "The help button of the dialog." msgstr "Die knoppies wat in die boodskapdialoog vertoon word" -#: gtk/gtkcombo.c:145 -msgid "Enable arrow keys" -msgstr "Stel pyltjiesleutels in werking" - -#: gtk/gtkcombo.c:146 -msgid "Whether the arrow keys move through the list of items" -msgstr "Of die pyltjiesleutels deur die lys items beweeg" - -#: gtk/gtkcombo.c:152 -msgid "Always enable arrows" -msgstr "Stel altyd pyltjies in werking" - -#: gtk/gtkcombo.c:153 -msgid "Obsolete property, ignored" -msgstr "Oortollige eienskap, geïgnoreer" - -#: gtk/gtkcombo.c:159 -msgid "Case sensitive" -msgstr "Kassensitief" - -#: gtk/gtkcombo.c:160 -msgid "Whether list item matching is case sensitive" -msgstr "Of die lysitem-passing kassensitief is" - -#: gtk/gtkcombo.c:167 -msgid "Allow empty" -msgstr "Laat leë toe" - -#: gtk/gtkcombo.c:168 -msgid "Whether an empty value may be entered in this field" -msgstr "Of 'n leë waarde in hierdie veld ingetik mag word" - -#: gtk/gtkcombo.c:175 -msgid "Value in list" -msgstr "Waarde in lys" - -#: gtk/gtkcombo.c:176 -msgid "Whether entered values must already be present in the list" -msgstr "Of ingetikte waardes reeds in die lys teenwoordig moet wees" - -#: gtk/gtkcombobox.c:668 +#: gtk/gtkcombobox.c:671 msgid "ComboBox model" msgstr "Kombinasiekas-model" -#: gtk/gtkcombobox.c:669 +#: gtk/gtkcombobox.c:672 msgid "The model for the combo box" msgstr "Die model van die kombinasiekas" -#: gtk/gtkcombobox.c:686 +#: gtk/gtkcombobox.c:689 #, fuzzy msgid "Wrap width for laying out the items in a grid" msgstr "Vouwydte vir die uitlê van items op 'n rooster" -#: gtk/gtkcombobox.c:708 +#: gtk/gtkcombobox.c:711 msgid "Row span column" msgstr "Ryspankolom" -#: gtk/gtkcombobox.c:709 +#: gtk/gtkcombobox.c:712 msgid "TreeModel column containing the row span values" msgstr "Boommodel-kolom wat die ryspanwaarde bevat" -#: gtk/gtkcombobox.c:730 +#: gtk/gtkcombobox.c:733 msgid "Column span column" msgstr "Kolomspankolom" -#: gtk/gtkcombobox.c:731 +#: gtk/gtkcombobox.c:734 msgid "TreeModel column containing the column span values" msgstr "Boommodel-kolom wat die kolomspanwaarde bevat" -#: gtk/gtkcombobox.c:752 +#: gtk/gtkcombobox.c:755 msgid "Active item" msgstr "Aktiewe item" -#: gtk/gtkcombobox.c:753 +#: gtk/gtkcombobox.c:756 msgid "The item which is currently active" msgstr "Die item wat tans aktief is" -#: gtk/gtkcombobox.c:772 gtk/gtkuimanager.c:226 +#: gtk/gtkcombobox.c:775 gtk/gtkuimanager.c:226 msgid "Add tearoffs to menus" msgstr "Voeg afskeuritems by die kieslyste" -#: gtk/gtkcombobox.c:773 +#: gtk/gtkcombobox.c:776 #, fuzzy msgid "Whether dropdowns should have a tearoff menu item" msgstr "Of oortjies eenvormige groottes moet hê" -#: gtk/gtkcombobox.c:788 gtk/gtkentry.c:687 +#: gtk/gtkcombobox.c:791 gtk/gtkentry.c:689 msgid "Has Frame" msgstr "Het raam" -#: gtk/gtkcombobox.c:789 +#: gtk/gtkcombobox.c:792 #, fuzzy msgid "Whether the combo box draws a frame around the child" msgstr "Of die kolom rondom die koppe hersorteer kan word" -#: gtk/gtkcombobox.c:797 +#: gtk/gtkcombobox.c:800 #, fuzzy msgid "Whether the combo box grabs focus when it is clicked with the mouse" msgstr "Of 'n knoppie die fokus gryp wanneer dit met die muis gekliek word" -#: gtk/gtkcombobox.c:812 gtk/gtkmenu.c:556 +#: gtk/gtkcombobox.c:815 gtk/gtkmenu.c:563 msgid "Tearoff Title" msgstr "Afskeurtitel" -#: gtk/gtkcombobox.c:813 +#: gtk/gtkcombobox.c:816 #, fuzzy msgid "" "A title that may be displayed by the window manager when the popup is torn-" @@ -2114,51 +2074,51 @@ msgstr "" "'n Titel wat deur die vensterbestuurder vertoon kan word wanneer hierdie " "kieslys afgeskeur word" -#: gtk/gtkcombobox.c:830 +#: gtk/gtkcombobox.c:833 #, fuzzy msgid "Popup shown" msgstr "Fokus op reëlwydte" -#: gtk/gtkcombobox.c:831 +#: gtk/gtkcombobox.c:834 #, fuzzy msgid "Whether the combo's dropdown is shown" msgstr "Of die grens vertoon moet word of nie" -#: gtk/gtkcombobox.c:847 +#: gtk/gtkcombobox.c:850 msgid "Button Sensitivity" msgstr "" -#: gtk/gtkcombobox.c:848 +#: gtk/gtkcombobox.c:851 #, fuzzy msgid "Whether the dropdown button is sensitive when the model is empty" msgstr "Of 'n knoppie die fokus gryp wanneer dit met die muis gekliek word" -#: gtk/gtkcombobox.c:855 +#: gtk/gtkcombobox.c:858 msgid "Appears as list" msgstr "" -#: gtk/gtkcombobox.c:856 +#: gtk/gtkcombobox.c:859 #, fuzzy msgid "Whether dropdowns should look like lists rather than menus" msgstr "Of die vouers in plaas van die lêers gekies moet word" -#: gtk/gtkcombobox.c:872 +#: gtk/gtkcombobox.c:875 #, fuzzy msgid "Arrow Size" msgstr "Pyltjierigting" -#: gtk/gtkcombobox.c:873 +#: gtk/gtkcombobox.c:876 #, fuzzy msgid "The minimum size of the arrow in the combo box" msgstr "Die model van die kombinasiekas" -#: gtk/gtkcombobox.c:888 gtk/gtkentry.c:787 gtk/gtkhandlebox.c:174 -#: gtk/gtkmenubar.c:194 gtk/gtkstatusbar.c:193 gtk/gtktoolbar.c:623 -#: gtk/gtkviewport.c:122 +#: gtk/gtkcombobox.c:891 gtk/gtkentry.c:789 gtk/gtkhandlebox.c:175 +#: gtk/gtkmenubar.c:194 gtk/gtkstatusbar.c:193 gtk/gtktoolbar.c:568 +#: gtk/gtkviewport.c:150 msgid "Shadow type" msgstr "Arseringsoort" -#: gtk/gtkcombobox.c:889 +#: gtk/gtkcombobox.c:892 #, fuzzy msgid "Which kind of shadow to draw around the combo box" msgstr "Wydte van grens rondom die oortjie-etikette" @@ -2187,46 +2147,6 @@ msgstr "Kind" msgid "Can be used to add a new child to the container" msgstr "Kan gebruik word om 'n nuwe kind by die houer te voeg" -#: gtk/gtkcurve.c:126 -msgid "Curve type" -msgstr "Kurwesoort" - -#: gtk/gtkcurve.c:127 -msgid "Is this curve linear, spline interpolated, or free-form" -msgstr "Is hierdie kurwe lineêr, glyspygeïnterpoleer of in vryformaat" - -#: gtk/gtkcurve.c:134 -msgid "Minimum X" -msgstr "minimum x" - -#: gtk/gtkcurve.c:135 -msgid "Minimum possible value for X" -msgstr "minimum moontlike waarde vir x" - -#: gtk/gtkcurve.c:143 -msgid "Maximum X" -msgstr "maksimum x" - -#: gtk/gtkcurve.c:144 -msgid "Maximum possible X value" -msgstr "maksimum moontlike waarde vir x" - -#: gtk/gtkcurve.c:152 -msgid "Minimum Y" -msgstr "minimum y" - -#: gtk/gtkcurve.c:153 -msgid "Minimum possible value for Y" -msgstr "minimum moontlike waarde vir y" - -#: gtk/gtkcurve.c:161 -msgid "Maximum Y" -msgstr "maksimum y" - -#: gtk/gtkcurve.c:162 -msgid "Maximum possible value for Y" -msgstr "maksimum moontlike waarde vir y" - #: gtk/gtkdialog.c:145 msgid "Has separator" msgstr "Het skeier" @@ -2270,52 +2190,52 @@ msgid "Width of border around the button area at the bottom of the dialog" msgstr "" "Wydte van grens rondom die knoppiestreek aan die onderkant van die dialoog" -#: gtk/gtkentry.c:634 +#: gtk/gtkentry.c:636 #, fuzzy msgid "Text Buffer" msgstr "Buffer" -#: gtk/gtkentry.c:635 +#: gtk/gtkentry.c:637 msgid "Text buffer object which actually stores entry text" msgstr "" -#: gtk/gtkentry.c:642 gtk/gtklabel.c:601 +#: gtk/gtkentry.c:644 gtk/gtklabel.c:623 msgid "Cursor Position" msgstr "Wyserposisie" -#: gtk/gtkentry.c:643 gtk/gtklabel.c:602 +#: gtk/gtkentry.c:645 gtk/gtklabel.c:624 msgid "The current position of the insertion cursor in chars" msgstr "Die huidige posisie van die invoegingswyser in karakters" -#: gtk/gtkentry.c:652 gtk/gtklabel.c:611 +#: gtk/gtkentry.c:654 gtk/gtklabel.c:633 msgid "Selection Bound" msgstr "Seleksiegrens" -#: gtk/gtkentry.c:653 gtk/gtklabel.c:612 +#: gtk/gtkentry.c:655 gtk/gtklabel.c:634 msgid "" "The position of the opposite end of the selection from the cursor in chars" msgstr "" "Die posisie van die oorkantste punt van die seleksie van die wyser in " "karakters" -#: gtk/gtkentry.c:663 +#: gtk/gtkentry.c:665 msgid "Whether the entry contents can be edited" msgstr "Of die inskrywingsinhoud geredigeer kan word" -#: gtk/gtkentry.c:670 gtk/gtkentrybuffer.c:383 +#: gtk/gtkentry.c:672 gtk/gtkentrybuffer.c:383 msgid "Maximum length" msgstr "maksimum lengte" -#: gtk/gtkentry.c:671 gtk/gtkentrybuffer.c:384 +#: gtk/gtkentry.c:673 gtk/gtkentrybuffer.c:384 msgid "Maximum number of characters for this entry. Zero if no maximum" msgstr "" "Maksimum getal karakters vir hierdie inskrywing. Nul indien geen maksimum" -#: gtk/gtkentry.c:679 +#: gtk/gtkentry.c:681 msgid "Visibility" msgstr "Sigbaarheid" -#: gtk/gtkentry.c:680 +#: gtk/gtkentry.c:682 msgid "" "FALSE displays the \"invisible char\" instead of the actual text (password " "mode)" @@ -2323,30 +2243,30 @@ msgstr "" "VALS vertoon die \"onsigbare karakter\" in plaas van die werklike teks " "(wagwoordmodus)" -#: gtk/gtkentry.c:688 +#: gtk/gtkentry.c:690 msgid "FALSE removes outside bevel from entry" msgstr "VALS verwyder buiteskuinskant uit inskrywing" -#: gtk/gtkentry.c:696 +#: gtk/gtkentry.c:698 msgid "" "Border between text and frame. Overrides the inner-border style property" msgstr "" -#: gtk/gtkentry.c:703 gtk/gtkentry.c:1269 +#: gtk/gtkentry.c:705 gtk/gtkentry.c:1271 msgid "Invisible character" msgstr "Onsigbare karakter" -#: gtk/gtkentry.c:704 gtk/gtkentry.c:1270 +#: gtk/gtkentry.c:706 gtk/gtkentry.c:1272 msgid "The character to use when masking entry contents (in \"password mode\")" msgstr "" "Die karakter om te gebruik wanneer inskrywingsinhoud verberg word (in " "\"wagwoordmodus\")" -#: gtk/gtkentry.c:711 +#: gtk/gtkentry.c:713 msgid "Activates default" msgstr "Aktiveer verstek" -#: gtk/gtkentry.c:712 +#: gtk/gtkentry.c:714 msgid "" "Whether to activate the default widget (such as the default button in a " "dialog) when Enter is pressed" @@ -2354,103 +2274,103 @@ msgstr "" "Of die verstekdingesie (soos die verstekknoppie in 'n dialoog) geaktiveer " "moet word wanneer ENTER gedruk word" -#: gtk/gtkentry.c:718 +#: gtk/gtkentry.c:720 msgid "Width in chars" msgstr "Wydte in karakters" -#: gtk/gtkentry.c:719 +#: gtk/gtkentry.c:721 msgid "Number of characters to leave space for in the entry" msgstr "Getal karakters om ruimte voor in die inskrywing te laat" -#: gtk/gtkentry.c:728 +#: gtk/gtkentry.c:730 msgid "Scroll offset" msgstr "Rolverplasing" -#: gtk/gtkentry.c:729 +#: gtk/gtkentry.c:731 msgid "Number of pixels of the entry scrolled off the screen to the left" msgstr "Getal pixels van die inskrywing wat links van die skerm af rol" -#: gtk/gtkentry.c:739 +#: gtk/gtkentry.c:741 msgid "The contents of the entry" msgstr "Die inhoud van die inskrywing" -#: gtk/gtkentry.c:754 gtk/gtkmisc.c:73 +#: gtk/gtkentry.c:756 gtk/gtkmisc.c:73 msgid "X align" msgstr "x-align" -#: gtk/gtkentry.c:755 gtk/gtkmisc.c:74 +#: gtk/gtkentry.c:757 gtk/gtkmisc.c:74 #, fuzzy msgid "" "The horizontal alignment, from 0 (left) to 1 (right). Reversed for RTL " "layouts." msgstr "Die horisontale belyning, van 0 (links) na 1 (regs)" -#: gtk/gtkentry.c:771 +#: gtk/gtkentry.c:773 #, fuzzy msgid "Truncate multiline" msgstr "Selekteer meervoudig" -#: gtk/gtkentry.c:772 +#: gtk/gtkentry.c:774 #, fuzzy msgid "Whether to truncate multiline pastes to one line." msgstr "Of meervoudige lêers geselekteer mag word" -#: gtk/gtkentry.c:788 +#: gtk/gtkentry.c:790 msgid "Which kind of shadow to draw around the entry when has-frame is set" msgstr "" -#: gtk/gtkentry.c:803 gtk/gtktextview.c:657 +#: gtk/gtkentry.c:805 gtk/gtktextview.c:657 msgid "Overwrite mode" msgstr "Oorheenskryfmodus" -#: gtk/gtkentry.c:804 +#: gtk/gtkentry.c:806 #, fuzzy msgid "Whether new text overwrites existing text" msgstr "Of teks wat ingetik word, bestaande teks oorheenskryf" -#: gtk/gtkentry.c:818 gtk/gtkentrybuffer.c:368 +#: gtk/gtkentry.c:820 gtk/gtkentrybuffer.c:368 #, fuzzy msgid "Text length" msgstr "Teks-x-gerigtheid" -#: gtk/gtkentry.c:819 +#: gtk/gtkentry.c:821 msgid "Length of the text currently in the entry" msgstr "" -#: gtk/gtkentry.c:834 +#: gtk/gtkentry.c:836 #, fuzzy msgid "Invisible char set" msgstr "Onsigbaar-stel" -#: gtk/gtkentry.c:835 +#: gtk/gtkentry.c:837 #, fuzzy msgid "Whether the invisible char has been set" msgstr "Of die aksiegroep in werking gestel is." -#: gtk/gtkentry.c:853 +#: gtk/gtkentry.c:855 msgid "Caps Lock warning" msgstr "" -#: gtk/gtkentry.c:854 +#: gtk/gtkentry.c:856 msgid "Whether password entries will show a warning when Caps Lock is on" msgstr "" -#: gtk/gtkentry.c:868 +#: gtk/gtkentry.c:870 #, fuzzy msgid "Progress Fraction" msgstr "Fraksie" -#: gtk/gtkentry.c:869 +#: gtk/gtkentry.c:871 #, fuzzy msgid "The current fraction of the task that's been completed" msgstr "Die fraksie van die totale werk wat al voltooi is" -#: gtk/gtkentry.c:886 +#: gtk/gtkentry.c:888 #, fuzzy msgid "Progress Pulse Step" msgstr "Polsstap" -#: gtk/gtkentry.c:887 +#: gtk/gtkentry.c:889 #, fuzzy msgid "" "The fraction of total entry width to move the progress bouncing block for " @@ -2459,226 +2379,226 @@ msgstr "" "Die fraksie van die totale vordering wat die wipblok beweeg moet word " "wanneer dit gepols word" -#: gtk/gtkentry.c:903 +#: gtk/gtkentry.c:905 #, fuzzy msgid "Primary pixbuf" msgstr "Pixbuf" -#: gtk/gtkentry.c:904 +#: gtk/gtkentry.c:906 #, fuzzy msgid "Primary pixbuf for the entry" msgstr "Pixbuf vir oop uitvouer" -#: gtk/gtkentry.c:918 +#: gtk/gtkentry.c:920 #, fuzzy msgid "Secondary pixbuf" msgstr "Sekondêre" -#: gtk/gtkentry.c:919 +#: gtk/gtkentry.c:921 #, fuzzy msgid "Secondary pixbuf for the entry" msgstr "Sekondêre vorentoestapper" -#: gtk/gtkentry.c:933 +#: gtk/gtkentry.c:935 msgid "Primary stock ID" msgstr "" -#: gtk/gtkentry.c:934 +#: gtk/gtkentry.c:936 msgid "Stock ID for primary icon" msgstr "" -#: gtk/gtkentry.c:948 +#: gtk/gtkentry.c:950 #, fuzzy msgid "Secondary stock ID" msgstr "Sekondêre" -#: gtk/gtkentry.c:949 +#: gtk/gtkentry.c:951 msgid "Stock ID for secondary icon" msgstr "" -#: gtk/gtkentry.c:963 +#: gtk/gtkentry.c:965 #, fuzzy msgid "Primary icon name" msgstr "Fontnaam" -#: gtk/gtkentry.c:964 +#: gtk/gtkentry.c:966 msgid "Icon name for primary icon" msgstr "" -#: gtk/gtkentry.c:978 +#: gtk/gtkentry.c:980 #, fuzzy msgid "Secondary icon name" msgstr "Sekondêre" -#: gtk/gtkentry.c:979 +#: gtk/gtkentry.c:981 msgid "Icon name for secondary icon" msgstr "" -#: gtk/gtkentry.c:993 +#: gtk/gtkentry.c:995 msgid "Primary GIcon" msgstr "" -#: gtk/gtkentry.c:994 +#: gtk/gtkentry.c:996 #, fuzzy msgid "GIcon for primary icon" msgstr "Ikon vir die venster" -#: gtk/gtkentry.c:1008 +#: gtk/gtkentry.c:1010 #, fuzzy msgid "Secondary GIcon" msgstr "Sekondêre" -#: gtk/gtkentry.c:1009 +#: gtk/gtkentry.c:1011 msgid "GIcon for secondary icon" msgstr "" -#: gtk/gtkentry.c:1023 +#: gtk/gtkentry.c:1025 #, fuzzy msgid "Primary storage type" msgstr "Bergsoort" -#: gtk/gtkentry.c:1024 +#: gtk/gtkentry.c:1026 #, fuzzy msgid "The representation being used for primary icon" msgstr "Die voorstelling wat vir die beelddata gebruik word" -#: gtk/gtkentry.c:1039 +#: gtk/gtkentry.c:1041 #, fuzzy msgid "Secondary storage type" msgstr "Sekondêre vorentoestapper" -#: gtk/gtkentry.c:1040 +#: gtk/gtkentry.c:1042 #, fuzzy msgid "The representation being used for secondary icon" msgstr "Die voorstelling wat vir die beelddata gebruik word" -#: gtk/gtkentry.c:1061 +#: gtk/gtkentry.c:1063 msgid "Primary icon activatable" msgstr "" -#: gtk/gtkentry.c:1062 +#: gtk/gtkentry.c:1064 #, fuzzy msgid "Whether the primary icon is activatable" msgstr "Of die aksie in werking gestel is." -#: gtk/gtkentry.c:1082 +#: gtk/gtkentry.c:1084 #, fuzzy msgid "Secondary icon activatable" msgstr "Sekondêrewyser-kleur" -#: gtk/gtkentry.c:1083 +#: gtk/gtkentry.c:1085 #, fuzzy msgid "Whether the secondary icon is activatable" msgstr "Of die aksie in werking gestel is." -#: gtk/gtkentry.c:1105 +#: gtk/gtkentry.c:1107 #, fuzzy msgid "Primary icon sensitive" msgstr "Vertoon die sel" -#: gtk/gtkentry.c:1106 +#: gtk/gtkentry.c:1108 #, fuzzy msgid "Whether the primary icon is sensitive" msgstr "Of die lysitem-passing kassensitief is" -#: gtk/gtkentry.c:1127 +#: gtk/gtkentry.c:1129 #, fuzzy msgid "Secondary icon sensitive" msgstr "Sekondêre" -#: gtk/gtkentry.c:1128 +#: gtk/gtkentry.c:1130 #, fuzzy msgid "Whether the secondary icon is sensitive" msgstr "Of die aksie in werking gestel is." -#: gtk/gtkentry.c:1144 +#: gtk/gtkentry.c:1146 #, fuzzy msgid "Primary icon tooltip text" msgstr "Vertoon die sel" -#: gtk/gtkentry.c:1145 gtk/gtkentry.c:1181 +#: gtk/gtkentry.c:1147 gtk/gtkentry.c:1183 #, fuzzy msgid "The contents of the tooltip on the primary icon" msgstr "Die inhoud van die inskrywing" -#: gtk/gtkentry.c:1161 +#: gtk/gtkentry.c:1163 #, fuzzy msgid "Secondary icon tooltip text" msgstr "Sekondêrewyser-kleur" -#: gtk/gtkentry.c:1162 gtk/gtkentry.c:1200 +#: gtk/gtkentry.c:1164 gtk/gtkentry.c:1202 #, fuzzy msgid "The contents of the tooltip on the secondary icon" msgstr "Die inhoud van die inskrywing" -#: gtk/gtkentry.c:1180 +#: gtk/gtkentry.c:1182 #, fuzzy msgid "Primary icon tooltip markup" msgstr "Fontnaam" -#: gtk/gtkentry.c:1199 +#: gtk/gtkentry.c:1201 #, fuzzy msgid "Secondary icon tooltip markup" msgstr "Sekondêre" -#: gtk/gtkentry.c:1219 gtk/gtktextview.c:685 +#: gtk/gtkentry.c:1221 gtk/gtktextview.c:685 #, fuzzy msgid "IM module" msgstr "Verstekwydte" -#: gtk/gtkentry.c:1220 gtk/gtktextview.c:686 +#: gtk/gtkentry.c:1222 gtk/gtktextview.c:686 #, fuzzy msgid "Which IM module should be used" msgstr "Of 'n palet gebruik moet word" -#: gtk/gtkentry.c:1234 +#: gtk/gtkentry.c:1236 #, fuzzy msgid "Icon Prelight" msgstr "Hoogte" -#: gtk/gtkentry.c:1235 +#: gtk/gtkentry.c:1237 #, fuzzy msgid "Whether activatable icons should prelight when hovered" msgstr "Of oortjies vertoon moet word of nie" -#: gtk/gtkentry.c:1248 +#: gtk/gtkentry.c:1250 #, fuzzy msgid "Progress Border" msgstr "Troggrens" -#: gtk/gtkentry.c:1249 +#: gtk/gtkentry.c:1251 #, fuzzy msgid "Border around the progress bar" msgstr "Teks wat in die vorderingstaaf vertoon moet word" -#: gtk/gtkentry.c:1741 +#: gtk/gtkentry.c:1743 msgid "Border between text and frame." msgstr "" -#: gtk/gtkentry.c:1755 +#: gtk/gtkentry.c:1757 #, fuzzy msgid "State Hint" msgstr "Reëlsverwenking" -#: gtk/gtkentry.c:1756 +#: gtk/gtkentry.c:1758 #, fuzzy msgid "Whether to pass a proper state when drawing shadow or background" msgstr "Biskaart om as masker te gebruik wanneer teksagtergrond geteken word" -#: gtk/gtkentry.c:1761 gtk/gtklabel.c:858 +#: gtk/gtkentry.c:1763 gtk/gtklabel.c:882 msgid "Select on focus" msgstr "Merk by fokus" -#: gtk/gtkentry.c:1762 +#: gtk/gtkentry.c:1764 msgid "Whether to select the contents of an entry when it is focused" msgstr "" "Of die inhoud van 'n inskrywing gemerk moet word wanneer die fokus daarop is" -#: gtk/gtkentry.c:1776 +#: gtk/gtkentry.c:1778 msgid "Password Hint Timeout" msgstr "" -#: gtk/gtkentry.c:1777 +#: gtk/gtkentry.c:1779 msgid "How long to show the last input character in hidden entries" msgstr "" @@ -2707,7 +2627,7 @@ msgstr "minimum knoppielengte" msgid "Minimum length of the search key in order to look up matches" msgstr "minimum lengte van die soekknoppie nodig om vir pare te soek" -#: gtk/gtkentrycompletion.c:303 gtk/gtkiconview.c:586 +#: gtk/gtkentrycompletion.c:303 gtk/gtkiconview.c:588 #, fuzzy msgid "Text column" msgstr "Tekskolom" @@ -2798,11 +2718,11 @@ msgstr "Of die uitvouer oopgemaak is om die kinddingesie te vertoon" msgid "Text of the expander's label" msgstr "Teks op die uitvouer se etiket" -#: gtk/gtkexpander.c:211 gtk/gtklabel.c:520 +#: gtk/gtkexpander.c:211 gtk/gtklabel.c:542 msgid "Use markup" msgstr "Gebruik markering" -#: gtk/gtkexpander.c:212 gtk/gtklabel.c:521 +#: gtk/gtkexpander.c:212 gtk/gtklabel.c:543 msgid "The text of the label includes XML markup. See pango_parse_markup()" msgstr "" "Die teks van die etiket sluit XML-markering in. Kyk pango_parse_markup()" @@ -2811,8 +2731,8 @@ msgstr "" msgid "Space to put between the label and the child" msgstr "Ruimte wat tussen die etiket en die kind moet kom" -#: gtk/gtkexpander.c:229 gtk/gtkframe.c:147 gtk/gtktoolbutton.c:218 -#: gtk/gtktoolitemgroup.c:1542 +#: gtk/gtkexpander.c:229 gtk/gtkframe.c:156 gtk/gtktoolbutton.c:218 +#: gtk/gtktoolitemgroup.c:1550 msgid "Label widget" msgstr "Etiketdingesie" @@ -2821,11 +2741,11 @@ msgid "A widget to display in place of the usual expander label" msgstr "" "'n Dingesie wat in die plek van die gewone uitvoueretiket vertoon moet word" -#: gtk/gtkexpander.c:236 gtk/gtktoolitemgroup.c:1570 gtk/gtktreeview.c:777 +#: gtk/gtkexpander.c:236 gtk/gtktoolitemgroup.c:1578 gtk/gtktreeview.c:779 msgid "Expander Size" msgstr "Uitvouergrootte" -#: gtk/gtkexpander.c:237 gtk/gtktoolitemgroup.c:1571 gtk/gtktreeview.c:778 +#: gtk/gtkexpander.c:237 gtk/gtktoolitemgroup.c:1579 gtk/gtktreeview.c:780 msgid "Size of the expander arrow" msgstr "Grootte van die uitvouerpyltjie" @@ -2833,107 +2753,99 @@ msgstr "Grootte van die uitvouerpyltjie" msgid "Spacing around expander arrow" msgstr "Spasiëring rondom uitvouerpyltjie" -#: gtk/gtkfilechooser.c:758 +#: gtk/gtkfilechooser.c:759 msgid "Action" msgstr "Aksie" -#: gtk/gtkfilechooser.c:759 +#: gtk/gtkfilechooser.c:760 msgid "The type of operation that the file selector is performing" msgstr "Die soort operasie wat die lêerkieser uitvoer" -#: gtk/gtkfilechooser.c:765 -msgid "File System Backend" -msgstr "Lêerstelsel-agterkant" - -#: gtk/gtkfilechooser.c:766 -msgid "Name of file system backend to use" -msgstr "Naam van die lêerstelsel-rugstelsel om te gebruik" - -#: gtk/gtkfilechooser.c:771 gtk/gtkrecentchooser.c:264 +#: gtk/gtkfilechooser.c:766 gtk/gtkrecentchooser.c:281 msgid "Filter" msgstr "Filter" -#: gtk/gtkfilechooser.c:772 +#: gtk/gtkfilechooser.c:767 msgid "The current filter for selecting which files are displayed" msgstr "Die huidige filter vir kies watter lêers vertoon word" -#: gtk/gtkfilechooser.c:777 +#: gtk/gtkfilechooser.c:772 msgid "Local Only" msgstr "Slegs plaaslik" -#: gtk/gtkfilechooser.c:778 +#: gtk/gtkfilechooser.c:773 msgid "Whether the selected file(s) should be limited to local file: URLs" msgstr "" "Of die geselekteerde lêer(s) beperk moet word tot plaaslike lêer:-URL'e" -#: gtk/gtkfilechooser.c:783 +#: gtk/gtkfilechooser.c:778 msgid "Preview widget" msgstr "Voorskou dingesie" -#: gtk/gtkfilechooser.c:784 +#: gtk/gtkfilechooser.c:779 msgid "Application supplied widget for custom previews." msgstr "Dingesie deur toepassing verskaf vir doelgemaakte voorskoue." -#: gtk/gtkfilechooser.c:789 +#: gtk/gtkfilechooser.c:784 msgid "Preview Widget Active" msgstr "Voorskou dingesie aktief" -#: gtk/gtkfilechooser.c:790 +#: gtk/gtkfilechooser.c:785 msgid "" "Whether the application supplied widget for custom previews should be shown." msgstr "" "Of die dingesie deur toepassing verskaf vir doelgemaakte voorskoue vertoon " "moet word." -#: gtk/gtkfilechooser.c:795 +#: gtk/gtkfilechooser.c:790 #, fuzzy msgid "Use Preview Label" msgstr "Gebruik grootte in etiket" -#: gtk/gtkfilechooser.c:796 +#: gtk/gtkfilechooser.c:791 msgid "Whether to display a stock label with the name of the previewed file." msgstr "" -#: gtk/gtkfilechooser.c:801 +#: gtk/gtkfilechooser.c:796 msgid "Extra widget" msgstr "Ekstra dingesie" -#: gtk/gtkfilechooser.c:802 +#: gtk/gtkfilechooser.c:797 msgid "Application supplied widget for extra options." msgstr "Dingesie deur toepassing verskaf vir ekstra opsies." -#: gtk/gtkfilechooser.c:807 gtk/gtkfilesel.c:540 gtk/gtkrecentchooser.c:203 +#: gtk/gtkfilechooser.c:802 gtk/gtkrecentchooser.c:220 msgid "Select Multiple" msgstr "Selekteer meervoudig" -#: gtk/gtkfilechooser.c:808 gtk/gtkfilesel.c:541 +#: gtk/gtkfilechooser.c:803 msgid "Whether to allow multiple files to be selected" msgstr "Of meervoudige lêers geselekteer mag word" -#: gtk/gtkfilechooser.c:814 +#: gtk/gtkfilechooser.c:809 msgid "Show Hidden" msgstr "Vertoon verskuil" -#: gtk/gtkfilechooser.c:815 +#: gtk/gtkfilechooser.c:810 msgid "Whether the hidden files and folders should be displayed" msgstr "Of die verskuilde lêers en gidse vertoon moet word" -#: gtk/gtkfilechooser.c:830 +#: gtk/gtkfilechooser.c:825 msgid "Do overwrite confirmation" msgstr "" -#: gtk/gtkfilechooser.c:831 +#: gtk/gtkfilechooser.c:826 msgid "" "Whether a file chooser in save mode will present an overwrite confirmation " "dialog if necessary." msgstr "" -#: gtk/gtkfilechooser.c:847 +#: gtk/gtkfilechooser.c:842 #, fuzzy msgid "Allow folders creation" msgstr "Vertoon lêeroperasies" -#: gtk/gtkfilechooser.c:848 +#: gtk/gtkfilechooser.c:843 msgid "" "Whether a file chooser not in open mode will offer the user to create new " "folders." @@ -2956,36 +2868,19 @@ msgstr "Die titel van die fontkies-dialoog" msgid "The desired width of the button widget, in characters." msgstr "" -#: gtk/gtkfilesel.c:526 gtk/gtkimage.c:254 gtk/gtkrecentmanager.c:214 -#: gtk/gtkstatusicon.c:221 -msgid "Filename" -msgstr "Lêernaam" - -#: gtk/gtkfilesel.c:527 -msgid "The currently selected filename" -msgstr "Die huidig geselekteerde lêernaam" - -#: gtk/gtkfilesel.c:533 -msgid "Show file operations" -msgstr "Vertoon lêeroperasies" - -#: gtk/gtkfilesel.c:534 -msgid "Whether buttons for creating/manipulating files should be displayed" -msgstr "Of die knoppies vir die skep/manipuleer van lêers vertoon moet word" - -#: gtk/gtkfixed.c:90 gtk/gtklayout.c:597 +#: gtk/gtkfixed.c:90 gtk/gtklayout.c:561 msgid "X position" msgstr "x-posisie" -#: gtk/gtkfixed.c:91 gtk/gtklayout.c:598 +#: gtk/gtkfixed.c:91 gtk/gtklayout.c:562 msgid "X position of child widget" msgstr "x-posisie van die kinddingesie" -#: gtk/gtkfixed.c:100 gtk/gtklayout.c:607 +#: gtk/gtkfixed.c:100 gtk/gtklayout.c:571 msgid "Y position" msgstr "y-posisie" -#: gtk/gtkfixed.c:101 gtk/gtklayout.c:608 +#: gtk/gtkfixed.c:101 gtk/gtklayout.c:572 msgid "Y position of child widget" msgstr "y-posisie van die kinddingesie" @@ -3055,70 +2950,70 @@ msgid "The text to display in order to demonstrate the selected font" msgstr "" "Die teks wat vertoon moet word om die geselekteerde font mee te demonstreer" -#: gtk/gtkframe.c:106 +#: gtk/gtkframe.c:115 msgid "Text of the frame's label" msgstr "Teks op die raam se etiket" -#: gtk/gtkframe.c:113 +#: gtk/gtkframe.c:122 msgid "Label xalign" msgstr "Etiket-xalign" -#: gtk/gtkframe.c:114 +#: gtk/gtkframe.c:123 msgid "The horizontal alignment of the label" msgstr "Die horisontale gerigtheid van die etiket" -#: gtk/gtkframe.c:122 +#: gtk/gtkframe.c:131 msgid "Label yalign" msgstr "Etiket-yalign" -#: gtk/gtkframe.c:123 +#: gtk/gtkframe.c:132 msgid "The vertical alignment of the label" msgstr "Die vertikale gerigtheid van die etiket" -#: gtk/gtkframe.c:131 gtk/gtkhandlebox.c:167 +#: gtk/gtkframe.c:140 gtk/gtkhandlebox.c:168 msgid "Deprecated property, use shadow_type instead" msgstr "Afgekeurde eienskap, gebruik eerder arseer_soort" -#: gtk/gtkframe.c:138 +#: gtk/gtkframe.c:147 msgid "Frame shadow" msgstr "Raamarsering" -#: gtk/gtkframe.c:139 +#: gtk/gtkframe.c:148 msgid "Appearance of the frame border" msgstr "Voorkoms van die raam se grens" -#: gtk/gtkframe.c:148 +#: gtk/gtkframe.c:157 msgid "A widget to display in place of the usual frame label" msgstr "" "'n Dingesie wat in die plek van die gewone raametiket vertoon moet word" -#: gtk/gtkhandlebox.c:175 +#: gtk/gtkhandlebox.c:176 msgid "Appearance of the shadow that surrounds the container" msgstr "Voorkoms van die arsering wat die wat die houer omring" -#: gtk/gtkhandlebox.c:183 +#: gtk/gtkhandlebox.c:184 msgid "Handle position" msgstr "Handvatsel-posisie" -#: gtk/gtkhandlebox.c:184 +#: gtk/gtkhandlebox.c:185 msgid "Position of the handle relative to the child widget" msgstr "Posisie van die handvatsel met betrekking tot die kinddingesie" -#: gtk/gtkhandlebox.c:192 +#: gtk/gtkhandlebox.c:193 msgid "Snap edge" msgstr "Slagrand" -#: gtk/gtkhandlebox.c:193 +#: gtk/gtkhandlebox.c:194 msgid "" "Side of the handlebox that's lined up with the docking point to dock the " "handlebox" msgstr "Kant van die handvatselkassie in lyn met die vasmeerpunt" -#: gtk/gtkhandlebox.c:201 +#: gtk/gtkhandlebox.c:202 msgid "Snap edge set" msgstr "Slagrandstel" -#: gtk/gtkhandlebox.c:202 +#: gtk/gtkhandlebox.c:203 msgid "" "Whether to use the value from the snap_edge property or a value derived from " "handle_position" @@ -3126,241 +3021,245 @@ msgstr "" "Of die waarde van die slag_rand-eienskap of 'n waarde wat van die " "handvatsel_posisie afgelei is, gebruik moet word" -#: gtk/gtkhandlebox.c:209 +#: gtk/gtkhandlebox.c:210 msgid "Child Detached" msgstr "" -#: gtk/gtkhandlebox.c:210 +#: gtk/gtkhandlebox.c:211 msgid "" "A boolean value indicating whether the handlebox's child is attached or " "detached." msgstr "" -#: gtk/gtkiconview.c:549 +#: gtk/gtkiconview.c:551 #, fuzzy msgid "Selection mode" msgstr "Seleksiegrens" -#: gtk/gtkiconview.c:550 +#: gtk/gtkiconview.c:552 #, fuzzy msgid "The selection mode" msgstr "Die geselekteerde jaar" -#: gtk/gtkiconview.c:568 +#: gtk/gtkiconview.c:570 #, fuzzy msgid "Pixbuf column" msgstr "Tekskolom" -#: gtk/gtkiconview.c:569 +#: gtk/gtkiconview.c:571 msgid "Model column used to retrieve the icon pixbuf from" msgstr "" -#: gtk/gtkiconview.c:587 +#: gtk/gtkiconview.c:589 msgid "Model column used to retrieve the text from" msgstr "" -#: gtk/gtkiconview.c:606 +#: gtk/gtkiconview.c:608 #, fuzzy msgid "Markup column" msgstr "Markering" -#: gtk/gtkiconview.c:607 +#: gtk/gtkiconview.c:609 msgid "Model column used to retrieve the text if using Pango markup" msgstr "" -#: gtk/gtkiconview.c:614 +#: gtk/gtkiconview.c:616 #, fuzzy msgid "Icon View Model" msgstr "TreeView-model" -#: gtk/gtkiconview.c:615 +#: gtk/gtkiconview.c:617 #, fuzzy msgid "The model for the icon view" msgstr "Die model vir die boomaansig" -#: gtk/gtkiconview.c:631 +#: gtk/gtkiconview.c:633 #, fuzzy msgid "Number of columns" msgstr "Getal kanale" -#: gtk/gtkiconview.c:632 +#: gtk/gtkiconview.c:634 #, fuzzy msgid "Number of columns to display" msgstr "Die getal desimale plekke om te vertoon" -#: gtk/gtkiconview.c:649 +#: gtk/gtkiconview.c:651 #, fuzzy msgid "Width for each item" msgstr "Dingesie wat as die itemetiket gebruik moet word" -#: gtk/gtkiconview.c:650 +#: gtk/gtkiconview.c:652 msgid "The width used for each item" msgstr "" -#: gtk/gtkiconview.c:666 +#: gtk/gtkiconview.c:668 msgid "Space which is inserted between cells of an item" msgstr "" -#: gtk/gtkiconview.c:681 +#: gtk/gtkiconview.c:683 #, fuzzy msgid "Row Spacing" msgstr "Ryspasiëring" -#: gtk/gtkiconview.c:682 +#: gtk/gtkiconview.c:684 msgid "Space which is inserted between grid rows" msgstr "" -#: gtk/gtkiconview.c:697 +#: gtk/gtkiconview.c:699 #, fuzzy msgid "Column Spacing" msgstr "Kolomspasiëring" -#: gtk/gtkiconview.c:698 +#: gtk/gtkiconview.c:700 msgid "Space which is inserted between grid columns" msgstr "" -#: gtk/gtkiconview.c:713 +#: gtk/gtkiconview.c:715 #, fuzzy msgid "Margin" msgstr "Linkergrens" -#: gtk/gtkiconview.c:714 +#: gtk/gtkiconview.c:716 msgid "Space which is inserted at the edges of the icon view" msgstr "" -#: gtk/gtkiconview.c:730 +#: gtk/gtkiconview.c:732 msgid "" "How the text and icon of each item are positioned relative to each other" msgstr "" -#: gtk/gtkiconview.c:746 gtk/gtktreeview.c:612 gtk/gtktreeviewcolumn.c:308 +#: gtk/gtkiconview.c:748 gtk/gtktreeview.c:614 gtk/gtktreeviewcolumn.c:308 msgid "Reorderable" msgstr "Hersorteerbaar" -#: gtk/gtkiconview.c:747 gtk/gtktreeview.c:613 +#: gtk/gtkiconview.c:749 gtk/gtktreeview.c:615 msgid "View is reorderable" msgstr "Aansig is hersorteerbaar" -#: gtk/gtkiconview.c:754 gtk/gtktreeview.c:763 +#: gtk/gtkiconview.c:756 gtk/gtktreeview.c:765 #, fuzzy msgid "Tooltip Column" msgstr "Tekskolom" -#: gtk/gtkiconview.c:755 +#: gtk/gtkiconview.c:757 #, fuzzy msgid "The column in the model containing the tooltip texts for the items" msgstr "'n Kolom in die databronmodel waaruit die stringe verkry moet word" -#: gtk/gtkiconview.c:772 +#: gtk/gtkiconview.c:774 #, fuzzy msgid "Item Padding" msgstr "Onderkantopvulling" -#: gtk/gtkiconview.c:773 +#: gtk/gtkiconview.c:775 msgid "Padding around icon view items" msgstr "" -#: gtk/gtkiconview.c:782 +#: gtk/gtkiconview.c:784 #, fuzzy msgid "Selection Box Color" msgstr "Seleksiegrens" -#: gtk/gtkiconview.c:783 +#: gtk/gtkiconview.c:785 #, fuzzy msgid "Color of the selection box" msgstr "Die titel van die fontkies-dialoog" -#: gtk/gtkiconview.c:789 +#: gtk/gtkiconview.c:791 #, fuzzy msgid "Selection Box Alpha" msgstr "Seleksiegrens" -#: gtk/gtkiconview.c:790 +#: gtk/gtkiconview.c:792 #, fuzzy msgid "Opacity of the selection box" msgstr "Die titel van die fontkies-dialoog" -#: gtk/gtkimage.c:222 gtk/gtkstatusicon.c:213 +#: gtk/gtkimage.c:227 gtk/gtkstatusicon.c:218 msgid "Pixbuf" msgstr "Pixbuf" -#: gtk/gtkimage.c:223 gtk/gtkstatusicon.c:214 +#: gtk/gtkimage.c:228 gtk/gtkstatusicon.c:219 msgid "A GdkPixbuf to display" msgstr "'n GdkPixbuf om te vertoon" -#: gtk/gtkimage.c:230 +#: gtk/gtkimage.c:235 msgid "Pixmap" msgstr "Pixmap" -#: gtk/gtkimage.c:231 +#: gtk/gtkimage.c:236 msgid "A GdkPixmap to display" msgstr "'n GdkPixmap om te vertoon" -#: gtk/gtkimage.c:238 gtk/gtkmessagedialog.c:215 +#: gtk/gtkimage.c:243 gtk/gtkmessagedialog.c:262 msgid "Image" msgstr "Image" -#: gtk/gtkimage.c:239 +#: gtk/gtkimage.c:244 msgid "A GdkImage to display" msgstr "'n GdkImage om te vertoon" -#: gtk/gtkimage.c:246 +#: gtk/gtkimage.c:251 msgid "Mask" msgstr "Masker" -#: gtk/gtkimage.c:247 +#: gtk/gtkimage.c:252 msgid "Mask bitmap to use with GdkImage or GdkPixmap" msgstr "Maskerbismatriks om met GdkImage of GdkPixmap te gebruik" -#: gtk/gtkimage.c:255 gtk/gtkstatusicon.c:222 +#: gtk/gtkimage.c:259 gtk/gtkrecentmanager.c:214 gtk/gtkstatusicon.c:226 +msgid "Filename" +msgstr "Lêernaam" + +#: gtk/gtkimage.c:260 gtk/gtkstatusicon.c:227 msgid "Filename to load and display" msgstr "Lêernaam wat gelaai en vertoon moet word" -#: gtk/gtkimage.c:264 gtk/gtkstatusicon.c:230 +#: gtk/gtkimage.c:269 gtk/gtkstatusicon.c:235 msgid "Stock ID for a stock image to display" msgstr "Stapel-ID vir 'n stapelbeeld wat vertoon moet word" -#: gtk/gtkimage.c:271 +#: gtk/gtkimage.c:276 msgid "Icon set" msgstr "Ikonstel" -#: gtk/gtkimage.c:272 +#: gtk/gtkimage.c:277 msgid "Icon set to display" msgstr "Ikonstel wat vertoon moet word" -#: gtk/gtkimage.c:279 gtk/gtkscalebutton.c:216 gtk/gtktoolbar.c:540 -#: gtk/gtktoolpalette.c:990 +#: gtk/gtkimage.c:284 gtk/gtkscalebutton.c:232 gtk/gtktoolbar.c:485 +#: gtk/gtktoolpalette.c:991 msgid "Icon size" msgstr "Ikongrootte" -#: gtk/gtkimage.c:280 +#: gtk/gtkimage.c:285 #, fuzzy msgid "Symbolic size to use for stock icon, icon set or named icon" msgstr "Grootte wat vir stapelikon of ikonstel gebruik moet word" -#: gtk/gtkimage.c:296 +#: gtk/gtkimage.c:301 #, fuzzy msgid "Pixel size" msgstr "Pixels" -#: gtk/gtkimage.c:297 +#: gtk/gtkimage.c:302 #, fuzzy msgid "Pixel size to use for named icon" msgstr "Grootte wat vir stapelikon of ikonstel gebruik moet word" -#: gtk/gtkimage.c:305 +#: gtk/gtkimage.c:310 msgid "Animation" msgstr "Animasie" -#: gtk/gtkimage.c:306 +#: gtk/gtkimage.c:311 msgid "GdkPixbufAnimation to display" msgstr "GdkPixbufAnimation om te vertoon" -#: gtk/gtkimage.c:346 gtk/gtkstatusicon.c:261 +#: gtk/gtkimage.c:351 gtk/gtkstatusicon.c:266 msgid "Storage type" msgstr "Bergsoort" -#: gtk/gtkimage.c:347 gtk/gtkstatusicon.c:262 +#: gtk/gtkimage.c:352 gtk/gtkstatusicon.c:267 msgid "The representation being used for image data" msgstr "Die voorstelling wat vir die beelddata gebruik word" @@ -3373,7 +3272,7 @@ msgstr "Kinddingesie wat langs die kieslysteks moet verskyn" msgid "Whether to use the label text to create a stock menu item" msgstr "Of die etiketteks met die muis gekies kan word" -#: gtk/gtkimagemenuitem.c:184 gtk/gtkmenu.c:516 +#: gtk/gtkimagemenuitem.c:184 gtk/gtkmenu.c:523 #, fuzzy msgid "Accel Group" msgstr "Aksiegroep" @@ -3391,11 +3290,11 @@ msgstr "Vertoon kieslysbeelde" msgid "Whether images should be shown in menus" msgstr "Of beelde in kieslyste vertoon moet word" -#: gtk/gtkinfobar.c:384 gtk/gtkmessagedialog.c:128 +#: gtk/gtkinfobar.c:384 gtk/gtkmessagedialog.c:175 msgid "Message Type" msgstr "Boodskapsoort" -#: gtk/gtkinfobar.c:385 gtk/gtkmessagedialog.c:129 +#: gtk/gtkinfobar.c:385 gtk/gtkmessagedialog.c:176 msgid "The type of message" msgstr "Die soort boodskap" @@ -3414,23 +3313,23 @@ msgstr "Ruimte tussen waardeteks en die skuifknoppie/trog-streek" msgid "Width of border around the action area" msgstr "Wydte van grens rondom die hoofdialoogstreek" -#: gtk/gtkinvisible.c:87 gtk/gtkwindow.c:627 +#: gtk/gtkinvisible.c:87 gtk/gtkwindow.c:651 msgid "The screen where this window will be displayed" msgstr "Die skerm waarop hierdie venster vertoon sal word" -#: gtk/gtklabel.c:507 +#: gtk/gtklabel.c:529 msgid "The text of the label" msgstr "Die teks van die etiket" -#: gtk/gtklabel.c:514 +#: gtk/gtklabel.c:536 msgid "A list of style attributes to apply to the text of the label" msgstr "'n Lys stylattribute om op die teks van die etiket toe te pas" -#: gtk/gtklabel.c:535 gtk/gtktexttag.c:359 gtk/gtktextview.c:594 +#: gtk/gtklabel.c:557 gtk/gtktexttag.c:359 gtk/gtktextview.c:594 msgid "Justification" msgstr "Alkantbelyning" -#: gtk/gtklabel.c:536 +#: gtk/gtklabel.c:558 msgid "" "The alignment of the lines in the text of the label relative to each other. " "This does NOT affect the alignment of the label within its allocation. See " @@ -3440,11 +3339,11 @@ msgstr "" "mekaar. \vDit het NIE 'n uitwerking op die belyning van die etiket binne sy " "allokasie nie. Kyk GtkMisc::xalign daarvoor" -#: gtk/gtklabel.c:544 +#: gtk/gtklabel.c:566 msgid "Pattern" msgstr "Patroon" -#: gtk/gtklabel.c:545 +#: gtk/gtklabel.c:567 msgid "" "A string with _ characters in positions correspond to characters in the text " "to underline" @@ -3452,119 +3351,119 @@ msgstr "" "'n String met _ karakters in posisies wat ooreenstem met karakters in die " "teks wat onderstreep moet word" -#: gtk/gtklabel.c:552 +#: gtk/gtklabel.c:574 msgid "Line wrap" msgstr "Reëlvou" -#: gtk/gtklabel.c:553 +#: gtk/gtklabel.c:575 msgid "If set, wrap lines if the text becomes too wide" msgstr "Indien gestel word reëls gevou indien die teks te breed word" -#: gtk/gtklabel.c:568 +#: gtk/gtklabel.c:590 #, fuzzy msgid "Line wrap mode" msgstr "Reëlvou" -#: gtk/gtklabel.c:569 +#: gtk/gtklabel.c:591 msgid "If wrap is set, controls how linewrapping is done" msgstr "" -#: gtk/gtklabel.c:576 +#: gtk/gtklabel.c:598 msgid "Selectable" msgstr "Kiesbaar" -#: gtk/gtklabel.c:577 +#: gtk/gtklabel.c:599 msgid "Whether the label text can be selected with the mouse" msgstr "Of die etiketteks met die muis gekies kan word" -#: gtk/gtklabel.c:583 +#: gtk/gtklabel.c:605 msgid "Mnemonic key" msgstr "Mnemoniese sleutel" -#: gtk/gtklabel.c:584 +#: gtk/gtklabel.c:606 msgid "The mnemonic accelerator key for this label" msgstr "Die mnemoniese snelsleutel vir hierdie etiket" -#: gtk/gtklabel.c:592 +#: gtk/gtklabel.c:614 msgid "Mnemonic widget" msgstr "Mnemoniese dingesie" -#: gtk/gtklabel.c:593 +#: gtk/gtklabel.c:615 msgid "The widget to be activated when the label's mnemonic key is pressed" msgstr "" "Die dingesie wat geaktiveer moet word wanneer die etiket se mnemoniese " "sleutel gedruk word" -#: gtk/gtklabel.c:639 +#: gtk/gtklabel.c:661 msgid "" "The preferred place to ellipsize the string, if the label does not have " "enough room to display the entire string" msgstr "" -#: gtk/gtklabel.c:679 +#: gtk/gtklabel.c:702 #, fuzzy msgid "Single Line Mode" msgstr "Enkelparagraaf-modus" -#: gtk/gtklabel.c:680 +#: gtk/gtklabel.c:703 #, fuzzy msgid "Whether the label is in single line mode" msgstr "Of die etiket in die geselekteerde font geteken moet word" -#: gtk/gtklabel.c:697 +#: gtk/gtklabel.c:720 msgid "Angle" msgstr "" -#: gtk/gtklabel.c:698 +#: gtk/gtklabel.c:721 msgid "Angle at which the label is rotated" msgstr "" -#: gtk/gtklabel.c:718 +#: gtk/gtklabel.c:742 #, fuzzy msgid "Maximum Width In Characters" msgstr "Wydte in karakters" -#: gtk/gtklabel.c:719 +#: gtk/gtklabel.c:743 msgid "The desired maximum width of the label, in characters" msgstr "" -#: gtk/gtklabel.c:737 +#: gtk/gtklabel.c:761 #, fuzzy msgid "Track visited links" msgstr "Die titel van die fontkies-dialoog" -#: gtk/gtklabel.c:738 +#: gtk/gtklabel.c:762 #, fuzzy msgid "Whether visited links should be tracked" msgstr "Of die verskuilde lêers en gidse vertoon moet word" -#: gtk/gtklabel.c:859 +#: gtk/gtklabel.c:883 #, fuzzy msgid "Whether to select the contents of a selectable label when it is focused" msgstr "" "Of die inhoud van 'n inskrywing gemerk moet word wanneer die fokus daarop is" -#: gtk/gtklayout.c:617 gtk/gtkviewport.c:106 +#: gtk/gtklayout.c:581 gtk/gtkviewport.c:134 msgid "Horizontal adjustment" msgstr "Horisontale verstelling" -#: gtk/gtklayout.c:618 gtk/gtkscrolledwindow.c:219 +#: gtk/gtklayout.c:582 gtk/gtkscrolledwindow.c:236 msgid "The GtkAdjustment for the horizontal position" msgstr "Die GtkAdjustment vir die horisontale posisie" -#: gtk/gtklayout.c:625 gtk/gtkviewport.c:114 +#: gtk/gtklayout.c:589 gtk/gtkviewport.c:142 msgid "Vertical adjustment" msgstr "Vertikale verstelling" -#: gtk/gtklayout.c:626 gtk/gtkscrolledwindow.c:226 +#: gtk/gtklayout.c:590 gtk/gtkscrolledwindow.c:243 msgid "The GtkAdjustment for the vertical position" msgstr "Die GtkAdjustment vir die vertikale posisie" -#: gtk/gtklayout.c:634 +#: gtk/gtklayout.c:598 msgid "The width of the layout" msgstr "Die wydte van die uitleg" -#: gtk/gtklayout.c:643 +#: gtk/gtklayout.c:607 msgid "The height of the layout" msgstr "Die hoogte van die uitleg" @@ -3587,35 +3486,35 @@ msgstr "Sigbaar" msgid "Whether this link has been visited." msgstr "Of die aksie sigbaar is." -#: gtk/gtkmenu.c:502 +#: gtk/gtkmenu.c:509 #, fuzzy msgid "The currently selected menu item" msgstr "Die huidig geselekteerde lêernaam" -#: gtk/gtkmenu.c:517 +#: gtk/gtkmenu.c:524 #, fuzzy msgid "The accel group holding accelerators for the menu" msgstr "Die mnemoniese snelsleutel vir hierdie etiket" -#: gtk/gtkmenu.c:531 gtk/gtkmenuitem.c:290 +#: gtk/gtkmenu.c:538 gtk/gtkmenuitem.c:290 msgid "Accel Path" msgstr "" -#: gtk/gtkmenu.c:532 +#: gtk/gtkmenu.c:539 msgid "An accel path used to conveniently construct accel paths of child items" msgstr "" -#: gtk/gtkmenu.c:548 +#: gtk/gtkmenu.c:555 #, fuzzy msgid "Attach Widget" msgstr "Ekstra dingesie" -#: gtk/gtkmenu.c:549 +#: gtk/gtkmenu.c:556 #, fuzzy msgid "The widget the menu is attached to" msgstr "Of die kieslysitem gemerk is" -#: gtk/gtkmenu.c:557 +#: gtk/gtkmenu.c:564 msgid "" "A title that may be displayed by the window manager when this menu is torn-" "off" @@ -3623,40 +3522,40 @@ msgstr "" "'n Titel wat deur die vensterbestuurder vertoon kan word wanneer hierdie " "kieslys afgeskeur word" -#: gtk/gtkmenu.c:571 +#: gtk/gtkmenu.c:578 #, fuzzy msgid "Tearoff State" msgstr "Afskeurtitel" -#: gtk/gtkmenu.c:572 +#: gtk/gtkmenu.c:579 #, fuzzy msgid "A boolean that indicates whether the menu is torn-off" msgstr "" "'n Titel wat deur die vensterbestuurder vertoon kan word wanneer hierdie " "kieslys afgeskeur word" -#: gtk/gtkmenu.c:586 +#: gtk/gtkmenu.c:593 #, fuzzy msgid "Monitor" msgstr "Maand" -#: gtk/gtkmenu.c:587 +#: gtk/gtkmenu.c:594 msgid "The monitor the menu will be popped up on" msgstr "" -#: gtk/gtkmenu.c:593 +#: gtk/gtkmenu.c:600 msgid "Vertical Padding" msgstr "Vertikale opvulling" -#: gtk/gtkmenu.c:594 +#: gtk/gtkmenu.c:601 msgid "Extra space at the top and bottom of the menu" msgstr "Ekstra ruimte aan bo- en onderkant van die kieslys" -#: gtk/gtkmenu.c:616 +#: gtk/gtkmenu.c:623 msgid "Reserve Toggle Size" msgstr "" -#: gtk/gtkmenu.c:617 +#: gtk/gtkmenu.c:624 #, fuzzy msgid "" "A boolean that indicates whether the menu reserves space for toggles and " @@ -3665,21 +3564,21 @@ msgstr "" "'n Titel wat deur die vensterbestuurder vertoon kan word wanneer hierdie " "kieslys afgeskeur word" -#: gtk/gtkmenu.c:623 +#: gtk/gtkmenu.c:630 #, fuzzy msgid "Horizontal Padding" msgstr "Horisontale opvulling" -#: gtk/gtkmenu.c:624 +#: gtk/gtkmenu.c:631 #, fuzzy msgid "Extra space at the left and right edges of the menu" msgstr "Ekstra ruimte aan bo- en onderkant van die kieslys" -#: gtk/gtkmenu.c:632 +#: gtk/gtkmenu.c:639 msgid "Vertical Offset" msgstr "Vertikale verplasing" -#: gtk/gtkmenu.c:633 +#: gtk/gtkmenu.c:640 msgid "" "When the menu is a submenu, position it this number of pixels offset " "vertically" @@ -3687,11 +3586,11 @@ msgstr "" "Wanneer die kieslys 'n subkieslys is, word dit hierdie getal pixels " "vertikaal verplaas" -#: gtk/gtkmenu.c:641 +#: gtk/gtkmenu.c:648 msgid "Horizontal Offset" msgstr "Horisontale verplasing" -#: gtk/gtkmenu.c:642 +#: gtk/gtkmenu.c:649 msgid "" "When the menu is a submenu, position it this number of pixels offset " "horizontally" @@ -3699,88 +3598,88 @@ msgstr "" "Wanneer die kieslys 'n subkieslys is, word dit hierdie getal pixels " "horisontaal verplaas" -#: gtk/gtkmenu.c:650 +#: gtk/gtkmenu.c:657 #, fuzzy msgid "Double Arrows" msgstr "Vertoon pyltjie" -#: gtk/gtkmenu.c:651 +#: gtk/gtkmenu.c:658 msgid "When scrolling, always show both arrows." msgstr "" -#: gtk/gtkmenu.c:664 +#: gtk/gtkmenu.c:671 #, fuzzy msgid "Arrow Placement" msgstr "Pyltjie-x-verplasing" -#: gtk/gtkmenu.c:665 +#: gtk/gtkmenu.c:672 msgid "Indicates where scroll arrows should be placed" msgstr "" -#: gtk/gtkmenu.c:673 +#: gtk/gtkmenu.c:680 msgid "Left Attach" msgstr "Linkeraanhegting" -#: gtk/gtkmenu.c:674 gtk/gtktable.c:174 +#: gtk/gtkmenu.c:681 gtk/gtktable.c:174 msgid "The column number to attach the left side of the child to" msgstr "Die kolomnommer waaraan die linkersy van die kind geheg moet word" -#: gtk/gtkmenu.c:681 +#: gtk/gtkmenu.c:688 msgid "Right Attach" msgstr "Regteraanhegting" -#: gtk/gtkmenu.c:682 +#: gtk/gtkmenu.c:689 msgid "The column number to attach the right side of the child to" msgstr "Die kolomnommer waaraan die regtersy van die kind geheg moet word" -#: gtk/gtkmenu.c:689 +#: gtk/gtkmenu.c:696 msgid "Top Attach" msgstr "Boaanhegting" -#: gtk/gtkmenu.c:690 +#: gtk/gtkmenu.c:697 msgid "The row number to attach the top of the child to" msgstr "Die kolomnommer waaraan die bokantste sy van die kind geheg moet word" -#: gtk/gtkmenu.c:697 +#: gtk/gtkmenu.c:704 msgid "Bottom Attach" msgstr "Onderaanhegting" -#: gtk/gtkmenu.c:698 gtk/gtktable.c:195 +#: gtk/gtkmenu.c:705 gtk/gtktable.c:195 msgid "The row number to attach the bottom of the child to" msgstr "" "Die kolomnommer waaraan die onderkantste sy van die kind geheg moet word" -#: gtk/gtkmenu.c:712 +#: gtk/gtkmenu.c:719 msgid "Arbitrary constant to scale down the size of the scroll arrow" msgstr "" -#: gtk/gtkmenu.c:799 +#: gtk/gtkmenu.c:806 msgid "Can change accelerators" msgstr "Kan snelsleutels wysig" -#: gtk/gtkmenu.c:800 +#: gtk/gtkmenu.c:807 msgid "" "Whether menu accelerators can be changed by pressing a key over the menu item" msgstr "" "Of kieslyssnelsleutels gewysig kan word deur 'n sleutel oor die kieslysitem " "te druk" -#: gtk/gtkmenu.c:805 +#: gtk/gtkmenu.c:812 msgid "Delay before submenus appear" msgstr "Vertraag voor subkieslyste verskyn" -#: gtk/gtkmenu.c:806 +#: gtk/gtkmenu.c:813 msgid "" "Minimum time the pointer must stay over a menu item before the submenu appear" msgstr "" "minimum tyd wat die wyser oor 'n kieslysitem moet wag voor die subkieslys " "verskyn" -#: gtk/gtkmenu.c:813 +#: gtk/gtkmenu.c:820 msgid "Delay before hiding a submenu" msgstr "Vertraging voor subkieslys verskuil word" -#: gtk/gtkmenu.c:814 +#: gtk/gtkmenu.c:821 msgid "" "The time before hiding a submenu when the pointer is moving towards the " "submenu" @@ -3811,7 +3710,7 @@ msgstr "Die oriëntering van die nutsbalk" msgid "Style of bevel around the menubar" msgstr "Styl skuinskant rondom die kieslysstaaf" -#: gtk/gtkmenubar.c:202 gtk/gtktoolbar.c:590 +#: gtk/gtkmenubar.c:202 gtk/gtktoolbar.c:535 msgid "Internal padding" msgstr "Binneopvulling" @@ -3867,88 +3766,88 @@ msgstr "Wydte in karakters" msgid "The minimum desired width of the menu item in characters" msgstr "" -#: gtk/gtkmenushell.c:379 +#: gtk/gtkmenushell.c:382 #, fuzzy msgid "Take Focus" msgstr "Het fokus" -#: gtk/gtkmenushell.c:380 +#: gtk/gtkmenushell.c:383 #, fuzzy msgid "A boolean that determines whether the menu grabs the keyboard focus" msgstr "" "'n Titel wat deur die vensterbestuurder vertoon kan word wanneer hierdie " "kieslys afgeskeur word" -#: gtk/gtkmenutoolbutton.c:245 gtk/gtkoptionmenu.c:161 +#: gtk/gtkmenutoolbutton.c:243 msgid "Menu" msgstr "Kieslys" -#: gtk/gtkmenutoolbutton.c:246 +#: gtk/gtkmenutoolbutton.c:244 msgid "The dropdown menu" msgstr "" -#: gtk/gtkmessagedialog.c:98 +#: gtk/gtkmessagedialog.c:145 msgid "Image/label border" msgstr "Beeld/etiket-grens" -#: gtk/gtkmessagedialog.c:99 +#: gtk/gtkmessagedialog.c:146 msgid "Width of border around the label and image in the message dialog" msgstr "Wydte van grens rondom die etiket en beeld in die boodskapdialoog" -#: gtk/gtkmessagedialog.c:114 +#: gtk/gtkmessagedialog.c:161 msgid "Use separator" msgstr "Gebruik skeier" -#: gtk/gtkmessagedialog.c:115 +#: gtk/gtkmessagedialog.c:162 msgid "" "Whether to put a separator between the message dialog's text and the buttons" msgstr "" "Of 'n skeier tussen die boodskap se dialoogteks en die knoppies geplaas moet " "word" -#: gtk/gtkmessagedialog.c:136 +#: gtk/gtkmessagedialog.c:183 msgid "Message Buttons" msgstr "Boodskapknoppies" -#: gtk/gtkmessagedialog.c:137 +#: gtk/gtkmessagedialog.c:184 msgid "The buttons shown in the message dialog" msgstr "Die knoppies wat in die boodskapdialoog vertoon word" -#: gtk/gtkmessagedialog.c:154 +#: gtk/gtkmessagedialog.c:201 #, fuzzy msgid "The primary text of the message dialog" msgstr "Die knoppies wat in die boodskapdialoog vertoon word" -#: gtk/gtkmessagedialog.c:169 +#: gtk/gtkmessagedialog.c:216 #, fuzzy msgid "Use Markup" msgstr "Gebruik markering" -#: gtk/gtkmessagedialog.c:170 +#: gtk/gtkmessagedialog.c:217 #, fuzzy msgid "The primary text of the title includes Pango markup." msgstr "" "Die teks van die etiket sluit XML-markering in. Kyk pango_parse_markup()" -#: gtk/gtkmessagedialog.c:184 +#: gtk/gtkmessagedialog.c:231 #, fuzzy msgid "Secondary Text" msgstr "Sekondêre" -#: gtk/gtkmessagedialog.c:185 +#: gtk/gtkmessagedialog.c:232 #, fuzzy msgid "The secondary text of the message dialog" msgstr "Die knoppies wat in die boodskapdialoog vertoon word" -#: gtk/gtkmessagedialog.c:200 +#: gtk/gtkmessagedialog.c:247 msgid "Use Markup in secondary" msgstr "" -#: gtk/gtkmessagedialog.c:201 +#: gtk/gtkmessagedialog.c:248 msgid "The secondary text includes Pango markup." msgstr "" -#: gtk/gtkmessagedialog.c:216 +#: gtk/gtkmessagedialog.c:263 #, fuzzy msgid "The image" msgstr "Die waarde" @@ -4007,76 +3906,52 @@ msgstr "" msgid "The screen where this window will be displayed." msgstr "Die skerm waarop hierdie venster vertoon sal word" -#: gtk/gtknotebook.c:585 +#: gtk/gtknotebook.c:571 msgid "Page" msgstr "Bladsy" -#: gtk/gtknotebook.c:586 +#: gtk/gtknotebook.c:572 msgid "The index of the current page" msgstr "Die indeks van die huidige bladsy" -#: gtk/gtknotebook.c:594 +#: gtk/gtknotebook.c:580 msgid "Tab Position" msgstr "Oortjieposisie" -#: gtk/gtknotebook.c:595 +#: gtk/gtknotebook.c:581 msgid "Which side of the notebook holds the tabs" msgstr "Watter kant van die notaboek die oortjies kom" -#: gtk/gtknotebook.c:602 -msgid "Tab Border" -msgstr "Oortjiegrens" - -#: gtk/gtknotebook.c:603 -msgid "Width of the border around the tab labels" -msgstr "Wydte van grens rondom die oortjie-etikette" - -#: gtk/gtknotebook.c:611 -msgid "Horizontal Tab Border" -msgstr "Horisontale oortjiegrens" - -#: gtk/gtknotebook.c:612 -msgid "Width of the horizontal border of tab labels" -msgstr "Wydte van horisontale grens van die oortjie-etikette" - -#: gtk/gtknotebook.c:620 -msgid "Vertical Tab Border" -msgstr "Vertikale oortjiegrens" - -#: gtk/gtknotebook.c:621 -msgid "Width of the vertical border of tab labels" -msgstr "Wydte van vertikale grens van die oortjie-etikette" - -#: gtk/gtknotebook.c:629 +#: gtk/gtknotebook.c:588 msgid "Show Tabs" msgstr "Vertoon oortjies" -#: gtk/gtknotebook.c:630 +#: gtk/gtknotebook.c:589 msgid "Whether tabs should be shown or not" msgstr "Of oortjies vertoon moet word of nie" -#: gtk/gtknotebook.c:636 +#: gtk/gtknotebook.c:595 msgid "Show Border" msgstr "Vertoon grens" -#: gtk/gtknotebook.c:637 +#: gtk/gtknotebook.c:596 msgid "Whether the border should be shown or not" msgstr "Of die grens vertoon moet word of nie" -#: gtk/gtknotebook.c:643 +#: gtk/gtknotebook.c:602 msgid "Scrollable" msgstr "Rolbaar" -#: gtk/gtknotebook.c:644 +#: gtk/gtknotebook.c:603 msgid "If TRUE, scroll arrows are added if there are too many tabs to fit" msgstr "" "Indien WAAR word rolpyltjies bygevoeg indien al die oortjies nie inpas nie" -#: gtk/gtknotebook.c:650 +#: gtk/gtknotebook.c:609 msgid "Enable Popup" msgstr "Stel opspringer in werking" -#: gtk/gtknotebook.c:651 +#: gtk/gtknotebook.c:610 msgid "" "If TRUE, pressing the right mouse button on the notebook pops up a menu that " "you can use to go to a page" @@ -4084,237 +3959,203 @@ msgstr "" "Indien WAAR sal 'n regskliek-aksie op die notaboek 'n kieslys laat opspring " "waarmee jy na 'n bladsy kan gaan" -#: gtk/gtknotebook.c:658 -msgid "Whether tabs should have homogeneous sizes" -msgstr "Of oortjies eenvormige groottes moet hê" - -#: gtk/gtknotebook.c:664 -#, fuzzy -msgid "Group ID" -msgstr "Groep" - -#: gtk/gtknotebook.c:665 -msgid "Group ID for tabs drag and drop" -msgstr "" - -#: gtk/gtknotebook.c:681 gtk/gtkradioaction.c:128 gtk/gtkradiobutton.c:82 +#: gtk/gtknotebook.c:624 gtk/gtkradioaction.c:140 gtk/gtkradiobutton.c:159 #: gtk/gtkradiomenuitem.c:353 gtk/gtkradiotoolbutton.c:65 msgid "Group" msgstr "Groep" -#: gtk/gtknotebook.c:682 +#: gtk/gtknotebook.c:625 msgid "Group for tabs drag and drop" msgstr "" -#: gtk/gtknotebook.c:688 +#: gtk/gtknotebook.c:631 msgid "Tab label" msgstr "Oortjie-etiket" -#: gtk/gtknotebook.c:689 +#: gtk/gtknotebook.c:632 #, fuzzy msgid "The string displayed on the child's tab label" msgstr "Die string wat op die kinderoortjie-etiket vertoon word" -#: gtk/gtknotebook.c:695 +#: gtk/gtknotebook.c:638 msgid "Menu label" msgstr "Kieslysetiket" -#: gtk/gtknotebook.c:696 +#: gtk/gtknotebook.c:639 #, fuzzy msgid "The string displayed in the child's menu entry" msgstr "Die string wat op die kinderkieslysetiket vertoon word" -#: gtk/gtknotebook.c:709 +#: gtk/gtknotebook.c:652 msgid "Tab expand" msgstr "Oortjie-uitvou" -#: gtk/gtknotebook.c:710 +#: gtk/gtknotebook.c:653 #, fuzzy msgid "Whether to expand the child's tab or not" msgstr "Of die kinderoortjie uitgevou moet word of nie" -#: gtk/gtknotebook.c:716 +#: gtk/gtknotebook.c:659 msgid "Tab fill" msgstr "Oortjie-opvulling" -#: gtk/gtknotebook.c:717 +#: gtk/gtknotebook.c:660 #, fuzzy msgid "Whether the child's tab should fill the allocated area or not" msgstr "Of die kinderoortjie die toegewysde ruimte moet opvul of nie" -#: gtk/gtknotebook.c:723 +#: gtk/gtknotebook.c:666 msgid "Tab pack type" msgstr "Oortjiepaksoort" -#: gtk/gtknotebook.c:730 +#: gtk/gtknotebook.c:673 #, fuzzy msgid "Tab reorderable" msgstr "Hersorteerbaar" -#: gtk/gtknotebook.c:731 +#: gtk/gtknotebook.c:674 #, fuzzy msgid "Whether the tab is reorderable by user action or not" msgstr "Of die grens vertoon moet word of nie" -#: gtk/gtknotebook.c:737 +#: gtk/gtknotebook.c:680 #, fuzzy msgid "Tab detachable" msgstr "Oortjie-etiket" -#: gtk/gtknotebook.c:738 +#: gtk/gtknotebook.c:681 #, fuzzy msgid "Whether the tab is detachable" msgstr "Of die aksie in werking gestel is." -#: gtk/gtknotebook.c:753 gtk/gtkscrollbar.c:81 +#: gtk/gtknotebook.c:696 gtk/gtkscrollbar.c:81 msgid "Secondary backward stepper" msgstr "Sekondêre agtertoestapper" -#: gtk/gtknotebook.c:754 +#: gtk/gtknotebook.c:697 msgid "" "Display a second backward arrow button on the opposite end of the tab area" msgstr "" "Vertoon 'n tweede agtertoe-pyltjie op die teenoorgestelde punt van die " "oortjiearea" -#: gtk/gtknotebook.c:769 gtk/gtkscrollbar.c:88 +#: gtk/gtknotebook.c:712 gtk/gtkscrollbar.c:88 msgid "Secondary forward stepper" msgstr "Sekondêre vorentoestapper" -#: gtk/gtknotebook.c:770 +#: gtk/gtknotebook.c:713 msgid "" "Display a second forward arrow button on the opposite end of the tab area" msgstr "" "Vertoon 'n tweede vorentoe-pyltjie op die teenoorgestelde punt van die " "oortjiearea" -#: gtk/gtknotebook.c:784 gtk/gtkscrollbar.c:67 +#: gtk/gtknotebook.c:727 gtk/gtkscrollbar.c:67 msgid "Backward stepper" msgstr "Agtertoestapper" -#: gtk/gtknotebook.c:785 gtk/gtkscrollbar.c:68 +#: gtk/gtknotebook.c:728 gtk/gtkscrollbar.c:68 msgid "Display the standard backward arrow button" msgstr "Vertoon die standaard-agtertoepyltjieknoppie" -#: gtk/gtknotebook.c:799 gtk/gtkscrollbar.c:74 +#: gtk/gtknotebook.c:742 gtk/gtkscrollbar.c:74 msgid "Forward stepper" msgstr "Vorentoestapper" -#: gtk/gtknotebook.c:800 gtk/gtkscrollbar.c:75 +#: gtk/gtknotebook.c:743 gtk/gtkscrollbar.c:75 msgid "Display the standard forward arrow button" msgstr "Vertoon die standaardvorentoe pyltjieknoppie" -#: gtk/gtknotebook.c:814 +#: gtk/gtknotebook.c:757 #, fuzzy msgid "Tab overlap" msgstr "Oortjiegrens" -#: gtk/gtknotebook.c:815 +#: gtk/gtknotebook.c:758 #, fuzzy msgid "Size of tab overlap area" msgstr "Grootte van die uitvouerpyltjie" -#: gtk/gtknotebook.c:830 +#: gtk/gtknotebook.c:773 msgid "Tab curvature" msgstr "" -#: gtk/gtknotebook.c:831 +#: gtk/gtknotebook.c:774 #, fuzzy msgid "Size of tab curvature" msgstr "Grootte van spasieerders" -#: gtk/gtknotebook.c:847 +#: gtk/gtknotebook.c:790 #, fuzzy msgid "Arrow spacing" msgstr "Ryspasiëring" -#: gtk/gtknotebook.c:848 +#: gtk/gtknotebook.c:791 #, fuzzy msgid "Scroll arrow spacing" msgstr "Rolstaafspasiëring" -#: gtk/gtkobject.c:370 -#, fuzzy -msgid "User Data" -msgstr "Gebruik alfa" - -#: gtk/gtkobject.c:371 -msgid "Anonymous User Data Pointer" -msgstr "" - -#: gtk/gtkoptionmenu.c:162 -msgid "The menu of options" -msgstr "Die kieslys met opsies" - -#: gtk/gtkoptionmenu.c:169 -msgid "Size of dropdown indicator" -msgstr "Grootte van aftuimelwyser" - -#: gtk/gtkoptionmenu.c:175 -msgid "Spacing around indicator" -msgstr "Spasiëring rondom aanduier" - -#: gtk/gtkorientable.c:75 +#: gtk/gtkorientable.c:64 #, fuzzy msgid "The orientation of the orientable" msgstr "Die oriëntering van die nutsbalk" -#: gtk/gtkpaned.c:242 +#: gtk/gtkpaned.c:243 msgid "" "Position of paned separator in pixels (0 means all the way to the left/top)" msgstr "" "Posisie van gepaneelde skeier in pixels (0 beteken heeltemal na links/bo)" -#: gtk/gtkpaned.c:251 +#: gtk/gtkpaned.c:252 msgid "Position Set" msgstr "Posisiestel" -#: gtk/gtkpaned.c:252 +#: gtk/gtkpaned.c:253 msgid "TRUE if the Position property should be used" msgstr "WAAR indien die posisie-eienskap gebruik moet word" -#: gtk/gtkpaned.c:258 +#: gtk/gtkpaned.c:259 msgid "Handle Size" msgstr "Handvatsel-grootte" -#: gtk/gtkpaned.c:259 +#: gtk/gtkpaned.c:260 msgid "Width of handle" msgstr "Wydte van die handvatsel" -#: gtk/gtkpaned.c:275 +#: gtk/gtkpaned.c:276 msgid "Minimal Position" msgstr "Minimale posisie" -#: gtk/gtkpaned.c:276 +#: gtk/gtkpaned.c:277 msgid "Smallest possible value for the \"position\" property" msgstr "Kleinste moontlike waarde vir die \"posisie\"-eienskap" -#: gtk/gtkpaned.c:293 +#: gtk/gtkpaned.c:294 msgid "Maximal Position" msgstr "Maksimale posisie" -#: gtk/gtkpaned.c:294 +#: gtk/gtkpaned.c:295 msgid "Largest possible value for the \"position\" property" msgstr "Grootste moontlike waarde vir die \"posisie\"-eienskap" -#: gtk/gtkpaned.c:311 +#: gtk/gtkpaned.c:312 msgid "Resize" msgstr "Skaleer" -#: gtk/gtkpaned.c:312 +#: gtk/gtkpaned.c:313 msgid "If TRUE, the child expands and shrinks along with the paned widget" msgstr "" "Indien WAAR vergroot of verklein die kind saam met die gepaneelde dingesie" -#: gtk/gtkpaned.c:327 +#: gtk/gtkpaned.c:328 msgid "Shrink" msgstr "Verklein" -#: gtk/gtkpaned.c:328 +#: gtk/gtkpaned.c:329 msgid "If TRUE, the child can be made smaller than its requisition" msgstr "Indien WAAR kan die kind kleiner gemaak word as rekwisisie" -#: gtk/gtkplug.c:171 gtk/gtkstatusicon.c:312 +#: gtk/gtkplug.c:171 gtk/gtkstatusicon.c:317 msgid "Embedded" msgstr "" @@ -4332,101 +4173,95 @@ msgstr "" msgid "The window of the socket the plug is embedded in" msgstr "Of die aksie sigbaar is." -#: gtk/gtkpreview.c:102 -msgid "" -"Whether the preview widget should take up the entire space it is allocated" -msgstr "" -"Of die voorskoudingesie die volledige toegewyste ruimte in beslag moet neem" - -#: gtk/gtkprinter.c:112 +#: gtk/gtkprinter.c:131 #, fuzzy msgid "Name of the printer" msgstr "Naam van ikontema om te gebruik" -#: gtk/gtkprinter.c:118 +#: gtk/gtkprinter.c:137 msgid "Backend" msgstr "" -#: gtk/gtkprinter.c:119 +#: gtk/gtkprinter.c:138 #, fuzzy msgid "Backend for the printer" msgstr "Die model vir die boomaansig" -#: gtk/gtkprinter.c:125 +#: gtk/gtkprinter.c:144 #, fuzzy msgid "Is Virtual" msgstr "Is belangrik" -#: gtk/gtkprinter.c:126 +#: gtk/gtkprinter.c:145 msgid "FALSE if this represents a real hardware printer" msgstr "" -#: gtk/gtkprinter.c:132 +#: gtk/gtkprinter.c:151 #, fuzzy msgid "Accepts PDF" msgstr "Aanvaar keep" -#: gtk/gtkprinter.c:133 +#: gtk/gtkprinter.c:152 msgid "TRUE if this printer can accept PDF" msgstr "" -#: gtk/gtkprinter.c:139 +#: gtk/gtkprinter.c:158 #, fuzzy msgid "Accepts PostScript" msgstr "Aanvaar keep" -#: gtk/gtkprinter.c:140 +#: gtk/gtkprinter.c:159 msgid "TRUE if this printer can accept PostScript" msgstr "" -#: gtk/gtkprinter.c:146 +#: gtk/gtkprinter.c:165 msgid "State Message" msgstr "" -#: gtk/gtkprinter.c:147 +#: gtk/gtkprinter.c:166 msgid "String giving the current state of the printer" msgstr "" -#: gtk/gtkprinter.c:153 +#: gtk/gtkprinter.c:172 #, fuzzy msgid "Location" msgstr "Aksie" -#: gtk/gtkprinter.c:154 +#: gtk/gtkprinter.c:173 #, fuzzy msgid "The location of the printer" msgstr "Die oriëntering van die nutsbalk" -#: gtk/gtkprinter.c:161 +#: gtk/gtkprinter.c:180 #, fuzzy msgid "The icon name to use for the printer" msgstr "Die model vir die boomaansig" -#: gtk/gtkprinter.c:167 +#: gtk/gtkprinter.c:186 msgid "Job Count" msgstr "" -#: gtk/gtkprinter.c:168 +#: gtk/gtkprinter.c:187 #, fuzzy msgid "Number of jobs queued in the printer" msgstr "Die getal rye in die tabel" -#: gtk/gtkprinter.c:186 +#: gtk/gtkprinter.c:205 #, fuzzy msgid "Paused Printer" msgstr "Filter" -#: gtk/gtkprinter.c:187 +#: gtk/gtkprinter.c:206 #, fuzzy msgid "TRUE if this printer is paused" msgstr "WAAR indien die posisie-eienskap gebruik moet word" -#: gtk/gtkprinter.c:200 +#: gtk/gtkprinter.c:219 #, fuzzy msgid "Accepting Jobs" msgstr "Aanvaar fokus" -#: gtk/gtkprinter.c:201 +#: gtk/gtkprinter.c:220 msgid "TRUE if this printer is accepting new jobs" msgstr "" @@ -4611,7 +4446,7 @@ msgid "Has Selection" msgstr "Die geselekteerde jaar" #: gtk/gtkprintoperation.c:1297 -msgid "TRUE if a selecion exists." +msgid "TRUE if a selection exists." msgstr "" #: gtk/gtkprintoperation.c:1312 gtk/gtkprintunixdialog.c:361 @@ -4694,142 +4529,97 @@ msgstr "Vertoon teks" msgid "Whether the progress is shown as text." msgstr "Of die vordering as teks vertoon moet word" -#: gtk/gtkprogressbar.c:119 -msgid "The GtkAdjustment connected to the progress bar (Deprecated)" -msgstr "Die GtkAdjustment wat met die vorderingstaaf gekoppel word (afgekeur)" - -#: gtk/gtkprogressbar.c:135 -msgid "Bar style" -msgstr "Staafstyl" - -#: gtk/gtkprogressbar.c:136 -msgid "Specifies the visual style of the bar in percentage mode (Deprecated)" -msgstr "" -"Spesifiseer die visuele styl van die staaf in persentasiemodus (afgekeur)" - -#: gtk/gtkprogressbar.c:144 -msgid "Activity Step" -msgstr "Aktiwiteitstap" - -#: gtk/gtkprogressbar.c:145 -msgid "The increment used for each iteration in activity mode (Deprecated)" -msgstr "Die inkrement van elke iterasie in aktiwiteitsmodus (afgekeur)" - -#: gtk/gtkprogressbar.c:152 -msgid "Activity Blocks" -msgstr "Aktiwiteitsblokke" - -#: gtk/gtkprogressbar.c:153 -msgid "" -"The number of blocks which can fit in the progress bar area in activity mode " -"(Deprecated)" -msgstr "" -"Die getal blokke wat in aktiwiteitsmodus in die vorderingstaafruimte kan pas " -"(afgekeur)" - -#: gtk/gtkprogressbar.c:160 -msgid "Discrete Blocks" -msgstr "Diskrete blokke" - -#: gtk/gtkprogressbar.c:161 -msgid "" -"The number of discrete blocks in a progress bar (when shown in the discrete " -"style)" -msgstr "" -"Die getal diskrete blokke in 'n vorderingstaaf (wanneer in diskrete styl " -"vertoon word)" - -#: gtk/gtkprogressbar.c:168 +#: gtk/gtkprogressbar.c:121 msgid "Fraction" msgstr "Fraksie" -#: gtk/gtkprogressbar.c:169 +#: gtk/gtkprogressbar.c:122 msgid "The fraction of total work that has been completed" msgstr "Die fraksie van die totale werk wat al voltooi is" -#: gtk/gtkprogressbar.c:176 +#: gtk/gtkprogressbar.c:129 msgid "Pulse Step" msgstr "Polsstap" -#: gtk/gtkprogressbar.c:177 +#: gtk/gtkprogressbar.c:130 msgid "The fraction of total progress to move the bouncing block when pulsed" msgstr "" "Die fraksie van die totale vordering wat die wipblok beweeg moet word " "wanneer dit gepols word" -#: gtk/gtkprogressbar.c:185 +#: gtk/gtkprogressbar.c:138 msgid "Text to be displayed in the progress bar" msgstr "Teks wat in die vorderingstaaf vertoon moet word" -#: gtk/gtkprogressbar.c:207 +#: gtk/gtkprogressbar.c:160 msgid "" "The preferred place to ellipsize the string, if the progress bar does not " "have enough room to display the entire string, if at all." msgstr "" -#: gtk/gtkprogressbar.c:214 +#: gtk/gtkprogressbar.c:167 #, fuzzy msgid "XSpacing" msgstr "Spasiëring" -#: gtk/gtkprogressbar.c:215 +#: gtk/gtkprogressbar.c:168 msgid "Extra spacing applied to the width of a progress bar." msgstr "" -#: gtk/gtkprogressbar.c:220 +#: gtk/gtkprogressbar.c:173 #, fuzzy msgid "YSpacing" msgstr "Spasiëring" -#: gtk/gtkprogressbar.c:221 +#: gtk/gtkprogressbar.c:174 msgid "Extra spacing applied to the height of a progress bar." msgstr "" -#: gtk/gtkprogressbar.c:234 +#: gtk/gtkprogressbar.c:187 #, fuzzy msgid "Min horizontal bar width" msgstr "Horisontaleskeier-wydte" -#: gtk/gtkprogressbar.c:235 +#: gtk/gtkprogressbar.c:188 #, fuzzy msgid "The minimum horizontal width of the progress bar" msgstr "Die horisontale gerigtheid van die etiket" -#: gtk/gtkprogressbar.c:247 +#: gtk/gtkprogressbar.c:200 #, fuzzy msgid "Min horizontal bar height" msgstr "Horisontale gerigtheid" -#: gtk/gtkprogressbar.c:248 +#: gtk/gtkprogressbar.c:201 #, fuzzy msgid "Minimum horizontal height of the progress bar" msgstr "Teks wat in die vorderingstaaf vertoon moet word" -#: gtk/gtkprogressbar.c:260 +#: gtk/gtkprogressbar.c:213 #, fuzzy msgid "Min vertical bar width" msgstr "Vertikaleskeier-wydte" -#: gtk/gtkprogressbar.c:261 +#: gtk/gtkprogressbar.c:214 #, fuzzy msgid "The minimum vertical width of the progress bar" msgstr "Teks wat in die vorderingstaaf vertoon moet word" -#: gtk/gtkprogressbar.c:273 +#: gtk/gtkprogressbar.c:226 #, fuzzy msgid "Min vertical bar height" msgstr "minimum kindhoogte" -#: gtk/gtkprogressbar.c:274 +#: gtk/gtkprogressbar.c:227 #, fuzzy msgid "The minimum vertical height of the progress bar" msgstr "Teks wat in die vorderingstaaf vertoon moet word" -#: gtk/gtkradioaction.c:111 +#: gtk/gtkradioaction.c:123 msgid "The value" msgstr "Die waarde" -#: gtk/gtkradioaction.c:112 +#: gtk/gtkradioaction.c:124 msgid "" "The value returned by gtk_radio_action_get_current_value() when this action " "is the current action of its group." @@ -4837,23 +4627,23 @@ msgstr "" "Die waarde wat deur gtk_radio_action_get_current_value gegee word wanneer " "hierdie aksie die huidige aksie in sy groep is." -#: gtk/gtkradioaction.c:129 +#: gtk/gtkradioaction.c:141 #, fuzzy msgid "The radio action whose group this action belongs to." msgstr "Die klinkaksie aan wie se groep dié aksie behoort." -#: gtk/gtkradioaction.c:144 +#: gtk/gtkradioaction.c:156 #, fuzzy msgid "The current value" msgstr "Die huidige kleur" -#: gtk/gtkradioaction.c:145 +#: gtk/gtkradioaction.c:157 msgid "" "The value property of the currently active member of the group to which this " "action belongs." msgstr "" -#: gtk/gtkradiobutton.c:83 +#: gtk/gtkradiobutton.c:160 #, fuzzy msgid "The radio button whose group this widget belongs to." msgstr "Die klinkknoppie aan wie se groep hierdie dingesie behoort." @@ -4868,256 +4658,256 @@ msgstr "Die klinkknoppie aan wie se groep hierdie dingesie behoort." msgid "The radio tool button whose group this button belongs to." msgstr "Die klinkknoppie aan wie se groep hierdie dingesie behoort." -#: gtk/gtkrange.c:358 +#: gtk/gtkrange.c:385 msgid "Update policy" msgstr "Bywerkbeleid" -#: gtk/gtkrange.c:359 +#: gtk/gtkrange.c:386 msgid "How the range should be updated on the screen" msgstr "Hoe die strekking op die skerm moet bygewerk word" -#: gtk/gtkrange.c:368 +#: gtk/gtkrange.c:395 msgid "The GtkAdjustment that contains the current value of this range object" msgstr "Die GtkAdjustment wat die huidige waarde van hierdie reikobjek bevat" -#: gtk/gtkrange.c:375 +#: gtk/gtkrange.c:402 msgid "Inverted" msgstr "Omgekeer" -#: gtk/gtkrange.c:376 +#: gtk/gtkrange.c:403 msgid "Invert direction slider moves to increase range value" msgstr "Omkeerrigtingskuifknoppie beweeg om reikwaarde te vermeerder" -#: gtk/gtkrange.c:383 +#: gtk/gtkrange.c:410 msgid "Lower stepper sensitivity" msgstr "" -#: gtk/gtkrange.c:384 +#: gtk/gtkrange.c:411 msgid "" "The sensitivity policy for the stepper that points to the adjustment's lower " "side" msgstr "" -#: gtk/gtkrange.c:392 +#: gtk/gtkrange.c:419 msgid "Upper stepper sensitivity" msgstr "" -#: gtk/gtkrange.c:393 +#: gtk/gtkrange.c:420 msgid "" "The sensitivity policy for the stepper that points to the adjustment's upper " "side" msgstr "" -#: gtk/gtkrange.c:410 +#: gtk/gtkrange.c:437 msgid "Show Fill Level" msgstr "" -#: gtk/gtkrange.c:411 +#: gtk/gtkrange.c:438 msgid "Whether to display a fill level indicator graphics on trough." msgstr "" -#: gtk/gtkrange.c:427 +#: gtk/gtkrange.c:454 msgid "Restrict to Fill Level" msgstr "" -#: gtk/gtkrange.c:428 +#: gtk/gtkrange.c:455 msgid "Whether to restrict the upper boundary to the fill level." msgstr "" -#: gtk/gtkrange.c:443 +#: gtk/gtkrange.c:470 msgid "Fill Level" msgstr "" -#: gtk/gtkrange.c:444 +#: gtk/gtkrange.c:471 msgid "The fill level." msgstr "" -#: gtk/gtkrange.c:452 +#: gtk/gtkrange.c:479 msgid "Slider Width" msgstr "Skuifknoppiewydte" -#: gtk/gtkrange.c:453 +#: gtk/gtkrange.c:480 msgid "Width of scrollbar or scale thumb" msgstr "Wydte van rolstaaf of skaalduimpie" -#: gtk/gtkrange.c:460 +#: gtk/gtkrange.c:487 msgid "Trough Border" msgstr "Troggrens" -#: gtk/gtkrange.c:461 +#: gtk/gtkrange.c:488 msgid "Spacing between thumb/steppers and outer trough bevel" msgstr "Spasiëring tussen duimpie/stappe en buitenste trog se skuinste" -#: gtk/gtkrange.c:468 +#: gtk/gtkrange.c:495 msgid "Stepper Size" msgstr "Stappergrootte" -#: gtk/gtkrange.c:469 +#: gtk/gtkrange.c:496 msgid "Length of step buttons at ends" msgstr "Lengte van stapknoppies aan ente" -#: gtk/gtkrange.c:484 +#: gtk/gtkrange.c:511 msgid "Stepper Spacing" msgstr "Stapperspasiëring" -#: gtk/gtkrange.c:485 +#: gtk/gtkrange.c:512 msgid "Spacing between step buttons and thumb" msgstr "Spasiëring tussen stapknoppies en duimpie" -#: gtk/gtkrange.c:492 +#: gtk/gtkrange.c:519 msgid "Arrow X Displacement" msgstr "Pyltjie-x-verplasing" -#: gtk/gtkrange.c:493 +#: gtk/gtkrange.c:520 msgid "" "How far in the x direction to move the arrow when the button is depressed" msgstr "" "Hoe ver in die x-rigting die pyltjie moet skuif wanneer die knoppie gedruk " "word" -#: gtk/gtkrange.c:500 +#: gtk/gtkrange.c:527 msgid "Arrow Y Displacement" msgstr "Pyltjie-y-verplasing" -#: gtk/gtkrange.c:501 +#: gtk/gtkrange.c:528 msgid "" "How far in the y direction to move the arrow when the button is depressed" msgstr "" "Hoe ver in die y-rigting die pyltjie moet skuif wanneer die knoppie gedruk " "word" -#: gtk/gtkrange.c:509 +#: gtk/gtkrange.c:536 msgid "Draw slider ACTIVE during drag" msgstr "" -#: gtk/gtkrange.c:510 +#: gtk/gtkrange.c:537 msgid "" "With this option set to TRUE, sliders will be drawn ACTIVE and with shadow " "IN while they are dragged" msgstr "" -#: gtk/gtkrange.c:524 +#: gtk/gtkrange.c:551 msgid "Trough Side Details" msgstr "" -#: gtk/gtkrange.c:525 +#: gtk/gtkrange.c:552 msgid "" "When TRUE, the parts of the trough on the two sides of the slider are drawn " "with different details" msgstr "" -#: gtk/gtkrange.c:541 +#: gtk/gtkrange.c:568 msgid "Trough Under Steppers" msgstr "" -#: gtk/gtkrange.c:542 +#: gtk/gtkrange.c:569 msgid "" "Whether to draw trough for full length of range or exclude the steppers and " "spacing" msgstr "" -#: gtk/gtkrange.c:555 +#: gtk/gtkrange.c:582 #, fuzzy msgid "Arrow scaling" msgstr "Ryspasiëring" -#: gtk/gtkrange.c:556 +#: gtk/gtkrange.c:583 msgid "Arrow scaling with regard to scroll button size" msgstr "" -#: gtk/gtkrecentaction.c:616 gtk/gtkrecentchoosermenu.c:227 +#: gtk/gtkrecentaction.c:633 gtk/gtkrecentchoosermenu.c:255 #, fuzzy msgid "Show Numbers" msgstr "Vertoon weeknommers" -#: gtk/gtkrecentaction.c:617 gtk/gtkrecentchoosermenu.c:228 +#: gtk/gtkrecentaction.c:634 gtk/gtkrecentchoosermenu.c:256 #, fuzzy msgid "Whether the items should be displayed with a number" msgstr "Of afskeurkieslysitems by kieslyste gevoeg moet word" -#: gtk/gtkrecentchooser.c:132 +#: gtk/gtkrecentchooser.c:149 msgid "Recent Manager" msgstr "" -#: gtk/gtkrecentchooser.c:133 +#: gtk/gtkrecentchooser.c:150 msgid "The RecentManager object to use" msgstr "" -#: gtk/gtkrecentchooser.c:147 +#: gtk/gtkrecentchooser.c:164 #, fuzzy msgid "Show Private" msgstr "Vertoon teks" -#: gtk/gtkrecentchooser.c:148 +#: gtk/gtkrecentchooser.c:165 #, fuzzy msgid "Whether the private items should be displayed" msgstr "Of die verskuilde lêers en gidse vertoon moet word" -#: gtk/gtkrecentchooser.c:161 +#: gtk/gtkrecentchooser.c:178 #, fuzzy msgid "Show Tooltips" msgstr "Nutswenk" -#: gtk/gtkrecentchooser.c:162 +#: gtk/gtkrecentchooser.c:179 #, fuzzy msgid "Whether there should be a tooltip on the item" msgstr "Of die grens vertoon moet word of nie" -#: gtk/gtkrecentchooser.c:174 +#: gtk/gtkrecentchooser.c:191 #, fuzzy msgid "Show Icons" msgstr "Stapelikoon" -#: gtk/gtkrecentchooser.c:175 +#: gtk/gtkrecentchooser.c:192 #, fuzzy msgid "Whether there should be an icon near the item" msgstr "Of die grens vertoon moet word of nie" -#: gtk/gtkrecentchooser.c:190 +#: gtk/gtkrecentchooser.c:207 msgid "Show Not Found" msgstr "" -#: gtk/gtkrecentchooser.c:191 +#: gtk/gtkrecentchooser.c:208 #, fuzzy msgid "Whether the items pointing to unavailable resources should be displayed" msgstr "Of die verskuilde lêers en gidse vertoon moet word" -#: gtk/gtkrecentchooser.c:204 +#: gtk/gtkrecentchooser.c:221 #, fuzzy msgid "Whether to allow multiple items to be selected" msgstr "Of meervoudige lêers geselekteer mag word" -#: gtk/gtkrecentchooser.c:217 +#: gtk/gtkrecentchooser.c:234 #, fuzzy msgid "Local only" msgstr "Slegs plaaslik" -#: gtk/gtkrecentchooser.c:218 +#: gtk/gtkrecentchooser.c:235 #, fuzzy msgid "Whether the selected resource(s) should be limited to local file: URIs" msgstr "" "Of die geselekteerde lêer(s) beperk moet word tot plaaslike lêer:-URL'e" -#: gtk/gtkrecentchooser.c:234 gtk/gtkrecentmanager.c:229 +#: gtk/gtkrecentchooser.c:251 gtk/gtkrecentmanager.c:229 msgid "Limit" msgstr "" -#: gtk/gtkrecentchooser.c:235 +#: gtk/gtkrecentchooser.c:252 #, fuzzy msgid "The maximum number of items to be displayed" msgstr "Die getal desimale plekke om te vertoon" -#: gtk/gtkrecentchooser.c:249 +#: gtk/gtkrecentchooser.c:266 #, fuzzy msgid "Sort Type" msgstr "Arseringsoort" -#: gtk/gtkrecentchooser.c:250 +#: gtk/gtkrecentchooser.c:267 #, fuzzy msgid "The sorting order of the items displayed" msgstr "Of die swikdeel van die knoppie vertoon word" -#: gtk/gtkrecentchooser.c:265 +#: gtk/gtkrecentchooser.c:282 #, fuzzy msgid "The current filter for selecting which resources are displayed" msgstr "Die huidige filter vir kies watter lêers vertoon word" @@ -5209,28 +4999,28 @@ msgstr "Waardespasiëring" msgid "Space between value text and the slider/trough area" msgstr "Ruimte tussen waardeteks en die skuifknoppie/trog-streek" -#: gtk/gtkscalebutton.c:207 +#: gtk/gtkscalebutton.c:223 #, fuzzy msgid "The value of the scale" msgstr "Die waarde van die aanpassing" -#: gtk/gtkscalebutton.c:217 +#: gtk/gtkscalebutton.c:233 #, fuzzy msgid "The icon size" msgstr "Nutsbalkikongrootte" -#: gtk/gtkscalebutton.c:226 +#: gtk/gtkscalebutton.c:242 #, fuzzy msgid "" "The GtkAdjustment that contains the current value of this scale button object" msgstr "Die GtkAdjustment wat die huidige waarde van hierdie reikobjek bevat" -#: gtk/gtkscalebutton.c:254 +#: gtk/gtkscalebutton.c:270 #, fuzzy msgid "Icons" msgstr "Ikon" -#: gtk/gtkscalebutton.c:255 +#: gtk/gtkscalebutton.c:271 #, fuzzy msgid "List of icon names" msgstr "Fontnaam" @@ -5268,104 +5058,104 @@ msgstr "" "Vertoon 'n tweede vorentoe-pyltjie op die teenoorgestelde punt van die " "rolstaaf" -#: gtk/gtkscrolledwindow.c:218 gtk/gtktext.c:545 gtk/gtktreeview.c:572 +#: gtk/gtkscrolledwindow.c:235 gtk/gtktreeview.c:574 msgid "Horizontal Adjustment" msgstr "Horisontale verstelling" -#: gtk/gtkscrolledwindow.c:225 gtk/gtktext.c:553 gtk/gtktreeview.c:580 +#: gtk/gtkscrolledwindow.c:242 gtk/gtktreeview.c:582 msgid "Vertical Adjustment" msgstr "Vertikale verstelling" -#: gtk/gtkscrolledwindow.c:232 +#: gtk/gtkscrolledwindow.c:249 msgid "Horizontal Scrollbar Policy" msgstr "Horisontalerolstaaf-beleid" -#: gtk/gtkscrolledwindow.c:233 +#: gtk/gtkscrolledwindow.c:250 msgid "When the horizontal scrollbar is displayed" msgstr "Wanneer die horisontale rolstaaf vertoon word" -#: gtk/gtkscrolledwindow.c:240 +#: gtk/gtkscrolledwindow.c:257 msgid "Vertical Scrollbar Policy" msgstr "Vertikalerolstaaf-beleid" -#: gtk/gtkscrolledwindow.c:241 +#: gtk/gtkscrolledwindow.c:258 msgid "When the vertical scrollbar is displayed" msgstr "Wanneer die vertikale rolstaaf vertoon word" -#: gtk/gtkscrolledwindow.c:249 +#: gtk/gtkscrolledwindow.c:266 msgid "Window Placement" msgstr "Vensterplasing" -#: gtk/gtkscrolledwindow.c:250 +#: gtk/gtkscrolledwindow.c:267 #, fuzzy msgid "" "Where the contents are located with respect to the scrollbars. This property " "only takes effect if \"window-placement-set\" is TRUE." msgstr "Waar die inhoud met betrekking tot die rolstawe geleë is" -#: gtk/gtkscrolledwindow.c:267 +#: gtk/gtkscrolledwindow.c:284 #, fuzzy msgid "Window Placement Set" msgstr "Vensterplasing" -#: gtk/gtkscrolledwindow.c:268 +#: gtk/gtkscrolledwindow.c:285 #, fuzzy msgid "" "Whether \"window-placement\" should be used to determine the location of the " "contents with respect to the scrollbars." msgstr "Waar die inhoud met betrekking tot die rolstawe geleë is" -#: gtk/gtkscrolledwindow.c:274 +#: gtk/gtkscrolledwindow.c:291 msgid "Shadow Type" msgstr "Arseringsoort" -#: gtk/gtkscrolledwindow.c:275 +#: gtk/gtkscrolledwindow.c:292 msgid "Style of bevel around the contents" msgstr "Styl van skuinskant rondom die inhoud" -#: gtk/gtkscrolledwindow.c:289 +#: gtk/gtkscrolledwindow.c:306 #, fuzzy msgid "Scrollbars within bevel" msgstr "Rolstaafspasiëring" -#: gtk/gtkscrolledwindow.c:290 +#: gtk/gtkscrolledwindow.c:307 #, fuzzy msgid "Place scrollbars within the scrolled window's bevel" msgstr "Getal pixels tussen die rolstawe en die gerolde venster" -#: gtk/gtkscrolledwindow.c:296 +#: gtk/gtkscrolledwindow.c:313 msgid "Scrollbar spacing" msgstr "Rolstaafspasiëring" -#: gtk/gtkscrolledwindow.c:297 +#: gtk/gtkscrolledwindow.c:314 msgid "Number of pixels between the scrollbars and the scrolled window" msgstr "Getal pixels tussen die rolstawe en die gerolde venster" -#: gtk/gtkscrolledwindow.c:312 +#: gtk/gtkscrolledwindow.c:329 #, fuzzy msgid "Scrolled Window Placement" msgstr "Vensterplasing" -#: gtk/gtkscrolledwindow.c:313 +#: gtk/gtkscrolledwindow.c:330 #, fuzzy msgid "" "Where the contents of scrolled windows are located with respect to the " "scrollbars, if not overridden by the scrolled window's own placement." msgstr "Waar die inhoud met betrekking tot die rolstawe geleë is" -#: gtk/gtkseparatortoolitem.c:105 +#: gtk/gtkseparatortoolitem.c:125 msgid "Draw" msgstr "Teken" -#: gtk/gtkseparatortoolitem.c:106 +#: gtk/gtkseparatortoolitem.c:126 msgid "Whether the separator is drawn, or just blank" msgstr "Of die skeier geteken word of weggelaat word" -#: gtk/gtksettings.c:224 +#: gtk/gtksettings.c:225 msgid "Double Click Time" msgstr "Dubbelkliek-tyd" -#: gtk/gtksettings.c:225 +#: gtk/gtksettings.c:226 msgid "" "Maximum time allowed between two clicks for them to be considered a double " "click (in milliseconds)" @@ -5373,11 +5163,11 @@ msgstr "" "maksimum tyd toegelaat tussen twee klieke om as 'n dubbelkliek gereken te " "word (in millisekondes)" -#: gtk/gtksettings.c:232 +#: gtk/gtksettings.c:233 msgid "Double Click Distance" msgstr "Dubbelkliek-afstand" -#: gtk/gtksettings.c:233 +#: gtk/gtksettings.c:234 msgid "" "Maximum distance allowed between two clicks for them to be considered a " "double click (in pixels)" @@ -5385,38 +5175,38 @@ msgstr "" "maksimum afstand toegelaat tussen twee klieke om as 'n dubbelkliek gereken " "te word (in pixels)" -#: gtk/gtksettings.c:249 +#: gtk/gtksettings.c:250 msgid "Cursor Blink" msgstr "Wyserflonker" -#: gtk/gtksettings.c:250 +#: gtk/gtksettings.c:251 msgid "Whether the cursor should blink" msgstr "Of die wyser moet flonker of nie" -#: gtk/gtksettings.c:257 +#: gtk/gtksettings.c:258 msgid "Cursor Blink Time" msgstr "Wyserflonker-tyd" -#: gtk/gtksettings.c:258 +#: gtk/gtksettings.c:259 #, fuzzy msgid "Length of the cursor blink cycle, in milliseconds" msgstr "Lengte van die wyserflonkersiklus, in millisekondes" -#: gtk/gtksettings.c:277 +#: gtk/gtksettings.c:278 #, fuzzy msgid "Cursor Blink Timeout" msgstr "Wyserflonker-tyd" -#: gtk/gtksettings.c:278 +#: gtk/gtksettings.c:279 #, fuzzy msgid "Time after which the cursor stops blinking, in seconds" msgstr "Lengte van die wyserflonkersiklus, in millisekondes" -#: gtk/gtksettings.c:285 +#: gtk/gtksettings.c:286 msgid "Split Cursor" msgstr "Dubbele wyser" -#: gtk/gtksettings.c:286 +#: gtk/gtksettings.c:287 msgid "" "Whether two cursors should be displayed for mixed left-to-right and right-to-" "left text" @@ -5424,102 +5214,102 @@ msgstr "" "Of twee wysers vertoon moet word in gemengde links-na-regs- en regs-na-links-" "teks" -#: gtk/gtksettings.c:293 +#: gtk/gtksettings.c:294 msgid "Theme Name" msgstr "Temanaam" -#: gtk/gtksettings.c:294 +#: gtk/gtksettings.c:295 msgid "Name of theme RC file to load" msgstr "Naam van tema-RC-lêer wat gelaai moet word" -#: gtk/gtksettings.c:302 +#: gtk/gtksettings.c:303 msgid "Icon Theme Name" msgstr "Ikontema naam" -#: gtk/gtksettings.c:303 +#: gtk/gtksettings.c:304 msgid "Name of icon theme to use" msgstr "Naam van ikontema om te gebruik" -#: gtk/gtksettings.c:311 +#: gtk/gtksettings.c:312 #, fuzzy msgid "Fallback Icon Theme Name" msgstr "Ikontema naam" -#: gtk/gtksettings.c:312 +#: gtk/gtksettings.c:313 #, fuzzy msgid "Name of a icon theme to fall back to" msgstr "Naam van ikontema om te gebruik" -#: gtk/gtksettings.c:320 +#: gtk/gtksettings.c:321 msgid "Key Theme Name" msgstr "Sleuteltema naam" -#: gtk/gtksettings.c:321 +#: gtk/gtksettings.c:322 msgid "Name of key theme RC file to load" msgstr "Naam van sleutel-RC-lêer wat gelaai moet word" -#: gtk/gtksettings.c:329 +#: gtk/gtksettings.c:330 msgid "Menu bar accelerator" msgstr "Kieslysstaafversneller" -#: gtk/gtksettings.c:330 +#: gtk/gtksettings.c:331 msgid "Keybinding to activate the menu bar" msgstr "Sleutelbinding om die kieslysstaaf te aktiveer" -#: gtk/gtksettings.c:338 +#: gtk/gtksettings.c:339 msgid "Drag threshold" msgstr "Sleepdrempel" -#: gtk/gtksettings.c:339 +#: gtk/gtksettings.c:340 msgid "Number of pixels the cursor can move before dragging" msgstr "Getal pixels wat die wyser mag beweeg voor daar gesleep word" -#: gtk/gtksettings.c:347 +#: gtk/gtksettings.c:348 msgid "Font Name" msgstr "Fontnaam" -#: gtk/gtksettings.c:348 +#: gtk/gtksettings.c:349 msgid "Name of default font to use" msgstr "Naam van verstekfont om te gebruik" -#: gtk/gtksettings.c:370 +#: gtk/gtksettings.c:371 msgid "Icon Sizes" msgstr "Ikongroottes" -#: gtk/gtksettings.c:371 +#: gtk/gtksettings.c:372 #, fuzzy msgid "List of icon sizes (gtk-menu=16,16:gtk-button=20,20..." msgstr "Lys van ikongroottes (gtk-menu=16,16;gtk-button=20,20..." -#: gtk/gtksettings.c:379 +#: gtk/gtksettings.c:380 msgid "GTK Modules" msgstr "" -#: gtk/gtksettings.c:380 +#: gtk/gtksettings.c:381 msgid "List of currently active GTK modules" msgstr "" -#: gtk/gtksettings.c:389 +#: gtk/gtksettings.c:390 msgid "Xft Antialias" msgstr "Xft-antialiassering" -#: gtk/gtksettings.c:390 +#: gtk/gtksettings.c:391 msgid "Whether to antialias Xft fonts; 0=no, 1=yes, -1=default" msgstr "Of Xft-fonte geantialiasseer moet word; 0=nee, 1=ja, -1=verstek" -#: gtk/gtksettings.c:399 +#: gtk/gtksettings.c:400 msgid "Xft Hinting" msgstr "Xft-verwenking" -#: gtk/gtksettings.c:400 +#: gtk/gtksettings.c:401 msgid "Whether to hint Xft fonts; 0=no, 1=yes, -1=default" msgstr "Of Xft-fonts verwenk moet word; 0=nee, 1=ja, -1=verstek" -#: gtk/gtksettings.c:409 +#: gtk/gtksettings.c:410 msgid "Xft Hint Style" msgstr "Xft-verwenkstyl" -#: gtk/gtksettings.c:410 +#: gtk/gtksettings.c:411 #, fuzzy msgid "" "What degree of hinting to use; hintnone, hintslight, hintmedium, or hintfull" @@ -5527,353 +5317,363 @@ msgstr "" "In hoe 'n mate verwenking toegepas moet word; geensins, effens, medium, of " "volledig" -#: gtk/gtksettings.c:419 +#: gtk/gtksettings.c:420 msgid "Xft RGBA" msgstr "Xft-RGBA" -#: gtk/gtksettings.c:420 +#: gtk/gtksettings.c:421 msgid "Type of subpixel antialiasing; none, rgb, bgr, vrgb, vbgr" msgstr "Soort subpixel-antialiassering; geen, RBG, BGR, VRGB, VBGR" -#: gtk/gtksettings.c:429 +#: gtk/gtksettings.c:430 msgid "Xft DPI" msgstr "Xft-DPI" -#: gtk/gtksettings.c:430 +#: gtk/gtksettings.c:431 msgid "Resolution for Xft, in 1024 * dots/inch. -1 to use default value" msgstr "" "Resolusie vir Xft, in 1024 * stippels per duim. -1 om verstekwaarde te " "gebruik" -#: gtk/gtksettings.c:439 +#: gtk/gtksettings.c:440 #, fuzzy msgid "Cursor theme name" msgstr "Ikontema naam" -#: gtk/gtksettings.c:440 +#: gtk/gtksettings.c:441 #, fuzzy msgid "Name of the cursor theme to use, or NULL to use the default theme" msgstr "Naam van ikontema om te gebruik" -#: gtk/gtksettings.c:448 +#: gtk/gtksettings.c:449 #, fuzzy msgid "Cursor theme size" msgstr "Wyser sigbaar" -#: gtk/gtksettings.c:449 +#: gtk/gtksettings.c:450 #, fuzzy msgid "Size to use for cursors, or 0 to use the default size" msgstr "Kleur wat vir onewegetal-rye gebruik word" -#: gtk/gtksettings.c:459 +#: gtk/gtksettings.c:460 msgid "Alternative button order" msgstr "" -#: gtk/gtksettings.c:460 +#: gtk/gtksettings.c:461 #, fuzzy msgid "Whether buttons in dialogs should use the alternative button order" msgstr "Of stapelikons in knoppies vertoon moet word" -#: gtk/gtksettings.c:477 +#: gtk/gtksettings.c:478 msgid "Alternative sort indicator direction" msgstr "" -#: gtk/gtksettings.c:478 +#: gtk/gtksettings.c:479 msgid "" "Whether the direction of the sort indicators in list and tree views is " "inverted compared to the default (where down means ascending)" msgstr "" -#: gtk/gtksettings.c:486 +#: gtk/gtksettings.c:487 msgid "Show the 'Input Methods' menu" msgstr "" -#: gtk/gtksettings.c:487 +#: gtk/gtksettings.c:488 msgid "" "Whether the context menus of entries and text views should offer to change " "the input method" msgstr "" -#: gtk/gtksettings.c:495 +#: gtk/gtksettings.c:496 msgid "Show the 'Insert Unicode Control Character' menu" msgstr "" -#: gtk/gtksettings.c:496 +#: gtk/gtksettings.c:497 msgid "" "Whether the context menus of entries and text views should offer to insert " "control characters" msgstr "" -#: gtk/gtksettings.c:504 +#: gtk/gtksettings.c:505 msgid "Start timeout" msgstr "" -#: gtk/gtksettings.c:505 +#: gtk/gtksettings.c:506 msgid "Starting value for timeouts, when button is pressed" msgstr "" -#: gtk/gtksettings.c:514 +#: gtk/gtksettings.c:515 msgid "Repeat timeout" msgstr "" -#: gtk/gtksettings.c:515 +#: gtk/gtksettings.c:516 msgid "Repeat value for timeouts, when button is pressed" msgstr "" -#: gtk/gtksettings.c:524 +#: gtk/gtksettings.c:525 #, fuzzy msgid "Expand timeout" msgstr "Uitvouergrootte" -#: gtk/gtksettings.c:525 +#: gtk/gtksettings.c:526 msgid "Expand value for timeouts, when a widget is expanding a new region" msgstr "" -#: gtk/gtksettings.c:560 +#: gtk/gtksettings.c:561 #, fuzzy msgid "Color scheme" msgstr "Kleurruimte" -#: gtk/gtksettings.c:561 +#: gtk/gtksettings.c:562 #, fuzzy msgid "A palette of named colors for use in themes" msgstr "Die naam van die geselekteerde font" -#: gtk/gtksettings.c:570 +#: gtk/gtksettings.c:571 #, fuzzy msgid "Enable Animations" msgstr "Animasie" -#: gtk/gtksettings.c:571 +#: gtk/gtksettings.c:572 msgid "Whether to enable toolkit-wide animations." msgstr "" -#: gtk/gtksettings.c:589 +#: gtk/gtksettings.c:590 msgid "Enable Touchscreen Mode" msgstr "" -#: gtk/gtksettings.c:590 +#: gtk/gtksettings.c:591 msgid "When TRUE, there are no motion notify events delivered on this screen" msgstr "" -#: gtk/gtksettings.c:607 +#: gtk/gtksettings.c:608 #, fuzzy msgid "Tooltip timeout" msgstr "Nutswenk" -#: gtk/gtksettings.c:608 +#: gtk/gtksettings.c:609 msgid "Timeout before tooltip is shown" msgstr "" -#: gtk/gtksettings.c:633 +#: gtk/gtksettings.c:634 msgid "Tooltip browse timeout" msgstr "" -#: gtk/gtksettings.c:634 +#: gtk/gtksettings.c:635 msgid "Timeout before tooltip is shown when browse mode is enabled" msgstr "" -#: gtk/gtksettings.c:655 +#: gtk/gtksettings.c:656 msgid "Tooltip browse mode timeout" msgstr "" -#: gtk/gtksettings.c:656 +#: gtk/gtksettings.c:657 #, fuzzy msgid "Timeout after which browse mode is disabled" msgstr "Die buffer wat vertoon word" -#: gtk/gtksettings.c:675 +#: gtk/gtksettings.c:676 msgid "Keynav Cursor Only" msgstr "" -#: gtk/gtksettings.c:676 +#: gtk/gtksettings.c:677 msgid "When TRUE, there are only cursor keys available to navigate widgets" msgstr "" -#: gtk/gtksettings.c:693 +#: gtk/gtksettings.c:694 msgid "Keynav Wrap Around" msgstr "" -#: gtk/gtksettings.c:694 +#: gtk/gtksettings.c:695 #, fuzzy msgid "Whether to wrap around when keyboard-navigating widgets" msgstr "Of die fokusaanwyser binne dingesies geteken moet word" -#: gtk/gtksettings.c:714 +#: gtk/gtksettings.c:715 msgid "Error Bell" msgstr "" -#: gtk/gtksettings.c:715 +#: gtk/gtksettings.c:716 msgid "When TRUE, keyboard navigation and other errors will cause a beep" msgstr "" -#: gtk/gtksettings.c:732 +#: gtk/gtksettings.c:733 #, fuzzy msgid "Color Hash" msgstr "Kleurruimte" -#: gtk/gtksettings.c:733 +#: gtk/gtksettings.c:734 msgid "A hash table representation of the color scheme." msgstr "" -#: gtk/gtksettings.c:741 +#: gtk/gtksettings.c:742 msgid "Default file chooser backend" msgstr "" -#: gtk/gtksettings.c:742 +#: gtk/gtksettings.c:743 #, fuzzy msgid "Name of the GtkFileChooser backend to use by default" msgstr "Naam van die lêerstelsel-rugstelsel om te gebruik" -#: gtk/gtksettings.c:759 +#: gtk/gtksettings.c:760 #, fuzzy msgid "Default print backend" msgstr "Verstekspasiëring" -#: gtk/gtksettings.c:760 +#: gtk/gtksettings.c:761 #, fuzzy msgid "List of the GtkPrintBackend backends to use by default" msgstr "Naam van die lêerstelsel-rugstelsel om te gebruik" -#: gtk/gtksettings.c:783 +#: gtk/gtksettings.c:784 msgid "Default command to run when displaying a print preview" msgstr "" -#: gtk/gtksettings.c:784 +#: gtk/gtksettings.c:785 msgid "Command to run when displaying a print preview" msgstr "" -#: gtk/gtksettings.c:800 +#: gtk/gtksettings.c:801 #, fuzzy msgid "Enable Mnemonics" msgstr "Animasie" -#: gtk/gtksettings.c:801 +#: gtk/gtksettings.c:802 #, fuzzy msgid "Whether labels should have mnemonics" msgstr "Of oortjies eenvormige groottes moet hê" -#: gtk/gtksettings.c:817 +#: gtk/gtksettings.c:818 #, fuzzy msgid "Enable Accelerators" msgstr "Kan snelsleutels wysig" -#: gtk/gtksettings.c:818 +#: gtk/gtksettings.c:819 #, fuzzy msgid "Whether menu items should have accelerators" msgstr "Of afskeurkieslysitems by kieslyste gevoeg moet word" -#: gtk/gtksettings.c:835 +#: gtk/gtksettings.c:836 msgid "Recent Files Limit" msgstr "" -#: gtk/gtksettings.c:836 +#: gtk/gtksettings.c:837 #, fuzzy msgid "Number of recently used files" msgstr "Getal kanale" -#: gtk/gtksettings.c:854 +#: gtk/gtksettings.c:855 #, fuzzy msgid "Default IM module" msgstr "Verstekwydte" -#: gtk/gtksettings.c:855 +#: gtk/gtksettings.c:856 #, fuzzy msgid "Which IM module should be used by default" msgstr "Of 'n palet gebruik moet word" -#: gtk/gtksettings.c:873 +#: gtk/gtksettings.c:874 msgid "Recent Files Max Age" msgstr "" -#: gtk/gtksettings.c:874 +#: gtk/gtksettings.c:875 #, fuzzy msgid "Maximum age of recently used files, in days" msgstr "Getal kanale" -#: gtk/gtksettings.c:883 +#: gtk/gtksettings.c:884 msgid "Fontconfig configuration timestamp" msgstr "" -#: gtk/gtksettings.c:884 +#: gtk/gtksettings.c:885 msgid "Timestamp of current fontconfig configuration" msgstr "" -#: gtk/gtksettings.c:906 +#: gtk/gtksettings.c:907 #, fuzzy msgid "Sound Theme Name" msgstr "Ikontema naam" -#: gtk/gtksettings.c:907 +#: gtk/gtksettings.c:908 #, fuzzy msgid "XDG sound theme name" msgstr "Ikontema naam" #. Translators: this means sounds that are played as feedback to user input -#: gtk/gtksettings.c:929 +#: gtk/gtksettings.c:930 msgid "Audible Input Feedback" msgstr "" -#: gtk/gtksettings.c:930 +#: gtk/gtksettings.c:931 #, fuzzy msgid "Whether to play event sounds as feedback to user input" msgstr "Of die dingesie reageer op toevoer" -#: gtk/gtksettings.c:951 +#: gtk/gtksettings.c:952 #, fuzzy msgid "Enable Event Sounds" msgstr "Animasie" -#: gtk/gtksettings.c:952 +#: gtk/gtksettings.c:953 #, fuzzy msgid "Whether to play any event sounds at all" msgstr "Of 'n \"teenstrydig\"-staat vertoon moet word" -#: gtk/gtksettings.c:967 +#: gtk/gtksettings.c:968 #, fuzzy msgid "Enable Tooltips" msgstr "Nutswenk" -#: gtk/gtksettings.c:968 +#: gtk/gtksettings.c:969 #, fuzzy msgid "Whether tooltips should be shown on widgets" msgstr "Of oortjies vertoon moet word of nie" -#: gtk/gtksettings.c:981 +#: gtk/gtksettings.c:982 msgid "Toolbar style" msgstr "Nutsbalkstyl" -#: gtk/gtksettings.c:982 +#: gtk/gtksettings.c:983 msgid "" "Whether default toolbars have text only, text and icons, icons only, etc." msgstr "Of die versteknutsbalk net teks, teks en ikons, net ikons, ens het." -#: gtk/gtksettings.c:996 +#: gtk/gtksettings.c:997 #, fuzzy msgid "Toolbar Icon Size" msgstr "Nutsbalkikongrootte" -#: gtk/gtksettings.c:997 +#: gtk/gtksettings.c:998 #, fuzzy msgid "The size of icons in default toolbars." msgstr "Grootte van ikons in versteknutsbalke" -#: gtk/gtksettings.c:1014 +#: gtk/gtksettings.c:1015 #, fuzzy msgid "Auto Mnemonics" msgstr "Animasie" -#: gtk/gtksettings.c:1015 +#: gtk/gtksettings.c:1016 msgid "" "Whether mnemonics should be automatically shown and hidden when the user " "presses the mnemonic activator." msgstr "" -#: gtk/gtksizegroup.c:301 +#: gtk/gtksettings.c:1041 +#, fuzzy +msgid "Application prefers a dark theme" +msgstr "Toepassing verfbaar" + +#: gtk/gtksettings.c:1042 +#, fuzzy +msgid "Whether the application prefers to have a dark theme." +msgstr "Of die aksie in werking gestel is." + +#: gtk/gtksizegroup.c:320 msgid "Mode" msgstr "Modus" -#: gtk/gtksizegroup.c:302 +#: gtk/gtksizegroup.c:321 #, fuzzy msgid "" "The directions in which the size group affects the requested sizes of its " @@ -5882,11 +5682,11 @@ msgstr "" "Die rigtings waarin die grootte van die groep 'n uitwerking op die gevraagde " "groottes van sy komponentdingesies het" -#: gtk/gtksizegroup.c:318 +#: gtk/gtksizegroup.c:337 msgid "Ignore hidden" msgstr "" -#: gtk/gtksizegroup.c:319 +#: gtk/gtksizegroup.c:338 msgid "" "If TRUE, unmapped widgets are ignored when determining the size of the group" msgstr "" @@ -5985,71 +5785,71 @@ msgstr "Of die statusstaaf 'n greep bevat om die bokant te herskaleer" msgid "Style of bevel around the statusbar text" msgstr "Styl van skuinskant rondom die statusstaafteks" -#: gtk/gtkstatusicon.c:271 +#: gtk/gtkstatusicon.c:276 #, fuzzy msgid "The size of the icon" msgstr "Die titel van die venster" -#: gtk/gtkstatusicon.c:281 +#: gtk/gtkstatusicon.c:286 #, fuzzy msgid "The screen where this status icon will be displayed" msgstr "Die skerm waarop hierdie venster vertoon sal word" -#: gtk/gtkstatusicon.c:288 +#: gtk/gtkstatusicon.c:293 msgid "Blinking" msgstr "" -#: gtk/gtkstatusicon.c:289 +#: gtk/gtkstatusicon.c:294 #, fuzzy msgid "Whether or not the status icon is blinking" msgstr "Of die aksie sigbaar is." -#: gtk/gtkstatusicon.c:297 +#: gtk/gtkstatusicon.c:302 #, fuzzy msgid "Whether or not the status icon is visible" msgstr "Of die aksie sigbaar is." -#: gtk/gtkstatusicon.c:313 +#: gtk/gtkstatusicon.c:318 #, fuzzy msgid "Whether or not the status icon is embedded" msgstr "Of die aksie sigbaar is." -#: gtk/gtkstatusicon.c:329 gtk/gtktrayicon-x11.c:111 +#: gtk/gtkstatusicon.c:334 gtk/gtktrayicon-x11.c:123 #, fuzzy msgid "The orientation of the tray" msgstr "Die oriëntering van die nutsbalk" -#: gtk/gtkstatusicon.c:356 gtk/gtkwidget.c:702 +#: gtk/gtkstatusicon.c:361 gtk/gtkwidget.c:722 #, fuzzy msgid "Has tooltip" msgstr "Nutswenk" -#: gtk/gtkstatusicon.c:357 +#: gtk/gtkstatusicon.c:362 #, fuzzy msgid "Whether this tray icon has a tooltip" msgstr "Of die dingesie die toevoerfokus het" -#: gtk/gtkstatusicon.c:382 gtk/gtkwidget.c:723 +#: gtk/gtkstatusicon.c:387 gtk/gtkwidget.c:743 #, fuzzy msgid "Tooltip Text" msgstr "Nutswenk" -#: gtk/gtkstatusicon.c:383 gtk/gtkwidget.c:724 gtk/gtkwidget.c:745 +#: gtk/gtkstatusicon.c:388 gtk/gtkwidget.c:744 gtk/gtkwidget.c:765 #, fuzzy msgid "The contents of the tooltip for this widget" msgstr "Die inhoud van die inskrywing" -#: gtk/gtkstatusicon.c:406 gtk/gtkwidget.c:744 +#: gtk/gtkstatusicon.c:411 gtk/gtkwidget.c:764 #, fuzzy msgid "Tooltip markup" msgstr "Nutswenk" -#: gtk/gtkstatusicon.c:407 +#: gtk/gtkstatusicon.c:412 #, fuzzy msgid "The contents of the tooltip for this tray icon" msgstr "Die inhoud van die inskrywing" -#: gtk/gtkstatusicon.c:425 +#: gtk/gtkstatusicon.c:430 #, fuzzy msgid "The title of this tray icon" msgstr "Die titel van die venster" @@ -6158,30 +5958,6 @@ msgstr "" "Ekstra ruimte wat tussen die kind en sy boonste- en onderste bure moet kom, " "in pixels" -#: gtk/gtktext.c:546 -msgid "Horizontal adjustment for the text widget" -msgstr "Horisontale verstelling vir die teksdingesie" - -#: gtk/gtktext.c:554 -msgid "Vertical adjustment for the text widget" -msgstr "Vertikale verstelling vir die teksdingesie" - -#: gtk/gtktext.c:561 -msgid "Line Wrap" -msgstr "Reëlvou" - -#: gtk/gtktext.c:562 -msgid "Whether lines are wrapped at widget edges" -msgstr "Of die reëls by die dingesie se rante gevou word" - -#: gtk/gtktext.c:569 -msgid "Word Wrap" -msgstr "Woordvou" - -#: gtk/gtktext.c:570 -msgid "Whether words are wrapped at widget edges" -msgstr "Of die woorde by die dingesie se rante gevou word" - #: gtk/gtktextbuffer.c:180 msgid "Tag Table" msgstr "Merkertabel" @@ -6632,15 +6408,15 @@ msgstr "Voorgrondkleur" msgid "Color with which to draw error-indication underlines" msgstr "Kleure waarmee die invoegwyser geteken moet word" -#: gtk/gtktoggleaction.c:104 +#: gtk/gtktoggleaction.c:115 msgid "Create the same proxies as a radio action" msgstr "Skep dieselfde instaners as klinkaksies" -#: gtk/gtktoggleaction.c:105 +#: gtk/gtktoggleaction.c:116 msgid "Whether the proxies for this action look like radio action proxies" msgstr "Of die instaners vir dié aksie soos klinkaksie-instaners lyk" -#: gtk/gtktoggleaction.c:120 +#: gtk/gtktoggleaction.c:131 #, fuzzy msgid "If the toggle action should be active in or not" msgstr "Of die swikknoppie gedruk moet word of nie" @@ -6661,93 +6437,83 @@ msgstr "Tekenaanduier" msgid "If the toggle part of the button is displayed" msgstr "Of die swikdeel van die knoppie vertoon word" -#: gtk/gtktoolbar.c:494 gtk/gtktoolpalette.c:1020 +#: gtk/gtktoolbar.c:456 gtk/gtktoolpalette.c:1021 msgid "Toolbar Style" msgstr "Nutsbalkstyl" -#: gtk/gtktoolbar.c:495 +#: gtk/gtktoolbar.c:457 msgid "How to draw the toolbar" msgstr "Hoe om die nutsbalk te teken" -#: gtk/gtktoolbar.c:502 +#: gtk/gtktoolbar.c:464 msgid "Show Arrow" msgstr "Vertoon pyltjie" -#: gtk/gtktoolbar.c:503 +#: gtk/gtktoolbar.c:465 msgid "If an arrow should be shown if the toolbar doesn't fit" msgstr "Of 'n pyltjie vertoon moet word as die nutsbalk nie pas nie" -#: gtk/gtktoolbar.c:518 -#, fuzzy -msgid "Tooltips" -msgstr "Nutswenk" - -#: gtk/gtktoolbar.c:519 -#, fuzzy -msgid "If the tooltips of the toolbar should be active or not" -msgstr "Of die swikknoppie gedruk moet word of nie" - -#: gtk/gtktoolbar.c:541 +#: gtk/gtktoolbar.c:486 #, fuzzy msgid "Size of icons in this toolbar" msgstr "Grootte van ikons in versteknutsbalke" -#: gtk/gtktoolbar.c:556 gtk/gtktoolpalette.c:1006 +#: gtk/gtktoolbar.c:501 gtk/gtktoolpalette.c:1007 #, fuzzy msgid "Icon size set" msgstr "Fontgroottestel" -#: gtk/gtktoolbar.c:557 gtk/gtktoolpalette.c:1007 +#: gtk/gtktoolbar.c:502 gtk/gtktoolpalette.c:1008 #, fuzzy msgid "Whether the icon-size property has been set" msgstr "Of die aksiegroep in werking gestel is." -#: gtk/gtktoolbar.c:566 +#: gtk/gtktoolbar.c:511 msgid "Whether the item should receive extra space when the toolbar grows" msgstr "Of die item ekstra ruimte moet kry wanneer die nutsbalk groei" -#: gtk/gtktoolbar.c:574 gtk/gtktoolitemgroup.c:1589 +#: gtk/gtktoolbar.c:519 gtk/gtktoolitemgroup.c:1597 msgid "Whether the item should be the same size as other homogeneous items" msgstr "Of die item dieselfde grootte as ander eenvormige items moet wees" -#: gtk/gtktoolbar.c:581 +#: gtk/gtktoolbar.c:526 msgid "Spacer size" msgstr "Spasieerdergrootte" -#: gtk/gtktoolbar.c:582 +#: gtk/gtktoolbar.c:527 msgid "Size of spacers" msgstr "Grootte van spasieerders" -#: gtk/gtktoolbar.c:591 +#: gtk/gtktoolbar.c:536 msgid "Amount of border space between the toolbar shadow and the buttons" msgstr "Hoeveelheid grensruimte tussen die nutsbalkarsering en knoppies" -#: gtk/gtktoolbar.c:599 +#: gtk/gtktoolbar.c:544 #, fuzzy msgid "Maximum child expand" msgstr "minimum kindwydte" -#: gtk/gtktoolbar.c:600 +#: gtk/gtktoolbar.c:545 msgid "Maximum amount of space an expandable item will be given" msgstr "" -#: gtk/gtktoolbar.c:608 +#: gtk/gtktoolbar.c:553 msgid "Space style" msgstr "Spasieerstyl" -#: gtk/gtktoolbar.c:609 +#: gtk/gtktoolbar.c:554 msgid "Whether spacers are vertical lines or just blank" msgstr "Of spasieerders vertikale strepe is of net leeg is" -#: gtk/gtktoolbar.c:616 +#: gtk/gtktoolbar.c:561 msgid "Button relief" msgstr "Knoppiereliëf" -#: gtk/gtktoolbar.c:617 +#: gtk/gtktoolbar.c:562 msgid "Type of bevel around toolbar buttons" msgstr "Soort skuinste rondom nutsbalkknoppies" -#: gtk/gtktoolbar.c:624 +#: gtk/gtktoolbar.c:569 msgid "Style of bevel around the toolbar" msgstr "Styl van skuinskant rondom die nutsbalk" @@ -6804,7 +6570,7 @@ msgstr "Ryspasiëring" msgid "Spacing in pixels between the icon and label" msgstr "Spasiëring tussen stapknoppies en duimpie" -#: gtk/gtktoolitem.c:207 +#: gtk/gtktoolitem.c:200 msgid "" "Whether the toolbar item is considered important. When TRUE, toolbar buttons " "show text in GTK_TOOLBAR_BOTH_HORIZ mode" @@ -6812,104 +6578,141 @@ msgstr "" "Of die nutsbalkitem as belangrik beskou word. Wanneer WAAR, wys " "nutsbalkknoppies teks vir hierdie aksie in GTK_TOOLBAR_BOTH_HORIZ-modus" -#: gtk/gtktoolitemgroup.c:1536 +#: gtk/gtktoolitemgroup.c:1544 #, fuzzy msgid "The human-readable title of this item group" msgstr "Die titel van die venster" -#: gtk/gtktoolitemgroup.c:1543 +#: gtk/gtktoolitemgroup.c:1551 #, fuzzy msgid "A widget to display in place of the usual label" msgstr "" "'n Dingesie wat in die plek van die gewone raametiket vertoon moet word" -#: gtk/gtktoolitemgroup.c:1549 +#: gtk/gtktoolitemgroup.c:1557 msgid "Collapsed" msgstr "" -#: gtk/gtktoolitemgroup.c:1550 +#: gtk/gtktoolitemgroup.c:1558 #, fuzzy msgid "Wether the group has been collapsed and items are hidden" msgstr "Of die uitvouer oopgemaak is om die kinddingesie te vertoon" -#: gtk/gtktoolitemgroup.c:1556 +#: gtk/gtktoolitemgroup.c:1564 #, fuzzy msgid "ellipsize" msgstr "Stygingstel" -#: gtk/gtktoolitemgroup.c:1557 +#: gtk/gtktoolitemgroup.c:1565 msgid "Ellipsize for item group headers" msgstr "" -#: gtk/gtktoolitemgroup.c:1563 +#: gtk/gtktoolitemgroup.c:1571 #, fuzzy msgid "Header Relief" msgstr "Koppe kliekbaar" -#: gtk/gtktoolitemgroup.c:1564 +#: gtk/gtktoolitemgroup.c:1572 #, fuzzy msgid "Relief of the group header button" msgstr "Vertoon die kolomkopknoppies" -#: gtk/gtktoolitemgroup.c:1579 +#: gtk/gtktoolitemgroup.c:1587 #, fuzzy msgid "Header Spacing" msgstr "Linkeropvulling" -#: gtk/gtktoolitemgroup.c:1580 +#: gtk/gtktoolitemgroup.c:1588 #, fuzzy msgid "Spacing between expander arrow and caption" msgstr "Spasiëring rondom uitvouerpyltjie" -#: gtk/gtktoolitemgroup.c:1596 +#: gtk/gtktoolitemgroup.c:1604 #, fuzzy msgid "Whether the item should receive extra space when the group grows" msgstr "Of die item ekstra ruimte moet kry wanneer die nutsbalk groei" -#: gtk/gtktoolitemgroup.c:1603 +#: gtk/gtktoolitemgroup.c:1611 #, fuzzy msgid "Whether the item should fill the available space" msgstr "Of die kinders almal dieselfde grootte moet wees" -#: gtk/gtktoolitemgroup.c:1609 +#: gtk/gtktoolitemgroup.c:1617 msgid "New Row" msgstr "" -#: gtk/gtktoolitemgroup.c:1610 +#: gtk/gtktoolitemgroup.c:1618 #, fuzzy msgid "Whether the item should start a new row" msgstr "Of afskeurkieslysitems by kieslyste gevoeg moet word" -#: gtk/gtktoolitemgroup.c:1617 +#: gtk/gtktoolitemgroup.c:1625 #, fuzzy msgid "Position of the item within this group" msgstr "Posisie van merk op die liniaal" -#: gtk/gtktoolpalette.c:991 +#: gtk/gtktoolpalette.c:992 #, fuzzy msgid "Size of icons in this tool palette" msgstr "Grootte van ikons in versteknutsbalke" -#: gtk/gtktoolpalette.c:1021 +#: gtk/gtktoolpalette.c:1022 #, fuzzy msgid "Style of items in the tool palette" msgstr "Styl van skuinskant rondom die nutsbalk" -#: gtk/gtktoolpalette.c:1037 +#: gtk/gtktoolpalette.c:1038 msgid "Exclusive" msgstr "" -#: gtk/gtktoolpalette.c:1038 +#: gtk/gtktoolpalette.c:1039 #, fuzzy msgid "Whether the item group should be the only expanded at a given time" msgstr "Of afskeurkieslysitems by kieslyste gevoeg moet word" -#: gtk/gtktoolpalette.c:1053 +#: gtk/gtktoolpalette.c:1054 #, fuzzy msgid "" "Whether the item group should receive extra space when the palette grows" msgstr "Of die kind ekstra ruimte moet kry wanneer die ouer groei" +#: gtk/gtktrayicon-x11.c:132 +#, fuzzy +msgid "Foreground color for symbolic icons" +msgstr "Voorgrondkleur as 'n string" + +#: gtk/gtktrayicon-x11.c:139 +#, fuzzy +msgid "Error color" +msgstr "Wyserkleur" + +#: gtk/gtktrayicon-x11.c:140 +msgid "Error color for symbolic icons" +msgstr "" + +#: gtk/gtktrayicon-x11.c:147 +#, fuzzy +msgid "Warning color" +msgstr "Agtergrondkleur" + +#: gtk/gtktrayicon-x11.c:148 +msgid "Warning color for symbolic icons" +msgstr "" + +#: gtk/gtktrayicon-x11.c:155 +#, fuzzy +msgid "Success color" +msgstr "Wyserkleur" + +#: gtk/gtktrayicon-x11.c:156 +msgid "Success color for symbolic icons" +msgstr "" + +#: gtk/gtktrayicon-x11.c:164 +#, fuzzy +msgid "Padding that should be put around icons in the tray" +msgstr "Of die grens vertoon moet word of nie" + #: gtk/gtktreemodelsort.c:278 msgid "TreeModelSort Model" msgstr "TreeModelSort-model" @@ -6918,247 +6721,247 @@ msgstr "TreeModelSort-model" msgid "The model for the TreeModelSort to sort" msgstr "Die model vir die TreeModelSort om te sorteer" -#: gtk/gtktreeview.c:564 +#: gtk/gtktreeview.c:566 msgid "TreeView Model" msgstr "TreeView-model" -#: gtk/gtktreeview.c:565 +#: gtk/gtktreeview.c:567 msgid "The model for the tree view" msgstr "Die model vir die boomaansig" -#: gtk/gtktreeview.c:573 +#: gtk/gtktreeview.c:575 msgid "Horizontal Adjustment for the widget" msgstr "Horisontale verstelling vir die dingesie" -#: gtk/gtktreeview.c:581 +#: gtk/gtktreeview.c:583 msgid "Vertical Adjustment for the widget" msgstr "Vertikale verstelling vir die dingesie" -#: gtk/gtktreeview.c:588 +#: gtk/gtktreeview.c:590 #, fuzzy msgid "Headers Visible" msgstr "Koppe kliekbaar" -#: gtk/gtktreeview.c:589 +#: gtk/gtktreeview.c:591 msgid "Show the column header buttons" msgstr "Vertoon die kolomkopknoppies" -#: gtk/gtktreeview.c:596 +#: gtk/gtktreeview.c:598 msgid "Headers Clickable" msgstr "Koppe kliekbaar" -#: gtk/gtktreeview.c:597 +#: gtk/gtktreeview.c:599 msgid "Column headers respond to click events" msgstr "Kolomkoppe wat op kliekgebeure reageer" -#: gtk/gtktreeview.c:604 +#: gtk/gtktreeview.c:606 msgid "Expander Column" msgstr "Uitvouerkolom" -#: gtk/gtktreeview.c:605 +#: gtk/gtktreeview.c:607 msgid "Set the column for the expander column" msgstr "Stel die kolom vir die uitvouerkolom op" -#: gtk/gtktreeview.c:620 +#: gtk/gtktreeview.c:622 msgid "Rules Hint" msgstr "Reëlsverwenking" -#: gtk/gtktreeview.c:621 +#: gtk/gtktreeview.c:623 msgid "Set a hint to the theme engine to draw rows in alternating colors" msgstr "" "Stel 'n verwenking in die tema-enjin om rye in afwisselende kleure te teken" -#: gtk/gtktreeview.c:628 +#: gtk/gtktreeview.c:630 msgid "Enable Search" msgstr "Stel soektog in werking" -#: gtk/gtktreeview.c:629 +#: gtk/gtktreeview.c:631 msgid "View allows user to search through columns interactively" msgstr "Aansig stel gebruiker in staat om interaktief deur kolomme te soek" -#: gtk/gtktreeview.c:636 +#: gtk/gtktreeview.c:638 msgid "Search Column" msgstr "Deursoek kolom" -#: gtk/gtktreeview.c:637 +#: gtk/gtktreeview.c:639 #, fuzzy msgid "Model column to search through during interactive search" msgstr "Modelkolom waardeur gesoek moet word wanneer deur kode gesoek word" -#: gtk/gtktreeview.c:657 +#: gtk/gtktreeview.c:659 msgid "Fixed Height Mode" msgstr "Vastehoogte-modus" -#: gtk/gtktreeview.c:658 +#: gtk/gtktreeview.c:660 msgid "Speeds up GtkTreeView by assuming that all rows have the same height" msgstr "Versnel GtkTreeView deur te aanvaar dat alle rye dieselfde hoogte is" -#: gtk/gtktreeview.c:678 +#: gtk/gtktreeview.c:680 msgid "Hover Selection" msgstr "" -#: gtk/gtktreeview.c:679 +#: gtk/gtktreeview.c:681 #, fuzzy msgid "Whether the selection should follow the pointer" msgstr "" "Of die kleurkieser toegelaat moet word om die ondeursigtigheid te verstel" -#: gtk/gtktreeview.c:698 +#: gtk/gtktreeview.c:700 #, fuzzy msgid "Hover Expand" msgstr "Uitvou" -#: gtk/gtktreeview.c:699 +#: gtk/gtktreeview.c:701 #, fuzzy msgid "" "Whether rows should be expanded/collapsed when the pointer moves over them" msgstr "Of die venster deur die vensterbestuurder versier moet word" -#: gtk/gtktreeview.c:713 +#: gtk/gtktreeview.c:715 #, fuzzy msgid "Show Expanders" msgstr "Is uitvouer" -#: gtk/gtktreeview.c:714 +#: gtk/gtktreeview.c:716 #, fuzzy msgid "View has expanders" msgstr "Is uitvouer" -#: gtk/gtktreeview.c:728 +#: gtk/gtktreeview.c:730 msgid "Level Indentation" msgstr "" -#: gtk/gtktreeview.c:729 +#: gtk/gtktreeview.c:731 msgid "Extra indentation for each level" msgstr "" -#: gtk/gtktreeview.c:738 +#: gtk/gtktreeview.c:740 msgid "Rubber Banding" msgstr "" -#: gtk/gtktreeview.c:739 +#: gtk/gtktreeview.c:741 #, fuzzy msgid "" "Whether to enable selection of multiple items by dragging the mouse pointer" msgstr "Of meervoudige lêers geselekteer mag word" -#: gtk/gtktreeview.c:746 +#: gtk/gtktreeview.c:748 #, fuzzy msgid "Enable Grid Lines" msgstr "Stel pyltjiesleutels in werking" -#: gtk/gtktreeview.c:747 +#: gtk/gtktreeview.c:749 #, fuzzy msgid "Whether grid lines should be drawn in the tree view" msgstr "Of die grens vertoon moet word of nie" -#: gtk/gtktreeview.c:755 +#: gtk/gtktreeview.c:757 #, fuzzy msgid "Enable Tree Lines" msgstr "Stel pyltjiesleutels in werking" -#: gtk/gtktreeview.c:756 +#: gtk/gtktreeview.c:758 #, fuzzy msgid "Whether tree lines should be drawn in the tree view" msgstr "Of die grens vertoon moet word of nie" -#: gtk/gtktreeview.c:764 +#: gtk/gtktreeview.c:766 #, fuzzy msgid "The column in the model containing the tooltip texts for the rows" msgstr "'n Kolom in die databronmodel waaruit die stringe verkry moet word" -#: gtk/gtktreeview.c:786 +#: gtk/gtktreeview.c:788 msgid "Vertical Separator Width" msgstr "Vertikaleskeier-wydte" -#: gtk/gtktreeview.c:787 +#: gtk/gtktreeview.c:789 msgid "Vertical space between cells. Must be an even number" msgstr "Vertikale ruimte tussen selle. Moet 'n ewe getal wees" -#: gtk/gtktreeview.c:795 +#: gtk/gtktreeview.c:797 msgid "Horizontal Separator Width" msgstr "Horisontaleskeier-wydte" -#: gtk/gtktreeview.c:796 +#: gtk/gtktreeview.c:798 msgid "Horizontal space between cells. Must be an even number" msgstr "Vertikale ruimte tussen selle. Moet 'n ewe getal wees" -#: gtk/gtktreeview.c:804 +#: gtk/gtktreeview.c:806 msgid "Allow Rules" msgstr "Laat reëls toe" -#: gtk/gtktreeview.c:805 +#: gtk/gtktreeview.c:807 msgid "Allow drawing of alternating color rows" msgstr "Laat teken van afwisselende kleure rye toe" -#: gtk/gtktreeview.c:811 +#: gtk/gtktreeview.c:813 msgid "Indent Expanders" msgstr "Inkeepuitvouers" -#: gtk/gtktreeview.c:812 +#: gtk/gtktreeview.c:814 msgid "Make the expanders indented" msgstr "Maak die uitvouers ingekeep" -#: gtk/gtktreeview.c:818 +#: gtk/gtktreeview.c:820 msgid "Even Row Color" msgstr "Ewegetal-ry se kleur" -#: gtk/gtktreeview.c:819 +#: gtk/gtktreeview.c:821 msgid "Color to use for even rows" msgstr "Kleur wat vir ewegetal-rye gebruik word" -#: gtk/gtktreeview.c:825 +#: gtk/gtktreeview.c:827 msgid "Odd Row Color" msgstr "Onewegetal-ry se kleur" -#: gtk/gtktreeview.c:826 +#: gtk/gtktreeview.c:828 msgid "Color to use for odd rows" msgstr "Kleur wat vir onewegetal-rye gebruik word" -#: gtk/gtktreeview.c:832 +#: gtk/gtktreeview.c:834 msgid "Row Ending details" msgstr "" -#: gtk/gtktreeview.c:833 +#: gtk/gtktreeview.c:835 msgid "Enable extended row background theming" msgstr "" -#: gtk/gtktreeview.c:839 +#: gtk/gtktreeview.c:841 #, fuzzy msgid "Grid line width" msgstr "Fokus op reëlwydte" -#: gtk/gtktreeview.c:840 +#: gtk/gtktreeview.c:842 #, fuzzy msgid "Width, in pixels, of the tree view grid lines" msgstr "Wydte in pixels van die fokusaanwyserlyn" -#: gtk/gtktreeview.c:846 +#: gtk/gtktreeview.c:848 #, fuzzy msgid "Tree line width" msgstr "Die vaste wydte" -#: gtk/gtktreeview.c:847 +#: gtk/gtktreeview.c:849 #, fuzzy msgid "Width, in pixels, of the tree view lines" msgstr "Wydte in pixels van die fokusaanwyserlyn" -#: gtk/gtktreeview.c:853 +#: gtk/gtktreeview.c:855 #, fuzzy msgid "Grid line pattern" msgstr "Fokuslyn-stippelpatroon" -#: gtk/gtktreeview.c:854 +#: gtk/gtktreeview.c:856 #, fuzzy msgid "Dash pattern used to draw the tree view grid lines" msgstr "Stippelpatroon wat gebruik moet word om die fokusaanwyser te teken" -#: gtk/gtktreeview.c:860 +#: gtk/gtktreeview.c:862 #, fuzzy msgid "Tree line pattern" msgstr "Fokuslyn-stippelpatroon" -#: gtk/gtktreeview.c:861 +#: gtk/gtktreeview.c:863 #, fuzzy msgid "Dash pattern used to draw the tree view lines" msgstr "Stippelpatroon wat gebruik moet word om die fokusaanwyser te teken" @@ -7167,7 +6970,7 @@ msgstr "Stippelpatroon wat gebruik moet word om die fokusaanwyser te teken" msgid "Whether to display the column" msgstr "Of die kolom vertoon moet word" -#: gtk/gtktreeviewcolumn.c:200 gtk/gtkwindow.c:542 +#: gtk/gtktreeviewcolumn.c:200 gtk/gtkwindow.c:566 msgid "Resizable" msgstr "Skaleerbaar" @@ -7284,7 +7087,7 @@ msgstr "Definisie van saamgesmelte UI" msgid "An XML string describing the merged UI" msgstr "'n XML-string wat die saamgesmelte UI beskryf" -#: gtk/gtkviewport.c:107 +#: gtk/gtkviewport.c:135 msgid "" "The GtkAdjustment that determines the values of the horizontal position for " "this viewport" @@ -7292,7 +7095,7 @@ msgstr "" "Die GtkAdjustment wat die waardes van die horisontale posisie vir hierdie " "aansigpunt bepaal" -#: gtk/gtkviewport.c:115 +#: gtk/gtkviewport.c:143 msgid "" "The GtkAdjustment that determines the values of the vertical position for " "this viewport" @@ -7300,31 +7103,31 @@ msgstr "" "Die GtkAdjustment wat die waardes van die vertikale posisie vir hierdie " "aansigpunt bepaal" -#: gtk/gtkviewport.c:123 +#: gtk/gtkviewport.c:151 msgid "Determines how the shadowed box around the viewport is drawn" msgstr "Bepaal hoe die gearseerde kassie rondom die aansigpunt geteken word" -#: gtk/gtkwidget.c:553 +#: gtk/gtkwidget.c:573 msgid "Widget name" msgstr "Dingesienaam" -#: gtk/gtkwidget.c:554 +#: gtk/gtkwidget.c:574 msgid "The name of the widget" msgstr "Die naam van die dingesie" -#: gtk/gtkwidget.c:560 +#: gtk/gtkwidget.c:580 msgid "Parent widget" msgstr "Ouerdingesie" -#: gtk/gtkwidget.c:561 +#: gtk/gtkwidget.c:581 msgid "The parent widget of this widget. Must be a Container widget" msgstr "Die ouerdingesie van hierdie dingesie. Moet 'n houerdingesie wees" -#: gtk/gtkwidget.c:568 +#: gtk/gtkwidget.c:588 msgid "Width request" msgstr "Wydteversoek" -#: gtk/gtkwidget.c:569 +#: gtk/gtkwidget.c:589 msgid "" "Override for width request of the widget, or -1 if natural request should be " "used" @@ -7332,11 +7135,11 @@ msgstr "" "Oorheers die wydteversoek van die dingesie, of -1 indien natuurlike versoek " "gebruik moet word" -#: gtk/gtkwidget.c:577 +#: gtk/gtkwidget.c:597 msgid "Height request" msgstr "Hoogteversoek" -#: gtk/gtkwidget.c:578 +#: gtk/gtkwidget.c:598 msgid "" "Override for height request of the widget, or -1 if natural request should " "be used" @@ -7344,85 +7147,85 @@ msgstr "" "Oorheers die hoogteversoek van die dingesie, of -1 indien natuurlike versoek " "gebruik moet word" -#: gtk/gtkwidget.c:587 +#: gtk/gtkwidget.c:607 msgid "Whether the widget is visible" msgstr "Of die dingesie sigbaar is" -#: gtk/gtkwidget.c:594 +#: gtk/gtkwidget.c:614 msgid "Whether the widget responds to input" msgstr "Of die dingesie reageer op toevoer" -#: gtk/gtkwidget.c:600 +#: gtk/gtkwidget.c:620 msgid "Application paintable" msgstr "Toepassing verfbaar" -#: gtk/gtkwidget.c:601 +#: gtk/gtkwidget.c:621 msgid "Whether the application will paint directly on the widget" msgstr "Of die toepassing direk op die dingesie sal verf" -#: gtk/gtkwidget.c:607 +#: gtk/gtkwidget.c:627 msgid "Can focus" msgstr "Kan fokus" -#: gtk/gtkwidget.c:608 +#: gtk/gtkwidget.c:628 msgid "Whether the widget can accept the input focus" msgstr "Of die dingesie die toevoerfokus kan aanvaar" -#: gtk/gtkwidget.c:614 +#: gtk/gtkwidget.c:634 msgid "Has focus" msgstr "Het fokus" -#: gtk/gtkwidget.c:615 +#: gtk/gtkwidget.c:635 msgid "Whether the widget has the input focus" msgstr "Of die dingesie die toevoerfokus het" -#: gtk/gtkwidget.c:621 +#: gtk/gtkwidget.c:641 msgid "Is focus" msgstr "Is fokus" -#: gtk/gtkwidget.c:622 +#: gtk/gtkwidget.c:642 msgid "Whether the widget is the focus widget within the toplevel" msgstr "Of die dingesie die fokusdingesie binne die bokant is" -#: gtk/gtkwidget.c:628 +#: gtk/gtkwidget.c:648 msgid "Can default" msgstr "Kan verstek wees" -#: gtk/gtkwidget.c:629 +#: gtk/gtkwidget.c:649 msgid "Whether the widget can be the default widget" msgstr "Of die dingesie die verstekdingesie kan wees" -#: gtk/gtkwidget.c:635 +#: gtk/gtkwidget.c:655 msgid "Has default" msgstr "Het verstek" -#: gtk/gtkwidget.c:636 +#: gtk/gtkwidget.c:656 msgid "Whether the widget is the default widget" msgstr "Of die dingesie die verstekdingesie is" -#: gtk/gtkwidget.c:642 +#: gtk/gtkwidget.c:662 msgid "Receives default" msgstr "Ontvang verstek" -#: gtk/gtkwidget.c:643 +#: gtk/gtkwidget.c:663 msgid "If TRUE, the widget will receive the default action when it is focused" msgstr "" "Indien WAAR sal die dingesie die verstekaksie ontvang wanneer dit gefokus " "word" -#: gtk/gtkwidget.c:649 +#: gtk/gtkwidget.c:669 msgid "Composite child" msgstr "Saamgestelde kind" -#: gtk/gtkwidget.c:650 +#: gtk/gtkwidget.c:670 msgid "Whether the widget is part of a composite widget" msgstr "Of die dingesie deel van 'n saamgestelde dingesie is" -#: gtk/gtkwidget.c:656 +#: gtk/gtkwidget.c:676 msgid "Style" msgstr "Styl" -#: gtk/gtkwidget.c:657 +#: gtk/gtkwidget.c:677 msgid "" "The style of the widget, which contains information about how it will look " "(colors etc)" @@ -7430,101 +7233,101 @@ msgstr "" "Die styl van die dingesie, waarin inligting oor hoe dit lyk (kleure ens) " "vervat is" -#: gtk/gtkwidget.c:663 +#: gtk/gtkwidget.c:683 msgid "Events" msgstr "Gebeure" -#: gtk/gtkwidget.c:664 +#: gtk/gtkwidget.c:684 msgid "The event mask that decides what kind of GdkEvents this widget gets" msgstr "" "Die gebeuremasker wat besluit watter soort GdkEvents hierdie dingesie kry" -#: gtk/gtkwidget.c:671 +#: gtk/gtkwidget.c:691 msgid "Extension events" msgstr "Uitbreidinggebeure" -#: gtk/gtkwidget.c:672 +#: gtk/gtkwidget.c:692 msgid "The mask that decides what kind of extension events this widget gets" msgstr "Die masker wat besluit watter soort uitbreiding hierdie dingesie kry" -#: gtk/gtkwidget.c:679 +#: gtk/gtkwidget.c:699 msgid "No show all" msgstr "Glad nie vertoon nie" -#: gtk/gtkwidget.c:680 +#: gtk/gtkwidget.c:700 msgid "Whether gtk_widget_show_all() should not affect this widget" msgstr "" "Of gtk_widget_show_all() nie 'n uitwerking op hierdie dingesie moet hê nie" -#: gtk/gtkwidget.c:703 +#: gtk/gtkwidget.c:723 #, fuzzy msgid "Whether this widget has a tooltip" msgstr "Of die dingesie die toevoerfokus het" -#: gtk/gtkwidget.c:759 +#: gtk/gtkwidget.c:779 #, fuzzy msgid "Window" msgstr "Venstersoort" -#: gtk/gtkwidget.c:760 +#: gtk/gtkwidget.c:780 msgid "The widget's window if it is realized" msgstr "" -#: gtk/gtkwidget.c:774 +#: gtk/gtkwidget.c:794 #, fuzzy msgid "Double Buffered" msgstr "Buffer" -#: gtk/gtkwidget.c:775 +#: gtk/gtkwidget.c:795 #, fuzzy msgid "Whether or not the widget is double buffered" msgstr "Of die aksie sigbaar is." -#: gtk/gtkwidget.c:2403 +#: gtk/gtkwidget.c:2427 msgid "Interior Focus" msgstr "Binnefokus" -#: gtk/gtkwidget.c:2404 +#: gtk/gtkwidget.c:2428 msgid "Whether to draw the focus indicator inside widgets" msgstr "Of die fokusaanwyser binne dingesies geteken moet word" -#: gtk/gtkwidget.c:2410 +#: gtk/gtkwidget.c:2434 msgid "Focus linewidth" msgstr "Fokus op reëlwydte" -#: gtk/gtkwidget.c:2411 +#: gtk/gtkwidget.c:2435 msgid "Width, in pixels, of the focus indicator line" msgstr "Wydte in pixels van die fokusaanwyserlyn" -#: gtk/gtkwidget.c:2417 +#: gtk/gtkwidget.c:2441 msgid "Focus line dash pattern" msgstr "Fokuslyn-stippelpatroon" -#: gtk/gtkwidget.c:2418 +#: gtk/gtkwidget.c:2442 msgid "Dash pattern used to draw the focus indicator" msgstr "Stippelpatroon wat gebruik moet word om die fokusaanwyser te teken" -#: gtk/gtkwidget.c:2423 +#: gtk/gtkwidget.c:2447 msgid "Focus padding" msgstr "Fokusopvulling" -#: gtk/gtkwidget.c:2424 +#: gtk/gtkwidget.c:2448 msgid "Width, in pixels, between focus indicator and the widget 'box'" msgstr "Wydte in pixels tussen fokusaanwyser en die dingesie-kassie" -#: gtk/gtkwidget.c:2429 +#: gtk/gtkwidget.c:2453 msgid "Cursor color" msgstr "Wyserkleur" -#: gtk/gtkwidget.c:2430 +#: gtk/gtkwidget.c:2454 msgid "Color with which to draw insertion cursor" msgstr "Kleure waarmee die invoegwyser geteken moet word" -#: gtk/gtkwidget.c:2435 +#: gtk/gtkwidget.c:2459 msgid "Secondary cursor color" msgstr "Sekondêrewyser-kleur" -#: gtk/gtkwidget.c:2436 +#: gtk/gtkwidget.c:2460 msgid "" "Color with which to draw the secondary insertion cursor when editing mixed " "right-to-left and left-to-right text" @@ -7532,135 +7335,135 @@ msgstr "" "Kleur waarmee die sekondêre invoegwyser geteken moet word wanneer gemengde " "regs-na-links- en links-na-regs-teks geredigeer word" -#: gtk/gtkwidget.c:2441 +#: gtk/gtkwidget.c:2465 msgid "Cursor line aspect ratio" msgstr "Wyserlyn-aspekratio" -#: gtk/gtkwidget.c:2442 +#: gtk/gtkwidget.c:2466 msgid "Aspect ratio with which to draw insertion cursor" msgstr "Aspekratio waarmee die invoegwyser geteken moet word" -#: gtk/gtkwidget.c:2456 +#: gtk/gtkwidget.c:2480 #, fuzzy msgid "Draw Border" msgstr "Oortjiegrens" -#: gtk/gtkwidget.c:2457 +#: gtk/gtkwidget.c:2481 msgid "Size of areas outside the widget's allocation to draw" msgstr "" -#: gtk/gtkwidget.c:2470 +#: gtk/gtkwidget.c:2494 #, fuzzy msgid "Unvisited Link Color" msgstr "Huidige kleur" -#: gtk/gtkwidget.c:2471 +#: gtk/gtkwidget.c:2495 #, fuzzy msgid "Color of unvisited links" msgstr "Die titel van die fontkies-dialoog" -#: gtk/gtkwidget.c:2484 +#: gtk/gtkwidget.c:2508 #, fuzzy msgid "Visited Link Color" msgstr "Huidige kleur" -#: gtk/gtkwidget.c:2485 +#: gtk/gtkwidget.c:2509 #, fuzzy msgid "Color of visited links" msgstr "Die titel van die fontkies-dialoog" -#: gtk/gtkwidget.c:2499 +#: gtk/gtkwidget.c:2523 #, fuzzy msgid "Wide Separators" msgstr "Gebruik skeier" -#: gtk/gtkwidget.c:2500 +#: gtk/gtkwidget.c:2524 msgid "" "Whether separators have configurable width and should be drawn using a box " "instead of a line" msgstr "" -#: gtk/gtkwidget.c:2514 +#: gtk/gtkwidget.c:2538 #, fuzzy msgid "Separator Width" msgstr "Vertikaleskeier-wydte" -#: gtk/gtkwidget.c:2515 +#: gtk/gtkwidget.c:2539 msgid "The width of separators if wide-separators is TRUE" msgstr "" -#: gtk/gtkwidget.c:2529 +#: gtk/gtkwidget.c:2553 #, fuzzy msgid "Separator Height" msgstr "Verstekhoogte" -#: gtk/gtkwidget.c:2530 +#: gtk/gtkwidget.c:2554 msgid "The height of separators if \"wide-separators\" is TRUE" msgstr "" -#: gtk/gtkwidget.c:2544 +#: gtk/gtkwidget.c:2568 #, fuzzy msgid "Horizontal Scroll Arrow Length" msgstr "Horisontalerolstaaf-beleid" -#: gtk/gtkwidget.c:2545 +#: gtk/gtkwidget.c:2569 #, fuzzy msgid "The length of horizontal scroll arrows" msgstr "Wanneer die horisontale rolstaaf vertoon word" -#: gtk/gtkwidget.c:2559 +#: gtk/gtkwidget.c:2583 #, fuzzy msgid "Vertical Scroll Arrow Length" msgstr "Vertikalerolstaaf-beleid" -#: gtk/gtkwidget.c:2560 +#: gtk/gtkwidget.c:2584 #, fuzzy msgid "The length of vertical scroll arrows" msgstr "Wanneer die vertikale rolstaaf vertoon word" -#: gtk/gtkwindow.c:483 +#: gtk/gtkwindow.c:507 msgid "Window Type" msgstr "Venstersoort" -#: gtk/gtkwindow.c:484 +#: gtk/gtkwindow.c:508 msgid "The type of the window" msgstr "Die soort venster" -#: gtk/gtkwindow.c:492 +#: gtk/gtkwindow.c:516 msgid "Window Title" msgstr "Venstertitel" -#: gtk/gtkwindow.c:493 +#: gtk/gtkwindow.c:517 msgid "The title of the window" msgstr "Die titel van die venster" -#: gtk/gtkwindow.c:500 +#: gtk/gtkwindow.c:524 msgid "Window Role" msgstr "Vensterrol" -#: gtk/gtkwindow.c:501 +#: gtk/gtkwindow.c:525 msgid "Unique identifier for the window to be used when restoring a session" msgstr "" "Unieke identifiseerder vir die venster wat gebruik moet word wanneer 'n " "sessie herstel word" -#: gtk/gtkwindow.c:517 +#: gtk/gtkwindow.c:541 #, fuzzy msgid "Startup ID" msgstr "Groep" -#: gtk/gtkwindow.c:518 +#: gtk/gtkwindow.c:542 #, fuzzy msgid "Unique startup identifier for the window used by startup-notification" msgstr "" "Unieke identifiseerder vir die venster wat gebruik moet word wanneer 'n " "sessie herstel word" -#: gtk/gtkwindow.c:525 +#: gtk/gtkwindow.c:549 msgid "Allow Shrink" msgstr "Laat verklein toe" -#: gtk/gtkwindow.c:527 +#: gtk/gtkwindow.c:551 #, no-c-format msgid "" "If TRUE, the window has no mimimum size. Setting this to TRUE is 99% of the " @@ -7669,24 +7472,24 @@ msgstr "" "Indien WAAR het die venster geen minimum grootte nie Om dié waarde op WAAR " "te stel is 99% van die tyd 'n slegte idee" -#: gtk/gtkwindow.c:534 +#: gtk/gtkwindow.c:558 msgid "Allow Grow" msgstr "Laat vergroot toe" -#: gtk/gtkwindow.c:535 +#: gtk/gtkwindow.c:559 msgid "If TRUE, users can expand the window beyond its minimum size" msgstr "" "Indien WAAR kan gebruikers die venster buite die minimum grootte vergroot" -#: gtk/gtkwindow.c:543 +#: gtk/gtkwindow.c:567 msgid "If TRUE, users can resize the window" msgstr "Indien WAAR kan gebruikers die venster skaleer" -#: gtk/gtkwindow.c:550 +#: gtk/gtkwindow.c:574 msgid "Modal" msgstr "Modaal" -#: gtk/gtkwindow.c:551 +#: gtk/gtkwindow.c:575 msgid "" "If TRUE, the window is modal (other windows are not usable while this one is " "up)" @@ -7694,83 +7497,83 @@ msgstr "" "Indien WAAR is die venster modaal (ander vensters is nie bruikbaar terwyl " "hierdie een op is nie)" -#: gtk/gtkwindow.c:558 +#: gtk/gtkwindow.c:582 msgid "Window Position" msgstr "Vensterposisie" -#: gtk/gtkwindow.c:559 +#: gtk/gtkwindow.c:583 msgid "The initial position of the window" msgstr "Die aanvanklike posisie van die venster" -#: gtk/gtkwindow.c:567 +#: gtk/gtkwindow.c:591 msgid "Default Width" msgstr "Verstekwydte" -#: gtk/gtkwindow.c:568 +#: gtk/gtkwindow.c:592 msgid "The default width of the window, used when initially showing the window" msgstr "" "Die verstekwydte van die venster, gebruik wanneer die venster aanvanklik " "vertoon word" -#: gtk/gtkwindow.c:577 +#: gtk/gtkwindow.c:601 msgid "Default Height" msgstr "Verstekhoogte" -#: gtk/gtkwindow.c:578 +#: gtk/gtkwindow.c:602 msgid "" "The default height of the window, used when initially showing the window" msgstr "" "Die verstekhoogte van die venster, gebruik wanneer die venster aanvanklik " "vertoon word" -#: gtk/gtkwindow.c:587 +#: gtk/gtkwindow.c:611 msgid "Destroy with Parent" msgstr "Vernietig met ouer" -#: gtk/gtkwindow.c:588 +#: gtk/gtkwindow.c:612 msgid "If this window should be destroyed when the parent is destroyed" msgstr "Of hierdie venster vernietig moet word wanneer die ouer vernietig word" -#: gtk/gtkwindow.c:596 +#: gtk/gtkwindow.c:620 msgid "Icon for this window" msgstr "Ikon vir die venster" -#: gtk/gtkwindow.c:602 +#: gtk/gtkwindow.c:626 #, fuzzy msgid "Mnemonics Visible" msgstr "Mnemoniese sleutel" -#: gtk/gtkwindow.c:603 +#: gtk/gtkwindow.c:627 #, fuzzy msgid "Whether mnemonics are currently visible in this window" msgstr "Of die bokant die huidige aktiewe venster is" -#: gtk/gtkwindow.c:619 +#: gtk/gtkwindow.c:643 #, fuzzy msgid "Name of the themed icon for this window" msgstr "Ikon vir die venster" -#: gtk/gtkwindow.c:634 +#: gtk/gtkwindow.c:658 msgid "Is Active" msgstr "Is aktief" -#: gtk/gtkwindow.c:635 +#: gtk/gtkwindow.c:659 msgid "Whether the toplevel is the current active window" msgstr "Of die bokant die huidige aktiewe venster is" -#: gtk/gtkwindow.c:642 +#: gtk/gtkwindow.c:666 msgid "Focus in Toplevel" msgstr "Fokus in bokant" -#: gtk/gtkwindow.c:643 +#: gtk/gtkwindow.c:667 msgid "Whether the input focus is within this GtkWindow" msgstr "Of die toevoerfokus binne hierdie GtkWindow is" -#: gtk/gtkwindow.c:650 +#: gtk/gtkwindow.c:674 msgid "Type hint" msgstr "Soort wenk" -#: gtk/gtkwindow.c:651 +#: gtk/gtkwindow.c:675 msgid "" "Hint to help the desktop environment understand what kind of window this is " "and how to treat it." @@ -7778,89 +7581,89 @@ msgstr "" "Wenk om die werkskermomgewing te laat begryp watter soort venster dit is en " "hoe om dit te hanteer." -#: gtk/gtkwindow.c:659 +#: gtk/gtkwindow.c:683 msgid "Skip taskbar" msgstr "Slaan taakbalk oor" -#: gtk/gtkwindow.c:660 +#: gtk/gtkwindow.c:684 msgid "TRUE if the window should not be in the task bar." msgstr "WAAR indien die venster nie in die taakbalk moet wees nie." -#: gtk/gtkwindow.c:667 +#: gtk/gtkwindow.c:691 msgid "Skip pager" msgstr "Slaan roeper oor" -#: gtk/gtkwindow.c:668 +#: gtk/gtkwindow.c:692 msgid "TRUE if the window should not be in the pager." msgstr "WAAR indien die venster nie in die roeper moet wees nie." -#: gtk/gtkwindow.c:675 +#: gtk/gtkwindow.c:699 msgid "Urgent" msgstr "" -#: gtk/gtkwindow.c:676 +#: gtk/gtkwindow.c:700 #, fuzzy msgid "TRUE if the window should be brought to the user's attention." msgstr "WAAR indien die venster nie in die roeper moet wees nie." -#: gtk/gtkwindow.c:690 +#: gtk/gtkwindow.c:714 msgid "Accept focus" msgstr "Aanvaar fokus" -#: gtk/gtkwindow.c:691 +#: gtk/gtkwindow.c:715 msgid "TRUE if the window should receive the input focus." msgstr "WAAR indien die venster die toevoerfokus moet ontvang." -#: gtk/gtkwindow.c:705 +#: gtk/gtkwindow.c:729 #, fuzzy msgid "Focus on map" msgstr "Fokus op kliek" -#: gtk/gtkwindow.c:706 +#: gtk/gtkwindow.c:730 #, fuzzy msgid "TRUE if the window should receive the input focus when mapped." msgstr "WAAR indien die venster die toevoerfokus moet ontvang." -#: gtk/gtkwindow.c:720 +#: gtk/gtkwindow.c:744 msgid "Decorated" msgstr "Versier" -#: gtk/gtkwindow.c:721 +#: gtk/gtkwindow.c:745 msgid "Whether the window should be decorated by the window manager" msgstr "Of die venster deur die vensterbestuurder versier moet word" -#: gtk/gtkwindow.c:735 +#: gtk/gtkwindow.c:759 #, fuzzy msgid "Deletable" msgstr "Kiesbaar" -#: gtk/gtkwindow.c:736 +#: gtk/gtkwindow.c:760 #, fuzzy msgid "Whether the window frame should have a close button" msgstr "Of die venster deur die vensterbestuurder versier moet word" -#: gtk/gtkwindow.c:752 +#: gtk/gtkwindow.c:776 msgid "Gravity" msgstr "Gravitasie" -#: gtk/gtkwindow.c:753 +#: gtk/gtkwindow.c:777 msgid "The window gravity of the window" msgstr "Die venstergravitasie van die venster" -#: gtk/gtkwindow.c:770 +#: gtk/gtkwindow.c:794 msgid "Transient for Window" msgstr "" -#: gtk/gtkwindow.c:771 +#: gtk/gtkwindow.c:795 #, fuzzy msgid "The transient parent of the dialog" msgstr "Die knoppies wat in die boodskapdialoog vertoon word" -#: gtk/gtkwindow.c:786 +#: gtk/gtkwindow.c:810 msgid "Opacity for Window" msgstr "" -#: gtk/gtkwindow.c:787 +#: gtk/gtkwindow.c:811 #, fuzzy msgid "The opacity of the window, from 0 to 1" msgstr "Die soort venster" @@ -7881,6 +7684,189 @@ msgstr "IM Status-styl" msgid "How to draw the input method statusbar" msgstr "Hoe om die toevoermetode-statusbalk te teken" +#~ msgid "Enable arrow keys" +#~ msgstr "Stel pyltjiesleutels in werking" + +#~ msgid "Whether the arrow keys move through the list of items" +#~ msgstr "Of die pyltjiesleutels deur die lys items beweeg" + +#~ msgid "Always enable arrows" +#~ msgstr "Stel altyd pyltjies in werking" + +#~ msgid "Obsolete property, ignored" +#~ msgstr "Oortollige eienskap, geïgnoreer" + +#~ msgid "Case sensitive" +#~ msgstr "Kassensitief" + +#~ msgid "Whether list item matching is case sensitive" +#~ msgstr "Of die lysitem-passing kassensitief is" + +#~ msgid "Allow empty" +#~ msgstr "Laat leë toe" + +#~ msgid "Whether an empty value may be entered in this field" +#~ msgstr "Of 'n leë waarde in hierdie veld ingetik mag word" + +#~ msgid "Value in list" +#~ msgstr "Waarde in lys" + +#~ msgid "Whether entered values must already be present in the list" +#~ msgstr "Of ingetikte waardes reeds in die lys teenwoordig moet wees" + +#~ msgid "Curve type" +#~ msgstr "Kurwesoort" + +#~ msgid "Is this curve linear, spline interpolated, or free-form" +#~ msgstr "Is hierdie kurwe lineêr, glyspygeïnterpoleer of in vryformaat" + +#~ msgid "Minimum X" +#~ msgstr "minimum x" + +#~ msgid "Minimum possible value for X" +#~ msgstr "minimum moontlike waarde vir x" + +#~ msgid "Maximum X" +#~ msgstr "maksimum x" + +#~ msgid "Maximum possible X value" +#~ msgstr "maksimum moontlike waarde vir x" + +#~ msgid "Minimum Y" +#~ msgstr "minimum y" + +#~ msgid "Minimum possible value for Y" +#~ msgstr "minimum moontlike waarde vir y" + +#~ msgid "Maximum Y" +#~ msgstr "maksimum y" + +#~ msgid "Maximum possible value for Y" +#~ msgstr "maksimum moontlike waarde vir y" + +#~ msgid "File System Backend" +#~ msgstr "Lêerstelsel-agterkant" + +#~ msgid "Name of file system backend to use" +#~ msgstr "Naam van die lêerstelsel-rugstelsel om te gebruik" + +#~ msgid "The currently selected filename" +#~ msgstr "Die huidig geselekteerde lêernaam" + +#~ msgid "Show file operations" +#~ msgstr "Vertoon lêeroperasies" + +#~ msgid "Whether buttons for creating/manipulating files should be displayed" +#~ msgstr "Of die knoppies vir die skep/manipuleer van lêers vertoon moet word" + +#~ msgid "Tab Border" +#~ msgstr "Oortjiegrens" + +#~ msgid "Width of the border around the tab labels" +#~ msgstr "Wydte van grens rondom die oortjie-etikette" + +#~ msgid "Horizontal Tab Border" +#~ msgstr "Horisontale oortjiegrens" + +#~ msgid "Width of the horizontal border of tab labels" +#~ msgstr "Wydte van horisontale grens van die oortjie-etikette" + +#~ msgid "Vertical Tab Border" +#~ msgstr "Vertikale oortjiegrens" + +#~ msgid "Width of the vertical border of tab labels" +#~ msgstr "Wydte van vertikale grens van die oortjie-etikette" + +#~ msgid "Whether tabs should have homogeneous sizes" +#~ msgstr "Of oortjies eenvormige groottes moet hê" + +#, fuzzy +#~ msgid "Group ID" +#~ msgstr "Groep" + +#, fuzzy +#~ msgid "User Data" +#~ msgstr "Gebruik alfa" + +#~ msgid "The menu of options" +#~ msgstr "Die kieslys met opsies" + +#~ msgid "Size of dropdown indicator" +#~ msgstr "Grootte van aftuimelwyser" + +#~ msgid "Spacing around indicator" +#~ msgstr "Spasiëring rondom aanduier" + +#~ msgid "" +#~ "Whether the preview widget should take up the entire space it is allocated" +#~ msgstr "" +#~ "Of die voorskoudingesie die volledige toegewyste ruimte in beslag moet " +#~ "neem" + +#~ msgid "The GtkAdjustment connected to the progress bar (Deprecated)" +#~ msgstr "" +#~ "Die GtkAdjustment wat met die vorderingstaaf gekoppel word (afgekeur)" + +#~ msgid "Bar style" +#~ msgstr "Staafstyl" + +#~ msgid "" +#~ "Specifies the visual style of the bar in percentage mode (Deprecated)" +#~ msgstr "" +#~ "Spesifiseer die visuele styl van die staaf in persentasiemodus (afgekeur)" + +#~ msgid "Activity Step" +#~ msgstr "Aktiwiteitstap" + +#~ msgid "The increment used for each iteration in activity mode (Deprecated)" +#~ msgstr "Die inkrement van elke iterasie in aktiwiteitsmodus (afgekeur)" + +#~ msgid "Activity Blocks" +#~ msgstr "Aktiwiteitsblokke" + +#~ msgid "" +#~ "The number of blocks which can fit in the progress bar area in activity " +#~ "mode (Deprecated)" +#~ msgstr "" +#~ "Die getal blokke wat in aktiwiteitsmodus in die vorderingstaafruimte kan " +#~ "pas (afgekeur)" + +#~ msgid "Discrete Blocks" +#~ msgstr "Diskrete blokke" + +#~ msgid "" +#~ "The number of discrete blocks in a progress bar (when shown in the " +#~ "discrete style)" +#~ msgstr "" +#~ "Die getal diskrete blokke in 'n vorderingstaaf (wanneer in diskrete styl " +#~ "vertoon word)" + +#~ msgid "Horizontal adjustment for the text widget" +#~ msgstr "Horisontale verstelling vir die teksdingesie" + +#~ msgid "Vertical adjustment for the text widget" +#~ msgstr "Vertikale verstelling vir die teksdingesie" + +#~ msgid "Line Wrap" +#~ msgstr "Reëlvou" + +#~ msgid "Whether lines are wrapped at widget edges" +#~ msgstr "Of die reëls by die dingesie se rante gevou word" + +#~ msgid "Word Wrap" +#~ msgstr "Woordvou" + +#~ msgid "Whether words are wrapped at widget edges" +#~ msgstr "Of die woorde by die dingesie se rante gevou word" + +#, fuzzy +#~ msgid "Tooltips" +#~ msgstr "Nutswenk" + +#, fuzzy +#~ msgid "If the tooltips of the toolbar should be active or not" +#~ msgstr "Of die swikknoppie gedruk moet word of nie" + #~ msgid "The orientation of the toolbar" #~ msgstr "Die oriëntering van die nutsbalk" diff --git a/po-properties/am.po b/po-properties/am.po index 81343aec40..daad731820 100644 --- a/po-properties/am.po +++ b/po-properties/am.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: gtk+ 2.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-03-22 23:35-0400\n" +"POT-Creation-Date: 2010-05-25 20:10-0400\n" "PO-Revision-Date: 2003-01-14 11:02+EDT\n" "Last-Translator: Ge'ez Frontier Foundation \n" "Language-Team: Amharic \n" @@ -57,7 +57,7 @@ msgstr "" msgid "The number of bits per sample" msgstr "" -#: gdk-pixbuf/gdk-pixbuf.c:132 gtk/gtklayout.c:633 gtk/gtktreeviewcolumn.c:208 +#: gdk-pixbuf/gdk-pixbuf.c:132 gtk/gtklayout.c:597 gtk/gtktreeviewcolumn.c:208 msgid "Width" msgstr "ስፋት" @@ -65,7 +65,7 @@ msgstr "ስፋት" msgid "The number of columns of the pixbuf" msgstr "" -#: gdk-pixbuf/gdk-pixbuf.c:142 gtk/gtklayout.c:642 +#: gdk-pixbuf/gdk-pixbuf.c:142 gtk/gtklayout.c:606 msgid "Height" msgstr "እርዝማኔ" @@ -100,7 +100,7 @@ msgid "The default display for GDK" msgstr "" #: gdk/gdkpango.c:538 gtk/gtkinvisible.c:86 gtk/gtkmountoperation.c:176 -#: gtk/gtkstatusicon.c:280 gtk/gtkwindow.c:626 +#: gtk/gtkstatusicon.c:285 gtk/gtkwindow.c:650 msgid "Screen" msgstr "እስክሪን" @@ -124,7 +124,7 @@ msgstr "" msgid "The resolution for fonts on the screen" msgstr "" -#: gdk/gdkwindow.c:496 gdk/gdkwindow.c:497 +#: gdk/gdkwindow.c:565 gdk/gdkwindow.c:566 #, fuzzy msgid "Cursor" msgstr "የመጠቆሚያዋ አበራርና አጠፋፍ" @@ -243,172 +243,172 @@ msgstr "" msgid "Whether to wrap the license text." msgstr "" -#: gtk/gtkaccellabel.c:178 +#: gtk/gtkaccellabel.c:189 msgid "Accelerator Closure" msgstr "" -#: gtk/gtkaccellabel.c:179 +#: gtk/gtkaccellabel.c:190 msgid "The closure to be monitored for accelerator changes" msgstr "" -#: gtk/gtkaccellabel.c:185 +#: gtk/gtkaccellabel.c:196 msgid "Accelerator Widget" msgstr "" -#: gtk/gtkaccellabel.c:186 +#: gtk/gtkaccellabel.c:197 msgid "The widget to be monitored for accelerator changes" msgstr "" -#: gtk/gtkaction.c:181 gtk/gtkactiongroup.c:170 gtk/gtkprinter.c:111 +#: gtk/gtkaction.c:220 gtk/gtkactiongroup.c:170 gtk/gtkprinter.c:130 #: gtk/gtktextmark.c:89 #, fuzzy msgid "Name" msgstr "የፊደሉ ቅርጽ ስም" -#: gtk/gtkaction.c:182 +#: gtk/gtkaction.c:221 msgid "A unique name for the action." msgstr "" -#: gtk/gtkaction.c:200 gtk/gtkbutton.c:219 gtk/gtkexpander.c:195 -#: gtk/gtkframe.c:105 gtk/gtklabel.c:506 gtk/gtkmenuitem.c:305 -#: gtk/gtktoolbutton.c:204 gtk/gtktoolitemgroup.c:1535 +#: gtk/gtkaction.c:239 gtk/gtkbutton.c:227 gtk/gtkexpander.c:195 +#: gtk/gtkframe.c:114 gtk/gtklabel.c:528 gtk/gtkmenuitem.c:305 +#: gtk/gtktoolbutton.c:204 gtk/gtktoolitemgroup.c:1543 msgid "Label" msgstr "መለያ" -#: gtk/gtkaction.c:201 +#: gtk/gtkaction.c:240 msgid "The label used for menu items and buttons that activate this action." msgstr "" -#: gtk/gtkaction.c:217 +#: gtk/gtkaction.c:256 #, fuzzy msgid "Short label" msgstr "ማስረጊያዎች አሳይ" -#: gtk/gtkaction.c:218 +#: gtk/gtkaction.c:257 msgid "A shorter label that may be used on toolbar buttons." msgstr "" -#: gtk/gtkaction.c:226 +#: gtk/gtkaction.c:265 msgid "Tooltip" msgstr "" -#: gtk/gtkaction.c:227 +#: gtk/gtkaction.c:266 msgid "A tooltip for this action." msgstr "" -#: gtk/gtkaction.c:242 +#: gtk/gtkaction.c:281 msgid "Stock Icon" msgstr "" -#: gtk/gtkaction.c:243 +#: gtk/gtkaction.c:282 msgid "The stock icon displayed in widgets representing this action." msgstr "" -#: gtk/gtkaction.c:263 gtk/gtkstatusicon.c:253 +#: gtk/gtkaction.c:302 gtk/gtkstatusicon.c:258 #, fuzzy msgid "GIcon" msgstr "ምልክት" -#: gtk/gtkaction.c:264 gtk/gtkcellrendererpixbuf.c:206 gtk/gtkimage.c:339 -#: gtk/gtkstatusicon.c:254 +#: gtk/gtkaction.c:303 gtk/gtkcellrendererpixbuf.c:206 gtk/gtkimage.c:344 +#: gtk/gtkstatusicon.c:259 msgid "The GIcon being displayed" msgstr "" -#: gtk/gtkaction.c:284 gtk/gtkcellrendererpixbuf.c:171 gtk/gtkimage.c:321 -#: gtk/gtkprinter.c:160 gtk/gtkstatusicon.c:237 gtk/gtkwindow.c:618 +#: gtk/gtkaction.c:323 gtk/gtkcellrendererpixbuf.c:171 gtk/gtkimage.c:326 +#: gtk/gtkprinter.c:179 gtk/gtkstatusicon.c:242 gtk/gtkwindow.c:642 #, fuzzy msgid "Icon Name" msgstr "የፊደሉ ቅርጽ ስም" -#: gtk/gtkaction.c:285 gtk/gtkcellrendererpixbuf.c:172 gtk/gtkimage.c:322 -#: gtk/gtkstatusicon.c:238 +#: gtk/gtkaction.c:324 gtk/gtkcellrendererpixbuf.c:172 gtk/gtkimage.c:327 +#: gtk/gtkstatusicon.c:243 #, fuzzy msgid "The name of the icon from the icon theme" msgstr "የጽሑፉ መለያ" -#: gtk/gtkaction.c:292 gtk/gtktoolitem.c:192 +#: gtk/gtkaction.c:331 gtk/gtktoolitem.c:185 msgid "Visible when horizontal" msgstr "" -#: gtk/gtkaction.c:293 gtk/gtktoolitem.c:193 +#: gtk/gtkaction.c:332 gtk/gtktoolitem.c:186 msgid "" "Whether the toolbar item is visible when the toolbar is in a horizontal " "orientation." msgstr "" -#: gtk/gtkaction.c:308 +#: gtk/gtkaction.c:347 #, fuzzy msgid "Visible when overflown" msgstr "የሚታይ" -#: gtk/gtkaction.c:309 +#: gtk/gtkaction.c:348 msgid "" "When TRUE, toolitem proxies for this action are represented in the toolbar " "overflow menu." msgstr "" -#: gtk/gtkaction.c:316 gtk/gtktoolitem.c:199 +#: gtk/gtkaction.c:355 gtk/gtktoolitem.c:192 msgid "Visible when vertical" msgstr "" -#: gtk/gtkaction.c:317 gtk/gtktoolitem.c:200 +#: gtk/gtkaction.c:356 gtk/gtktoolitem.c:193 msgid "" "Whether the toolbar item is visible when the toolbar is in a vertical " "orientation." msgstr "" -#: gtk/gtkaction.c:324 gtk/gtktoolitem.c:206 +#: gtk/gtkaction.c:363 gtk/gtktoolitem.c:199 msgid "Is important" msgstr "" -#: gtk/gtkaction.c:325 +#: gtk/gtkaction.c:364 msgid "" "Whether the action is considered important. When TRUE, toolitem proxies for " "this action show text in GTK_TOOLBAR_BOTH_HORIZ mode." msgstr "" -#: gtk/gtkaction.c:333 +#: gtk/gtkaction.c:372 msgid "Hide if empty" msgstr "" -#: gtk/gtkaction.c:334 +#: gtk/gtkaction.c:373 msgid "When TRUE, empty menu proxies for this action are hidden." msgstr "" -#: gtk/gtkaction.c:340 gtk/gtkactiongroup.c:177 gtk/gtkcellrenderer.c:193 -#: gtk/gtkwidget.c:593 +#: gtk/gtkaction.c:379 gtk/gtkactiongroup.c:177 gtk/gtkcellrenderer.c:193 +#: gtk/gtkwidget.c:613 msgid "Sensitive" msgstr "" -#: gtk/gtkaction.c:341 +#: gtk/gtkaction.c:380 msgid "Whether the action is enabled." msgstr "" -#: gtk/gtkaction.c:347 gtk/gtkactiongroup.c:184 gtk/gtkstatusicon.c:296 -#: gtk/gtktreeviewcolumn.c:192 gtk/gtkwidget.c:586 +#: gtk/gtkaction.c:386 gtk/gtkactiongroup.c:184 gtk/gtkstatusicon.c:301 +#: gtk/gtktreeviewcolumn.c:192 gtk/gtkwidget.c:606 msgid "Visible" msgstr "የሚታይ" -#: gtk/gtkaction.c:348 +#: gtk/gtkaction.c:387 msgid "Whether the action is visible." msgstr "" -#: gtk/gtkaction.c:354 +#: gtk/gtkaction.c:393 #, fuzzy msgid "Action Group" msgstr "ምልክት" -#: gtk/gtkaction.c:355 +#: gtk/gtkaction.c:394 msgid "" "The GtkActionGroup this GtkAction is associated with, or NULL (for internal " "use)." msgstr "" -#: gtk/gtkaction.c:373 gtk/gtkimagemenuitem.c:169 +#: gtk/gtkaction.c:412 gtk/gtkimagemenuitem.c:169 msgid "Always show image" msgstr "" -#: gtk/gtkaction.c:374 gtk/gtkimagemenuitem.c:170 +#: gtk/gtkaction.c:413 gtk/gtkimagemenuitem.c:170 msgid "Whether the image will always be shown" msgstr "" @@ -442,7 +442,7 @@ msgid "Whether to use the related actions appearance properties" msgstr "" #: gtk/gtkadjustment.c:93 gtk/gtkcellrendererprogress.c:128 -#: gtk/gtkscalebutton.c:206 gtk/gtkspinbutton.c:269 +#: gtk/gtkscalebutton.c:222 gtk/gtkspinbutton.c:269 msgid "Value" msgstr "ዕሴት" @@ -500,468 +500,467 @@ msgstr "መጠን" msgid "The page size of the adjustment" msgstr "የጽሑፉ መለያ" -#: gtk/gtkalignment.c:90 +#: gtk/gtkalignment.c:117 msgid "Horizontal alignment" msgstr "የአግድም ኩልኩል" -#: gtk/gtkalignment.c:91 gtk/gtkbutton.c:270 +#: gtk/gtkalignment.c:118 gtk/gtkbutton.c:278 msgid "" "Horizontal position of child in available space. 0.0 is left aligned, 1.0 is " "right aligned" msgstr "" -#: gtk/gtkalignment.c:100 +#: gtk/gtkalignment.c:127 msgid "Vertical alignment" msgstr "የቁመት ኩልኩል" -#: gtk/gtkalignment.c:101 gtk/gtkbutton.c:289 +#: gtk/gtkalignment.c:128 gtk/gtkbutton.c:297 msgid "" "Vertical position of child in available space. 0.0 is top aligned, 1.0 is " "bottom aligned" msgstr "" -#: gtk/gtkalignment.c:109 +#: gtk/gtkalignment.c:136 msgid "Horizontal scale" msgstr "" -#: gtk/gtkalignment.c:110 +#: gtk/gtkalignment.c:137 msgid "" "If available horizontal space is bigger than needed for the child, how much " "of it to use for the child. 0.0 means none, 1.0 means all" msgstr "" -#: gtk/gtkalignment.c:118 +#: gtk/gtkalignment.c:145 msgid "Vertical scale" msgstr "" -#: gtk/gtkalignment.c:119 +#: gtk/gtkalignment.c:146 msgid "" "If available vertical space is bigger than needed for the child, how much of " "it to use for the child. 0.0 means none, 1.0 means all" msgstr "" -#: gtk/gtkalignment.c:136 +#: gtk/gtkalignment.c:163 msgid "Top Padding" msgstr "" -#: gtk/gtkalignment.c:137 +#: gtk/gtkalignment.c:164 msgid "The padding to insert at the top of the widget." msgstr "" -#: gtk/gtkalignment.c:153 +#: gtk/gtkalignment.c:180 msgid "Bottom Padding" msgstr "" -#: gtk/gtkalignment.c:154 +#: gtk/gtkalignment.c:181 msgid "The padding to insert at the bottom of the widget." msgstr "" -#: gtk/gtkalignment.c:170 +#: gtk/gtkalignment.c:197 #, fuzzy msgid "Left Padding" msgstr "የግራ ህዳግ" -#: gtk/gtkalignment.c:171 +#: gtk/gtkalignment.c:198 msgid "The padding to insert at the left of the widget." msgstr "" -#: gtk/gtkalignment.c:187 +#: gtk/gtkalignment.c:214 #, fuzzy msgid "Right Padding" msgstr "የቀኝ ህዳግ" -#: gtk/gtkalignment.c:188 +#: gtk/gtkalignment.c:215 msgid "The padding to insert at the right of the widget." msgstr "" -#: gtk/gtkarrow.c:75 +#: gtk/gtkarrow.c:95 msgid "Arrow direction" msgstr "" -#: gtk/gtkarrow.c:76 +#: gtk/gtkarrow.c:96 msgid "The direction the arrow should point" msgstr "" -#: gtk/gtkarrow.c:84 +#: gtk/gtkarrow.c:104 msgid "Arrow shadow" msgstr "" -#: gtk/gtkarrow.c:85 +#: gtk/gtkarrow.c:105 msgid "Appearance of the shadow surrounding the arrow" msgstr "" -#: gtk/gtkarrow.c:92 gtk/gtkmenu.c:711 gtk/gtkmenuitem.c:368 +#: gtk/gtkarrow.c:112 gtk/gtkmenu.c:718 gtk/gtkmenuitem.c:368 #, fuzzy msgid "Arrow Scaling" msgstr "ክፍተት" -#: gtk/gtkarrow.c:93 +#: gtk/gtkarrow.c:113 msgid "Amount of space used up by arrow" msgstr "" -#: gtk/gtkaspectframe.c:79 +#: gtk/gtkaspectframe.c:93 msgid "Horizontal Alignment" msgstr "የአግድም ኩልኩል" -#: gtk/gtkaspectframe.c:80 +#: gtk/gtkaspectframe.c:94 msgid "X alignment of the child" msgstr "" -#: gtk/gtkaspectframe.c:86 +#: gtk/gtkaspectframe.c:100 msgid "Vertical Alignment" msgstr "የቁመት ኩልኩል" -#: gtk/gtkaspectframe.c:87 +#: gtk/gtkaspectframe.c:101 msgid "Y alignment of the child" msgstr "" -#: gtk/gtkaspectframe.c:93 +#: gtk/gtkaspectframe.c:107 msgid "Ratio" msgstr "" -#: gtk/gtkaspectframe.c:94 +#: gtk/gtkaspectframe.c:108 msgid "Aspect ratio if obey_child is FALSE" msgstr "" -#: gtk/gtkaspectframe.c:100 +#: gtk/gtkaspectframe.c:114 msgid "Obey child" msgstr "" -#: gtk/gtkaspectframe.c:101 +#: gtk/gtkaspectframe.c:115 msgid "Force aspect ratio to match that of the frame's child" msgstr "" -#: gtk/gtkassistant.c:284 +#: gtk/gtkassistant.c:306 #, fuzzy msgid "Header Padding" msgstr "የግራ ህዳግ" -#: gtk/gtkassistant.c:285 +#: gtk/gtkassistant.c:307 #, fuzzy msgid "Number of pixels around the header." msgstr "የጽሑፉ መለያ" -#: gtk/gtkassistant.c:292 +#: gtk/gtkassistant.c:314 #, fuzzy msgid "Content Padding" msgstr "የግራ ህዳግ" -#: gtk/gtkassistant.c:293 +#: gtk/gtkassistant.c:315 #, fuzzy msgid "Number of pixels around the content pages." msgstr "የጽሑፉ መለያ" -#: gtk/gtkassistant.c:309 +#: gtk/gtkassistant.c:331 #, fuzzy msgid "Page type" msgstr "መጠን" -#: gtk/gtkassistant.c:310 +#: gtk/gtkassistant.c:332 #, fuzzy msgid "The type of the assistant page" msgstr "የመስኮቱ ዓይነት" -#: gtk/gtkassistant.c:327 +#: gtk/gtkassistant.c:349 #, fuzzy msgid "Page title" msgstr "መጠን" -#: gtk/gtkassistant.c:328 +#: gtk/gtkassistant.c:350 #, fuzzy msgid "The title of the assistant page" msgstr "የመስኮቱ አርእስት" -#: gtk/gtkassistant.c:344 +#: gtk/gtkassistant.c:366 #, fuzzy msgid "Header image" msgstr "የጭብጥ ስም" -#: gtk/gtkassistant.c:345 +#: gtk/gtkassistant.c:367 msgid "Header image for the assistant page" msgstr "" -#: gtk/gtkassistant.c:361 +#: gtk/gtkassistant.c:383 #, fuzzy msgid "Sidebar image" msgstr "የጭብጥ ስም" -#: gtk/gtkassistant.c:362 +#: gtk/gtkassistant.c:384 msgid "Sidebar image for the assistant page" msgstr "" -#: gtk/gtkassistant.c:377 +#: gtk/gtkassistant.c:399 #, fuzzy msgid "Page complete" msgstr "መጠን" -#: gtk/gtkassistant.c:378 +#: gtk/gtkassistant.c:400 msgid "Whether all required fields on the page have been filled out" msgstr "" -#: gtk/gtkbbox.c:101 +#: gtk/gtkbbox.c:129 msgid "Minimum child width" msgstr "" -#: gtk/gtkbbox.c:102 +#: gtk/gtkbbox.c:130 msgid "Minimum width of buttons inside the box" msgstr "" -#: gtk/gtkbbox.c:110 +#: gtk/gtkbbox.c:138 msgid "Minimum child height" msgstr "" -#: gtk/gtkbbox.c:111 +#: gtk/gtkbbox.c:139 msgid "Minimum height of buttons inside the box" msgstr "" -#: gtk/gtkbbox.c:119 +#: gtk/gtkbbox.c:147 msgid "Child internal width padding" msgstr "" -#: gtk/gtkbbox.c:120 +#: gtk/gtkbbox.c:148 msgid "Amount to increase child's size on either side" msgstr "" -#: gtk/gtkbbox.c:128 +#: gtk/gtkbbox.c:156 msgid "Child internal height padding" msgstr "" -#: gtk/gtkbbox.c:129 +#: gtk/gtkbbox.c:157 msgid "Amount to increase child's size on the top and bottom" msgstr "" -#: gtk/gtkbbox.c:137 +#: gtk/gtkbbox.c:165 msgid "Layout style" msgstr "የእቅድ ዓይነት" -#: gtk/gtkbbox.c:138 +#: gtk/gtkbbox.c:166 msgid "" "How to layout the buttons in the box. Possible values are default, spread, " "edge, start and end" msgstr "" -#: gtk/gtkbbox.c:146 +#: gtk/gtkbbox.c:174 msgid "Secondary" msgstr "" -#: gtk/gtkbbox.c:147 +#: gtk/gtkbbox.c:175 msgid "" "If TRUE, the child appears in a secondary group of children, suitable for, e." "g., help buttons" msgstr "" -#: gtk/gtkbox.c:130 gtk/gtkexpander.c:219 gtk/gtkiconview.c:665 +#: gtk/gtkbox.c:217 gtk/gtkexpander.c:219 gtk/gtkiconview.c:667 #: gtk/gtktreeviewcolumn.c:217 msgid "Spacing" msgstr "ክፍተት" -#: gtk/gtkbox.c:131 +#: gtk/gtkbox.c:218 msgid "The amount of space between children" msgstr "" -#: gtk/gtkbox.c:140 gtk/gtknotebook.c:657 gtk/gtktable.c:165 -#: gtk/gtktoolbar.c:573 gtk/gtktoolitemgroup.c:1588 +#: gtk/gtkbox.c:227 gtk/gtktable.c:165 gtk/gtktoolbar.c:518 +#: gtk/gtktoolitemgroup.c:1596 msgid "Homogeneous" msgstr "" -#: gtk/gtkbox.c:141 +#: gtk/gtkbox.c:228 msgid "Whether the children should all be the same size" msgstr "" -#: gtk/gtkbox.c:148 gtk/gtkpreview.c:101 gtk/gtktoolbar.c:565 -#: gtk/gtktoolitemgroup.c:1595 gtk/gtktoolpalette.c:1052 -#: gtk/gtktreeviewcolumn.c:273 +#: gtk/gtkbox.c:235 gtk/gtktoolbar.c:510 gtk/gtktoolitemgroup.c:1603 +#: gtk/gtktoolpalette.c:1053 gtk/gtktreeviewcolumn.c:273 msgid "Expand" msgstr "" -#: gtk/gtkbox.c:149 +#: gtk/gtkbox.c:236 msgid "Whether the child should receive extra space when the parent grows" msgstr "" -#: gtk/gtkbox.c:155 gtk/gtktoolitemgroup.c:1602 +#: gtk/gtkbox.c:242 gtk/gtktoolitemgroup.c:1610 msgid "Fill" msgstr "" -#: gtk/gtkbox.c:156 +#: gtk/gtkbox.c:243 msgid "" "Whether extra space given to the child should be allocated to the child or " "used as padding" msgstr "" -#: gtk/gtkbox.c:162 +#: gtk/gtkbox.c:249 gtk/gtktrayicon-x11.c:163 msgid "Padding" msgstr "" -#: gtk/gtkbox.c:163 +#: gtk/gtkbox.c:250 msgid "Extra space to put between the child and its neighbors, in pixels" msgstr "" -#: gtk/gtkbox.c:169 +#: gtk/gtkbox.c:256 msgid "Pack type" msgstr "" -#: gtk/gtkbox.c:170 gtk/gtknotebook.c:724 +#: gtk/gtkbox.c:257 gtk/gtknotebook.c:667 msgid "" "A GtkPackType indicating whether the child is packed with reference to the " "start or end of the parent" msgstr "" -#: gtk/gtkbox.c:176 gtk/gtknotebook.c:702 gtk/gtkpaned.c:241 -#: gtk/gtkruler.c:148 gtk/gtktoolitemgroup.c:1616 +#: gtk/gtkbox.c:263 gtk/gtknotebook.c:645 gtk/gtkpaned.c:242 +#: gtk/gtkruler.c:148 gtk/gtktoolitemgroup.c:1624 msgid "Position" msgstr "ቦታ" -#: gtk/gtkbox.c:177 gtk/gtknotebook.c:703 +#: gtk/gtkbox.c:264 gtk/gtknotebook.c:646 msgid "The index of the child in the parent" msgstr "" -#: gtk/gtkbuilder.c:96 +#: gtk/gtkbuilder.c:314 msgid "Translation Domain" msgstr "" -#: gtk/gtkbuilder.c:97 +#: gtk/gtkbuilder.c:315 msgid "The translation domain used by gettext" msgstr "" -#: gtk/gtkbutton.c:220 +#: gtk/gtkbutton.c:228 msgid "" "Text of the label widget inside the button, if the button contains a label " "widget" msgstr "" -#: gtk/gtkbutton.c:227 gtk/gtkexpander.c:203 gtk/gtklabel.c:527 +#: gtk/gtkbutton.c:235 gtk/gtkexpander.c:203 gtk/gtklabel.c:549 #: gtk/gtkmenuitem.c:320 gtk/gtktoolbutton.c:211 msgid "Use underline" msgstr "" -#: gtk/gtkbutton.c:228 gtk/gtkexpander.c:204 gtk/gtklabel.c:528 +#: gtk/gtkbutton.c:236 gtk/gtkexpander.c:204 gtk/gtklabel.c:550 #: gtk/gtkmenuitem.c:321 msgid "" "If set, an underline in the text indicates the next character should be used " "for the mnemonic accelerator key" msgstr "" -#: gtk/gtkbutton.c:235 gtk/gtkimagemenuitem.c:150 +#: gtk/gtkbutton.c:243 gtk/gtkimagemenuitem.c:150 msgid "Use stock" msgstr "" -#: gtk/gtkbutton.c:236 +#: gtk/gtkbutton.c:244 msgid "" "If set, the label is used to pick a stock item instead of being displayed" msgstr "" -#: gtk/gtkbutton.c:243 gtk/gtkcombobox.c:796 gtk/gtkfilechooserbutton.c:393 +#: gtk/gtkbutton.c:251 gtk/gtkcombobox.c:799 gtk/gtkfilechooserbutton.c:393 msgid "Focus on click" msgstr "" -#: gtk/gtkbutton.c:244 gtk/gtkfilechooserbutton.c:394 +#: gtk/gtkbutton.c:252 gtk/gtkfilechooserbutton.c:394 msgid "Whether the button grabs focus when it is clicked with the mouse" msgstr "" -#: gtk/gtkbutton.c:251 +#: gtk/gtkbutton.c:259 msgid "Border relief" msgstr "" -#: gtk/gtkbutton.c:252 +#: gtk/gtkbutton.c:260 msgid "The border relief style" msgstr "" -#: gtk/gtkbutton.c:269 +#: gtk/gtkbutton.c:277 #, fuzzy msgid "Horizontal alignment for child" msgstr "የአግድም ኩልኩል" -#: gtk/gtkbutton.c:288 +#: gtk/gtkbutton.c:296 #, fuzzy msgid "Vertical alignment for child" msgstr "የቁመት ኩልኩል" -#: gtk/gtkbutton.c:305 gtk/gtkimagemenuitem.c:135 +#: gtk/gtkbutton.c:313 gtk/gtkimagemenuitem.c:135 msgid "Image widget" msgstr "" -#: gtk/gtkbutton.c:306 +#: gtk/gtkbutton.c:314 msgid "Child widget to appear next to the button text" msgstr "" -#: gtk/gtkbutton.c:320 +#: gtk/gtkbutton.c:328 #, fuzzy msgid "Image position" msgstr "የX ቦታ" -#: gtk/gtkbutton.c:321 +#: gtk/gtkbutton.c:329 msgid "The position of the image relative to the text" msgstr "" -#: gtk/gtkbutton.c:441 +#: gtk/gtkbutton.c:449 msgid "Default Spacing" msgstr "" -#: gtk/gtkbutton.c:442 +#: gtk/gtkbutton.c:450 msgid "Extra space to add for GTK_CAN_DEFAULT buttons" msgstr "" -#: gtk/gtkbutton.c:456 +#: gtk/gtkbutton.c:464 msgid "Default Outside Spacing" msgstr "" -#: gtk/gtkbutton.c:457 +#: gtk/gtkbutton.c:465 msgid "" "Extra space to add for GTK_CAN_DEFAULT buttons that is always drawn outside " "the border" msgstr "" -#: gtk/gtkbutton.c:462 -msgid "Child X Displacement" -msgstr "" - -#: gtk/gtkbutton.c:463 -msgid "" -"How far in the x direction to move the child when the button is depressed" -msgstr "" - #: gtk/gtkbutton.c:470 -msgid "Child Y Displacement" +msgid "Child X Displacement" msgstr "" #: gtk/gtkbutton.c:471 msgid "" +"How far in the x direction to move the child when the button is depressed" +msgstr "" + +#: gtk/gtkbutton.c:478 +msgid "Child Y Displacement" +msgstr "" + +#: gtk/gtkbutton.c:479 +msgid "" "How far in the y direction to move the child when the button is depressed" msgstr "" -#: gtk/gtkbutton.c:487 +#: gtk/gtkbutton.c:495 msgid "Displace focus" msgstr "" -#: gtk/gtkbutton.c:488 +#: gtk/gtkbutton.c:496 msgid "" "Whether the child_displacement_x/_y properties should also affect the focus " "rectangle" msgstr "" -#: gtk/gtkbutton.c:501 gtk/gtkentry.c:695 gtk/gtkentry.c:1740 +#: gtk/gtkbutton.c:509 gtk/gtkentry.c:697 gtk/gtkentry.c:1742 #, fuzzy msgid "Inner Border" msgstr "ቅደም ተከተል" -#: gtk/gtkbutton.c:502 +#: gtk/gtkbutton.c:510 msgid "Border between button edges and child." msgstr "" -#: gtk/gtkbutton.c:515 +#: gtk/gtkbutton.c:523 #, fuzzy msgid "Image spacing" msgstr "ክፍተት" -#: gtk/gtkbutton.c:516 +#: gtk/gtkbutton.c:524 msgid "Spacing in pixels between the image and label" msgstr "" -#: gtk/gtkbutton.c:530 +#: gtk/gtkbutton.c:538 msgid "Show button images" msgstr "" -#: gtk/gtkbutton.c:531 +#: gtk/gtkbutton.c:539 msgid "Whether images should be shown on buttons" msgstr "" @@ -1053,11 +1052,11 @@ msgstr "ማስረጊያዎች አሳይ" msgid "If TRUE, details are shown" msgstr "" -#: gtk/gtkcelleditable.c:76 +#: gtk/gtkcelleditable.c:43 msgid "Editing Canceled" msgstr "" -#: gtk/gtkcelleditable.c:77 +#: gtk/gtkcelleditable.c:44 msgid "Indicates that editing has been canceled" msgstr "" @@ -1177,36 +1176,36 @@ msgstr "" msgid "Whether this tag affects the cell background color" msgstr "" -#: gtk/gtkcellrendereraccel.c:114 +#: gtk/gtkcellrendereraccel.c:124 msgid "Accelerator key" msgstr "" -#: gtk/gtkcellrendereraccel.c:115 +#: gtk/gtkcellrendereraccel.c:125 #, fuzzy msgid "The keyval of the accelerator" msgstr "የጽሑፉ መለያ" -#: gtk/gtkcellrendereraccel.c:131 +#: gtk/gtkcellrendereraccel.c:141 msgid "Accelerator modifiers" msgstr "" -#: gtk/gtkcellrendereraccel.c:132 +#: gtk/gtkcellrendereraccel.c:142 msgid "The modifier mask of the accelerator" msgstr "" -#: gtk/gtkcellrendereraccel.c:149 +#: gtk/gtkcellrendereraccel.c:159 msgid "Accelerator keycode" msgstr "" -#: gtk/gtkcellrendereraccel.c:150 +#: gtk/gtkcellrendereraccel.c:160 msgid "The hardware keycode of the accelerator" msgstr "" -#: gtk/gtkcellrendereraccel.c:169 +#: gtk/gtkcellrendereraccel.c:179 msgid "Accelerator Mode" msgstr "" -#: gtk/gtkcellrendereraccel.c:170 +#: gtk/gtkcellrendereraccel.c:180 #, fuzzy msgid "The type of accelerators" msgstr "የመስኮቱ ዓይነት" @@ -1261,7 +1260,7 @@ msgstr "" msgid "Pixbuf for closed expander" msgstr "" -#: gtk/gtkcellrendererpixbuf.c:135 gtk/gtkimage.c:263 gtk/gtkstatusicon.c:229 +#: gtk/gtkcellrendererpixbuf.c:135 gtk/gtkimage.c:268 gtk/gtkstatusicon.c:234 msgid "Stock ID" msgstr "" @@ -1270,7 +1269,7 @@ msgid "The stock ID of the stock icon to render" msgstr "" #: gtk/gtkcellrendererpixbuf.c:143 gtk/gtkcellrendererspinner.c:158 -#: gtk/gtkrecentmanager.c:245 gtk/gtkstatusicon.c:270 +#: gtk/gtkrecentmanager.c:245 gtk/gtkstatusicon.c:275 msgid "Size" msgstr "መጠን" @@ -1294,7 +1293,7 @@ msgstr "" msgid "Whether the rendered pixbuf should be colorized according to the state" msgstr "" -#: gtk/gtkcellrendererpixbuf.c:205 gtk/gtkimage.c:338 gtk/gtkwindow.c:595 +#: gtk/gtkcellrendererpixbuf.c:205 gtk/gtkimage.c:343 gtk/gtkwindow.c:619 msgid "Icon" msgstr "ምልክት" @@ -1303,8 +1302,8 @@ msgid "Value of the progress bar" msgstr "" #: gtk/gtkcellrendererprogress.c:146 gtk/gtkcellrenderertext.c:195 -#: gtk/gtkentry.c:738 gtk/gtkentrybuffer.c:353 gtk/gtkmessagedialog.c:153 -#: gtk/gtkprogressbar.c:184 gtk/gtktextbuffer.c:198 +#: gtk/gtkentry.c:740 gtk/gtkentrybuffer.c:353 gtk/gtkmessagedialog.c:200 +#: gtk/gtkprogressbar.c:137 gtk/gtktextbuffer.c:198 msgid "Text" msgstr "ጽሑፍ" @@ -1341,18 +1340,18 @@ msgstr "" msgid "The vertical text alignment, from 0 (top) to 1 (bottom)." msgstr "" -#: gtk/gtkcellrendererprogress.c:221 gtk/gtkiconview.c:729 -#: gtk/gtkorientable.c:74 gtk/gtkprogressbar.c:126 gtk/gtkstatusicon.c:328 -#: gtk/gtktrayicon-x11.c:110 +#: gtk/gtkcellrendererprogress.c:221 gtk/gtkiconview.c:731 +#: gtk/gtkorientable.c:63 gtk/gtkprogressbar.c:112 gtk/gtkstatusicon.c:333 +#: gtk/gtktrayicon-x11.c:122 msgid "Orientation" msgstr "አቀማመጥ" -#: gtk/gtkcellrendererprogress.c:222 gtk/gtkprogressbar.c:127 +#: gtk/gtkcellrendererprogress.c:222 gtk/gtkprogressbar.c:113 msgid "Orientation and growth direction of the progress bar" msgstr "" -#: gtk/gtkcellrendererspin.c:93 gtk/gtkprogressbar.c:118 gtk/gtkrange.c:367 -#: gtk/gtkscalebutton.c:225 gtk/gtkspinbutton.c:208 +#: gtk/gtkcellrendererspin.c:93 gtk/gtkrange.c:394 gtk/gtkscalebutton.c:241 +#: gtk/gtkspinbutton.c:208 msgid "Adjustment" msgstr "" @@ -1377,7 +1376,7 @@ msgid "The number of decimal places to display" msgstr "" #: gtk/gtkcellrendererspinner.c:124 gtk/gtkcheckmenuitem.c:98 -#: gtk/gtkmenu.c:501 gtk/gtkspinner.c:128 gtk/gtktoggleaction.c:119 +#: gtk/gtkmenu.c:508 gtk/gtkspinner.c:128 gtk/gtktoggleaction.c:130 #: gtk/gtktogglebutton.c:115 gtk/gtktoggletoolbutton.c:114 msgid "Active" msgstr "" @@ -1407,7 +1406,7 @@ msgstr "" msgid "Marked up text to render" msgstr "" -#: gtk/gtkcellrenderertext.c:211 gtk/gtklabel.c:513 +#: gtk/gtkcellrenderertext.c:211 gtk/gtklabel.c:535 msgid "Attributes" msgstr "" @@ -1448,6 +1447,7 @@ msgid "Foreground color as a string" msgstr "" #: gtk/gtkcellrenderertext.c:252 gtk/gtktexttag.c:225 +#: gtk/gtktrayicon-x11.c:131 msgid "Foreground color" msgstr "የፊት ለፊቱ ቀለም" @@ -1455,7 +1455,7 @@ msgstr "የፊት ለፊቱ ቀለም" msgid "Foreground color as a GdkColor" msgstr "" -#: gtk/gtkcellrenderertext.c:261 gtk/gtkentry.c:662 gtk/gtktexttag.c:251 +#: gtk/gtkcellrenderertext.c:261 gtk/gtkentry.c:664 gtk/gtktexttag.c:251 #: gtk/gtktextview.c:577 msgid "Editable" msgstr "" @@ -1562,7 +1562,7 @@ msgid "" "probably don't need it" msgstr "" -#: gtk/gtkcellrenderertext.c:411 gtk/gtklabel.c:638 gtk/gtkprogressbar.c:206 +#: gtk/gtkcellrenderertext.c:411 gtk/gtklabel.c:660 gtk/gtkprogressbar.c:159 msgid "Ellipsize" msgstr "" @@ -1573,11 +1573,11 @@ msgid "" msgstr "" #: gtk/gtkcellrenderertext.c:431 gtk/gtkfilechooserbutton.c:421 -#: gtk/gtklabel.c:658 +#: gtk/gtklabel.c:681 msgid "Width In Characters" msgstr "" -#: gtk/gtkcellrenderertext.c:432 gtk/gtklabel.c:659 +#: gtk/gtkcellrenderertext.c:432 gtk/gtklabel.c:682 msgid "The desired width of the label, in characters" msgstr "" @@ -1591,7 +1591,7 @@ msgid "" "have enough room to display the entire string" msgstr "" -#: gtk/gtkcellrenderertext.c:470 gtk/gtkcombobox.c:685 +#: gtk/gtkcellrenderertext.c:470 gtk/gtkcombobox.c:688 #, fuzzy msgid "Wrap width" msgstr "ስፋት" @@ -1789,11 +1789,11 @@ msgstr "የምልክት መጠን" msgid "The model for cell view" msgstr "የመስኮቱ ዓይነት" -#: gtk/gtkcheckbutton.c:69 gtk/gtkcheckmenuitem.c:121 gtk/gtkoptionmenu.c:168 +#: gtk/gtkcheckbutton.c:69 gtk/gtkcheckmenuitem.c:121 msgid "Indicator Size" msgstr "" -#: gtk/gtkcheckbutton.c:77 gtk/gtkexpander.c:245 gtk/gtkoptionmenu.c:174 +#: gtk/gtkcheckbutton.c:77 gtk/gtkexpander.c:245 msgid "Indicator Spacing" msgstr "" @@ -1830,7 +1830,7 @@ msgid "Whether or not to give the color an alpha value" msgstr "" #: gtk/gtkcolorbutton.c:186 gtk/gtkfilechooserbutton.c:407 -#: gtk/gtkfontbutton.c:142 gtk/gtkprintjob.c:116 gtk/gtkstatusicon.c:424 +#: gtk/gtkfontbutton.c:142 gtk/gtkprintjob.c:116 gtk/gtkstatusicon.c:429 #: gtk/gtktreeviewcolumn.c:265 msgid "Title" msgstr "አርእስት" @@ -1840,7 +1840,7 @@ msgstr "አርእስት" msgid "The title of the color selection dialog" msgstr "የመስኮቱ አርእስት" -#: gtk/gtkcolorbutton.c:201 gtk/gtkcolorsel.c:293 +#: gtk/gtkcolorbutton.c:201 gtk/gtkcolorsel.c:295 msgid "Current Color" msgstr "የአሁኑን ቀለም" @@ -1848,7 +1848,7 @@ msgstr "የአሁኑን ቀለም" msgid "The selected color" msgstr "" -#: gtk/gtkcolorbutton.c:216 gtk/gtkcolorsel.c:300 +#: gtk/gtkcolorbutton.c:216 gtk/gtkcolorsel.c:302 msgid "Current Alpha" msgstr "" @@ -1856,35 +1856,35 @@ msgstr "" msgid "The selected opacity value (0 fully transparent, 65535 fully opaque)" msgstr "" -#: gtk/gtkcolorsel.c:279 +#: gtk/gtkcolorsel.c:281 msgid "Has Opacity Control" msgstr "" -#: gtk/gtkcolorsel.c:280 +#: gtk/gtkcolorsel.c:282 msgid "Whether the color selector should allow setting opacity" msgstr "" -#: gtk/gtkcolorsel.c:286 +#: gtk/gtkcolorsel.c:288 msgid "Has palette" msgstr "" -#: gtk/gtkcolorsel.c:287 +#: gtk/gtkcolorsel.c:289 msgid "Whether a palette should be used" msgstr "" -#: gtk/gtkcolorsel.c:294 +#: gtk/gtkcolorsel.c:296 msgid "The current color" msgstr "" -#: gtk/gtkcolorsel.c:301 +#: gtk/gtkcolorsel.c:303 msgid "The current opacity value (0 fully transparent, 65535 fully opaque)" msgstr "" -#: gtk/gtkcolorsel.c:315 +#: gtk/gtkcolorsel.c:317 msgid "Custom palette" msgstr "" -#: gtk/gtkcolorsel.c:316 +#: gtk/gtkcolorsel.c:318 msgid "Palette to use in the color selector" msgstr "" @@ -1925,152 +1925,112 @@ msgstr "" msgid "The help button of the dialog." msgstr "የመስኮቱ አርእስት" -#: gtk/gtkcombo.c:145 -msgid "Enable arrow keys" -msgstr "" - -#: gtk/gtkcombo.c:146 -msgid "Whether the arrow keys move through the list of items" -msgstr "" - -#: gtk/gtkcombo.c:152 -msgid "Always enable arrows" -msgstr "" - -#: gtk/gtkcombo.c:153 -msgid "Obsolete property, ignored" -msgstr "" - -#: gtk/gtkcombo.c:159 -msgid "Case sensitive" -msgstr "" - -#: gtk/gtkcombo.c:160 -msgid "Whether list item matching is case sensitive" -msgstr "" - -#: gtk/gtkcombo.c:167 -msgid "Allow empty" -msgstr "" - -#: gtk/gtkcombo.c:168 -msgid "Whether an empty value may be entered in this field" -msgstr "" - -#: gtk/gtkcombo.c:175 -msgid "Value in list" -msgstr "" - -#: gtk/gtkcombo.c:176 -msgid "Whether entered values must already be present in the list" -msgstr "" - -#: gtk/gtkcombobox.c:668 +#: gtk/gtkcombobox.c:671 msgid "ComboBox model" msgstr "" -#: gtk/gtkcombobox.c:669 +#: gtk/gtkcombobox.c:672 msgid "The model for the combo box" msgstr "" -#: gtk/gtkcombobox.c:686 +#: gtk/gtkcombobox.c:689 msgid "Wrap width for laying out the items in a grid" msgstr "" -#: gtk/gtkcombobox.c:708 +#: gtk/gtkcombobox.c:711 msgid "Row span column" msgstr "" -#: gtk/gtkcombobox.c:709 +#: gtk/gtkcombobox.c:712 msgid "TreeModel column containing the row span values" msgstr "" -#: gtk/gtkcombobox.c:730 +#: gtk/gtkcombobox.c:733 msgid "Column span column" msgstr "" -#: gtk/gtkcombobox.c:731 +#: gtk/gtkcombobox.c:734 msgid "TreeModel column containing the column span values" msgstr "" -#: gtk/gtkcombobox.c:752 +#: gtk/gtkcombobox.c:755 msgid "Active item" msgstr "" -#: gtk/gtkcombobox.c:753 +#: gtk/gtkcombobox.c:756 msgid "The item which is currently active" msgstr "" -#: gtk/gtkcombobox.c:772 gtk/gtkuimanager.c:226 +#: gtk/gtkcombobox.c:775 gtk/gtkuimanager.c:226 msgid "Add tearoffs to menus" msgstr "" -#: gtk/gtkcombobox.c:773 +#: gtk/gtkcombobox.c:776 msgid "Whether dropdowns should have a tearoff menu item" msgstr "" -#: gtk/gtkcombobox.c:788 gtk/gtkentry.c:687 +#: gtk/gtkcombobox.c:791 gtk/gtkentry.c:689 msgid "Has Frame" msgstr "ፍሬም አለ" -#: gtk/gtkcombobox.c:789 +#: gtk/gtkcombobox.c:792 msgid "Whether the combo box draws a frame around the child" msgstr "" -#: gtk/gtkcombobox.c:797 +#: gtk/gtkcombobox.c:800 msgid "Whether the combo box grabs focus when it is clicked with the mouse" msgstr "" -#: gtk/gtkcombobox.c:812 gtk/gtkmenu.c:556 +#: gtk/gtkcombobox.c:815 gtk/gtkmenu.c:563 msgid "Tearoff Title" msgstr "" -#: gtk/gtkcombobox.c:813 +#: gtk/gtkcombobox.c:816 msgid "" "A title that may be displayed by the window manager when the popup is torn-" "off" msgstr "" -#: gtk/gtkcombobox.c:830 +#: gtk/gtkcombobox.c:833 msgid "Popup shown" msgstr "" -#: gtk/gtkcombobox.c:831 +#: gtk/gtkcombobox.c:834 msgid "Whether the combo's dropdown is shown" msgstr "" -#: gtk/gtkcombobox.c:847 +#: gtk/gtkcombobox.c:850 msgid "Button Sensitivity" msgstr "" -#: gtk/gtkcombobox.c:848 +#: gtk/gtkcombobox.c:851 msgid "Whether the dropdown button is sensitive when the model is empty" msgstr "" -#: gtk/gtkcombobox.c:855 +#: gtk/gtkcombobox.c:858 msgid "Appears as list" msgstr "" -#: gtk/gtkcombobox.c:856 +#: gtk/gtkcombobox.c:859 msgid "Whether dropdowns should look like lists rather than menus" msgstr "" -#: gtk/gtkcombobox.c:872 +#: gtk/gtkcombobox.c:875 #, fuzzy msgid "Arrow Size" msgstr "ጽሑፍ አሳይ" -#: gtk/gtkcombobox.c:873 +#: gtk/gtkcombobox.c:876 msgid "The minimum size of the arrow in the combo box" msgstr "" -#: gtk/gtkcombobox.c:888 gtk/gtkentry.c:787 gtk/gtkhandlebox.c:174 -#: gtk/gtkmenubar.c:194 gtk/gtkstatusbar.c:193 gtk/gtktoolbar.c:623 -#: gtk/gtkviewport.c:122 +#: gtk/gtkcombobox.c:891 gtk/gtkentry.c:789 gtk/gtkhandlebox.c:175 +#: gtk/gtkmenubar.c:194 gtk/gtkstatusbar.c:193 gtk/gtktoolbar.c:568 +#: gtk/gtkviewport.c:150 msgid "Shadow type" msgstr "" -#: gtk/gtkcombobox.c:889 +#: gtk/gtkcombobox.c:892 msgid "Which kind of shadow to draw around the combo box" msgstr "" @@ -2098,46 +2058,6 @@ msgstr "ልጅ" msgid "Can be used to add a new child to the container" msgstr "" -#: gtk/gtkcurve.c:126 -msgid "Curve type" -msgstr "" - -#: gtk/gtkcurve.c:127 -msgid "Is this curve linear, spline interpolated, or free-form" -msgstr "" - -#: gtk/gtkcurve.c:134 -msgid "Minimum X" -msgstr "በተቻለ መጠን X" - -#: gtk/gtkcurve.c:135 -msgid "Minimum possible value for X" -msgstr "" - -#: gtk/gtkcurve.c:143 -msgid "Maximum X" -msgstr "ከፍተኛ መጠን X" - -#: gtk/gtkcurve.c:144 -msgid "Maximum possible X value" -msgstr "" - -#: gtk/gtkcurve.c:152 -msgid "Minimum Y" -msgstr "በተቻለ መጠን Y" - -#: gtk/gtkcurve.c:153 -msgid "Minimum possible value for Y" -msgstr "" - -#: gtk/gtkcurve.c:161 -msgid "Maximum Y" -msgstr "ከፍተኛ መጠን Y" - -#: gtk/gtkcurve.c:162 -msgid "Maximum possible value for Y" -msgstr "" - #: gtk/gtkdialog.c:145 msgid "Has separator" msgstr "" @@ -2179,373 +2099,373 @@ msgstr "" msgid "Width of border around the button area at the bottom of the dialog" msgstr "" -#: gtk/gtkentry.c:634 +#: gtk/gtkentry.c:636 msgid "Text Buffer" msgstr "" -#: gtk/gtkentry.c:635 +#: gtk/gtkentry.c:637 msgid "Text buffer object which actually stores entry text" msgstr "" -#: gtk/gtkentry.c:642 gtk/gtklabel.c:601 +#: gtk/gtkentry.c:644 gtk/gtklabel.c:623 msgid "Cursor Position" msgstr "ጠቋሚው ባለበት ቦታ" -#: gtk/gtkentry.c:643 gtk/gtklabel.c:602 +#: gtk/gtkentry.c:645 gtk/gtklabel.c:624 msgid "The current position of the insertion cursor in chars" msgstr "" -#: gtk/gtkentry.c:652 gtk/gtklabel.c:611 +#: gtk/gtkentry.c:654 gtk/gtklabel.c:633 msgid "Selection Bound" msgstr "" -#: gtk/gtkentry.c:653 gtk/gtklabel.c:612 +#: gtk/gtkentry.c:655 gtk/gtklabel.c:634 msgid "" "The position of the opposite end of the selection from the cursor in chars" msgstr "" -#: gtk/gtkentry.c:663 +#: gtk/gtkentry.c:665 msgid "Whether the entry contents can be edited" msgstr "" -#: gtk/gtkentry.c:670 gtk/gtkentrybuffer.c:383 +#: gtk/gtkentry.c:672 gtk/gtkentrybuffer.c:383 msgid "Maximum length" msgstr "" -#: gtk/gtkentry.c:671 gtk/gtkentrybuffer.c:384 +#: gtk/gtkentry.c:673 gtk/gtkentrybuffer.c:384 msgid "Maximum number of characters for this entry. Zero if no maximum" msgstr "" -#: gtk/gtkentry.c:679 +#: gtk/gtkentry.c:681 msgid "Visibility" msgstr "" -#: gtk/gtkentry.c:680 +#: gtk/gtkentry.c:682 msgid "" "FALSE displays the \"invisible char\" instead of the actual text (password " "mode)" msgstr "" -#: gtk/gtkentry.c:688 +#: gtk/gtkentry.c:690 msgid "FALSE removes outside bevel from entry" msgstr "" -#: gtk/gtkentry.c:696 +#: gtk/gtkentry.c:698 msgid "" "Border between text and frame. Overrides the inner-border style property" msgstr "" -#: gtk/gtkentry.c:703 gtk/gtkentry.c:1269 +#: gtk/gtkentry.c:705 gtk/gtkentry.c:1271 msgid "Invisible character" msgstr "" -#: gtk/gtkentry.c:704 gtk/gtkentry.c:1270 +#: gtk/gtkentry.c:706 gtk/gtkentry.c:1272 msgid "The character to use when masking entry contents (in \"password mode\")" msgstr "" -#: gtk/gtkentry.c:711 +#: gtk/gtkentry.c:713 msgid "Activates default" msgstr "" -#: gtk/gtkentry.c:712 +#: gtk/gtkentry.c:714 msgid "" "Whether to activate the default widget (such as the default button in a " "dialog) when Enter is pressed" msgstr "" -#: gtk/gtkentry.c:718 +#: gtk/gtkentry.c:720 msgid "Width in chars" msgstr "" -#: gtk/gtkentry.c:719 +#: gtk/gtkentry.c:721 msgid "Number of characters to leave space for in the entry" msgstr "" -#: gtk/gtkentry.c:728 +#: gtk/gtkentry.c:730 msgid "Scroll offset" msgstr "" -#: gtk/gtkentry.c:729 +#: gtk/gtkentry.c:731 msgid "Number of pixels of the entry scrolled off the screen to the left" msgstr "" -#: gtk/gtkentry.c:739 +#: gtk/gtkentry.c:741 msgid "The contents of the entry" msgstr "" -#: gtk/gtkentry.c:754 gtk/gtkmisc.c:73 +#: gtk/gtkentry.c:756 gtk/gtkmisc.c:73 msgid "X align" msgstr "" -#: gtk/gtkentry.c:755 gtk/gtkmisc.c:74 +#: gtk/gtkentry.c:757 gtk/gtkmisc.c:74 msgid "" "The horizontal alignment, from 0 (left) to 1 (right). Reversed for RTL " "layouts." msgstr "" -#: gtk/gtkentry.c:771 +#: gtk/gtkentry.c:773 msgid "Truncate multiline" msgstr "" -#: gtk/gtkentry.c:772 +#: gtk/gtkentry.c:774 msgid "Whether to truncate multiline pastes to one line." msgstr "" -#: gtk/gtkentry.c:788 +#: gtk/gtkentry.c:790 msgid "Which kind of shadow to draw around the entry when has-frame is set" msgstr "" -#: gtk/gtkentry.c:803 gtk/gtktextview.c:657 +#: gtk/gtkentry.c:805 gtk/gtktextview.c:657 msgid "Overwrite mode" msgstr "" -#: gtk/gtkentry.c:804 +#: gtk/gtkentry.c:806 msgid "Whether new text overwrites existing text" msgstr "" -#: gtk/gtkentry.c:818 gtk/gtkentrybuffer.c:368 +#: gtk/gtkentry.c:820 gtk/gtkentrybuffer.c:368 #, fuzzy msgid "Text length" msgstr "ዐምዶች" -#: gtk/gtkentry.c:819 +#: gtk/gtkentry.c:821 msgid "Length of the text currently in the entry" msgstr "" -#: gtk/gtkentry.c:834 +#: gtk/gtkentry.c:836 msgid "Invisible char set" msgstr "" -#: gtk/gtkentry.c:835 +#: gtk/gtkentry.c:837 msgid "Whether the invisible char has been set" msgstr "" -#: gtk/gtkentry.c:853 +#: gtk/gtkentry.c:855 msgid "Caps Lock warning" msgstr "" -#: gtk/gtkentry.c:854 +#: gtk/gtkentry.c:856 msgid "Whether password entries will show a warning when Caps Lock is on" msgstr "" -#: gtk/gtkentry.c:868 +#: gtk/gtkentry.c:870 msgid "Progress Fraction" msgstr "" -#: gtk/gtkentry.c:869 +#: gtk/gtkentry.c:871 #, fuzzy msgid "The current fraction of the task that's been completed" msgstr "የጽሑፉ መለያ" -#: gtk/gtkentry.c:886 +#: gtk/gtkentry.c:888 msgid "Progress Pulse Step" msgstr "" -#: gtk/gtkentry.c:887 +#: gtk/gtkentry.c:889 msgid "" "The fraction of total entry width to move the progress bouncing block for " "each call to gtk_entry_progress_pulse()" msgstr "" -#: gtk/gtkentry.c:903 +#: gtk/gtkentry.c:905 msgid "Primary pixbuf" msgstr "" -#: gtk/gtkentry.c:904 +#: gtk/gtkentry.c:906 msgid "Primary pixbuf for the entry" msgstr "" -#: gtk/gtkentry.c:918 +#: gtk/gtkentry.c:920 msgid "Secondary pixbuf" msgstr "" -#: gtk/gtkentry.c:919 +#: gtk/gtkentry.c:921 msgid "Secondary pixbuf for the entry" msgstr "" -#: gtk/gtkentry.c:933 +#: gtk/gtkentry.c:935 msgid "Primary stock ID" msgstr "" -#: gtk/gtkentry.c:934 +#: gtk/gtkentry.c:936 msgid "Stock ID for primary icon" msgstr "" -#: gtk/gtkentry.c:948 +#: gtk/gtkentry.c:950 msgid "Secondary stock ID" msgstr "" -#: gtk/gtkentry.c:949 +#: gtk/gtkentry.c:951 msgid "Stock ID for secondary icon" msgstr "" -#: gtk/gtkentry.c:963 +#: gtk/gtkentry.c:965 #, fuzzy msgid "Primary icon name" msgstr "የፊደሉ ቅርጽ ስም" -#: gtk/gtkentry.c:964 +#: gtk/gtkentry.c:966 msgid "Icon name for primary icon" msgstr "" -#: gtk/gtkentry.c:978 +#: gtk/gtkentry.c:980 #, fuzzy msgid "Secondary icon name" msgstr "የመደቡ ቀለም ስም" -#: gtk/gtkentry.c:979 +#: gtk/gtkentry.c:981 msgid "Icon name for secondary icon" msgstr "" -#: gtk/gtkentry.c:993 +#: gtk/gtkentry.c:995 msgid "Primary GIcon" msgstr "" -#: gtk/gtkentry.c:994 +#: gtk/gtkentry.c:996 #, fuzzy msgid "GIcon for primary icon" msgstr "ምልክት ለዚህን መስኮት" -#: gtk/gtkentry.c:1008 +#: gtk/gtkentry.c:1010 msgid "Secondary GIcon" msgstr "" -#: gtk/gtkentry.c:1009 +#: gtk/gtkentry.c:1011 msgid "GIcon for secondary icon" msgstr "" -#: gtk/gtkentry.c:1023 +#: gtk/gtkentry.c:1025 #, fuzzy msgid "Primary storage type" msgstr "መጠን" -#: gtk/gtkentry.c:1024 +#: gtk/gtkentry.c:1026 msgid "The representation being used for primary icon" msgstr "" -#: gtk/gtkentry.c:1039 +#: gtk/gtkentry.c:1041 msgid "Secondary storage type" msgstr "" -#: gtk/gtkentry.c:1040 +#: gtk/gtkentry.c:1042 msgid "The representation being used for secondary icon" msgstr "" -#: gtk/gtkentry.c:1061 +#: gtk/gtkentry.c:1063 msgid "Primary icon activatable" msgstr "" -#: gtk/gtkentry.c:1062 +#: gtk/gtkentry.c:1064 msgid "Whether the primary icon is activatable" msgstr "" -#: gtk/gtkentry.c:1082 +#: gtk/gtkentry.c:1084 msgid "Secondary icon activatable" msgstr "" -#: gtk/gtkentry.c:1083 +#: gtk/gtkentry.c:1085 msgid "Whether the secondary icon is activatable" msgstr "" -#: gtk/gtkentry.c:1105 +#: gtk/gtkentry.c:1107 msgid "Primary icon sensitive" msgstr "" -#: gtk/gtkentry.c:1106 +#: gtk/gtkentry.c:1108 msgid "Whether the primary icon is sensitive" msgstr "" -#: gtk/gtkentry.c:1127 +#: gtk/gtkentry.c:1129 msgid "Secondary icon sensitive" msgstr "" -#: gtk/gtkentry.c:1128 +#: gtk/gtkentry.c:1130 msgid "Whether the secondary icon is sensitive" msgstr "" -#: gtk/gtkentry.c:1144 +#: gtk/gtkentry.c:1146 #, fuzzy msgid "Primary icon tooltip text" msgstr "የፊደሉ ቅርጽ ስም" -#: gtk/gtkentry.c:1145 gtk/gtkentry.c:1181 +#: gtk/gtkentry.c:1147 gtk/gtkentry.c:1183 #, fuzzy msgid "The contents of the tooltip on the primary icon" msgstr "የመስኮቱ አርእስት" -#: gtk/gtkentry.c:1161 +#: gtk/gtkentry.c:1163 #, fuzzy msgid "Secondary icon tooltip text" msgstr "የመደቡ ቀለም ስም" -#: gtk/gtkentry.c:1162 gtk/gtkentry.c:1200 +#: gtk/gtkentry.c:1164 gtk/gtkentry.c:1202 #, fuzzy msgid "The contents of the tooltip on the secondary icon" msgstr "የመስኮቱ አርእስት" -#: gtk/gtkentry.c:1180 +#: gtk/gtkentry.c:1182 #, fuzzy msgid "Primary icon tooltip markup" msgstr "የፊደሉ ቅርጽ ስም" -#: gtk/gtkentry.c:1199 +#: gtk/gtkentry.c:1201 #, fuzzy msgid "Secondary icon tooltip markup" msgstr "የመደቡ ቀለም ስም" -#: gtk/gtkentry.c:1219 gtk/gtktextview.c:685 +#: gtk/gtkentry.c:1221 gtk/gtktextview.c:685 #, fuzzy msgid "IM module" msgstr "የነበረው ስፋት" -#: gtk/gtkentry.c:1220 gtk/gtktextview.c:686 +#: gtk/gtkentry.c:1222 gtk/gtktextview.c:686 msgid "Which IM module should be used" msgstr "" -#: gtk/gtkentry.c:1234 +#: gtk/gtkentry.c:1236 #, fuzzy msgid "Icon Prelight" msgstr "እርዝማኔ" -#: gtk/gtkentry.c:1235 +#: gtk/gtkentry.c:1237 msgid "Whether activatable icons should prelight when hovered" msgstr "" -#: gtk/gtkentry.c:1248 +#: gtk/gtkentry.c:1250 #, fuzzy msgid "Progress Border" msgstr "ቅደም ተከተል" -#: gtk/gtkentry.c:1249 +#: gtk/gtkentry.c:1251 #, fuzzy msgid "Border around the progress bar" msgstr "የጽሑፉ መለያ" -#: gtk/gtkentry.c:1741 +#: gtk/gtkentry.c:1743 msgid "Border between text and frame." msgstr "" -#: gtk/gtkentry.c:1755 +#: gtk/gtkentry.c:1757 msgid "State Hint" msgstr "" -#: gtk/gtkentry.c:1756 +#: gtk/gtkentry.c:1758 msgid "Whether to pass a proper state when drawing shadow or background" msgstr "" -#: gtk/gtkentry.c:1761 gtk/gtklabel.c:858 +#: gtk/gtkentry.c:1763 gtk/gtklabel.c:882 msgid "Select on focus" msgstr "" -#: gtk/gtkentry.c:1762 +#: gtk/gtkentry.c:1764 msgid "Whether to select the contents of an entry when it is focused" msgstr "" -#: gtk/gtkentry.c:1776 +#: gtk/gtkentry.c:1778 msgid "Password Hint Timeout" msgstr "" -#: gtk/gtkentry.c:1777 +#: gtk/gtkentry.c:1779 msgid "How long to show the last input character in hidden entries" msgstr "" @@ -2575,7 +2495,7 @@ msgstr "" msgid "Minimum length of the search key in order to look up matches" msgstr "" -#: gtk/gtkentrycompletion.c:303 gtk/gtkiconview.c:586 +#: gtk/gtkentrycompletion.c:303 gtk/gtkiconview.c:588 #, fuzzy msgid "Text column" msgstr "ዐምዶች" @@ -2658,11 +2578,11 @@ msgstr "" msgid "Text of the expander's label" msgstr "የጽሑፉ መለያ" -#: gtk/gtkexpander.c:211 gtk/gtklabel.c:520 +#: gtk/gtkexpander.c:211 gtk/gtklabel.c:542 msgid "Use markup" msgstr "" -#: gtk/gtkexpander.c:212 gtk/gtklabel.c:521 +#: gtk/gtkexpander.c:212 gtk/gtklabel.c:543 msgid "The text of the label includes XML markup. See pango_parse_markup()" msgstr "" @@ -2670,8 +2590,8 @@ msgstr "" msgid "Space to put between the label and the child" msgstr "" -#: gtk/gtkexpander.c:229 gtk/gtkframe.c:147 gtk/gtktoolbutton.c:218 -#: gtk/gtktoolitemgroup.c:1542 +#: gtk/gtkexpander.c:229 gtk/gtkframe.c:156 gtk/gtktoolbutton.c:218 +#: gtk/gtktoolitemgroup.c:1550 msgid "Label widget" msgstr "" @@ -2679,11 +2599,11 @@ msgstr "" msgid "A widget to display in place of the usual expander label" msgstr "" -#: gtk/gtkexpander.c:236 gtk/gtktoolitemgroup.c:1570 gtk/gtktreeview.c:777 +#: gtk/gtkexpander.c:236 gtk/gtktoolitemgroup.c:1578 gtk/gtktreeview.c:779 msgid "Expander Size" msgstr "" -#: gtk/gtkexpander.c:237 gtk/gtktoolitemgroup.c:1571 gtk/gtktreeview.c:778 +#: gtk/gtkexpander.c:237 gtk/gtktoolitemgroup.c:1579 gtk/gtktreeview.c:780 msgid "Size of the expander arrow" msgstr "" @@ -2691,111 +2611,102 @@ msgstr "" msgid "Spacing around expander arrow" msgstr "" -#: gtk/gtkfilechooser.c:758 +#: gtk/gtkfilechooser.c:759 #, fuzzy msgid "Action" msgstr "ምልክት" -#: gtk/gtkfilechooser.c:759 +#: gtk/gtkfilechooser.c:760 msgid "The type of operation that the file selector is performing" msgstr "" -#: gtk/gtkfilechooser.c:765 -#, fuzzy -msgid "File System Backend" -msgstr "ፋይሎች" - -#: gtk/gtkfilechooser.c:766 -msgid "Name of file system backend to use" -msgstr "" - -#: gtk/gtkfilechooser.c:771 gtk/gtkrecentchooser.c:264 +#: gtk/gtkfilechooser.c:766 gtk/gtkrecentchooser.c:281 #, fuzzy msgid "Filter" msgstr "ፋይሎች" -#: gtk/gtkfilechooser.c:772 +#: gtk/gtkfilechooser.c:767 msgid "The current filter for selecting which files are displayed" msgstr "" -#: gtk/gtkfilechooser.c:777 +#: gtk/gtkfilechooser.c:772 msgid "Local Only" msgstr "" -#: gtk/gtkfilechooser.c:778 +#: gtk/gtkfilechooser.c:773 msgid "Whether the selected file(s) should be limited to local file: URLs" msgstr "" -#: gtk/gtkfilechooser.c:783 +#: gtk/gtkfilechooser.c:778 #, fuzzy msgid "Preview widget" msgstr "የጽሑፉ ቅድመ ዕይታ" -#: gtk/gtkfilechooser.c:784 +#: gtk/gtkfilechooser.c:779 msgid "Application supplied widget for custom previews." msgstr "" -#: gtk/gtkfilechooser.c:789 +#: gtk/gtkfilechooser.c:784 #, fuzzy msgid "Preview Widget Active" msgstr "የጽሑፉ ቅድመ ዕይታ" -#: gtk/gtkfilechooser.c:790 +#: gtk/gtkfilechooser.c:785 msgid "" "Whether the application supplied widget for custom previews should be shown." msgstr "" -#: gtk/gtkfilechooser.c:795 +#: gtk/gtkfilechooser.c:790 #, fuzzy msgid "Use Preview Label" msgstr "የጽሑፉ ቅድመ ዕይታ" -#: gtk/gtkfilechooser.c:796 +#: gtk/gtkfilechooser.c:791 msgid "Whether to display a stock label with the name of the previewed file." msgstr "" -#: gtk/gtkfilechooser.c:801 +#: gtk/gtkfilechooser.c:796 #, fuzzy msgid "Extra widget" msgstr "ስፋት" -#: gtk/gtkfilechooser.c:802 +#: gtk/gtkfilechooser.c:797 msgid "Application supplied widget for extra options." msgstr "" -#: gtk/gtkfilechooser.c:807 gtk/gtkfilesel.c:540 gtk/gtkrecentchooser.c:203 +#: gtk/gtkfilechooser.c:802 gtk/gtkrecentchooser.c:220 #, fuzzy msgid "Select Multiple" msgstr "ሁሉንም ምረጡ" -#: gtk/gtkfilechooser.c:808 gtk/gtkfilesel.c:541 +#: gtk/gtkfilechooser.c:803 msgid "Whether to allow multiple files to be selected" msgstr "" -#: gtk/gtkfilechooser.c:814 +#: gtk/gtkfilechooser.c:809 #, fuzzy msgid "Show Hidden" msgstr "ጽሑፍ አሳይ" -#: gtk/gtkfilechooser.c:815 +#: gtk/gtkfilechooser.c:810 msgid "Whether the hidden files and folders should be displayed" msgstr "" -#: gtk/gtkfilechooser.c:830 +#: gtk/gtkfilechooser.c:825 msgid "Do overwrite confirmation" msgstr "" -#: gtk/gtkfilechooser.c:831 +#: gtk/gtkfilechooser.c:826 msgid "" "Whether a file chooser in save mode will present an overwrite confirmation " "dialog if necessary." msgstr "" -#: gtk/gtkfilechooser.c:847 +#: gtk/gtkfilechooser.c:842 msgid "Allow folders creation" msgstr "" -#: gtk/gtkfilechooser.c:848 +#: gtk/gtkfilechooser.c:843 msgid "" "Whether a file chooser not in open mode will offer the user to create new " "folders." @@ -2818,36 +2729,19 @@ msgstr "የመስኮቱ አርእስት" msgid "The desired width of the button widget, in characters." msgstr "" -#: gtk/gtkfilesel.c:526 gtk/gtkimage.c:254 gtk/gtkrecentmanager.c:214 -#: gtk/gtkstatusicon.c:221 -msgid "Filename" -msgstr "የፋይል ስም" - -#: gtk/gtkfilesel.c:527 -msgid "The currently selected filename" -msgstr "" - -#: gtk/gtkfilesel.c:533 -msgid "Show file operations" -msgstr "" - -#: gtk/gtkfilesel.c:534 -msgid "Whether buttons for creating/manipulating files should be displayed" -msgstr "" - -#: gtk/gtkfixed.c:90 gtk/gtklayout.c:597 +#: gtk/gtkfixed.c:90 gtk/gtklayout.c:561 msgid "X position" msgstr "የX ቦታ" -#: gtk/gtkfixed.c:91 gtk/gtklayout.c:598 +#: gtk/gtkfixed.c:91 gtk/gtklayout.c:562 msgid "X position of child widget" msgstr "" -#: gtk/gtkfixed.c:100 gtk/gtklayout.c:607 +#: gtk/gtkfixed.c:100 gtk/gtklayout.c:571 msgid "Y position" msgstr "የY ቦታ" -#: gtk/gtkfixed.c:101 gtk/gtklayout.c:608 +#: gtk/gtkfixed.c:101 gtk/gtklayout.c:572 msgid "Y position of child widget" msgstr "" @@ -2919,299 +2813,303 @@ msgstr "የጽሑፉ ቅድመ ዕይታ" msgid "The text to display in order to demonstrate the selected font" msgstr "" -#: gtk/gtkframe.c:106 +#: gtk/gtkframe.c:115 msgid "Text of the frame's label" msgstr "" -#: gtk/gtkframe.c:113 +#: gtk/gtkframe.c:122 msgid "Label xalign" msgstr "" -#: gtk/gtkframe.c:114 +#: gtk/gtkframe.c:123 msgid "The horizontal alignment of the label" msgstr "" -#: gtk/gtkframe.c:122 +#: gtk/gtkframe.c:131 msgid "Label yalign" msgstr "" -#: gtk/gtkframe.c:123 +#: gtk/gtkframe.c:132 msgid "The vertical alignment of the label" msgstr "" -#: gtk/gtkframe.c:131 gtk/gtkhandlebox.c:167 +#: gtk/gtkframe.c:140 gtk/gtkhandlebox.c:168 msgid "Deprecated property, use shadow_type instead" msgstr "" -#: gtk/gtkframe.c:138 +#: gtk/gtkframe.c:147 msgid "Frame shadow" msgstr "" -#: gtk/gtkframe.c:139 +#: gtk/gtkframe.c:148 msgid "Appearance of the frame border" msgstr "" -#: gtk/gtkframe.c:148 +#: gtk/gtkframe.c:157 msgid "A widget to display in place of the usual frame label" msgstr "" -#: gtk/gtkhandlebox.c:175 +#: gtk/gtkhandlebox.c:176 msgid "Appearance of the shadow that surrounds the container" msgstr "" -#: gtk/gtkhandlebox.c:183 +#: gtk/gtkhandlebox.c:184 msgid "Handle position" msgstr "" -#: gtk/gtkhandlebox.c:184 +#: gtk/gtkhandlebox.c:185 msgid "Position of the handle relative to the child widget" msgstr "" -#: gtk/gtkhandlebox.c:192 +#: gtk/gtkhandlebox.c:193 msgid "Snap edge" msgstr "" -#: gtk/gtkhandlebox.c:193 +#: gtk/gtkhandlebox.c:194 msgid "" "Side of the handlebox that's lined up with the docking point to dock the " "handlebox" msgstr "" -#: gtk/gtkhandlebox.c:201 +#: gtk/gtkhandlebox.c:202 msgid "Snap edge set" msgstr "" -#: gtk/gtkhandlebox.c:202 +#: gtk/gtkhandlebox.c:203 msgid "" "Whether to use the value from the snap_edge property or a value derived from " "handle_position" msgstr "" -#: gtk/gtkhandlebox.c:209 +#: gtk/gtkhandlebox.c:210 msgid "Child Detached" msgstr "" -#: gtk/gtkhandlebox.c:210 +#: gtk/gtkhandlebox.c:211 msgid "" "A boolean value indicating whether the handlebox's child is attached or " "detached." msgstr "" -#: gtk/gtkiconview.c:549 +#: gtk/gtkiconview.c:551 msgid "Selection mode" msgstr "" -#: gtk/gtkiconview.c:550 +#: gtk/gtkiconview.c:552 msgid "The selection mode" msgstr "" -#: gtk/gtkiconview.c:568 +#: gtk/gtkiconview.c:570 #, fuzzy msgid "Pixbuf column" msgstr "ዐምዶች" -#: gtk/gtkiconview.c:569 +#: gtk/gtkiconview.c:571 msgid "Model column used to retrieve the icon pixbuf from" msgstr "" -#: gtk/gtkiconview.c:587 +#: gtk/gtkiconview.c:589 msgid "Model column used to retrieve the text from" msgstr "" -#: gtk/gtkiconview.c:606 +#: gtk/gtkiconview.c:608 msgid "Markup column" msgstr "" -#: gtk/gtkiconview.c:607 +#: gtk/gtkiconview.c:609 msgid "Model column used to retrieve the text if using Pango markup" msgstr "" -#: gtk/gtkiconview.c:614 +#: gtk/gtkiconview.c:616 #, fuzzy msgid "Icon View Model" msgstr "የምልክት መጠን" -#: gtk/gtkiconview.c:615 +#: gtk/gtkiconview.c:617 #, fuzzy msgid "The model for the icon view" msgstr "የመስኮቱ ዓይነት" -#: gtk/gtkiconview.c:631 +#: gtk/gtkiconview.c:633 #, fuzzy msgid "Number of columns" msgstr "ዐምዶች" -#: gtk/gtkiconview.c:632 +#: gtk/gtkiconview.c:634 msgid "Number of columns to display" msgstr "" -#: gtk/gtkiconview.c:649 +#: gtk/gtkiconview.c:651 msgid "Width for each item" msgstr "" -#: gtk/gtkiconview.c:650 +#: gtk/gtkiconview.c:652 msgid "The width used for each item" msgstr "" -#: gtk/gtkiconview.c:666 +#: gtk/gtkiconview.c:668 msgid "Space which is inserted between cells of an item" msgstr "" -#: gtk/gtkiconview.c:681 +#: gtk/gtkiconview.c:683 #, fuzzy msgid "Row Spacing" msgstr "ክፍተት" -#: gtk/gtkiconview.c:682 +#: gtk/gtkiconview.c:684 msgid "Space which is inserted between grid rows" msgstr "" -#: gtk/gtkiconview.c:697 +#: gtk/gtkiconview.c:699 #, fuzzy msgid "Column Spacing" msgstr "ክፍተት" -#: gtk/gtkiconview.c:698 +#: gtk/gtkiconview.c:700 msgid "Space which is inserted between grid columns" msgstr "" -#: gtk/gtkiconview.c:713 +#: gtk/gtkiconview.c:715 #, fuzzy msgid "Margin" msgstr "የግራ ህዳግ" -#: gtk/gtkiconview.c:714 +#: gtk/gtkiconview.c:716 msgid "Space which is inserted at the edges of the icon view" msgstr "" -#: gtk/gtkiconview.c:730 +#: gtk/gtkiconview.c:732 msgid "" "How the text and icon of each item are positioned relative to each other" msgstr "" -#: gtk/gtkiconview.c:746 gtk/gtktreeview.c:612 gtk/gtktreeviewcolumn.c:308 +#: gtk/gtkiconview.c:748 gtk/gtktreeview.c:614 gtk/gtktreeviewcolumn.c:308 msgid "Reorderable" msgstr "" -#: gtk/gtkiconview.c:747 gtk/gtktreeview.c:613 +#: gtk/gtkiconview.c:749 gtk/gtktreeview.c:615 msgid "View is reorderable" msgstr "" -#: gtk/gtkiconview.c:754 gtk/gtktreeview.c:763 +#: gtk/gtkiconview.c:756 gtk/gtktreeview.c:765 #, fuzzy msgid "Tooltip Column" msgstr "ዐምዶች" -#: gtk/gtkiconview.c:755 +#: gtk/gtkiconview.c:757 msgid "The column in the model containing the tooltip texts for the items" msgstr "" -#: gtk/gtkiconview.c:772 +#: gtk/gtkiconview.c:774 #, fuzzy msgid "Item Padding" msgstr "የግራ ህዳግ" -#: gtk/gtkiconview.c:773 +#: gtk/gtkiconview.c:775 msgid "Padding around icon view items" msgstr "" -#: gtk/gtkiconview.c:782 +#: gtk/gtkiconview.c:784 msgid "Selection Box Color" msgstr "" -#: gtk/gtkiconview.c:783 +#: gtk/gtkiconview.c:785 #, fuzzy msgid "Color of the selection box" msgstr "የመስኮቱ አርእስት" -#: gtk/gtkiconview.c:789 +#: gtk/gtkiconview.c:791 msgid "Selection Box Alpha" msgstr "" -#: gtk/gtkiconview.c:790 +#: gtk/gtkiconview.c:792 #, fuzzy msgid "Opacity of the selection box" msgstr "የመስኮቱ አርእስት" -#: gtk/gtkimage.c:222 gtk/gtkstatusicon.c:213 +#: gtk/gtkimage.c:227 gtk/gtkstatusicon.c:218 msgid "Pixbuf" msgstr "" -#: gtk/gtkimage.c:223 gtk/gtkstatusicon.c:214 +#: gtk/gtkimage.c:228 gtk/gtkstatusicon.c:219 msgid "A GdkPixbuf to display" msgstr "" -#: gtk/gtkimage.c:230 +#: gtk/gtkimage.c:235 msgid "Pixmap" msgstr "Pixmap" -#: gtk/gtkimage.c:231 +#: gtk/gtkimage.c:236 msgid "A GdkPixmap to display" msgstr "" -#: gtk/gtkimage.c:238 gtk/gtkmessagedialog.c:215 +#: gtk/gtkimage.c:243 gtk/gtkmessagedialog.c:262 msgid "Image" msgstr "ምስል" -#: gtk/gtkimage.c:239 +#: gtk/gtkimage.c:244 msgid "A GdkImage to display" msgstr "" -#: gtk/gtkimage.c:246 +#: gtk/gtkimage.c:251 msgid "Mask" msgstr "" -#: gtk/gtkimage.c:247 +#: gtk/gtkimage.c:252 msgid "Mask bitmap to use with GdkImage or GdkPixmap" msgstr "" -#: gtk/gtkimage.c:255 gtk/gtkstatusicon.c:222 +#: gtk/gtkimage.c:259 gtk/gtkrecentmanager.c:214 gtk/gtkstatusicon.c:226 +msgid "Filename" +msgstr "የፋይል ስም" + +#: gtk/gtkimage.c:260 gtk/gtkstatusicon.c:227 msgid "Filename to load and display" msgstr "" -#: gtk/gtkimage.c:264 gtk/gtkstatusicon.c:230 +#: gtk/gtkimage.c:269 gtk/gtkstatusicon.c:235 msgid "Stock ID for a stock image to display" msgstr "" -#: gtk/gtkimage.c:271 +#: gtk/gtkimage.c:276 msgid "Icon set" msgstr "" -#: gtk/gtkimage.c:272 +#: gtk/gtkimage.c:277 msgid "Icon set to display" msgstr "" -#: gtk/gtkimage.c:279 gtk/gtkscalebutton.c:216 gtk/gtktoolbar.c:540 -#: gtk/gtktoolpalette.c:990 +#: gtk/gtkimage.c:284 gtk/gtkscalebutton.c:232 gtk/gtktoolbar.c:485 +#: gtk/gtktoolpalette.c:991 msgid "Icon size" msgstr "የምልክት መጠን" -#: gtk/gtkimage.c:280 +#: gtk/gtkimage.c:285 msgid "Symbolic size to use for stock icon, icon set or named icon" msgstr "" -#: gtk/gtkimage.c:296 +#: gtk/gtkimage.c:301 #, fuzzy msgid "Pixel size" msgstr "መጠን" -#: gtk/gtkimage.c:297 +#: gtk/gtkimage.c:302 msgid "Pixel size to use for named icon" msgstr "" -#: gtk/gtkimage.c:305 +#: gtk/gtkimage.c:310 msgid "Animation" msgstr "" -#: gtk/gtkimage.c:306 +#: gtk/gtkimage.c:311 msgid "GdkPixbufAnimation to display" msgstr "" -#: gtk/gtkimage.c:346 gtk/gtkstatusicon.c:261 +#: gtk/gtkimage.c:351 gtk/gtkstatusicon.c:266 msgid "Storage type" msgstr "" -#: gtk/gtkimage.c:347 gtk/gtkstatusicon.c:262 +#: gtk/gtkimage.c:352 gtk/gtkstatusicon.c:267 msgid "The representation being used for image data" msgstr "" @@ -3223,7 +3121,7 @@ msgstr "" msgid "Whether to use the label text to create a stock menu item" msgstr "" -#: gtk/gtkimagemenuitem.c:184 gtk/gtkmenu.c:516 +#: gtk/gtkimagemenuitem.c:184 gtk/gtkmenu.c:523 #, fuzzy msgid "Accel Group" msgstr "ምልክት" @@ -3241,11 +3139,11 @@ msgstr "ማስረጊያዎች አሳይ" msgid "Whether images should be shown in menus" msgstr "" -#: gtk/gtkinfobar.c:384 gtk/gtkmessagedialog.c:128 +#: gtk/gtkinfobar.c:384 gtk/gtkmessagedialog.c:175 msgid "Message Type" msgstr "" -#: gtk/gtkinfobar.c:385 gtk/gtkmessagedialog.c:129 +#: gtk/gtkinfobar.c:385 gtk/gtkmessagedialog.c:176 msgid "The type of message" msgstr "" @@ -3263,144 +3161,144 @@ msgstr "" msgid "Width of border around the action area" msgstr "የጽሑፉ መለያ" -#: gtk/gtkinvisible.c:87 gtk/gtkwindow.c:627 +#: gtk/gtkinvisible.c:87 gtk/gtkwindow.c:651 msgid "The screen where this window will be displayed" msgstr "" -#: gtk/gtklabel.c:507 +#: gtk/gtklabel.c:529 msgid "The text of the label" msgstr "የጽሑፉ መለያ" -#: gtk/gtklabel.c:514 +#: gtk/gtklabel.c:536 msgid "A list of style attributes to apply to the text of the label" msgstr "" -#: gtk/gtklabel.c:535 gtk/gtktexttag.c:359 gtk/gtktextview.c:594 +#: gtk/gtklabel.c:557 gtk/gtktexttag.c:359 gtk/gtktextview.c:594 msgid "Justification" msgstr "" -#: gtk/gtklabel.c:536 +#: gtk/gtklabel.c:558 msgid "" "The alignment of the lines in the text of the label relative to each other. " "This does NOT affect the alignment of the label within its allocation. See " "GtkMisc::xalign for that" msgstr "" -#: gtk/gtklabel.c:544 +#: gtk/gtklabel.c:566 msgid "Pattern" msgstr "ንድፍ" -#: gtk/gtklabel.c:545 +#: gtk/gtklabel.c:567 msgid "" "A string with _ characters in positions correspond to characters in the text " "to underline" msgstr "" -#: gtk/gtklabel.c:552 +#: gtk/gtklabel.c:574 msgid "Line wrap" msgstr "" -#: gtk/gtklabel.c:553 +#: gtk/gtklabel.c:575 msgid "If set, wrap lines if the text becomes too wide" msgstr "" -#: gtk/gtklabel.c:568 +#: gtk/gtklabel.c:590 #, fuzzy msgid "Line wrap mode" msgstr "የመሸፈኛ ዘዴ" -#: gtk/gtklabel.c:569 +#: gtk/gtklabel.c:591 msgid "If wrap is set, controls how linewrapping is done" msgstr "" -#: gtk/gtklabel.c:576 +#: gtk/gtklabel.c:598 msgid "Selectable" msgstr "" -#: gtk/gtklabel.c:577 +#: gtk/gtklabel.c:599 msgid "Whether the label text can be selected with the mouse" msgstr "" -#: gtk/gtklabel.c:583 +#: gtk/gtklabel.c:605 msgid "Mnemonic key" msgstr "" -#: gtk/gtklabel.c:584 +#: gtk/gtklabel.c:606 msgid "The mnemonic accelerator key for this label" msgstr "" -#: gtk/gtklabel.c:592 +#: gtk/gtklabel.c:614 msgid "Mnemonic widget" msgstr "" -#: gtk/gtklabel.c:593 +#: gtk/gtklabel.c:615 msgid "The widget to be activated when the label's mnemonic key is pressed" msgstr "" -#: gtk/gtklabel.c:639 +#: gtk/gtklabel.c:661 msgid "" "The preferred place to ellipsize the string, if the label does not have " "enough room to display the entire string" msgstr "" -#: gtk/gtklabel.c:679 +#: gtk/gtklabel.c:702 msgid "Single Line Mode" msgstr "" -#: gtk/gtklabel.c:680 +#: gtk/gtklabel.c:703 msgid "Whether the label is in single line mode" msgstr "" -#: gtk/gtklabel.c:697 +#: gtk/gtklabel.c:720 msgid "Angle" msgstr "" -#: gtk/gtklabel.c:698 +#: gtk/gtklabel.c:721 msgid "Angle at which the label is rotated" msgstr "" -#: gtk/gtklabel.c:718 +#: gtk/gtklabel.c:742 msgid "Maximum Width In Characters" msgstr "" -#: gtk/gtklabel.c:719 +#: gtk/gtklabel.c:743 msgid "The desired maximum width of the label, in characters" msgstr "" -#: gtk/gtklabel.c:737 +#: gtk/gtklabel.c:761 #, fuzzy msgid "Track visited links" msgstr "የመስኮቱ አርእስት" -#: gtk/gtklabel.c:738 +#: gtk/gtklabel.c:762 msgid "Whether visited links should be tracked" msgstr "" -#: gtk/gtklabel.c:859 +#: gtk/gtklabel.c:883 msgid "Whether to select the contents of a selectable label when it is focused" msgstr "" -#: gtk/gtklayout.c:617 gtk/gtkviewport.c:106 +#: gtk/gtklayout.c:581 gtk/gtkviewport.c:134 msgid "Horizontal adjustment" msgstr "" -#: gtk/gtklayout.c:618 gtk/gtkscrolledwindow.c:219 +#: gtk/gtklayout.c:582 gtk/gtkscrolledwindow.c:236 msgid "The GtkAdjustment for the horizontal position" msgstr "" -#: gtk/gtklayout.c:625 gtk/gtkviewport.c:114 +#: gtk/gtklayout.c:589 gtk/gtkviewport.c:142 msgid "Vertical adjustment" msgstr "" -#: gtk/gtklayout.c:626 gtk/gtkscrolledwindow.c:226 +#: gtk/gtklayout.c:590 gtk/gtkscrolledwindow.c:243 msgid "The GtkAdjustment for the vertical position" msgstr "" -#: gtk/gtklayout.c:634 +#: gtk/gtklayout.c:598 msgid "The width of the layout" msgstr "" -#: gtk/gtklayout.c:643 +#: gtk/gtklayout.c:607 msgid "The height of the layout" msgstr "" @@ -3421,182 +3319,182 @@ msgstr "የሚታይ" msgid "Whether this link has been visited." msgstr "" -#: gtk/gtkmenu.c:502 +#: gtk/gtkmenu.c:509 #, fuzzy msgid "The currently selected menu item" msgstr "የጽሑፉ መለያ" -#: gtk/gtkmenu.c:517 +#: gtk/gtkmenu.c:524 msgid "The accel group holding accelerators for the menu" msgstr "" -#: gtk/gtkmenu.c:531 gtk/gtkmenuitem.c:290 +#: gtk/gtkmenu.c:538 gtk/gtkmenuitem.c:290 msgid "Accel Path" msgstr "" -#: gtk/gtkmenu.c:532 +#: gtk/gtkmenu.c:539 msgid "An accel path used to conveniently construct accel paths of child items" msgstr "" -#: gtk/gtkmenu.c:548 +#: gtk/gtkmenu.c:555 #, fuzzy msgid "Attach Widget" msgstr "ስፋት" -#: gtk/gtkmenu.c:549 +#: gtk/gtkmenu.c:556 msgid "The widget the menu is attached to" msgstr "" -#: gtk/gtkmenu.c:557 +#: gtk/gtkmenu.c:564 msgid "" "A title that may be displayed by the window manager when this menu is torn-" "off" msgstr "" -#: gtk/gtkmenu.c:571 +#: gtk/gtkmenu.c:578 msgid "Tearoff State" msgstr "" -#: gtk/gtkmenu.c:572 +#: gtk/gtkmenu.c:579 msgid "A boolean that indicates whether the menu is torn-off" msgstr "" -#: gtk/gtkmenu.c:586 -#, fuzzy -msgid "Monitor" -msgstr "የፊደል ቅርጽ" - -#: gtk/gtkmenu.c:587 -msgid "The monitor the menu will be popped up on" -msgstr "" - #: gtk/gtkmenu.c:593 #, fuzzy +msgid "Monitor" +msgstr "የፊደል ቅርጽ" + +#: gtk/gtkmenu.c:594 +msgid "The monitor the menu will be popped up on" +msgstr "" + +#: gtk/gtkmenu.c:600 +#, fuzzy msgid "Vertical Padding" msgstr "የቁመት ኩልኩል" -#: gtk/gtkmenu.c:594 +#: gtk/gtkmenu.c:601 msgid "Extra space at the top and bottom of the menu" msgstr "" -#: gtk/gtkmenu.c:616 +#: gtk/gtkmenu.c:623 msgid "Reserve Toggle Size" msgstr "" -#: gtk/gtkmenu.c:617 +#: gtk/gtkmenu.c:624 msgid "" "A boolean that indicates whether the menu reserves space for toggles and " "icons" msgstr "" -#: gtk/gtkmenu.c:623 +#: gtk/gtkmenu.c:630 #, fuzzy msgid "Horizontal Padding" msgstr "የአግድም ኩልኩል" -#: gtk/gtkmenu.c:624 +#: gtk/gtkmenu.c:631 msgid "Extra space at the left and right edges of the menu" msgstr "" -#: gtk/gtkmenu.c:632 +#: gtk/gtkmenu.c:639 #, fuzzy msgid "Vertical Offset" msgstr "የቁመት ኩልኩል" -#: gtk/gtkmenu.c:633 +#: gtk/gtkmenu.c:640 msgid "" "When the menu is a submenu, position it this number of pixels offset " "vertically" msgstr "" -#: gtk/gtkmenu.c:641 +#: gtk/gtkmenu.c:648 #, fuzzy msgid "Horizontal Offset" msgstr "የአግድም ኩልኩል" -#: gtk/gtkmenu.c:642 +#: gtk/gtkmenu.c:649 msgid "" "When the menu is a submenu, position it this number of pixels offset " "horizontally" msgstr "" -#: gtk/gtkmenu.c:650 +#: gtk/gtkmenu.c:657 msgid "Double Arrows" msgstr "" -#: gtk/gtkmenu.c:651 +#: gtk/gtkmenu.c:658 msgid "When scrolling, always show both arrows." msgstr "" -#: gtk/gtkmenu.c:664 +#: gtk/gtkmenu.c:671 #, fuzzy msgid "Arrow Placement" msgstr "ክፍተት" -#: gtk/gtkmenu.c:665 +#: gtk/gtkmenu.c:672 msgid "Indicates where scroll arrows should be placed" msgstr "" -#: gtk/gtkmenu.c:673 +#: gtk/gtkmenu.c:680 msgid "Left Attach" msgstr "" -#: gtk/gtkmenu.c:674 gtk/gtktable.c:174 +#: gtk/gtkmenu.c:681 gtk/gtktable.c:174 msgid "The column number to attach the left side of the child to" msgstr "" -#: gtk/gtkmenu.c:681 +#: gtk/gtkmenu.c:688 msgid "Right Attach" msgstr "" -#: gtk/gtkmenu.c:682 +#: gtk/gtkmenu.c:689 msgid "The column number to attach the right side of the child to" msgstr "" -#: gtk/gtkmenu.c:689 +#: gtk/gtkmenu.c:696 msgid "Top Attach" msgstr "" -#: gtk/gtkmenu.c:690 +#: gtk/gtkmenu.c:697 msgid "The row number to attach the top of the child to" msgstr "" -#: gtk/gtkmenu.c:697 +#: gtk/gtkmenu.c:704 #, fuzzy msgid "Bottom Attach" msgstr "ወደ ታች (_B)" -#: gtk/gtkmenu.c:698 gtk/gtktable.c:195 +#: gtk/gtkmenu.c:705 gtk/gtktable.c:195 msgid "The row number to attach the bottom of the child to" msgstr "" -#: gtk/gtkmenu.c:712 +#: gtk/gtkmenu.c:719 msgid "Arbitrary constant to scale down the size of the scroll arrow" msgstr "" -#: gtk/gtkmenu.c:799 +#: gtk/gtkmenu.c:806 msgid "Can change accelerators" msgstr "" -#: gtk/gtkmenu.c:800 +#: gtk/gtkmenu.c:807 msgid "" "Whether menu accelerators can be changed by pressing a key over the menu item" msgstr "" -#: gtk/gtkmenu.c:805 +#: gtk/gtkmenu.c:812 msgid "Delay before submenus appear" msgstr "" -#: gtk/gtkmenu.c:806 +#: gtk/gtkmenu.c:813 msgid "" "Minimum time the pointer must stay over a menu item before the submenu appear" msgstr "" -#: gtk/gtkmenu.c:813 +#: gtk/gtkmenu.c:820 msgid "Delay before hiding a submenu" msgstr "" -#: gtk/gtkmenu.c:814 +#: gtk/gtkmenu.c:821 msgid "" "The time before hiding a submenu when the pointer is moving towards the " "submenu" @@ -3624,7 +3522,7 @@ msgstr "" msgid "Style of bevel around the menubar" msgstr "" -#: gtk/gtkmenubar.c:202 gtk/gtktoolbar.c:590 +#: gtk/gtkmenubar.c:202 gtk/gtktoolbar.c:535 msgid "Internal padding" msgstr "" @@ -3678,78 +3576,78 @@ msgstr "" msgid "The minimum desired width of the menu item in characters" msgstr "" -#: gtk/gtkmenushell.c:379 +#: gtk/gtkmenushell.c:382 msgid "Take Focus" msgstr "" -#: gtk/gtkmenushell.c:380 +#: gtk/gtkmenushell.c:383 msgid "A boolean that determines whether the menu grabs the keyboard focus" msgstr "" -#: gtk/gtkmenutoolbutton.c:245 gtk/gtkoptionmenu.c:161 +#: gtk/gtkmenutoolbutton.c:243 msgid "Menu" msgstr "ሜኑ" -#: gtk/gtkmenutoolbutton.c:246 +#: gtk/gtkmenutoolbutton.c:244 msgid "The dropdown menu" msgstr "" -#: gtk/gtkmessagedialog.c:98 +#: gtk/gtkmessagedialog.c:145 msgid "Image/label border" msgstr "" -#: gtk/gtkmessagedialog.c:99 +#: gtk/gtkmessagedialog.c:146 msgid "Width of border around the label and image in the message dialog" msgstr "" -#: gtk/gtkmessagedialog.c:114 +#: gtk/gtkmessagedialog.c:161 msgid "Use separator" msgstr "" -#: gtk/gtkmessagedialog.c:115 +#: gtk/gtkmessagedialog.c:162 msgid "" "Whether to put a separator between the message dialog's text and the buttons" msgstr "" -#: gtk/gtkmessagedialog.c:136 +#: gtk/gtkmessagedialog.c:183 msgid "Message Buttons" msgstr "" -#: gtk/gtkmessagedialog.c:137 +#: gtk/gtkmessagedialog.c:184 msgid "The buttons shown in the message dialog" msgstr "" -#: gtk/gtkmessagedialog.c:154 +#: gtk/gtkmessagedialog.c:201 #, fuzzy msgid "The primary text of the message dialog" msgstr "የመስኮቱ አርእስት" -#: gtk/gtkmessagedialog.c:169 +#: gtk/gtkmessagedialog.c:216 msgid "Use Markup" msgstr "" -#: gtk/gtkmessagedialog.c:170 +#: gtk/gtkmessagedialog.c:217 msgid "The primary text of the title includes Pango markup." msgstr "" -#: gtk/gtkmessagedialog.c:184 +#: gtk/gtkmessagedialog.c:231 msgid "Secondary Text" msgstr "" -#: gtk/gtkmessagedialog.c:185 +#: gtk/gtkmessagedialog.c:232 #, fuzzy msgid "The secondary text of the message dialog" msgstr "የመስኮቱ አርእስት" -#: gtk/gtkmessagedialog.c:200 +#: gtk/gtkmessagedialog.c:247 msgid "Use Markup in secondary" msgstr "" -#: gtk/gtkmessagedialog.c:201 +#: gtk/gtkmessagedialog.c:248 msgid "The secondary text includes Pango markup." msgstr "" -#: gtk/gtkmessagedialog.c:216 +#: gtk/gtkmessagedialog.c:263 #, fuzzy msgid "The image" msgstr "የጭብጥ ስም" @@ -3802,296 +3700,239 @@ msgstr "" msgid "The screen where this window will be displayed." msgstr "" -#: gtk/gtknotebook.c:585 +#: gtk/gtknotebook.c:571 msgid "Page" msgstr "ገጽ" -#: gtk/gtknotebook.c:586 +#: gtk/gtknotebook.c:572 msgid "The index of the current page" msgstr "" -#: gtk/gtknotebook.c:594 +#: gtk/gtknotebook.c:580 msgid "Tab Position" msgstr "" -#: gtk/gtknotebook.c:595 +#: gtk/gtknotebook.c:581 msgid "Which side of the notebook holds the tabs" msgstr "" -#: gtk/gtknotebook.c:602 -msgid "Tab Border" -msgstr "" - -#: gtk/gtknotebook.c:603 -msgid "Width of the border around the tab labels" -msgstr "" - -#: gtk/gtknotebook.c:611 -msgid "Horizontal Tab Border" -msgstr "" - -#: gtk/gtknotebook.c:612 -msgid "Width of the horizontal border of tab labels" -msgstr "" - -#: gtk/gtknotebook.c:620 -msgid "Vertical Tab Border" -msgstr "" - -#: gtk/gtknotebook.c:621 -msgid "Width of the vertical border of tab labels" -msgstr "" - -#: gtk/gtknotebook.c:629 +#: gtk/gtknotebook.c:588 msgid "Show Tabs" msgstr "ማስረጊያዎች አሳይ" -#: gtk/gtknotebook.c:630 +#: gtk/gtknotebook.c:589 msgid "Whether tabs should be shown or not" msgstr "" -#: gtk/gtknotebook.c:636 +#: gtk/gtknotebook.c:595 msgid "Show Border" msgstr "" -#: gtk/gtknotebook.c:637 +#: gtk/gtknotebook.c:596 msgid "Whether the border should be shown or not" msgstr "" -#: gtk/gtknotebook.c:643 +#: gtk/gtknotebook.c:602 msgid "Scrollable" msgstr "" -#: gtk/gtknotebook.c:644 +#: gtk/gtknotebook.c:603 msgid "If TRUE, scroll arrows are added if there are too many tabs to fit" msgstr "" -#: gtk/gtknotebook.c:650 +#: gtk/gtknotebook.c:609 msgid "Enable Popup" msgstr "" -#: gtk/gtknotebook.c:651 +#: gtk/gtknotebook.c:610 msgid "" "If TRUE, pressing the right mouse button on the notebook pops up a menu that " "you can use to go to a page" msgstr "" -#: gtk/gtknotebook.c:658 -msgid "Whether tabs should have homogeneous sizes" -msgstr "" - -#: gtk/gtknotebook.c:664 -#, fuzzy -msgid "Group ID" -msgstr "መድረክ" - -#: gtk/gtknotebook.c:665 -msgid "Group ID for tabs drag and drop" -msgstr "" - -#: gtk/gtknotebook.c:681 gtk/gtkradioaction.c:128 gtk/gtkradiobutton.c:82 +#: gtk/gtknotebook.c:624 gtk/gtkradioaction.c:140 gtk/gtkradiobutton.c:159 #: gtk/gtkradiomenuitem.c:353 gtk/gtkradiotoolbutton.c:65 msgid "Group" msgstr "መድረክ" -#: gtk/gtknotebook.c:682 +#: gtk/gtknotebook.c:625 msgid "Group for tabs drag and drop" msgstr "" -#: gtk/gtknotebook.c:688 +#: gtk/gtknotebook.c:631 msgid "Tab label" msgstr "" -#: gtk/gtknotebook.c:689 +#: gtk/gtknotebook.c:632 msgid "The string displayed on the child's tab label" msgstr "" -#: gtk/gtknotebook.c:695 +#: gtk/gtknotebook.c:638 msgid "Menu label" msgstr "" -#: gtk/gtknotebook.c:696 +#: gtk/gtknotebook.c:639 msgid "The string displayed in the child's menu entry" msgstr "" -#: gtk/gtknotebook.c:709 +#: gtk/gtknotebook.c:652 msgid "Tab expand" msgstr "" -#: gtk/gtknotebook.c:710 +#: gtk/gtknotebook.c:653 msgid "Whether to expand the child's tab or not" msgstr "" -#: gtk/gtknotebook.c:716 +#: gtk/gtknotebook.c:659 msgid "Tab fill" msgstr "" -#: gtk/gtknotebook.c:717 +#: gtk/gtknotebook.c:660 msgid "Whether the child's tab should fill the allocated area or not" msgstr "" -#: gtk/gtknotebook.c:723 +#: gtk/gtknotebook.c:666 msgid "Tab pack type" msgstr "" -#: gtk/gtknotebook.c:730 +#: gtk/gtknotebook.c:673 msgid "Tab reorderable" msgstr "" -#: gtk/gtknotebook.c:731 +#: gtk/gtknotebook.c:674 msgid "Whether the tab is reorderable by user action or not" msgstr "" -#: gtk/gtknotebook.c:737 +#: gtk/gtknotebook.c:680 msgid "Tab detachable" msgstr "" -#: gtk/gtknotebook.c:738 +#: gtk/gtknotebook.c:681 msgid "Whether the tab is detachable" msgstr "" -#: gtk/gtknotebook.c:753 gtk/gtkscrollbar.c:81 +#: gtk/gtknotebook.c:696 gtk/gtkscrollbar.c:81 msgid "Secondary backward stepper" msgstr "" -#: gtk/gtknotebook.c:754 +#: gtk/gtknotebook.c:697 msgid "" "Display a second backward arrow button on the opposite end of the tab area" msgstr "" -#: gtk/gtknotebook.c:769 gtk/gtkscrollbar.c:88 +#: gtk/gtknotebook.c:712 gtk/gtkscrollbar.c:88 msgid "Secondary forward stepper" msgstr "" -#: gtk/gtknotebook.c:770 +#: gtk/gtknotebook.c:713 msgid "" "Display a second forward arrow button on the opposite end of the tab area" msgstr "" -#: gtk/gtknotebook.c:784 gtk/gtkscrollbar.c:67 +#: gtk/gtknotebook.c:727 gtk/gtkscrollbar.c:67 msgid "Backward stepper" msgstr "" -#: gtk/gtknotebook.c:785 gtk/gtkscrollbar.c:68 +#: gtk/gtknotebook.c:728 gtk/gtkscrollbar.c:68 msgid "Display the standard backward arrow button" msgstr "" -#: gtk/gtknotebook.c:799 gtk/gtkscrollbar.c:74 +#: gtk/gtknotebook.c:742 gtk/gtkscrollbar.c:74 msgid "Forward stepper" msgstr "" -#: gtk/gtknotebook.c:800 gtk/gtkscrollbar.c:75 +#: gtk/gtknotebook.c:743 gtk/gtkscrollbar.c:75 msgid "Display the standard forward arrow button" msgstr "" -#: gtk/gtknotebook.c:814 +#: gtk/gtknotebook.c:757 msgid "Tab overlap" msgstr "" -#: gtk/gtknotebook.c:815 +#: gtk/gtknotebook.c:758 msgid "Size of tab overlap area" msgstr "" -#: gtk/gtknotebook.c:830 +#: gtk/gtknotebook.c:773 msgid "Tab curvature" msgstr "" -#: gtk/gtknotebook.c:831 +#: gtk/gtknotebook.c:774 msgid "Size of tab curvature" msgstr "" -#: gtk/gtknotebook.c:847 +#: gtk/gtknotebook.c:790 #, fuzzy msgid "Arrow spacing" msgstr "ክፍተት" -#: gtk/gtknotebook.c:848 +#: gtk/gtknotebook.c:791 #, fuzzy msgid "Scroll arrow spacing" msgstr "ክፍተት" -#: gtk/gtkobject.c:370 -msgid "User Data" -msgstr "" - -#: gtk/gtkobject.c:371 -msgid "Anonymous User Data Pointer" -msgstr "" - -#: gtk/gtkoptionmenu.c:162 -msgid "The menu of options" -msgstr "" - -#: gtk/gtkoptionmenu.c:169 -msgid "Size of dropdown indicator" -msgstr "" - -#: gtk/gtkoptionmenu.c:175 -msgid "Spacing around indicator" -msgstr "" - -#: gtk/gtkorientable.c:75 +#: gtk/gtkorientable.c:64 #, fuzzy msgid "The orientation of the orientable" msgstr "የጽሑፉ መለያ" -#: gtk/gtkpaned.c:242 +#: gtk/gtkpaned.c:243 msgid "" "Position of paned separator in pixels (0 means all the way to the left/top)" msgstr "" -#: gtk/gtkpaned.c:251 +#: gtk/gtkpaned.c:252 msgid "Position Set" msgstr "" -#: gtk/gtkpaned.c:252 +#: gtk/gtkpaned.c:253 msgid "TRUE if the Position property should be used" msgstr "" -#: gtk/gtkpaned.c:258 +#: gtk/gtkpaned.c:259 msgid "Handle Size" msgstr "" -#: gtk/gtkpaned.c:259 +#: gtk/gtkpaned.c:260 msgid "Width of handle" msgstr "" -#: gtk/gtkpaned.c:275 +#: gtk/gtkpaned.c:276 #, fuzzy msgid "Minimal Position" msgstr "የመስኮት ቦታ" -#: gtk/gtkpaned.c:276 +#: gtk/gtkpaned.c:277 msgid "Smallest possible value for the \"position\" property" msgstr "" -#: gtk/gtkpaned.c:293 +#: gtk/gtkpaned.c:294 #, fuzzy msgid "Maximal Position" msgstr "ቦታ" -#: gtk/gtkpaned.c:294 +#: gtk/gtkpaned.c:295 msgid "Largest possible value for the \"position\" property" msgstr "" -#: gtk/gtkpaned.c:311 +#: gtk/gtkpaned.c:312 #, fuzzy msgid "Resize" msgstr "መጠን" -#: gtk/gtkpaned.c:312 +#: gtk/gtkpaned.c:313 msgid "If TRUE, the child expands and shrinks along with the paned widget" msgstr "" -#: gtk/gtkpaned.c:327 +#: gtk/gtkpaned.c:328 msgid "Shrink" msgstr "" -#: gtk/gtkpaned.c:328 +#: gtk/gtkpaned.c:329 msgid "If TRUE, the child can be made smaller than its requisition" msgstr "" -#: gtk/gtkplug.c:171 gtk/gtkstatusicon.c:312 +#: gtk/gtkplug.c:171 gtk/gtkstatusicon.c:317 msgid "Embedded" msgstr "" @@ -4107,93 +3948,88 @@ msgstr "" msgid "The window of the socket the plug is embedded in" msgstr "" -#: gtk/gtkpreview.c:102 -msgid "" -"Whether the preview widget should take up the entire space it is allocated" -msgstr "" - -#: gtk/gtkprinter.c:112 +#: gtk/gtkprinter.c:131 #, fuzzy msgid "Name of the printer" msgstr "የጽሑፉ መለያ" -#: gtk/gtkprinter.c:118 +#: gtk/gtkprinter.c:137 msgid "Backend" msgstr "" -#: gtk/gtkprinter.c:119 +#: gtk/gtkprinter.c:138 msgid "Backend for the printer" msgstr "" -#: gtk/gtkprinter.c:125 +#: gtk/gtkprinter.c:144 msgid "Is Virtual" msgstr "" -#: gtk/gtkprinter.c:126 +#: gtk/gtkprinter.c:145 msgid "FALSE if this represents a real hardware printer" msgstr "" -#: gtk/gtkprinter.c:132 +#: gtk/gtkprinter.c:151 msgid "Accepts PDF" msgstr "" -#: gtk/gtkprinter.c:133 +#: gtk/gtkprinter.c:152 msgid "TRUE if this printer can accept PDF" msgstr "" -#: gtk/gtkprinter.c:139 +#: gtk/gtkprinter.c:158 msgid "Accepts PostScript" msgstr "" -#: gtk/gtkprinter.c:140 +#: gtk/gtkprinter.c:159 msgid "TRUE if this printer can accept PostScript" msgstr "" -#: gtk/gtkprinter.c:146 +#: gtk/gtkprinter.c:165 msgid "State Message" msgstr "" -#: gtk/gtkprinter.c:147 +#: gtk/gtkprinter.c:166 msgid "String giving the current state of the printer" msgstr "" -#: gtk/gtkprinter.c:153 +#: gtk/gtkprinter.c:172 #, fuzzy msgid "Location" msgstr "ምልክት" -#: gtk/gtkprinter.c:154 +#: gtk/gtkprinter.c:173 #, fuzzy msgid "The location of the printer" msgstr "የጽሑፉ መለያ" -#: gtk/gtkprinter.c:161 +#: gtk/gtkprinter.c:180 #, fuzzy msgid "The icon name to use for the printer" msgstr "የጽሑፉ መለያ" -#: gtk/gtkprinter.c:167 +#: gtk/gtkprinter.c:186 msgid "Job Count" msgstr "" -#: gtk/gtkprinter.c:168 +#: gtk/gtkprinter.c:187 msgid "Number of jobs queued in the printer" msgstr "" -#: gtk/gtkprinter.c:186 +#: gtk/gtkprinter.c:205 #, fuzzy msgid "Paused Printer" msgstr "ፋይሎች" -#: gtk/gtkprinter.c:187 +#: gtk/gtkprinter.c:206 msgid "TRUE if this printer is paused" msgstr "" -#: gtk/gtkprinter.c:200 +#: gtk/gtkprinter.c:219 msgid "Accepting Jobs" msgstr "" -#: gtk/gtkprinter.c:201 +#: gtk/gtkprinter.c:220 msgid "TRUE if this printer is accepting new jobs" msgstr "" @@ -4374,7 +4210,7 @@ msgid "Has Selection" msgstr "የመስኮቱ አርእስት" #: gtk/gtkprintoperation.c:1297 -msgid "TRUE if a selecion exists." +msgid "TRUE if a selection exists." msgstr "" #: gtk/gtkprintoperation.c:1312 gtk/gtkprintunixdialog.c:361 @@ -4447,154 +4283,114 @@ msgstr "ጽሑፍ አሳይ" msgid "Whether the progress is shown as text." msgstr "" -#: gtk/gtkprogressbar.c:119 -msgid "The GtkAdjustment connected to the progress bar (Deprecated)" -msgstr "" - -#: gtk/gtkprogressbar.c:135 -msgid "Bar style" -msgstr "" - -#: gtk/gtkprogressbar.c:136 -msgid "Specifies the visual style of the bar in percentage mode (Deprecated)" -msgstr "" - -#: gtk/gtkprogressbar.c:144 -msgid "Activity Step" -msgstr "" - -#: gtk/gtkprogressbar.c:145 -msgid "The increment used for each iteration in activity mode (Deprecated)" -msgstr "" - -#: gtk/gtkprogressbar.c:152 -msgid "Activity Blocks" -msgstr "" - -#: gtk/gtkprogressbar.c:153 -msgid "" -"The number of blocks which can fit in the progress bar area in activity mode " -"(Deprecated)" -msgstr "" - -#: gtk/gtkprogressbar.c:160 -msgid "Discrete Blocks" -msgstr "" - -#: gtk/gtkprogressbar.c:161 -msgid "" -"The number of discrete blocks in a progress bar (when shown in the discrete " -"style)" -msgstr "" - -#: gtk/gtkprogressbar.c:168 +#: gtk/gtkprogressbar.c:121 msgid "Fraction" msgstr "" -#: gtk/gtkprogressbar.c:169 +#: gtk/gtkprogressbar.c:122 msgid "The fraction of total work that has been completed" msgstr "" -#: gtk/gtkprogressbar.c:176 +#: gtk/gtkprogressbar.c:129 msgid "Pulse Step" msgstr "" -#: gtk/gtkprogressbar.c:177 +#: gtk/gtkprogressbar.c:130 msgid "The fraction of total progress to move the bouncing block when pulsed" msgstr "" -#: gtk/gtkprogressbar.c:185 +#: gtk/gtkprogressbar.c:138 msgid "Text to be displayed in the progress bar" msgstr "" -#: gtk/gtkprogressbar.c:207 +#: gtk/gtkprogressbar.c:160 msgid "" "The preferred place to ellipsize the string, if the progress bar does not " "have enough room to display the entire string, if at all." msgstr "" -#: gtk/gtkprogressbar.c:214 +#: gtk/gtkprogressbar.c:167 #, fuzzy msgid "XSpacing" msgstr "ክፍተት" -#: gtk/gtkprogressbar.c:215 +#: gtk/gtkprogressbar.c:168 msgid "Extra spacing applied to the width of a progress bar." msgstr "" -#: gtk/gtkprogressbar.c:220 +#: gtk/gtkprogressbar.c:173 #, fuzzy msgid "YSpacing" msgstr "ክፍተት" -#: gtk/gtkprogressbar.c:221 +#: gtk/gtkprogressbar.c:174 msgid "Extra spacing applied to the height of a progress bar." msgstr "" -#: gtk/gtkprogressbar.c:234 +#: gtk/gtkprogressbar.c:187 msgid "Min horizontal bar width" msgstr "" -#: gtk/gtkprogressbar.c:235 +#: gtk/gtkprogressbar.c:188 #, fuzzy msgid "The minimum horizontal width of the progress bar" msgstr "የጽሑፉ መለያ" -#: gtk/gtkprogressbar.c:247 +#: gtk/gtkprogressbar.c:200 #, fuzzy msgid "Min horizontal bar height" msgstr "የአግድም ኩልኩል" -#: gtk/gtkprogressbar.c:248 +#: gtk/gtkprogressbar.c:201 #, fuzzy msgid "Minimum horizontal height of the progress bar" msgstr "የጽሑፉ መለያ" -#: gtk/gtkprogressbar.c:260 +#: gtk/gtkprogressbar.c:213 msgid "Min vertical bar width" msgstr "" -#: gtk/gtkprogressbar.c:261 +#: gtk/gtkprogressbar.c:214 #, fuzzy msgid "The minimum vertical width of the progress bar" msgstr "የጽሑፉ መለያ" -#: gtk/gtkprogressbar.c:273 +#: gtk/gtkprogressbar.c:226 msgid "Min vertical bar height" msgstr "" -#: gtk/gtkprogressbar.c:274 +#: gtk/gtkprogressbar.c:227 #, fuzzy msgid "The minimum vertical height of the progress bar" msgstr "የጽሑፉ መለያ" -#: gtk/gtkradioaction.c:111 +#: gtk/gtkradioaction.c:123 #, fuzzy msgid "The value" msgstr "የጭብጥ ስም" -#: gtk/gtkradioaction.c:112 +#: gtk/gtkradioaction.c:124 msgid "" "The value returned by gtk_radio_action_get_current_value() when this action " "is the current action of its group." msgstr "" -#: gtk/gtkradioaction.c:129 +#: gtk/gtkradioaction.c:141 msgid "The radio action whose group this action belongs to." msgstr "" -#: gtk/gtkradioaction.c:144 +#: gtk/gtkradioaction.c:156 #, fuzzy msgid "The current value" msgstr "የጭብጥ ስም" -#: gtk/gtkradioaction.c:145 +#: gtk/gtkradioaction.c:157 msgid "" "The value property of the currently active member of the group to which this " "action belongs." msgstr "" -#: gtk/gtkradiobutton.c:83 +#: gtk/gtkradiobutton.c:160 msgid "The radio button whose group this widget belongs to." msgstr "" @@ -4606,243 +4402,243 @@ msgstr "" msgid "The radio tool button whose group this button belongs to." msgstr "" -#: gtk/gtkrange.c:358 +#: gtk/gtkrange.c:385 msgid "Update policy" msgstr "" -#: gtk/gtkrange.c:359 +#: gtk/gtkrange.c:386 msgid "How the range should be updated on the screen" msgstr "" -#: gtk/gtkrange.c:368 +#: gtk/gtkrange.c:395 msgid "The GtkAdjustment that contains the current value of this range object" msgstr "" -#: gtk/gtkrange.c:375 +#: gtk/gtkrange.c:402 msgid "Inverted" msgstr "" -#: gtk/gtkrange.c:376 +#: gtk/gtkrange.c:403 msgid "Invert direction slider moves to increase range value" msgstr "" -#: gtk/gtkrange.c:383 +#: gtk/gtkrange.c:410 msgid "Lower stepper sensitivity" msgstr "" -#: gtk/gtkrange.c:384 +#: gtk/gtkrange.c:411 msgid "" "The sensitivity policy for the stepper that points to the adjustment's lower " "side" msgstr "" -#: gtk/gtkrange.c:392 +#: gtk/gtkrange.c:419 msgid "Upper stepper sensitivity" msgstr "" -#: gtk/gtkrange.c:393 +#: gtk/gtkrange.c:420 msgid "" "The sensitivity policy for the stepper that points to the adjustment's upper " "side" msgstr "" -#: gtk/gtkrange.c:410 +#: gtk/gtkrange.c:437 msgid "Show Fill Level" msgstr "" -#: gtk/gtkrange.c:411 +#: gtk/gtkrange.c:438 msgid "Whether to display a fill level indicator graphics on trough." msgstr "" -#: gtk/gtkrange.c:427 +#: gtk/gtkrange.c:454 msgid "Restrict to Fill Level" msgstr "" -#: gtk/gtkrange.c:428 +#: gtk/gtkrange.c:455 msgid "Whether to restrict the upper boundary to the fill level." msgstr "" -#: gtk/gtkrange.c:443 +#: gtk/gtkrange.c:470 msgid "Fill Level" msgstr "" -#: gtk/gtkrange.c:444 +#: gtk/gtkrange.c:471 msgid "The fill level." msgstr "" -#: gtk/gtkrange.c:452 +#: gtk/gtkrange.c:479 msgid "Slider Width" msgstr "" -#: gtk/gtkrange.c:453 +#: gtk/gtkrange.c:480 msgid "Width of scrollbar or scale thumb" msgstr "" -#: gtk/gtkrange.c:460 +#: gtk/gtkrange.c:487 msgid "Trough Border" msgstr "" -#: gtk/gtkrange.c:461 +#: gtk/gtkrange.c:488 msgid "Spacing between thumb/steppers and outer trough bevel" msgstr "" -#: gtk/gtkrange.c:468 +#: gtk/gtkrange.c:495 msgid "Stepper Size" msgstr "" -#: gtk/gtkrange.c:469 +#: gtk/gtkrange.c:496 msgid "Length of step buttons at ends" msgstr "" -#: gtk/gtkrange.c:484 +#: gtk/gtkrange.c:511 msgid "Stepper Spacing" msgstr "" -#: gtk/gtkrange.c:485 +#: gtk/gtkrange.c:512 msgid "Spacing between step buttons and thumb" msgstr "" -#: gtk/gtkrange.c:492 +#: gtk/gtkrange.c:519 msgid "Arrow X Displacement" msgstr "" -#: gtk/gtkrange.c:493 +#: gtk/gtkrange.c:520 msgid "" "How far in the x direction to move the arrow when the button is depressed" msgstr "" -#: gtk/gtkrange.c:500 +#: gtk/gtkrange.c:527 msgid "Arrow Y Displacement" msgstr "" -#: gtk/gtkrange.c:501 +#: gtk/gtkrange.c:528 msgid "" "How far in the y direction to move the arrow when the button is depressed" msgstr "" -#: gtk/gtkrange.c:509 +#: gtk/gtkrange.c:536 msgid "Draw slider ACTIVE during drag" msgstr "" -#: gtk/gtkrange.c:510 +#: gtk/gtkrange.c:537 msgid "" "With this option set to TRUE, sliders will be drawn ACTIVE and with shadow " "IN while they are dragged" msgstr "" -#: gtk/gtkrange.c:524 +#: gtk/gtkrange.c:551 msgid "Trough Side Details" msgstr "" -#: gtk/gtkrange.c:525 +#: gtk/gtkrange.c:552 msgid "" "When TRUE, the parts of the trough on the two sides of the slider are drawn " "with different details" msgstr "" -#: gtk/gtkrange.c:541 +#: gtk/gtkrange.c:568 msgid "Trough Under Steppers" msgstr "" -#: gtk/gtkrange.c:542 +#: gtk/gtkrange.c:569 msgid "" "Whether to draw trough for full length of range or exclude the steppers and " "spacing" msgstr "" -#: gtk/gtkrange.c:555 +#: gtk/gtkrange.c:582 #, fuzzy msgid "Arrow scaling" msgstr "ክፍተት" -#: gtk/gtkrange.c:556 +#: gtk/gtkrange.c:583 msgid "Arrow scaling with regard to scroll button size" msgstr "" -#: gtk/gtkrecentaction.c:616 gtk/gtkrecentchoosermenu.c:227 +#: gtk/gtkrecentaction.c:633 gtk/gtkrecentchoosermenu.c:255 #, fuzzy msgid "Show Numbers" msgstr "ማስረጊያዎች አሳይ" -#: gtk/gtkrecentaction.c:617 gtk/gtkrecentchoosermenu.c:228 +#: gtk/gtkrecentaction.c:634 gtk/gtkrecentchoosermenu.c:256 msgid "Whether the items should be displayed with a number" msgstr "" -#: gtk/gtkrecentchooser.c:132 +#: gtk/gtkrecentchooser.c:149 msgid "Recent Manager" msgstr "" -#: gtk/gtkrecentchooser.c:133 +#: gtk/gtkrecentchooser.c:150 msgid "The RecentManager object to use" msgstr "" -#: gtk/gtkrecentchooser.c:147 +#: gtk/gtkrecentchooser.c:164 #, fuzzy msgid "Show Private" msgstr "ጽሑፍ አሳይ" -#: gtk/gtkrecentchooser.c:148 +#: gtk/gtkrecentchooser.c:165 msgid "Whether the private items should be displayed" msgstr "" -#: gtk/gtkrecentchooser.c:161 +#: gtk/gtkrecentchooser.c:178 #, fuzzy msgid "Show Tooltips" msgstr "ማስረጊያዎች አሳይ" -#: gtk/gtkrecentchooser.c:162 +#: gtk/gtkrecentchooser.c:179 msgid "Whether there should be a tooltip on the item" msgstr "" -#: gtk/gtkrecentchooser.c:174 +#: gtk/gtkrecentchooser.c:191 #, fuzzy msgid "Show Icons" msgstr "ማስረጊያዎች አሳይ" -#: gtk/gtkrecentchooser.c:175 +#: gtk/gtkrecentchooser.c:192 msgid "Whether there should be an icon near the item" msgstr "" -#: gtk/gtkrecentchooser.c:190 +#: gtk/gtkrecentchooser.c:207 msgid "Show Not Found" msgstr "" -#: gtk/gtkrecentchooser.c:191 +#: gtk/gtkrecentchooser.c:208 msgid "Whether the items pointing to unavailable resources should be displayed" msgstr "" -#: gtk/gtkrecentchooser.c:204 +#: gtk/gtkrecentchooser.c:221 msgid "Whether to allow multiple items to be selected" msgstr "" -#: gtk/gtkrecentchooser.c:217 +#: gtk/gtkrecentchooser.c:234 msgid "Local only" msgstr "" -#: gtk/gtkrecentchooser.c:218 +#: gtk/gtkrecentchooser.c:235 msgid "Whether the selected resource(s) should be limited to local file: URIs" msgstr "" -#: gtk/gtkrecentchooser.c:234 gtk/gtkrecentmanager.c:229 +#: gtk/gtkrecentchooser.c:251 gtk/gtkrecentmanager.c:229 msgid "Limit" msgstr "" -#: gtk/gtkrecentchooser.c:235 +#: gtk/gtkrecentchooser.c:252 #, fuzzy msgid "The maximum number of items to be displayed" msgstr "የጽሑፉ መለያ" -#: gtk/gtkrecentchooser.c:249 +#: gtk/gtkrecentchooser.c:266 #, fuzzy msgid "Sort Type" msgstr "ቅደም ተከተል" -#: gtk/gtkrecentchooser.c:250 +#: gtk/gtkrecentchooser.c:267 #, fuzzy msgid "The sorting order of the items displayed" msgstr "የጽሑፉ መለያ" -#: gtk/gtkrecentchooser.c:265 +#: gtk/gtkrecentchooser.c:282 msgid "The current filter for selecting which resources are displayed" msgstr "" @@ -4932,27 +4728,27 @@ msgstr "" msgid "Space between value text and the slider/trough area" msgstr "" -#: gtk/gtkscalebutton.c:207 +#: gtk/gtkscalebutton.c:223 #, fuzzy msgid "The value of the scale" msgstr "የጽሑፉ መለያ" -#: gtk/gtkscalebutton.c:217 +#: gtk/gtkscalebutton.c:233 #, fuzzy msgid "The icon size" msgstr "የምልክት መጠን" -#: gtk/gtkscalebutton.c:226 +#: gtk/gtkscalebutton.c:242 msgid "" "The GtkAdjustment that contains the current value of this scale button object" msgstr "" -#: gtk/gtkscalebutton.c:254 +#: gtk/gtkscalebutton.c:270 #, fuzzy msgid "Icons" msgstr "ምልክት" -#: gtk/gtkscalebutton.c:255 +#: gtk/gtkscalebutton.c:271 #, fuzzy msgid "List of icon names" msgstr "የፊደሉ ቅርጽ ስም" @@ -4983,581 +4779,589 @@ msgid "" "Display a second forward arrow button on the opposite end of the scrollbar" msgstr "" -#: gtk/gtkscrolledwindow.c:218 gtk/gtktext.c:545 gtk/gtktreeview.c:572 +#: gtk/gtkscrolledwindow.c:235 gtk/gtktreeview.c:574 msgid "Horizontal Adjustment" msgstr "" -#: gtk/gtkscrolledwindow.c:225 gtk/gtktext.c:553 gtk/gtktreeview.c:580 +#: gtk/gtkscrolledwindow.c:242 gtk/gtktreeview.c:582 msgid "Vertical Adjustment" msgstr "" -#: gtk/gtkscrolledwindow.c:232 +#: gtk/gtkscrolledwindow.c:249 msgid "Horizontal Scrollbar Policy" msgstr "" -#: gtk/gtkscrolledwindow.c:233 +#: gtk/gtkscrolledwindow.c:250 msgid "When the horizontal scrollbar is displayed" msgstr "" -#: gtk/gtkscrolledwindow.c:240 +#: gtk/gtkscrolledwindow.c:257 msgid "Vertical Scrollbar Policy" msgstr "" -#: gtk/gtkscrolledwindow.c:241 +#: gtk/gtkscrolledwindow.c:258 msgid "When the vertical scrollbar is displayed" msgstr "" -#: gtk/gtkscrolledwindow.c:249 +#: gtk/gtkscrolledwindow.c:266 msgid "Window Placement" msgstr "" -#: gtk/gtkscrolledwindow.c:250 +#: gtk/gtkscrolledwindow.c:267 msgid "" "Where the contents are located with respect to the scrollbars. This property " "only takes effect if \"window-placement-set\" is TRUE." msgstr "" -#: gtk/gtkscrolledwindow.c:267 +#: gtk/gtkscrolledwindow.c:284 msgid "Window Placement Set" msgstr "" -#: gtk/gtkscrolledwindow.c:268 +#: gtk/gtkscrolledwindow.c:285 msgid "" "Whether \"window-placement\" should be used to determine the location of the " "contents with respect to the scrollbars." msgstr "" -#: gtk/gtkscrolledwindow.c:274 +#: gtk/gtkscrolledwindow.c:291 msgid "Shadow Type" msgstr "" -#: gtk/gtkscrolledwindow.c:275 +#: gtk/gtkscrolledwindow.c:292 msgid "Style of bevel around the contents" msgstr "" -#: gtk/gtkscrolledwindow.c:289 +#: gtk/gtkscrolledwindow.c:306 msgid "Scrollbars within bevel" msgstr "" -#: gtk/gtkscrolledwindow.c:290 +#: gtk/gtkscrolledwindow.c:307 msgid "Place scrollbars within the scrolled window's bevel" msgstr "" -#: gtk/gtkscrolledwindow.c:296 +#: gtk/gtkscrolledwindow.c:313 msgid "Scrollbar spacing" msgstr "" -#: gtk/gtkscrolledwindow.c:297 +#: gtk/gtkscrolledwindow.c:314 msgid "Number of pixels between the scrollbars and the scrolled window" msgstr "" -#: gtk/gtkscrolledwindow.c:312 +#: gtk/gtkscrolledwindow.c:329 msgid "Scrolled Window Placement" msgstr "" -#: gtk/gtkscrolledwindow.c:313 +#: gtk/gtkscrolledwindow.c:330 msgid "" "Where the contents of scrolled windows are located with respect to the " "scrollbars, if not overridden by the scrolled window's own placement." msgstr "" -#: gtk/gtkseparatortoolitem.c:105 +#: gtk/gtkseparatortoolitem.c:125 msgid "Draw" msgstr "" -#: gtk/gtkseparatortoolitem.c:106 +#: gtk/gtkseparatortoolitem.c:126 msgid "Whether the separator is drawn, or just blank" msgstr "" -#: gtk/gtksettings.c:224 +#: gtk/gtksettings.c:225 msgid "Double Click Time" msgstr "" -#: gtk/gtksettings.c:225 +#: gtk/gtksettings.c:226 msgid "" "Maximum time allowed between two clicks for them to be considered a double " "click (in milliseconds)" msgstr "" -#: gtk/gtksettings.c:232 +#: gtk/gtksettings.c:233 msgid "Double Click Distance" msgstr "" -#: gtk/gtksettings.c:233 +#: gtk/gtksettings.c:234 msgid "" "Maximum distance allowed between two clicks for them to be considered a " "double click (in pixels)" msgstr "" -#: gtk/gtksettings.c:249 +#: gtk/gtksettings.c:250 msgid "Cursor Blink" msgstr "የመጠቆሚያዋ አበራርና አጠፋፍ" -#: gtk/gtksettings.c:250 +#: gtk/gtksettings.c:251 msgid "Whether the cursor should blink" msgstr "" -#: gtk/gtksettings.c:257 +#: gtk/gtksettings.c:258 msgid "Cursor Blink Time" msgstr "" -#: gtk/gtksettings.c:258 +#: gtk/gtksettings.c:259 msgid "Length of the cursor blink cycle, in milliseconds" msgstr "" -#: gtk/gtksettings.c:277 +#: gtk/gtksettings.c:278 #, fuzzy msgid "Cursor Blink Timeout" msgstr "የመጠቆሚያዋ አበራርና አጠፋፍ" -#: gtk/gtksettings.c:278 +#: gtk/gtksettings.c:279 msgid "Time after which the cursor stops blinking, in seconds" msgstr "" -#: gtk/gtksettings.c:285 +#: gtk/gtksettings.c:286 msgid "Split Cursor" msgstr "" -#: gtk/gtksettings.c:286 +#: gtk/gtksettings.c:287 msgid "" "Whether two cursors should be displayed for mixed left-to-right and right-to-" "left text" msgstr "" -#: gtk/gtksettings.c:293 +#: gtk/gtksettings.c:294 msgid "Theme Name" msgstr "የጭብጥ ስም" -#: gtk/gtksettings.c:294 +#: gtk/gtksettings.c:295 msgid "Name of theme RC file to load" msgstr "" -#: gtk/gtksettings.c:302 +#: gtk/gtksettings.c:303 #, fuzzy msgid "Icon Theme Name" msgstr "የጭብጥ ስም" -#: gtk/gtksettings.c:303 +#: gtk/gtksettings.c:304 msgid "Name of icon theme to use" msgstr "" -#: gtk/gtksettings.c:311 +#: gtk/gtksettings.c:312 #, fuzzy msgid "Fallback Icon Theme Name" msgstr "የጭብጥ ስም" -#: gtk/gtksettings.c:312 +#: gtk/gtksettings.c:313 #, fuzzy msgid "Name of a icon theme to fall back to" msgstr "የጽሑፉ መለያ" -#: gtk/gtksettings.c:320 +#: gtk/gtksettings.c:321 msgid "Key Theme Name" msgstr "" -#: gtk/gtksettings.c:321 +#: gtk/gtksettings.c:322 msgid "Name of key theme RC file to load" msgstr "" -#: gtk/gtksettings.c:329 +#: gtk/gtksettings.c:330 msgid "Menu bar accelerator" msgstr "" -#: gtk/gtksettings.c:330 +#: gtk/gtksettings.c:331 msgid "Keybinding to activate the menu bar" msgstr "" -#: gtk/gtksettings.c:338 +#: gtk/gtksettings.c:339 msgid "Drag threshold" msgstr "" -#: gtk/gtksettings.c:339 +#: gtk/gtksettings.c:340 msgid "Number of pixels the cursor can move before dragging" msgstr "" -#: gtk/gtksettings.c:347 +#: gtk/gtksettings.c:348 msgid "Font Name" msgstr "የፊደሉ ቅርጽ ስም" -#: gtk/gtksettings.c:348 +#: gtk/gtksettings.c:349 msgid "Name of default font to use" msgstr "" -#: gtk/gtksettings.c:370 +#: gtk/gtksettings.c:371 msgid "Icon Sizes" msgstr "" -#: gtk/gtksettings.c:371 +#: gtk/gtksettings.c:372 msgid "List of icon sizes (gtk-menu=16,16:gtk-button=20,20..." msgstr "" -#: gtk/gtksettings.c:379 +#: gtk/gtksettings.c:380 msgid "GTK Modules" msgstr "" -#: gtk/gtksettings.c:380 +#: gtk/gtksettings.c:381 msgid "List of currently active GTK modules" msgstr "" -#: gtk/gtksettings.c:389 +#: gtk/gtksettings.c:390 msgid "Xft Antialias" msgstr "" -#: gtk/gtksettings.c:390 +#: gtk/gtksettings.c:391 msgid "Whether to antialias Xft fonts; 0=no, 1=yes, -1=default" msgstr "" -#: gtk/gtksettings.c:399 +#: gtk/gtksettings.c:400 msgid "Xft Hinting" msgstr "" -#: gtk/gtksettings.c:400 +#: gtk/gtksettings.c:401 msgid "Whether to hint Xft fonts; 0=no, 1=yes, -1=default" msgstr "" -#: gtk/gtksettings.c:409 +#: gtk/gtksettings.c:410 msgid "Xft Hint Style" msgstr "" -#: gtk/gtksettings.c:410 +#: gtk/gtksettings.c:411 msgid "" "What degree of hinting to use; hintnone, hintslight, hintmedium, or hintfull" msgstr "" -#: gtk/gtksettings.c:419 +#: gtk/gtksettings.c:420 msgid "Xft RGBA" msgstr "" -#: gtk/gtksettings.c:420 +#: gtk/gtksettings.c:421 msgid "Type of subpixel antialiasing; none, rgb, bgr, vrgb, vbgr" msgstr "" -#: gtk/gtksettings.c:429 +#: gtk/gtksettings.c:430 msgid "Xft DPI" msgstr "" -#: gtk/gtksettings.c:430 +#: gtk/gtksettings.c:431 msgid "Resolution for Xft, in 1024 * dots/inch. -1 to use default value" msgstr "" -#: gtk/gtksettings.c:439 +#: gtk/gtksettings.c:440 #, fuzzy msgid "Cursor theme name" msgstr "የጭብጥ ስም" -#: gtk/gtksettings.c:440 +#: gtk/gtksettings.c:441 #, fuzzy msgid "Name of the cursor theme to use, or NULL to use the default theme" msgstr "የጽሑፉ መለያ" -#: gtk/gtksettings.c:448 +#: gtk/gtksettings.c:449 msgid "Cursor theme size" msgstr "" -#: gtk/gtksettings.c:449 +#: gtk/gtksettings.c:450 msgid "Size to use for cursors, or 0 to use the default size" msgstr "" -#: gtk/gtksettings.c:459 +#: gtk/gtksettings.c:460 msgid "Alternative button order" msgstr "" -#: gtk/gtksettings.c:460 +#: gtk/gtksettings.c:461 msgid "Whether buttons in dialogs should use the alternative button order" msgstr "" -#: gtk/gtksettings.c:477 +#: gtk/gtksettings.c:478 msgid "Alternative sort indicator direction" msgstr "" -#: gtk/gtksettings.c:478 +#: gtk/gtksettings.c:479 msgid "" "Whether the direction of the sort indicators in list and tree views is " "inverted compared to the default (where down means ascending)" msgstr "" -#: gtk/gtksettings.c:486 +#: gtk/gtksettings.c:487 msgid "Show the 'Input Methods' menu" msgstr "" -#: gtk/gtksettings.c:487 +#: gtk/gtksettings.c:488 msgid "" "Whether the context menus of entries and text views should offer to change " "the input method" msgstr "" -#: gtk/gtksettings.c:495 +#: gtk/gtksettings.c:496 msgid "Show the 'Insert Unicode Control Character' menu" msgstr "" -#: gtk/gtksettings.c:496 +#: gtk/gtksettings.c:497 msgid "" "Whether the context menus of entries and text views should offer to insert " "control characters" msgstr "" -#: gtk/gtksettings.c:504 +#: gtk/gtksettings.c:505 msgid "Start timeout" msgstr "" -#: gtk/gtksettings.c:505 +#: gtk/gtksettings.c:506 msgid "Starting value for timeouts, when button is pressed" msgstr "" -#: gtk/gtksettings.c:514 +#: gtk/gtksettings.c:515 msgid "Repeat timeout" msgstr "" -#: gtk/gtksettings.c:515 +#: gtk/gtksettings.c:516 msgid "Repeat value for timeouts, when button is pressed" msgstr "" -#: gtk/gtksettings.c:524 +#: gtk/gtksettings.c:525 msgid "Expand timeout" msgstr "" -#: gtk/gtksettings.c:525 +#: gtk/gtksettings.c:526 msgid "Expand value for timeouts, when a widget is expanding a new region" msgstr "" -#: gtk/gtksettings.c:560 +#: gtk/gtksettings.c:561 #, fuzzy msgid "Color scheme" msgstr "የቀለሙ _ስም፦" -#: gtk/gtksettings.c:561 +#: gtk/gtksettings.c:562 #, fuzzy msgid "A palette of named colors for use in themes" msgstr "የጽሑፉ መለያ" -#: gtk/gtksettings.c:570 +#: gtk/gtksettings.c:571 msgid "Enable Animations" msgstr "" -#: gtk/gtksettings.c:571 +#: gtk/gtksettings.c:572 msgid "Whether to enable toolkit-wide animations." msgstr "" -#: gtk/gtksettings.c:589 +#: gtk/gtksettings.c:590 msgid "Enable Touchscreen Mode" msgstr "" -#: gtk/gtksettings.c:590 +#: gtk/gtksettings.c:591 msgid "When TRUE, there are no motion notify events delivered on this screen" msgstr "" -#: gtk/gtksettings.c:607 +#: gtk/gtksettings.c:608 msgid "Tooltip timeout" msgstr "" -#: gtk/gtksettings.c:608 +#: gtk/gtksettings.c:609 msgid "Timeout before tooltip is shown" msgstr "" -#: gtk/gtksettings.c:633 +#: gtk/gtksettings.c:634 msgid "Tooltip browse timeout" msgstr "" -#: gtk/gtksettings.c:634 +#: gtk/gtksettings.c:635 msgid "Timeout before tooltip is shown when browse mode is enabled" msgstr "" -#: gtk/gtksettings.c:655 +#: gtk/gtksettings.c:656 msgid "Tooltip browse mode timeout" msgstr "" -#: gtk/gtksettings.c:656 +#: gtk/gtksettings.c:657 msgid "Timeout after which browse mode is disabled" msgstr "" -#: gtk/gtksettings.c:675 +#: gtk/gtksettings.c:676 msgid "Keynav Cursor Only" msgstr "" -#: gtk/gtksettings.c:676 +#: gtk/gtksettings.c:677 msgid "When TRUE, there are only cursor keys available to navigate widgets" msgstr "" -#: gtk/gtksettings.c:693 +#: gtk/gtksettings.c:694 msgid "Keynav Wrap Around" msgstr "" -#: gtk/gtksettings.c:694 +#: gtk/gtksettings.c:695 msgid "Whether to wrap around when keyboard-navigating widgets" msgstr "" -#: gtk/gtksettings.c:714 +#: gtk/gtksettings.c:715 msgid "Error Bell" msgstr "" -#: gtk/gtksettings.c:715 +#: gtk/gtksettings.c:716 msgid "When TRUE, keyboard navigation and other errors will cause a beep" msgstr "" -#: gtk/gtksettings.c:732 +#: gtk/gtksettings.c:733 #, fuzzy msgid "Color Hash" msgstr "የቀለሙ _ስም፦" -#: gtk/gtksettings.c:733 +#: gtk/gtksettings.c:734 msgid "A hash table representation of the color scheme." msgstr "" -#: gtk/gtksettings.c:741 +#: gtk/gtksettings.c:742 msgid "Default file chooser backend" msgstr "" -#: gtk/gtksettings.c:742 +#: gtk/gtksettings.c:743 msgid "Name of the GtkFileChooser backend to use by default" msgstr "" -#: gtk/gtksettings.c:759 +#: gtk/gtksettings.c:760 msgid "Default print backend" msgstr "" -#: gtk/gtksettings.c:760 +#: gtk/gtksettings.c:761 msgid "List of the GtkPrintBackend backends to use by default" msgstr "" -#: gtk/gtksettings.c:783 +#: gtk/gtksettings.c:784 msgid "Default command to run when displaying a print preview" msgstr "" -#: gtk/gtksettings.c:784 +#: gtk/gtksettings.c:785 msgid "Command to run when displaying a print preview" msgstr "" -#: gtk/gtksettings.c:800 +#: gtk/gtksettings.c:801 msgid "Enable Mnemonics" msgstr "" -#: gtk/gtksettings.c:801 +#: gtk/gtksettings.c:802 msgid "Whether labels should have mnemonics" msgstr "" -#: gtk/gtksettings.c:817 +#: gtk/gtksettings.c:818 #, fuzzy msgid "Enable Accelerators" msgstr "የመስኮቱ ዓይነት" -#: gtk/gtksettings.c:818 +#: gtk/gtksettings.c:819 msgid "Whether menu items should have accelerators" msgstr "" -#: gtk/gtksettings.c:835 +#: gtk/gtksettings.c:836 msgid "Recent Files Limit" msgstr "" -#: gtk/gtksettings.c:836 +#: gtk/gtksettings.c:837 #, fuzzy msgid "Number of recently used files" msgstr "ዐምዶች" -#: gtk/gtksettings.c:854 +#: gtk/gtksettings.c:855 #, fuzzy msgid "Default IM module" msgstr "የነበረው ስፋት" -#: gtk/gtksettings.c:855 +#: gtk/gtksettings.c:856 msgid "Which IM module should be used by default" msgstr "" -#: gtk/gtksettings.c:873 +#: gtk/gtksettings.c:874 msgid "Recent Files Max Age" msgstr "" -#: gtk/gtksettings.c:874 +#: gtk/gtksettings.c:875 #, fuzzy msgid "Maximum age of recently used files, in days" msgstr "ዐምዶች" -#: gtk/gtksettings.c:883 +#: gtk/gtksettings.c:884 msgid "Fontconfig configuration timestamp" msgstr "" -#: gtk/gtksettings.c:884 +#: gtk/gtksettings.c:885 msgid "Timestamp of current fontconfig configuration" msgstr "" -#: gtk/gtksettings.c:906 +#: gtk/gtksettings.c:907 #, fuzzy msgid "Sound Theme Name" msgstr "የጭብጥ ስም" -#: gtk/gtksettings.c:907 +#: gtk/gtksettings.c:908 #, fuzzy msgid "XDG sound theme name" msgstr "የጭብጥ ስም" #. Translators: this means sounds that are played as feedback to user input -#: gtk/gtksettings.c:929 +#: gtk/gtksettings.c:930 msgid "Audible Input Feedback" msgstr "" -#: gtk/gtksettings.c:930 +#: gtk/gtksettings.c:931 msgid "Whether to play event sounds as feedback to user input" msgstr "" -#: gtk/gtksettings.c:951 +#: gtk/gtksettings.c:952 msgid "Enable Event Sounds" msgstr "" -#: gtk/gtksettings.c:952 +#: gtk/gtksettings.c:953 msgid "Whether to play any event sounds at all" msgstr "" -#: gtk/gtksettings.c:967 +#: gtk/gtksettings.c:968 #, fuzzy msgid "Enable Tooltips" msgstr "ማስረጊያዎች አሳይ" -#: gtk/gtksettings.c:968 +#: gtk/gtksettings.c:969 msgid "Whether tooltips should be shown on widgets" msgstr "" -#: gtk/gtksettings.c:981 +#: gtk/gtksettings.c:982 msgid "Toolbar style" msgstr "የቱልባር ዓይነት" -#: gtk/gtksettings.c:982 +#: gtk/gtksettings.c:983 msgid "" "Whether default toolbars have text only, text and icons, icons only, etc." msgstr "" -#: gtk/gtksettings.c:996 +#: gtk/gtksettings.c:997 #, fuzzy msgid "Toolbar Icon Size" msgstr "የቱልባር ዓይነት" -#: gtk/gtksettings.c:997 +#: gtk/gtksettings.c:998 msgid "The size of icons in default toolbars." msgstr "" -#: gtk/gtksettings.c:1014 +#: gtk/gtksettings.c:1015 msgid "Auto Mnemonics" msgstr "" -#: gtk/gtksettings.c:1015 +#: gtk/gtksettings.c:1016 msgid "" "Whether mnemonics should be automatically shown and hidden when the user " "presses the mnemonic activator." msgstr "" -#: gtk/gtksizegroup.c:301 +#: gtk/gtksettings.c:1041 +msgid "Application prefers a dark theme" +msgstr "" + +#: gtk/gtksettings.c:1042 +msgid "Whether the application prefers to have a dark theme." +msgstr "" + +#: gtk/gtksizegroup.c:320 msgid "Mode" msgstr "የአሠራሩ ዘዴ" -#: gtk/gtksizegroup.c:302 +#: gtk/gtksizegroup.c:321 msgid "" "The directions in which the size group affects the requested sizes of its " "component widgets" msgstr "" -#: gtk/gtksizegroup.c:318 +#: gtk/gtksizegroup.c:337 msgid "Ignore hidden" msgstr "" -#: gtk/gtksizegroup.c:319 +#: gtk/gtksizegroup.c:338 msgid "" "If TRUE, unmapped widgets are ignored when determining the size of the group" msgstr "" @@ -5650,62 +5454,62 @@ msgstr "" msgid "Style of bevel around the statusbar text" msgstr "" -#: gtk/gtkstatusicon.c:271 +#: gtk/gtkstatusicon.c:276 #, fuzzy msgid "The size of the icon" msgstr "የመስኮቱ አርእስት" -#: gtk/gtkstatusicon.c:281 +#: gtk/gtkstatusicon.c:286 msgid "The screen where this status icon will be displayed" msgstr "" -#: gtk/gtkstatusicon.c:288 +#: gtk/gtkstatusicon.c:293 msgid "Blinking" msgstr "" -#: gtk/gtkstatusicon.c:289 +#: gtk/gtkstatusicon.c:294 msgid "Whether or not the status icon is blinking" msgstr "" -#: gtk/gtkstatusicon.c:297 +#: gtk/gtkstatusicon.c:302 msgid "Whether or not the status icon is visible" msgstr "" -#: gtk/gtkstatusicon.c:313 +#: gtk/gtkstatusicon.c:318 msgid "Whether or not the status icon is embedded" msgstr "" -#: gtk/gtkstatusicon.c:329 gtk/gtktrayicon-x11.c:111 +#: gtk/gtkstatusicon.c:334 gtk/gtktrayicon-x11.c:123 #, fuzzy msgid "The orientation of the tray" msgstr "የጽሑፉ መለያ" -#: gtk/gtkstatusicon.c:356 gtk/gtkwidget.c:702 +#: gtk/gtkstatusicon.c:361 gtk/gtkwidget.c:722 msgid "Has tooltip" msgstr "" -#: gtk/gtkstatusicon.c:357 +#: gtk/gtkstatusicon.c:362 msgid "Whether this tray icon has a tooltip" msgstr "" -#: gtk/gtkstatusicon.c:382 gtk/gtkwidget.c:723 +#: gtk/gtkstatusicon.c:387 gtk/gtkwidget.c:743 msgid "Tooltip Text" msgstr "" -#: gtk/gtkstatusicon.c:383 gtk/gtkwidget.c:724 gtk/gtkwidget.c:745 +#: gtk/gtkstatusicon.c:388 gtk/gtkwidget.c:744 gtk/gtkwidget.c:765 msgid "The contents of the tooltip for this widget" msgstr "" -#: gtk/gtkstatusicon.c:406 gtk/gtkwidget.c:744 +#: gtk/gtkstatusicon.c:411 gtk/gtkwidget.c:764 msgid "Tooltip markup" msgstr "" -#: gtk/gtkstatusicon.c:407 +#: gtk/gtkstatusicon.c:412 #, fuzzy msgid "The contents of the tooltip for this tray icon" msgstr "የመስኮቱ አርእስት" -#: gtk/gtkstatusicon.c:425 +#: gtk/gtkstatusicon.c:430 #, fuzzy msgid "The title of this tray icon" msgstr "የመስኮቱ አርእስት" @@ -5806,30 +5610,6 @@ msgid "" "pixels" msgstr "" -#: gtk/gtktext.c:546 -msgid "Horizontal adjustment for the text widget" -msgstr "" - -#: gtk/gtktext.c:554 -msgid "Vertical adjustment for the text widget" -msgstr "" - -#: gtk/gtktext.c:561 -msgid "Line Wrap" -msgstr "" - -#: gtk/gtktext.c:562 -msgid "Whether lines are wrapped at widget edges" -msgstr "" - -#: gtk/gtktext.c:569 -msgid "Word Wrap" -msgstr "" - -#: gtk/gtktext.c:570 -msgid "Whether words are wrapped at widget edges" -msgstr "" - #: gtk/gtktextbuffer.c:180 msgid "Tag Table" msgstr "" @@ -6254,15 +6034,15 @@ msgstr "የፊት ለፊቱ ቀለም" msgid "Color with which to draw error-indication underlines" msgstr "" -#: gtk/gtktoggleaction.c:104 +#: gtk/gtktoggleaction.c:115 msgid "Create the same proxies as a radio action" msgstr "" -#: gtk/gtktoggleaction.c:105 +#: gtk/gtktoggleaction.c:116 msgid "Whether the proxies for this action look like radio action proxies" msgstr "" -#: gtk/gtktoggleaction.c:120 +#: gtk/gtktoggleaction.c:131 msgid "If the toggle action should be active in or not" msgstr "" @@ -6282,89 +6062,81 @@ msgstr "" msgid "If the toggle part of the button is displayed" msgstr "" -#: gtk/gtktoolbar.c:494 gtk/gtktoolpalette.c:1020 +#: gtk/gtktoolbar.c:456 gtk/gtktoolpalette.c:1021 msgid "Toolbar Style" msgstr "የቱልባር ዓይነት" -#: gtk/gtktoolbar.c:495 +#: gtk/gtktoolbar.c:457 msgid "How to draw the toolbar" msgstr "" -#: gtk/gtktoolbar.c:502 +#: gtk/gtktoolbar.c:464 msgid "Show Arrow" msgstr "" -#: gtk/gtktoolbar.c:503 +#: gtk/gtktoolbar.c:465 msgid "If an arrow should be shown if the toolbar doesn't fit" msgstr "" -#: gtk/gtktoolbar.c:518 -msgid "Tooltips" -msgstr "" - -#: gtk/gtktoolbar.c:519 -msgid "If the tooltips of the toolbar should be active or not" -msgstr "" - -#: gtk/gtktoolbar.c:541 +#: gtk/gtktoolbar.c:486 msgid "Size of icons in this toolbar" msgstr "" -#: gtk/gtktoolbar.c:556 gtk/gtktoolpalette.c:1006 +#: gtk/gtktoolbar.c:501 gtk/gtktoolpalette.c:1007 #, fuzzy msgid "Icon size set" msgstr "የምልክት መጠን" -#: gtk/gtktoolbar.c:557 gtk/gtktoolpalette.c:1007 +#: gtk/gtktoolbar.c:502 gtk/gtktoolpalette.c:1008 msgid "Whether the icon-size property has been set" msgstr "" -#: gtk/gtktoolbar.c:566 +#: gtk/gtktoolbar.c:511 msgid "Whether the item should receive extra space when the toolbar grows" msgstr "" -#: gtk/gtktoolbar.c:574 gtk/gtktoolitemgroup.c:1589 +#: gtk/gtktoolbar.c:519 gtk/gtktoolitemgroup.c:1597 msgid "Whether the item should be the same size as other homogeneous items" msgstr "" -#: gtk/gtktoolbar.c:581 +#: gtk/gtktoolbar.c:526 msgid "Spacer size" msgstr "" -#: gtk/gtktoolbar.c:582 +#: gtk/gtktoolbar.c:527 msgid "Size of spacers" msgstr "" -#: gtk/gtktoolbar.c:591 +#: gtk/gtktoolbar.c:536 msgid "Amount of border space between the toolbar shadow and the buttons" msgstr "" -#: gtk/gtktoolbar.c:599 +#: gtk/gtktoolbar.c:544 #, fuzzy msgid "Maximum child expand" msgstr "ከፍተኛ መጠን X" -#: gtk/gtktoolbar.c:600 +#: gtk/gtktoolbar.c:545 msgid "Maximum amount of space an expandable item will be given" msgstr "" -#: gtk/gtktoolbar.c:608 +#: gtk/gtktoolbar.c:553 msgid "Space style" msgstr "" -#: gtk/gtktoolbar.c:609 +#: gtk/gtktoolbar.c:554 msgid "Whether spacers are vertical lines or just blank" msgstr "" -#: gtk/gtktoolbar.c:616 +#: gtk/gtktoolbar.c:561 msgid "Button relief" msgstr "" -#: gtk/gtktoolbar.c:617 +#: gtk/gtktoolbar.c:562 msgid "Type of bevel around toolbar buttons" msgstr "" -#: gtk/gtktoolbar.c:624 +#: gtk/gtktoolbar.c:569 msgid "Style of bevel around the toolbar" msgstr "" @@ -6418,97 +6190,133 @@ msgstr "ክፍተት" msgid "Spacing in pixels between the icon and label" msgstr "" -#: gtk/gtktoolitem.c:207 +#: gtk/gtktoolitem.c:200 msgid "" "Whether the toolbar item is considered important. When TRUE, toolbar buttons " "show text in GTK_TOOLBAR_BOTH_HORIZ mode" msgstr "" -#: gtk/gtktoolitemgroup.c:1536 +#: gtk/gtktoolitemgroup.c:1544 #, fuzzy msgid "The human-readable title of this item group" msgstr "የመስኮቱ አርእስት" -#: gtk/gtktoolitemgroup.c:1543 +#: gtk/gtktoolitemgroup.c:1551 msgid "A widget to display in place of the usual label" msgstr "" -#: gtk/gtktoolitemgroup.c:1549 +#: gtk/gtktoolitemgroup.c:1557 msgid "Collapsed" msgstr "" -#: gtk/gtktoolitemgroup.c:1550 +#: gtk/gtktoolitemgroup.c:1558 msgid "Wether the group has been collapsed and items are hidden" msgstr "" -#: gtk/gtktoolitemgroup.c:1556 +#: gtk/gtktoolitemgroup.c:1564 #, fuzzy msgid "ellipsize" msgstr "መጠን" -#: gtk/gtktoolitemgroup.c:1557 +#: gtk/gtktoolitemgroup.c:1565 msgid "Ellipsize for item group headers" msgstr "" -#: gtk/gtktoolitemgroup.c:1563 +#: gtk/gtktoolitemgroup.c:1571 #, fuzzy msgid "Header Relief" msgstr "የጭብጥ ስም" -#: gtk/gtktoolitemgroup.c:1564 +#: gtk/gtktoolitemgroup.c:1572 msgid "Relief of the group header button" msgstr "" -#: gtk/gtktoolitemgroup.c:1579 +#: gtk/gtktoolitemgroup.c:1587 #, fuzzy msgid "Header Spacing" msgstr "የግራ ህዳግ" -#: gtk/gtktoolitemgroup.c:1580 +#: gtk/gtktoolitemgroup.c:1588 msgid "Spacing between expander arrow and caption" msgstr "" -#: gtk/gtktoolitemgroup.c:1596 +#: gtk/gtktoolitemgroup.c:1604 msgid "Whether the item should receive extra space when the group grows" msgstr "" -#: gtk/gtktoolitemgroup.c:1603 +#: gtk/gtktoolitemgroup.c:1611 msgid "Whether the item should fill the available space" msgstr "" -#: gtk/gtktoolitemgroup.c:1609 +#: gtk/gtktoolitemgroup.c:1617 msgid "New Row" msgstr "" -#: gtk/gtktoolitemgroup.c:1610 +#: gtk/gtktoolitemgroup.c:1618 msgid "Whether the item should start a new row" msgstr "" -#: gtk/gtktoolitemgroup.c:1617 +#: gtk/gtktoolitemgroup.c:1625 msgid "Position of the item within this group" msgstr "" -#: gtk/gtktoolpalette.c:991 +#: gtk/gtktoolpalette.c:992 msgid "Size of icons in this tool palette" msgstr "" -#: gtk/gtktoolpalette.c:1021 +#: gtk/gtktoolpalette.c:1022 msgid "Style of items in the tool palette" msgstr "" -#: gtk/gtktoolpalette.c:1037 +#: gtk/gtktoolpalette.c:1038 msgid "Exclusive" msgstr "" -#: gtk/gtktoolpalette.c:1038 +#: gtk/gtktoolpalette.c:1039 msgid "Whether the item group should be the only expanded at a given time" msgstr "" -#: gtk/gtktoolpalette.c:1053 +#: gtk/gtktoolpalette.c:1054 msgid "" "Whether the item group should receive extra space when the palette grows" msgstr "" +#: gtk/gtktrayicon-x11.c:132 +#, fuzzy +msgid "Foreground color for symbolic icons" +msgstr "የፊት ለፊት ቀለም ስም" + +#: gtk/gtktrayicon-x11.c:139 +#, fuzzy +msgid "Error color" +msgstr "የጠቋሚው ቀለም" + +#: gtk/gtktrayicon-x11.c:140 +msgid "Error color for symbolic icons" +msgstr "" + +#: gtk/gtktrayicon-x11.c:147 +#, fuzzy +msgid "Warning color" +msgstr "የመደቡ ቀለም" + +#: gtk/gtktrayicon-x11.c:148 +msgid "Warning color for symbolic icons" +msgstr "" + +#: gtk/gtktrayicon-x11.c:155 +#, fuzzy +msgid "Success color" +msgstr "የጠቋሚው ቀለም" + +#: gtk/gtktrayicon-x11.c:156 +msgid "Success color for symbolic icons" +msgstr "" + +#: gtk/gtktrayicon-x11.c:164 +msgid "Padding that should be put around icons in the tray" +msgstr "" + #: gtk/gtktreemodelsort.c:278 msgid "TreeModelSort Model" msgstr "" @@ -6517,228 +6325,228 @@ msgstr "" msgid "The model for the TreeModelSort to sort" msgstr "" -#: gtk/gtktreeview.c:564 +#: gtk/gtktreeview.c:566 msgid "TreeView Model" msgstr "" -#: gtk/gtktreeview.c:565 +#: gtk/gtktreeview.c:567 msgid "The model for the tree view" msgstr "" -#: gtk/gtktreeview.c:573 +#: gtk/gtktreeview.c:575 msgid "Horizontal Adjustment for the widget" msgstr "" -#: gtk/gtktreeview.c:581 +#: gtk/gtktreeview.c:583 msgid "Vertical Adjustment for the widget" msgstr "" -#: gtk/gtktreeview.c:588 +#: gtk/gtktreeview.c:590 #, fuzzy msgid "Headers Visible" msgstr "የሚታይ" -#: gtk/gtktreeview.c:589 +#: gtk/gtktreeview.c:591 msgid "Show the column header buttons" msgstr "" -#: gtk/gtktreeview.c:596 +#: gtk/gtktreeview.c:598 msgid "Headers Clickable" msgstr "" -#: gtk/gtktreeview.c:597 +#: gtk/gtktreeview.c:599 msgid "Column headers respond to click events" msgstr "" -#: gtk/gtktreeview.c:604 +#: gtk/gtktreeview.c:606 msgid "Expander Column" msgstr "" -#: gtk/gtktreeview.c:605 +#: gtk/gtktreeview.c:607 msgid "Set the column for the expander column" msgstr "" -#: gtk/gtktreeview.c:620 +#: gtk/gtktreeview.c:622 msgid "Rules Hint" msgstr "" -#: gtk/gtktreeview.c:621 +#: gtk/gtktreeview.c:623 msgid "Set a hint to the theme engine to draw rows in alternating colors" msgstr "" -#: gtk/gtktreeview.c:628 +#: gtk/gtktreeview.c:630 msgid "Enable Search" msgstr "" -#: gtk/gtktreeview.c:629 +#: gtk/gtktreeview.c:631 msgid "View allows user to search through columns interactively" msgstr "" -#: gtk/gtktreeview.c:636 +#: gtk/gtktreeview.c:638 msgid "Search Column" msgstr "" -#: gtk/gtktreeview.c:637 +#: gtk/gtktreeview.c:639 msgid "Model column to search through during interactive search" msgstr "" -#: gtk/gtktreeview.c:657 +#: gtk/gtktreeview.c:659 msgid "Fixed Height Mode" msgstr "" -#: gtk/gtktreeview.c:658 +#: gtk/gtktreeview.c:660 msgid "Speeds up GtkTreeView by assuming that all rows have the same height" msgstr "" -#: gtk/gtktreeview.c:678 +#: gtk/gtktreeview.c:680 msgid "Hover Selection" msgstr "" -#: gtk/gtktreeview.c:679 +#: gtk/gtktreeview.c:681 msgid "Whether the selection should follow the pointer" msgstr "" -#: gtk/gtktreeview.c:698 +#: gtk/gtktreeview.c:700 msgid "Hover Expand" msgstr "" -#: gtk/gtktreeview.c:699 +#: gtk/gtktreeview.c:701 msgid "" "Whether rows should be expanded/collapsed when the pointer moves over them" msgstr "" -#: gtk/gtktreeview.c:713 +#: gtk/gtktreeview.c:715 #, fuzzy msgid "Show Expanders" msgstr "ማስረጊያዎች አሳይ" -#: gtk/gtktreeview.c:714 +#: gtk/gtktreeview.c:716 msgid "View has expanders" msgstr "" -#: gtk/gtktreeview.c:728 +#: gtk/gtktreeview.c:730 msgid "Level Indentation" msgstr "" -#: gtk/gtktreeview.c:729 +#: gtk/gtktreeview.c:731 msgid "Extra indentation for each level" msgstr "" -#: gtk/gtktreeview.c:738 +#: gtk/gtktreeview.c:740 msgid "Rubber Banding" msgstr "" -#: gtk/gtktreeview.c:739 +#: gtk/gtktreeview.c:741 msgid "" "Whether to enable selection of multiple items by dragging the mouse pointer" msgstr "" -#: gtk/gtktreeview.c:746 +#: gtk/gtktreeview.c:748 msgid "Enable Grid Lines" msgstr "" -#: gtk/gtktreeview.c:747 +#: gtk/gtktreeview.c:749 msgid "Whether grid lines should be drawn in the tree view" msgstr "" -#: gtk/gtktreeview.c:755 +#: gtk/gtktreeview.c:757 msgid "Enable Tree Lines" msgstr "" -#: gtk/gtktreeview.c:756 +#: gtk/gtktreeview.c:758 msgid "Whether tree lines should be drawn in the tree view" msgstr "" -#: gtk/gtktreeview.c:764 +#: gtk/gtktreeview.c:766 msgid "The column in the model containing the tooltip texts for the rows" msgstr "" -#: gtk/gtktreeview.c:786 +#: gtk/gtktreeview.c:788 msgid "Vertical Separator Width" msgstr "" -#: gtk/gtktreeview.c:787 +#: gtk/gtktreeview.c:789 msgid "Vertical space between cells. Must be an even number" msgstr "" -#: gtk/gtktreeview.c:795 +#: gtk/gtktreeview.c:797 msgid "Horizontal Separator Width" msgstr "" -#: gtk/gtktreeview.c:796 +#: gtk/gtktreeview.c:798 msgid "Horizontal space between cells. Must be an even number" msgstr "" -#: gtk/gtktreeview.c:804 +#: gtk/gtktreeview.c:806 msgid "Allow Rules" msgstr "" -#: gtk/gtktreeview.c:805 +#: gtk/gtktreeview.c:807 msgid "Allow drawing of alternating color rows" msgstr "" -#: gtk/gtktreeview.c:811 +#: gtk/gtktreeview.c:813 msgid "Indent Expanders" msgstr "" -#: gtk/gtktreeview.c:812 +#: gtk/gtktreeview.c:814 msgid "Make the expanders indented" msgstr "" -#: gtk/gtktreeview.c:818 +#: gtk/gtktreeview.c:820 msgid "Even Row Color" msgstr "" -#: gtk/gtktreeview.c:819 +#: gtk/gtktreeview.c:821 msgid "Color to use for even rows" msgstr "" -#: gtk/gtktreeview.c:825 +#: gtk/gtktreeview.c:827 msgid "Odd Row Color" msgstr "" -#: gtk/gtktreeview.c:826 +#: gtk/gtktreeview.c:828 msgid "Color to use for odd rows" msgstr "" -#: gtk/gtktreeview.c:832 +#: gtk/gtktreeview.c:834 msgid "Row Ending details" msgstr "" -#: gtk/gtktreeview.c:833 +#: gtk/gtktreeview.c:835 msgid "Enable extended row background theming" msgstr "" -#: gtk/gtktreeview.c:839 +#: gtk/gtktreeview.c:841 msgid "Grid line width" msgstr "" -#: gtk/gtktreeview.c:840 +#: gtk/gtktreeview.c:842 msgid "Width, in pixels, of the tree view grid lines" msgstr "" -#: gtk/gtktreeview.c:846 +#: gtk/gtktreeview.c:848 #, fuzzy msgid "Tree line width" msgstr "የጽሑፉ ቅድመ ዕይታ" -#: gtk/gtktreeview.c:847 +#: gtk/gtktreeview.c:849 msgid "Width, in pixels, of the tree view lines" msgstr "" -#: gtk/gtktreeview.c:853 +#: gtk/gtktreeview.c:855 msgid "Grid line pattern" msgstr "" -#: gtk/gtktreeview.c:854 +#: gtk/gtktreeview.c:856 msgid "Dash pattern used to draw the tree view grid lines" msgstr "" -#: gtk/gtktreeview.c:860 +#: gtk/gtktreeview.c:862 msgid "Tree line pattern" msgstr "" -#: gtk/gtktreeview.c:861 +#: gtk/gtktreeview.c:863 msgid "Dash pattern used to draw the tree view lines" msgstr "" @@ -6746,7 +6554,7 @@ msgstr "" msgid "Whether to display the column" msgstr "" -#: gtk/gtktreeviewcolumn.c:200 gtk/gtkwindow.c:542 +#: gtk/gtktreeviewcolumn.c:200 gtk/gtkwindow.c:566 msgid "Resizable" msgstr "" @@ -6863,540 +6671,540 @@ msgstr "" msgid "An XML string describing the merged UI" msgstr "" -#: gtk/gtkviewport.c:107 +#: gtk/gtkviewport.c:135 msgid "" "The GtkAdjustment that determines the values of the horizontal position for " "this viewport" msgstr "" -#: gtk/gtkviewport.c:115 +#: gtk/gtkviewport.c:143 msgid "" "The GtkAdjustment that determines the values of the vertical position for " "this viewport" msgstr "" -#: gtk/gtkviewport.c:123 +#: gtk/gtkviewport.c:151 msgid "Determines how the shadowed box around the viewport is drawn" msgstr "" -#: gtk/gtkwidget.c:553 +#: gtk/gtkwidget.c:573 msgid "Widget name" msgstr "" -#: gtk/gtkwidget.c:554 +#: gtk/gtkwidget.c:574 msgid "The name of the widget" msgstr "" -#: gtk/gtkwidget.c:560 +#: gtk/gtkwidget.c:580 msgid "Parent widget" msgstr "" -#: gtk/gtkwidget.c:561 +#: gtk/gtkwidget.c:581 msgid "The parent widget of this widget. Must be a Container widget" msgstr "" -#: gtk/gtkwidget.c:568 +#: gtk/gtkwidget.c:588 msgid "Width request" msgstr "" -#: gtk/gtkwidget.c:569 +#: gtk/gtkwidget.c:589 msgid "" "Override for width request of the widget, or -1 if natural request should be " "used" msgstr "" -#: gtk/gtkwidget.c:577 +#: gtk/gtkwidget.c:597 msgid "Height request" msgstr "" -#: gtk/gtkwidget.c:578 +#: gtk/gtkwidget.c:598 msgid "" "Override for height request of the widget, or -1 if natural request should " "be used" msgstr "" -#: gtk/gtkwidget.c:587 +#: gtk/gtkwidget.c:607 msgid "Whether the widget is visible" msgstr "" -#: gtk/gtkwidget.c:594 +#: gtk/gtkwidget.c:614 msgid "Whether the widget responds to input" msgstr "" -#: gtk/gtkwidget.c:600 +#: gtk/gtkwidget.c:620 msgid "Application paintable" msgstr "" -#: gtk/gtkwidget.c:601 +#: gtk/gtkwidget.c:621 msgid "Whether the application will paint directly on the widget" msgstr "" -#: gtk/gtkwidget.c:607 +#: gtk/gtkwidget.c:627 msgid "Can focus" msgstr "" -#: gtk/gtkwidget.c:608 +#: gtk/gtkwidget.c:628 msgid "Whether the widget can accept the input focus" msgstr "" -#: gtk/gtkwidget.c:614 +#: gtk/gtkwidget.c:634 msgid "Has focus" msgstr "" -#: gtk/gtkwidget.c:615 +#: gtk/gtkwidget.c:635 msgid "Whether the widget has the input focus" msgstr "" -#: gtk/gtkwidget.c:621 +#: gtk/gtkwidget.c:641 msgid "Is focus" msgstr "" -#: gtk/gtkwidget.c:622 +#: gtk/gtkwidget.c:642 msgid "Whether the widget is the focus widget within the toplevel" msgstr "" -#: gtk/gtkwidget.c:628 +#: gtk/gtkwidget.c:648 msgid "Can default" msgstr "" -#: gtk/gtkwidget.c:629 +#: gtk/gtkwidget.c:649 msgid "Whether the widget can be the default widget" msgstr "" -#: gtk/gtkwidget.c:635 +#: gtk/gtkwidget.c:655 msgid "Has default" msgstr "" -#: gtk/gtkwidget.c:636 +#: gtk/gtkwidget.c:656 msgid "Whether the widget is the default widget" msgstr "" -#: gtk/gtkwidget.c:642 +#: gtk/gtkwidget.c:662 msgid "Receives default" msgstr "" -#: gtk/gtkwidget.c:643 +#: gtk/gtkwidget.c:663 msgid "If TRUE, the widget will receive the default action when it is focused" msgstr "" -#: gtk/gtkwidget.c:649 +#: gtk/gtkwidget.c:669 msgid "Composite child" msgstr "" -#: gtk/gtkwidget.c:650 +#: gtk/gtkwidget.c:670 msgid "Whether the widget is part of a composite widget" msgstr "" -#: gtk/gtkwidget.c:656 +#: gtk/gtkwidget.c:676 msgid "Style" msgstr "ዘይቤ" -#: gtk/gtkwidget.c:657 +#: gtk/gtkwidget.c:677 msgid "" "The style of the widget, which contains information about how it will look " "(colors etc)" msgstr "" -#: gtk/gtkwidget.c:663 +#: gtk/gtkwidget.c:683 msgid "Events" msgstr "" -#: gtk/gtkwidget.c:664 +#: gtk/gtkwidget.c:684 msgid "The event mask that decides what kind of GdkEvents this widget gets" msgstr "" -#: gtk/gtkwidget.c:671 +#: gtk/gtkwidget.c:691 msgid "Extension events" msgstr "" -#: gtk/gtkwidget.c:672 +#: gtk/gtkwidget.c:692 msgid "The mask that decides what kind of extension events this widget gets" msgstr "" -#: gtk/gtkwidget.c:679 +#: gtk/gtkwidget.c:699 msgid "No show all" msgstr "" -#: gtk/gtkwidget.c:680 +#: gtk/gtkwidget.c:700 msgid "Whether gtk_widget_show_all() should not affect this widget" msgstr "" -#: gtk/gtkwidget.c:703 +#: gtk/gtkwidget.c:723 msgid "Whether this widget has a tooltip" msgstr "" -#: gtk/gtkwidget.c:759 +#: gtk/gtkwidget.c:779 #, fuzzy msgid "Window" msgstr "የመስኮት ዓይነት" -#: gtk/gtkwidget.c:760 +#: gtk/gtkwidget.c:780 msgid "The widget's window if it is realized" msgstr "" -#: gtk/gtkwidget.c:774 +#: gtk/gtkwidget.c:794 msgid "Double Buffered" msgstr "" -#: gtk/gtkwidget.c:775 +#: gtk/gtkwidget.c:795 msgid "Whether or not the widget is double buffered" msgstr "" -#: gtk/gtkwidget.c:2403 +#: gtk/gtkwidget.c:2427 msgid "Interior Focus" msgstr "" -#: gtk/gtkwidget.c:2404 +#: gtk/gtkwidget.c:2428 msgid "Whether to draw the focus indicator inside widgets" msgstr "" -#: gtk/gtkwidget.c:2410 +#: gtk/gtkwidget.c:2434 msgid "Focus linewidth" msgstr "" -#: gtk/gtkwidget.c:2411 +#: gtk/gtkwidget.c:2435 msgid "Width, in pixels, of the focus indicator line" msgstr "" -#: gtk/gtkwidget.c:2417 +#: gtk/gtkwidget.c:2441 msgid "Focus line dash pattern" msgstr "" -#: gtk/gtkwidget.c:2418 +#: gtk/gtkwidget.c:2442 msgid "Dash pattern used to draw the focus indicator" msgstr "" -#: gtk/gtkwidget.c:2423 +#: gtk/gtkwidget.c:2447 msgid "Focus padding" msgstr "" -#: gtk/gtkwidget.c:2424 +#: gtk/gtkwidget.c:2448 msgid "Width, in pixels, between focus indicator and the widget 'box'" msgstr "" -#: gtk/gtkwidget.c:2429 +#: gtk/gtkwidget.c:2453 msgid "Cursor color" msgstr "የጠቋሚው ቀለም" -#: gtk/gtkwidget.c:2430 +#: gtk/gtkwidget.c:2454 msgid "Color with which to draw insertion cursor" msgstr "" -#: gtk/gtkwidget.c:2435 +#: gtk/gtkwidget.c:2459 msgid "Secondary cursor color" msgstr "" -#: gtk/gtkwidget.c:2436 +#: gtk/gtkwidget.c:2460 msgid "" "Color with which to draw the secondary insertion cursor when editing mixed " "right-to-left and left-to-right text" msgstr "" -#: gtk/gtkwidget.c:2441 +#: gtk/gtkwidget.c:2465 msgid "Cursor line aspect ratio" msgstr "" -#: gtk/gtkwidget.c:2442 +#: gtk/gtkwidget.c:2466 msgid "Aspect ratio with which to draw insertion cursor" msgstr "" -#: gtk/gtkwidget.c:2456 +#: gtk/gtkwidget.c:2480 #, fuzzy msgid "Draw Border" msgstr "ቅደም ተከተል" -#: gtk/gtkwidget.c:2457 +#: gtk/gtkwidget.c:2481 msgid "Size of areas outside the widget's allocation to draw" msgstr "" -#: gtk/gtkwidget.c:2470 +#: gtk/gtkwidget.c:2494 #, fuzzy msgid "Unvisited Link Color" msgstr "የአሁኑን ቀለም" -#: gtk/gtkwidget.c:2471 +#: gtk/gtkwidget.c:2495 #, fuzzy msgid "Color of unvisited links" msgstr "የመስኮቱ አርእስት" -#: gtk/gtkwidget.c:2484 +#: gtk/gtkwidget.c:2508 #, fuzzy msgid "Visited Link Color" msgstr "የአሁኑን ቀለም" -#: gtk/gtkwidget.c:2485 +#: gtk/gtkwidget.c:2509 #, fuzzy msgid "Color of visited links" msgstr "የመስኮቱ አርእስት" -#: gtk/gtkwidget.c:2499 +#: gtk/gtkwidget.c:2523 msgid "Wide Separators" msgstr "" -#: gtk/gtkwidget.c:2500 +#: gtk/gtkwidget.c:2524 msgid "" "Whether separators have configurable width and should be drawn using a box " "instead of a line" msgstr "" -#: gtk/gtkwidget.c:2514 +#: gtk/gtkwidget.c:2538 #, fuzzy msgid "Separator Width" msgstr "የነበረው ስፋት" -#: gtk/gtkwidget.c:2515 +#: gtk/gtkwidget.c:2539 msgid "The width of separators if wide-separators is TRUE" msgstr "" -#: gtk/gtkwidget.c:2529 +#: gtk/gtkwidget.c:2553 #, fuzzy msgid "Separator Height" msgstr "የነበረው እርዝማኔ" -#: gtk/gtkwidget.c:2530 +#: gtk/gtkwidget.c:2554 msgid "The height of separators if \"wide-separators\" is TRUE" msgstr "" -#: gtk/gtkwidget.c:2544 +#: gtk/gtkwidget.c:2568 #, fuzzy msgid "Horizontal Scroll Arrow Length" msgstr "የአግድም ኩልኩል" -#: gtk/gtkwidget.c:2545 +#: gtk/gtkwidget.c:2569 msgid "The length of horizontal scroll arrows" msgstr "" -#: gtk/gtkwidget.c:2559 +#: gtk/gtkwidget.c:2583 msgid "Vertical Scroll Arrow Length" msgstr "" -#: gtk/gtkwidget.c:2560 +#: gtk/gtkwidget.c:2584 msgid "The length of vertical scroll arrows" msgstr "" -#: gtk/gtkwindow.c:483 +#: gtk/gtkwindow.c:507 msgid "Window Type" msgstr "የመስኮት ዓይነት" -#: gtk/gtkwindow.c:484 +#: gtk/gtkwindow.c:508 msgid "The type of the window" msgstr "የመስኮቱ ዓይነት" -#: gtk/gtkwindow.c:492 +#: gtk/gtkwindow.c:516 msgid "Window Title" msgstr "የመስኮት አርእስት" -#: gtk/gtkwindow.c:493 +#: gtk/gtkwindow.c:517 msgid "The title of the window" msgstr "የመስኮቱ አርእስት" -#: gtk/gtkwindow.c:500 +#: gtk/gtkwindow.c:524 #, fuzzy msgid "Window Role" msgstr "የመስኮት አርእስት" -#: gtk/gtkwindow.c:501 +#: gtk/gtkwindow.c:525 msgid "Unique identifier for the window to be used when restoring a session" msgstr "" -#: gtk/gtkwindow.c:517 +#: gtk/gtkwindow.c:541 #, fuzzy msgid "Startup ID" msgstr "መድረክ" -#: gtk/gtkwindow.c:518 +#: gtk/gtkwindow.c:542 msgid "Unique startup identifier for the window used by startup-notification" msgstr "" -#: gtk/gtkwindow.c:525 +#: gtk/gtkwindow.c:549 msgid "Allow Shrink" msgstr "" -#: gtk/gtkwindow.c:527 +#: gtk/gtkwindow.c:551 #, no-c-format msgid "" "If TRUE, the window has no mimimum size. Setting this to TRUE is 99% of the " "time a bad idea" msgstr "" -#: gtk/gtkwindow.c:534 +#: gtk/gtkwindow.c:558 msgid "Allow Grow" msgstr "" -#: gtk/gtkwindow.c:535 +#: gtk/gtkwindow.c:559 msgid "If TRUE, users can expand the window beyond its minimum size" msgstr "" -#: gtk/gtkwindow.c:543 +#: gtk/gtkwindow.c:567 msgid "If TRUE, users can resize the window" msgstr "" -#: gtk/gtkwindow.c:550 +#: gtk/gtkwindow.c:574 msgid "Modal" msgstr "አዛምድ" -#: gtk/gtkwindow.c:551 +#: gtk/gtkwindow.c:575 msgid "" "If TRUE, the window is modal (other windows are not usable while this one is " "up)" msgstr "" -#: gtk/gtkwindow.c:558 +#: gtk/gtkwindow.c:582 msgid "Window Position" msgstr "የመስኮት ቦታ" -#: gtk/gtkwindow.c:559 +#: gtk/gtkwindow.c:583 msgid "The initial position of the window" msgstr "" -#: gtk/gtkwindow.c:567 +#: gtk/gtkwindow.c:591 msgid "Default Width" msgstr "የነበረው ስፋት" -#: gtk/gtkwindow.c:568 +#: gtk/gtkwindow.c:592 msgid "The default width of the window, used when initially showing the window" msgstr "" -#: gtk/gtkwindow.c:577 +#: gtk/gtkwindow.c:601 msgid "Default Height" msgstr "የነበረው እርዝማኔ" -#: gtk/gtkwindow.c:578 +#: gtk/gtkwindow.c:602 msgid "" "The default height of the window, used when initially showing the window" msgstr "" -#: gtk/gtkwindow.c:587 +#: gtk/gtkwindow.c:611 msgid "Destroy with Parent" msgstr "" -#: gtk/gtkwindow.c:588 +#: gtk/gtkwindow.c:612 msgid "If this window should be destroyed when the parent is destroyed" msgstr "" -#: gtk/gtkwindow.c:596 +#: gtk/gtkwindow.c:620 msgid "Icon for this window" msgstr "ምልክት ለዚህን መስኮት" -#: gtk/gtkwindow.c:602 +#: gtk/gtkwindow.c:626 #, fuzzy msgid "Mnemonics Visible" msgstr "የሚታይ" -#: gtk/gtkwindow.c:603 +#: gtk/gtkwindow.c:627 msgid "Whether mnemonics are currently visible in this window" msgstr "" -#: gtk/gtkwindow.c:619 +#: gtk/gtkwindow.c:643 #, fuzzy msgid "Name of the themed icon for this window" msgstr "ምልክት ለዚህን መስኮት" -#: gtk/gtkwindow.c:634 +#: gtk/gtkwindow.c:658 msgid "Is Active" msgstr "" -#: gtk/gtkwindow.c:635 +#: gtk/gtkwindow.c:659 msgid "Whether the toplevel is the current active window" msgstr "" -#: gtk/gtkwindow.c:642 +#: gtk/gtkwindow.c:666 msgid "Focus in Toplevel" msgstr "" -#: gtk/gtkwindow.c:643 +#: gtk/gtkwindow.c:667 msgid "Whether the input focus is within this GtkWindow" msgstr "" -#: gtk/gtkwindow.c:650 +#: gtk/gtkwindow.c:674 msgid "Type hint" msgstr "" -#: gtk/gtkwindow.c:651 +#: gtk/gtkwindow.c:675 msgid "" "Hint to help the desktop environment understand what kind of window this is " "and how to treat it." msgstr "" -#: gtk/gtkwindow.c:659 +#: gtk/gtkwindow.c:683 msgid "Skip taskbar" msgstr "" -#: gtk/gtkwindow.c:660 +#: gtk/gtkwindow.c:684 msgid "TRUE if the window should not be in the task bar." msgstr "" -#: gtk/gtkwindow.c:667 +#: gtk/gtkwindow.c:691 msgid "Skip pager" msgstr "" -#: gtk/gtkwindow.c:668 +#: gtk/gtkwindow.c:692 msgid "TRUE if the window should not be in the pager." msgstr "" -#: gtk/gtkwindow.c:675 +#: gtk/gtkwindow.c:699 msgid "Urgent" msgstr "" -#: gtk/gtkwindow.c:676 +#: gtk/gtkwindow.c:700 msgid "TRUE if the window should be brought to the user's attention." msgstr "" -#: gtk/gtkwindow.c:690 +#: gtk/gtkwindow.c:714 msgid "Accept focus" msgstr "" -#: gtk/gtkwindow.c:691 +#: gtk/gtkwindow.c:715 msgid "TRUE if the window should receive the input focus." msgstr "" -#: gtk/gtkwindow.c:705 +#: gtk/gtkwindow.c:729 msgid "Focus on map" msgstr "" -#: gtk/gtkwindow.c:706 +#: gtk/gtkwindow.c:730 msgid "TRUE if the window should receive the input focus when mapped." msgstr "" -#: gtk/gtkwindow.c:720 +#: gtk/gtkwindow.c:744 msgid "Decorated" msgstr "" -#: gtk/gtkwindow.c:721 +#: gtk/gtkwindow.c:745 msgid "Whether the window should be decorated by the window manager" msgstr "" -#: gtk/gtkwindow.c:735 +#: gtk/gtkwindow.c:759 msgid "Deletable" msgstr "" -#: gtk/gtkwindow.c:736 +#: gtk/gtkwindow.c:760 msgid "Whether the window frame should have a close button" msgstr "" -#: gtk/gtkwindow.c:752 +#: gtk/gtkwindow.c:776 msgid "Gravity" msgstr "" -#: gtk/gtkwindow.c:753 +#: gtk/gtkwindow.c:777 #, fuzzy msgid "The window gravity of the window" msgstr "የመስኮቱ ዓይነት" -#: gtk/gtkwindow.c:770 +#: gtk/gtkwindow.c:794 msgid "Transient for Window" msgstr "" -#: gtk/gtkwindow.c:771 +#: gtk/gtkwindow.c:795 #, fuzzy msgid "The transient parent of the dialog" msgstr "የመስኮቱ አርእስት" -#: gtk/gtkwindow.c:786 +#: gtk/gtkwindow.c:810 msgid "Opacity for Window" msgstr "" -#: gtk/gtkwindow.c:787 +#: gtk/gtkwindow.c:811 #, fuzzy msgid "The opacity of the window, from 0 to 1" msgstr "የመስኮቱ ዓይነት" @@ -7417,6 +7225,26 @@ msgstr "" msgid "How to draw the input method statusbar" msgstr "" +#~ msgid "Minimum X" +#~ msgstr "በተቻለ መጠን X" + +#~ msgid "Maximum X" +#~ msgstr "ከፍተኛ መጠን X" + +#~ msgid "Minimum Y" +#~ msgstr "በተቻለ መጠን Y" + +#~ msgid "Maximum Y" +#~ msgstr "ከፍተኛ መጠን Y" + +#, fuzzy +#~ msgid "File System Backend" +#~ msgstr "ፋይሎች" + +#, fuzzy +#~ msgid "Group ID" +#~ msgstr "መድረክ" + #, fuzzy #~ msgid "The current page in the document." #~ msgstr "የጽሑፉ መለያ" diff --git a/po-properties/ang.po b/po-properties/ang.po index 82bda4ac61..6416dde65d 100644 --- a/po-properties/ang.po +++ b/po-properties/ang.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: gtk+-properties OE\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-03-22 23:35-0400\n" +"POT-Creation-Date: 2010-05-25 20:10-0400\n" "PO-Revision-Date: 2004-08-26 16:32-0600\n" "Last-Translator: James Johnson \n" "Language-Team: Old English \n" @@ -55,7 +55,7 @@ msgstr "" msgid "The number of bits per sample" msgstr "" -#: gdk-pixbuf/gdk-pixbuf.c:132 gtk/gtklayout.c:633 gtk/gtktreeviewcolumn.c:208 +#: gdk-pixbuf/gdk-pixbuf.c:132 gtk/gtklayout.c:597 gtk/gtktreeviewcolumn.c:208 msgid "Width" msgstr "Wídu" @@ -63,7 +63,7 @@ msgstr "Wídu" msgid "The number of columns of the pixbuf" msgstr "" -#: gdk-pixbuf/gdk-pixbuf.c:142 gtk/gtklayout.c:642 +#: gdk-pixbuf/gdk-pixbuf.c:142 gtk/gtklayout.c:606 msgid "Height" msgstr "Híehþu" @@ -97,7 +97,7 @@ msgid "The default display for GDK" msgstr "" #: gdk/gdkpango.c:538 gtk/gtkinvisible.c:86 gtk/gtkmountoperation.c:176 -#: gtk/gtkstatusicon.c:280 gtk/gtkwindow.c:626 +#: gtk/gtkstatusicon.c:285 gtk/gtkwindow.c:650 msgid "Screen" msgstr "" @@ -121,7 +121,7 @@ msgstr "" msgid "The resolution for fonts on the screen" msgstr "" -#: gdk/gdkwindow.c:496 gdk/gdkwindow.c:497 +#: gdk/gdkwindow.c:565 gdk/gdkwindow.c:566 msgid "Cursor" msgstr "" @@ -236,167 +236,167 @@ msgstr "" msgid "Whether to wrap the license text." msgstr "" -#: gtk/gtkaccellabel.c:178 +#: gtk/gtkaccellabel.c:189 msgid "Accelerator Closure" msgstr "" -#: gtk/gtkaccellabel.c:179 +#: gtk/gtkaccellabel.c:190 msgid "The closure to be monitored for accelerator changes" msgstr "" -#: gtk/gtkaccellabel.c:185 +#: gtk/gtkaccellabel.c:196 msgid "Accelerator Widget" msgstr "" -#: gtk/gtkaccellabel.c:186 +#: gtk/gtkaccellabel.c:197 msgid "The widget to be monitored for accelerator changes" msgstr "" -#: gtk/gtkaction.c:181 gtk/gtkactiongroup.c:170 gtk/gtkprinter.c:111 +#: gtk/gtkaction.c:220 gtk/gtkactiongroup.c:170 gtk/gtkprinter.c:130 #: gtk/gtktextmark.c:89 msgid "Name" msgstr "Nama" -#: gtk/gtkaction.c:182 +#: gtk/gtkaction.c:221 msgid "A unique name for the action." msgstr "" -#: gtk/gtkaction.c:200 gtk/gtkbutton.c:219 gtk/gtkexpander.c:195 -#: gtk/gtkframe.c:105 gtk/gtklabel.c:506 gtk/gtkmenuitem.c:305 -#: gtk/gtktoolbutton.c:204 gtk/gtktoolitemgroup.c:1535 +#: gtk/gtkaction.c:239 gtk/gtkbutton.c:227 gtk/gtkexpander.c:195 +#: gtk/gtkframe.c:114 gtk/gtklabel.c:528 gtk/gtkmenuitem.c:305 +#: gtk/gtktoolbutton.c:204 gtk/gtktoolitemgroup.c:1543 msgid "Label" msgstr "" -#: gtk/gtkaction.c:201 +#: gtk/gtkaction.c:240 msgid "The label used for menu items and buttons that activate this action." msgstr "" -#: gtk/gtkaction.c:217 +#: gtk/gtkaction.c:256 msgid "Short label" msgstr "" -#: gtk/gtkaction.c:218 +#: gtk/gtkaction.c:257 msgid "A shorter label that may be used on toolbar buttons." msgstr "" -#: gtk/gtkaction.c:226 +#: gtk/gtkaction.c:265 msgid "Tooltip" msgstr "" -#: gtk/gtkaction.c:227 +#: gtk/gtkaction.c:266 msgid "A tooltip for this action." msgstr "" -#: gtk/gtkaction.c:242 +#: gtk/gtkaction.c:281 msgid "Stock Icon" msgstr "" -#: gtk/gtkaction.c:243 +#: gtk/gtkaction.c:282 msgid "The stock icon displayed in widgets representing this action." msgstr "" -#: gtk/gtkaction.c:263 gtk/gtkstatusicon.c:253 +#: gtk/gtkaction.c:302 gtk/gtkstatusicon.c:258 #, fuzzy msgid "GIcon" msgstr "Segn" -#: gtk/gtkaction.c:264 gtk/gtkcellrendererpixbuf.c:206 gtk/gtkimage.c:339 -#: gtk/gtkstatusicon.c:254 +#: gtk/gtkaction.c:303 gtk/gtkcellrendererpixbuf.c:206 gtk/gtkimage.c:344 +#: gtk/gtkstatusicon.c:259 msgid "The GIcon being displayed" msgstr "" -#: gtk/gtkaction.c:284 gtk/gtkcellrendererpixbuf.c:171 gtk/gtkimage.c:321 -#: gtk/gtkprinter.c:160 gtk/gtkstatusicon.c:237 gtk/gtkwindow.c:618 +#: gtk/gtkaction.c:323 gtk/gtkcellrendererpixbuf.c:171 gtk/gtkimage.c:326 +#: gtk/gtkprinter.c:179 gtk/gtkstatusicon.c:242 gtk/gtkwindow.c:642 #, fuzzy msgid "Icon Name" msgstr "Nama" -#: gtk/gtkaction.c:285 gtk/gtkcellrendererpixbuf.c:172 gtk/gtkimage.c:322 -#: gtk/gtkstatusicon.c:238 +#: gtk/gtkaction.c:324 gtk/gtkcellrendererpixbuf.c:172 gtk/gtkimage.c:327 +#: gtk/gtkstatusicon.c:243 msgid "The name of the icon from the icon theme" msgstr "" -#: gtk/gtkaction.c:292 gtk/gtktoolitem.c:192 +#: gtk/gtkaction.c:331 gtk/gtktoolitem.c:185 msgid "Visible when horizontal" msgstr "" -#: gtk/gtkaction.c:293 gtk/gtktoolitem.c:193 +#: gtk/gtkaction.c:332 gtk/gtktoolitem.c:186 msgid "" "Whether the toolbar item is visible when the toolbar is in a horizontal " "orientation." msgstr "" -#: gtk/gtkaction.c:308 +#: gtk/gtkaction.c:347 msgid "Visible when overflown" msgstr "" -#: gtk/gtkaction.c:309 +#: gtk/gtkaction.c:348 msgid "" "When TRUE, toolitem proxies for this action are represented in the toolbar " "overflow menu." msgstr "" -#: gtk/gtkaction.c:316 gtk/gtktoolitem.c:199 +#: gtk/gtkaction.c:355 gtk/gtktoolitem.c:192 msgid "Visible when vertical" msgstr "" -#: gtk/gtkaction.c:317 gtk/gtktoolitem.c:200 +#: gtk/gtkaction.c:356 gtk/gtktoolitem.c:193 msgid "" "Whether the toolbar item is visible when the toolbar is in a vertical " "orientation." msgstr "" -#: gtk/gtkaction.c:324 gtk/gtktoolitem.c:206 +#: gtk/gtkaction.c:363 gtk/gtktoolitem.c:199 msgid "Is important" msgstr "" -#: gtk/gtkaction.c:325 +#: gtk/gtkaction.c:364 msgid "" "Whether the action is considered important. When TRUE, toolitem proxies for " "this action show text in GTK_TOOLBAR_BOTH_HORIZ mode." msgstr "" -#: gtk/gtkaction.c:333 +#: gtk/gtkaction.c:372 msgid "Hide if empty" msgstr "Hýdan gif ǽmtig" -#: gtk/gtkaction.c:334 +#: gtk/gtkaction.c:373 msgid "When TRUE, empty menu proxies for this action are hidden." msgstr "" -#: gtk/gtkaction.c:340 gtk/gtkactiongroup.c:177 gtk/gtkcellrenderer.c:193 -#: gtk/gtkwidget.c:593 +#: gtk/gtkaction.c:379 gtk/gtkactiongroup.c:177 gtk/gtkcellrenderer.c:193 +#: gtk/gtkwidget.c:613 msgid "Sensitive" msgstr "" -#: gtk/gtkaction.c:341 +#: gtk/gtkaction.c:380 msgid "Whether the action is enabled." msgstr "" -#: gtk/gtkaction.c:347 gtk/gtkactiongroup.c:184 gtk/gtkstatusicon.c:296 -#: gtk/gtktreeviewcolumn.c:192 gtk/gtkwidget.c:586 +#: gtk/gtkaction.c:386 gtk/gtkactiongroup.c:184 gtk/gtkstatusicon.c:301 +#: gtk/gtktreeviewcolumn.c:192 gtk/gtkwidget.c:606 msgid "Visible" msgstr "" -#: gtk/gtkaction.c:348 +#: gtk/gtkaction.c:387 msgid "Whether the action is visible." msgstr "" -#: gtk/gtkaction.c:354 +#: gtk/gtkaction.c:393 msgid "Action Group" msgstr "" -#: gtk/gtkaction.c:355 +#: gtk/gtkaction.c:394 msgid "" "The GtkActionGroup this GtkAction is associated with, or NULL (for internal " "use)." msgstr "" -#: gtk/gtkaction.c:373 gtk/gtkimagemenuitem.c:169 +#: gtk/gtkaction.c:412 gtk/gtkimagemenuitem.c:169 msgid "Always show image" msgstr "" -#: gtk/gtkaction.c:374 gtk/gtkimagemenuitem.c:170 +#: gtk/gtkaction.c:413 gtk/gtkimagemenuitem.c:170 msgid "Whether the image will always be shown" msgstr "" @@ -429,7 +429,7 @@ msgid "Whether to use the related actions appearance properties" msgstr "" #: gtk/gtkadjustment.c:93 gtk/gtkcellrendererprogress.c:128 -#: gtk/gtkscalebutton.c:206 gtk/gtkspinbutton.c:269 +#: gtk/gtkscalebutton.c:222 gtk/gtkspinbutton.c:269 msgid "Value" msgstr "" @@ -477,451 +477,450 @@ msgstr "" msgid "The page size of the adjustment" msgstr "" -#: gtk/gtkalignment.c:90 +#: gtk/gtkalignment.c:117 msgid "Horizontal alignment" msgstr "" -#: gtk/gtkalignment.c:91 gtk/gtkbutton.c:270 +#: gtk/gtkalignment.c:118 gtk/gtkbutton.c:278 msgid "" "Horizontal position of child in available space. 0.0 is left aligned, 1.0 is " "right aligned" msgstr "" -#: gtk/gtkalignment.c:100 +#: gtk/gtkalignment.c:127 msgid "Vertical alignment" msgstr "" -#: gtk/gtkalignment.c:101 gtk/gtkbutton.c:289 +#: gtk/gtkalignment.c:128 gtk/gtkbutton.c:297 msgid "" "Vertical position of child in available space. 0.0 is top aligned, 1.0 is " "bottom aligned" msgstr "" -#: gtk/gtkalignment.c:109 +#: gtk/gtkalignment.c:136 msgid "Horizontal scale" msgstr "" -#: gtk/gtkalignment.c:110 +#: gtk/gtkalignment.c:137 msgid "" "If available horizontal space is bigger than needed for the child, how much " "of it to use for the child. 0.0 means none, 1.0 means all" msgstr "" -#: gtk/gtkalignment.c:118 +#: gtk/gtkalignment.c:145 msgid "Vertical scale" msgstr "" -#: gtk/gtkalignment.c:119 +#: gtk/gtkalignment.c:146 msgid "" "If available vertical space is bigger than needed for the child, how much of " "it to use for the child. 0.0 means none, 1.0 means all" msgstr "" -#: gtk/gtkalignment.c:136 +#: gtk/gtkalignment.c:163 msgid "Top Padding" msgstr "" -#: gtk/gtkalignment.c:137 +#: gtk/gtkalignment.c:164 msgid "The padding to insert at the top of the widget." msgstr "" -#: gtk/gtkalignment.c:153 +#: gtk/gtkalignment.c:180 msgid "Bottom Padding" msgstr "" -#: gtk/gtkalignment.c:154 +#: gtk/gtkalignment.c:181 msgid "The padding to insert at the bottom of the widget." msgstr "" -#: gtk/gtkalignment.c:170 +#: gtk/gtkalignment.c:197 msgid "Left Padding" msgstr "" -#: gtk/gtkalignment.c:171 +#: gtk/gtkalignment.c:198 msgid "The padding to insert at the left of the widget." msgstr "" -#: gtk/gtkalignment.c:187 +#: gtk/gtkalignment.c:214 msgid "Right Padding" msgstr "" -#: gtk/gtkalignment.c:188 +#: gtk/gtkalignment.c:215 msgid "The padding to insert at the right of the widget." msgstr "" -#: gtk/gtkarrow.c:75 +#: gtk/gtkarrow.c:95 msgid "Arrow direction" msgstr "" -#: gtk/gtkarrow.c:76 +#: gtk/gtkarrow.c:96 msgid "The direction the arrow should point" msgstr "" -#: gtk/gtkarrow.c:84 +#: gtk/gtkarrow.c:104 msgid "Arrow shadow" msgstr "" -#: gtk/gtkarrow.c:85 +#: gtk/gtkarrow.c:105 msgid "Appearance of the shadow surrounding the arrow" msgstr "" -#: gtk/gtkarrow.c:92 gtk/gtkmenu.c:711 gtk/gtkmenuitem.c:368 +#: gtk/gtkarrow.c:112 gtk/gtkmenu.c:718 gtk/gtkmenuitem.c:368 msgid "Arrow Scaling" msgstr "" -#: gtk/gtkarrow.c:93 +#: gtk/gtkarrow.c:113 msgid "Amount of space used up by arrow" msgstr "" -#: gtk/gtkaspectframe.c:79 +#: gtk/gtkaspectframe.c:93 msgid "Horizontal Alignment" msgstr "" -#: gtk/gtkaspectframe.c:80 +#: gtk/gtkaspectframe.c:94 msgid "X alignment of the child" msgstr "" -#: gtk/gtkaspectframe.c:86 +#: gtk/gtkaspectframe.c:100 msgid "Vertical Alignment" msgstr "" -#: gtk/gtkaspectframe.c:87 +#: gtk/gtkaspectframe.c:101 msgid "Y alignment of the child" msgstr "" -#: gtk/gtkaspectframe.c:93 +#: gtk/gtkaspectframe.c:107 msgid "Ratio" msgstr "" -#: gtk/gtkaspectframe.c:94 +#: gtk/gtkaspectframe.c:108 msgid "Aspect ratio if obey_child is FALSE" msgstr "" -#: gtk/gtkaspectframe.c:100 +#: gtk/gtkaspectframe.c:114 msgid "Obey child" msgstr "" -#: gtk/gtkaspectframe.c:101 +#: gtk/gtkaspectframe.c:115 msgid "Force aspect ratio to match that of the frame's child" msgstr "" -#: gtk/gtkassistant.c:284 +#: gtk/gtkassistant.c:306 msgid "Header Padding" msgstr "" -#: gtk/gtkassistant.c:285 +#: gtk/gtkassistant.c:307 msgid "Number of pixels around the header." msgstr "" -#: gtk/gtkassistant.c:292 +#: gtk/gtkassistant.c:314 msgid "Content Padding" msgstr "" -#: gtk/gtkassistant.c:293 +#: gtk/gtkassistant.c:315 msgid "Number of pixels around the content pages." msgstr "" -#: gtk/gtkassistant.c:309 +#: gtk/gtkassistant.c:331 msgid "Page type" msgstr "" -#: gtk/gtkassistant.c:310 +#: gtk/gtkassistant.c:332 #, fuzzy msgid "The type of the assistant page" msgstr "Þæt cynn þæs éagþyrles" -#: gtk/gtkassistant.c:327 +#: gtk/gtkassistant.c:349 msgid "Page title" msgstr "" -#: gtk/gtkassistant.c:328 +#: gtk/gtkassistant.c:350 #, fuzzy msgid "The title of the assistant page" msgstr "Þæt cynn þæs éagþyrles" -#: gtk/gtkassistant.c:344 +#: gtk/gtkassistant.c:366 msgid "Header image" msgstr "" -#: gtk/gtkassistant.c:345 +#: gtk/gtkassistant.c:367 msgid "Header image for the assistant page" msgstr "" -#: gtk/gtkassistant.c:361 +#: gtk/gtkassistant.c:383 msgid "Sidebar image" msgstr "" -#: gtk/gtkassistant.c:362 +#: gtk/gtkassistant.c:384 msgid "Sidebar image for the assistant page" msgstr "" -#: gtk/gtkassistant.c:377 +#: gtk/gtkassistant.c:399 msgid "Page complete" msgstr "" -#: gtk/gtkassistant.c:378 +#: gtk/gtkassistant.c:400 msgid "Whether all required fields on the page have been filled out" msgstr "" -#: gtk/gtkbbox.c:101 +#: gtk/gtkbbox.c:129 msgid "Minimum child width" msgstr "" -#: gtk/gtkbbox.c:102 +#: gtk/gtkbbox.c:130 msgid "Minimum width of buttons inside the box" msgstr "" -#: gtk/gtkbbox.c:110 +#: gtk/gtkbbox.c:138 msgid "Minimum child height" msgstr "" -#: gtk/gtkbbox.c:111 +#: gtk/gtkbbox.c:139 msgid "Minimum height of buttons inside the box" msgstr "" -#: gtk/gtkbbox.c:119 +#: gtk/gtkbbox.c:147 msgid "Child internal width padding" msgstr "" -#: gtk/gtkbbox.c:120 +#: gtk/gtkbbox.c:148 msgid "Amount to increase child's size on either side" msgstr "" -#: gtk/gtkbbox.c:128 +#: gtk/gtkbbox.c:156 msgid "Child internal height padding" msgstr "" -#: gtk/gtkbbox.c:129 +#: gtk/gtkbbox.c:157 msgid "Amount to increase child's size on the top and bottom" msgstr "" -#: gtk/gtkbbox.c:137 +#: gtk/gtkbbox.c:165 msgid "Layout style" msgstr "" -#: gtk/gtkbbox.c:138 +#: gtk/gtkbbox.c:166 msgid "" "How to layout the buttons in the box. Possible values are default, spread, " "edge, start and end" msgstr "" -#: gtk/gtkbbox.c:146 +#: gtk/gtkbbox.c:174 msgid "Secondary" msgstr "" -#: gtk/gtkbbox.c:147 +#: gtk/gtkbbox.c:175 msgid "" "If TRUE, the child appears in a secondary group of children, suitable for, e." "g., help buttons" msgstr "" -#: gtk/gtkbox.c:130 gtk/gtkexpander.c:219 gtk/gtkiconview.c:665 +#: gtk/gtkbox.c:217 gtk/gtkexpander.c:219 gtk/gtkiconview.c:667 #: gtk/gtktreeviewcolumn.c:217 msgid "Spacing" msgstr "" -#: gtk/gtkbox.c:131 +#: gtk/gtkbox.c:218 msgid "The amount of space between children" msgstr "" -#: gtk/gtkbox.c:140 gtk/gtknotebook.c:657 gtk/gtktable.c:165 -#: gtk/gtktoolbar.c:573 gtk/gtktoolitemgroup.c:1588 +#: gtk/gtkbox.c:227 gtk/gtktable.c:165 gtk/gtktoolbar.c:518 +#: gtk/gtktoolitemgroup.c:1596 msgid "Homogeneous" msgstr "" -#: gtk/gtkbox.c:141 +#: gtk/gtkbox.c:228 msgid "Whether the children should all be the same size" msgstr "" -#: gtk/gtkbox.c:148 gtk/gtkpreview.c:101 gtk/gtktoolbar.c:565 -#: gtk/gtktoolitemgroup.c:1595 gtk/gtktoolpalette.c:1052 -#: gtk/gtktreeviewcolumn.c:273 +#: gtk/gtkbox.c:235 gtk/gtktoolbar.c:510 gtk/gtktoolitemgroup.c:1603 +#: gtk/gtktoolpalette.c:1053 gtk/gtktreeviewcolumn.c:273 msgid "Expand" msgstr "" -#: gtk/gtkbox.c:149 +#: gtk/gtkbox.c:236 msgid "Whether the child should receive extra space when the parent grows" msgstr "" -#: gtk/gtkbox.c:155 gtk/gtktoolitemgroup.c:1602 +#: gtk/gtkbox.c:242 gtk/gtktoolitemgroup.c:1610 msgid "Fill" msgstr "" -#: gtk/gtkbox.c:156 +#: gtk/gtkbox.c:243 msgid "" "Whether extra space given to the child should be allocated to the child or " "used as padding" msgstr "" -#: gtk/gtkbox.c:162 +#: gtk/gtkbox.c:249 gtk/gtktrayicon-x11.c:163 msgid "Padding" msgstr "" -#: gtk/gtkbox.c:163 +#: gtk/gtkbox.c:250 msgid "Extra space to put between the child and its neighbors, in pixels" msgstr "" -#: gtk/gtkbox.c:169 +#: gtk/gtkbox.c:256 msgid "Pack type" msgstr "" -#: gtk/gtkbox.c:170 gtk/gtknotebook.c:724 +#: gtk/gtkbox.c:257 gtk/gtknotebook.c:667 msgid "" "A GtkPackType indicating whether the child is packed with reference to the " "start or end of the parent" msgstr "" -#: gtk/gtkbox.c:176 gtk/gtknotebook.c:702 gtk/gtkpaned.c:241 -#: gtk/gtkruler.c:148 gtk/gtktoolitemgroup.c:1616 +#: gtk/gtkbox.c:263 gtk/gtknotebook.c:645 gtk/gtkpaned.c:242 +#: gtk/gtkruler.c:148 gtk/gtktoolitemgroup.c:1624 msgid "Position" msgstr "" -#: gtk/gtkbox.c:177 gtk/gtknotebook.c:703 +#: gtk/gtkbox.c:264 gtk/gtknotebook.c:646 msgid "The index of the child in the parent" msgstr "" -#: gtk/gtkbuilder.c:96 +#: gtk/gtkbuilder.c:314 msgid "Translation Domain" msgstr "" -#: gtk/gtkbuilder.c:97 +#: gtk/gtkbuilder.c:315 msgid "The translation domain used by gettext" msgstr "" -#: gtk/gtkbutton.c:220 +#: gtk/gtkbutton.c:228 msgid "" "Text of the label widget inside the button, if the button contains a label " "widget" msgstr "" -#: gtk/gtkbutton.c:227 gtk/gtkexpander.c:203 gtk/gtklabel.c:527 +#: gtk/gtkbutton.c:235 gtk/gtkexpander.c:203 gtk/gtklabel.c:549 #: gtk/gtkmenuitem.c:320 gtk/gtktoolbutton.c:211 msgid "Use underline" msgstr "" -#: gtk/gtkbutton.c:228 gtk/gtkexpander.c:204 gtk/gtklabel.c:528 +#: gtk/gtkbutton.c:236 gtk/gtkexpander.c:204 gtk/gtklabel.c:550 #: gtk/gtkmenuitem.c:321 msgid "" "If set, an underline in the text indicates the next character should be used " "for the mnemonic accelerator key" msgstr "" -#: gtk/gtkbutton.c:235 gtk/gtkimagemenuitem.c:150 +#: gtk/gtkbutton.c:243 gtk/gtkimagemenuitem.c:150 msgid "Use stock" msgstr "" -#: gtk/gtkbutton.c:236 +#: gtk/gtkbutton.c:244 msgid "" "If set, the label is used to pick a stock item instead of being displayed" msgstr "" -#: gtk/gtkbutton.c:243 gtk/gtkcombobox.c:796 gtk/gtkfilechooserbutton.c:393 +#: gtk/gtkbutton.c:251 gtk/gtkcombobox.c:799 gtk/gtkfilechooserbutton.c:393 msgid "Focus on click" msgstr "" -#: gtk/gtkbutton.c:244 gtk/gtkfilechooserbutton.c:394 +#: gtk/gtkbutton.c:252 gtk/gtkfilechooserbutton.c:394 msgid "Whether the button grabs focus when it is clicked with the mouse" msgstr "" -#: gtk/gtkbutton.c:251 +#: gtk/gtkbutton.c:259 msgid "Border relief" msgstr "" -#: gtk/gtkbutton.c:252 +#: gtk/gtkbutton.c:260 msgid "The border relief style" msgstr "" -#: gtk/gtkbutton.c:269 +#: gtk/gtkbutton.c:277 msgid "Horizontal alignment for child" msgstr "" -#: gtk/gtkbutton.c:288 +#: gtk/gtkbutton.c:296 msgid "Vertical alignment for child" msgstr "" -#: gtk/gtkbutton.c:305 gtk/gtkimagemenuitem.c:135 +#: gtk/gtkbutton.c:313 gtk/gtkimagemenuitem.c:135 msgid "Image widget" msgstr "" -#: gtk/gtkbutton.c:306 +#: gtk/gtkbutton.c:314 msgid "Child widget to appear next to the button text" msgstr "" -#: gtk/gtkbutton.c:320 +#: gtk/gtkbutton.c:328 msgid "Image position" msgstr "" -#: gtk/gtkbutton.c:321 +#: gtk/gtkbutton.c:329 msgid "The position of the image relative to the text" msgstr "" -#: gtk/gtkbutton.c:441 +#: gtk/gtkbutton.c:449 msgid "Default Spacing" msgstr "" -#: gtk/gtkbutton.c:442 +#: gtk/gtkbutton.c:450 msgid "Extra space to add for GTK_CAN_DEFAULT buttons" msgstr "" -#: gtk/gtkbutton.c:456 +#: gtk/gtkbutton.c:464 msgid "Default Outside Spacing" msgstr "" -#: gtk/gtkbutton.c:457 +#: gtk/gtkbutton.c:465 msgid "" "Extra space to add for GTK_CAN_DEFAULT buttons that is always drawn outside " "the border" msgstr "" -#: gtk/gtkbutton.c:462 -msgid "Child X Displacement" -msgstr "" - -#: gtk/gtkbutton.c:463 -msgid "" -"How far in the x direction to move the child when the button is depressed" -msgstr "" - #: gtk/gtkbutton.c:470 -msgid "Child Y Displacement" +msgid "Child X Displacement" msgstr "" #: gtk/gtkbutton.c:471 msgid "" +"How far in the x direction to move the child when the button is depressed" +msgstr "" + +#: gtk/gtkbutton.c:478 +msgid "Child Y Displacement" +msgstr "" + +#: gtk/gtkbutton.c:479 +msgid "" "How far in the y direction to move the child when the button is depressed" msgstr "" -#: gtk/gtkbutton.c:487 +#: gtk/gtkbutton.c:495 msgid "Displace focus" msgstr "" -#: gtk/gtkbutton.c:488 +#: gtk/gtkbutton.c:496 msgid "" "Whether the child_displacement_x/_y properties should also affect the focus " "rectangle" msgstr "" -#: gtk/gtkbutton.c:501 gtk/gtkentry.c:695 gtk/gtkentry.c:1740 +#: gtk/gtkbutton.c:509 gtk/gtkentry.c:697 gtk/gtkentry.c:1742 msgid "Inner Border" msgstr "" -#: gtk/gtkbutton.c:502 +#: gtk/gtkbutton.c:510 msgid "Border between button edges and child." msgstr "" -#: gtk/gtkbutton.c:515 +#: gtk/gtkbutton.c:523 msgid "Image spacing" msgstr "" -#: gtk/gtkbutton.c:516 +#: gtk/gtkbutton.c:524 msgid "Spacing in pixels between the image and label" msgstr "" -#: gtk/gtkbutton.c:530 +#: gtk/gtkbutton.c:538 msgid "Show button images" msgstr "" -#: gtk/gtkbutton.c:531 +#: gtk/gtkbutton.c:539 msgid "Whether images should be shown on buttons" msgstr "" @@ -1010,11 +1009,11 @@ msgstr "" msgid "If TRUE, details are shown" msgstr "" -#: gtk/gtkcelleditable.c:76 +#: gtk/gtkcelleditable.c:43 msgid "Editing Canceled" msgstr "" -#: gtk/gtkcelleditable.c:77 +#: gtk/gtkcelleditable.c:44 msgid "Indicates that editing has been canceled" msgstr "" @@ -1134,35 +1133,35 @@ msgstr "" msgid "Whether this tag affects the cell background color" msgstr "" -#: gtk/gtkcellrendereraccel.c:114 +#: gtk/gtkcellrendereraccel.c:124 msgid "Accelerator key" msgstr "" -#: gtk/gtkcellrendereraccel.c:115 +#: gtk/gtkcellrendereraccel.c:125 msgid "The keyval of the accelerator" msgstr "" -#: gtk/gtkcellrendereraccel.c:131 +#: gtk/gtkcellrendereraccel.c:141 msgid "Accelerator modifiers" msgstr "" -#: gtk/gtkcellrendereraccel.c:132 +#: gtk/gtkcellrendereraccel.c:142 msgid "The modifier mask of the accelerator" msgstr "" -#: gtk/gtkcellrendereraccel.c:149 +#: gtk/gtkcellrendereraccel.c:159 msgid "Accelerator keycode" msgstr "" -#: gtk/gtkcellrendereraccel.c:150 +#: gtk/gtkcellrendereraccel.c:160 msgid "The hardware keycode of the accelerator" msgstr "" -#: gtk/gtkcellrendereraccel.c:169 +#: gtk/gtkcellrendereraccel.c:179 msgid "Accelerator Mode" msgstr "" -#: gtk/gtkcellrendereraccel.c:170 +#: gtk/gtkcellrendereraccel.c:180 #, fuzzy msgid "The type of accelerators" msgstr "Þæt cynn þæs éagþyrles" @@ -1215,7 +1214,7 @@ msgstr "" msgid "Pixbuf for closed expander" msgstr "" -#: gtk/gtkcellrendererpixbuf.c:135 gtk/gtkimage.c:263 gtk/gtkstatusicon.c:229 +#: gtk/gtkcellrendererpixbuf.c:135 gtk/gtkimage.c:268 gtk/gtkstatusicon.c:234 msgid "Stock ID" msgstr "" @@ -1224,7 +1223,7 @@ msgid "The stock ID of the stock icon to render" msgstr "" #: gtk/gtkcellrendererpixbuf.c:143 gtk/gtkcellrendererspinner.c:158 -#: gtk/gtkrecentmanager.c:245 gtk/gtkstatusicon.c:270 +#: gtk/gtkrecentmanager.c:245 gtk/gtkstatusicon.c:275 msgid "Size" msgstr "" @@ -1248,7 +1247,7 @@ msgstr "" msgid "Whether the rendered pixbuf should be colorized according to the state" msgstr "" -#: gtk/gtkcellrendererpixbuf.c:205 gtk/gtkimage.c:338 gtk/gtkwindow.c:595 +#: gtk/gtkcellrendererpixbuf.c:205 gtk/gtkimage.c:343 gtk/gtkwindow.c:619 msgid "Icon" msgstr "Segn" @@ -1257,8 +1256,8 @@ msgid "Value of the progress bar" msgstr "" #: gtk/gtkcellrendererprogress.c:146 gtk/gtkcellrenderertext.c:195 -#: gtk/gtkentry.c:738 gtk/gtkentrybuffer.c:353 gtk/gtkmessagedialog.c:153 -#: gtk/gtkprogressbar.c:184 gtk/gtktextbuffer.c:198 +#: gtk/gtkentry.c:740 gtk/gtkentrybuffer.c:353 gtk/gtkmessagedialog.c:200 +#: gtk/gtkprogressbar.c:137 gtk/gtktextbuffer.c:198 msgid "Text" msgstr "" @@ -1294,18 +1293,18 @@ msgstr "" msgid "The vertical text alignment, from 0 (top) to 1 (bottom)." msgstr "" -#: gtk/gtkcellrendererprogress.c:221 gtk/gtkiconview.c:729 -#: gtk/gtkorientable.c:74 gtk/gtkprogressbar.c:126 gtk/gtkstatusicon.c:328 -#: gtk/gtktrayicon-x11.c:110 +#: gtk/gtkcellrendererprogress.c:221 gtk/gtkiconview.c:731 +#: gtk/gtkorientable.c:63 gtk/gtkprogressbar.c:112 gtk/gtkstatusicon.c:333 +#: gtk/gtktrayicon-x11.c:122 msgid "Orientation" msgstr "" -#: gtk/gtkcellrendererprogress.c:222 gtk/gtkprogressbar.c:127 +#: gtk/gtkcellrendererprogress.c:222 gtk/gtkprogressbar.c:113 msgid "Orientation and growth direction of the progress bar" msgstr "" -#: gtk/gtkcellrendererspin.c:93 gtk/gtkprogressbar.c:118 gtk/gtkrange.c:367 -#: gtk/gtkscalebutton.c:225 gtk/gtkspinbutton.c:208 +#: gtk/gtkcellrendererspin.c:93 gtk/gtkrange.c:394 gtk/gtkscalebutton.c:241 +#: gtk/gtkspinbutton.c:208 msgid "Adjustment" msgstr "" @@ -1330,7 +1329,7 @@ msgid "The number of decimal places to display" msgstr "" #: gtk/gtkcellrendererspinner.c:124 gtk/gtkcheckmenuitem.c:98 -#: gtk/gtkmenu.c:501 gtk/gtkspinner.c:128 gtk/gtktoggleaction.c:119 +#: gtk/gtkmenu.c:508 gtk/gtkspinner.c:128 gtk/gtktoggleaction.c:130 #: gtk/gtktogglebutton.c:115 gtk/gtktoggletoolbutton.c:114 msgid "Active" msgstr "" @@ -1360,7 +1359,7 @@ msgstr "" msgid "Marked up text to render" msgstr "" -#: gtk/gtkcellrenderertext.c:211 gtk/gtklabel.c:513 +#: gtk/gtkcellrenderertext.c:211 gtk/gtklabel.c:535 msgid "Attributes" msgstr "" @@ -1401,6 +1400,7 @@ msgid "Foreground color as a string" msgstr "" #: gtk/gtkcellrenderertext.c:252 gtk/gtktexttag.c:225 +#: gtk/gtktrayicon-x11.c:131 msgid "Foreground color" msgstr "" @@ -1408,7 +1408,7 @@ msgstr "" msgid "Foreground color as a GdkColor" msgstr "" -#: gtk/gtkcellrenderertext.c:261 gtk/gtkentry.c:662 gtk/gtktexttag.c:251 +#: gtk/gtkcellrenderertext.c:261 gtk/gtkentry.c:664 gtk/gtktexttag.c:251 #: gtk/gtktextview.c:577 msgid "Editable" msgstr "" @@ -1515,7 +1515,7 @@ msgid "" "probably don't need it" msgstr "" -#: gtk/gtkcellrenderertext.c:411 gtk/gtklabel.c:638 gtk/gtkprogressbar.c:206 +#: gtk/gtkcellrenderertext.c:411 gtk/gtklabel.c:660 gtk/gtkprogressbar.c:159 msgid "Ellipsize" msgstr "" @@ -1526,11 +1526,11 @@ msgid "" msgstr "" #: gtk/gtkcellrenderertext.c:431 gtk/gtkfilechooserbutton.c:421 -#: gtk/gtklabel.c:658 +#: gtk/gtklabel.c:681 msgid "Width In Characters" msgstr "" -#: gtk/gtkcellrenderertext.c:432 gtk/gtklabel.c:659 +#: gtk/gtkcellrenderertext.c:432 gtk/gtklabel.c:682 msgid "The desired width of the label, in characters" msgstr "" @@ -1544,7 +1544,7 @@ msgid "" "have enough room to display the entire string" msgstr "" -#: gtk/gtkcellrenderertext.c:470 gtk/gtkcombobox.c:685 +#: gtk/gtkcellrenderertext.c:470 gtk/gtkcombobox.c:688 msgid "Wrap width" msgstr "" @@ -1737,11 +1737,11 @@ msgstr "" msgid "The model for cell view" msgstr "" -#: gtk/gtkcheckbutton.c:69 gtk/gtkcheckmenuitem.c:121 gtk/gtkoptionmenu.c:168 +#: gtk/gtkcheckbutton.c:69 gtk/gtkcheckmenuitem.c:121 msgid "Indicator Size" msgstr "" -#: gtk/gtkcheckbutton.c:77 gtk/gtkexpander.c:245 gtk/gtkoptionmenu.c:174 +#: gtk/gtkcheckbutton.c:77 gtk/gtkexpander.c:245 msgid "Indicator Spacing" msgstr "" @@ -1778,7 +1778,7 @@ msgid "Whether or not to give the color an alpha value" msgstr "" #: gtk/gtkcolorbutton.c:186 gtk/gtkfilechooserbutton.c:407 -#: gtk/gtkfontbutton.c:142 gtk/gtkprintjob.c:116 gtk/gtkstatusicon.c:424 +#: gtk/gtkfontbutton.c:142 gtk/gtkprintjob.c:116 gtk/gtkstatusicon.c:429 #: gtk/gtktreeviewcolumn.c:265 msgid "Title" msgstr "" @@ -1787,7 +1787,7 @@ msgstr "" msgid "The title of the color selection dialog" msgstr "" -#: gtk/gtkcolorbutton.c:201 gtk/gtkcolorsel.c:293 +#: gtk/gtkcolorbutton.c:201 gtk/gtkcolorsel.c:295 msgid "Current Color" msgstr "" @@ -1795,7 +1795,7 @@ msgstr "" msgid "The selected color" msgstr "" -#: gtk/gtkcolorbutton.c:216 gtk/gtkcolorsel.c:300 +#: gtk/gtkcolorbutton.c:216 gtk/gtkcolorsel.c:302 msgid "Current Alpha" msgstr "" @@ -1803,35 +1803,35 @@ msgstr "" msgid "The selected opacity value (0 fully transparent, 65535 fully opaque)" msgstr "" -#: gtk/gtkcolorsel.c:279 +#: gtk/gtkcolorsel.c:281 msgid "Has Opacity Control" msgstr "" -#: gtk/gtkcolorsel.c:280 +#: gtk/gtkcolorsel.c:282 msgid "Whether the color selector should allow setting opacity" msgstr "" -#: gtk/gtkcolorsel.c:286 +#: gtk/gtkcolorsel.c:288 msgid "Has palette" msgstr "" -#: gtk/gtkcolorsel.c:287 +#: gtk/gtkcolorsel.c:289 msgid "Whether a palette should be used" msgstr "" -#: gtk/gtkcolorsel.c:294 +#: gtk/gtkcolorsel.c:296 msgid "The current color" msgstr "" -#: gtk/gtkcolorsel.c:301 +#: gtk/gtkcolorsel.c:303 msgid "The current opacity value (0 fully transparent, 65535 fully opaque)" msgstr "" -#: gtk/gtkcolorsel.c:315 +#: gtk/gtkcolorsel.c:317 msgid "Custom palette" msgstr "" -#: gtk/gtkcolorsel.c:316 +#: gtk/gtkcolorsel.c:318 msgid "Palette to use in the color selector" msgstr "" @@ -1870,151 +1870,111 @@ msgstr "" msgid "The help button of the dialog." msgstr "Þæt cynn þæs éagþyrles" -#: gtk/gtkcombo.c:145 -msgid "Enable arrow keys" -msgstr "" - -#: gtk/gtkcombo.c:146 -msgid "Whether the arrow keys move through the list of items" -msgstr "" - -#: gtk/gtkcombo.c:152 -msgid "Always enable arrows" -msgstr "" - -#: gtk/gtkcombo.c:153 -msgid "Obsolete property, ignored" -msgstr "" - -#: gtk/gtkcombo.c:159 -msgid "Case sensitive" -msgstr "" - -#: gtk/gtkcombo.c:160 -msgid "Whether list item matching is case sensitive" -msgstr "" - -#: gtk/gtkcombo.c:167 -msgid "Allow empty" -msgstr "" - -#: gtk/gtkcombo.c:168 -msgid "Whether an empty value may be entered in this field" -msgstr "" - -#: gtk/gtkcombo.c:175 -msgid "Value in list" -msgstr "" - -#: gtk/gtkcombo.c:176 -msgid "Whether entered values must already be present in the list" -msgstr "" - -#: gtk/gtkcombobox.c:668 +#: gtk/gtkcombobox.c:671 msgid "ComboBox model" msgstr "" -#: gtk/gtkcombobox.c:669 +#: gtk/gtkcombobox.c:672 msgid "The model for the combo box" msgstr "" -#: gtk/gtkcombobox.c:686 +#: gtk/gtkcombobox.c:689 msgid "Wrap width for laying out the items in a grid" msgstr "" -#: gtk/gtkcombobox.c:708 +#: gtk/gtkcombobox.c:711 msgid "Row span column" msgstr "" -#: gtk/gtkcombobox.c:709 +#: gtk/gtkcombobox.c:712 msgid "TreeModel column containing the row span values" msgstr "" -#: gtk/gtkcombobox.c:730 +#: gtk/gtkcombobox.c:733 msgid "Column span column" msgstr "" -#: gtk/gtkcombobox.c:731 +#: gtk/gtkcombobox.c:734 msgid "TreeModel column containing the column span values" msgstr "" -#: gtk/gtkcombobox.c:752 +#: gtk/gtkcombobox.c:755 msgid "Active item" msgstr "" -#: gtk/gtkcombobox.c:753 +#: gtk/gtkcombobox.c:756 msgid "The item which is currently active" msgstr "" -#: gtk/gtkcombobox.c:772 gtk/gtkuimanager.c:226 +#: gtk/gtkcombobox.c:775 gtk/gtkuimanager.c:226 msgid "Add tearoffs to menus" msgstr "" -#: gtk/gtkcombobox.c:773 +#: gtk/gtkcombobox.c:776 msgid "Whether dropdowns should have a tearoff menu item" msgstr "" -#: gtk/gtkcombobox.c:788 gtk/gtkentry.c:687 +#: gtk/gtkcombobox.c:791 gtk/gtkentry.c:689 msgid "Has Frame" msgstr "" -#: gtk/gtkcombobox.c:789 +#: gtk/gtkcombobox.c:792 msgid "Whether the combo box draws a frame around the child" msgstr "" -#: gtk/gtkcombobox.c:797 +#: gtk/gtkcombobox.c:800 msgid "Whether the combo box grabs focus when it is clicked with the mouse" msgstr "" -#: gtk/gtkcombobox.c:812 gtk/gtkmenu.c:556 +#: gtk/gtkcombobox.c:815 gtk/gtkmenu.c:563 msgid "Tearoff Title" msgstr "" -#: gtk/gtkcombobox.c:813 +#: gtk/gtkcombobox.c:816 msgid "" "A title that may be displayed by the window manager when the popup is torn-" "off" msgstr "" -#: gtk/gtkcombobox.c:830 +#: gtk/gtkcombobox.c:833 msgid "Popup shown" msgstr "" -#: gtk/gtkcombobox.c:831 +#: gtk/gtkcombobox.c:834 msgid "Whether the combo's dropdown is shown" msgstr "" -#: gtk/gtkcombobox.c:847 +#: gtk/gtkcombobox.c:850 msgid "Button Sensitivity" msgstr "" -#: gtk/gtkcombobox.c:848 +#: gtk/gtkcombobox.c:851 msgid "Whether the dropdown button is sensitive when the model is empty" msgstr "" -#: gtk/gtkcombobox.c:855 +#: gtk/gtkcombobox.c:858 msgid "Appears as list" msgstr "" -#: gtk/gtkcombobox.c:856 +#: gtk/gtkcombobox.c:859 msgid "Whether dropdowns should look like lists rather than menus" msgstr "" -#: gtk/gtkcombobox.c:872 +#: gtk/gtkcombobox.c:875 msgid "Arrow Size" msgstr "" -#: gtk/gtkcombobox.c:873 +#: gtk/gtkcombobox.c:876 msgid "The minimum size of the arrow in the combo box" msgstr "" -#: gtk/gtkcombobox.c:888 gtk/gtkentry.c:787 gtk/gtkhandlebox.c:174 -#: gtk/gtkmenubar.c:194 gtk/gtkstatusbar.c:193 gtk/gtktoolbar.c:623 -#: gtk/gtkviewport.c:122 +#: gtk/gtkcombobox.c:891 gtk/gtkentry.c:789 gtk/gtkhandlebox.c:175 +#: gtk/gtkmenubar.c:194 gtk/gtkstatusbar.c:193 gtk/gtktoolbar.c:568 +#: gtk/gtkviewport.c:150 msgid "Shadow type" msgstr "" -#: gtk/gtkcombobox.c:889 +#: gtk/gtkcombobox.c:892 msgid "Which kind of shadow to draw around the combo box" msgstr "" @@ -2042,46 +2002,6 @@ msgstr "" msgid "Can be used to add a new child to the container" msgstr "" -#: gtk/gtkcurve.c:126 -msgid "Curve type" -msgstr "" - -#: gtk/gtkcurve.c:127 -msgid "Is this curve linear, spline interpolated, or free-form" -msgstr "" - -#: gtk/gtkcurve.c:134 -msgid "Minimum X" -msgstr "" - -#: gtk/gtkcurve.c:135 -msgid "Minimum possible value for X" -msgstr "" - -#: gtk/gtkcurve.c:143 -msgid "Maximum X" -msgstr "" - -#: gtk/gtkcurve.c:144 -msgid "Maximum possible X value" -msgstr "" - -#: gtk/gtkcurve.c:152 -msgid "Minimum Y" -msgstr "" - -#: gtk/gtkcurve.c:153 -msgid "Minimum possible value for Y" -msgstr "" - -#: gtk/gtkcurve.c:161 -msgid "Maximum Y" -msgstr "" - -#: gtk/gtkcurve.c:162 -msgid "Maximum possible value for Y" -msgstr "" - #: gtk/gtkdialog.c:145 msgid "Has separator" msgstr "" @@ -2122,364 +2042,364 @@ msgstr "" msgid "Width of border around the button area at the bottom of the dialog" msgstr "" -#: gtk/gtkentry.c:634 +#: gtk/gtkentry.c:636 msgid "Text Buffer" msgstr "" -#: gtk/gtkentry.c:635 +#: gtk/gtkentry.c:637 msgid "Text buffer object which actually stores entry text" msgstr "" -#: gtk/gtkentry.c:642 gtk/gtklabel.c:601 +#: gtk/gtkentry.c:644 gtk/gtklabel.c:623 msgid "Cursor Position" msgstr "" -#: gtk/gtkentry.c:643 gtk/gtklabel.c:602 +#: gtk/gtkentry.c:645 gtk/gtklabel.c:624 msgid "The current position of the insertion cursor in chars" msgstr "" -#: gtk/gtkentry.c:652 gtk/gtklabel.c:611 +#: gtk/gtkentry.c:654 gtk/gtklabel.c:633 msgid "Selection Bound" msgstr "" -#: gtk/gtkentry.c:653 gtk/gtklabel.c:612 +#: gtk/gtkentry.c:655 gtk/gtklabel.c:634 msgid "" "The position of the opposite end of the selection from the cursor in chars" msgstr "" -#: gtk/gtkentry.c:663 +#: gtk/gtkentry.c:665 msgid "Whether the entry contents can be edited" msgstr "" -#: gtk/gtkentry.c:670 gtk/gtkentrybuffer.c:383 +#: gtk/gtkentry.c:672 gtk/gtkentrybuffer.c:383 msgid "Maximum length" msgstr "" -#: gtk/gtkentry.c:671 gtk/gtkentrybuffer.c:384 +#: gtk/gtkentry.c:673 gtk/gtkentrybuffer.c:384 msgid "Maximum number of characters for this entry. Zero if no maximum" msgstr "" -#: gtk/gtkentry.c:679 +#: gtk/gtkentry.c:681 msgid "Visibility" msgstr "" -#: gtk/gtkentry.c:680 +#: gtk/gtkentry.c:682 msgid "" "FALSE displays the \"invisible char\" instead of the actual text (password " "mode)" msgstr "" -#: gtk/gtkentry.c:688 +#: gtk/gtkentry.c:690 msgid "FALSE removes outside bevel from entry" msgstr "" -#: gtk/gtkentry.c:696 +#: gtk/gtkentry.c:698 msgid "" "Border between text and frame. Overrides the inner-border style property" msgstr "" -#: gtk/gtkentry.c:703 gtk/gtkentry.c:1269 +#: gtk/gtkentry.c:705 gtk/gtkentry.c:1271 msgid "Invisible character" msgstr "" -#: gtk/gtkentry.c:704 gtk/gtkentry.c:1270 +#: gtk/gtkentry.c:706 gtk/gtkentry.c:1272 msgid "The character to use when masking entry contents (in \"password mode\")" msgstr "" -#: gtk/gtkentry.c:711 +#: gtk/gtkentry.c:713 msgid "Activates default" msgstr "" -#: gtk/gtkentry.c:712 +#: gtk/gtkentry.c:714 msgid "" "Whether to activate the default widget (such as the default button in a " "dialog) when Enter is pressed" msgstr "" -#: gtk/gtkentry.c:718 +#: gtk/gtkentry.c:720 msgid "Width in chars" msgstr "" -#: gtk/gtkentry.c:719 +#: gtk/gtkentry.c:721 msgid "Number of characters to leave space for in the entry" msgstr "" -#: gtk/gtkentry.c:728 +#: gtk/gtkentry.c:730 msgid "Scroll offset" msgstr "" -#: gtk/gtkentry.c:729 +#: gtk/gtkentry.c:731 msgid "Number of pixels of the entry scrolled off the screen to the left" msgstr "" -#: gtk/gtkentry.c:739 +#: gtk/gtkentry.c:741 msgid "The contents of the entry" msgstr "" -#: gtk/gtkentry.c:754 gtk/gtkmisc.c:73 +#: gtk/gtkentry.c:756 gtk/gtkmisc.c:73 msgid "X align" msgstr "" -#: gtk/gtkentry.c:755 gtk/gtkmisc.c:74 +#: gtk/gtkentry.c:757 gtk/gtkmisc.c:74 msgid "" "The horizontal alignment, from 0 (left) to 1 (right). Reversed for RTL " "layouts." msgstr "" -#: gtk/gtkentry.c:771 +#: gtk/gtkentry.c:773 msgid "Truncate multiline" msgstr "" -#: gtk/gtkentry.c:772 +#: gtk/gtkentry.c:774 msgid "Whether to truncate multiline pastes to one line." msgstr "" -#: gtk/gtkentry.c:788 +#: gtk/gtkentry.c:790 msgid "Which kind of shadow to draw around the entry when has-frame is set" msgstr "" -#: gtk/gtkentry.c:803 gtk/gtktextview.c:657 +#: gtk/gtkentry.c:805 gtk/gtktextview.c:657 msgid "Overwrite mode" msgstr "" -#: gtk/gtkentry.c:804 +#: gtk/gtkentry.c:806 msgid "Whether new text overwrites existing text" msgstr "" -#: gtk/gtkentry.c:818 gtk/gtkentrybuffer.c:368 +#: gtk/gtkentry.c:820 gtk/gtkentrybuffer.c:368 msgid "Text length" msgstr "" -#: gtk/gtkentry.c:819 +#: gtk/gtkentry.c:821 msgid "Length of the text currently in the entry" msgstr "" -#: gtk/gtkentry.c:834 +#: gtk/gtkentry.c:836 #, fuzzy msgid "Invisible char set" msgstr "Ungesíene" -#: gtk/gtkentry.c:835 +#: gtk/gtkentry.c:837 msgid "Whether the invisible char has been set" msgstr "" -#: gtk/gtkentry.c:853 +#: gtk/gtkentry.c:855 msgid "Caps Lock warning" msgstr "" -#: gtk/gtkentry.c:854 +#: gtk/gtkentry.c:856 msgid "Whether password entries will show a warning when Caps Lock is on" msgstr "" -#: gtk/gtkentry.c:868 +#: gtk/gtkentry.c:870 msgid "Progress Fraction" msgstr "" -#: gtk/gtkentry.c:869 +#: gtk/gtkentry.c:871 #, fuzzy msgid "The current fraction of the task that's been completed" msgstr "Þæt cynn þæs éagþyrles" -#: gtk/gtkentry.c:886 +#: gtk/gtkentry.c:888 msgid "Progress Pulse Step" msgstr "" -#: gtk/gtkentry.c:887 +#: gtk/gtkentry.c:889 msgid "" "The fraction of total entry width to move the progress bouncing block for " "each call to gtk_entry_progress_pulse()" msgstr "" -#: gtk/gtkentry.c:903 +#: gtk/gtkentry.c:905 msgid "Primary pixbuf" msgstr "" -#: gtk/gtkentry.c:904 +#: gtk/gtkentry.c:906 msgid "Primary pixbuf for the entry" msgstr "" -#: gtk/gtkentry.c:918 +#: gtk/gtkentry.c:920 msgid "Secondary pixbuf" msgstr "" -#: gtk/gtkentry.c:919 +#: gtk/gtkentry.c:921 msgid "Secondary pixbuf for the entry" msgstr "" -#: gtk/gtkentry.c:933 +#: gtk/gtkentry.c:935 msgid "Primary stock ID" msgstr "" -#: gtk/gtkentry.c:934 +#: gtk/gtkentry.c:936 msgid "Stock ID for primary icon" msgstr "" -#: gtk/gtkentry.c:948 +#: gtk/gtkentry.c:950 msgid "Secondary stock ID" msgstr "" -#: gtk/gtkentry.c:949 +#: gtk/gtkentry.c:951 msgid "Stock ID for secondary icon" msgstr "" -#: gtk/gtkentry.c:963 +#: gtk/gtkentry.c:965 #, fuzzy msgid "Primary icon name" msgstr "Segn" -#: gtk/gtkentry.c:964 +#: gtk/gtkentry.c:966 msgid "Icon name for primary icon" msgstr "" -#: gtk/gtkentry.c:978 +#: gtk/gtkentry.c:980 msgid "Secondary icon name" msgstr "" -#: gtk/gtkentry.c:979 +#: gtk/gtkentry.c:981 msgid "Icon name for secondary icon" msgstr "" -#: gtk/gtkentry.c:993 +#: gtk/gtkentry.c:995 msgid "Primary GIcon" msgstr "" -#: gtk/gtkentry.c:994 +#: gtk/gtkentry.c:996 #, fuzzy msgid "GIcon for primary icon" msgstr "Segn þissum éagþyrle" -#: gtk/gtkentry.c:1008 +#: gtk/gtkentry.c:1010 msgid "Secondary GIcon" msgstr "" -#: gtk/gtkentry.c:1009 +#: gtk/gtkentry.c:1011 msgid "GIcon for secondary icon" msgstr "" -#: gtk/gtkentry.c:1023 +#: gtk/gtkentry.c:1025 msgid "Primary storage type" msgstr "" -#: gtk/gtkentry.c:1024 +#: gtk/gtkentry.c:1026 msgid "The representation being used for primary icon" msgstr "" -#: gtk/gtkentry.c:1039 +#: gtk/gtkentry.c:1041 msgid "Secondary storage type" msgstr "" -#: gtk/gtkentry.c:1040 +#: gtk/gtkentry.c:1042 msgid "The representation being used for secondary icon" msgstr "" -#: gtk/gtkentry.c:1061 +#: gtk/gtkentry.c:1063 msgid "Primary icon activatable" msgstr "" -#: gtk/gtkentry.c:1062 +#: gtk/gtkentry.c:1064 msgid "Whether the primary icon is activatable" msgstr "" -#: gtk/gtkentry.c:1082 +#: gtk/gtkentry.c:1084 msgid "Secondary icon activatable" msgstr "" -#: gtk/gtkentry.c:1083 +#: gtk/gtkentry.c:1085 msgid "Whether the secondary icon is activatable" msgstr "" -#: gtk/gtkentry.c:1105 +#: gtk/gtkentry.c:1107 msgid "Primary icon sensitive" msgstr "" -#: gtk/gtkentry.c:1106 +#: gtk/gtkentry.c:1108 msgid "Whether the primary icon is sensitive" msgstr "" -#: gtk/gtkentry.c:1127 +#: gtk/gtkentry.c:1129 msgid "Secondary icon sensitive" msgstr "" -#: gtk/gtkentry.c:1128 +#: gtk/gtkentry.c:1130 msgid "Whether the secondary icon is sensitive" msgstr "" -#: gtk/gtkentry.c:1144 +#: gtk/gtkentry.c:1146 #, fuzzy msgid "Primary icon tooltip text" msgstr "Segn" -#: gtk/gtkentry.c:1145 gtk/gtkentry.c:1181 +#: gtk/gtkentry.c:1147 gtk/gtkentry.c:1183 msgid "The contents of the tooltip on the primary icon" msgstr "" -#: gtk/gtkentry.c:1161 +#: gtk/gtkentry.c:1163 msgid "Secondary icon tooltip text" msgstr "" -#: gtk/gtkentry.c:1162 gtk/gtkentry.c:1200 +#: gtk/gtkentry.c:1164 gtk/gtkentry.c:1202 msgid "The contents of the tooltip on the secondary icon" msgstr "" -#: gtk/gtkentry.c:1180 +#: gtk/gtkentry.c:1182 #, fuzzy msgid "Primary icon tooltip markup" msgstr "Segn" -#: gtk/gtkentry.c:1199 +#: gtk/gtkentry.c:1201 msgid "Secondary icon tooltip markup" msgstr "" -#: gtk/gtkentry.c:1219 gtk/gtktextview.c:685 +#: gtk/gtkentry.c:1221 gtk/gtktextview.c:685 msgid "IM module" msgstr "" -#: gtk/gtkentry.c:1220 gtk/gtktextview.c:686 +#: gtk/gtkentry.c:1222 gtk/gtktextview.c:686 msgid "Which IM module should be used" msgstr "" -#: gtk/gtkentry.c:1234 +#: gtk/gtkentry.c:1236 #, fuzzy msgid "Icon Prelight" msgstr "Híehþu" -#: gtk/gtkentry.c:1235 +#: gtk/gtkentry.c:1237 msgid "Whether activatable icons should prelight when hovered" msgstr "" -#: gtk/gtkentry.c:1248 +#: gtk/gtkentry.c:1250 msgid "Progress Border" msgstr "" -#: gtk/gtkentry.c:1249 +#: gtk/gtkentry.c:1251 msgid "Border around the progress bar" msgstr "" -#: gtk/gtkentry.c:1741 +#: gtk/gtkentry.c:1743 msgid "Border between text and frame." msgstr "" -#: gtk/gtkentry.c:1755 +#: gtk/gtkentry.c:1757 msgid "State Hint" msgstr "" -#: gtk/gtkentry.c:1756 +#: gtk/gtkentry.c:1758 msgid "Whether to pass a proper state when drawing shadow or background" msgstr "" -#: gtk/gtkentry.c:1761 gtk/gtklabel.c:858 +#: gtk/gtkentry.c:1763 gtk/gtklabel.c:882 msgid "Select on focus" msgstr "" -#: gtk/gtkentry.c:1762 +#: gtk/gtkentry.c:1764 msgid "Whether to select the contents of an entry when it is focused" msgstr "" -#: gtk/gtkentry.c:1776 +#: gtk/gtkentry.c:1778 msgid "Password Hint Timeout" msgstr "" -#: gtk/gtkentry.c:1777 +#: gtk/gtkentry.c:1779 msgid "How long to show the last input character in hidden entries" msgstr "" @@ -2508,7 +2428,7 @@ msgstr "" msgid "Minimum length of the search key in order to look up matches" msgstr "" -#: gtk/gtkentrycompletion.c:303 gtk/gtkiconview.c:586 +#: gtk/gtkentrycompletion.c:303 gtk/gtkiconview.c:588 msgid "Text column" msgstr "" @@ -2588,11 +2508,11 @@ msgstr "" msgid "Text of the expander's label" msgstr "" -#: gtk/gtkexpander.c:211 gtk/gtklabel.c:520 +#: gtk/gtkexpander.c:211 gtk/gtklabel.c:542 msgid "Use markup" msgstr "" -#: gtk/gtkexpander.c:212 gtk/gtklabel.c:521 +#: gtk/gtkexpander.c:212 gtk/gtklabel.c:543 msgid "The text of the label includes XML markup. See pango_parse_markup()" msgstr "" @@ -2600,8 +2520,8 @@ msgstr "" msgid "Space to put between the label and the child" msgstr "" -#: gtk/gtkexpander.c:229 gtk/gtkframe.c:147 gtk/gtktoolbutton.c:218 -#: gtk/gtktoolitemgroup.c:1542 +#: gtk/gtkexpander.c:229 gtk/gtkframe.c:156 gtk/gtktoolbutton.c:218 +#: gtk/gtktoolitemgroup.c:1550 msgid "Label widget" msgstr "" @@ -2609,11 +2529,11 @@ msgstr "" msgid "A widget to display in place of the usual expander label" msgstr "" -#: gtk/gtkexpander.c:236 gtk/gtktoolitemgroup.c:1570 gtk/gtktreeview.c:777 +#: gtk/gtkexpander.c:236 gtk/gtktoolitemgroup.c:1578 gtk/gtktreeview.c:779 msgid "Expander Size" msgstr "" -#: gtk/gtkexpander.c:237 gtk/gtktoolitemgroup.c:1571 gtk/gtktreeview.c:778 +#: gtk/gtkexpander.c:237 gtk/gtktoolitemgroup.c:1579 gtk/gtktreeview.c:780 msgid "Size of the expander arrow" msgstr "" @@ -2621,102 +2541,94 @@ msgstr "" msgid "Spacing around expander arrow" msgstr "" -#: gtk/gtkfilechooser.c:758 +#: gtk/gtkfilechooser.c:759 msgid "Action" msgstr "" -#: gtk/gtkfilechooser.c:759 +#: gtk/gtkfilechooser.c:760 msgid "The type of operation that the file selector is performing" msgstr "" -#: gtk/gtkfilechooser.c:765 -msgid "File System Backend" -msgstr "" - -#: gtk/gtkfilechooser.c:766 -msgid "Name of file system backend to use" -msgstr "" - -#: gtk/gtkfilechooser.c:771 gtk/gtkrecentchooser.c:264 +#: gtk/gtkfilechooser.c:766 gtk/gtkrecentchooser.c:281 msgid "Filter" msgstr "" -#: gtk/gtkfilechooser.c:772 +#: gtk/gtkfilechooser.c:767 msgid "The current filter for selecting which files are displayed" msgstr "" -#: gtk/gtkfilechooser.c:777 +#: gtk/gtkfilechooser.c:772 msgid "Local Only" msgstr "" -#: gtk/gtkfilechooser.c:778 +#: gtk/gtkfilechooser.c:773 msgid "Whether the selected file(s) should be limited to local file: URLs" msgstr "" -#: gtk/gtkfilechooser.c:783 +#: gtk/gtkfilechooser.c:778 msgid "Preview widget" msgstr "" -#: gtk/gtkfilechooser.c:784 +#: gtk/gtkfilechooser.c:779 msgid "Application supplied widget for custom previews." msgstr "" -#: gtk/gtkfilechooser.c:789 +#: gtk/gtkfilechooser.c:784 msgid "Preview Widget Active" msgstr "" -#: gtk/gtkfilechooser.c:790 +#: gtk/gtkfilechooser.c:785 msgid "" "Whether the application supplied widget for custom previews should be shown." msgstr "" -#: gtk/gtkfilechooser.c:795 +#: gtk/gtkfilechooser.c:790 msgid "Use Preview Label" msgstr "" -#: gtk/gtkfilechooser.c:796 +#: gtk/gtkfilechooser.c:791 msgid "Whether to display a stock label with the name of the previewed file." msgstr "" -#: gtk/gtkfilechooser.c:801 +#: gtk/gtkfilechooser.c:796 msgid "Extra widget" msgstr "" -#: gtk/gtkfilechooser.c:802 +#: gtk/gtkfilechooser.c:797 msgid "Application supplied widget for extra options." msgstr "" -#: gtk/gtkfilechooser.c:807 gtk/gtkfilesel.c:540 gtk/gtkrecentchooser.c:203 +#: gtk/gtkfilechooser.c:802 gtk/gtkrecentchooser.c:220 msgid "Select Multiple" msgstr "" -#: gtk/gtkfilechooser.c:808 gtk/gtkfilesel.c:541 +#: gtk/gtkfilechooser.c:803 msgid "Whether to allow multiple files to be selected" msgstr "" -#: gtk/gtkfilechooser.c:814 +#: gtk/gtkfilechooser.c:809 msgid "Show Hidden" msgstr "" -#: gtk/gtkfilechooser.c:815 +#: gtk/gtkfilechooser.c:810 msgid "Whether the hidden files and folders should be displayed" msgstr "" -#: gtk/gtkfilechooser.c:830 +#: gtk/gtkfilechooser.c:825 msgid "Do overwrite confirmation" msgstr "" -#: gtk/gtkfilechooser.c:831 +#: gtk/gtkfilechooser.c:826 msgid "" "Whether a file chooser in save mode will present an overwrite confirmation " "dialog if necessary." msgstr "" -#: gtk/gtkfilechooser.c:847 +#: gtk/gtkfilechooser.c:842 msgid "Allow folders creation" msgstr "" -#: gtk/gtkfilechooser.c:848 +#: gtk/gtkfilechooser.c:843 msgid "" "Whether a file chooser not in open mode will offer the user to create new " "folders." @@ -2738,36 +2650,19 @@ msgstr "" msgid "The desired width of the button widget, in characters." msgstr "" -#: gtk/gtkfilesel.c:526 gtk/gtkimage.c:254 gtk/gtkrecentmanager.c:214 -#: gtk/gtkstatusicon.c:221 -msgid "Filename" -msgstr "" - -#: gtk/gtkfilesel.c:527 -msgid "The currently selected filename" -msgstr "" - -#: gtk/gtkfilesel.c:533 -msgid "Show file operations" -msgstr "" - -#: gtk/gtkfilesel.c:534 -msgid "Whether buttons for creating/manipulating files should be displayed" -msgstr "" - -#: gtk/gtkfixed.c:90 gtk/gtklayout.c:597 +#: gtk/gtkfixed.c:90 gtk/gtklayout.c:561 msgid "X position" msgstr "" -#: gtk/gtkfixed.c:91 gtk/gtklayout.c:598 +#: gtk/gtkfixed.c:91 gtk/gtklayout.c:562 msgid "X position of child widget" msgstr "" -#: gtk/gtkfixed.c:100 gtk/gtklayout.c:607 +#: gtk/gtkfixed.c:100 gtk/gtklayout.c:571 msgid "Y position" msgstr "" -#: gtk/gtkfixed.c:101 gtk/gtklayout.c:608 +#: gtk/gtkfixed.c:101 gtk/gtklayout.c:572 msgid "Y position of child widget" msgstr "" @@ -2835,290 +2730,294 @@ msgstr "" msgid "The text to display in order to demonstrate the selected font" msgstr "" -#: gtk/gtkframe.c:106 +#: gtk/gtkframe.c:115 msgid "Text of the frame's label" msgstr "" -#: gtk/gtkframe.c:113 +#: gtk/gtkframe.c:122 msgid "Label xalign" msgstr "" -#: gtk/gtkframe.c:114 +#: gtk/gtkframe.c:123 msgid "The horizontal alignment of the label" msgstr "" -#: gtk/gtkframe.c:122 +#: gtk/gtkframe.c:131 msgid "Label yalign" msgstr "" -#: gtk/gtkframe.c:123 +#: gtk/gtkframe.c:132 msgid "The vertical alignment of the label" msgstr "" -#: gtk/gtkframe.c:131 gtk/gtkhandlebox.c:167 +#: gtk/gtkframe.c:140 gtk/gtkhandlebox.c:168 msgid "Deprecated property, use shadow_type instead" msgstr "" -#: gtk/gtkframe.c:138 +#: gtk/gtkframe.c:147 msgid "Frame shadow" msgstr "" -#: gtk/gtkframe.c:139 +#: gtk/gtkframe.c:148 msgid "Appearance of the frame border" msgstr "" -#: gtk/gtkframe.c:148 +#: gtk/gtkframe.c:157 msgid "A widget to display in place of the usual frame label" msgstr "" -#: gtk/gtkhandlebox.c:175 +#: gtk/gtkhandlebox.c:176 msgid "Appearance of the shadow that surrounds the container" msgstr "" -#: gtk/gtkhandlebox.c:183 +#: gtk/gtkhandlebox.c:184 msgid "Handle position" msgstr "" -#: gtk/gtkhandlebox.c:184 +#: gtk/gtkhandlebox.c:185 msgid "Position of the handle relative to the child widget" msgstr "" -#: gtk/gtkhandlebox.c:192 +#: gtk/gtkhandlebox.c:193 msgid "Snap edge" msgstr "" -#: gtk/gtkhandlebox.c:193 +#: gtk/gtkhandlebox.c:194 msgid "" "Side of the handlebox that's lined up with the docking point to dock the " "handlebox" msgstr "" -#: gtk/gtkhandlebox.c:201 +#: gtk/gtkhandlebox.c:202 msgid "Snap edge set" msgstr "" -#: gtk/gtkhandlebox.c:202 +#: gtk/gtkhandlebox.c:203 msgid "" "Whether to use the value from the snap_edge property or a value derived from " "handle_position" msgstr "" -#: gtk/gtkhandlebox.c:209 +#: gtk/gtkhandlebox.c:210 msgid "Child Detached" msgstr "" -#: gtk/gtkhandlebox.c:210 +#: gtk/gtkhandlebox.c:211 msgid "" "A boolean value indicating whether the handlebox's child is attached or " "detached." msgstr "" -#: gtk/gtkiconview.c:549 +#: gtk/gtkiconview.c:551 msgid "Selection mode" msgstr "" -#: gtk/gtkiconview.c:550 +#: gtk/gtkiconview.c:552 #, fuzzy msgid "The selection mode" msgstr "Þæt gecorene géar" -#: gtk/gtkiconview.c:568 +#: gtk/gtkiconview.c:570 msgid "Pixbuf column" msgstr "" -#: gtk/gtkiconview.c:569 +#: gtk/gtkiconview.c:571 msgid "Model column used to retrieve the icon pixbuf from" msgstr "" -#: gtk/gtkiconview.c:587 +#: gtk/gtkiconview.c:589 msgid "Model column used to retrieve the text from" msgstr "" -#: gtk/gtkiconview.c:606 +#: gtk/gtkiconview.c:608 msgid "Markup column" msgstr "" -#: gtk/gtkiconview.c:607 +#: gtk/gtkiconview.c:609 msgid "Model column used to retrieve the text if using Pango markup" msgstr "" -#: gtk/gtkiconview.c:614 +#: gtk/gtkiconview.c:616 msgid "Icon View Model" msgstr "" -#: gtk/gtkiconview.c:615 +#: gtk/gtkiconview.c:617 #, fuzzy msgid "The model for the icon view" msgstr "Þæt cynn þæs éagþyrles" -#: gtk/gtkiconview.c:631 +#: gtk/gtkiconview.c:633 #, fuzzy msgid "Number of columns" msgstr "Gerím channela" -#: gtk/gtkiconview.c:632 +#: gtk/gtkiconview.c:634 msgid "Number of columns to display" msgstr "" -#: gtk/gtkiconview.c:649 +#: gtk/gtkiconview.c:651 msgid "Width for each item" msgstr "" -#: gtk/gtkiconview.c:650 +#: gtk/gtkiconview.c:652 msgid "The width used for each item" msgstr "" -#: gtk/gtkiconview.c:666 +#: gtk/gtkiconview.c:668 msgid "Space which is inserted between cells of an item" msgstr "" -#: gtk/gtkiconview.c:681 +#: gtk/gtkiconview.c:683 msgid "Row Spacing" msgstr "" -#: gtk/gtkiconview.c:682 +#: gtk/gtkiconview.c:684 msgid "Space which is inserted between grid rows" msgstr "" -#: gtk/gtkiconview.c:697 +#: gtk/gtkiconview.c:699 msgid "Column Spacing" msgstr "" -#: gtk/gtkiconview.c:698 +#: gtk/gtkiconview.c:700 msgid "Space which is inserted between grid columns" msgstr "" -#: gtk/gtkiconview.c:713 +#: gtk/gtkiconview.c:715 msgid "Margin" msgstr "" -#: gtk/gtkiconview.c:714 +#: gtk/gtkiconview.c:716 msgid "Space which is inserted at the edges of the icon view" msgstr "" -#: gtk/gtkiconview.c:730 +#: gtk/gtkiconview.c:732 msgid "" "How the text and icon of each item are positioned relative to each other" msgstr "" -#: gtk/gtkiconview.c:746 gtk/gtktreeview.c:612 gtk/gtktreeviewcolumn.c:308 +#: gtk/gtkiconview.c:748 gtk/gtktreeview.c:614 gtk/gtktreeviewcolumn.c:308 msgid "Reorderable" msgstr "" -#: gtk/gtkiconview.c:747 gtk/gtktreeview.c:613 +#: gtk/gtkiconview.c:749 gtk/gtktreeview.c:615 msgid "View is reorderable" msgstr "" -#: gtk/gtkiconview.c:754 gtk/gtktreeview.c:763 +#: gtk/gtkiconview.c:756 gtk/gtktreeview.c:765 msgid "Tooltip Column" msgstr "" -#: gtk/gtkiconview.c:755 +#: gtk/gtkiconview.c:757 msgid "The column in the model containing the tooltip texts for the items" msgstr "" -#: gtk/gtkiconview.c:772 +#: gtk/gtkiconview.c:774 msgid "Item Padding" msgstr "" -#: gtk/gtkiconview.c:773 +#: gtk/gtkiconview.c:775 msgid "Padding around icon view items" msgstr "" -#: gtk/gtkiconview.c:782 +#: gtk/gtkiconview.c:784 msgid "Selection Box Color" msgstr "" -#: gtk/gtkiconview.c:783 +#: gtk/gtkiconview.c:785 msgid "Color of the selection box" msgstr "" -#: gtk/gtkiconview.c:789 +#: gtk/gtkiconview.c:791 msgid "Selection Box Alpha" msgstr "" -#: gtk/gtkiconview.c:790 +#: gtk/gtkiconview.c:792 msgid "Opacity of the selection box" msgstr "" -#: gtk/gtkimage.c:222 gtk/gtkstatusicon.c:213 +#: gtk/gtkimage.c:227 gtk/gtkstatusicon.c:218 msgid "Pixbuf" msgstr "" -#: gtk/gtkimage.c:223 gtk/gtkstatusicon.c:214 +#: gtk/gtkimage.c:228 gtk/gtkstatusicon.c:219 msgid "A GdkPixbuf to display" msgstr "" -#: gtk/gtkimage.c:230 +#: gtk/gtkimage.c:235 msgid "Pixmap" msgstr "" -#: gtk/gtkimage.c:231 +#: gtk/gtkimage.c:236 msgid "A GdkPixmap to display" msgstr "" -#: gtk/gtkimage.c:238 gtk/gtkmessagedialog.c:215 +#: gtk/gtkimage.c:243 gtk/gtkmessagedialog.c:262 msgid "Image" msgstr "" -#: gtk/gtkimage.c:239 +#: gtk/gtkimage.c:244 msgid "A GdkImage to display" msgstr "" -#: gtk/gtkimage.c:246 +#: gtk/gtkimage.c:251 msgid "Mask" msgstr "" -#: gtk/gtkimage.c:247 +#: gtk/gtkimage.c:252 msgid "Mask bitmap to use with GdkImage or GdkPixmap" msgstr "" -#: gtk/gtkimage.c:255 gtk/gtkstatusicon.c:222 +#: gtk/gtkimage.c:259 gtk/gtkrecentmanager.c:214 gtk/gtkstatusicon.c:226 +msgid "Filename" +msgstr "" + +#: gtk/gtkimage.c:260 gtk/gtkstatusicon.c:227 msgid "Filename to load and display" msgstr "" -#: gtk/gtkimage.c:264 gtk/gtkstatusicon.c:230 +#: gtk/gtkimage.c:269 gtk/gtkstatusicon.c:235 msgid "Stock ID for a stock image to display" msgstr "" -#: gtk/gtkimage.c:271 +#: gtk/gtkimage.c:276 msgid "Icon set" msgstr "" -#: gtk/gtkimage.c:272 +#: gtk/gtkimage.c:277 msgid "Icon set to display" msgstr "" -#: gtk/gtkimage.c:279 gtk/gtkscalebutton.c:216 gtk/gtktoolbar.c:540 -#: gtk/gtktoolpalette.c:990 +#: gtk/gtkimage.c:284 gtk/gtkscalebutton.c:232 gtk/gtktoolbar.c:485 +#: gtk/gtktoolpalette.c:991 msgid "Icon size" msgstr "" -#: gtk/gtkimage.c:280 +#: gtk/gtkimage.c:285 msgid "Symbolic size to use for stock icon, icon set or named icon" msgstr "" -#: gtk/gtkimage.c:296 +#: gtk/gtkimage.c:301 msgid "Pixel size" msgstr "" -#: gtk/gtkimage.c:297 +#: gtk/gtkimage.c:302 msgid "Pixel size to use for named icon" msgstr "" -#: gtk/gtkimage.c:305 +#: gtk/gtkimage.c:310 msgid "Animation" msgstr "" -#: gtk/gtkimage.c:306 +#: gtk/gtkimage.c:311 msgid "GdkPixbufAnimation to display" msgstr "" -#: gtk/gtkimage.c:346 gtk/gtkstatusicon.c:261 +#: gtk/gtkimage.c:351 gtk/gtkstatusicon.c:266 msgid "Storage type" msgstr "" -#: gtk/gtkimage.c:347 gtk/gtkstatusicon.c:262 +#: gtk/gtkimage.c:352 gtk/gtkstatusicon.c:267 msgid "The representation being used for image data" msgstr "" @@ -3130,7 +3029,7 @@ msgstr "" msgid "Whether to use the label text to create a stock menu item" msgstr "" -#: gtk/gtkimagemenuitem.c:184 gtk/gtkmenu.c:516 +#: gtk/gtkimagemenuitem.c:184 gtk/gtkmenu.c:523 msgid "Accel Group" msgstr "" @@ -3146,11 +3045,11 @@ msgstr "" msgid "Whether images should be shown in menus" msgstr "" -#: gtk/gtkinfobar.c:384 gtk/gtkmessagedialog.c:128 +#: gtk/gtkinfobar.c:384 gtk/gtkmessagedialog.c:175 msgid "Message Type" msgstr "" -#: gtk/gtkinfobar.c:385 gtk/gtkmessagedialog.c:129 +#: gtk/gtkinfobar.c:385 gtk/gtkmessagedialog.c:176 msgid "The type of message" msgstr "" @@ -3166,142 +3065,142 @@ msgstr "" msgid "Width of border around the action area" msgstr "" -#: gtk/gtkinvisible.c:87 gtk/gtkwindow.c:627 +#: gtk/gtkinvisible.c:87 gtk/gtkwindow.c:651 msgid "The screen where this window will be displayed" msgstr "" -#: gtk/gtklabel.c:507 +#: gtk/gtklabel.c:529 msgid "The text of the label" msgstr "" -#: gtk/gtklabel.c:514 +#: gtk/gtklabel.c:536 msgid "A list of style attributes to apply to the text of the label" msgstr "" -#: gtk/gtklabel.c:535 gtk/gtktexttag.c:359 gtk/gtktextview.c:594 +#: gtk/gtklabel.c:557 gtk/gtktexttag.c:359 gtk/gtktextview.c:594 msgid "Justification" msgstr "" -#: gtk/gtklabel.c:536 +#: gtk/gtklabel.c:558 msgid "" "The alignment of the lines in the text of the label relative to each other. " "This does NOT affect the alignment of the label within its allocation. See " "GtkMisc::xalign for that" msgstr "" -#: gtk/gtklabel.c:544 +#: gtk/gtklabel.c:566 msgid "Pattern" msgstr "" -#: gtk/gtklabel.c:545 +#: gtk/gtklabel.c:567 msgid "" "A string with _ characters in positions correspond to characters in the text " "to underline" msgstr "" -#: gtk/gtklabel.c:552 +#: gtk/gtklabel.c:574 msgid "Line wrap" msgstr "" -#: gtk/gtklabel.c:553 +#: gtk/gtklabel.c:575 msgid "If set, wrap lines if the text becomes too wide" msgstr "" -#: gtk/gtklabel.c:568 +#: gtk/gtklabel.c:590 msgid "Line wrap mode" msgstr "" -#: gtk/gtklabel.c:569 +#: gtk/gtklabel.c:591 msgid "If wrap is set, controls how linewrapping is done" msgstr "" -#: gtk/gtklabel.c:576 +#: gtk/gtklabel.c:598 msgid "Selectable" msgstr "" -#: gtk/gtklabel.c:577 +#: gtk/gtklabel.c:599 msgid "Whether the label text can be selected with the mouse" msgstr "" -#: gtk/gtklabel.c:583 +#: gtk/gtklabel.c:605 msgid "Mnemonic key" msgstr "" -#: gtk/gtklabel.c:584 +#: gtk/gtklabel.c:606 msgid "The mnemonic accelerator key for this label" msgstr "" -#: gtk/gtklabel.c:592 +#: gtk/gtklabel.c:614 msgid "Mnemonic widget" msgstr "" -#: gtk/gtklabel.c:593 +#: gtk/gtklabel.c:615 msgid "The widget to be activated when the label's mnemonic key is pressed" msgstr "" -#: gtk/gtklabel.c:639 +#: gtk/gtklabel.c:661 msgid "" "The preferred place to ellipsize the string, if the label does not have " "enough room to display the entire string" msgstr "" -#: gtk/gtklabel.c:679 +#: gtk/gtklabel.c:702 msgid "Single Line Mode" msgstr "" -#: gtk/gtklabel.c:680 +#: gtk/gtklabel.c:703 msgid "Whether the label is in single line mode" msgstr "" -#: gtk/gtklabel.c:697 +#: gtk/gtklabel.c:720 msgid "Angle" msgstr "" -#: gtk/gtklabel.c:698 +#: gtk/gtklabel.c:721 msgid "Angle at which the label is rotated" msgstr "" -#: gtk/gtklabel.c:718 +#: gtk/gtklabel.c:742 msgid "Maximum Width In Characters" msgstr "" -#: gtk/gtklabel.c:719 +#: gtk/gtklabel.c:743 msgid "The desired maximum width of the label, in characters" msgstr "" -#: gtk/gtklabel.c:737 +#: gtk/gtklabel.c:761 msgid "Track visited links" msgstr "" -#: gtk/gtklabel.c:738 +#: gtk/gtklabel.c:762 msgid "Whether visited links should be tracked" msgstr "" -#: gtk/gtklabel.c:859 +#: gtk/gtklabel.c:883 msgid "Whether to select the contents of a selectable label when it is focused" msgstr "" -#: gtk/gtklayout.c:617 gtk/gtkviewport.c:106 +#: gtk/gtklayout.c:581 gtk/gtkviewport.c:134 msgid "Horizontal adjustment" msgstr "" -#: gtk/gtklayout.c:618 gtk/gtkscrolledwindow.c:219 +#: gtk/gtklayout.c:582 gtk/gtkscrolledwindow.c:236 msgid "The GtkAdjustment for the horizontal position" msgstr "" -#: gtk/gtklayout.c:625 gtk/gtkviewport.c:114 +#: gtk/gtklayout.c:589 gtk/gtkviewport.c:142 msgid "Vertical adjustment" msgstr "" -#: gtk/gtklayout.c:626 gtk/gtkscrolledwindow.c:226 +#: gtk/gtklayout.c:590 gtk/gtkscrolledwindow.c:243 msgid "The GtkAdjustment for the vertical position" msgstr "" -#: gtk/gtklayout.c:634 +#: gtk/gtklayout.c:598 msgid "The width of the layout" msgstr "" -#: gtk/gtklayout.c:643 +#: gtk/gtklayout.c:607 msgid "The height of the layout" msgstr "" @@ -3321,174 +3220,174 @@ msgstr "" msgid "Whether this link has been visited." msgstr "" -#: gtk/gtkmenu.c:502 +#: gtk/gtkmenu.c:509 msgid "The currently selected menu item" msgstr "" -#: gtk/gtkmenu.c:517 +#: gtk/gtkmenu.c:524 msgid "The accel group holding accelerators for the menu" msgstr "" -#: gtk/gtkmenu.c:531 gtk/gtkmenuitem.c:290 +#: gtk/gtkmenu.c:538 gtk/gtkmenuitem.c:290 msgid "Accel Path" msgstr "" -#: gtk/gtkmenu.c:532 +#: gtk/gtkmenu.c:539 msgid "An accel path used to conveniently construct accel paths of child items" msgstr "" -#: gtk/gtkmenu.c:548 +#: gtk/gtkmenu.c:555 msgid "Attach Widget" msgstr "" -#: gtk/gtkmenu.c:549 +#: gtk/gtkmenu.c:556 msgid "The widget the menu is attached to" msgstr "" -#: gtk/gtkmenu.c:557 +#: gtk/gtkmenu.c:564 msgid "" "A title that may be displayed by the window manager when this menu is torn-" "off" msgstr "" -#: gtk/gtkmenu.c:571 +#: gtk/gtkmenu.c:578 msgid "Tearoff State" msgstr "" -#: gtk/gtkmenu.c:572 +#: gtk/gtkmenu.c:579 msgid "A boolean that indicates whether the menu is torn-off" msgstr "" -#: gtk/gtkmenu.c:586 +#: gtk/gtkmenu.c:593 #, fuzzy msgid "Monitor" msgstr "Mónaþ" -#: gtk/gtkmenu.c:587 +#: gtk/gtkmenu.c:594 msgid "The monitor the menu will be popped up on" msgstr "" -#: gtk/gtkmenu.c:593 +#: gtk/gtkmenu.c:600 msgid "Vertical Padding" msgstr "" -#: gtk/gtkmenu.c:594 +#: gtk/gtkmenu.c:601 msgid "Extra space at the top and bottom of the menu" msgstr "" -#: gtk/gtkmenu.c:616 +#: gtk/gtkmenu.c:623 msgid "Reserve Toggle Size" msgstr "" -#: gtk/gtkmenu.c:617 +#: gtk/gtkmenu.c:624 msgid "" "A boolean that indicates whether the menu reserves space for toggles and " "icons" msgstr "" -#: gtk/gtkmenu.c:623 +#: gtk/gtkmenu.c:630 msgid "Horizontal Padding" msgstr "" -#: gtk/gtkmenu.c:624 +#: gtk/gtkmenu.c:631 msgid "Extra space at the left and right edges of the menu" msgstr "" -#: gtk/gtkmenu.c:632 +#: gtk/gtkmenu.c:639 msgid "Vertical Offset" msgstr "" -#: gtk/gtkmenu.c:633 +#: gtk/gtkmenu.c:640 msgid "" "When the menu is a submenu, position it this number of pixels offset " "vertically" msgstr "" -#: gtk/gtkmenu.c:641 +#: gtk/gtkmenu.c:648 msgid "Horizontal Offset" msgstr "" -#: gtk/gtkmenu.c:642 +#: gtk/gtkmenu.c:649 msgid "" "When the menu is a submenu, position it this number of pixels offset " "horizontally" msgstr "" -#: gtk/gtkmenu.c:650 +#: gtk/gtkmenu.c:657 msgid "Double Arrows" msgstr "" -#: gtk/gtkmenu.c:651 +#: gtk/gtkmenu.c:658 msgid "When scrolling, always show both arrows." msgstr "" -#: gtk/gtkmenu.c:664 +#: gtk/gtkmenu.c:671 msgid "Arrow Placement" msgstr "" -#: gtk/gtkmenu.c:665 +#: gtk/gtkmenu.c:672 msgid "Indicates where scroll arrows should be placed" msgstr "" -#: gtk/gtkmenu.c:673 +#: gtk/gtkmenu.c:680 msgid "Left Attach" msgstr "" -#: gtk/gtkmenu.c:674 gtk/gtktable.c:174 +#: gtk/gtkmenu.c:681 gtk/gtktable.c:174 msgid "The column number to attach the left side of the child to" msgstr "" -#: gtk/gtkmenu.c:681 +#: gtk/gtkmenu.c:688 msgid "Right Attach" msgstr "" -#: gtk/gtkmenu.c:682 +#: gtk/gtkmenu.c:689 msgid "The column number to attach the right side of the child to" msgstr "" -#: gtk/gtkmenu.c:689 +#: gtk/gtkmenu.c:696 msgid "Top Attach" msgstr "" -#: gtk/gtkmenu.c:690 +#: gtk/gtkmenu.c:697 msgid "The row number to attach the top of the child to" msgstr "" -#: gtk/gtkmenu.c:697 +#: gtk/gtkmenu.c:704 msgid "Bottom Attach" msgstr "" -#: gtk/gtkmenu.c:698 gtk/gtktable.c:195 +#: gtk/gtkmenu.c:705 gtk/gtktable.c:195 msgid "The row number to attach the bottom of the child to" msgstr "" -#: gtk/gtkmenu.c:712 +#: gtk/gtkmenu.c:719 msgid "Arbitrary constant to scale down the size of the scroll arrow" msgstr "" -#: gtk/gtkmenu.c:799 +#: gtk/gtkmenu.c:806 msgid "Can change accelerators" msgstr "" -#: gtk/gtkmenu.c:800 +#: gtk/gtkmenu.c:807 msgid "" "Whether menu accelerators can be changed by pressing a key over the menu item" msgstr "" -#: gtk/gtkmenu.c:805 +#: gtk/gtkmenu.c:812 msgid "Delay before submenus appear" msgstr "" -#: gtk/gtkmenu.c:806 +#: gtk/gtkmenu.c:813 msgid "" "Minimum time the pointer must stay over a menu item before the submenu appear" msgstr "" -#: gtk/gtkmenu.c:813 +#: gtk/gtkmenu.c:820 msgid "Delay before hiding a submenu" msgstr "" -#: gtk/gtkmenu.c:814 +#: gtk/gtkmenu.c:821 msgid "" "The time before hiding a submenu when the pointer is moving towards the " "submenu" @@ -3514,7 +3413,7 @@ msgstr "" msgid "Style of bevel around the menubar" msgstr "" -#: gtk/gtkmenubar.c:202 gtk/gtktoolbar.c:590 +#: gtk/gtkmenubar.c:202 gtk/gtktoolbar.c:535 msgid "Internal padding" msgstr "" @@ -3568,76 +3467,76 @@ msgstr "" msgid "The minimum desired width of the menu item in characters" msgstr "" -#: gtk/gtkmenushell.c:379 +#: gtk/gtkmenushell.c:382 msgid "Take Focus" msgstr "" -#: gtk/gtkmenushell.c:380 +#: gtk/gtkmenushell.c:383 msgid "A boolean that determines whether the menu grabs the keyboard focus" msgstr "" -#: gtk/gtkmenutoolbutton.c:245 gtk/gtkoptionmenu.c:161 +#: gtk/gtkmenutoolbutton.c:243 msgid "Menu" msgstr "" -#: gtk/gtkmenutoolbutton.c:246 +#: gtk/gtkmenutoolbutton.c:244 msgid "The dropdown menu" msgstr "" -#: gtk/gtkmessagedialog.c:98 +#: gtk/gtkmessagedialog.c:145 msgid "Image/label border" msgstr "" -#: gtk/gtkmessagedialog.c:99 +#: gtk/gtkmessagedialog.c:146 msgid "Width of border around the label and image in the message dialog" msgstr "" -#: gtk/gtkmessagedialog.c:114 +#: gtk/gtkmessagedialog.c:161 msgid "Use separator" msgstr "" -#: gtk/gtkmessagedialog.c:115 +#: gtk/gtkmessagedialog.c:162 msgid "" "Whether to put a separator between the message dialog's text and the buttons" msgstr "" -#: gtk/gtkmessagedialog.c:136 +#: gtk/gtkmessagedialog.c:183 msgid "Message Buttons" msgstr "" -#: gtk/gtkmessagedialog.c:137 +#: gtk/gtkmessagedialog.c:184 msgid "The buttons shown in the message dialog" msgstr "" -#: gtk/gtkmessagedialog.c:154 +#: gtk/gtkmessagedialog.c:201 msgid "The primary text of the message dialog" msgstr "" -#: gtk/gtkmessagedialog.c:169 +#: gtk/gtkmessagedialog.c:216 msgid "Use Markup" msgstr "" -#: gtk/gtkmessagedialog.c:170 +#: gtk/gtkmessagedialog.c:217 msgid "The primary text of the title includes Pango markup." msgstr "" -#: gtk/gtkmessagedialog.c:184 +#: gtk/gtkmessagedialog.c:231 msgid "Secondary Text" msgstr "" -#: gtk/gtkmessagedialog.c:185 +#: gtk/gtkmessagedialog.c:232 msgid "The secondary text of the message dialog" msgstr "" -#: gtk/gtkmessagedialog.c:200 +#: gtk/gtkmessagedialog.c:247 msgid "Use Markup in secondary" msgstr "" -#: gtk/gtkmessagedialog.c:201 +#: gtk/gtkmessagedialog.c:248 msgid "The secondary text includes Pango markup." msgstr "" -#: gtk/gtkmessagedialog.c:216 +#: gtk/gtkmessagedialog.c:263 #, fuzzy msgid "The image" msgstr "Þæt x-align" @@ -3689,290 +3588,234 @@ msgstr "" msgid "The screen where this window will be displayed." msgstr "" -#: gtk/gtknotebook.c:585 +#: gtk/gtknotebook.c:571 msgid "Page" msgstr "" -#: gtk/gtknotebook.c:586 +#: gtk/gtknotebook.c:572 msgid "The index of the current page" msgstr "" -#: gtk/gtknotebook.c:594 +#: gtk/gtknotebook.c:580 msgid "Tab Position" msgstr "" -#: gtk/gtknotebook.c:595 +#: gtk/gtknotebook.c:581 msgid "Which side of the notebook holds the tabs" msgstr "" -#: gtk/gtknotebook.c:602 -msgid "Tab Border" -msgstr "" - -#: gtk/gtknotebook.c:603 -msgid "Width of the border around the tab labels" -msgstr "" - -#: gtk/gtknotebook.c:611 -msgid "Horizontal Tab Border" -msgstr "" - -#: gtk/gtknotebook.c:612 -msgid "Width of the horizontal border of tab labels" -msgstr "" - -#: gtk/gtknotebook.c:620 -msgid "Vertical Tab Border" -msgstr "" - -#: gtk/gtknotebook.c:621 -msgid "Width of the vertical border of tab labels" -msgstr "" - -#: gtk/gtknotebook.c:629 +#: gtk/gtknotebook.c:588 msgid "Show Tabs" msgstr "" -#: gtk/gtknotebook.c:630 +#: gtk/gtknotebook.c:589 msgid "Whether tabs should be shown or not" msgstr "" -#: gtk/gtknotebook.c:636 +#: gtk/gtknotebook.c:595 msgid "Show Border" msgstr "" -#: gtk/gtknotebook.c:637 +#: gtk/gtknotebook.c:596 msgid "Whether the border should be shown or not" msgstr "" -#: gtk/gtknotebook.c:643 +#: gtk/gtknotebook.c:602 msgid "Scrollable" msgstr "" -#: gtk/gtknotebook.c:644 +#: gtk/gtknotebook.c:603 msgid "If TRUE, scroll arrows are added if there are too many tabs to fit" msgstr "" -#: gtk/gtknotebook.c:650 +#: gtk/gtknotebook.c:609 msgid "Enable Popup" msgstr "" -#: gtk/gtknotebook.c:651 +#: gtk/gtknotebook.c:610 msgid "" "If TRUE, pressing the right mouse button on the notebook pops up a menu that " "you can use to go to a page" msgstr "" -#: gtk/gtknotebook.c:658 -msgid "Whether tabs should have homogeneous sizes" -msgstr "" - -#: gtk/gtknotebook.c:664 -msgid "Group ID" -msgstr "" - -#: gtk/gtknotebook.c:665 -msgid "Group ID for tabs drag and drop" -msgstr "" - -#: gtk/gtknotebook.c:681 gtk/gtkradioaction.c:128 gtk/gtkradiobutton.c:82 +#: gtk/gtknotebook.c:624 gtk/gtkradioaction.c:140 gtk/gtkradiobutton.c:159 #: gtk/gtkradiomenuitem.c:353 gtk/gtkradiotoolbutton.c:65 msgid "Group" msgstr "" -#: gtk/gtknotebook.c:682 +#: gtk/gtknotebook.c:625 msgid "Group for tabs drag and drop" msgstr "" -#: gtk/gtknotebook.c:688 +#: gtk/gtknotebook.c:631 msgid "Tab label" msgstr "" -#: gtk/gtknotebook.c:689 +#: gtk/gtknotebook.c:632 msgid "The string displayed on the child's tab label" msgstr "" -#: gtk/gtknotebook.c:695 +#: gtk/gtknotebook.c:638 msgid "Menu label" msgstr "" -#: gtk/gtknotebook.c:696 +#: gtk/gtknotebook.c:639 msgid "The string displayed in the child's menu entry" msgstr "" -#: gtk/gtknotebook.c:709 +#: gtk/gtknotebook.c:652 msgid "Tab expand" msgstr "" -#: gtk/gtknotebook.c:710 +#: gtk/gtknotebook.c:653 msgid "Whether to expand the child's tab or not" msgstr "" -#: gtk/gtknotebook.c:716 +#: gtk/gtknotebook.c:659 msgid "Tab fill" msgstr "" -#: gtk/gtknotebook.c:717 +#: gtk/gtknotebook.c:660 msgid "Whether the child's tab should fill the allocated area or not" msgstr "" -#: gtk/gtknotebook.c:723 +#: gtk/gtknotebook.c:666 msgid "Tab pack type" msgstr "" -#: gtk/gtknotebook.c:730 +#: gtk/gtknotebook.c:673 msgid "Tab reorderable" msgstr "" -#: gtk/gtknotebook.c:731 +#: gtk/gtknotebook.c:674 msgid "Whether the tab is reorderable by user action or not" msgstr "" -#: gtk/gtknotebook.c:737 +#: gtk/gtknotebook.c:680 msgid "Tab detachable" msgstr "" -#: gtk/gtknotebook.c:738 +#: gtk/gtknotebook.c:681 msgid "Whether the tab is detachable" msgstr "" -#: gtk/gtknotebook.c:753 gtk/gtkscrollbar.c:81 +#: gtk/gtknotebook.c:696 gtk/gtkscrollbar.c:81 msgid "Secondary backward stepper" msgstr "" -#: gtk/gtknotebook.c:754 +#: gtk/gtknotebook.c:697 msgid "" "Display a second backward arrow button on the opposite end of the tab area" msgstr "" -#: gtk/gtknotebook.c:769 gtk/gtkscrollbar.c:88 +#: gtk/gtknotebook.c:712 gtk/gtkscrollbar.c:88 msgid "Secondary forward stepper" msgstr "" -#: gtk/gtknotebook.c:770 +#: gtk/gtknotebook.c:713 msgid "" "Display a second forward arrow button on the opposite end of the tab area" msgstr "" -#: gtk/gtknotebook.c:784 gtk/gtkscrollbar.c:67 +#: gtk/gtknotebook.c:727 gtk/gtkscrollbar.c:67 msgid "Backward stepper" msgstr "" -#: gtk/gtknotebook.c:785 gtk/gtkscrollbar.c:68 +#: gtk/gtknotebook.c:728 gtk/gtkscrollbar.c:68 msgid "Display the standard backward arrow button" msgstr "" -#: gtk/gtknotebook.c:799 gtk/gtkscrollbar.c:74 +#: gtk/gtknotebook.c:742 gtk/gtkscrollbar.c:74 msgid "Forward stepper" msgstr "" -#: gtk/gtknotebook.c:800 gtk/gtkscrollbar.c:75 +#: gtk/gtknotebook.c:743 gtk/gtkscrollbar.c:75 msgid "Display the standard forward arrow button" msgstr "" -#: gtk/gtknotebook.c:814 +#: gtk/gtknotebook.c:757 msgid "Tab overlap" msgstr "" -#: gtk/gtknotebook.c:815 +#: gtk/gtknotebook.c:758 msgid "Size of tab overlap area" msgstr "" -#: gtk/gtknotebook.c:830 +#: gtk/gtknotebook.c:773 msgid "Tab curvature" msgstr "" -#: gtk/gtknotebook.c:831 +#: gtk/gtknotebook.c:774 msgid "Size of tab curvature" msgstr "" -#: gtk/gtknotebook.c:847 +#: gtk/gtknotebook.c:790 msgid "Arrow spacing" msgstr "" -#: gtk/gtknotebook.c:848 +#: gtk/gtknotebook.c:791 msgid "Scroll arrow spacing" msgstr "" -#: gtk/gtkobject.c:370 -msgid "User Data" -msgstr "" - -#: gtk/gtkobject.c:371 -msgid "Anonymous User Data Pointer" -msgstr "" - -#: gtk/gtkoptionmenu.c:162 -msgid "The menu of options" -msgstr "" - -#: gtk/gtkoptionmenu.c:169 -msgid "Size of dropdown indicator" -msgstr "" - -#: gtk/gtkoptionmenu.c:175 -msgid "Spacing around indicator" -msgstr "" - -#: gtk/gtkorientable.c:75 +#: gtk/gtkorientable.c:64 #, fuzzy msgid "The orientation of the orientable" msgstr "Þæt cynn þæs éagþyrles" -#: gtk/gtkpaned.c:242 +#: gtk/gtkpaned.c:243 msgid "" "Position of paned separator in pixels (0 means all the way to the left/top)" msgstr "" -#: gtk/gtkpaned.c:251 +#: gtk/gtkpaned.c:252 msgid "Position Set" msgstr "" -#: gtk/gtkpaned.c:252 +#: gtk/gtkpaned.c:253 msgid "TRUE if the Position property should be used" msgstr "" -#: gtk/gtkpaned.c:258 +#: gtk/gtkpaned.c:259 msgid "Handle Size" msgstr "" -#: gtk/gtkpaned.c:259 +#: gtk/gtkpaned.c:260 msgid "Width of handle" msgstr "" -#: gtk/gtkpaned.c:275 +#: gtk/gtkpaned.c:276 msgid "Minimal Position" msgstr "" -#: gtk/gtkpaned.c:276 +#: gtk/gtkpaned.c:277 msgid "Smallest possible value for the \"position\" property" msgstr "" -#: gtk/gtkpaned.c:293 +#: gtk/gtkpaned.c:294 msgid "Maximal Position" msgstr "" -#: gtk/gtkpaned.c:294 +#: gtk/gtkpaned.c:295 msgid "Largest possible value for the \"position\" property" msgstr "" -#: gtk/gtkpaned.c:311 +#: gtk/gtkpaned.c:312 msgid "Resize" msgstr "" -#: gtk/gtkpaned.c:312 +#: gtk/gtkpaned.c:313 msgid "If TRUE, the child expands and shrinks along with the paned widget" msgstr "" -#: gtk/gtkpaned.c:327 +#: gtk/gtkpaned.c:328 msgid "Shrink" msgstr "" -#: gtk/gtkpaned.c:328 +#: gtk/gtkpaned.c:329 msgid "If TRUE, the child can be made smaller than its requisition" msgstr "" -#: gtk/gtkplug.c:171 gtk/gtkstatusicon.c:312 +#: gtk/gtkplug.c:171 gtk/gtkstatusicon.c:317 msgid "Embedded" msgstr "" @@ -3988,90 +3831,85 @@ msgstr "" msgid "The window of the socket the plug is embedded in" msgstr "" -#: gtk/gtkpreview.c:102 -msgid "" -"Whether the preview widget should take up the entire space it is allocated" -msgstr "" - -#: gtk/gtkprinter.c:112 +#: gtk/gtkprinter.c:131 msgid "Name of the printer" msgstr "" -#: gtk/gtkprinter.c:118 +#: gtk/gtkprinter.c:137 msgid "Backend" msgstr "" -#: gtk/gtkprinter.c:119 +#: gtk/gtkprinter.c:138 msgid "Backend for the printer" msgstr "" -#: gtk/gtkprinter.c:125 +#: gtk/gtkprinter.c:144 msgid "Is Virtual" msgstr "" -#: gtk/gtkprinter.c:126 +#: gtk/gtkprinter.c:145 msgid "FALSE if this represents a real hardware printer" msgstr "" -#: gtk/gtkprinter.c:132 +#: gtk/gtkprinter.c:151 msgid "Accepts PDF" msgstr "" -#: gtk/gtkprinter.c:133 +#: gtk/gtkprinter.c:152 msgid "TRUE if this printer can accept PDF" msgstr "" -#: gtk/gtkprinter.c:139 +#: gtk/gtkprinter.c:158 msgid "Accepts PostScript" msgstr "" -#: gtk/gtkprinter.c:140 +#: gtk/gtkprinter.c:159 msgid "TRUE if this printer can accept PostScript" msgstr "" -#: gtk/gtkprinter.c:146 +#: gtk/gtkprinter.c:165 msgid "State Message" msgstr "" -#: gtk/gtkprinter.c:147 +#: gtk/gtkprinter.c:166 msgid "String giving the current state of the printer" msgstr "" -#: gtk/gtkprinter.c:153 +#: gtk/gtkprinter.c:172 msgid "Location" msgstr "" -#: gtk/gtkprinter.c:154 +#: gtk/gtkprinter.c:173 #, fuzzy msgid "The location of the printer" msgstr "Þæt cynn þæs éagþyrles" -#: gtk/gtkprinter.c:161 +#: gtk/gtkprinter.c:180 msgid "The icon name to use for the printer" msgstr "" -#: gtk/gtkprinter.c:167 +#: gtk/gtkprinter.c:186 msgid "Job Count" msgstr "" -#: gtk/gtkprinter.c:168 +#: gtk/gtkprinter.c:187 msgid "Number of jobs queued in the printer" msgstr "" -#: gtk/gtkprinter.c:186 +#: gtk/gtkprinter.c:205 #, fuzzy msgid "Paused Printer" msgstr "Þæt gecorene géar" -#: gtk/gtkprinter.c:187 +#: gtk/gtkprinter.c:206 msgid "TRUE if this printer is paused" msgstr "" -#: gtk/gtkprinter.c:200 +#: gtk/gtkprinter.c:219 msgid "Accepting Jobs" msgstr "" -#: gtk/gtkprinter.c:201 +#: gtk/gtkprinter.c:220 msgid "TRUE if this printer is accepting new jobs" msgstr "" @@ -4242,7 +4080,7 @@ msgid "Has Selection" msgstr "" #: gtk/gtkprintoperation.c:1297 -msgid "TRUE if a selecion exists." +msgid "TRUE if a selection exists." msgstr "" #: gtk/gtkprintoperation.c:1312 gtk/gtkprintunixdialog.c:361 @@ -4315,145 +4153,105 @@ msgstr "" msgid "Whether the progress is shown as text." msgstr "" -#: gtk/gtkprogressbar.c:119 -msgid "The GtkAdjustment connected to the progress bar (Deprecated)" -msgstr "" - -#: gtk/gtkprogressbar.c:135 -msgid "Bar style" -msgstr "" - -#: gtk/gtkprogressbar.c:136 -msgid "Specifies the visual style of the bar in percentage mode (Deprecated)" -msgstr "" - -#: gtk/gtkprogressbar.c:144 -msgid "Activity Step" -msgstr "" - -#: gtk/gtkprogressbar.c:145 -msgid "The increment used for each iteration in activity mode (Deprecated)" -msgstr "" - -#: gtk/gtkprogressbar.c:152 -msgid "Activity Blocks" -msgstr "" - -#: gtk/gtkprogressbar.c:153 -msgid "" -"The number of blocks which can fit in the progress bar area in activity mode " -"(Deprecated)" -msgstr "" - -#: gtk/gtkprogressbar.c:160 -msgid "Discrete Blocks" -msgstr "" - -#: gtk/gtkprogressbar.c:161 -msgid "" -"The number of discrete blocks in a progress bar (when shown in the discrete " -"style)" -msgstr "" - -#: gtk/gtkprogressbar.c:168 +#: gtk/gtkprogressbar.c:121 msgid "Fraction" msgstr "" -#: gtk/gtkprogressbar.c:169 +#: gtk/gtkprogressbar.c:122 msgid "The fraction of total work that has been completed" msgstr "" -#: gtk/gtkprogressbar.c:176 +#: gtk/gtkprogressbar.c:129 msgid "Pulse Step" msgstr "" -#: gtk/gtkprogressbar.c:177 +#: gtk/gtkprogressbar.c:130 msgid "The fraction of total progress to move the bouncing block when pulsed" msgstr "" -#: gtk/gtkprogressbar.c:185 +#: gtk/gtkprogressbar.c:138 msgid "Text to be displayed in the progress bar" msgstr "" -#: gtk/gtkprogressbar.c:207 +#: gtk/gtkprogressbar.c:160 msgid "" "The preferred place to ellipsize the string, if the progress bar does not " "have enough room to display the entire string, if at all." msgstr "" -#: gtk/gtkprogressbar.c:214 +#: gtk/gtkprogressbar.c:167 msgid "XSpacing" msgstr "" -#: gtk/gtkprogressbar.c:215 +#: gtk/gtkprogressbar.c:168 msgid "Extra spacing applied to the width of a progress bar." msgstr "" -#: gtk/gtkprogressbar.c:220 +#: gtk/gtkprogressbar.c:173 msgid "YSpacing" msgstr "" -#: gtk/gtkprogressbar.c:221 +#: gtk/gtkprogressbar.c:174 msgid "Extra spacing applied to the height of a progress bar." msgstr "" -#: gtk/gtkprogressbar.c:234 +#: gtk/gtkprogressbar.c:187 msgid "Min horizontal bar width" msgstr "" -#: gtk/gtkprogressbar.c:235 +#: gtk/gtkprogressbar.c:188 msgid "The minimum horizontal width of the progress bar" msgstr "" -#: gtk/gtkprogressbar.c:247 +#: gtk/gtkprogressbar.c:200 msgid "Min horizontal bar height" msgstr "" -#: gtk/gtkprogressbar.c:248 +#: gtk/gtkprogressbar.c:201 msgid "Minimum horizontal height of the progress bar" msgstr "" -#: gtk/gtkprogressbar.c:260 +#: gtk/gtkprogressbar.c:213 msgid "Min vertical bar width" msgstr "" -#: gtk/gtkprogressbar.c:261 +#: gtk/gtkprogressbar.c:214 msgid "The minimum vertical width of the progress bar" msgstr "" -#: gtk/gtkprogressbar.c:273 +#: gtk/gtkprogressbar.c:226 msgid "Min vertical bar height" msgstr "" -#: gtk/gtkprogressbar.c:274 +#: gtk/gtkprogressbar.c:227 msgid "The minimum vertical height of the progress bar" msgstr "" -#: gtk/gtkradioaction.c:111 +#: gtk/gtkradioaction.c:123 msgid "The value" msgstr "" -#: gtk/gtkradioaction.c:112 +#: gtk/gtkradioaction.c:124 msgid "" "The value returned by gtk_radio_action_get_current_value() when this action " "is the current action of its group." msgstr "" -#: gtk/gtkradioaction.c:129 +#: gtk/gtkradioaction.c:141 msgid "The radio action whose group this action belongs to." msgstr "" -#: gtk/gtkradioaction.c:144 +#: gtk/gtkradioaction.c:156 msgid "The current value" msgstr "" -#: gtk/gtkradioaction.c:145 +#: gtk/gtkradioaction.c:157 msgid "" "The value property of the currently active member of the group to which this " "action belongs." msgstr "" -#: gtk/gtkradiobutton.c:83 +#: gtk/gtkradiobutton.c:160 msgid "The radio button whose group this widget belongs to." msgstr "" @@ -4465,236 +4263,236 @@ msgstr "" msgid "The radio tool button whose group this button belongs to." msgstr "" -#: gtk/gtkrange.c:358 +#: gtk/gtkrange.c:385 msgid "Update policy" msgstr "" -#: gtk/gtkrange.c:359 +#: gtk/gtkrange.c:386 msgid "How the range should be updated on the screen" msgstr "" -#: gtk/gtkrange.c:368 +#: gtk/gtkrange.c:395 msgid "The GtkAdjustment that contains the current value of this range object" msgstr "" -#: gtk/gtkrange.c:375 +#: gtk/gtkrange.c:402 msgid "Inverted" msgstr "" -#: gtk/gtkrange.c:376 +#: gtk/gtkrange.c:403 msgid "Invert direction slider moves to increase range value" msgstr "" -#: gtk/gtkrange.c:383 +#: gtk/gtkrange.c:410 msgid "Lower stepper sensitivity" msgstr "" -#: gtk/gtkrange.c:384 +#: gtk/gtkrange.c:411 msgid "" "The sensitivity policy for the stepper that points to the adjustment's lower " "side" msgstr "" -#: gtk/gtkrange.c:392 +#: gtk/gtkrange.c:419 msgid "Upper stepper sensitivity" msgstr "" -#: gtk/gtkrange.c:393 +#: gtk/gtkrange.c:420 msgid "" "The sensitivity policy for the stepper that points to the adjustment's upper " "side" msgstr "" -#: gtk/gtkrange.c:410 +#: gtk/gtkrange.c:437 msgid "Show Fill Level" msgstr "" -#: gtk/gtkrange.c:411 +#: gtk/gtkrange.c:438 msgid "Whether to display a fill level indicator graphics on trough." msgstr "" -#: gtk/gtkrange.c:427 +#: gtk/gtkrange.c:454 msgid "Restrict to Fill Level" msgstr "" -#: gtk/gtkrange.c:428 +#: gtk/gtkrange.c:455 msgid "Whether to restrict the upper boundary to the fill level." msgstr "" -#: gtk/gtkrange.c:443 +#: gtk/gtkrange.c:470 msgid "Fill Level" msgstr "" -#: gtk/gtkrange.c:444 +#: gtk/gtkrange.c:471 msgid "The fill level." msgstr "" -#: gtk/gtkrange.c:452 +#: gtk/gtkrange.c:479 msgid "Slider Width" msgstr "" -#: gtk/gtkrange.c:453 +#: gtk/gtkrange.c:480 msgid "Width of scrollbar or scale thumb" msgstr "" -#: gtk/gtkrange.c:460 +#: gtk/gtkrange.c:487 msgid "Trough Border" msgstr "" -#: gtk/gtkrange.c:461 +#: gtk/gtkrange.c:488 msgid "Spacing between thumb/steppers and outer trough bevel" msgstr "" -#: gtk/gtkrange.c:468 +#: gtk/gtkrange.c:495 msgid "Stepper Size" msgstr "" -#: gtk/gtkrange.c:469 +#: gtk/gtkrange.c:496 msgid "Length of step buttons at ends" msgstr "" -#: gtk/gtkrange.c:484 +#: gtk/gtkrange.c:511 msgid "Stepper Spacing" msgstr "" -#: gtk/gtkrange.c:485 +#: gtk/gtkrange.c:512 msgid "Spacing between step buttons and thumb" msgstr "" -#: gtk/gtkrange.c:492 +#: gtk/gtkrange.c:519 msgid "Arrow X Displacement" msgstr "" -#: gtk/gtkrange.c:493 +#: gtk/gtkrange.c:520 msgid "" "How far in the x direction to move the arrow when the button is depressed" msgstr "" -#: gtk/gtkrange.c:500 +#: gtk/gtkrange.c:527 msgid "Arrow Y Displacement" msgstr "" -#: gtk/gtkrange.c:501 +#: gtk/gtkrange.c:528 msgid "" "How far in the y direction to move the arrow when the button is depressed" msgstr "" -#: gtk/gtkrange.c:509 +#: gtk/gtkrange.c:536 msgid "Draw slider ACTIVE during drag" msgstr "" -#: gtk/gtkrange.c:510 +#: gtk/gtkrange.c:537 msgid "" "With this option set to TRUE, sliders will be drawn ACTIVE and with shadow " "IN while they are dragged" msgstr "" -#: gtk/gtkrange.c:524 +#: gtk/gtkrange.c:551 msgid "Trough Side Details" msgstr "" -#: gtk/gtkrange.c:525 +#: gtk/gtkrange.c:552 msgid "" "When TRUE, the parts of the trough on the two sides of the slider are drawn " "with different details" msgstr "" -#: gtk/gtkrange.c:541 +#: gtk/gtkrange.c:568 msgid "Trough Under Steppers" msgstr "" -#: gtk/gtkrange.c:542 +#: gtk/gtkrange.c:569 msgid "" "Whether to draw trough for full length of range or exclude the steppers and " "spacing" msgstr "" -#: gtk/gtkrange.c:555 +#: gtk/gtkrange.c:582 msgid "Arrow scaling" msgstr "" -#: gtk/gtkrange.c:556 +#: gtk/gtkrange.c:583 msgid "Arrow scaling with regard to scroll button size" msgstr "" -#: gtk/gtkrecentaction.c:616 gtk/gtkrecentchoosermenu.c:227 +#: gtk/gtkrecentaction.c:633 gtk/gtkrecentchoosermenu.c:255 msgid "Show Numbers" msgstr "" -#: gtk/gtkrecentaction.c:617 gtk/gtkrecentchoosermenu.c:228 +#: gtk/gtkrecentaction.c:634 gtk/gtkrecentchoosermenu.c:256 msgid "Whether the items should be displayed with a number" msgstr "" -#: gtk/gtkrecentchooser.c:132 +#: gtk/gtkrecentchooser.c:149 msgid "Recent Manager" msgstr "" -#: gtk/gtkrecentchooser.c:133 +#: gtk/gtkrecentchooser.c:150 msgid "The RecentManager object to use" msgstr "" -#: gtk/gtkrecentchooser.c:147 +#: gtk/gtkrecentchooser.c:164 msgid "Show Private" msgstr "" -#: gtk/gtkrecentchooser.c:148 +#: gtk/gtkrecentchooser.c:165 msgid "Whether the private items should be displayed" msgstr "" -#: gtk/gtkrecentchooser.c:161 +#: gtk/gtkrecentchooser.c:178 msgid "Show Tooltips" msgstr "" -#: gtk/gtkrecentchooser.c:162 +#: gtk/gtkrecentchooser.c:179 msgid "Whether there should be a tooltip on the item" msgstr "" -#: gtk/gtkrecentchooser.c:174 +#: gtk/gtkrecentchooser.c:191 msgid "Show Icons" msgstr "" -#: gtk/gtkrecentchooser.c:175 +#: gtk/gtkrecentchooser.c:192 msgid "Whether there should be an icon near the item" msgstr "" -#: gtk/gtkrecentchooser.c:190 +#: gtk/gtkrecentchooser.c:207 msgid "Show Not Found" msgstr "" -#: gtk/gtkrecentchooser.c:191 +#: gtk/gtkrecentchooser.c:208 msgid "Whether the items pointing to unavailable resources should be displayed" msgstr "" -#: gtk/gtkrecentchooser.c:204 +#: gtk/gtkrecentchooser.c:221 msgid "Whether to allow multiple items to be selected" msgstr "" -#: gtk/gtkrecentchooser.c:217 +#: gtk/gtkrecentchooser.c:234 msgid "Local only" msgstr "" -#: gtk/gtkrecentchooser.c:218 +#: gtk/gtkrecentchooser.c:235 msgid "Whether the selected resource(s) should be limited to local file: URIs" msgstr "" -#: gtk/gtkrecentchooser.c:234 gtk/gtkrecentmanager.c:229 +#: gtk/gtkrecentchooser.c:251 gtk/gtkrecentmanager.c:229 msgid "Limit" msgstr "" -#: gtk/gtkrecentchooser.c:235 +#: gtk/gtkrecentchooser.c:252 msgid "The maximum number of items to be displayed" msgstr "" -#: gtk/gtkrecentchooser.c:249 +#: gtk/gtkrecentchooser.c:266 #, fuzzy msgid "Sort Type" msgstr "Éagþyrelcynn" -#: gtk/gtkrecentchooser.c:250 +#: gtk/gtkrecentchooser.c:267 msgid "The sorting order of the items displayed" msgstr "" -#: gtk/gtkrecentchooser.c:265 +#: gtk/gtkrecentchooser.c:282 msgid "The current filter for selecting which resources are displayed" msgstr "" @@ -4783,26 +4581,26 @@ msgstr "" msgid "Space between value text and the slider/trough area" msgstr "" -#: gtk/gtkscalebutton.c:207 +#: gtk/gtkscalebutton.c:223 #, fuzzy msgid "The value of the scale" msgstr "Þæt cynn þæs éagþyrles" -#: gtk/gtkscalebutton.c:217 +#: gtk/gtkscalebutton.c:233 msgid "The icon size" msgstr "" -#: gtk/gtkscalebutton.c:226 +#: gtk/gtkscalebutton.c:242 msgid "" "The GtkAdjustment that contains the current value of this scale button object" msgstr "" -#: gtk/gtkscalebutton.c:254 +#: gtk/gtkscalebutton.c:270 #, fuzzy msgid "Icons" msgstr "Segn" -#: gtk/gtkscalebutton.c:255 +#: gtk/gtkscalebutton.c:271 msgid "List of icon names" msgstr "" @@ -4832,567 +4630,575 @@ msgid "" "Display a second forward arrow button on the opposite end of the scrollbar" msgstr "" -#: gtk/gtkscrolledwindow.c:218 gtk/gtktext.c:545 gtk/gtktreeview.c:572 +#: gtk/gtkscrolledwindow.c:235 gtk/gtktreeview.c:574 msgid "Horizontal Adjustment" msgstr "" -#: gtk/gtkscrolledwindow.c:225 gtk/gtktext.c:553 gtk/gtktreeview.c:580 +#: gtk/gtkscrolledwindow.c:242 gtk/gtktreeview.c:582 msgid "Vertical Adjustment" msgstr "" -#: gtk/gtkscrolledwindow.c:232 +#: gtk/gtkscrolledwindow.c:249 msgid "Horizontal Scrollbar Policy" msgstr "" -#: gtk/gtkscrolledwindow.c:233 +#: gtk/gtkscrolledwindow.c:250 msgid "When the horizontal scrollbar is displayed" msgstr "" -#: gtk/gtkscrolledwindow.c:240 +#: gtk/gtkscrolledwindow.c:257 msgid "Vertical Scrollbar Policy" msgstr "" -#: gtk/gtkscrolledwindow.c:241 +#: gtk/gtkscrolledwindow.c:258 msgid "When the vertical scrollbar is displayed" msgstr "" -#: gtk/gtkscrolledwindow.c:249 +#: gtk/gtkscrolledwindow.c:266 msgid "Window Placement" msgstr "" -#: gtk/gtkscrolledwindow.c:250 +#: gtk/gtkscrolledwindow.c:267 msgid "" "Where the contents are located with respect to the scrollbars. This property " "only takes effect if \"window-placement-set\" is TRUE." msgstr "" -#: gtk/gtkscrolledwindow.c:267 +#: gtk/gtkscrolledwindow.c:284 msgid "Window Placement Set" msgstr "" -#: gtk/gtkscrolledwindow.c:268 +#: gtk/gtkscrolledwindow.c:285 msgid "" "Whether \"window-placement\" should be used to determine the location of the " "contents with respect to the scrollbars." msgstr "" -#: gtk/gtkscrolledwindow.c:274 +#: gtk/gtkscrolledwindow.c:291 msgid "Shadow Type" msgstr "" -#: gtk/gtkscrolledwindow.c:275 +#: gtk/gtkscrolledwindow.c:292 msgid "Style of bevel around the contents" msgstr "" -#: gtk/gtkscrolledwindow.c:289 +#: gtk/gtkscrolledwindow.c:306 msgid "Scrollbars within bevel" msgstr "" -#: gtk/gtkscrolledwindow.c:290 +#: gtk/gtkscrolledwindow.c:307 msgid "Place scrollbars within the scrolled window's bevel" msgstr "" -#: gtk/gtkscrolledwindow.c:296 +#: gtk/gtkscrolledwindow.c:313 msgid "Scrollbar spacing" msgstr "" -#: gtk/gtkscrolledwindow.c:297 +#: gtk/gtkscrolledwindow.c:314 msgid "Number of pixels between the scrollbars and the scrolled window" msgstr "" -#: gtk/gtkscrolledwindow.c:312 +#: gtk/gtkscrolledwindow.c:329 msgid "Scrolled Window Placement" msgstr "" -#: gtk/gtkscrolledwindow.c:313 +#: gtk/gtkscrolledwindow.c:330 msgid "" "Where the contents of scrolled windows are located with respect to the " "scrollbars, if not overridden by the scrolled window's own placement." msgstr "" -#: gtk/gtkseparatortoolitem.c:105 +#: gtk/gtkseparatortoolitem.c:125 msgid "Draw" msgstr "" -#: gtk/gtkseparatortoolitem.c:106 +#: gtk/gtkseparatortoolitem.c:126 msgid "Whether the separator is drawn, or just blank" msgstr "" -#: gtk/gtksettings.c:224 +#: gtk/gtksettings.c:225 msgid "Double Click Time" msgstr "" -#: gtk/gtksettings.c:225 +#: gtk/gtksettings.c:226 msgid "" "Maximum time allowed between two clicks for them to be considered a double " "click (in milliseconds)" msgstr "" -#: gtk/gtksettings.c:232 +#: gtk/gtksettings.c:233 msgid "Double Click Distance" msgstr "" -#: gtk/gtksettings.c:233 +#: gtk/gtksettings.c:234 msgid "" "Maximum distance allowed between two clicks for them to be considered a " "double click (in pixels)" msgstr "" -#: gtk/gtksettings.c:249 +#: gtk/gtksettings.c:250 msgid "Cursor Blink" msgstr "" -#: gtk/gtksettings.c:250 +#: gtk/gtksettings.c:251 msgid "Whether the cursor should blink" msgstr "" -#: gtk/gtksettings.c:257 +#: gtk/gtksettings.c:258 msgid "Cursor Blink Time" msgstr "" -#: gtk/gtksettings.c:258 +#: gtk/gtksettings.c:259 msgid "Length of the cursor blink cycle, in milliseconds" msgstr "" -#: gtk/gtksettings.c:277 +#: gtk/gtksettings.c:278 msgid "Cursor Blink Timeout" msgstr "" -#: gtk/gtksettings.c:278 +#: gtk/gtksettings.c:279 msgid "Time after which the cursor stops blinking, in seconds" msgstr "" -#: gtk/gtksettings.c:285 +#: gtk/gtksettings.c:286 msgid "Split Cursor" msgstr "" -#: gtk/gtksettings.c:286 +#: gtk/gtksettings.c:287 msgid "" "Whether two cursors should be displayed for mixed left-to-right and right-to-" "left text" msgstr "" -#: gtk/gtksettings.c:293 +#: gtk/gtksettings.c:294 msgid "Theme Name" msgstr "" -#: gtk/gtksettings.c:294 +#: gtk/gtksettings.c:295 msgid "Name of theme RC file to load" msgstr "" -#: gtk/gtksettings.c:302 +#: gtk/gtksettings.c:303 msgid "Icon Theme Name" msgstr "" -#: gtk/gtksettings.c:303 +#: gtk/gtksettings.c:304 msgid "Name of icon theme to use" msgstr "" -#: gtk/gtksettings.c:311 +#: gtk/gtksettings.c:312 msgid "Fallback Icon Theme Name" msgstr "" -#: gtk/gtksettings.c:312 +#: gtk/gtksettings.c:313 msgid "Name of a icon theme to fall back to" msgstr "" -#: gtk/gtksettings.c:320 +#: gtk/gtksettings.c:321 msgid "Key Theme Name" msgstr "" -#: gtk/gtksettings.c:321 +#: gtk/gtksettings.c:322 msgid "Name of key theme RC file to load" msgstr "" -#: gtk/gtksettings.c:329 +#: gtk/gtksettings.c:330 msgid "Menu bar accelerator" msgstr "" -#: gtk/gtksettings.c:330 +#: gtk/gtksettings.c:331 msgid "Keybinding to activate the menu bar" msgstr "" -#: gtk/gtksettings.c:338 +#: gtk/gtksettings.c:339 msgid "Drag threshold" msgstr "" -#: gtk/gtksettings.c:339 +#: gtk/gtksettings.c:340 msgid "Number of pixels the cursor can move before dragging" msgstr "" -#: gtk/gtksettings.c:347 +#: gtk/gtksettings.c:348 msgid "Font Name" msgstr "" -#: gtk/gtksettings.c:348 +#: gtk/gtksettings.c:349 msgid "Name of default font to use" msgstr "" -#: gtk/gtksettings.c:370 +#: gtk/gtksettings.c:371 msgid "Icon Sizes" msgstr "" -#: gtk/gtksettings.c:371 +#: gtk/gtksettings.c:372 msgid "List of icon sizes (gtk-menu=16,16:gtk-button=20,20..." msgstr "" -#: gtk/gtksettings.c:379 +#: gtk/gtksettings.c:380 msgid "GTK Modules" msgstr "" -#: gtk/gtksettings.c:380 +#: gtk/gtksettings.c:381 msgid "List of currently active GTK modules" msgstr "" -#: gtk/gtksettings.c:389 +#: gtk/gtksettings.c:390 msgid "Xft Antialias" msgstr "" -#: gtk/gtksettings.c:390 +#: gtk/gtksettings.c:391 msgid "Whether to antialias Xft fonts; 0=no, 1=yes, -1=default" msgstr "" -#: gtk/gtksettings.c:399 +#: gtk/gtksettings.c:400 msgid "Xft Hinting" msgstr "" -#: gtk/gtksettings.c:400 +#: gtk/gtksettings.c:401 msgid "Whether to hint Xft fonts; 0=no, 1=yes, -1=default" msgstr "" -#: gtk/gtksettings.c:409 +#: gtk/gtksettings.c:410 msgid "Xft Hint Style" msgstr "" -#: gtk/gtksettings.c:410 +#: gtk/gtksettings.c:411 msgid "" "What degree of hinting to use; hintnone, hintslight, hintmedium, or hintfull" msgstr "" -#: gtk/gtksettings.c:419 +#: gtk/gtksettings.c:420 msgid "Xft RGBA" msgstr "" -#: gtk/gtksettings.c:420 +#: gtk/gtksettings.c:421 msgid "Type of subpixel antialiasing; none, rgb, bgr, vrgb, vbgr" msgstr "" -#: gtk/gtksettings.c:429 +#: gtk/gtksettings.c:430 msgid "Xft DPI" msgstr "" -#: gtk/gtksettings.c:430 +#: gtk/gtksettings.c:431 msgid "Resolution for Xft, in 1024 * dots/inch. -1 to use default value" msgstr "" -#: gtk/gtksettings.c:439 +#: gtk/gtksettings.c:440 msgid "Cursor theme name" msgstr "" -#: gtk/gtksettings.c:440 +#: gtk/gtksettings.c:441 msgid "Name of the cursor theme to use, or NULL to use the default theme" msgstr "" -#: gtk/gtksettings.c:448 +#: gtk/gtksettings.c:449 msgid "Cursor theme size" msgstr "" -#: gtk/gtksettings.c:449 +#: gtk/gtksettings.c:450 msgid "Size to use for cursors, or 0 to use the default size" msgstr "" -#: gtk/gtksettings.c:459 +#: gtk/gtksettings.c:460 msgid "Alternative button order" msgstr "" -#: gtk/gtksettings.c:460 +#: gtk/gtksettings.c:461 msgid "Whether buttons in dialogs should use the alternative button order" msgstr "" -#: gtk/gtksettings.c:477 +#: gtk/gtksettings.c:478 msgid "Alternative sort indicator direction" msgstr "" -#: gtk/gtksettings.c:478 +#: gtk/gtksettings.c:479 msgid "" "Whether the direction of the sort indicators in list and tree views is " "inverted compared to the default (where down means ascending)" msgstr "" -#: gtk/gtksettings.c:486 +#: gtk/gtksettings.c:487 msgid "Show the 'Input Methods' menu" msgstr "" -#: gtk/gtksettings.c:487 +#: gtk/gtksettings.c:488 msgid "" "Whether the context menus of entries and text views should offer to change " "the input method" msgstr "" -#: gtk/gtksettings.c:495 +#: gtk/gtksettings.c:496 msgid "Show the 'Insert Unicode Control Character' menu" msgstr "" -#: gtk/gtksettings.c:496 +#: gtk/gtksettings.c:497 msgid "" "Whether the context menus of entries and text views should offer to insert " "control characters" msgstr "" -#: gtk/gtksettings.c:504 +#: gtk/gtksettings.c:505 msgid "Start timeout" msgstr "" -#: gtk/gtksettings.c:505 +#: gtk/gtksettings.c:506 msgid "Starting value for timeouts, when button is pressed" msgstr "" -#: gtk/gtksettings.c:514 +#: gtk/gtksettings.c:515 msgid "Repeat timeout" msgstr "" -#: gtk/gtksettings.c:515 +#: gtk/gtksettings.c:516 msgid "Repeat value for timeouts, when button is pressed" msgstr "" -#: gtk/gtksettings.c:524 +#: gtk/gtksettings.c:525 msgid "Expand timeout" msgstr "" -#: gtk/gtksettings.c:525 +#: gtk/gtksettings.c:526 msgid "Expand value for timeouts, when a widget is expanding a new region" msgstr "" -#: gtk/gtksettings.c:560 +#: gtk/gtksettings.c:561 msgid "Color scheme" msgstr "" -#: gtk/gtksettings.c:561 +#: gtk/gtksettings.c:562 msgid "A palette of named colors for use in themes" msgstr "" -#: gtk/gtksettings.c:570 +#: gtk/gtksettings.c:571 msgid "Enable Animations" msgstr "" -#: gtk/gtksettings.c:571 +#: gtk/gtksettings.c:572 msgid "Whether to enable toolkit-wide animations." msgstr "" -#: gtk/gtksettings.c:589 +#: gtk/gtksettings.c:590 msgid "Enable Touchscreen Mode" msgstr "" -#: gtk/gtksettings.c:590 +#: gtk/gtksettings.c:591 msgid "When TRUE, there are no motion notify events delivered on this screen" msgstr "" -#: gtk/gtksettings.c:607 +#: gtk/gtksettings.c:608 msgid "Tooltip timeout" msgstr "" -#: gtk/gtksettings.c:608 +#: gtk/gtksettings.c:609 msgid "Timeout before tooltip is shown" msgstr "" -#: gtk/gtksettings.c:633 +#: gtk/gtksettings.c:634 msgid "Tooltip browse timeout" msgstr "" -#: gtk/gtksettings.c:634 +#: gtk/gtksettings.c:635 msgid "Timeout before tooltip is shown when browse mode is enabled" msgstr "" -#: gtk/gtksettings.c:655 +#: gtk/gtksettings.c:656 msgid "Tooltip browse mode timeout" msgstr "" -#: gtk/gtksettings.c:656 +#: gtk/gtksettings.c:657 msgid "Timeout after which browse mode is disabled" msgstr "" -#: gtk/gtksettings.c:675 +#: gtk/gtksettings.c:676 msgid "Keynav Cursor Only" msgstr "" -#: gtk/gtksettings.c:676 +#: gtk/gtksettings.c:677 msgid "When TRUE, there are only cursor keys available to navigate widgets" msgstr "" -#: gtk/gtksettings.c:693 +#: gtk/gtksettings.c:694 msgid "Keynav Wrap Around" msgstr "" -#: gtk/gtksettings.c:694 +#: gtk/gtksettings.c:695 msgid "Whether to wrap around when keyboard-navigating widgets" msgstr "" -#: gtk/gtksettings.c:714 +#: gtk/gtksettings.c:715 msgid "Error Bell" msgstr "" -#: gtk/gtksettings.c:715 +#: gtk/gtksettings.c:716 msgid "When TRUE, keyboard navigation and other errors will cause a beep" msgstr "" -#: gtk/gtksettings.c:732 +#: gtk/gtksettings.c:733 msgid "Color Hash" msgstr "" -#: gtk/gtksettings.c:733 +#: gtk/gtksettings.c:734 msgid "A hash table representation of the color scheme." msgstr "" -#: gtk/gtksettings.c:741 +#: gtk/gtksettings.c:742 msgid "Default file chooser backend" msgstr "" -#: gtk/gtksettings.c:742 +#: gtk/gtksettings.c:743 msgid "Name of the GtkFileChooser backend to use by default" msgstr "" -#: gtk/gtksettings.c:759 +#: gtk/gtksettings.c:760 msgid "Default print backend" msgstr "" -#: gtk/gtksettings.c:760 +#: gtk/gtksettings.c:761 msgid "List of the GtkPrintBackend backends to use by default" msgstr "" -#: gtk/gtksettings.c:783 +#: gtk/gtksettings.c:784 msgid "Default command to run when displaying a print preview" msgstr "" -#: gtk/gtksettings.c:784 +#: gtk/gtksettings.c:785 msgid "Command to run when displaying a print preview" msgstr "" -#: gtk/gtksettings.c:800 +#: gtk/gtksettings.c:801 msgid "Enable Mnemonics" msgstr "" -#: gtk/gtksettings.c:801 +#: gtk/gtksettings.c:802 msgid "Whether labels should have mnemonics" msgstr "" -#: gtk/gtksettings.c:817 +#: gtk/gtksettings.c:818 msgid "Enable Accelerators" msgstr "" -#: gtk/gtksettings.c:818 +#: gtk/gtksettings.c:819 msgid "Whether menu items should have accelerators" msgstr "" -#: gtk/gtksettings.c:835 +#: gtk/gtksettings.c:836 msgid "Recent Files Limit" msgstr "" -#: gtk/gtksettings.c:836 +#: gtk/gtksettings.c:837 #, fuzzy msgid "Number of recently used files" msgstr "Gerím channela" -#: gtk/gtksettings.c:854 +#: gtk/gtksettings.c:855 msgid "Default IM module" msgstr "" -#: gtk/gtksettings.c:855 +#: gtk/gtksettings.c:856 msgid "Which IM module should be used by default" msgstr "" -#: gtk/gtksettings.c:873 +#: gtk/gtksettings.c:874 msgid "Recent Files Max Age" msgstr "" -#: gtk/gtksettings.c:874 +#: gtk/gtksettings.c:875 #, fuzzy msgid "Maximum age of recently used files, in days" msgstr "Gerím channela" -#: gtk/gtksettings.c:883 +#: gtk/gtksettings.c:884 msgid "Fontconfig configuration timestamp" msgstr "" -#: gtk/gtksettings.c:884 +#: gtk/gtksettings.c:885 msgid "Timestamp of current fontconfig configuration" msgstr "" -#: gtk/gtksettings.c:906 +#: gtk/gtksettings.c:907 msgid "Sound Theme Name" msgstr "" -#: gtk/gtksettings.c:907 +#: gtk/gtksettings.c:908 msgid "XDG sound theme name" msgstr "" #. Translators: this means sounds that are played as feedback to user input -#: gtk/gtksettings.c:929 +#: gtk/gtksettings.c:930 msgid "Audible Input Feedback" msgstr "" -#: gtk/gtksettings.c:930 +#: gtk/gtksettings.c:931 msgid "Whether to play event sounds as feedback to user input" msgstr "" -#: gtk/gtksettings.c:951 +#: gtk/gtksettings.c:952 msgid "Enable Event Sounds" msgstr "" -#: gtk/gtksettings.c:952 +#: gtk/gtksettings.c:953 msgid "Whether to play any event sounds at all" msgstr "" -#: gtk/gtksettings.c:967 +#: gtk/gtksettings.c:968 #, fuzzy msgid "Enable Tooltips" msgstr "Hæfþ Alpha" -#: gtk/gtksettings.c:968 +#: gtk/gtksettings.c:969 msgid "Whether tooltips should be shown on widgets" msgstr "" -#: gtk/gtksettings.c:981 +#: gtk/gtksettings.c:982 msgid "Toolbar style" msgstr "" -#: gtk/gtksettings.c:982 +#: gtk/gtksettings.c:983 msgid "" "Whether default toolbars have text only, text and icons, icons only, etc." msgstr "" -#: gtk/gtksettings.c:996 +#: gtk/gtksettings.c:997 msgid "Toolbar Icon Size" msgstr "" -#: gtk/gtksettings.c:997 +#: gtk/gtksettings.c:998 msgid "The size of icons in default toolbars." msgstr "" -#: gtk/gtksettings.c:1014 +#: gtk/gtksettings.c:1015 msgid "Auto Mnemonics" msgstr "" -#: gtk/gtksettings.c:1015 +#: gtk/gtksettings.c:1016 msgid "" "Whether mnemonics should be automatically shown and hidden when the user " "presses the mnemonic activator." msgstr "" -#: gtk/gtksizegroup.c:301 +#: gtk/gtksettings.c:1041 +msgid "Application prefers a dark theme" +msgstr "" + +#: gtk/gtksettings.c:1042 +msgid "Whether the application prefers to have a dark theme." +msgstr "" + +#: gtk/gtksizegroup.c:320 msgid "Mode" msgstr "" -#: gtk/gtksizegroup.c:302 +#: gtk/gtksizegroup.c:321 msgid "" "The directions in which the size group affects the requested sizes of its " "component widgets" msgstr "" -#: gtk/gtksizegroup.c:318 +#: gtk/gtksizegroup.c:337 msgid "Ignore hidden" msgstr "" -#: gtk/gtksizegroup.c:319 +#: gtk/gtksizegroup.c:338 msgid "" "If TRUE, unmapped widgets are ignored when determining the size of the group" msgstr "" @@ -5485,61 +5291,61 @@ msgstr "" msgid "Style of bevel around the statusbar text" msgstr "" -#: gtk/gtkstatusicon.c:271 +#: gtk/gtkstatusicon.c:276 #, fuzzy msgid "The size of the icon" msgstr "Þæt cynn þæs éagþyrles" -#: gtk/gtkstatusicon.c:281 +#: gtk/gtkstatusicon.c:286 msgid "The screen where this status icon will be displayed" msgstr "" -#: gtk/gtkstatusicon.c:288 +#: gtk/gtkstatusicon.c:293 msgid "Blinking" msgstr "" -#: gtk/gtkstatusicon.c:289 +#: gtk/gtkstatusicon.c:294 msgid "Whether or not the status icon is blinking" msgstr "" -#: gtk/gtkstatusicon.c:297 +#: gtk/gtkstatusicon.c:302 msgid "Whether or not the status icon is visible" msgstr "" -#: gtk/gtkstatusicon.c:313 +#: gtk/gtkstatusicon.c:318 msgid "Whether or not the status icon is embedded" msgstr "" -#: gtk/gtkstatusicon.c:329 gtk/gtktrayicon-x11.c:111 +#: gtk/gtkstatusicon.c:334 gtk/gtktrayicon-x11.c:123 msgid "The orientation of the tray" msgstr "" -#: gtk/gtkstatusicon.c:356 gtk/gtkwidget.c:702 +#: gtk/gtkstatusicon.c:361 gtk/gtkwidget.c:722 #, fuzzy msgid "Has tooltip" msgstr "Hæfþ Alpha" -#: gtk/gtkstatusicon.c:357 +#: gtk/gtkstatusicon.c:362 msgid "Whether this tray icon has a tooltip" msgstr "" -#: gtk/gtkstatusicon.c:382 gtk/gtkwidget.c:723 +#: gtk/gtkstatusicon.c:387 gtk/gtkwidget.c:743 msgid "Tooltip Text" msgstr "" -#: gtk/gtkstatusicon.c:383 gtk/gtkwidget.c:724 gtk/gtkwidget.c:745 +#: gtk/gtkstatusicon.c:388 gtk/gtkwidget.c:744 gtk/gtkwidget.c:765 msgid "The contents of the tooltip for this widget" msgstr "" -#: gtk/gtkstatusicon.c:406 gtk/gtkwidget.c:744 +#: gtk/gtkstatusicon.c:411 gtk/gtkwidget.c:764 msgid "Tooltip markup" msgstr "" -#: gtk/gtkstatusicon.c:407 +#: gtk/gtkstatusicon.c:412 msgid "The contents of the tooltip for this tray icon" msgstr "" -#: gtk/gtkstatusicon.c:425 +#: gtk/gtkstatusicon.c:430 #, fuzzy msgid "The title of this tray icon" msgstr "Þæt cynn þæs éagþyrles" @@ -5640,30 +5446,6 @@ msgid "" "pixels" msgstr "" -#: gtk/gtktext.c:546 -msgid "Horizontal adjustment for the text widget" -msgstr "" - -#: gtk/gtktext.c:554 -msgid "Vertical adjustment for the text widget" -msgstr "" - -#: gtk/gtktext.c:561 -msgid "Line Wrap" -msgstr "" - -#: gtk/gtktext.c:562 -msgid "Whether lines are wrapped at widget edges" -msgstr "" - -#: gtk/gtktext.c:569 -msgid "Word Wrap" -msgstr "" - -#: gtk/gtktext.c:570 -msgid "Whether words are wrapped at widget edges" -msgstr "" - #: gtk/gtktextbuffer.c:180 msgid "Tag Table" msgstr "" @@ -6080,15 +5862,15 @@ msgstr "" msgid "Color with which to draw error-indication underlines" msgstr "" -#: gtk/gtktoggleaction.c:104 +#: gtk/gtktoggleaction.c:115 msgid "Create the same proxies as a radio action" msgstr "" -#: gtk/gtktoggleaction.c:105 +#: gtk/gtktoggleaction.c:116 msgid "Whether the proxies for this action look like radio action proxies" msgstr "" -#: gtk/gtktoggleaction.c:120 +#: gtk/gtktoggleaction.c:131 msgid "If the toggle action should be active in or not" msgstr "" @@ -6108,87 +5890,79 @@ msgstr "" msgid "If the toggle part of the button is displayed" msgstr "" -#: gtk/gtktoolbar.c:494 gtk/gtktoolpalette.c:1020 +#: gtk/gtktoolbar.c:456 gtk/gtktoolpalette.c:1021 msgid "Toolbar Style" msgstr "" -#: gtk/gtktoolbar.c:495 +#: gtk/gtktoolbar.c:457 msgid "How to draw the toolbar" msgstr "" -#: gtk/gtktoolbar.c:502 +#: gtk/gtktoolbar.c:464 msgid "Show Arrow" msgstr "" -#: gtk/gtktoolbar.c:503 +#: gtk/gtktoolbar.c:465 msgid "If an arrow should be shown if the toolbar doesn't fit" msgstr "" -#: gtk/gtktoolbar.c:518 -msgid "Tooltips" -msgstr "" - -#: gtk/gtktoolbar.c:519 -msgid "If the tooltips of the toolbar should be active or not" -msgstr "" - -#: gtk/gtktoolbar.c:541 +#: gtk/gtktoolbar.c:486 msgid "Size of icons in this toolbar" msgstr "" -#: gtk/gtktoolbar.c:556 gtk/gtktoolpalette.c:1006 +#: gtk/gtktoolbar.c:501 gtk/gtktoolpalette.c:1007 msgid "Icon size set" msgstr "" -#: gtk/gtktoolbar.c:557 gtk/gtktoolpalette.c:1007 +#: gtk/gtktoolbar.c:502 gtk/gtktoolpalette.c:1008 msgid "Whether the icon-size property has been set" msgstr "" -#: gtk/gtktoolbar.c:566 +#: gtk/gtktoolbar.c:511 msgid "Whether the item should receive extra space when the toolbar grows" msgstr "" -#: gtk/gtktoolbar.c:574 gtk/gtktoolitemgroup.c:1589 +#: gtk/gtktoolbar.c:519 gtk/gtktoolitemgroup.c:1597 msgid "Whether the item should be the same size as other homogeneous items" msgstr "" -#: gtk/gtktoolbar.c:581 +#: gtk/gtktoolbar.c:526 msgid "Spacer size" msgstr "" -#: gtk/gtktoolbar.c:582 +#: gtk/gtktoolbar.c:527 msgid "Size of spacers" msgstr "" -#: gtk/gtktoolbar.c:591 +#: gtk/gtktoolbar.c:536 msgid "Amount of border space between the toolbar shadow and the buttons" msgstr "" -#: gtk/gtktoolbar.c:599 +#: gtk/gtktoolbar.c:544 msgid "Maximum child expand" msgstr "" -#: gtk/gtktoolbar.c:600 +#: gtk/gtktoolbar.c:545 msgid "Maximum amount of space an expandable item will be given" msgstr "" -#: gtk/gtktoolbar.c:608 +#: gtk/gtktoolbar.c:553 msgid "Space style" msgstr "" -#: gtk/gtktoolbar.c:609 +#: gtk/gtktoolbar.c:554 msgid "Whether spacers are vertical lines or just blank" msgstr "" -#: gtk/gtktoolbar.c:616 +#: gtk/gtktoolbar.c:561 msgid "Button relief" msgstr "" -#: gtk/gtktoolbar.c:617 +#: gtk/gtktoolbar.c:562 msgid "Type of bevel around toolbar buttons" msgstr "" -#: gtk/gtktoolbar.c:624 +#: gtk/gtktoolbar.c:569 msgid "Style of bevel around the toolbar" msgstr "" @@ -6239,94 +6013,126 @@ msgstr "" msgid "Spacing in pixels between the icon and label" msgstr "" -#: gtk/gtktoolitem.c:207 +#: gtk/gtktoolitem.c:200 msgid "" "Whether the toolbar item is considered important. When TRUE, toolbar buttons " "show text in GTK_TOOLBAR_BOTH_HORIZ mode" msgstr "" -#: gtk/gtktoolitemgroup.c:1536 +#: gtk/gtktoolitemgroup.c:1544 #, fuzzy msgid "The human-readable title of this item group" msgstr "Þæt cynn þæs éagþyrles" -#: gtk/gtktoolitemgroup.c:1543 +#: gtk/gtktoolitemgroup.c:1551 msgid "A widget to display in place of the usual label" msgstr "" -#: gtk/gtktoolitemgroup.c:1549 +#: gtk/gtktoolitemgroup.c:1557 msgid "Collapsed" msgstr "" -#: gtk/gtktoolitemgroup.c:1550 +#: gtk/gtktoolitemgroup.c:1558 msgid "Wether the group has been collapsed and items are hidden" msgstr "" -#: gtk/gtktoolitemgroup.c:1556 +#: gtk/gtktoolitemgroup.c:1564 msgid "ellipsize" msgstr "" -#: gtk/gtktoolitemgroup.c:1557 +#: gtk/gtktoolitemgroup.c:1565 msgid "Ellipsize for item group headers" msgstr "" -#: gtk/gtktoolitemgroup.c:1563 +#: gtk/gtktoolitemgroup.c:1571 msgid "Header Relief" msgstr "" -#: gtk/gtktoolitemgroup.c:1564 +#: gtk/gtktoolitemgroup.c:1572 msgid "Relief of the group header button" msgstr "" -#: gtk/gtktoolitemgroup.c:1579 +#: gtk/gtktoolitemgroup.c:1587 msgid "Header Spacing" msgstr "" -#: gtk/gtktoolitemgroup.c:1580 +#: gtk/gtktoolitemgroup.c:1588 msgid "Spacing between expander arrow and caption" msgstr "" -#: gtk/gtktoolitemgroup.c:1596 +#: gtk/gtktoolitemgroup.c:1604 msgid "Whether the item should receive extra space when the group grows" msgstr "" -#: gtk/gtktoolitemgroup.c:1603 +#: gtk/gtktoolitemgroup.c:1611 msgid "Whether the item should fill the available space" msgstr "" -#: gtk/gtktoolitemgroup.c:1609 +#: gtk/gtktoolitemgroup.c:1617 msgid "New Row" msgstr "" -#: gtk/gtktoolitemgroup.c:1610 +#: gtk/gtktoolitemgroup.c:1618 msgid "Whether the item should start a new row" msgstr "" -#: gtk/gtktoolitemgroup.c:1617 +#: gtk/gtktoolitemgroup.c:1625 msgid "Position of the item within this group" msgstr "" -#: gtk/gtktoolpalette.c:991 +#: gtk/gtktoolpalette.c:992 msgid "Size of icons in this tool palette" msgstr "" -#: gtk/gtktoolpalette.c:1021 +#: gtk/gtktoolpalette.c:1022 msgid "Style of items in the tool palette" msgstr "" -#: gtk/gtktoolpalette.c:1037 +#: gtk/gtktoolpalette.c:1038 msgid "Exclusive" msgstr "" -#: gtk/gtktoolpalette.c:1038 +#: gtk/gtktoolpalette.c:1039 msgid "Whether the item group should be the only expanded at a given time" msgstr "" -#: gtk/gtktoolpalette.c:1053 +#: gtk/gtktoolpalette.c:1054 msgid "" "Whether the item group should receive extra space when the palette grows" msgstr "" +#: gtk/gtktrayicon-x11.c:132 +msgid "Foreground color for symbolic icons" +msgstr "" + +#: gtk/gtktrayicon-x11.c:139 +msgid "Error color" +msgstr "" + +#: gtk/gtktrayicon-x11.c:140 +msgid "Error color for symbolic icons" +msgstr "" + +#: gtk/gtktrayicon-x11.c:147 +msgid "Warning color" +msgstr "" + +#: gtk/gtktrayicon-x11.c:148 +msgid "Warning color for symbolic icons" +msgstr "" + +#: gtk/gtktrayicon-x11.c:155 +msgid "Success color" +msgstr "" + +#: gtk/gtktrayicon-x11.c:156 +msgid "Success color for symbolic icons" +msgstr "" + +#: gtk/gtktrayicon-x11.c:164 +msgid "Padding that should be put around icons in the tray" +msgstr "" + #: gtk/gtktreemodelsort.c:278 msgid "TreeModelSort Model" msgstr "" @@ -6335,228 +6141,228 @@ msgstr "" msgid "The model for the TreeModelSort to sort" msgstr "" -#: gtk/gtktreeview.c:564 +#: gtk/gtktreeview.c:566 msgid "TreeView Model" msgstr "" -#: gtk/gtktreeview.c:565 +#: gtk/gtktreeview.c:567 msgid "The model for the tree view" msgstr "" -#: gtk/gtktreeview.c:573 +#: gtk/gtktreeview.c:575 msgid "Horizontal Adjustment for the widget" msgstr "" -#: gtk/gtktreeview.c:581 +#: gtk/gtktreeview.c:583 msgid "Vertical Adjustment for the widget" msgstr "" -#: gtk/gtktreeview.c:588 +#: gtk/gtktreeview.c:590 msgid "Headers Visible" msgstr "" -#: gtk/gtktreeview.c:589 +#: gtk/gtktreeview.c:591 msgid "Show the column header buttons" msgstr "" -#: gtk/gtktreeview.c:596 +#: gtk/gtktreeview.c:598 msgid "Headers Clickable" msgstr "" -#: gtk/gtktreeview.c:597 +#: gtk/gtktreeview.c:599 msgid "Column headers respond to click events" msgstr "" -#: gtk/gtktreeview.c:604 +#: gtk/gtktreeview.c:606 msgid "Expander Column" msgstr "" -#: gtk/gtktreeview.c:605 +#: gtk/gtktreeview.c:607 msgid "Set the column for the expander column" msgstr "" -#: gtk/gtktreeview.c:620 +#: gtk/gtktreeview.c:622 msgid "Rules Hint" msgstr "" -#: gtk/gtktreeview.c:621 +#: gtk/gtktreeview.c:623 msgid "Set a hint to the theme engine to draw rows in alternating colors" msgstr "" -#: gtk/gtktreeview.c:628 +#: gtk/gtktreeview.c:630 msgid "Enable Search" msgstr "" -#: gtk/gtktreeview.c:629 +#: gtk/gtktreeview.c:631 msgid "View allows user to search through columns interactively" msgstr "" -#: gtk/gtktreeview.c:636 +#: gtk/gtktreeview.c:638 msgid "Search Column" msgstr "" -#: gtk/gtktreeview.c:637 +#: gtk/gtktreeview.c:639 msgid "Model column to search through during interactive search" msgstr "" -#: gtk/gtktreeview.c:657 +#: gtk/gtktreeview.c:659 msgid "Fixed Height Mode" msgstr "" -#: gtk/gtktreeview.c:658 +#: gtk/gtktreeview.c:660 msgid "Speeds up GtkTreeView by assuming that all rows have the same height" msgstr "" -#: gtk/gtktreeview.c:678 +#: gtk/gtktreeview.c:680 msgid "Hover Selection" msgstr "" -#: gtk/gtktreeview.c:679 +#: gtk/gtktreeview.c:681 msgid "Whether the selection should follow the pointer" msgstr "" -#: gtk/gtktreeview.c:698 +#: gtk/gtktreeview.c:700 #, fuzzy msgid "Hover Expand" msgstr "Þæt xpad" -#: gtk/gtktreeview.c:699 +#: gtk/gtktreeview.c:701 msgid "" "Whether rows should be expanded/collapsed when the pointer moves over them" msgstr "" -#: gtk/gtktreeview.c:713 +#: gtk/gtktreeview.c:715 msgid "Show Expanders" msgstr "" -#: gtk/gtktreeview.c:714 +#: gtk/gtktreeview.c:716 msgid "View has expanders" msgstr "" -#: gtk/gtktreeview.c:728 +#: gtk/gtktreeview.c:730 msgid "Level Indentation" msgstr "" -#: gtk/gtktreeview.c:729 +#: gtk/gtktreeview.c:731 msgid "Extra indentation for each level" msgstr "" -#: gtk/gtktreeview.c:738 +#: gtk/gtktreeview.c:740 msgid "Rubber Banding" msgstr "" -#: gtk/gtktreeview.c:739 +#: gtk/gtktreeview.c:741 msgid "" "Whether to enable selection of multiple items by dragging the mouse pointer" msgstr "" -#: gtk/gtktreeview.c:746 +#: gtk/gtktreeview.c:748 msgid "Enable Grid Lines" msgstr "" -#: gtk/gtktreeview.c:747 +#: gtk/gtktreeview.c:749 msgid "Whether grid lines should be drawn in the tree view" msgstr "" -#: gtk/gtktreeview.c:755 +#: gtk/gtktreeview.c:757 msgid "Enable Tree Lines" msgstr "" -#: gtk/gtktreeview.c:756 +#: gtk/gtktreeview.c:758 msgid "Whether tree lines should be drawn in the tree view" msgstr "" -#: gtk/gtktreeview.c:764 +#: gtk/gtktreeview.c:766 msgid "The column in the model containing the tooltip texts for the rows" msgstr "" -#: gtk/gtktreeview.c:786 +#: gtk/gtktreeview.c:788 msgid "Vertical Separator Width" msgstr "" -#: gtk/gtktreeview.c:787 +#: gtk/gtktreeview.c:789 msgid "Vertical space between cells. Must be an even number" msgstr "" -#: gtk/gtktreeview.c:795 +#: gtk/gtktreeview.c:797 msgid "Horizontal Separator Width" msgstr "" -#: gtk/gtktreeview.c:796 +#: gtk/gtktreeview.c:798 msgid "Horizontal space between cells. Must be an even number" msgstr "" -#: gtk/gtktreeview.c:804 +#: gtk/gtktreeview.c:806 msgid "Allow Rules" msgstr "" -#: gtk/gtktreeview.c:805 +#: gtk/gtktreeview.c:807 msgid "Allow drawing of alternating color rows" msgstr "" -#: gtk/gtktreeview.c:811 +#: gtk/gtktreeview.c:813 msgid "Indent Expanders" msgstr "" -#: gtk/gtktreeview.c:812 +#: gtk/gtktreeview.c:814 msgid "Make the expanders indented" msgstr "" -#: gtk/gtktreeview.c:818 +#: gtk/gtktreeview.c:820 msgid "Even Row Color" msgstr "" -#: gtk/gtktreeview.c:819 +#: gtk/gtktreeview.c:821 msgid "Color to use for even rows" msgstr "" -#: gtk/gtktreeview.c:825 +#: gtk/gtktreeview.c:827 msgid "Odd Row Color" msgstr "" -#: gtk/gtktreeview.c:826 +#: gtk/gtktreeview.c:828 msgid "Color to use for odd rows" msgstr "" -#: gtk/gtktreeview.c:832 +#: gtk/gtktreeview.c:834 msgid "Row Ending details" msgstr "" -#: gtk/gtktreeview.c:833 +#: gtk/gtktreeview.c:835 msgid "Enable extended row background theming" msgstr "" -#: gtk/gtktreeview.c:839 +#: gtk/gtktreeview.c:841 #, fuzzy msgid "Grid line width" msgstr "Séo fæste wídu" -#: gtk/gtktreeview.c:840 +#: gtk/gtktreeview.c:842 msgid "Width, in pixels, of the tree view grid lines" msgstr "" -#: gtk/gtktreeview.c:846 +#: gtk/gtktreeview.c:848 #, fuzzy msgid "Tree line width" msgstr "Séo fæste wídu" -#: gtk/gtktreeview.c:847 +#: gtk/gtktreeview.c:849 msgid "Width, in pixels, of the tree view lines" msgstr "" -#: gtk/gtktreeview.c:853 +#: gtk/gtktreeview.c:855 msgid "Grid line pattern" msgstr "" -#: gtk/gtktreeview.c:854 +#: gtk/gtktreeview.c:856 msgid "Dash pattern used to draw the tree view grid lines" msgstr "" -#: gtk/gtktreeview.c:860 +#: gtk/gtktreeview.c:862 msgid "Tree line pattern" msgstr "" -#: gtk/gtktreeview.c:861 +#: gtk/gtktreeview.c:863 msgid "Dash pattern used to draw the tree view lines" msgstr "" @@ -6564,7 +6370,7 @@ msgstr "" msgid "Whether to display the column" msgstr "" -#: gtk/gtktreeviewcolumn.c:200 gtk/gtkwindow.c:542 +#: gtk/gtktreeviewcolumn.c:200 gtk/gtkwindow.c:566 msgid "Resizable" msgstr "" @@ -6680,528 +6486,528 @@ msgstr "" msgid "An XML string describing the merged UI" msgstr "" -#: gtk/gtkviewport.c:107 +#: gtk/gtkviewport.c:135 msgid "" "The GtkAdjustment that determines the values of the horizontal position for " "this viewport" msgstr "" -#: gtk/gtkviewport.c:115 +#: gtk/gtkviewport.c:143 msgid "" "The GtkAdjustment that determines the values of the vertical position for " "this viewport" msgstr "" -#: gtk/gtkviewport.c:123 +#: gtk/gtkviewport.c:151 msgid "Determines how the shadowed box around the viewport is drawn" msgstr "" -#: gtk/gtkwidget.c:553 +#: gtk/gtkwidget.c:573 msgid "Widget name" msgstr "Wicgetnama" -#: gtk/gtkwidget.c:554 +#: gtk/gtkwidget.c:574 msgid "The name of the widget" msgstr "" -#: gtk/gtkwidget.c:560 +#: gtk/gtkwidget.c:580 msgid "Parent widget" msgstr "" -#: gtk/gtkwidget.c:561 +#: gtk/gtkwidget.c:581 msgid "The parent widget of this widget. Must be a Container widget" msgstr "" -#: gtk/gtkwidget.c:568 +#: gtk/gtkwidget.c:588 msgid "Width request" msgstr "" -#: gtk/gtkwidget.c:569 +#: gtk/gtkwidget.c:589 msgid "" "Override for width request of the widget, or -1 if natural request should be " "used" msgstr "" -#: gtk/gtkwidget.c:577 +#: gtk/gtkwidget.c:597 msgid "Height request" msgstr "" -#: gtk/gtkwidget.c:578 +#: gtk/gtkwidget.c:598 msgid "" "Override for height request of the widget, or -1 if natural request should " "be used" msgstr "" -#: gtk/gtkwidget.c:587 +#: gtk/gtkwidget.c:607 msgid "Whether the widget is visible" msgstr "" -#: gtk/gtkwidget.c:594 +#: gtk/gtkwidget.c:614 msgid "Whether the widget responds to input" msgstr "" -#: gtk/gtkwidget.c:600 +#: gtk/gtkwidget.c:620 msgid "Application paintable" msgstr "" -#: gtk/gtkwidget.c:601 +#: gtk/gtkwidget.c:621 msgid "Whether the application will paint directly on the widget" msgstr "" -#: gtk/gtkwidget.c:607 +#: gtk/gtkwidget.c:627 msgid "Can focus" msgstr "" -#: gtk/gtkwidget.c:608 +#: gtk/gtkwidget.c:628 msgid "Whether the widget can accept the input focus" msgstr "" -#: gtk/gtkwidget.c:614 +#: gtk/gtkwidget.c:634 msgid "Has focus" msgstr "" -#: gtk/gtkwidget.c:615 +#: gtk/gtkwidget.c:635 msgid "Whether the widget has the input focus" msgstr "" -#: gtk/gtkwidget.c:621 +#: gtk/gtkwidget.c:641 msgid "Is focus" msgstr "" -#: gtk/gtkwidget.c:622 +#: gtk/gtkwidget.c:642 msgid "Whether the widget is the focus widget within the toplevel" msgstr "" -#: gtk/gtkwidget.c:628 +#: gtk/gtkwidget.c:648 msgid "Can default" msgstr "" -#: gtk/gtkwidget.c:629 +#: gtk/gtkwidget.c:649 msgid "Whether the widget can be the default widget" msgstr "" -#: gtk/gtkwidget.c:635 +#: gtk/gtkwidget.c:655 msgid "Has default" msgstr "" -#: gtk/gtkwidget.c:636 +#: gtk/gtkwidget.c:656 msgid "Whether the widget is the default widget" msgstr "" -#: gtk/gtkwidget.c:642 +#: gtk/gtkwidget.c:662 msgid "Receives default" msgstr "" -#: gtk/gtkwidget.c:643 +#: gtk/gtkwidget.c:663 msgid "If TRUE, the widget will receive the default action when it is focused" msgstr "" -#: gtk/gtkwidget.c:649 +#: gtk/gtkwidget.c:669 msgid "Composite child" msgstr "" -#: gtk/gtkwidget.c:650 +#: gtk/gtkwidget.c:670 msgid "Whether the widget is part of a composite widget" msgstr "" -#: gtk/gtkwidget.c:656 +#: gtk/gtkwidget.c:676 msgid "Style" msgstr "" -#: gtk/gtkwidget.c:657 +#: gtk/gtkwidget.c:677 msgid "" "The style of the widget, which contains information about how it will look " "(colors etc)" msgstr "" -#: gtk/gtkwidget.c:663 +#: gtk/gtkwidget.c:683 msgid "Events" msgstr "" -#: gtk/gtkwidget.c:664 +#: gtk/gtkwidget.c:684 msgid "The event mask that decides what kind of GdkEvents this widget gets" msgstr "" -#: gtk/gtkwidget.c:671 +#: gtk/gtkwidget.c:691 msgid "Extension events" msgstr "" -#: gtk/gtkwidget.c:672 +#: gtk/gtkwidget.c:692 msgid "The mask that decides what kind of extension events this widget gets" msgstr "" -#: gtk/gtkwidget.c:679 +#: gtk/gtkwidget.c:699 msgid "No show all" msgstr "" -#: gtk/gtkwidget.c:680 +#: gtk/gtkwidget.c:700 msgid "Whether gtk_widget_show_all() should not affect this widget" msgstr "" -#: gtk/gtkwidget.c:703 +#: gtk/gtkwidget.c:723 msgid "Whether this widget has a tooltip" msgstr "" -#: gtk/gtkwidget.c:759 +#: gtk/gtkwidget.c:779 #, fuzzy msgid "Window" msgstr "Éagþyrelcynn" -#: gtk/gtkwidget.c:760 +#: gtk/gtkwidget.c:780 msgid "The widget's window if it is realized" msgstr "" -#: gtk/gtkwidget.c:774 +#: gtk/gtkwidget.c:794 msgid "Double Buffered" msgstr "" -#: gtk/gtkwidget.c:775 +#: gtk/gtkwidget.c:795 msgid "Whether or not the widget is double buffered" msgstr "" -#: gtk/gtkwidget.c:2403 +#: gtk/gtkwidget.c:2427 msgid "Interior Focus" msgstr "" -#: gtk/gtkwidget.c:2404 +#: gtk/gtkwidget.c:2428 msgid "Whether to draw the focus indicator inside widgets" msgstr "" -#: gtk/gtkwidget.c:2410 +#: gtk/gtkwidget.c:2434 msgid "Focus linewidth" msgstr "" -#: gtk/gtkwidget.c:2411 +#: gtk/gtkwidget.c:2435 msgid "Width, in pixels, of the focus indicator line" msgstr "" -#: gtk/gtkwidget.c:2417 +#: gtk/gtkwidget.c:2441 msgid "Focus line dash pattern" msgstr "" -#: gtk/gtkwidget.c:2418 +#: gtk/gtkwidget.c:2442 msgid "Dash pattern used to draw the focus indicator" msgstr "" -#: gtk/gtkwidget.c:2423 +#: gtk/gtkwidget.c:2447 msgid "Focus padding" msgstr "" -#: gtk/gtkwidget.c:2424 +#: gtk/gtkwidget.c:2448 msgid "Width, in pixels, between focus indicator and the widget 'box'" msgstr "" -#: gtk/gtkwidget.c:2429 +#: gtk/gtkwidget.c:2453 msgid "Cursor color" msgstr "" -#: gtk/gtkwidget.c:2430 +#: gtk/gtkwidget.c:2454 msgid "Color with which to draw insertion cursor" msgstr "" -#: gtk/gtkwidget.c:2435 +#: gtk/gtkwidget.c:2459 msgid "Secondary cursor color" msgstr "" -#: gtk/gtkwidget.c:2436 +#: gtk/gtkwidget.c:2460 msgid "" "Color with which to draw the secondary insertion cursor when editing mixed " "right-to-left and left-to-right text" msgstr "" -#: gtk/gtkwidget.c:2441 +#: gtk/gtkwidget.c:2465 msgid "Cursor line aspect ratio" msgstr "" -#: gtk/gtkwidget.c:2442 +#: gtk/gtkwidget.c:2466 msgid "Aspect ratio with which to draw insertion cursor" msgstr "" -#: gtk/gtkwidget.c:2456 +#: gtk/gtkwidget.c:2480 msgid "Draw Border" msgstr "" -#: gtk/gtkwidget.c:2457 +#: gtk/gtkwidget.c:2481 msgid "Size of areas outside the widget's allocation to draw" msgstr "" -#: gtk/gtkwidget.c:2470 +#: gtk/gtkwidget.c:2494 msgid "Unvisited Link Color" msgstr "" -#: gtk/gtkwidget.c:2471 +#: gtk/gtkwidget.c:2495 msgid "Color of unvisited links" msgstr "" -#: gtk/gtkwidget.c:2484 +#: gtk/gtkwidget.c:2508 msgid "Visited Link Color" msgstr "" -#: gtk/gtkwidget.c:2485 +#: gtk/gtkwidget.c:2509 msgid "Color of visited links" msgstr "" -#: gtk/gtkwidget.c:2499 +#: gtk/gtkwidget.c:2523 msgid "Wide Separators" msgstr "" -#: gtk/gtkwidget.c:2500 +#: gtk/gtkwidget.c:2524 msgid "" "Whether separators have configurable width and should be drawn using a box " "instead of a line" msgstr "" -#: gtk/gtkwidget.c:2514 +#: gtk/gtkwidget.c:2538 msgid "Separator Width" msgstr "" -#: gtk/gtkwidget.c:2515 +#: gtk/gtkwidget.c:2539 msgid "The width of separators if wide-separators is TRUE" msgstr "" -#: gtk/gtkwidget.c:2529 +#: gtk/gtkwidget.c:2553 msgid "Separator Height" msgstr "" -#: gtk/gtkwidget.c:2530 +#: gtk/gtkwidget.c:2554 msgid "The height of separators if \"wide-separators\" is TRUE" msgstr "" -#: gtk/gtkwidget.c:2544 +#: gtk/gtkwidget.c:2568 msgid "Horizontal Scroll Arrow Length" msgstr "" -#: gtk/gtkwidget.c:2545 +#: gtk/gtkwidget.c:2569 msgid "The length of horizontal scroll arrows" msgstr "" -#: gtk/gtkwidget.c:2559 +#: gtk/gtkwidget.c:2583 msgid "Vertical Scroll Arrow Length" msgstr "" -#: gtk/gtkwidget.c:2560 +#: gtk/gtkwidget.c:2584 msgid "The length of vertical scroll arrows" msgstr "" -#: gtk/gtkwindow.c:483 +#: gtk/gtkwindow.c:507 msgid "Window Type" msgstr "Éagþyrelcynn" -#: gtk/gtkwindow.c:484 +#: gtk/gtkwindow.c:508 msgid "The type of the window" msgstr "Þæt cynn þæs éagþyrles" -#: gtk/gtkwindow.c:492 +#: gtk/gtkwindow.c:516 msgid "Window Title" msgstr "" -#: gtk/gtkwindow.c:493 +#: gtk/gtkwindow.c:517 msgid "The title of the window" msgstr "" -#: gtk/gtkwindow.c:500 +#: gtk/gtkwindow.c:524 msgid "Window Role" msgstr "" -#: gtk/gtkwindow.c:501 +#: gtk/gtkwindow.c:525 msgid "Unique identifier for the window to be used when restoring a session" msgstr "" -#: gtk/gtkwindow.c:517 +#: gtk/gtkwindow.c:541 msgid "Startup ID" msgstr "" -#: gtk/gtkwindow.c:518 +#: gtk/gtkwindow.c:542 msgid "Unique startup identifier for the window used by startup-notification" msgstr "" -#: gtk/gtkwindow.c:525 +#: gtk/gtkwindow.c:549 msgid "Allow Shrink" msgstr "" -#: gtk/gtkwindow.c:527 +#: gtk/gtkwindow.c:551 #, no-c-format msgid "" "If TRUE, the window has no mimimum size. Setting this to TRUE is 99% of the " "time a bad idea" msgstr "" -#: gtk/gtkwindow.c:534 +#: gtk/gtkwindow.c:558 msgid "Allow Grow" msgstr "" -#: gtk/gtkwindow.c:535 +#: gtk/gtkwindow.c:559 msgid "If TRUE, users can expand the window beyond its minimum size" msgstr "" -#: gtk/gtkwindow.c:543 +#: gtk/gtkwindow.c:567 msgid "If TRUE, users can resize the window" msgstr "" -#: gtk/gtkwindow.c:550 +#: gtk/gtkwindow.c:574 msgid "Modal" msgstr "" -#: gtk/gtkwindow.c:551 +#: gtk/gtkwindow.c:575 msgid "" "If TRUE, the window is modal (other windows are not usable while this one is " "up)" msgstr "" -#: gtk/gtkwindow.c:558 +#: gtk/gtkwindow.c:582 msgid "Window Position" msgstr "" -#: gtk/gtkwindow.c:559 +#: gtk/gtkwindow.c:583 msgid "The initial position of the window" msgstr "" -#: gtk/gtkwindow.c:567 +#: gtk/gtkwindow.c:591 msgid "Default Width" msgstr "" -#: gtk/gtkwindow.c:568 +#: gtk/gtkwindow.c:592 msgid "The default width of the window, used when initially showing the window" msgstr "" -#: gtk/gtkwindow.c:577 +#: gtk/gtkwindow.c:601 msgid "Default Height" msgstr "" -#: gtk/gtkwindow.c:578 +#: gtk/gtkwindow.c:602 msgid "" "The default height of the window, used when initially showing the window" msgstr "" -#: gtk/gtkwindow.c:587 +#: gtk/gtkwindow.c:611 msgid "Destroy with Parent" msgstr "" -#: gtk/gtkwindow.c:588 +#: gtk/gtkwindow.c:612 msgid "If this window should be destroyed when the parent is destroyed" msgstr "" -#: gtk/gtkwindow.c:596 +#: gtk/gtkwindow.c:620 msgid "Icon for this window" msgstr "Segn þissum éagþyrle" -#: gtk/gtkwindow.c:602 +#: gtk/gtkwindow.c:626 msgid "Mnemonics Visible" msgstr "" -#: gtk/gtkwindow.c:603 +#: gtk/gtkwindow.c:627 msgid "Whether mnemonics are currently visible in this window" msgstr "" -#: gtk/gtkwindow.c:619 +#: gtk/gtkwindow.c:643 #, fuzzy msgid "Name of the themed icon for this window" msgstr "Segn þissum éagþyrle" -#: gtk/gtkwindow.c:634 +#: gtk/gtkwindow.c:658 msgid "Is Active" msgstr "" -#: gtk/gtkwindow.c:635 +#: gtk/gtkwindow.c:659 msgid "Whether the toplevel is the current active window" msgstr "" -#: gtk/gtkwindow.c:642 +#: gtk/gtkwindow.c:666 msgid "Focus in Toplevel" msgstr "" -#: gtk/gtkwindow.c:643 +#: gtk/gtkwindow.c:667 msgid "Whether the input focus is within this GtkWindow" msgstr "" -#: gtk/gtkwindow.c:650 +#: gtk/gtkwindow.c:674 msgid "Type hint" msgstr "" -#: gtk/gtkwindow.c:651 +#: gtk/gtkwindow.c:675 msgid "" "Hint to help the desktop environment understand what kind of window this is " "and how to treat it." msgstr "" -#: gtk/gtkwindow.c:659 +#: gtk/gtkwindow.c:683 msgid "Skip taskbar" msgstr "" -#: gtk/gtkwindow.c:660 +#: gtk/gtkwindow.c:684 msgid "TRUE if the window should not be in the task bar." msgstr "" -#: gtk/gtkwindow.c:667 +#: gtk/gtkwindow.c:691 msgid "Skip pager" msgstr "" -#: gtk/gtkwindow.c:668 +#: gtk/gtkwindow.c:692 msgid "TRUE if the window should not be in the pager." msgstr "" -#: gtk/gtkwindow.c:675 +#: gtk/gtkwindow.c:699 msgid "Urgent" msgstr "" -#: gtk/gtkwindow.c:676 +#: gtk/gtkwindow.c:700 msgid "TRUE if the window should be brought to the user's attention." msgstr "" -#: gtk/gtkwindow.c:690 +#: gtk/gtkwindow.c:714 msgid "Accept focus" msgstr "" -#: gtk/gtkwindow.c:691 +#: gtk/gtkwindow.c:715 msgid "TRUE if the window should receive the input focus." msgstr "" -#: gtk/gtkwindow.c:705 +#: gtk/gtkwindow.c:729 msgid "Focus on map" msgstr "" -#: gtk/gtkwindow.c:706 +#: gtk/gtkwindow.c:730 msgid "TRUE if the window should receive the input focus when mapped." msgstr "" -#: gtk/gtkwindow.c:720 +#: gtk/gtkwindow.c:744 msgid "Decorated" msgstr "" -#: gtk/gtkwindow.c:721 +#: gtk/gtkwindow.c:745 msgid "Whether the window should be decorated by the window manager" msgstr "" -#: gtk/gtkwindow.c:735 +#: gtk/gtkwindow.c:759 msgid "Deletable" msgstr "" -#: gtk/gtkwindow.c:736 +#: gtk/gtkwindow.c:760 msgid "Whether the window frame should have a close button" msgstr "" -#: gtk/gtkwindow.c:752 +#: gtk/gtkwindow.c:776 msgid "Gravity" msgstr "" -#: gtk/gtkwindow.c:753 +#: gtk/gtkwindow.c:777 msgid "The window gravity of the window" msgstr "" -#: gtk/gtkwindow.c:770 +#: gtk/gtkwindow.c:794 msgid "Transient for Window" msgstr "" -#: gtk/gtkwindow.c:771 +#: gtk/gtkwindow.c:795 #, fuzzy msgid "The transient parent of the dialog" msgstr "Þæt cynn þæs éagþyrles" -#: gtk/gtkwindow.c:786 +#: gtk/gtkwindow.c:810 msgid "Opacity for Window" msgstr "" -#: gtk/gtkwindow.c:787 +#: gtk/gtkwindow.c:811 #, fuzzy msgid "The opacity of the window, from 0 to 1" msgstr "Þæt cynn þæs éagþyrles" diff --git a/po-properties/ar.po b/po-properties/ar.po index 0237f82c2b..7cfc985755 100644 --- a/po-properties/ar.po +++ b/po-properties/ar.po @@ -12,7 +12,7 @@ msgid "" msgstr "" "Project-Id-Version: gtk+-properties.HEAD.ar\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-03-22 23:35-0400\n" +"POT-Creation-Date: 2010-05-25 20:10-0400\n" "PO-Revision-Date: 2008-09-18 02:19+0300\n" "Last-Translator: Anas Afif Emad \n" "Language-Team: Arabic \n" @@ -65,7 +65,7 @@ msgstr "بيتات لكل نموذج" msgid "The number of bits per sample" msgstr "عدد البيتات لكل نموذج" -#: gdk-pixbuf/gdk-pixbuf.c:132 gtk/gtklayout.c:633 gtk/gtktreeviewcolumn.c:208 +#: gdk-pixbuf/gdk-pixbuf.c:132 gtk/gtklayout.c:597 gtk/gtktreeviewcolumn.c:208 msgid "Width" msgstr "العرض" @@ -73,7 +73,7 @@ msgstr "العرض" msgid "The number of columns of the pixbuf" msgstr "عدد أعمدة البكسبف" -#: gdk-pixbuf/gdk-pixbuf.c:142 gtk/gtklayout.c:642 +#: gdk-pixbuf/gdk-pixbuf.c:142 gtk/gtklayout.c:606 msgid "Height" msgstr "الارتفاع" @@ -107,7 +107,7 @@ msgid "The default display for GDK" msgstr "شاشة GDK الافتراضية" #: gdk/gdkpango.c:538 gtk/gtkinvisible.c:86 gtk/gtkmountoperation.c:176 -#: gtk/gtkstatusicon.c:280 gtk/gtkwindow.c:626 +#: gtk/gtkstatusicon.c:285 gtk/gtkwindow.c:650 msgid "Screen" msgstr "شاشة" @@ -131,7 +131,7 @@ msgstr "ميز الخط" msgid "The resolution for fonts on the screen" msgstr "ميز الخطوط على الشاشة" -#: gdk/gdkwindow.c:496 gdk/gdkwindow.c:497 +#: gdk/gdkwindow.c:565 gdk/gdkwindow.c:566 #, fuzzy msgid "Cursor" msgstr "وميض المؤشر" @@ -249,100 +249,100 @@ msgstr "لف الرخصة" msgid "Whether to wrap the license text." msgstr "اذا كان يتم لف الرخصة" -#: gtk/gtkaccellabel.c:178 +#: gtk/gtkaccellabel.c:189 msgid "Accelerator Closure" msgstr "غلق المُسرّع" -#: gtk/gtkaccellabel.c:179 +#: gtk/gtkaccellabel.c:190 msgid "The closure to be monitored for accelerator changes" msgstr "المنهي الذي سيعرض لتغييرات مفتاح الإختصار" -#: gtk/gtkaccellabel.c:185 +#: gtk/gtkaccellabel.c:196 msgid "Accelerator Widget" msgstr "ودجة المُسرّع" -#: gtk/gtkaccellabel.c:186 +#: gtk/gtkaccellabel.c:197 msgid "The widget to be monitored for accelerator changes" msgstr "الودجة التي ستراقب لتغييرات مفاتيح الاختصار" -#: gtk/gtkaction.c:181 gtk/gtkactiongroup.c:170 gtk/gtkprinter.c:111 +#: gtk/gtkaction.c:220 gtk/gtkactiongroup.c:170 gtk/gtkprinter.c:130 #: gtk/gtktextmark.c:89 msgid "Name" msgstr "الاسم" -#: gtk/gtkaction.c:182 +#: gtk/gtkaction.c:221 msgid "A unique name for the action." msgstr "اسم متفرّد للعملية." -#: gtk/gtkaction.c:200 gtk/gtkbutton.c:219 gtk/gtkexpander.c:195 -#: gtk/gtkframe.c:105 gtk/gtklabel.c:506 gtk/gtkmenuitem.c:305 -#: gtk/gtktoolbutton.c:204 gtk/gtktoolitemgroup.c:1535 +#: gtk/gtkaction.c:239 gtk/gtkbutton.c:227 gtk/gtkexpander.c:195 +#: gtk/gtkframe.c:114 gtk/gtklabel.c:528 gtk/gtkmenuitem.c:305 +#: gtk/gtktoolbutton.c:204 gtk/gtktoolitemgroup.c:1543 msgid "Label" msgstr "عنوان" -#: gtk/gtkaction.c:201 +#: gtk/gtkaction.c:240 msgid "The label used for menu items and buttons that activate this action." msgstr "العنوان المستخدم لعناصر القوائم و الأزرار المشغلة لهذه العملية." -#: gtk/gtkaction.c:217 +#: gtk/gtkaction.c:256 msgid "Short label" msgstr "عنوان قصير" -#: gtk/gtkaction.c:218 +#: gtk/gtkaction.c:257 msgid "A shorter label that may be used on toolbar buttons." msgstr "عنوان اقصر يمكن استخدامه على أزرار أعمدة الأدوات." -#: gtk/gtkaction.c:226 +#: gtk/gtkaction.c:265 msgid "Tooltip" msgstr "تلميحة" -#: gtk/gtkaction.c:227 +#: gtk/gtkaction.c:266 msgid "A tooltip for this action." msgstr "تلميحة لهذه العملية." -#: gtk/gtkaction.c:242 +#: gtk/gtkaction.c:281 msgid "Stock Icon" msgstr "أيقونة من المخزون" -#: gtk/gtkaction.c:243 +#: gtk/gtkaction.c:282 msgid "The stock icon displayed in widgets representing this action." msgstr "أيقونة المخزون المعروضة في ودجات تمثل هذه العملية." -#: gtk/gtkaction.c:263 gtk/gtkstatusicon.c:253 +#: gtk/gtkaction.c:302 gtk/gtkstatusicon.c:258 msgid "GIcon" msgstr "أيقونة ج" -#: gtk/gtkaction.c:264 gtk/gtkcellrendererpixbuf.c:206 gtk/gtkimage.c:339 -#: gtk/gtkstatusicon.c:254 +#: gtk/gtkaction.c:303 gtk/gtkcellrendererpixbuf.c:206 gtk/gtkimage.c:344 +#: gtk/gtkstatusicon.c:259 msgid "The GIcon being displayed" msgstr "تم عرض GIcon" -#: gtk/gtkaction.c:284 gtk/gtkcellrendererpixbuf.c:171 gtk/gtkimage.c:321 -#: gtk/gtkprinter.c:160 gtk/gtkstatusicon.c:237 gtk/gtkwindow.c:618 +#: gtk/gtkaction.c:323 gtk/gtkcellrendererpixbuf.c:171 gtk/gtkimage.c:326 +#: gtk/gtkprinter.c:179 gtk/gtkstatusicon.c:242 gtk/gtkwindow.c:642 msgid "Icon Name" msgstr "اسم الأيقونة" -#: gtk/gtkaction.c:285 gtk/gtkcellrendererpixbuf.c:172 gtk/gtkimage.c:322 -#: gtk/gtkstatusicon.c:238 +#: gtk/gtkaction.c:324 gtk/gtkcellrendererpixbuf.c:172 gtk/gtkimage.c:327 +#: gtk/gtkstatusicon.c:243 msgid "The name of the icon from the icon theme" msgstr "اسم الايقونه من ايقونات النسق" -#: gtk/gtkaction.c:292 gtk/gtktoolitem.c:192 +#: gtk/gtkaction.c:331 gtk/gtktoolitem.c:185 msgid "Visible when horizontal" msgstr "مرئي عندما يكون افقي" -#: gtk/gtkaction.c:293 gtk/gtktoolitem.c:193 +#: gtk/gtkaction.c:332 gtk/gtktoolitem.c:186 msgid "" "Whether the toolbar item is visible when the toolbar is in a horizontal " "orientation." msgstr "" "فيما إذا سيكون عنصر عمود الأدوات مرئيا عندما يكون عمود الأدوات في اتجاه افقي." -#: gtk/gtkaction.c:308 +#: gtk/gtkaction.c:347 msgid "Visible when overflown" msgstr "مرئي عندما يكون فوقيا" -#: gtk/gtkaction.c:309 +#: gtk/gtkaction.c:348 msgid "" "When TRUE, toolitem proxies for this action are represented in the toolbar " "overflow menu." @@ -350,11 +350,11 @@ msgstr "" "عندما يكون TRUE، قوائم أدوات الوكيل لهذه العملية توضع في قائمة الأدوات " "الفائضة." -#: gtk/gtkaction.c:316 gtk/gtktoolitem.c:199 +#: gtk/gtkaction.c:355 gtk/gtktoolitem.c:192 msgid "Visible when vertical" msgstr "مرئي عندما يكون عمودي" -#: gtk/gtkaction.c:317 gtk/gtktoolitem.c:200 +#: gtk/gtkaction.c:356 gtk/gtktoolitem.c:193 msgid "" "Whether the toolbar item is visible when the toolbar is in a vertical " "orientation." @@ -362,11 +362,11 @@ msgstr "" "فيما إذا سيكون عنصر عمود الأدوات مرئيا عندما يكون عمود الأدوات في اتجاه " "عمودي." -#: gtk/gtkaction.c:324 gtk/gtktoolitem.c:206 +#: gtk/gtkaction.c:363 gtk/gtktoolitem.c:199 msgid "Is important" msgstr "مهم" -#: gtk/gtkaction.c:325 +#: gtk/gtkaction.c:364 msgid "" "Whether the action is considered important. When TRUE, toolitem proxies for " "this action show text in GTK_TOOLBAR_BOTH_HORIZ mode." @@ -374,47 +374,47 @@ msgstr "" "فيما إذا سيعتبر العمل مهما. عند صبطه لـ TRUE، ستعرض بروكسيات عنصر الأدات " "لهذا العمل النص في نسق GTK_TOOLBAR_BOTH_HORIZ." -#: gtk/gtkaction.c:333 +#: gtk/gtkaction.c:372 msgid "Hide if empty" msgstr "اخفاء اذا كان فارغا" -#: gtk/gtkaction.c:334 +#: gtk/gtkaction.c:373 msgid "When TRUE, empty menu proxies for this action are hidden." msgstr "عندما يكون TRUE، تخفى قوائم البروكسي الفارغة لهذه العملية." -#: gtk/gtkaction.c:340 gtk/gtkactiongroup.c:177 gtk/gtkcellrenderer.c:193 -#: gtk/gtkwidget.c:593 +#: gtk/gtkaction.c:379 gtk/gtkactiongroup.c:177 gtk/gtkcellrenderer.c:193 +#: gtk/gtkwidget.c:613 msgid "Sensitive" msgstr "حساس" -#: gtk/gtkaction.c:341 +#: gtk/gtkaction.c:380 msgid "Whether the action is enabled." msgstr "فيما إذا كانت العملية مفعلة." -#: gtk/gtkaction.c:347 gtk/gtkactiongroup.c:184 gtk/gtkstatusicon.c:296 -#: gtk/gtktreeviewcolumn.c:192 gtk/gtkwidget.c:586 +#: gtk/gtkaction.c:386 gtk/gtkactiongroup.c:184 gtk/gtkstatusicon.c:301 +#: gtk/gtktreeviewcolumn.c:192 gtk/gtkwidget.c:606 msgid "Visible" msgstr "مرئي" -#: gtk/gtkaction.c:348 +#: gtk/gtkaction.c:387 msgid "Whether the action is visible." msgstr "فيما إذا كانت العملية مرئية." -#: gtk/gtkaction.c:354 +#: gtk/gtkaction.c:393 msgid "Action Group" msgstr "مجموعة العمليات" -#: gtk/gtkaction.c:355 +#: gtk/gtkaction.c:394 msgid "" "The GtkActionGroup this GtkAction is associated with, or NULL (for internal " "use)." msgstr "GtkActionGroup المربوط به GtkAction هذا أو NULL (للاستخدام الداخلي)" -#: gtk/gtkaction.c:373 gtk/gtkimagemenuitem.c:169 +#: gtk/gtkaction.c:412 gtk/gtkimagemenuitem.c:169 msgid "Always show image" msgstr "" -#: gtk/gtkaction.c:374 gtk/gtkimagemenuitem.c:170 +#: gtk/gtkaction.c:413 gtk/gtkimagemenuitem.c:170 #, fuzzy msgid "Whether the image will always be shown" msgstr "ما إذا كان الكائن ظاهرا" @@ -450,7 +450,7 @@ msgid "Whether to use the related actions appearance properties" msgstr "فيما اذا كان من الممكن انتقاء نص الشارة بالفأرة" #: gtk/gtkadjustment.c:93 gtk/gtkcellrendererprogress.c:128 -#: gtk/gtkscalebutton.c:206 gtk/gtkspinbutton.c:269 +#: gtk/gtkscalebutton.c:222 gtk/gtkspinbutton.c:269 msgid "Value" msgstr "القيمة" @@ -498,11 +498,11 @@ msgstr "حجم الصفحة" msgid "The page size of the adjustment" msgstr "حجم الصفحة عند التسوية" -#: gtk/gtkalignment.c:90 +#: gtk/gtkalignment.c:117 msgid "Horizontal alignment" msgstr "ترصيف أفقي" -#: gtk/gtkalignment.c:91 gtk/gtkbutton.c:270 +#: gtk/gtkalignment.c:118 gtk/gtkbutton.c:278 msgid "" "Horizontal position of child in available space. 0.0 is left aligned, 1.0 is " "right aligned" @@ -510,11 +510,11 @@ msgstr "" "الموقع الأفقي للابن في المساحة المتاحة، ترصيف أيسر عندما يكون 0.0 و ترصيف " "أيمن عندما يكون 1.0" -#: gtk/gtkalignment.c:100 +#: gtk/gtkalignment.c:127 msgid "Vertical alignment" msgstr "ترصيف عمودي" -#: gtk/gtkalignment.c:101 gtk/gtkbutton.c:289 +#: gtk/gtkalignment.c:128 gtk/gtkbutton.c:297 msgid "" "Vertical position of child in available space. 0.0 is top aligned, 1.0 is " "bottom aligned" @@ -522,11 +522,11 @@ msgstr "" "الموقع العمودي للابن في المساحة المتاحة، ترصيف للأعلى عندما يكون 0.0 و ترصيف " "للأسفل عندما يكون 1.0" -#: gtk/gtkalignment.c:109 +#: gtk/gtkalignment.c:136 msgid "Horizontal scale" msgstr "قياس أفقي" -#: gtk/gtkalignment.c:110 +#: gtk/gtkalignment.c:137 msgid "" "If available horizontal space is bigger than needed for the child, how much " "of it to use for the child. 0.0 means none, 1.0 means all" @@ -534,11 +534,11 @@ msgstr "" "إذا كان الفراغ الأفقي المتوفر أكبر من الذي يطلبه الإبن، فكم سيستخدم منه " "للإبن. 0.0·يعني لا شيء و 1.0 الكل" -#: gtk/gtkalignment.c:118 +#: gtk/gtkalignment.c:145 msgid "Vertical scale" msgstr "قياس عمودي" -#: gtk/gtkalignment.c:119 +#: gtk/gtkalignment.c:146 msgid "" "If available vertical space is bigger than needed for the child, how much of " "it to use for the child. 0.0 means none, 1.0 means all" @@ -546,187 +546,187 @@ msgstr "" "إذا·كان·الفراغ·العمودي·المتوفر··أكبر·من·الذي·يطلبه·الإبن،·فكم·سيستخدم·منه·للإبن." "·0.0 يعني·لا·شيء·و·1.0·الكل" -#: gtk/gtkalignment.c:136 +#: gtk/gtkalignment.c:163 msgid "Top Padding" msgstr "الحشو الأعلى" -#: gtk/gtkalignment.c:137 +#: gtk/gtkalignment.c:164 msgid "The padding to insert at the top of the widget." msgstr "الحشو الذي سيدخل في أعلى الودجة." -#: gtk/gtkalignment.c:153 +#: gtk/gtkalignment.c:180 msgid "Bottom Padding" msgstr "الحشو الأسفل" -#: gtk/gtkalignment.c:154 +#: gtk/gtkalignment.c:181 msgid "The padding to insert at the bottom of the widget." msgstr "الحشو الذي سيدخل في أسفل الودجة." -#: gtk/gtkalignment.c:170 +#: gtk/gtkalignment.c:197 msgid "Left Padding" msgstr "الحشو الأيسر" -#: gtk/gtkalignment.c:171 +#: gtk/gtkalignment.c:198 msgid "The padding to insert at the left of the widget." msgstr "الحشو الذي سيدخل عند يسار الودجة" -#: gtk/gtkalignment.c:187 +#: gtk/gtkalignment.c:214 msgid "Right Padding" msgstr "الحشو الأيمن" -#: gtk/gtkalignment.c:188 +#: gtk/gtkalignment.c:215 msgid "The padding to insert at the right of the widget." msgstr "الحشو·الذي·سيدخل·على·يمين·الودجة" -#: gtk/gtkarrow.c:75 +#: gtk/gtkarrow.c:95 msgid "Arrow direction" msgstr "اتجاه السهم" -#: gtk/gtkarrow.c:76 +#: gtk/gtkarrow.c:96 msgid "The direction the arrow should point" msgstr "اتجاه تأشير السهم" -#: gtk/gtkarrow.c:84 +#: gtk/gtkarrow.c:104 msgid "Arrow shadow" msgstr "ظل السهم" -#: gtk/gtkarrow.c:85 +#: gtk/gtkarrow.c:105 msgid "Appearance of the shadow surrounding the arrow" msgstr "مظهر الظل المحيط بالسهم" -#: gtk/gtkarrow.c:92 gtk/gtkmenu.c:711 gtk/gtkmenuitem.c:368 +#: gtk/gtkarrow.c:112 gtk/gtkmenu.c:718 gtk/gtkmenuitem.c:368 msgid "Arrow Scaling" msgstr "مباعدة الأسهم" -#: gtk/gtkarrow.c:93 +#: gtk/gtkarrow.c:113 msgid "Amount of space used up by arrow" msgstr "كمية الفضاء المستخدم من طرف السهم" -#: gtk/gtkaspectframe.c:79 +#: gtk/gtkaspectframe.c:93 msgid "Horizontal Alignment" msgstr "الترصيف الأفقي" -#: gtk/gtkaspectframe.c:80 +#: gtk/gtkaspectframe.c:94 msgid "X alignment of the child" msgstr "ترصيف س للابن" -#: gtk/gtkaspectframe.c:86 +#: gtk/gtkaspectframe.c:100 msgid "Vertical Alignment" msgstr "الترصيف العمودي" -#: gtk/gtkaspectframe.c:87 +#: gtk/gtkaspectframe.c:101 msgid "Y alignment of the child" msgstr "ترصيف ص للابن" -#: gtk/gtkaspectframe.c:93 +#: gtk/gtkaspectframe.c:107 msgid "Ratio" msgstr "النسبة" -#: gtk/gtkaspectframe.c:94 +#: gtk/gtkaspectframe.c:108 msgid "Aspect ratio if obey_child is FALSE" msgstr "نسبة الإشعاع إذا كان obey_child مضبوطا لـ FALSE" -#: gtk/gtkaspectframe.c:100 +#: gtk/gtkaspectframe.c:114 msgid "Obey child" msgstr "ابن مطيع" -#: gtk/gtkaspectframe.c:101 +#: gtk/gtkaspectframe.c:115 msgid "Force aspect ratio to match that of the frame's child" msgstr "فرض نسبة الإشعاع حتى تناسب نسبة إطار الإبن" -#: gtk/gtkassistant.c:284 +#: gtk/gtkassistant.c:306 msgid "Header Padding" msgstr "حشو الرأس" -#: gtk/gtkassistant.c:285 +#: gtk/gtkassistant.c:307 msgid "Number of pixels around the header." msgstr "عدد البكسلات حول العنوان." -#: gtk/gtkassistant.c:292 +#: gtk/gtkassistant.c:314 msgid "Content Padding" msgstr "حشو المحتوى" -#: gtk/gtkassistant.c:293 +#: gtk/gtkassistant.c:315 msgid "Number of pixels around the content pages." msgstr "عدد البكسلات حول محتويات الصفحات" -#: gtk/gtkassistant.c:309 +#: gtk/gtkassistant.c:331 msgid "Page type" msgstr "نوع الصفحة" -#: gtk/gtkassistant.c:310 +#: gtk/gtkassistant.c:332 msgid "The type of the assistant page" msgstr "نوع الصفحة المساعدة" -#: gtk/gtkassistant.c:327 +#: gtk/gtkassistant.c:349 msgid "Page title" msgstr "عنوان الصفحة" -#: gtk/gtkassistant.c:328 +#: gtk/gtkassistant.c:350 msgid "The title of the assistant page" msgstr "عنوان الصورة المعاونة" -#: gtk/gtkassistant.c:344 +#: gtk/gtkassistant.c:366 msgid "Header image" msgstr "صورة الرأس" -#: gtk/gtkassistant.c:345 +#: gtk/gtkassistant.c:367 msgid "Header image for the assistant page" msgstr "الصورة الرأسية للصفحة المساعدة" -#: gtk/gtkassistant.c:361 +#: gtk/gtkassistant.c:383 msgid "Sidebar image" msgstr "الصورة الجانبية" -#: gtk/gtkassistant.c:362 +#: gtk/gtkassistant.c:384 msgid "Sidebar image for the assistant page" msgstr "الصورة الجانبية للصفحة المساعدة" -#: gtk/gtkassistant.c:377 +#: gtk/gtkassistant.c:399 msgid "Page complete" msgstr "صفحة كاملة" -#: gtk/gtkassistant.c:378 +#: gtk/gtkassistant.c:400 msgid "Whether all required fields on the page have been filled out" msgstr "إذا تم ملأ كل المجالات المطلوبة على الصفحة" -#: gtk/gtkbbox.c:101 +#: gtk/gtkbbox.c:129 msgid "Minimum child width" msgstr "عرض الابن الادنى" -#: gtk/gtkbbox.c:102 +#: gtk/gtkbbox.c:130 msgid "Minimum width of buttons inside the box" msgstr "عرض الأزرار الأدنى داخل الصندوق" -#: gtk/gtkbbox.c:110 +#: gtk/gtkbbox.c:138 msgid "Minimum child height" msgstr "ارتفاع الابن الادنى" -#: gtk/gtkbbox.c:111 +#: gtk/gtkbbox.c:139 msgid "Minimum height of buttons inside the box" msgstr "ارتفاع الأزرار الأدنى داخل الصندوق" -#: gtk/gtkbbox.c:119 +#: gtk/gtkbbox.c:147 msgid "Child internal width padding" msgstr "حشو العرض الداخلي للابن" -#: gtk/gtkbbox.c:120 +#: gtk/gtkbbox.c:148 msgid "Amount to increase child's size on either side" msgstr "مقدار زيادة حجم الابن في كلا الجانبين" -#: gtk/gtkbbox.c:128 +#: gtk/gtkbbox.c:156 msgid "Child internal height padding" msgstr "حشو الارتفاع الداخلي للابن" -#: gtk/gtkbbox.c:129 +#: gtk/gtkbbox.c:157 msgid "Amount to increase child's size on the top and bottom" msgstr "مقدار زيادة حجم الابن في الأعلى والأسفل" -#: gtk/gtkbbox.c:137 +#: gtk/gtkbbox.c:165 msgid "Layout style" msgstr "نمط التخطيط" -#: gtk/gtkbbox.c:138 +#: gtk/gtkbbox.c:166 msgid "" "How to layout the buttons in the box. Possible values are default, spread, " "edge, start and end" @@ -734,11 +734,11 @@ msgstr "" "كيفية تخطيط الأزرار في الصندوق. القيم الممكنة هي افتراضا، انتشرا، حافة، بدء " "و، نهاية" -#: gtk/gtkbbox.c:146 +#: gtk/gtkbbox.c:174 msgid "Secondary" msgstr "ثانوي" -#: gtk/gtkbbox.c:147 +#: gtk/gtkbbox.c:175 msgid "" "If TRUE, the child appears in a secondary group of children, suitable for, e." "g., help buttons" @@ -746,91 +746,90 @@ msgstr "" "إذا كان TRUE، فسيبدو الابن في مجموعة ثانوية للأبناء، مناسبة لأزرار المساعدة " "مثلا." -#: gtk/gtkbox.c:130 gtk/gtkexpander.c:219 gtk/gtkiconview.c:665 +#: gtk/gtkbox.c:217 gtk/gtkexpander.c:219 gtk/gtkiconview.c:667 #: gtk/gtktreeviewcolumn.c:217 msgid "Spacing" msgstr "فراغات" -#: gtk/gtkbox.c:131 +#: gtk/gtkbox.c:218 msgid "The amount of space between children" msgstr "مقدار الفراغ بين الأبناء." -#: gtk/gtkbox.c:140 gtk/gtknotebook.c:657 gtk/gtktable.c:165 -#: gtk/gtktoolbar.c:573 gtk/gtktoolitemgroup.c:1588 +#: gtk/gtkbox.c:227 gtk/gtktable.c:165 gtk/gtktoolbar.c:518 +#: gtk/gtktoolitemgroup.c:1596 msgid "Homogeneous" msgstr "متناسق" -#: gtk/gtkbox.c:141 +#: gtk/gtkbox.c:228 msgid "Whether the children should all be the same size" msgstr "ما إذا سيكون كل الأبناء بنفس الحجم" -#: gtk/gtkbox.c:148 gtk/gtkpreview.c:101 gtk/gtktoolbar.c:565 -#: gtk/gtktoolitemgroup.c:1595 gtk/gtktoolpalette.c:1052 -#: gtk/gtktreeviewcolumn.c:273 +#: gtk/gtkbox.c:235 gtk/gtktoolbar.c:510 gtk/gtktoolitemgroup.c:1603 +#: gtk/gtktoolpalette.c:1053 gtk/gtktreeviewcolumn.c:273 msgid "Expand" msgstr "تمديد" -#: gtk/gtkbox.c:149 +#: gtk/gtkbox.c:236 msgid "Whether the child should receive extra space when the parent grows" msgstr "فيما إذا وجب أن يتلقى الإبن فضاءا أكبر عند نمو أبيه" -#: gtk/gtkbox.c:155 gtk/gtktoolitemgroup.c:1602 +#: gtk/gtkbox.c:242 gtk/gtktoolitemgroup.c:1610 msgid "Fill" msgstr "ملأ" -#: gtk/gtkbox.c:156 +#: gtk/gtkbox.c:243 msgid "" "Whether extra space given to the child should be allocated to the child or " "used as padding" msgstr "فيما إذا يجب تخصيص الفضاء الإضافي للإبن للإبن نفسه أو كحشو" -#: gtk/gtkbox.c:162 +#: gtk/gtkbox.c:249 gtk/gtktrayicon-x11.c:163 msgid "Padding" msgstr "حشو" -#: gtk/gtkbox.c:163 +#: gtk/gtkbox.c:250 msgid "Extra space to put between the child and its neighbors, in pixels" msgstr "الفضاء الإضافي لوضعه بين الإبن و جيرانه، بالبكسلات" -#: gtk/gtkbox.c:169 +#: gtk/gtkbox.c:256 msgid "Pack type" msgstr "نوع التحزيم" -#: gtk/gtkbox.c:170 gtk/gtknotebook.c:724 +#: gtk/gtkbox.c:257 gtk/gtknotebook.c:667 msgid "" "A GtkPackType indicating whether the child is packed with reference to the " "start or end of the parent" msgstr "GtkPackType مؤشر لما إذا سيحزم الإبن بمرجع لبداية أو نهاية الأب" -#: gtk/gtkbox.c:176 gtk/gtknotebook.c:702 gtk/gtkpaned.c:241 -#: gtk/gtkruler.c:148 gtk/gtktoolitemgroup.c:1616 +#: gtk/gtkbox.c:263 gtk/gtknotebook.c:645 gtk/gtkpaned.c:242 +#: gtk/gtkruler.c:148 gtk/gtktoolitemgroup.c:1624 msgid "Position" msgstr "الموقع" -#: gtk/gtkbox.c:177 gtk/gtknotebook.c:703 +#: gtk/gtkbox.c:264 gtk/gtknotebook.c:646 msgid "The index of the child in the parent" msgstr "فهرس الإبن عند الأب" -#: gtk/gtkbuilder.c:96 +#: gtk/gtkbuilder.c:314 msgid "Translation Domain" msgstr "نطاق الترجمة" -#: gtk/gtkbuilder.c:97 +#: gtk/gtkbuilder.c:315 msgid "The translation domain used by gettext" msgstr "مجال الترجمة المستعمل من طرف gettext" -#: gtk/gtkbutton.c:220 +#: gtk/gtkbutton.c:228 msgid "" "Text of the label widget inside the button, if the button contains a label " "widget" msgstr "نص ودجة الشارة داخل الزر، إذا كان الزر يحوي كائن شارة" -#: gtk/gtkbutton.c:227 gtk/gtkexpander.c:203 gtk/gtklabel.c:527 +#: gtk/gtkbutton.c:235 gtk/gtkexpander.c:203 gtk/gtklabel.c:549 #: gtk/gtkmenuitem.c:320 gtk/gtktoolbutton.c:211 msgid "Use underline" msgstr "استخدام التسطير" -#: gtk/gtkbutton.c:228 gtk/gtkexpander.c:204 gtk/gtklabel.c:528 +#: gtk/gtkbutton.c:236 gtk/gtkexpander.c:204 gtk/gtklabel.c:550 #: gtk/gtkmenuitem.c:321 msgid "" "If set, an underline in the text indicates the next character should be used " @@ -839,124 +838,124 @@ msgstr "" "إذا ضبط، فسيكون هناك تسطير في النص يشير إلى الرمز التالي الذي يجب استخدامه " "كرمز مسطر لمفتاح الاختصار" -#: gtk/gtkbutton.c:235 gtk/gtkimagemenuitem.c:150 +#: gtk/gtkbutton.c:243 gtk/gtkimagemenuitem.c:150 msgid "Use stock" msgstr "مخزن المستخدم" -#: gtk/gtkbutton.c:236 +#: gtk/gtkbutton.c:244 msgid "" "If set, the label is used to pick a stock item instead of being displayed" msgstr "إذا ضبط، فستستخدم العلامة لاختيار عنصر مخزن بدل عرضها" -#: gtk/gtkbutton.c:243 gtk/gtkcombobox.c:796 gtk/gtkfilechooserbutton.c:393 +#: gtk/gtkbutton.c:251 gtk/gtkcombobox.c:799 gtk/gtkfilechooserbutton.c:393 msgid "Focus on click" msgstr "تركيز عند النقر" -#: gtk/gtkbutton.c:244 gtk/gtkfilechooserbutton.c:394 +#: gtk/gtkbutton.c:252 gtk/gtkfilechooserbutton.c:394 msgid "Whether the button grabs focus when it is clicked with the mouse" msgstr "فيما إذا سيقبض الزر التركيز عند نقره بالفأرة" -#: gtk/gtkbutton.c:251 +#: gtk/gtkbutton.c:259 msgid "Border relief" msgstr "نحت الحد" -#: gtk/gtkbutton.c:252 +#: gtk/gtkbutton.c:260 msgid "The border relief style" msgstr "أسلوب نحت الحد" -#: gtk/gtkbutton.c:269 +#: gtk/gtkbutton.c:277 msgid "Horizontal alignment for child" msgstr "الترصيف الأفقي للإبن" -#: gtk/gtkbutton.c:288 +#: gtk/gtkbutton.c:296 msgid "Vertical alignment for child" msgstr "الترصيف العمودي للإبن" -#: gtk/gtkbutton.c:305 gtk/gtkimagemenuitem.c:135 +#: gtk/gtkbutton.c:313 gtk/gtkimagemenuitem.c:135 msgid "Image widget" msgstr "ودجة صورة" -#: gtk/gtkbutton.c:306 +#: gtk/gtkbutton.c:314 msgid "Child widget to appear next to the button text" msgstr "الودجة الابن التي ستظهر إلى جانب نص الزر" -#: gtk/gtkbutton.c:320 +#: gtk/gtkbutton.c:328 msgid "Image position" msgstr "موقع الصورة" -#: gtk/gtkbutton.c:321 +#: gtk/gtkbutton.c:329 msgid "The position of the image relative to the text" msgstr "موقع الصورة بالنسبة للنص" -#: gtk/gtkbutton.c:441 +#: gtk/gtkbutton.c:449 msgid "Default Spacing" msgstr "المباعدة الافتراضية" -#: gtk/gtkbutton.c:442 +#: gtk/gtkbutton.c:450 #, fuzzy msgid "Extra space to add for GTK_CAN_DEFAULT buttons" msgstr "الفراغ الإضافي للإضافة لأزرار CAN_DEFAULT" -#: gtk/gtkbutton.c:456 +#: gtk/gtkbutton.c:464 msgid "Default Outside Spacing" msgstr "الفراغات الخارجية الافتراضية" -#: gtk/gtkbutton.c:457 +#: gtk/gtkbutton.c:465 #, fuzzy msgid "" "Extra space to add for GTK_CAN_DEFAULT buttons that is always drawn outside " "the border" msgstr "الفراغ الإضافي للإضافة لأزرار CAN_DEFAULT الذي يرسم دائمًا خارج الحد" -#: gtk/gtkbutton.c:462 +#: gtk/gtkbutton.c:470 msgid "Child X Displacement" msgstr "إزاحة الابن في س" -#: gtk/gtkbutton.c:463 +#: gtk/gtkbutton.c:471 msgid "" "How far in the x direction to move the child when the button is depressed" msgstr "مقدار نقل الابن في اتجاه س اثر تحرير الزر" -#: gtk/gtkbutton.c:470 +#: gtk/gtkbutton.c:478 msgid "Child Y Displacement" msgstr "إزاحة الابن في ص" -#: gtk/gtkbutton.c:471 +#: gtk/gtkbutton.c:479 msgid "" "How far in the y direction to move the child when the button is depressed" msgstr "مقدار نقل الابن في اتجاه ص اثر تحرير الزر" -#: gtk/gtkbutton.c:487 +#: gtk/gtkbutton.c:495 msgid "Displace focus" msgstr "إزاحة التركيز" -#: gtk/gtkbutton.c:488 +#: gtk/gtkbutton.c:496 msgid "" "Whether the child_displacement_x/_y properties should also affect the focus " "rectangle" msgstr "إذا كانت خصائص child_displacement_x/_y تؤثر أيضا عل مستطيل التركيز" -#: gtk/gtkbutton.c:501 gtk/gtkentry.c:695 gtk/gtkentry.c:1740 +#: gtk/gtkbutton.c:509 gtk/gtkentry.c:697 gtk/gtkentry.c:1742 msgid "Inner Border" msgstr "الحد الداخلي" -#: gtk/gtkbutton.c:502 +#: gtk/gtkbutton.c:510 msgid "Border between button edges and child." msgstr "الحد بين اطراف الزر والطفل." -#: gtk/gtkbutton.c:515 +#: gtk/gtkbutton.c:523 msgid "Image spacing" msgstr "تَبَاعُد الصور" -#: gtk/gtkbutton.c:516 +#: gtk/gtkbutton.c:524 msgid "Spacing in pixels between the image and label" msgstr "الفضاء بين الصورة و العنوان بالبكسل." -#: gtk/gtkbutton.c:530 +#: gtk/gtkbutton.c:538 msgid "Show button images" msgstr "إظهار صور الأزرار" -#: gtk/gtkbutton.c:531 +#: gtk/gtkbutton.c:539 msgid "Whether images should be shown on buttons" msgstr "فيما إذا كان سيتم إظهار صور على الأزرار" @@ -1042,12 +1041,12 @@ msgstr "اظهر التفاصيل" msgid "If TRUE, details are shown" msgstr "إذا كان \"صحيح\"، ستعرض التفاصيل" -#: gtk/gtkcelleditable.c:76 +#: gtk/gtkcelleditable.c:43 #, fuzzy msgid "Editing Canceled" msgstr "أُلغيت" -#: gtk/gtkcelleditable.c:77 +#: gtk/gtkcelleditable.c:44 msgid "Indicates that editing has been canceled" msgstr "" @@ -1167,35 +1166,35 @@ msgstr "ضبط خلفية الخلية" msgid "Whether this tag affects the cell background color" msgstr "فيما إذا كانت هذه الشارة تؤثر في لون خلفية الخلية" -#: gtk/gtkcellrendereraccel.c:114 +#: gtk/gtkcellrendereraccel.c:124 msgid "Accelerator key" msgstr "مفتاح التسريع" -#: gtk/gtkcellrendereraccel.c:115 +#: gtk/gtkcellrendereraccel.c:125 msgid "The keyval of the accelerator" msgstr "زر المسرّع" -#: gtk/gtkcellrendereraccel.c:131 +#: gtk/gtkcellrendereraccel.c:141 msgid "Accelerator modifiers" msgstr "مغيرات المُسرّع" -#: gtk/gtkcellrendereraccel.c:132 +#: gtk/gtkcellrendereraccel.c:142 msgid "The modifier mask of the accelerator" msgstr "قناع التغير للمسرّع" -#: gtk/gtkcellrendereraccel.c:149 +#: gtk/gtkcellrendereraccel.c:159 msgid "Accelerator keycode" msgstr "رمز مفتاح المُسرّع" -#: gtk/gtkcellrendereraccel.c:150 +#: gtk/gtkcellrendereraccel.c:160 msgid "The hardware keycode of the accelerator" msgstr "شفرة المسرّع" -#: gtk/gtkcellrendereraccel.c:169 +#: gtk/gtkcellrendereraccel.c:179 msgid "Accelerator Mode" msgstr "نمط المُسرّع" -#: gtk/gtkcellrendereraccel.c:170 +#: gtk/gtkcellrendereraccel.c:180 msgid "The type of accelerators" msgstr "نوع المسرّعات" @@ -1247,7 +1246,7 @@ msgstr "موسع·مغلق·للبيكسبف" msgid "Pixbuf for closed expander" msgstr "بيكسبف الموسع المغلق." -#: gtk/gtkcellrendererpixbuf.c:135 gtk/gtkimage.c:263 gtk/gtkstatusicon.c:229 +#: gtk/gtkcellrendererpixbuf.c:135 gtk/gtkimage.c:268 gtk/gtkstatusicon.c:234 msgid "Stock ID" msgstr "هوية المخزون" @@ -1256,7 +1255,7 @@ msgid "The stock ID of the stock icon to render" msgstr "هوية المخزون لأيقونة المخزون التي ستترجم" #: gtk/gtkcellrendererpixbuf.c:143 gtk/gtkcellrendererspinner.c:158 -#: gtk/gtkrecentmanager.c:245 gtk/gtkstatusicon.c:270 +#: gtk/gtkrecentmanager.c:245 gtk/gtkstatusicon.c:275 msgid "Size" msgstr "الحجم" @@ -1280,7 +1279,7 @@ msgstr "اتبع الحالة" msgid "Whether the rendered pixbuf should be colorized according to the state" msgstr "فيما إذا كان يتم تلوين pixbuf المرسوم حسب الحالة" -#: gtk/gtkcellrendererpixbuf.c:205 gtk/gtkimage.c:338 gtk/gtkwindow.c:595 +#: gtk/gtkcellrendererpixbuf.c:205 gtk/gtkimage.c:343 gtk/gtkwindow.c:619 msgid "Icon" msgstr "أيقونة" @@ -1289,8 +1288,8 @@ msgid "Value of the progress bar" msgstr "قيمة شريط التَّقدم" #: gtk/gtkcellrendererprogress.c:146 gtk/gtkcellrenderertext.c:195 -#: gtk/gtkentry.c:738 gtk/gtkentrybuffer.c:353 gtk/gtkmessagedialog.c:153 -#: gtk/gtkprogressbar.c:184 gtk/gtktextbuffer.c:198 +#: gtk/gtkentry.c:740 gtk/gtkentrybuffer.c:353 gtk/gtkmessagedialog.c:200 +#: gtk/gtkprogressbar.c:137 gtk/gtktextbuffer.c:198 msgid "Text" msgstr "النص" @@ -1326,18 +1325,18 @@ msgstr "ترصيف ص للنص" msgid "The vertical text alignment, from 0 (top) to 1 (bottom)." msgstr "التنسيق العمودي، من 0 (فوق) إلى 1 (تحت)" -#: gtk/gtkcellrendererprogress.c:221 gtk/gtkiconview.c:729 -#: gtk/gtkorientable.c:74 gtk/gtkprogressbar.c:126 gtk/gtkstatusicon.c:328 -#: gtk/gtktrayicon-x11.c:110 +#: gtk/gtkcellrendererprogress.c:221 gtk/gtkiconview.c:731 +#: gtk/gtkorientable.c:63 gtk/gtkprogressbar.c:112 gtk/gtkstatusicon.c:333 +#: gtk/gtktrayicon-x11.c:122 msgid "Orientation" msgstr "الاتجاه" -#: gtk/gtkcellrendererprogress.c:222 gtk/gtkprogressbar.c:127 +#: gtk/gtkcellrendererprogress.c:222 gtk/gtkprogressbar.c:113 msgid "Orientation and growth direction of the progress bar" msgstr "إتجاه و وجهة نموّ همود التطوّر" -#: gtk/gtkcellrendererspin.c:93 gtk/gtkprogressbar.c:118 gtk/gtkrange.c:367 -#: gtk/gtkscalebutton.c:225 gtk/gtkspinbutton.c:208 +#: gtk/gtkcellrendererspin.c:93 gtk/gtkrange.c:394 gtk/gtkscalebutton.c:241 +#: gtk/gtkspinbutton.c:208 msgid "Adjustment" msgstr "الملائمة" @@ -1362,7 +1361,7 @@ msgid "The number of decimal places to display" msgstr "عدد الخانات العشرية لعرضها" #: gtk/gtkcellrendererspinner.c:124 gtk/gtkcheckmenuitem.c:98 -#: gtk/gtkmenu.c:501 gtk/gtkspinner.c:128 gtk/gtktoggleaction.c:119 +#: gtk/gtkmenu.c:508 gtk/gtkspinner.c:128 gtk/gtktoggleaction.c:130 #: gtk/gtktogglebutton.c:115 gtk/gtktoggletoolbutton.c:114 msgid "Active" msgstr "نشط" @@ -1394,7 +1393,7 @@ msgstr "تعليم" msgid "Marked up text to render" msgstr "نص معلّم للترجمة" -#: gtk/gtkcellrenderertext.c:211 gtk/gtklabel.c:513 +#: gtk/gtkcellrenderertext.c:211 gtk/gtklabel.c:535 msgid "Attributes" msgstr "الصفات" @@ -1435,6 +1434,7 @@ msgid "Foreground color as a string" msgstr "لون الواجهة الأمامية كسلسلة" #: gtk/gtkcellrenderertext.c:252 gtk/gtktexttag.c:225 +#: gtk/gtktrayicon-x11.c:131 msgid "Foreground color" msgstr "لون الواجهة الأمامية" @@ -1442,7 +1442,7 @@ msgstr "لون الواجهة الأمامية" msgid "Foreground color as a GdkColor" msgstr "لون الواجهة الأمامية كـ GdkColor" -#: gtk/gtkcellrenderertext.c:261 gtk/gtkentry.c:662 gtk/gtktexttag.c:251 +#: gtk/gtkcellrenderertext.c:261 gtk/gtkentry.c:664 gtk/gtktexttag.c:251 #: gtk/gtktextview.c:577 msgid "Editable" msgstr "قابل للتحرير" @@ -1552,7 +1552,7 @@ msgstr "" "اللغة التي فيها هذا النص، كشفرة ISO. يمكن لبانكو إستعمال هذا كتلميحة عند رسم " "النص. إذا كنت لا تفهم هذا المتغيّر فأنك ربما لا تستحقّه" -#: gtk/gtkcellrenderertext.c:411 gtk/gtklabel.c:638 gtk/gtkprogressbar.c:206 +#: gtk/gtkcellrenderertext.c:411 gtk/gtklabel.c:660 gtk/gtkprogressbar.c:159 msgid "Ellipsize" msgstr "قص" @@ -1563,11 +1563,11 @@ msgid "" msgstr "المكان المفضل لقطع النص." #: gtk/gtkcellrenderertext.c:431 gtk/gtkfilechooserbutton.c:421 -#: gtk/gtklabel.c:658 +#: gtk/gtklabel.c:681 msgid "Width In Characters" msgstr "العرض بالحروف" -#: gtk/gtkcellrenderertext.c:432 gtk/gtklabel.c:659 +#: gtk/gtkcellrenderertext.c:432 gtk/gtklabel.c:682 msgid "The desired width of the label, in characters" msgstr "العرض المطلوب للعنوان بالمحارف" @@ -1582,7 +1582,7 @@ msgid "" msgstr "" "كيفية كسر النص الى سطور متعددة، إذا كان لا يوجد هناك فراغ كافٍ لكامل النص." -#: gtk/gtkcellrenderertext.c:470 gtk/gtkcombobox.c:685 +#: gtk/gtkcellrenderertext.c:470 gtk/gtkcombobox.c:688 msgid "Wrap width" msgstr "عرض اللف" @@ -1775,11 +1775,11 @@ msgstr "طراز CellView" msgid "The model for cell view" msgstr "نمط عرض الخلية" -#: gtk/gtkcheckbutton.c:69 gtk/gtkcheckmenuitem.c:121 gtk/gtkoptionmenu.c:168 +#: gtk/gtkcheckbutton.c:69 gtk/gtkcheckmenuitem.c:121 msgid "Indicator Size" msgstr "حجم المؤشر" -#: gtk/gtkcheckbutton.c:77 gtk/gtkexpander.c:245 gtk/gtkoptionmenu.c:174 +#: gtk/gtkcheckbutton.c:77 gtk/gtkexpander.c:245 msgid "Indicator Spacing" msgstr "فراغات المؤشر" @@ -1816,7 +1816,7 @@ msgid "Whether or not to give the color an alpha value" msgstr "فيما إذا سيمنح للون شفافية أم لا" #: gtk/gtkcolorbutton.c:186 gtk/gtkfilechooserbutton.c:407 -#: gtk/gtkfontbutton.c:142 gtk/gtkprintjob.c:116 gtk/gtkstatusicon.c:424 +#: gtk/gtkfontbutton.c:142 gtk/gtkprintjob.c:116 gtk/gtkstatusicon.c:429 #: gtk/gtktreeviewcolumn.c:265 msgid "Title" msgstr "العنوان" @@ -1825,7 +1825,7 @@ msgstr "العنوان" msgid "The title of the color selection dialog" msgstr "عنوان حوار انتقاء الألوان" -#: gtk/gtkcolorbutton.c:201 gtk/gtkcolorsel.c:293 +#: gtk/gtkcolorbutton.c:201 gtk/gtkcolorsel.c:295 msgid "Current Color" msgstr "اللون الحالي" @@ -1833,7 +1833,7 @@ msgstr "اللون الحالي" msgid "The selected color" msgstr "اللون المنتقى" -#: gtk/gtkcolorbutton.c:216 gtk/gtkcolorsel.c:300 +#: gtk/gtkcolorbutton.c:216 gtk/gtkcolorsel.c:302 msgid "Current Alpha" msgstr "الشفافية الحالية (قيمة ألفا الحالية)" @@ -1841,35 +1841,35 @@ msgstr "الشفافية الحالية (قيمة ألفا الحالية)" msgid "The selected opacity value (0 fully transparent, 65535 fully opaque)" msgstr "قيمة التعتيم الحالية (0 شفاف تمامًا, 65535 معتم تمامًا)" -#: gtk/gtkcolorsel.c:279 +#: gtk/gtkcolorsel.c:281 msgid "Has Opacity Control" msgstr "له متحكم تعتيم" -#: gtk/gtkcolorsel.c:280 +#: gtk/gtkcolorsel.c:282 msgid "Whether the color selector should allow setting opacity" msgstr "فيما اذا كان منتقي الألوان سيسمح بضبط التعتيم" -#: gtk/gtkcolorsel.c:286 +#: gtk/gtkcolorsel.c:288 msgid "Has palette" msgstr "له لوحة ألوان" -#: gtk/gtkcolorsel.c:287 +#: gtk/gtkcolorsel.c:289 msgid "Whether a palette should be used" msgstr "فيما اذا وجب استخدام لوحة ألوان" -#: gtk/gtkcolorsel.c:294 +#: gtk/gtkcolorsel.c:296 msgid "The current color" msgstr "اللون الحالي" -#: gtk/gtkcolorsel.c:301 +#: gtk/gtkcolorsel.c:303 msgid "The current opacity value (0 fully transparent, 65535 fully opaque)" msgstr "قيمة التعتيم الحالية (0 شفاف تمامًا, 65535 معتم تمامًا)" -#: gtk/gtkcolorsel.c:315 +#: gtk/gtkcolorsel.c:317 msgid "Custom palette" msgstr "لوحة الألوان الخاصة" -#: gtk/gtkcolorsel.c:316 +#: gtk/gtkcolorsel.c:318 msgid "Palette to use in the color selector" msgstr "لوحة الألوان التي ستستخدم في منتقي الألوان" @@ -1905,153 +1905,113 @@ msgstr "زر مساعدة" msgid "The help button of the dialog." msgstr "زر المساعدة في مربع الحوار" -#: gtk/gtkcombo.c:145 -msgid "Enable arrow keys" -msgstr "تفعيل مفاتيح الأسهم" - -#: gtk/gtkcombo.c:146 -msgid "Whether the arrow keys move through the list of items" -msgstr "إن كانت مفاتيح الأسهم تتنقل خلال قائمة العناصر" - -#: gtk/gtkcombo.c:152 -msgid "Always enable arrows" -msgstr "تفعيل الأسهم دائما" - -#: gtk/gtkcombo.c:153 -msgid "Obsolete property, ignored" -msgstr "خاصية باطلة، تجاهل" - -#: gtk/gtkcombo.c:159 -msgid "Case sensitive" -msgstr "حساس للحالة" - -#: gtk/gtkcombo.c:160 -msgid "Whether list item matching is case sensitive" -msgstr "فيما إذا كان تطابق عناصر القائمة حساس للحالة" - -#: gtk/gtkcombo.c:167 -msgid "Allow empty" -msgstr "السماح بالفراغ" - -#: gtk/gtkcombo.c:168 -msgid "Whether an empty value may be entered in this field" -msgstr "فيما اذا كان من الممكن إدخال قيمة فارغة في هذا الحقل" - -#: gtk/gtkcombo.c:175 -msgid "Value in list" -msgstr "القيمة في القائمة" - -#: gtk/gtkcombo.c:176 -msgid "Whether entered values must already be present in the list" -msgstr "فيما إذا وجب على القيم المدخلة أن تكون موجودةً في القائمة" - -#: gtk/gtkcombobox.c:668 +#: gtk/gtkcombobox.c:671 msgid "ComboBox model" msgstr "نموذج ComboBox" -#: gtk/gtkcombobox.c:669 +#: gtk/gtkcombobox.c:672 msgid "The model for the combo box" msgstr "نموذج لصندوق المجموعات" -#: gtk/gtkcombobox.c:686 +#: gtk/gtkcombobox.c:689 msgid "Wrap width for laying out the items in a grid" msgstr "عرض اللف عند تصميم العناصر في الشبكة" -#: gtk/gtkcombobox.c:708 +#: gtk/gtkcombobox.c:711 msgid "Row span column" msgstr "عمود إمتداد السطر" -#: gtk/gtkcombobox.c:709 +#: gtk/gtkcombobox.c:712 msgid "TreeModel column containing the row span values" msgstr "عمود نموذج الشجرة المحتوي على قيم إمتداد السطر" -#: gtk/gtkcombobox.c:730 +#: gtk/gtkcombobox.c:733 msgid "Column span column" msgstr "عمود إمتداد العمود" -#: gtk/gtkcombobox.c:731 +#: gtk/gtkcombobox.c:734 msgid "TreeModel column containing the column span values" msgstr "عمود TreeModel الحاوي لقيم مدى العمود" -#: gtk/gtkcombobox.c:752 +#: gtk/gtkcombobox.c:755 msgid "Active item" msgstr "العنصر النشط" -#: gtk/gtkcombobox.c:753 +#: gtk/gtkcombobox.c:756 msgid "The item which is currently active" msgstr "العنصر النشط حاليا" -#: gtk/gtkcombobox.c:772 gtk/gtkuimanager.c:226 +#: gtk/gtkcombobox.c:775 gtk/gtkuimanager.c:226 msgid "Add tearoffs to menus" msgstr "إضافة قاطفات للقوائم" -#: gtk/gtkcombobox.c:773 +#: gtk/gtkcombobox.c:776 msgid "Whether dropdowns should have a tearoff menu item" msgstr "فيما إذا وجب أن يكون للقوائم النازلة عنصر قطع" -#: gtk/gtkcombobox.c:788 gtk/gtkentry.c:687 +#: gtk/gtkcombobox.c:791 gtk/gtkentry.c:689 msgid "Has Frame" msgstr "له إطار" -#: gtk/gtkcombobox.c:789 +#: gtk/gtkcombobox.c:792 msgid "Whether the combo box draws a frame around the child" msgstr "إذا ما كان صندوق الإختيار يرسم إطارا حول الإبن" -#: gtk/gtkcombobox.c:797 +#: gtk/gtkcombobox.c:800 msgid "Whether the combo box grabs focus when it is clicked with the mouse" msgstr "فيما إذا سيأخذ الزر التركيز عند نقره بالفأرة" -#: gtk/gtkcombobox.c:812 gtk/gtkmenu.c:556 +#: gtk/gtkcombobox.c:815 gtk/gtkmenu.c:563 msgid "Tearoff Title" msgstr "قطف العنوان" -#: gtk/gtkcombobox.c:813 +#: gtk/gtkcombobox.c:816 msgid "" "A title that may be displayed by the window manager when the popup is torn-" "off" msgstr "عنوان قد يعرض من قبل مدير النوافذ عند إلغاء القوائم المنبثقة" -#: gtk/gtkcombobox.c:830 +#: gtk/gtkcombobox.c:833 msgid "Popup shown" msgstr "نافذة قافزة معروضة" -#: gtk/gtkcombobox.c:831 +#: gtk/gtkcombobox.c:834 msgid "Whether the combo's dropdown is shown" msgstr "فيما إذا يتم عرض قائمة الصندوق" -#: gtk/gtkcombobox.c:847 +#: gtk/gtkcombobox.c:850 msgid "Button Sensitivity" msgstr "حساسية الزر" -#: gtk/gtkcombobox.c:848 +#: gtk/gtkcombobox.c:851 msgid "Whether the dropdown button is sensitive when the model is empty" msgstr "فيما إذا كان زر القائمة المنسدلة حساساً عندما يكون النموذج فارغاً" -#: gtk/gtkcombobox.c:855 +#: gtk/gtkcombobox.c:858 msgid "Appears as list" msgstr "يظهر كقائمة" -#: gtk/gtkcombobox.c:856 +#: gtk/gtkcombobox.c:859 msgid "Whether dropdowns should look like lists rather than menus" msgstr "" "فما إذا القوائم النازلة لصناديق المجموعات يجب أن تكون قوائم بسيطة عوض قوائم " "حاسوب" -#: gtk/gtkcombobox.c:872 +#: gtk/gtkcombobox.c:875 msgid "Arrow Size" msgstr "حجم السهم" -#: gtk/gtkcombobox.c:873 +#: gtk/gtkcombobox.c:876 msgid "The minimum size of the arrow in the combo box" msgstr "الحجم الأدنى للسهم في صندوق الإختيار" -#: gtk/gtkcombobox.c:888 gtk/gtkentry.c:787 gtk/gtkhandlebox.c:174 -#: gtk/gtkmenubar.c:194 gtk/gtkstatusbar.c:193 gtk/gtktoolbar.c:623 -#: gtk/gtkviewport.c:122 +#: gtk/gtkcombobox.c:891 gtk/gtkentry.c:789 gtk/gtkhandlebox.c:175 +#: gtk/gtkmenubar.c:194 gtk/gtkstatusbar.c:193 gtk/gtktoolbar.c:568 +#: gtk/gtkviewport.c:150 msgid "Shadow type" msgstr "نوع الظل" -#: gtk/gtkcombobox.c:889 +#: gtk/gtkcombobox.c:892 msgid "Which kind of shadow to draw around the combo box" msgstr "نوع الظل حول صندوق الإختيار" @@ -2079,46 +2039,6 @@ msgstr "ابن" msgid "Can be used to add a new child to the container" msgstr "يمكن استخدامه لإضافة ابن جديد للحاوي" -#: gtk/gtkcurve.c:126 -msgid "Curve type" -msgstr "نوع المنحنى" - -#: gtk/gtkcurve.c:127 -msgid "Is this curve linear, spline interpolated, or free-form" -msgstr "هل هذا المنحنى خطي أو نقاط توجيه مستفات أو ذي شكل حر" - -#: gtk/gtkcurve.c:134 -msgid "Minimum X" -msgstr "س الدنيا" - -#: gtk/gtkcurve.c:135 -msgid "Minimum possible value for X" -msgstr "القيمة الممكنة الدنيا لـ س" - -#: gtk/gtkcurve.c:143 -msgid "Maximum X" -msgstr "س الأقصى" - -#: gtk/gtkcurve.c:144 -msgid "Maximum possible X value" -msgstr "القيمة القصوى الممكنة لـ س" - -#: gtk/gtkcurve.c:152 -msgid "Minimum Y" -msgstr "ص الأدنى" - -#: gtk/gtkcurve.c:153 -msgid "Minimum possible value for Y" -msgstr "القيمة الممكنة الدنيا لـ ص" - -#: gtk/gtkcurve.c:161 -msgid "Maximum Y" -msgstr "ص الأقصى" - -#: gtk/gtkcurve.c:162 -msgid "Maximum possible value for Y" -msgstr "القيمة الممكنة القصوى لـ ص" - #: gtk/gtkdialog.c:145 msgid "Has separator" msgstr "له فاصل" @@ -2161,76 +2081,76 @@ msgstr "حد منطقة العمل" msgid "Width of border around the button area at the bottom of the dialog" msgstr "عرض حد منطقة الزر أسفل الصندوق" -#: gtk/gtkentry.c:634 +#: gtk/gtkentry.c:636 #, fuzzy msgid "Text Buffer" msgstr "ذاكرة وسيطة" -#: gtk/gtkentry.c:635 +#: gtk/gtkentry.c:637 msgid "Text buffer object which actually stores entry text" msgstr "" -#: gtk/gtkentry.c:642 gtk/gtklabel.c:601 +#: gtk/gtkentry.c:644 gtk/gtklabel.c:623 msgid "Cursor Position" msgstr "موقع المؤشر" -#: gtk/gtkentry.c:643 gtk/gtklabel.c:602 +#: gtk/gtkentry.c:645 gtk/gtklabel.c:624 msgid "The current position of the insertion cursor in chars" msgstr "الموقع الحالي لمؤشر الإدخال في الرموز" -#: gtk/gtkentry.c:652 gtk/gtklabel.c:611 +#: gtk/gtkentry.c:654 gtk/gtklabel.c:633 msgid "Selection Bound" msgstr "قيد المنتقى" -#: gtk/gtkentry.c:653 gtk/gtklabel.c:612 +#: gtk/gtkentry.c:655 gtk/gtklabel.c:634 msgid "" "The position of the opposite end of the selection from the cursor in chars" msgstr "موقع النهاية المعكوسة للمنتقى من المؤشر في الرموز" -#: gtk/gtkentry.c:663 +#: gtk/gtkentry.c:665 msgid "Whether the entry contents can be edited" msgstr "فيما إذا كانت محتويات الخانة قابلة للتحرير" -#: gtk/gtkentry.c:670 gtk/gtkentrybuffer.c:383 +#: gtk/gtkentry.c:672 gtk/gtkentrybuffer.c:383 msgid "Maximum length" msgstr "الارتفاع الأقصى" -#: gtk/gtkentry.c:671 gtk/gtkentrybuffer.c:384 +#: gtk/gtkentry.c:673 gtk/gtkentrybuffer.c:384 msgid "Maximum number of characters for this entry. Zero if no maximum" msgstr "العدد الأقصى للرموز لهذا المدخل. صفر إذا لم يكن أقصى" -#: gtk/gtkentry.c:679 +#: gtk/gtkentry.c:681 msgid "Visibility" msgstr "الرؤية" -#: gtk/gtkentry.c:680 +#: gtk/gtkentry.c:682 msgid "" "FALSE displays the \"invisible char\" instead of the actual text (password " "mode)" msgstr "FALSE سيعرض \"الرمز المخفي\" بدلًا من النص الحالي (نمط كلمة السر)" -#: gtk/gtkentry.c:688 +#: gtk/gtkentry.c:690 msgid "FALSE removes outside bevel from entry" msgstr "FALSE يحذف الحافة الخارجية من الخانة" -#: gtk/gtkentry.c:696 +#: gtk/gtkentry.c:698 msgid "" "Border between text and frame. Overrides the inner-border style property" msgstr "الحد بين النص والاطار. تتجاوز خاصية أسلوب الحد-الداخلي" -#: gtk/gtkentry.c:703 gtk/gtkentry.c:1269 +#: gtk/gtkentry.c:705 gtk/gtkentry.c:1271 msgid "Invisible character" msgstr "رمز مخفي" -#: gtk/gtkentry.c:704 gtk/gtkentry.c:1270 +#: gtk/gtkentry.c:706 gtk/gtkentry.c:1272 msgid "The character to use when masking entry contents (in \"password mode\")" msgstr "الرمز الذي سيستخدم لاخفاء محتويات الخانة (في \"نمط كلمة السر\")" -#: gtk/gtkentry.c:711 +#: gtk/gtkentry.c:713 msgid "Activates default" msgstr "تنشيط الافتراضات" -#: gtk/gtkentry.c:712 +#: gtk/gtkentry.c:714 msgid "" "Whether to activate the default widget (such as the default button in a " "dialog) when Enter is pressed" @@ -2238,323 +2158,323 @@ msgstr "" "فيما اذا وجب تنشيط الودجة الافتراضية (مثل الزر الافتراضي في حوار ما)عند نقر " "زر الادخال" -#: gtk/gtkentry.c:718 +#: gtk/gtkentry.c:720 msgid "Width in chars" msgstr "العرض بالرموز" -#: gtk/gtkentry.c:719 +#: gtk/gtkentry.c:721 msgid "Number of characters to leave space for in the entry" msgstr "عدد الرموز التي ستترك لها فراغات في الخانة" -#: gtk/gtkentry.c:728 +#: gtk/gtkentry.c:730 msgid "Scroll offset" msgstr "تكافؤ اللف" -#: gtk/gtkentry.c:729 +#: gtk/gtkentry.c:731 msgid "Number of pixels of the entry scrolled off the screen to the left" msgstr "عدد بكسلات الخانة الملفوفة خارج الشاشة إلى اليسار" -#: gtk/gtkentry.c:739 +#: gtk/gtkentry.c:741 msgid "The contents of the entry" msgstr "محتويات الخانة" -#: gtk/gtkentry.c:754 gtk/gtkmisc.c:73 +#: gtk/gtkentry.c:756 gtk/gtkmisc.c:73 msgid "X align" msgstr "تنسيق س" -#: gtk/gtkentry.c:755 gtk/gtkmisc.c:74 +#: gtk/gtkentry.c:757 gtk/gtkmisc.c:74 msgid "" "The horizontal alignment, from 0 (left) to 1 (right). Reversed for RTL " "layouts." msgstr "الترصيف الأفقي، من 0 (يسار) إلى 1 (يمين). مقلوب لتصاميم RTL" -#: gtk/gtkentry.c:771 +#: gtk/gtkentry.c:773 msgid "Truncate multiline" msgstr "قطع السطور المتعددة" -#: gtk/gtkentry.c:772 +#: gtk/gtkentry.c:774 msgid "Whether to truncate multiline pastes to one line." msgstr "ما إذا سيتم قطع نص ملصوق متعدد السطور إلى سطر واحد" -#: gtk/gtkentry.c:788 +#: gtk/gtkentry.c:790 msgid "Which kind of shadow to draw around the entry when has-frame is set" msgstr "أي نوع من الظل المرسوم حول المدخل عند تحديد has-frame" -#: gtk/gtkentry.c:803 gtk/gtktextview.c:657 +#: gtk/gtkentry.c:805 gtk/gtktextview.c:657 msgid "Overwrite mode" msgstr "نسق التنميق" -#: gtk/gtkentry.c:804 +#: gtk/gtkentry.c:806 msgid "Whether new text overwrites existing text" msgstr "فيما إذا كان النص الجديد يكتب فوق النص الموجود" -#: gtk/gtkentry.c:818 gtk/gtkentrybuffer.c:368 +#: gtk/gtkentry.c:820 gtk/gtkentrybuffer.c:368 msgid "Text length" msgstr "طول النص" -#: gtk/gtkentry.c:819 +#: gtk/gtkentry.c:821 msgid "Length of the text currently in the entry" msgstr "طول النص الموجود حالياً في المُدخل" -#: gtk/gtkentry.c:834 +#: gtk/gtkentry.c:836 #, fuzzy msgid "Invisible char set" msgstr "تعيين غير المرئية" -#: gtk/gtkentry.c:835 +#: gtk/gtkentry.c:837 #, fuzzy msgid "Whether the invisible char has been set" msgstr "فيما إذا كتم تحديد icon-size" -#: gtk/gtkentry.c:853 +#: gtk/gtkentry.c:855 msgid "Caps Lock warning" msgstr "" -#: gtk/gtkentry.c:854 +#: gtk/gtkentry.c:856 msgid "Whether password entries will show a warning when Caps Lock is on" msgstr "" -#: gtk/gtkentry.c:868 +#: gtk/gtkentry.c:870 #, fuzzy msgid "Progress Fraction" msgstr "جزء" -#: gtk/gtkentry.c:869 +#: gtk/gtkentry.c:871 #, fuzzy msgid "The current fraction of the task that's been completed" msgstr "جزء من العمل الذي تم" -#: gtk/gtkentry.c:886 +#: gtk/gtkentry.c:888 #, fuzzy msgid "Progress Pulse Step" msgstr "خطوة النبض" -#: gtk/gtkentry.c:887 +#: gtk/gtkentry.c:889 #, fuzzy msgid "" "The fraction of total entry width to move the progress bouncing block for " "each call to gtk_entry_progress_pulse()" msgstr "جزء التقدم الكلي لتحريك الكتلة القافزة عند النبض" -#: gtk/gtkentry.c:903 +#: gtk/gtkentry.c:905 #, fuzzy msgid "Primary pixbuf" msgstr "بكسبف" -#: gtk/gtkentry.c:904 +#: gtk/gtkentry.c:906 #, fuzzy msgid "Primary pixbuf for the entry" msgstr "بيكسبف للموسع المفتوح" -#: gtk/gtkentry.c:918 +#: gtk/gtkentry.c:920 #, fuzzy msgid "Secondary pixbuf" msgstr "النص الثانوي" -#: gtk/gtkentry.c:919 +#: gtk/gtkentry.c:921 #, fuzzy msgid "Secondary pixbuf for the entry" msgstr "متخطي التقدم الثانوي" -#: gtk/gtkentry.c:933 +#: gtk/gtkentry.c:935 msgid "Primary stock ID" msgstr "" -#: gtk/gtkentry.c:934 +#: gtk/gtkentry.c:936 msgid "Stock ID for primary icon" msgstr "" -#: gtk/gtkentry.c:948 +#: gtk/gtkentry.c:950 #, fuzzy msgid "Secondary stock ID" msgstr "النص الثانوي" -#: gtk/gtkentry.c:949 +#: gtk/gtkentry.c:951 msgid "Stock ID for secondary icon" msgstr "" -#: gtk/gtkentry.c:963 +#: gtk/gtkentry.c:965 #, fuzzy msgid "Primary icon name" msgstr "قائمة أسماء الإيقونات" -#: gtk/gtkentry.c:964 +#: gtk/gtkentry.c:966 msgid "Icon name for primary icon" msgstr "" -#: gtk/gtkentry.c:978 +#: gtk/gtkentry.c:980 #, fuzzy msgid "Secondary icon name" msgstr "النص الثانوي" -#: gtk/gtkentry.c:979 +#: gtk/gtkentry.c:981 msgid "Icon name for secondary icon" msgstr "" -#: gtk/gtkentry.c:993 +#: gtk/gtkentry.c:995 msgid "Primary GIcon" msgstr "" -#: gtk/gtkentry.c:994 +#: gtk/gtkentry.c:996 #, fuzzy msgid "GIcon for primary icon" msgstr "أيقونة لهذه النافذة" -#: gtk/gtkentry.c:1008 +#: gtk/gtkentry.c:1010 #, fuzzy msgid "Secondary GIcon" msgstr "ثانوي" -#: gtk/gtkentry.c:1009 +#: gtk/gtkentry.c:1011 msgid "GIcon for secondary icon" msgstr "" -#: gtk/gtkentry.c:1023 +#: gtk/gtkentry.c:1025 #, fuzzy msgid "Primary storage type" msgstr "نوع التخزين" -#: gtk/gtkentry.c:1024 +#: gtk/gtkentry.c:1026 #, fuzzy msgid "The representation being used for primary icon" msgstr "التقديم المستعمل لبيانات الرسوم" -#: gtk/gtkentry.c:1039 +#: gtk/gtkentry.c:1041 #, fuzzy msgid "Secondary storage type" msgstr "متخطي التقدم الثانوي" -#: gtk/gtkentry.c:1040 +#: gtk/gtkentry.c:1042 #, fuzzy msgid "The representation being used for secondary icon" msgstr "التقديم المستعمل لبيانات الرسوم" -#: gtk/gtkentry.c:1061 +#: gtk/gtkentry.c:1063 msgid "Primary icon activatable" msgstr "" -#: gtk/gtkentry.c:1062 +#: gtk/gtkentry.c:1064 #, fuzzy msgid "Whether the primary icon is activatable" msgstr "فيما إذا كانت العملية مفعلة." -#: gtk/gtkentry.c:1082 +#: gtk/gtkentry.c:1084 #, fuzzy msgid "Secondary icon activatable" msgstr "مؤشر ا?دخال الثانوي" -#: gtk/gtkentry.c:1083 +#: gtk/gtkentry.c:1085 #, fuzzy msgid "Whether the secondary icon is activatable" msgstr "فيما إذا كانت العملية مفعلة." -#: gtk/gtkentry.c:1105 +#: gtk/gtkentry.c:1107 #, fuzzy msgid "Primary icon sensitive" msgstr "عرض حساسية الخلية" -#: gtk/gtkentry.c:1106 +#: gtk/gtkentry.c:1108 #, fuzzy msgid "Whether the primary icon is sensitive" msgstr "فيما إذا كان تطابق عناصر القائمة حساس للحالة" -#: gtk/gtkentry.c:1127 +#: gtk/gtkentry.c:1129 #, fuzzy msgid "Secondary icon sensitive" msgstr "النص الثانوي" -#: gtk/gtkentry.c:1128 +#: gtk/gtkentry.c:1130 #, fuzzy msgid "Whether the secondary icon is sensitive" msgstr "فيما إذا كانت العملية مفعلة." -#: gtk/gtkentry.c:1144 +#: gtk/gtkentry.c:1146 #, fuzzy msgid "Primary icon tooltip text" msgstr "عرض حساسية الخلية" -#: gtk/gtkentry.c:1145 gtk/gtkentry.c:1181 +#: gtk/gtkentry.c:1147 gtk/gtkentry.c:1183 #, fuzzy msgid "The contents of the tooltip on the primary icon" msgstr "نص تلميحة لهذه الودجة" -#: gtk/gtkentry.c:1161 +#: gtk/gtkentry.c:1163 #, fuzzy msgid "Secondary icon tooltip text" msgstr "مؤشر ا?دخال الثانوي" -#: gtk/gtkentry.c:1162 gtk/gtkentry.c:1200 +#: gtk/gtkentry.c:1164 gtk/gtkentry.c:1202 #, fuzzy msgid "The contents of the tooltip on the secondary icon" msgstr "نص تلميحة لهذه الودجة" -#: gtk/gtkentry.c:1180 +#: gtk/gtkentry.c:1182 #, fuzzy msgid "Primary icon tooltip markup" msgstr "قائمة أسماء الإيقونات" -#: gtk/gtkentry.c:1199 +#: gtk/gtkentry.c:1201 #, fuzzy msgid "Secondary icon tooltip markup" msgstr "النص الثانوي" -#: gtk/gtkentry.c:1219 gtk/gtktextview.c:685 +#: gtk/gtkentry.c:1221 gtk/gtktextview.c:685 #, fuzzy msgid "IM module" msgstr "وحدة IM الإفتراضية" -#: gtk/gtkentry.c:1220 gtk/gtktextview.c:686 +#: gtk/gtkentry.c:1222 gtk/gtktextview.c:686 #, fuzzy msgid "Which IM module should be used" msgstr "وحدة IM الإفتراضية" -#: gtk/gtkentry.c:1234 +#: gtk/gtkentry.c:1236 #, fuzzy msgid "Icon Prelight" msgstr "الارتفاع" -#: gtk/gtkentry.c:1235 +#: gtk/gtkentry.c:1237 #, fuzzy msgid "Whether activatable icons should prelight when hovered" msgstr "فيما إذا كان سيتم عرض الألسنة أم لا" -#: gtk/gtkentry.c:1248 +#: gtk/gtkentry.c:1250 #, fuzzy msgid "Progress Border" msgstr "حد منخفض" -#: gtk/gtkentry.c:1249 +#: gtk/gtkentry.c:1251 #, fuzzy msgid "Border around the progress bar" msgstr "النص على عمود التقدم" -#: gtk/gtkentry.c:1741 +#: gtk/gtkentry.c:1743 msgid "Border between text and frame." msgstr "الحد بين النص والاطار." -#: gtk/gtkentry.c:1755 +#: gtk/gtkentry.c:1757 #, fuzzy msgid "State Hint" msgstr "نص الحالة" -#: gtk/gtkentry.c:1756 +#: gtk/gtkentry.c:1758 #, fuzzy msgid "Whether to pass a proper state when drawing shadow or background" msgstr "صورة بيتماب المستخدمة كغلاف أثناء رسم الواجهة الخلفية للنص" -#: gtk/gtkentry.c:1761 gtk/gtklabel.c:858 +#: gtk/gtkentry.c:1763 gtk/gtklabel.c:882 msgid "Select on focus" msgstr "اختيار عند التركيز" -#: gtk/gtkentry.c:1762 +#: gtk/gtkentry.c:1764 msgid "Whether to select the contents of an entry when it is focused" msgstr "فيما اذا سيقع انتقاء محتويات خانة عند تركيزها" -#: gtk/gtkentry.c:1776 +#: gtk/gtkentry.c:1778 msgid "Password Hint Timeout" msgstr "مدة عرض تلميحة كلمة السر" -#: gtk/gtkentry.c:1777 +#: gtk/gtkentry.c:1779 msgid "How long to show the last input character in hidden entries" msgstr "مدة ظهور الحرف المدخل الأخير في المداخل المخفية" @@ -2584,7 +2504,7 @@ msgstr "الطول الأدنى للمفتاح" msgid "Minimum length of the search key in order to look up matches" msgstr "الطول الأدنى لمفتاح البحث حتى يمكن البحث عن المتطابقات" -#: gtk/gtkentrycompletion.c:303 gtk/gtkiconview.c:586 +#: gtk/gtkentrycompletion.c:303 gtk/gtkiconview.c:588 msgid "Text column" msgstr "عمود النص" @@ -2668,11 +2588,11 @@ msgstr "فيما إذا وقع فتح الموسع للكشف عن الودجة msgid "Text of the expander's label" msgstr "نص شارة الموسع" -#: gtk/gtkexpander.c:211 gtk/gtklabel.c:520 +#: gtk/gtkexpander.c:211 gtk/gtklabel.c:542 msgid "Use markup" msgstr "استخدام التعليم" -#: gtk/gtkexpander.c:212 gtk/gtklabel.c:521 +#: gtk/gtkexpander.c:212 gtk/gtklabel.c:543 msgid "The text of the label includes XML markup. See pango_parse_markup()" msgstr "نص الشارة يحوي تعليم XML. راجع pango_parse_markup()" @@ -2680,8 +2600,8 @@ msgstr "نص الشارة يحوي تعليم XML. راجع pango_parse_markup() msgid "Space to put between the label and the child" msgstr "الفضاء الذي سيوضع بين الشارة و الإبن" -#: gtk/gtkexpander.c:229 gtk/gtkframe.c:147 gtk/gtktoolbutton.c:218 -#: gtk/gtktoolitemgroup.c:1542 +#: gtk/gtkexpander.c:229 gtk/gtkframe.c:156 gtk/gtktoolbutton.c:218 +#: gtk/gtktoolitemgroup.c:1550 msgid "Label widget" msgstr "ودجة الشارة" @@ -2689,11 +2609,11 @@ msgstr "ودجة الشارة" msgid "A widget to display in place of the usual expander label" msgstr "الودجة التي ستعرض عوض شارة الموسع الاعتادية" -#: gtk/gtkexpander.c:236 gtk/gtktoolitemgroup.c:1570 gtk/gtktreeview.c:777 +#: gtk/gtkexpander.c:236 gtk/gtktoolitemgroup.c:1578 gtk/gtktreeview.c:779 msgid "Expander Size" msgstr "حجم الموسع" -#: gtk/gtkexpander.c:237 gtk/gtktoolitemgroup.c:1571 gtk/gtktreeview.c:778 +#: gtk/gtkexpander.c:237 gtk/gtktoolitemgroup.c:1579 gtk/gtktreeview.c:780 msgid "Size of the expander arrow" msgstr "حجم سهم الموسع" @@ -2701,92 +2621,84 @@ msgstr "حجم سهم الموسع" msgid "Spacing around expander arrow" msgstr "الفراغات حول سهم الموسع" -#: gtk/gtkfilechooser.c:758 +#: gtk/gtkfilechooser.c:759 msgid "Action" msgstr "عملية" -#: gtk/gtkfilechooser.c:759 +#: gtk/gtkfilechooser.c:760 msgid "The type of operation that the file selector is performing" msgstr "نوع العملية التي يقوم بها منتقي الملفات" -#: gtk/gtkfilechooser.c:765 -msgid "File System Backend" -msgstr "خلفية نظام الملفات" - -#: gtk/gtkfilechooser.c:766 -msgid "Name of file system backend to use" -msgstr "اسم خلفية نظام الملفات التي ستستخدم" - -#: gtk/gtkfilechooser.c:771 gtk/gtkrecentchooser.c:264 +#: gtk/gtkfilechooser.c:766 gtk/gtkrecentchooser.c:281 msgid "Filter" msgstr "مرشح" -#: gtk/gtkfilechooser.c:772 +#: gtk/gtkfilechooser.c:767 msgid "The current filter for selecting which files are displayed" msgstr "المرشح الحالي لانتقاء الملفات للعرض" -#: gtk/gtkfilechooser.c:777 +#: gtk/gtkfilechooser.c:772 msgid "Local Only" msgstr "المحلي فقط" -#: gtk/gtkfilechooser.c:778 +#: gtk/gtkfilechooser.c:773 msgid "Whether the selected file(s) should be limited to local file: URLs" msgstr "فيما إذا سيقع حد الملفات المنتقات للملف المحلي: العناوين" -#: gtk/gtkfilechooser.c:783 +#: gtk/gtkfilechooser.c:778 msgid "Preview widget" msgstr "ودجة التلميح" -#: gtk/gtkfilechooser.c:784 +#: gtk/gtkfilechooser.c:779 msgid "Application supplied widget for custom previews." msgstr "ودجة ممدّدة بتطبيق للتلميحات الخاصّة." -#: gtk/gtkfilechooser.c:789 +#: gtk/gtkfilechooser.c:784 msgid "Preview Widget Active" msgstr "ودجة التلميح نشطة" -#: gtk/gtkfilechooser.c:790 +#: gtk/gtkfilechooser.c:785 msgid "" "Whether the application supplied widget for custom previews should be shown." msgstr "فيما إذا ستعرض الودجة الممدّدة بتطبيق للتلميحات الخاصّة." -#: gtk/gtkfilechooser.c:795 +#: gtk/gtkfilechooser.c:790 msgid "Use Preview Label" msgstr "استخدام علامة المعاينة" -#: gtk/gtkfilechooser.c:796 +#: gtk/gtkfilechooser.c:791 msgid "Whether to display a stock label with the name of the previewed file." msgstr "فيما إذا ستعرض علامة مخزونة مع أسم الملف المعاين." -#: gtk/gtkfilechooser.c:801 +#: gtk/gtkfilechooser.c:796 msgid "Extra widget" msgstr "ودجة اضافية" -#: gtk/gtkfilechooser.c:802 +#: gtk/gtkfilechooser.c:797 msgid "Application supplied widget for extra options." msgstr "ودجة ممدّدة بتطبيق للخيارات الإضافيّة." -#: gtk/gtkfilechooser.c:807 gtk/gtkfilesel.c:540 gtk/gtkrecentchooser.c:203 +#: gtk/gtkfilechooser.c:802 gtk/gtkrecentchooser.c:220 msgid "Select Multiple" msgstr "إنتقاء متعدّد" -#: gtk/gtkfilechooser.c:808 gtk/gtkfilesel.c:541 +#: gtk/gtkfilechooser.c:803 msgid "Whether to allow multiple files to be selected" msgstr "ما إذا سيتم السماح بانتقاء ملفات متعددة" -#: gtk/gtkfilechooser.c:814 +#: gtk/gtkfilechooser.c:809 msgid "Show Hidden" msgstr "اظهار المخفي" -#: gtk/gtkfilechooser.c:815 +#: gtk/gtkfilechooser.c:810 msgid "Whether the hidden files and folders should be displayed" msgstr "فيما اذا وجب عرض الملفات و الدلائل المخفية" -#: gtk/gtkfilechooser.c:830 +#: gtk/gtkfilechooser.c:825 msgid "Do overwrite confirmation" msgstr "تأكيد الكتابة الفوقية" -#: gtk/gtkfilechooser.c:831 +#: gtk/gtkfilechooser.c:826 msgid "" "Whether a file chooser in save mode will present an overwrite confirmation " "dialog if necessary." @@ -2794,12 +2706,12 @@ msgstr "" "اذا كان حوار اختيار الملف في حالة الحفظ سيعرض سؤال لتأكيد الكتابة الفوقية ان " "كان ذلك مطلوبا." -#: gtk/gtkfilechooser.c:847 +#: gtk/gtkfilechooser.c:842 #, fuzzy msgid "Allow folders creation" msgstr "إظهار عمليات الملفات" -#: gtk/gtkfilechooser.c:848 +#: gtk/gtkfilechooser.c:843 #, fuzzy msgid "" "Whether a file chooser not in open mode will offer the user to create new " @@ -2824,36 +2736,19 @@ msgstr "عنوان لحوار تصفّح الملفات." msgid "The desired width of the button widget, in characters." msgstr "العرض المطلوب لودجة الزر، بالمحارف" -#: gtk/gtkfilesel.c:526 gtk/gtkimage.c:254 gtk/gtkrecentmanager.c:214 -#: gtk/gtkstatusicon.c:221 -msgid "Filename" -msgstr "اسم الملف" - -#: gtk/gtkfilesel.c:527 -msgid "The currently selected filename" -msgstr "اسم الملف المنتقى حاليا" - -#: gtk/gtkfilesel.c:533 -msgid "Show file operations" -msgstr "إظهار عمليات الملفات" - -#: gtk/gtkfilesel.c:534 -msgid "Whether buttons for creating/manipulating files should be displayed" -msgstr "فيم اذا وجب عرض أزرار لإنشاء أو معالجة الملفات" - -#: gtk/gtkfixed.c:90 gtk/gtklayout.c:597 +#: gtk/gtkfixed.c:90 gtk/gtklayout.c:561 msgid "X position" msgstr "موقع س" -#: gtk/gtkfixed.c:91 gtk/gtklayout.c:598 +#: gtk/gtkfixed.c:91 gtk/gtklayout.c:562 msgid "X position of child widget" msgstr "موقع س للودجة الابنة" -#: gtk/gtkfixed.c:100 gtk/gtklayout.c:607 +#: gtk/gtkfixed.c:100 gtk/gtklayout.c:571 msgid "Y position" msgstr "موقع ص" -#: gtk/gtkfixed.c:101 gtk/gtklayout.c:608 +#: gtk/gtkfixed.c:101 gtk/gtklayout.c:572 msgid "Y position of child widget" msgstr "موقع ص للودجة الابنة" @@ -2921,288 +2816,292 @@ msgstr "نص اللمحة" msgid "The text to display in order to demonstrate the selected font" msgstr "النص الذي سيعرض لتقديم الخط المنتقى" -#: gtk/gtkframe.c:106 +#: gtk/gtkframe.c:115 msgid "Text of the frame's label" msgstr "نص شارة الإطار" -#: gtk/gtkframe.c:113 +#: gtk/gtkframe.c:122 msgid "Label xalign" msgstr "ترصيف س للعلامة" -#: gtk/gtkframe.c:114 +#: gtk/gtkframe.c:123 msgid "The horizontal alignment of the label" msgstr "الترصيف الأفقي للشارة" -#: gtk/gtkframe.c:122 +#: gtk/gtkframe.c:131 msgid "Label yalign" msgstr "ترصيف ص للعلامة" -#: gtk/gtkframe.c:123 +#: gtk/gtkframe.c:132 msgid "The vertical alignment of the label" msgstr "الترصيف العمودي للشارة" -#: gtk/gtkframe.c:131 gtk/gtkhandlebox.c:167 +#: gtk/gtkframe.c:140 gtk/gtkhandlebox.c:168 msgid "Deprecated property, use shadow_type instead" msgstr "خاضية ملغات، إستعمل shadow_type عوضا عنها" -#: gtk/gtkframe.c:138 +#: gtk/gtkframe.c:147 msgid "Frame shadow" msgstr "ظل الإطار" -#: gtk/gtkframe.c:139 +#: gtk/gtkframe.c:148 msgid "Appearance of the frame border" msgstr "مظهر حدود الإطار" -#: gtk/gtkframe.c:148 +#: gtk/gtkframe.c:157 msgid "A widget to display in place of the usual frame label" msgstr "ودجة للعرض عوض شارة الاظار المعتادة" -#: gtk/gtkhandlebox.c:175 +#: gtk/gtkhandlebox.c:176 msgid "Appearance of the shadow that surrounds the container" msgstr "مظهر الظل المأطر للحاوي" -#: gtk/gtkhandlebox.c:183 +#: gtk/gtkhandlebox.c:184 msgid "Handle position" msgstr "موقع المقبض" -#: gtk/gtkhandlebox.c:184 +#: gtk/gtkhandlebox.c:185 msgid "Position of the handle relative to the child widget" msgstr "موقع المعالج نسبة لودجة الابن" -#: gtk/gtkhandlebox.c:192 +#: gtk/gtkhandlebox.c:193 msgid "Snap edge" msgstr "حافة سريعة" -#: gtk/gtkhandlebox.c:193 +#: gtk/gtkhandlebox.c:194 msgid "" "Side of the handlebox that's lined up with the docking point to dock the " "handlebox" msgstr "حجم صندوق المعالجة المرصّف مع نقطة الإرساء لإرساء صندوق المعالجة" -#: gtk/gtkhandlebox.c:201 +#: gtk/gtkhandlebox.c:202 msgid "Snap edge set" msgstr "ضبط الحافة السريعة" -#: gtk/gtkhandlebox.c:202 +#: gtk/gtkhandlebox.c:203 msgid "" "Whether to use the value from the snap_edge property or a value derived from " "handle_position" msgstr "فيما إذا ستستخدم القيمة من خاصيّة snap_edge أو قيمة من handle_position" -#: gtk/gtkhandlebox.c:209 +#: gtk/gtkhandlebox.c:210 msgid "Child Detached" msgstr "الابن منفصل" -#: gtk/gtkhandlebox.c:210 +#: gtk/gtkhandlebox.c:211 msgid "" "A boolean value indicating whether the handlebox's child is attached or " "detached." msgstr "قيمة منطقية تحدد فيما إذا كان صندوق المداولة للابن متصل أو منفصل." -#: gtk/gtkiconview.c:549 +#: gtk/gtkiconview.c:551 msgid "Selection mode" msgstr "نمط الانتقاء" -#: gtk/gtkiconview.c:550 +#: gtk/gtkiconview.c:552 msgid "The selection mode" msgstr "نمط الانتقاء" -#: gtk/gtkiconview.c:568 +#: gtk/gtkiconview.c:570 msgid "Pixbuf column" msgstr "عمود Pixbuf" -#: gtk/gtkiconview.c:569 +#: gtk/gtkiconview.c:571 msgid "Model column used to retrieve the icon pixbuf from" msgstr "نموذج العمود المستخدم لاستعادة ايقونة pixbuf" -#: gtk/gtkiconview.c:587 +#: gtk/gtkiconview.c:589 msgid "Model column used to retrieve the text from" msgstr "نموذج العمود المستخدم لاستعادة النص" -#: gtk/gtkiconview.c:606 +#: gtk/gtkiconview.c:608 msgid "Markup column" msgstr "عمود الترميز" -#: gtk/gtkiconview.c:607 +#: gtk/gtkiconview.c:609 msgid "Model column used to retrieve the text if using Pango markup" msgstr "نموذج العمود المستخدم لاستعادة النص اذا تم استخدام ترميز بانغو" -#: gtk/gtkiconview.c:614 +#: gtk/gtkiconview.c:616 msgid "Icon View Model" msgstr "نمط عرض الأيقونات" -#: gtk/gtkiconview.c:615 +#: gtk/gtkiconview.c:617 msgid "The model for the icon view" msgstr "نمط عرض الأيقونات" -#: gtk/gtkiconview.c:631 +#: gtk/gtkiconview.c:633 msgid "Number of columns" msgstr "عدد الأعمدة" -#: gtk/gtkiconview.c:632 +#: gtk/gtkiconview.c:634 msgid "Number of columns to display" msgstr "عدد الأعمدة المعروضة" -#: gtk/gtkiconview.c:649 +#: gtk/gtkiconview.c:651 msgid "Width for each item" msgstr "عرض كل عنصر" -#: gtk/gtkiconview.c:650 +#: gtk/gtkiconview.c:652 msgid "The width used for each item" msgstr "عرض كل عنصر" -#: gtk/gtkiconview.c:666 +#: gtk/gtkiconview.c:668 msgid "Space which is inserted between cells of an item" msgstr "الفراغ بين خلايا العنصر" -#: gtk/gtkiconview.c:681 +#: gtk/gtkiconview.c:683 msgid "Row Spacing" msgstr "فراغات السطور" -#: gtk/gtkiconview.c:682 +#: gtk/gtkiconview.c:684 msgid "Space which is inserted between grid rows" msgstr "الفراغ المدرج بين صفوف الشبكة" -#: gtk/gtkiconview.c:697 +#: gtk/gtkiconview.c:699 msgid "Column Spacing" msgstr "فراغات العمود" -#: gtk/gtkiconview.c:698 +#: gtk/gtkiconview.c:700 msgid "Space which is inserted between grid columns" msgstr "الفراغ المدرج بين أعمدة الشبكة" -#: gtk/gtkiconview.c:713 +#: gtk/gtkiconview.c:715 msgid "Margin" msgstr "الحاشية" -#: gtk/gtkiconview.c:714 +#: gtk/gtkiconview.c:716 msgid "Space which is inserted at the edges of the icon view" msgstr "الفراغ الملحق عند حدود الأيقونات" -#: gtk/gtkiconview.c:730 +#: gtk/gtkiconview.c:732 msgid "" "How the text and icon of each item are positioned relative to each other" msgstr "كيفية وضع نص و أيقون كل عنصر بالنسبة لبعضهما" -#: gtk/gtkiconview.c:746 gtk/gtktreeview.c:612 gtk/gtktreeviewcolumn.c:308 +#: gtk/gtkiconview.c:748 gtk/gtktreeview.c:614 gtk/gtktreeviewcolumn.c:308 msgid "Reorderable" msgstr "قابل لإعادة الترتيب" -#: gtk/gtkiconview.c:747 gtk/gtktreeview.c:613 +#: gtk/gtkiconview.c:749 gtk/gtktreeview.c:615 msgid "View is reorderable" msgstr "العرض قابل لإعادة الترتيب" -#: gtk/gtkiconview.c:754 gtk/gtktreeview.c:763 +#: gtk/gtkiconview.c:756 gtk/gtktreeview.c:765 msgid "Tooltip Column" msgstr "عمود التلميحات" -#: gtk/gtkiconview.c:755 +#: gtk/gtkiconview.c:757 msgid "The column in the model containing the tooltip texts for the items" msgstr "عمود النموذج المحتوي على التلميحات للعناصر." -#: gtk/gtkiconview.c:772 +#: gtk/gtkiconview.c:774 #, fuzzy msgid "Item Padding" msgstr "الحشو الأسفل" -#: gtk/gtkiconview.c:773 +#: gtk/gtkiconview.c:775 msgid "Padding around icon view items" msgstr "" -#: gtk/gtkiconview.c:782 +#: gtk/gtkiconview.c:784 msgid "Selection Box Color" msgstr "لون علبة الإختيار" -#: gtk/gtkiconview.c:783 +#: gtk/gtkiconview.c:785 msgid "Color of the selection box" msgstr "لون صندوق الإختيار" -#: gtk/gtkiconview.c:789 +#: gtk/gtkiconview.c:791 msgid "Selection Box Alpha" msgstr "ألفا علبة الإختيار" -#: gtk/gtkiconview.c:790 +#: gtk/gtkiconview.c:792 msgid "Opacity of the selection box" msgstr "شفافية علبة الإختيار" -#: gtk/gtkimage.c:222 gtk/gtkstatusicon.c:213 +#: gtk/gtkimage.c:227 gtk/gtkstatusicon.c:218 msgid "Pixbuf" msgstr "بكسبف" -#: gtk/gtkimage.c:223 gtk/gtkstatusicon.c:214 +#: gtk/gtkimage.c:228 gtk/gtkstatusicon.c:219 msgid "A GdkPixbuf to display" msgstr "GdkPixbuf لعرضه" -#: gtk/gtkimage.c:230 +#: gtk/gtkimage.c:235 msgid "Pixmap" msgstr "بكسماب" -#: gtk/gtkimage.c:231 +#: gtk/gtkimage.c:236 msgid "A GdkPixmap to display" msgstr "GdkPixmap لعرضها" -#: gtk/gtkimage.c:238 gtk/gtkmessagedialog.c:215 +#: gtk/gtkimage.c:243 gtk/gtkmessagedialog.c:262 msgid "Image" msgstr "صورة" -#: gtk/gtkimage.c:239 +#: gtk/gtkimage.c:244 msgid "A GdkImage to display" msgstr "GdkImage لعرضها" -#: gtk/gtkimage.c:246 +#: gtk/gtkimage.c:251 msgid "Mask" msgstr "غلاف" -#: gtk/gtkimage.c:247 +#: gtk/gtkimage.c:252 msgid "Mask bitmap to use with GdkImage or GdkPixmap" msgstr "بيتماب الغلاف لاستخدامه مع GdkImage أو GdkPixmap" -#: gtk/gtkimage.c:255 gtk/gtkstatusicon.c:222 +#: gtk/gtkimage.c:259 gtk/gtkrecentmanager.c:214 gtk/gtkstatusicon.c:226 +msgid "Filename" +msgstr "اسم الملف" + +#: gtk/gtkimage.c:260 gtk/gtkstatusicon.c:227 msgid "Filename to load and display" msgstr "اسم الملف للتحميل و العرض" -#: gtk/gtkimage.c:264 gtk/gtkstatusicon.c:230 +#: gtk/gtkimage.c:269 gtk/gtkstatusicon.c:235 msgid "Stock ID for a stock image to display" msgstr "هوية المخزون لصورة مخزون للعرض" -#: gtk/gtkimage.c:271 +#: gtk/gtkimage.c:276 msgid "Icon set" msgstr "مجموعة الأيقونات" -#: gtk/gtkimage.c:272 +#: gtk/gtkimage.c:277 msgid "Icon set to display" msgstr "مجموعة الأيقونات للعرض" -#: gtk/gtkimage.c:279 gtk/gtkscalebutton.c:216 gtk/gtktoolbar.c:540 -#: gtk/gtktoolpalette.c:990 +#: gtk/gtkimage.c:284 gtk/gtkscalebutton.c:232 gtk/gtktoolbar.c:485 +#: gtk/gtktoolpalette.c:991 msgid "Icon size" msgstr "حجم الأيقونة" -#: gtk/gtkimage.c:280 +#: gtk/gtkimage.c:285 msgid "Symbolic size to use for stock icon, icon set or named icon" msgstr "الحجم الرمزي للأيقونة, مجموعة الأيقونات أو الأيقون المسمى" -#: gtk/gtkimage.c:296 +#: gtk/gtkimage.c:301 msgid "Pixel size" msgstr "حجم البكسل" -#: gtk/gtkimage.c:297 +#: gtk/gtkimage.c:302 msgid "Pixel size to use for named icon" msgstr "حجم البكسل المستعمل للأيقونة المسماة" -#: gtk/gtkimage.c:305 +#: gtk/gtkimage.c:310 msgid "Animation" msgstr "رسوم متحركة" -#: gtk/gtkimage.c:306 +#: gtk/gtkimage.c:311 msgid "GdkPixbufAnimation to display" msgstr "GdkPixbufAnimation لعرضها" -#: gtk/gtkimage.c:346 gtk/gtkstatusicon.c:261 +#: gtk/gtkimage.c:351 gtk/gtkstatusicon.c:266 msgid "Storage type" msgstr "نوع التخزين" -#: gtk/gtkimage.c:347 gtk/gtkstatusicon.c:262 +#: gtk/gtkimage.c:352 gtk/gtkstatusicon.c:267 msgid "The representation being used for image data" msgstr "التقديم المستعمل لبيانات الرسوم" @@ -3215,7 +3114,7 @@ msgstr "الودجة الابن التي ستظهر إلى جانب نص الق msgid "Whether to use the label text to create a stock menu item" msgstr "فيما اذا كان من الممكن انتقاء نص الشارة بالفأرة" -#: gtk/gtkimagemenuitem.c:184 gtk/gtkmenu.c:516 +#: gtk/gtkimagemenuitem.c:184 gtk/gtkmenu.c:523 msgid "Accel Group" msgstr "مجموعة Accel" @@ -3232,11 +3131,11 @@ msgstr "اظهار صور القوائم" msgid "Whether images should be shown in menus" msgstr "فيما إذا سيتم إظهار صور في القوائم" -#: gtk/gtkinfobar.c:384 gtk/gtkmessagedialog.c:128 +#: gtk/gtkinfobar.c:384 gtk/gtkmessagedialog.c:175 msgid "Message Type" msgstr "نوع الرسالة" -#: gtk/gtkinfobar.c:385 gtk/gtkmessagedialog.c:129 +#: gtk/gtkinfobar.c:385 gtk/gtkmessagedialog.c:176 msgid "The type of message" msgstr "نوع الرسالة" @@ -3255,23 +3154,23 @@ msgstr "الفراغ بين نص القيمة ومنطقة المتزحلق/ال msgid "Width of border around the action area" msgstr "عرض حد منطقة الحوار الرئيسية" -#: gtk/gtkinvisible.c:87 gtk/gtkwindow.c:627 +#: gtk/gtkinvisible.c:87 gtk/gtkwindow.c:651 msgid "The screen where this window will be displayed" msgstr "الشاشة التي ستعرض فيها هذه النافذة" -#: gtk/gtklabel.c:507 +#: gtk/gtklabel.c:529 msgid "The text of the label" msgstr "نص الشارة" -#: gtk/gtklabel.c:514 +#: gtk/gtklabel.c:536 msgid "A list of style attributes to apply to the text of the label" msgstr "قائمة لصفات الأساليب لتطبيقها على نص العلامة" -#: gtk/gtklabel.c:535 gtk/gtktexttag.c:359 gtk/gtktextview.c:594 +#: gtk/gtklabel.c:557 gtk/gtktexttag.c:359 gtk/gtktextview.c:594 msgid "Justification" msgstr "ضبط" -#: gtk/gtklabel.c:536 +#: gtk/gtklabel.c:558 msgid "" "The alignment of the lines in the text of the label relative to each other. " "This does NOT affect the alignment of the label within its allocation. See " @@ -3280,57 +3179,57 @@ msgstr "" "ترصيف السطور في نص العلامة بالنسبة لبعضها البعض. لا يؤثّر هذا في ترصيف " "العلامة نفسها في مكانها المخصص لها. راجع GtkMisc::xalign للمزيد من العملومات" -#: gtk/gtklabel.c:544 +#: gtk/gtklabel.c:566 msgid "Pattern" msgstr "نمط" -#: gtk/gtklabel.c:545 +#: gtk/gtklabel.c:567 msgid "" "A string with _ characters in positions correspond to characters in the text " "to underline" msgstr "سلسلة برموز _ في مواقع معينة يرمز لرموز ستسطّر في النص" -#: gtk/gtklabel.c:552 +#: gtk/gtklabel.c:574 msgid "Line wrap" msgstr "لف السطور" -#: gtk/gtklabel.c:553 +#: gtk/gtklabel.c:575 msgid "If set, wrap lines if the text becomes too wide" msgstr "اذا ضبط، فستلف السطور عندما يصبح النص واسعا جدا" -#: gtk/gtklabel.c:568 +#: gtk/gtklabel.c:590 msgid "Line wrap mode" msgstr "نسق نظام الالتواء" -#: gtk/gtklabel.c:569 +#: gtk/gtklabel.c:591 msgid "If wrap is set, controls how linewrapping is done" msgstr "اذا كان اللف مفعّلا، التحكم في كيفية لف السطر." -#: gtk/gtklabel.c:576 +#: gtk/gtklabel.c:598 msgid "Selectable" msgstr "قابل للاختيار" -#: gtk/gtklabel.c:577 +#: gtk/gtklabel.c:599 msgid "Whether the label text can be selected with the mouse" msgstr "فيما اذا كان من الممكن انتقاء نص الشارة بالفأرة" -#: gtk/gtklabel.c:583 +#: gtk/gtklabel.c:605 msgid "Mnemonic key" msgstr "مفتاح الإختصار المسطّر" -#: gtk/gtklabel.c:584 +#: gtk/gtklabel.c:606 msgid "The mnemonic accelerator key for this label" msgstr "مفتاح الإختصار المسطر لهذه العلامة" -#: gtk/gtklabel.c:592 +#: gtk/gtklabel.c:614 msgid "Mnemonic widget" msgstr "ودجة مفتاح الإختصار المسطر" -#: gtk/gtklabel.c:593 +#: gtk/gtklabel.c:615 msgid "The widget to be activated when the label's mnemonic key is pressed" msgstr "الودجة التي ستفعل عند نقر مفتاح الإختصار المسطر" -#: gtk/gtklabel.c:639 +#: gtk/gtklabel.c:661 msgid "" "The preferred place to ellipsize the string, if the label does not have " "enough room to display the entire string" @@ -3338,65 +3237,65 @@ msgstr "" "المكان المفضل لوضع القطع في النص، إذا كانت التسمية لا تملك المكان الكافي " "لعرض كل النص" -#: gtk/gtklabel.c:679 +#: gtk/gtklabel.c:702 msgid "Single Line Mode" msgstr "نمط سطر وحيد" -#: gtk/gtklabel.c:680 +#: gtk/gtklabel.c:703 msgid "Whether the label is in single line mode" msgstr "فيما إذا كانت العلامة في نمط السطر الوحيد" -#: gtk/gtklabel.c:697 +#: gtk/gtklabel.c:720 msgid "Angle" msgstr "الزاويه" -#: gtk/gtklabel.c:698 +#: gtk/gtklabel.c:721 msgid "Angle at which the label is rotated" msgstr "الزاوية التي سيدوّرها العنوان" -#: gtk/gtklabel.c:718 +#: gtk/gtklabel.c:742 msgid "Maximum Width In Characters" msgstr "العرض الأكبر بالحروف" -#: gtk/gtklabel.c:719 +#: gtk/gtklabel.c:743 msgid "The desired maximum width of the label, in characters" msgstr "العرض الأقصى المطلوب للتسمية، بالمحارف" -#: gtk/gtklabel.c:737 +#: gtk/gtklabel.c:761 #, fuzzy msgid "Track visited links" msgstr "لون الوصلات المزارة" -#: gtk/gtklabel.c:738 +#: gtk/gtklabel.c:762 #, fuzzy msgid "Whether visited links should be tracked" msgstr "فيما إذا يفترض اظهار العناصر الخاصة" -#: gtk/gtklabel.c:859 +#: gtk/gtklabel.c:883 msgid "Whether to select the contents of a selectable label when it is focused" msgstr "فيما اذا سيتم اختيار محتويات التسمية عند التركيز عليها" -#: gtk/gtklayout.c:617 gtk/gtkviewport.c:106 +#: gtk/gtklayout.c:581 gtk/gtkviewport.c:134 msgid "Horizontal adjustment" msgstr "ضبط أفقي" -#: gtk/gtklayout.c:618 gtk/gtkscrolledwindow.c:219 +#: gtk/gtklayout.c:582 gtk/gtkscrolledwindow.c:236 msgid "The GtkAdjustment for the horizontal position" msgstr "GtkAdjustment للموقع الأفقي" -#: gtk/gtklayout.c:625 gtk/gtkviewport.c:114 +#: gtk/gtklayout.c:589 gtk/gtkviewport.c:142 msgid "Vertical adjustment" msgstr "ضبط عمودي" -#: gtk/gtklayout.c:626 gtk/gtkscrolledwindow.c:226 +#: gtk/gtklayout.c:590 gtk/gtkscrolledwindow.c:243 msgid "The GtkAdjustment for the vertical position" msgstr "GtkAdjustment للموقع العمودي" -#: gtk/gtklayout.c:634 +#: gtk/gtklayout.c:598 msgid "The width of the layout" msgstr "عرض التصميم" -#: gtk/gtklayout.c:643 +#: gtk/gtklayout.c:607 msgid "The height of the layout" msgstr "ارتفاع التصميم" @@ -3416,179 +3315,179 @@ msgstr "تمت زيارته" msgid "Whether this link has been visited." msgstr "فيما إذا تمت زيارة هذا الرابط" -#: gtk/gtkmenu.c:502 +#: gtk/gtkmenu.c:509 msgid "The currently selected menu item" msgstr "اسم عنصر القائمة المحدد حالياً" -#: gtk/gtkmenu.c:517 +#: gtk/gtkmenu.c:524 msgid "The accel group holding accelerators for the menu" msgstr "المسرّع مجموعة accel للقائمة" -#: gtk/gtkmenu.c:531 gtk/gtkmenuitem.c:290 +#: gtk/gtkmenu.c:538 gtk/gtkmenuitem.c:290 msgid "Accel Path" msgstr "مسار Accel" -#: gtk/gtkmenu.c:532 +#: gtk/gtkmenu.c:539 msgid "An accel path used to conveniently construct accel paths of child items" msgstr "مسار الـ accel المستخدم لتسهيل بناء مسارات الـ accel للعناصر الأبناء" -#: gtk/gtkmenu.c:548 +#: gtk/gtkmenu.c:555 msgid "Attach Widget" msgstr "ربط ودجة" -#: gtk/gtkmenu.c:549 +#: gtk/gtkmenu.c:556 msgid "The widget the menu is attached to" msgstr "الودجة التي ترتبط بها القائمة" -#: gtk/gtkmenu.c:557 +#: gtk/gtkmenu.c:564 msgid "" "A title that may be displayed by the window manager when this menu is torn-" "off" msgstr "عنوان قد يعرض من قبل مدير النوافذ عند قطف هذه القائمة" -#: gtk/gtkmenu.c:571 +#: gtk/gtkmenu.c:578 msgid "Tearoff State" msgstr "حالة القطع" -#: gtk/gtkmenu.c:572 +#: gtk/gtkmenu.c:579 msgid "A boolean that indicates whether the menu is torn-off" msgstr "عدد منطقي يحدد ما إذا كانت القائمة مغلقة أم لا" -#: gtk/gtkmenu.c:586 +#: gtk/gtkmenu.c:593 msgid "Monitor" msgstr "الشاشة" -#: gtk/gtkmenu.c:587 +#: gtk/gtkmenu.c:594 msgid "The monitor the menu will be popped up on" msgstr "الشاشة التي ستنبثق عليها القائمة" -#: gtk/gtkmenu.c:593 +#: gtk/gtkmenu.c:600 msgid "Vertical Padding" msgstr "الحشو العمودي" -#: gtk/gtkmenu.c:594 +#: gtk/gtkmenu.c:601 msgid "Extra space at the top and bottom of the menu" msgstr "مساحة اضافية لأعلى وأسفل القائمة" -#: gtk/gtkmenu.c:616 +#: gtk/gtkmenu.c:623 msgid "Reserve Toggle Size" msgstr "" -#: gtk/gtkmenu.c:617 +#: gtk/gtkmenu.c:624 #, fuzzy msgid "" "A boolean that indicates whether the menu reserves space for toggles and " "icons" msgstr "عدد منطقي يحدد ما إذا كانت القائمة مغلقة أم لا" -#: gtk/gtkmenu.c:623 +#: gtk/gtkmenu.c:630 msgid "Horizontal Padding" msgstr "الحشو الأفقي" -#: gtk/gtkmenu.c:624 +#: gtk/gtkmenu.c:631 msgid "Extra space at the left and right edges of the menu" msgstr "فراغ اضافي عند حواف القائمة يمينا ويسارا" -#: gtk/gtkmenu.c:632 +#: gtk/gtkmenu.c:639 msgid "Vertical Offset" msgstr "التكافؤ العمودي" -#: gtk/gtkmenu.c:633 +#: gtk/gtkmenu.c:640 msgid "" "When the menu is a submenu, position it this number of pixels offset " "vertically" msgstr "" "عندما تكون القائمة قائمة فرعيّة تموقع هذا العدد من البكسلات عموديّا كتعويض" -#: gtk/gtkmenu.c:641 +#: gtk/gtkmenu.c:648 msgid "Horizontal Offset" msgstr "التكافؤ العمودي" -#: gtk/gtkmenu.c:642 +#: gtk/gtkmenu.c:649 msgid "" "When the menu is a submenu, position it this number of pixels offset " "horizontally" msgstr "عندما·تكون·القائمة·قائمة·فرعيّة·تموقع·هذا·العدد·من·البكسلات·أفقيّا·كتعويض" -#: gtk/gtkmenu.c:650 +#: gtk/gtkmenu.c:657 msgid "Double Arrows" msgstr "أسهم مزدوجة" -#: gtk/gtkmenu.c:651 +#: gtk/gtkmenu.c:658 msgid "When scrolling, always show both arrows." msgstr "عند التحريك اظهر كل الأسهم" -#: gtk/gtkmenu.c:664 +#: gtk/gtkmenu.c:671 #, fuzzy msgid "Arrow Placement" msgstr "إزاحة السهم في س" -#: gtk/gtkmenu.c:665 +#: gtk/gtkmenu.c:672 msgid "Indicates where scroll arrows should be placed" msgstr "" -#: gtk/gtkmenu.c:673 +#: gtk/gtkmenu.c:680 msgid "Left Attach" msgstr "ربط على اليسار" -#: gtk/gtkmenu.c:674 gtk/gtktable.c:174 +#: gtk/gtkmenu.c:681 gtk/gtktable.c:174 msgid "The column number to attach the left side of the child to" msgstr "رقم العمود الذي إليه ستربط الجهة اليسرى للإبن" -#: gtk/gtkmenu.c:681 +#: gtk/gtkmenu.c:688 msgid "Right Attach" msgstr "ربط على اليمين" -#: gtk/gtkmenu.c:682 +#: gtk/gtkmenu.c:689 msgid "The column number to attach the right side of the child to" msgstr "رقم·العمود·الذي·إليه·ستربط·الجهة·اليمنى·للإبن" -#: gtk/gtkmenu.c:689 +#: gtk/gtkmenu.c:696 msgid "Top Attach" msgstr "ربط بالأعلى" -#: gtk/gtkmenu.c:690 +#: gtk/gtkmenu.c:697 msgid "The row number to attach the top of the child to" msgstr "رقم·السطر·الذي·إليه·ستربط·الجهة·العليا·للإبن" -#: gtk/gtkmenu.c:697 +#: gtk/gtkmenu.c:704 msgid "Bottom Attach" msgstr "ربط بالأسفل" -#: gtk/gtkmenu.c:698 gtk/gtktable.c:195 +#: gtk/gtkmenu.c:705 gtk/gtktable.c:195 msgid "The row number to attach the bottom of the child to" msgstr "رقم·السطر·الذي·إليه·ستربط·الجهة·السفلى·للإبن" -#: gtk/gtkmenu.c:712 +#: gtk/gtkmenu.c:719 msgid "Arbitrary constant to scale down the size of the scroll arrow" msgstr "" -#: gtk/gtkmenu.c:799 +#: gtk/gtkmenu.c:806 msgid "Can change accelerators" msgstr "من الممكن تغيير مفاتيح الاختصار" -#: gtk/gtkmenu.c:800 +#: gtk/gtkmenu.c:807 msgid "" "Whether menu accelerators can be changed by pressing a key over the menu item" msgstr "" "فيما اذا كان من الممكن تغيير مفاتيح اختصار القوائم بضغط مفتاح فوق عنصر " "القائمة" -#: gtk/gtkmenu.c:805 +#: gtk/gtkmenu.c:812 msgid "Delay before submenus appear" msgstr "التأخير قبل ظهور القوائم المحوية" -#: gtk/gtkmenu.c:806 +#: gtk/gtkmenu.c:813 msgid "" "Minimum time the pointer must stay over a menu item before the submenu appear" msgstr "" "الوقت الأدنى الذي يجب أن يبقى فيه المؤشر فوق عنصر قائمة لتظهر القائمة المحوية" -#: gtk/gtkmenu.c:813 +#: gtk/gtkmenu.c:820 msgid "Delay before hiding a submenu" msgstr "التأخير قبل اخفاء قائمة محوية" -#: gtk/gtkmenu.c:814 +#: gtk/gtkmenu.c:821 msgid "" "The time before hiding a submenu when the pointer is moving towards the " "submenu" @@ -3614,7 +3513,7 @@ msgstr "اتجاه حزمة الإبن لشريط القائمة" msgid "Style of bevel around the menubar" msgstr "أسلوب الحافة حول عمود القوائم" -#: gtk/gtkmenubar.c:202 gtk/gtktoolbar.c:590 +#: gtk/gtkmenubar.c:202 gtk/gtktoolbar.c:535 msgid "Internal padding" msgstr "الحشو الداخلي" @@ -3669,76 +3568,76 @@ msgstr "العرض بالحروف" msgid "The minimum desired width of the menu item in characters" msgstr "الحد الأدنى للعرض المطلوب لعنصر القائمة بالحروف" -#: gtk/gtkmenushell.c:379 +#: gtk/gtkmenushell.c:382 msgid "Take Focus" msgstr "أخذ تركيز" -#: gtk/gtkmenushell.c:380 +#: gtk/gtkmenushell.c:383 msgid "A boolean that determines whether the menu grabs the keyboard focus" msgstr "عدد منطقي يحدد ما إذا كانت القائمة تأخذ تركيز لوحة المفاتيح أم لا" -#: gtk/gtkmenutoolbutton.c:245 gtk/gtkoptionmenu.c:161 +#: gtk/gtkmenutoolbutton.c:243 msgid "Menu" msgstr "القائمة" -#: gtk/gtkmenutoolbutton.c:246 +#: gtk/gtkmenutoolbutton.c:244 msgid "The dropdown menu" msgstr "القائمة النازلة" -#: gtk/gtkmessagedialog.c:98 +#: gtk/gtkmessagedialog.c:145 msgid "Image/label border" msgstr "حد الصورة/الشارة" -#: gtk/gtkmessagedialog.c:99 +#: gtk/gtkmessagedialog.c:146 msgid "Width of border around the label and image in the message dialog" msgstr "عرض الحد حول الشارة والصورة في حوار الرسالة" -#: gtk/gtkmessagedialog.c:114 +#: gtk/gtkmessagedialog.c:161 msgid "Use separator" msgstr "استخدم فاصل" -#: gtk/gtkmessagedialog.c:115 +#: gtk/gtkmessagedialog.c:162 msgid "" "Whether to put a separator between the message dialog's text and the buttons" msgstr "فيما إذا سيوضع فاصل بين نص حوار الرسالة و الأزرار" -#: gtk/gtkmessagedialog.c:136 +#: gtk/gtkmessagedialog.c:183 msgid "Message Buttons" msgstr "أزرار الرسالة" -#: gtk/gtkmessagedialog.c:137 +#: gtk/gtkmessagedialog.c:184 msgid "The buttons shown in the message dialog" msgstr "الأزرار المعروضة في حوار الرسالة" -#: gtk/gtkmessagedialog.c:154 +#: gtk/gtkmessagedialog.c:201 msgid "The primary text of the message dialog" msgstr "النص الأولي لرسالة الحوار" -#: gtk/gtkmessagedialog.c:169 +#: gtk/gtkmessagedialog.c:216 msgid "Use Markup" msgstr "استمل التشكيل" -#: gtk/gtkmessagedialog.c:170 +#: gtk/gtkmessagedialog.c:217 msgid "The primary text of the title includes Pango markup." msgstr "النص الأولي للعنوان يحتوي على تشكيل بانغو Pango." -#: gtk/gtkmessagedialog.c:184 +#: gtk/gtkmessagedialog.c:231 msgid "Secondary Text" msgstr "النص الثانوي" -#: gtk/gtkmessagedialog.c:185 +#: gtk/gtkmessagedialog.c:232 msgid "The secondary text of the message dialog" msgstr "النص الثانوي لرسالة الحوار" -#: gtk/gtkmessagedialog.c:200 +#: gtk/gtkmessagedialog.c:247 msgid "Use Markup in secondary" msgstr "استخدم تشكيل في الثانوي" -#: gtk/gtkmessagedialog.c:201 +#: gtk/gtkmessagedialog.c:248 msgid "The secondary text includes Pango markup." msgstr "النص الثانوي يحتوي على تشكيل بانغو Pango." -#: gtk/gtkmessagedialog.c:216 +#: gtk/gtkmessagedialog.c:263 msgid "The image" msgstr "الصورة" @@ -3788,75 +3687,51 @@ msgstr "هل سنُظهر مربع حوار" msgid "The screen where this window will be displayed." msgstr "الشاشة التي ستعرض فيها هذه النافذة" -#: gtk/gtknotebook.c:585 +#: gtk/gtknotebook.c:571 msgid "Page" msgstr "صفحة" -#: gtk/gtknotebook.c:586 +#: gtk/gtknotebook.c:572 msgid "The index of the current page" msgstr "دليل الصفحة الحالية" -#: gtk/gtknotebook.c:594 +#: gtk/gtknotebook.c:580 msgid "Tab Position" msgstr "موقع اللسان" -#: gtk/gtknotebook.c:595 +#: gtk/gtknotebook.c:581 msgid "Which side of the notebook holds the tabs" msgstr "أي جهة من الدفتر تحوي الألسنة" -#: gtk/gtknotebook.c:602 -msgid "Tab Border" -msgstr "حد اللسان" - -#: gtk/gtknotebook.c:603 -msgid "Width of the border around the tab labels" -msgstr "عرض الحد حول شارات الألسنة" - -#: gtk/gtknotebook.c:611 -msgid "Horizontal Tab Border" -msgstr "حد اللسان الأفقي" - -#: gtk/gtknotebook.c:612 -msgid "Width of the horizontal border of tab labels" -msgstr "عرض الحد الأفقي لشارات الألسنة" - -#: gtk/gtknotebook.c:620 -msgid "Vertical Tab Border" -msgstr "الحد العمودي للسان" - -#: gtk/gtknotebook.c:621 -msgid "Width of the vertical border of tab labels" -msgstr "عرض الحد العمودي لشارات اللسان" - -#: gtk/gtknotebook.c:629 +#: gtk/gtknotebook.c:588 msgid "Show Tabs" msgstr "عرض الألسنة" -#: gtk/gtknotebook.c:630 +#: gtk/gtknotebook.c:589 msgid "Whether tabs should be shown or not" msgstr "فيما إذا كان سيتم عرض الألسنة أم لا" -#: gtk/gtknotebook.c:636 +#: gtk/gtknotebook.c:595 msgid "Show Border" msgstr "عرض الحد" -#: gtk/gtknotebook.c:637 +#: gtk/gtknotebook.c:596 msgid "Whether the border should be shown or not" msgstr "فيما إذا كان سيتم عرض الحد أم لا" -#: gtk/gtknotebook.c:643 +#: gtk/gtknotebook.c:602 msgid "Scrollable" msgstr "قابل للف" -#: gtk/gtknotebook.c:644 +#: gtk/gtknotebook.c:603 msgid "If TRUE, scroll arrows are added if there are too many tabs to fit" msgstr "إذا كان TRUE، فستضاف أسهم لف إذا كانت هناك ألسنة كثيرة للملائمة" -#: gtk/gtknotebook.c:650 +#: gtk/gtknotebook.c:609 msgid "Enable Popup" msgstr "تفعيل النوافذ البارزة" -#: gtk/gtknotebook.c:651 +#: gtk/gtknotebook.c:610 msgid "" "If TRUE, pressing the right mouse button on the notebook pops up a menu that " "you can use to go to a page" @@ -3864,217 +3739,185 @@ msgstr "" "إذا كان TRUE، فإن كبس زر الفأرة الأيمن على الدفتر يبرز لك قائمة تمكنك من " "الذهاب لصفحة" -#: gtk/gtknotebook.c:658 -msgid "Whether tabs should have homogeneous sizes" -msgstr "فيما إذا وجب أن يكون للألسنة أحجام متناسقة" - -#: gtk/gtknotebook.c:664 -msgid "Group ID" -msgstr "هويّة المجموعة" - -#: gtk/gtknotebook.c:665 -msgid "Group ID for tabs drag and drop" -msgstr "هويّة المجموعة لسحب و إلقاء الألسنة" - -#: gtk/gtknotebook.c:681 gtk/gtkradioaction.c:128 gtk/gtkradiobutton.c:82 +#: gtk/gtknotebook.c:624 gtk/gtkradioaction.c:140 gtk/gtkradiobutton.c:159 #: gtk/gtkradiomenuitem.c:353 gtk/gtkradiotoolbutton.c:65 msgid "Group" msgstr "مجموعة" -#: gtk/gtknotebook.c:682 +#: gtk/gtknotebook.c:625 msgid "Group for tabs drag and drop" msgstr "جمع الألسنة للأخذ و السحب" -#: gtk/gtknotebook.c:688 +#: gtk/gtknotebook.c:631 msgid "Tab label" msgstr "شارة اللسان" -#: gtk/gtknotebook.c:689 +#: gtk/gtknotebook.c:632 msgid "The string displayed on the child's tab label" msgstr "السلسلة المعروضة على شارة ابن اللسان" -#: gtk/gtknotebook.c:695 +#: gtk/gtknotebook.c:638 msgid "Menu label" msgstr "شارة القائمة" -#: gtk/gtknotebook.c:696 +#: gtk/gtknotebook.c:639 msgid "The string displayed in the child's menu entry" msgstr "السلسلة المعروضة في خانة قائمة الابن" -#: gtk/gtknotebook.c:709 +#: gtk/gtknotebook.c:652 msgid "Tab expand" msgstr "تمديد اللسان" -#: gtk/gtknotebook.c:710 +#: gtk/gtknotebook.c:653 msgid "Whether to expand the child's tab or not" msgstr "فيما إذا وجب تمديد لسان الأبن أم لا" -#: gtk/gtknotebook.c:716 +#: gtk/gtknotebook.c:659 msgid "Tab fill" msgstr "ملأ اللسان" -#: gtk/gtknotebook.c:717 +#: gtk/gtknotebook.c:660 msgid "Whether the child's tab should fill the allocated area or not" msgstr "فيما إذا وجب للسان الإبن ملأ المساحة المخصصة" -#: gtk/gtknotebook.c:723 +#: gtk/gtknotebook.c:666 msgid "Tab pack type" msgstr "نوع حزم الألسنة" -#: gtk/gtknotebook.c:730 +#: gtk/gtknotebook.c:673 msgid "Tab reorderable" msgstr "لسان قابل لمراجعة التصفيف" -#: gtk/gtknotebook.c:731 +#: gtk/gtknotebook.c:674 msgid "Whether the tab is reorderable by user action or not" msgstr "فيما إذا كان فيما إذا كان اللسان قابلا لمراجعة التصفيف" -#: gtk/gtknotebook.c:737 +#: gtk/gtknotebook.c:680 msgid "Tab detachable" msgstr "لسان قابل للقطع" -#: gtk/gtknotebook.c:738 +#: gtk/gtknotebook.c:681 msgid "Whether the tab is detachable" msgstr "فيما إذا كان اللسان قابلا للقطع" -#: gtk/gtknotebook.c:753 gtk/gtkscrollbar.c:81 +#: gtk/gtknotebook.c:696 gtk/gtkscrollbar.c:81 msgid "Secondary backward stepper" msgstr "متخطي التراجع الثانوي" -#: gtk/gtknotebook.c:754 +#: gtk/gtknotebook.c:697 msgid "" "Display a second backward arrow button on the opposite end of the tab area" msgstr "اعرض زر سهم التراجع الثانوي على النهاية المقابلة لمساحة اللسان" -#: gtk/gtknotebook.c:769 gtk/gtkscrollbar.c:88 +#: gtk/gtknotebook.c:712 gtk/gtkscrollbar.c:88 msgid "Secondary forward stepper" msgstr "متخطي التقدم الثانوي" -#: gtk/gtknotebook.c:770 +#: gtk/gtknotebook.c:713 msgid "" "Display a second forward arrow button on the opposite end of the tab area" msgstr "اعرض زر سهم التقدم الثانوي على النهاية المقابلة لمساحة اللسان" -#: gtk/gtknotebook.c:784 gtk/gtkscrollbar.c:67 +#: gtk/gtknotebook.c:727 gtk/gtkscrollbar.c:67 msgid "Backward stepper" msgstr "متخطي التراجع" -#: gtk/gtknotebook.c:785 gtk/gtkscrollbar.c:68 +#: gtk/gtknotebook.c:728 gtk/gtkscrollbar.c:68 msgid "Display the standard backward arrow button" msgstr "عرض زر سهم التراجع القياسي" -#: gtk/gtknotebook.c:799 gtk/gtkscrollbar.c:74 +#: gtk/gtknotebook.c:742 gtk/gtkscrollbar.c:74 msgid "Forward stepper" msgstr "متخطي التقدم" -#: gtk/gtknotebook.c:800 gtk/gtkscrollbar.c:75 +#: gtk/gtknotebook.c:743 gtk/gtkscrollbar.c:75 msgid "Display the standard forward arrow button" msgstr "عرض زر سهم التقدم القياسي" -#: gtk/gtknotebook.c:814 +#: gtk/gtknotebook.c:757 msgid "Tab overlap" msgstr "تداخل اللسان" -#: gtk/gtknotebook.c:815 +#: gtk/gtknotebook.c:758 msgid "Size of tab overlap area" msgstr "حجم منطقة تداخل اللسان" -#: gtk/gtknotebook.c:830 +#: gtk/gtknotebook.c:773 msgid "Tab curvature" msgstr "تقوس اللسان" -#: gtk/gtknotebook.c:831 +#: gtk/gtknotebook.c:774 msgid "Size of tab curvature" msgstr "حجم تقوس اللسان" -#: gtk/gtknotebook.c:847 +#: gtk/gtknotebook.c:790 msgid "Arrow spacing" msgstr "مباعدة الأسهم" -#: gtk/gtknotebook.c:848 +#: gtk/gtknotebook.c:791 msgid "Scroll arrow spacing" msgstr "فراغات عمود اللف" -#: gtk/gtkobject.c:370 -msgid "User Data" -msgstr "البيانات الشخصية" - -#: gtk/gtkobject.c:371 -msgid "Anonymous User Data Pointer" -msgstr "مؤشّر لبيانات شخص مجهول" - -#: gtk/gtkoptionmenu.c:162 -msgid "The menu of options" -msgstr "قائمة الخيارات" - -#: gtk/gtkoptionmenu.c:169 -msgid "Size of dropdown indicator" -msgstr "حجم مؤشر الإسقاط السفلي" - -#: gtk/gtkoptionmenu.c:175 -msgid "Spacing around indicator" -msgstr "الفراغات حول المؤشر" - -#: gtk/gtkorientable.c:75 +#: gtk/gtkorientable.c:64 #, fuzzy msgid "The orientation of the orientable" msgstr "اتجاه التحجيم" -#: gtk/gtkpaned.c:242 +#: gtk/gtkpaned.c:243 msgid "" "Position of paned separator in pixels (0 means all the way to the left/top)" msgstr "" "موقع الفاصل المحاط بلوحة بالبكسلات (0 يعني كامل المسافة إلى اليسار/الأعلى)" -#: gtk/gtkpaned.c:251 +#: gtk/gtkpaned.c:252 msgid "Position Set" msgstr "ضبط الموقع" -#: gtk/gtkpaned.c:252 +#: gtk/gtkpaned.c:253 msgid "TRUE if the Position property should be used" msgstr " TRUE إذا ما وجب استخدام خاصية الموقع" -#: gtk/gtkpaned.c:258 +#: gtk/gtkpaned.c:259 msgid "Handle Size" msgstr "حجم المقبض" -#: gtk/gtkpaned.c:259 +#: gtk/gtkpaned.c:260 msgid "Width of handle" msgstr "عرض المقبض" -#: gtk/gtkpaned.c:275 +#: gtk/gtkpaned.c:276 msgid "Minimal Position" msgstr "الموقع الأدنى" -#: gtk/gtkpaned.c:276 +#: gtk/gtkpaned.c:277 msgid "Smallest possible value for the \"position\" property" msgstr "أصغر قيمة ممكنة لخاصية \"الموقع\"" -#: gtk/gtkpaned.c:293 +#: gtk/gtkpaned.c:294 msgid "Maximal Position" msgstr "الموقع الأقصى" -#: gtk/gtkpaned.c:294 +#: gtk/gtkpaned.c:295 msgid "Largest possible value for the \"position\" property" msgstr "أكبر قيمة ممكنة لخاصية \"الموقع\"" -#: gtk/gtkpaned.c:311 +#: gtk/gtkpaned.c:312 msgid "Resize" msgstr "تحجيم" -#: gtk/gtkpaned.c:312 +#: gtk/gtkpaned.c:313 msgid "If TRUE, the child expands and shrinks along with the paned widget" msgstr "إذا ضبط لـ ·TRUE، فيتمدّد و يتقلصّ الأبن مع الودجة المحاطة بلوح" -#: gtk/gtkpaned.c:327 +#: gtk/gtkpaned.c:328 msgid "Shrink" msgstr "تقليص" -#: gtk/gtkpaned.c:328 +#: gtk/gtkpaned.c:329 msgid "If TRUE, the child can be made smaller than its requisition" msgstr "إذا ضبط لـ TRUE، فيمكن جعل الإبن أصغر من إستدعائه" -#: gtk/gtkplug.c:171 gtk/gtkstatusicon.c:312 +#: gtk/gtkplug.c:171 gtk/gtkstatusicon.c:317 msgid "Embedded" msgstr "مدمج" @@ -4090,88 +3933,83 @@ msgstr "نافذة المقبس" msgid "The window of the socket the plug is embedded in" msgstr "نافذة المقبس الذي يتضمن الملحق" -#: gtk/gtkpreview.c:102 -msgid "" -"Whether the preview widget should take up the entire space it is allocated" -msgstr "فيما إذا وجب أن تملأ ودجة·التلميح كامل المساحة التي خصصة لها" - -#: gtk/gtkprinter.c:112 +#: gtk/gtkprinter.c:131 msgid "Name of the printer" msgstr "اسم الطابعة" -#: gtk/gtkprinter.c:118 +#: gtk/gtkprinter.c:137 msgid "Backend" msgstr "نهاية خلفية" -#: gtk/gtkprinter.c:119 +#: gtk/gtkprinter.c:138 msgid "Backend for the printer" msgstr "النهاية الخلفية للطابعة" -#: gtk/gtkprinter.c:125 +#: gtk/gtkprinter.c:144 msgid "Is Virtual" msgstr "خيالي" -#: gtk/gtkprinter.c:126 +#: gtk/gtkprinter.c:145 msgid "FALSE if this represents a real hardware printer" msgstr "خطأ إذا كانت هذه تمثل طابعة حقيقية" -#: gtk/gtkprinter.c:132 +#: gtk/gtkprinter.c:151 msgid "Accepts PDF" msgstr "تقبل PDF" -#: gtk/gtkprinter.c:133 +#: gtk/gtkprinter.c:152 msgid "TRUE if this printer can accept PDF" msgstr "صحيح اذا كانت الطابعة تقبل PDF" -#: gtk/gtkprinter.c:139 +#: gtk/gtkprinter.c:158 msgid "Accepts PostScript" msgstr "تقبل PostScript" -#: gtk/gtkprinter.c:140 +#: gtk/gtkprinter.c:159 msgid "TRUE if this printer can accept PostScript" msgstr "صحيح اذا كانت الطابعة تقبل PostScript" -#: gtk/gtkprinter.c:146 +#: gtk/gtkprinter.c:165 msgid "State Message" msgstr "رسالة الحالة" -#: gtk/gtkprinter.c:147 +#: gtk/gtkprinter.c:166 msgid "String giving the current state of the printer" msgstr "النص الشارح للحالة الحالية للطابعة" -#: gtk/gtkprinter.c:153 +#: gtk/gtkprinter.c:172 msgid "Location" msgstr "الموقع" -#: gtk/gtkprinter.c:154 +#: gtk/gtkprinter.c:173 msgid "The location of the printer" msgstr "مكان الطابعة" -#: gtk/gtkprinter.c:161 +#: gtk/gtkprinter.c:180 msgid "The icon name to use for the printer" msgstr "اسم الإيقونة المستعملة للطابعة" -#: gtk/gtkprinter.c:167 +#: gtk/gtkprinter.c:186 msgid "Job Count" msgstr "عدد الأعمال" -#: gtk/gtkprinter.c:168 +#: gtk/gtkprinter.c:187 msgid "Number of jobs queued in the printer" msgstr "عدد الأشغال المنتظرة للطبع" -#: gtk/gtkprinter.c:186 +#: gtk/gtkprinter.c:205 msgid "Paused Printer" msgstr "طابعة متوقفة مؤقتاً" -#: gtk/gtkprinter.c:187 +#: gtk/gtkprinter.c:206 msgid "TRUE if this printer is paused" msgstr "صحيح إذا كانت الطابعة متوقفة مؤقتاً" -#: gtk/gtkprinter.c:200 +#: gtk/gtkprinter.c:219 msgid "Accepting Jobs" msgstr "تقبل المهام" -#: gtk/gtkprinter.c:201 +#: gtk/gtkprinter.c:220 msgid "TRUE if this printer is accepting new jobs" msgstr "صحيح إذا كانت الطابعة تقبل المهام الجديدة" @@ -4346,7 +4184,7 @@ msgid "Has Selection" msgstr "له اختيار" #: gtk/gtkprintoperation.c:1297 -msgid "TRUE if a selecion exists." +msgid "TRUE if a selection exists." msgstr "" #: gtk/gtkprintoperation.c:1312 gtk/gtkprintunixdialog.c:361 @@ -4424,67 +4262,27 @@ msgstr "اظهار نص" msgid "Whether the progress is shown as text." msgstr "فيما إذا كان التقدم سيعرض كنص" -#: gtk/gtkprogressbar.c:119 -msgid "The GtkAdjustment connected to the progress bar (Deprecated)" -msgstr "GtkAdjustment المرتبط بعمود التطوّر (ملغى)" - -#: gtk/gtkprogressbar.c:135 -msgid "Bar style" -msgstr "أسلوب العمود" - -#: gtk/gtkprogressbar.c:136 -msgid "Specifies the visual style of the bar in percentage mode (Deprecated)" -msgstr "يحدد الأسلوب المرئي للعمود بنسق النسبة المائوية (ملغاة)" - -#: gtk/gtkprogressbar.c:144 -msgid "Activity Step" -msgstr "خطوة النشاط" - -#: gtk/gtkprogressbar.c:145 -msgid "The increment used for each iteration in activity mode (Deprecated)" -msgstr "التزايد المستخدم لكل تكرار في نسق النشاط (ملغى)" - -#: gtk/gtkprogressbar.c:152 -msgid "Activity Blocks" -msgstr "قوالب النشاط" - -#: gtk/gtkprogressbar.c:153 -msgid "" -"The number of blocks which can fit in the progress bar area in activity mode " -"(Deprecated)" -msgstr "عدد القوالب التي يمكن أن تلائم منطقة عمود التقدم في نسق النشاط (ملغاة)" - -#: gtk/gtkprogressbar.c:160 -msgid "Discrete Blocks" -msgstr "القوالب المتقطعة" - -#: gtk/gtkprogressbar.c:161 -msgid "" -"The number of discrete blocks in a progress bar (when shown in the discrete " -"style)" -msgstr "عدد القوالب المتقطعة في عمود التقدم (عند عرضها بالأسلوب المتقطع)" - -#: gtk/gtkprogressbar.c:168 +#: gtk/gtkprogressbar.c:121 msgid "Fraction" msgstr "جزء" -#: gtk/gtkprogressbar.c:169 +#: gtk/gtkprogressbar.c:122 msgid "The fraction of total work that has been completed" msgstr "جزء من العمل الذي تم" -#: gtk/gtkprogressbar.c:176 +#: gtk/gtkprogressbar.c:129 msgid "Pulse Step" msgstr "خطوة النبض" -#: gtk/gtkprogressbar.c:177 +#: gtk/gtkprogressbar.c:130 msgid "The fraction of total progress to move the bouncing block when pulsed" msgstr "جزء التقدم الكلي لتحريك الكتلة القافزة عند النبض" -#: gtk/gtkprogressbar.c:185 +#: gtk/gtkprogressbar.c:138 msgid "Text to be displayed in the progress bar" msgstr "النص الذي سيعرض في عمود التقدم" -#: gtk/gtkprogressbar.c:207 +#: gtk/gtkprogressbar.c:160 msgid "" "The preferred place to ellipsize the string, if the progress bar does not " "have enough room to display the entire string, if at all." @@ -4492,59 +4290,59 @@ msgstr "" "المكان المفضل لوضع القطع في النص، إذا كان شريط التقدم لا يملك المكان الكافي " "لعرض كل النص" -#: gtk/gtkprogressbar.c:214 +#: gtk/gtkprogressbar.c:167 msgid "XSpacing" msgstr "فراغات س" -#: gtk/gtkprogressbar.c:215 +#: gtk/gtkprogressbar.c:168 msgid "Extra spacing applied to the width of a progress bar." msgstr "فضاء اضافي مطبق لعرض شريط التقدم." -#: gtk/gtkprogressbar.c:220 +#: gtk/gtkprogressbar.c:173 msgid "YSpacing" msgstr "فراغات ع" -#: gtk/gtkprogressbar.c:221 +#: gtk/gtkprogressbar.c:174 msgid "Extra spacing applied to the height of a progress bar." msgstr "فضاء اضافي مطبق لطول شريط التقدم." -#: gtk/gtkprogressbar.c:234 +#: gtk/gtkprogressbar.c:187 msgid "Min horizontal bar width" msgstr "العرض الأفقي الأدنى للشريط" -#: gtk/gtkprogressbar.c:235 +#: gtk/gtkprogressbar.c:188 msgid "The minimum horizontal width of the progress bar" msgstr "الحد الأدنى للعرض الأفقي لشريط التقدم" -#: gtk/gtkprogressbar.c:247 +#: gtk/gtkprogressbar.c:200 msgid "Min horizontal bar height" msgstr "الارتفاع الأفقي الأدنى للشريط" -#: gtk/gtkprogressbar.c:248 +#: gtk/gtkprogressbar.c:201 msgid "Minimum horizontal height of the progress bar" msgstr "الحد الأدنى للارتفاع الأفقي لشريط التقدم" -#: gtk/gtkprogressbar.c:260 +#: gtk/gtkprogressbar.c:213 msgid "Min vertical bar width" msgstr "العرض العمودي الأدنى للشريط" -#: gtk/gtkprogressbar.c:261 +#: gtk/gtkprogressbar.c:214 msgid "The minimum vertical width of the progress bar" msgstr "الحد الأدنى للعرض العمودي لشريط التقدم" -#: gtk/gtkprogressbar.c:273 +#: gtk/gtkprogressbar.c:226 msgid "Min vertical bar height" msgstr "الارتفاع العمودي الأدنى للشريط" -#: gtk/gtkprogressbar.c:274 +#: gtk/gtkprogressbar.c:227 msgid "The minimum vertical height of the progress bar" msgstr "الحد الأدنى للارتفاع العمودي لشريط التقدم" -#: gtk/gtkradioaction.c:111 +#: gtk/gtkradioaction.c:123 msgid "The value" msgstr "القيمة" -#: gtk/gtkradioaction.c:112 +#: gtk/gtkradioaction.c:124 msgid "" "The value returned by gtk_radio_action_get_current_value() when this action " "is the current action of its group." @@ -4552,21 +4350,21 @@ msgstr "" "القيمة المرجعة من قبل gtk_radio_action_get_current_value() عندما يكون هذا " "الحدث هو الحدث الحالي لمجموعته." -#: gtk/gtkradioaction.c:129 +#: gtk/gtkradioaction.c:141 msgid "The radio action whose group this action belongs to." msgstr "عمل الراديو صاحب المجموعة المحتوية على هذه القطعة" -#: gtk/gtkradioaction.c:144 +#: gtk/gtkradioaction.c:156 msgid "The current value" msgstr "القيمة الحالية" -#: gtk/gtkradioaction.c:145 +#: gtk/gtkradioaction.c:157 msgid "" "The value property of the currently active member of the group to which this " "action belongs." msgstr "خاصية القيمة للعضو الفعال حاليا المحتوي على هذا العمل." -#: gtk/gtkradiobutton.c:83 +#: gtk/gtkradiobutton.c:160 msgid "The radio button whose group this widget belongs to." msgstr "زر الراديو صاحب المجموعة المحتوية على هذه الودجة" @@ -4578,135 +4376,135 @@ msgstr "عنصر قائمة الراديو صاحب المجموعة المحت msgid "The radio tool button whose group this button belongs to." msgstr "زر الراديو صاحب المجموعة المحتوية على هذا الزر" -#: gtk/gtkrange.c:358 +#: gtk/gtkrange.c:385 msgid "Update policy" msgstr "سياسة التحديث" -#: gtk/gtkrange.c:359 +#: gtk/gtkrange.c:386 msgid "How the range should be updated on the screen" msgstr "كيفية تحديث المدى على الشاشة" -#: gtk/gtkrange.c:368 +#: gtk/gtkrange.c:395 msgid "The GtkAdjustment that contains the current value of this range object" msgstr "GtkAdjustment المحتوي على القيمة الحالية لجسم المدى هذا" -#: gtk/gtkrange.c:375 +#: gtk/gtkrange.c:402 msgid "Inverted" msgstr "معكوس" -#: gtk/gtkrange.c:376 +#: gtk/gtkrange.c:403 msgid "Invert direction slider moves to increase range value" msgstr "عكس الاتجاه الذي إليه ينتقل المتزحلق لزيادة قيمة المدى" -#: gtk/gtkrange.c:383 +#: gtk/gtkrange.c:410 msgid "Lower stepper sensitivity" msgstr "تخفيض حساسية المدرج" -#: gtk/gtkrange.c:384 +#: gtk/gtkrange.c:411 msgid "" "The sensitivity policy for the stepper that points to the adjustment's lower " "side" msgstr "سياسة الحساسية للدرج الموجه لتعديل الجانب السّفلي " -#: gtk/gtkrange.c:392 +#: gtk/gtkrange.c:419 msgid "Upper stepper sensitivity" msgstr "زيادة حساسية المدرج" -#: gtk/gtkrange.c:393 +#: gtk/gtkrange.c:420 msgid "" "The sensitivity policy for the stepper that points to the adjustment's upper " "side" msgstr "سياسة الحساسية للدرج الموجه لتعديل الجانب العلوي " -#: gtk/gtkrange.c:410 +#: gtk/gtkrange.c:437 msgid "Show Fill Level" msgstr "اعرض مستوى الملأ" -#: gtk/gtkrange.c:411 +#: gtk/gtkrange.c:438 msgid "Whether to display a fill level indicator graphics on trough." msgstr "فيما إذا يتم عرض منبه صوري للملأ على المحتوى." -#: gtk/gtkrange.c:427 +#: gtk/gtkrange.c:454 msgid "Restrict to Fill Level" msgstr "حدد بمستوى الملأ" -#: gtk/gtkrange.c:428 +#: gtk/gtkrange.c:455 msgid "Whether to restrict the upper boundary to the fill level." msgstr "فيما إذا يتم تحديد الحد العلوي لمستوى الملأ" -#: gtk/gtkrange.c:443 +#: gtk/gtkrange.c:470 msgid "Fill Level" msgstr "مستوى الملأ" -#: gtk/gtkrange.c:444 +#: gtk/gtkrange.c:471 msgid "The fill level." msgstr "مستوى الملأ" -#: gtk/gtkrange.c:452 +#: gtk/gtkrange.c:479 msgid "Slider Width" msgstr "عرض المتزحلق" -#: gtk/gtkrange.c:453 +#: gtk/gtkrange.c:480 msgid "Width of scrollbar or scale thumb" msgstr "عرض عمود اللف أو مربع القياس" -#: gtk/gtkrange.c:460 +#: gtk/gtkrange.c:487 msgid "Trough Border" msgstr "حد منخفض" -#: gtk/gtkrange.c:461 +#: gtk/gtkrange.c:488 msgid "Spacing between thumb/steppers and outer trough bevel" msgstr "الفراغات بين المربع/المتخطي والحافة المنحدرة الخارجية" -#: gtk/gtkrange.c:468 +#: gtk/gtkrange.c:495 msgid "Stepper Size" msgstr "حجم المتخطي" -#: gtk/gtkrange.c:469 +#: gtk/gtkrange.c:496 msgid "Length of step buttons at ends" msgstr "طول أزرار الخطوات عند النهايات" -#: gtk/gtkrange.c:484 +#: gtk/gtkrange.c:511 msgid "Stepper Spacing" msgstr "فراغات المتخطي" -#: gtk/gtkrange.c:485 +#: gtk/gtkrange.c:512 msgid "Spacing between step buttons and thumb" msgstr "الفراغات بين أزرار الخطوات والإبهام" -#: gtk/gtkrange.c:492 +#: gtk/gtkrange.c:519 msgid "Arrow X Displacement" msgstr "إزاحة السهم في س" -#: gtk/gtkrange.c:493 +#: gtk/gtkrange.c:520 msgid "" "How far in the x direction to move the arrow when the button is depressed" msgstr "مقدار تحريك السهم باتجاه س عند تحرير الزر" -#: gtk/gtkrange.c:500 +#: gtk/gtkrange.c:527 msgid "Arrow Y Displacement" msgstr "إزاحة السهم في ص" -#: gtk/gtkrange.c:501 +#: gtk/gtkrange.c:528 msgid "" "How far in the y direction to move the arrow when the button is depressed" msgstr "مقدار·تحريك·السهم·باتجاه·ص·عند·تحرير·الزر" -#: gtk/gtkrange.c:509 +#: gtk/gtkrange.c:536 msgid "Draw slider ACTIVE during drag" msgstr "رسم المتزلّج نشطا عند السّحب" -#: gtk/gtkrange.c:510 +#: gtk/gtkrange.c:537 msgid "" "With this option set to TRUE, sliders will be drawn ACTIVE and with shadow " "IN while they are dragged" msgstr "إذا كان صحيحا، يتم الرسم المزلجات كـ ACTIVE بظل IN عند سحبها" -#: gtk/gtkrange.c:524 +#: gtk/gtkrange.c:551 msgid "Trough Side Details" msgstr "انخفاض التفاصيل الجانبية" -#: gtk/gtkrange.c:525 +#: gtk/gtkrange.c:552 msgid "" "When TRUE, the parts of the trough on the two sides of the slider are drawn " "with different details" @@ -4714,101 +4512,101 @@ msgstr "" "إذا كان صحيحا، يتم رسم أجزاء المنخفض على الجانبين الإثنين للمتزلج بتفاصيل " "مختلفة" -#: gtk/gtkrange.c:541 +#: gtk/gtkrange.c:568 msgid "Trough Under Steppers" msgstr "انخفاض تحت المدرج" -#: gtk/gtkrange.c:542 +#: gtk/gtkrange.c:569 msgid "" "Whether to draw trough for full length of range or exclude the steppers and " "spacing" msgstr "فيما اذا يتم رسم الطول الكامل للمدى أو استثناء المباعدة و الدرجات" -#: gtk/gtkrange.c:555 +#: gtk/gtkrange.c:582 msgid "Arrow scaling" msgstr "تحجيم الأسهم" -#: gtk/gtkrange.c:556 +#: gtk/gtkrange.c:583 msgid "Arrow scaling with regard to scroll button size" msgstr "تغيير حجم السهم وفقاً لحجم زر التمرير" -#: gtk/gtkrecentaction.c:616 gtk/gtkrecentchoosermenu.c:227 +#: gtk/gtkrecentaction.c:633 gtk/gtkrecentchoosermenu.c:255 msgid "Show Numbers" msgstr "اعرض الأرقام" -#: gtk/gtkrecentaction.c:617 gtk/gtkrecentchoosermenu.c:228 +#: gtk/gtkrecentaction.c:634 gtk/gtkrecentchoosermenu.c:256 msgid "Whether the items should be displayed with a number" msgstr "فيما إذا يتم عرض العناصر بعدد" -#: gtk/gtkrecentchooser.c:132 +#: gtk/gtkrecentchooser.c:149 msgid "Recent Manager" msgstr "المدير الأخير" -#: gtk/gtkrecentchooser.c:133 +#: gtk/gtkrecentchooser.c:150 msgid "The RecentManager object to use" msgstr "جسم المدير الأخير المستخدم" -#: gtk/gtkrecentchooser.c:147 +#: gtk/gtkrecentchooser.c:164 msgid "Show Private" msgstr "اظهر الخاص" -#: gtk/gtkrecentchooser.c:148 +#: gtk/gtkrecentchooser.c:165 msgid "Whether the private items should be displayed" msgstr "فيما إذا يفترض اظهار العناصر الخاصة" -#: gtk/gtkrecentchooser.c:161 +#: gtk/gtkrecentchooser.c:178 msgid "Show Tooltips" msgstr "اظهر التلميحات" -#: gtk/gtkrecentchooser.c:162 +#: gtk/gtkrecentchooser.c:179 msgid "Whether there should be a tooltip on the item" msgstr "فيما إذا يفترض عرض تلميحة العنصر" -#: gtk/gtkrecentchooser.c:174 +#: gtk/gtkrecentchooser.c:191 msgid "Show Icons" msgstr "اظهر الأيقونات" -#: gtk/gtkrecentchooser.c:175 +#: gtk/gtkrecentchooser.c:192 msgid "Whether there should be an icon near the item" msgstr "فيما إذا يفترض عرض أيقونة أمام العنصر" -#: gtk/gtkrecentchooser.c:190 +#: gtk/gtkrecentchooser.c:207 msgid "Show Not Found" msgstr "اظهر غير الموجودة" -#: gtk/gtkrecentchooser.c:191 +#: gtk/gtkrecentchooser.c:208 msgid "Whether the items pointing to unavailable resources should be displayed" msgstr "فيما اذا وجب عرض العناصر المشيرة إلى مصادر غير متوفرة" -#: gtk/gtkrecentchooser.c:204 +#: gtk/gtkrecentchooser.c:221 msgid "Whether to allow multiple items to be selected" msgstr "ما إذا سيتم السماح بانتقاء عناصر متعددة" -#: gtk/gtkrecentchooser.c:217 +#: gtk/gtkrecentchooser.c:234 msgid "Local only" msgstr "المحلي فقط" -#: gtk/gtkrecentchooser.c:218 +#: gtk/gtkrecentchooser.c:235 msgid "Whether the selected resource(s) should be limited to local file: URIs" msgstr "فيما إذا يجب تحديد المصادر بالملفات المحلية: URI" -#: gtk/gtkrecentchooser.c:234 gtk/gtkrecentmanager.c:229 +#: gtk/gtkrecentchooser.c:251 gtk/gtkrecentmanager.c:229 msgid "Limit" msgstr "الحدّ" -#: gtk/gtkrecentchooser.c:235 +#: gtk/gtkrecentchooser.c:252 msgid "The maximum number of items to be displayed" msgstr "العدد العلوي للعناصر المعروضة" -#: gtk/gtkrecentchooser.c:249 +#: gtk/gtkrecentchooser.c:266 msgid "Sort Type" msgstr "نوع التّرتيب" -#: gtk/gtkrecentchooser.c:250 +#: gtk/gtkrecentchooser.c:267 msgid "The sorting order of the items displayed" msgstr "كيفية تصنيف العناصر المعروضة" -#: gtk/gtkrecentchooser.c:265 +#: gtk/gtkrecentchooser.c:282 msgid "The current filter for selecting which resources are displayed" msgstr "المرشّح الحالي لانتقاء الموارد المعروضة" @@ -4897,24 +4695,24 @@ msgstr "فراغات القيمة" msgid "Space between value text and the slider/trough area" msgstr "الفراغ بين نص القيمة ومنطقة المتزحلق/المنخفض" -#: gtk/gtkscalebutton.c:207 +#: gtk/gtkscalebutton.c:223 msgid "The value of the scale" msgstr "قيمة المقياس" -#: gtk/gtkscalebutton.c:217 +#: gtk/gtkscalebutton.c:233 msgid "The icon size" msgstr "حجم الأيقونة" -#: gtk/gtkscalebutton.c:226 +#: gtk/gtkscalebutton.c:242 msgid "" "The GtkAdjustment that contains the current value of this scale button object" msgstr "GtkAdjustment المحتوي على القيمة الحالية لجسم التحجيم هذا" -#: gtk/gtkscalebutton.c:254 +#: gtk/gtkscalebutton.c:270 msgid "Icons" msgstr "أيقونات" -#: gtk/gtkscalebutton.c:255 +#: gtk/gtkscalebutton.c:271 msgid "List of icon names" msgstr "قائمة أسماء الإيقونات" @@ -4944,35 +4742,35 @@ msgid "" "Display a second forward arrow button on the opposite end of the scrollbar" msgstr "اعرض زر سهم تقدّم ثان عند النهاية المعاكسة لعمود التدرج" -#: gtk/gtkscrolledwindow.c:218 gtk/gtktext.c:545 gtk/gtktreeview.c:572 +#: gtk/gtkscrolledwindow.c:235 gtk/gtktreeview.c:574 msgid "Horizontal Adjustment" msgstr "ضبط أفقي" -#: gtk/gtkscrolledwindow.c:225 gtk/gtktext.c:553 gtk/gtktreeview.c:580 +#: gtk/gtkscrolledwindow.c:242 gtk/gtktreeview.c:582 msgid "Vertical Adjustment" msgstr "ضبط عمودي" -#: gtk/gtkscrolledwindow.c:232 +#: gtk/gtkscrolledwindow.c:249 msgid "Horizontal Scrollbar Policy" msgstr "سياسة عمود اللف الأفقي" -#: gtk/gtkscrolledwindow.c:233 +#: gtk/gtkscrolledwindow.c:250 msgid "When the horizontal scrollbar is displayed" msgstr "آن عرض عمود اللف الأفقي" -#: gtk/gtkscrolledwindow.c:240 +#: gtk/gtkscrolledwindow.c:257 msgid "Vertical Scrollbar Policy" msgstr "سياسة عمود التدرج العمودي" -#: gtk/gtkscrolledwindow.c:241 +#: gtk/gtkscrolledwindow.c:258 msgid "When the vertical scrollbar is displayed" msgstr "آن عرض شريط التدرج العمودي" -#: gtk/gtkscrolledwindow.c:249 +#: gtk/gtkscrolledwindow.c:266 msgid "Window Placement" msgstr "موضع النافذة" -#: gtk/gtkscrolledwindow.c:250 +#: gtk/gtkscrolledwindow.c:267 msgid "" "Where the contents are located with respect to the scrollbars. This property " "only takes effect if \"window-placement-set\" is TRUE." @@ -4980,46 +4778,46 @@ msgstr "" "موقع المحتويات باعتبار أعمدة اللف. الخاصية صحيحة فقط إذا كانت \"window-" "placement-set\" صحيحة TRUE." -#: gtk/gtkscrolledwindow.c:267 +#: gtk/gtkscrolledwindow.c:284 msgid "Window Placement Set" msgstr "تم تحديد مكان النافذة" -#: gtk/gtkscrolledwindow.c:268 +#: gtk/gtkscrolledwindow.c:285 msgid "" "Whether \"window-placement\" should be used to determine the location of the " "contents with respect to the scrollbars." msgstr "" "إذا كان \"window-placement\" يستخدم لتحديد موقع المحتويات حسب أشرطة اللّف." -#: gtk/gtkscrolledwindow.c:274 +#: gtk/gtkscrolledwindow.c:291 msgid "Shadow Type" msgstr "نوع الظل" -#: gtk/gtkscrolledwindow.c:275 +#: gtk/gtkscrolledwindow.c:292 msgid "Style of bevel around the contents" msgstr "أسلوب الحافة حول المحتويات" -#: gtk/gtkscrolledwindow.c:289 +#: gtk/gtkscrolledwindow.c:306 msgid "Scrollbars within bevel" msgstr "أعمدة تصفح داخلية" -#: gtk/gtkscrolledwindow.c:290 +#: gtk/gtkscrolledwindow.c:307 msgid "Place scrollbars within the scrolled window's bevel" msgstr "ضع أعمدة تصفح داخل النافذة" -#: gtk/gtkscrolledwindow.c:296 +#: gtk/gtkscrolledwindow.c:313 msgid "Scrollbar spacing" msgstr "فراغات عمود اللف" -#: gtk/gtkscrolledwindow.c:297 +#: gtk/gtkscrolledwindow.c:314 msgid "Number of pixels between the scrollbars and the scrolled window" msgstr "عدد البكسلات بين أعمدة اللف و النافذة الملفوفة" -#: gtk/gtkscrolledwindow.c:312 +#: gtk/gtkscrolledwindow.c:329 msgid "Scrolled Window Placement" msgstr "وضع النافذة الملفوفة" -#: gtk/gtkscrolledwindow.c:313 +#: gtk/gtkscrolledwindow.c:330 msgid "" "Where the contents of scrolled windows are located with respect to the " "scrollbars, if not overridden by the scrolled window's own placement." @@ -5027,221 +4825,221 @@ msgstr "" "موقع محتويات النافذة الملفوفة باعتبار أعمدة اللف، إذا لم يتم تجاوزها بوضع " "النافذة الملفوفة نفسها." -#: gtk/gtkseparatortoolitem.c:105 +#: gtk/gtkseparatortoolitem.c:125 msgid "Draw" msgstr "رسم" -#: gtk/gtkseparatortoolitem.c:106 +#: gtk/gtkseparatortoolitem.c:126 msgid "Whether the separator is drawn, or just blank" msgstr "فيما إذا كان الفاصل رسما أو فراغا" -#: gtk/gtksettings.c:224 +#: gtk/gtksettings.c:225 msgid "Double Click Time" msgstr "وقت النقر الثنائي" -#: gtk/gtksettings.c:225 +#: gtk/gtksettings.c:226 msgid "" "Maximum time allowed between two clicks for them to be considered a double " "click (in milliseconds)" msgstr "الوقت الأقصى المسموح بين نقرتين لاحتسابهما كنقرة ثنائية (بالمليثانية)" -#: gtk/gtksettings.c:232 +#: gtk/gtksettings.c:233 msgid "Double Click Distance" msgstr "مسافة النقر الثنائي" -#: gtk/gtksettings.c:233 +#: gtk/gtksettings.c:234 msgid "" "Maximum distance allowed between two clicks for them to be considered a " "double click (in pixels)" msgstr "المسافة القصوى المسموح بها بين نقرتين لاعتبارهما نقرة ثنائية (بالبكسل)" -#: gtk/gtksettings.c:249 +#: gtk/gtksettings.c:250 msgid "Cursor Blink" msgstr "وميض المؤشر" -#: gtk/gtksettings.c:250 +#: gtk/gtksettings.c:251 msgid "Whether the cursor should blink" msgstr "فيما إذا كان المؤشر سيومض" -#: gtk/gtksettings.c:257 +#: gtk/gtksettings.c:258 msgid "Cursor Blink Time" msgstr "وقت وميض المؤشر" -#: gtk/gtksettings.c:258 +#: gtk/gtksettings.c:259 msgid "Length of the cursor blink cycle, in milliseconds" msgstr "مدة دورة وميض المؤشر، بالملي ثانية" -#: gtk/gtksettings.c:277 +#: gtk/gtksettings.c:278 msgid "Cursor Blink Timeout" msgstr "وقت وميض المؤشر" -#: gtk/gtksettings.c:278 +#: gtk/gtksettings.c:279 msgid "Time after which the cursor stops blinking, in seconds" msgstr "مدة دورة وميض المؤشر، بالمليثانية" -#: gtk/gtksettings.c:285 +#: gtk/gtksettings.c:286 msgid "Split Cursor" msgstr "قسم المؤشر" -#: gtk/gtksettings.c:286 +#: gtk/gtksettings.c:287 msgid "" "Whether two cursors should be displayed for mixed left-to-right and right-to-" "left text" msgstr "فيما إذا يجب عرض مؤشرين للنصوص المخلوطة من يسار-لليمين ويمين-لليسار" -#: gtk/gtksettings.c:293 +#: gtk/gtksettings.c:294 msgid "Theme Name" msgstr "اسم التيمة" -#: gtk/gtksettings.c:294 +#: gtk/gtksettings.c:295 msgid "Name of theme RC file to load" msgstr "اسم ملف RC للتيمة لتحميله" -#: gtk/gtksettings.c:302 +#: gtk/gtksettings.c:303 msgid "Icon Theme Name" msgstr "اسم تيمة الأيقونات" -#: gtk/gtksettings.c:303 +#: gtk/gtksettings.c:304 msgid "Name of icon theme to use" msgstr "اسم تيمة الأيقونات لاستخدامها" -#: gtk/gtksettings.c:311 +#: gtk/gtksettings.c:312 msgid "Fallback Icon Theme Name" msgstr "اسم تيمة الأيقونات الإحتياطية" -#: gtk/gtksettings.c:312 +#: gtk/gtksettings.c:313 msgid "Name of a icon theme to fall back to" msgstr "اسم تيمة الأيقونات الإحتياطية" -#: gtk/gtksettings.c:320 +#: gtk/gtksettings.c:321 msgid "Key Theme Name" msgstr "اسم تيمة المفتاح" -#: gtk/gtksettings.c:321 +#: gtk/gtksettings.c:322 msgid "Name of key theme RC file to load" msgstr "اسم ملف RC لتيمة المفتاح لتحميله" -#: gtk/gtksettings.c:329 +#: gtk/gtksettings.c:330 msgid "Menu bar accelerator" msgstr "مفتاح الاختصار لعمود القائمة" -#: gtk/gtksettings.c:330 +#: gtk/gtksettings.c:331 msgid "Keybinding to activate the menu bar" msgstr "المفتاح الرابط لتنشيط عمود القوائم" -#: gtk/gtksettings.c:338 +#: gtk/gtksettings.c:339 msgid "Drag threshold" msgstr "سحب العتبة" -#: gtk/gtksettings.c:339 +#: gtk/gtksettings.c:340 msgid "Number of pixels the cursor can move before dragging" msgstr "عدد البكسلات التي يمكن للمؤشر تحريكها قبل السحب" -#: gtk/gtksettings.c:347 +#: gtk/gtksettings.c:348 msgid "Font Name" msgstr "اسم الخط" -#: gtk/gtksettings.c:348 +#: gtk/gtksettings.c:349 msgid "Name of default font to use" msgstr "اسم الخط الافتراضي لاستخدامه" -#: gtk/gtksettings.c:370 +#: gtk/gtksettings.c:371 msgid "Icon Sizes" msgstr "أحجام الأيقونات" -#: gtk/gtksettings.c:371 +#: gtk/gtksettings.c:372 msgid "List of icon sizes (gtk-menu=16,16:gtk-button=20,20..." msgstr "قائمة أحجام الأيقونات (gtk-menu=16,16:gtk-button=20,20..." -#: gtk/gtksettings.c:379 +#: gtk/gtksettings.c:380 msgid "GTK Modules" msgstr "وحدات ج.ت.ك GTK" -#: gtk/gtksettings.c:380 +#: gtk/gtksettings.c:381 msgid "List of currently active GTK modules" msgstr "وحدات ج.ت.ك GTK النشطة حاليا" -#: gtk/gtksettings.c:389 +#: gtk/gtksettings.c:390 msgid "Xft Antialias" msgstr "تحسين الحواف لـ Xft·" -#: gtk/gtksettings.c:390 +#: gtk/gtksettings.c:391 msgid "Whether to antialias Xft fonts; 0=no, 1=yes, -1=default" msgstr "فيما إذا ستحسّن حواف خطوط Xft، 0=لا، 1=نعم، -1=الإفتراض" -#: gtk/gtksettings.c:399 +#: gtk/gtksettings.c:400 msgid "Xft Hinting" msgstr "تركيز Xft" -#: gtk/gtksettings.c:400 +#: gtk/gtksettings.c:401 msgid "Whether to hint Xft fonts; 0=no, 1=yes, -1=default" msgstr "فيما إذا يقع تركيز خطوط Xft، 0=لا، 1=نعم، -1=الإفتراض" -#: gtk/gtksettings.c:409 +#: gtk/gtksettings.c:410 msgid "Xft Hint Style" msgstr "أسلوب تركيز Xft" -#: gtk/gtksettings.c:410 +#: gtk/gtksettings.c:411 msgid "" "What degree of hinting to use; hintnone, hintslight, hintmedium, or hintfull" msgstr "درجة التركيز مستعمل; hintnone, hintslight, hintmedium, أو hintfull" -#: gtk/gtksettings.c:419 +#: gtk/gtksettings.c:420 msgid "Xft RGBA" msgstr "Xft RGBA" -#: gtk/gtksettings.c:420 +#: gtk/gtksettings.c:421 msgid "Type of subpixel antialiasing; none, rgb, bgr, vrgb, vbgr" msgstr "نوع تحسين الحواف التحت بكسلي، لا تحسين أو rgb أو bgr أو vrgb أو·vbgr" -#: gtk/gtksettings.c:429 +#: gtk/gtksettings.c:430 msgid "Xft DPI" msgstr "Xft DPI" -#: gtk/gtksettings.c:430 +#: gtk/gtksettings.c:431 msgid "Resolution for Xft, in 1024 * dots/inch. -1 to use default value" msgstr "" "الإستبانة لـ Xft، بالـ 1024·*·نقطة للإنش. -1·لإستخدام القيمة الإفتراضيّة" -#: gtk/gtksettings.c:439 +#: gtk/gtksettings.c:440 msgid "Cursor theme name" msgstr "اسم ملف سِمة المؤشّر" -#: gtk/gtksettings.c:440 +#: gtk/gtksettings.c:441 msgid "Name of the cursor theme to use, or NULL to use the default theme" msgstr "اسم نسق المؤشر المستخدم، أو NULL لاستعمال النسق الإفتراضي" -#: gtk/gtksettings.c:448 +#: gtk/gtksettings.c:449 msgid "Cursor theme size" msgstr "حجم سِمة المؤشر" -#: gtk/gtksettings.c:449 +#: gtk/gtksettings.c:450 msgid "Size to use for cursors, or 0 to use the default size" msgstr "الحجم المستعمل للمؤشرات، أو 0 لاستعمال الحجم الإفتراضي" -#: gtk/gtksettings.c:459 +#: gtk/gtksettings.c:460 msgid "Alternative button order" msgstr "ترتيب الأزرار البديل" -#: gtk/gtksettings.c:460 +#: gtk/gtksettings.c:461 msgid "Whether buttons in dialogs should use the alternative button order" msgstr "فيما إذا تستعمل الأزرار في الحوارات الترتيب البديل" -#: gtk/gtksettings.c:477 +#: gtk/gtksettings.c:478 msgid "Alternative sort indicator direction" msgstr "اتجاه الفرز الذي يتوجب على مؤشر الفرز أن يشير إليه" -#: gtk/gtksettings.c:478 +#: gtk/gtksettings.c:479 msgid "" "Whether the direction of the sort indicators in list and tree views is " "inverted compared to the default (where down means ascending)" msgstr "إذا كان اتجاه موضحات الترتيب في مظهر القائمة و الشجرة مقلوبا للإفتراضي" -#: gtk/gtksettings.c:486 +#: gtk/gtksettings.c:487 msgid "Show the 'Input Methods' menu" msgstr "عرض قائمة 'انماط الإدخال'" -#: gtk/gtksettings.c:487 +#: gtk/gtksettings.c:488 msgid "" "Whether the context menus of entries and text views should offer to change " "the input method" @@ -5249,11 +5047,11 @@ msgstr "" "فيما اذا كانت القوائم السياقية للمداخل و مظاهر النص تعطي امكانية تغيير كيفية " "الإدخال" -#: gtk/gtksettings.c:495 +#: gtk/gtksettings.c:496 msgid "Show the 'Insert Unicode Control Character' menu" msgstr "عرض قائمة 'Y]ohg " -#: gtk/gtksettings.c:496 +#: gtk/gtksettings.c:497 msgid "" "Whether the context menus of entries and text views should offer to insert " "control characters" @@ -5261,263 +5059,273 @@ msgstr "" "فيما اذا كانت القوائم السياقية للمداخل و مظاهر النص تعطي امكانية ادخال محارف " "التغيير" -#: gtk/gtksettings.c:504 +#: gtk/gtksettings.c:505 msgid "Start timeout" msgstr "انقضاء مدة البدأ" -#: gtk/gtksettings.c:505 +#: gtk/gtksettings.c:506 msgid "Starting value for timeouts, when button is pressed" msgstr "القيمة البدئية لمهلة الإنتهاء، عند ضغط الزر" -#: gtk/gtksettings.c:514 +#: gtk/gtksettings.c:515 msgid "Repeat timeout" msgstr "انقضاء مدة الإعادة" -#: gtk/gtksettings.c:515 +#: gtk/gtksettings.c:516 msgid "Repeat value for timeouts, when button is pressed" msgstr "القيمة الإعادية لمهلة الإنتهاء، عند ضغط الزر" -#: gtk/gtksettings.c:524 +#: gtk/gtksettings.c:525 msgid "Expand timeout" msgstr "مدة انقضاء التوسيع" -#: gtk/gtksettings.c:525 +#: gtk/gtksettings.c:526 msgid "Expand value for timeouts, when a widget is expanding a new region" msgstr "قيمة تمديد المهلة, عند امتداد الودجة إلى منطقة جديدة" -#: gtk/gtksettings.c:560 +#: gtk/gtksettings.c:561 msgid "Color scheme" msgstr "مخطط اللون" -#: gtk/gtksettings.c:561 +#: gtk/gtksettings.c:562 msgid "A palette of named colors for use in themes" msgstr "لوح ألوان لألوان مسماه لكي تستخد في السِّمات" -#: gtk/gtksettings.c:570 +#: gtk/gtksettings.c:571 msgid "Enable Animations" msgstr "مكّن الرسوم المتحركة" -#: gtk/gtksettings.c:571 +#: gtk/gtksettings.c:572 msgid "Whether to enable toolkit-wide animations." msgstr "فيما أذا يتم تفعيل الحرَاكة " -#: gtk/gtksettings.c:589 +#: gtk/gtksettings.c:590 msgid "Enable Touchscreen Mode" msgstr "مكّن نمط شاشة اللمسض" -#: gtk/gtksettings.c:590 +#: gtk/gtksettings.c:591 msgid "When TRUE, there are no motion notify events delivered on this screen" msgstr "عندما يكون صحيحا ، لا يوجد طلب تسليم اخطار هذه الاحداث على الشاشة" -#: gtk/gtksettings.c:607 +#: gtk/gtksettings.c:608 msgid "Tooltip timeout" msgstr "مدة ظهور التلميحة" -#: gtk/gtksettings.c:608 +#: gtk/gtksettings.c:609 msgid "Timeout before tooltip is shown" msgstr "مدة إظهار التلميحات" -#: gtk/gtksettings.c:633 +#: gtk/gtksettings.c:634 msgid "Tooltip browse timeout" msgstr "مدة اظهار التلميحة في وضع التصفح" -#: gtk/gtksettings.c:634 +#: gtk/gtksettings.c:635 msgid "Timeout before tooltip is shown when browse mode is enabled" msgstr "مدة إظهار التلميحات عند تفعيل نسق التصفح" -#: gtk/gtksettings.c:655 +#: gtk/gtksettings.c:656 msgid "Tooltip browse mode timeout" msgstr "مدة تلميحة نسق التصفح" -#: gtk/gtksettings.c:656 +#: gtk/gtksettings.c:657 msgid "Timeout after which browse mode is disabled" msgstr "مدة اظهار التلميحة بعد تعطيل نسق التصفح" -#: gtk/gtksettings.c:675 +#: gtk/gtksettings.c:676 msgid "Keynav Cursor Only" msgstr "مؤشر Keynav فقط" -#: gtk/gtksettings.c:676 +#: gtk/gtksettings.c:677 msgid "When TRUE, there are only cursor keys available to navigate widgets" msgstr "اذا كان TRUE، لا يوجد إلا مفاتيح مؤشر لتصفح الودجات " -#: gtk/gtksettings.c:693 +#: gtk/gtksettings.c:694 msgid "Keynav Wrap Around" msgstr "تدوير Keynav " -#: gtk/gtksettings.c:694 +#: gtk/gtksettings.c:695 msgid "Whether to wrap around when keyboard-navigating widgets" msgstr "ما إذا يجب التدوير عند التصفح بالمؤشر" -#: gtk/gtksettings.c:714 +#: gtk/gtksettings.c:715 msgid "Error Bell" msgstr "جرس الخطأ" -#: gtk/gtksettings.c:715 +#: gtk/gtksettings.c:716 msgid "When TRUE, keyboard navigation and other errors will cause a beep" msgstr "اذا كان TRUE، الأخطاء و التصفح بلوحة المفاتيح تحدث أصواتا" -#: gtk/gtksettings.c:732 +#: gtk/gtksettings.c:733 msgid "Color Hash" msgstr "هاش اللون" -#: gtk/gtksettings.c:733 +#: gtk/gtksettings.c:734 msgid "A hash table representation of the color scheme." msgstr "تمثيل جدول هاش لنظام الألوان" -#: gtk/gtksettings.c:741 +#: gtk/gtksettings.c:742 msgid "Default file chooser backend" msgstr "خلفيّة منتقي الملفات الإفتراضيّة" -#: gtk/gtksettings.c:742 +#: gtk/gtksettings.c:743 msgid "Name of the GtkFileChooser backend to use by default" msgstr "اسم خلفية GtkFileChooser التي ستستخدم إفتراضيّا" -#: gtk/gtksettings.c:759 +#: gtk/gtksettings.c:760 msgid "Default print backend" msgstr "خلفيّة الطابعة الإفتراضيّة" -#: gtk/gtksettings.c:760 +#: gtk/gtksettings.c:761 msgid "List of the GtkPrintBackend backends to use by default" msgstr "اسم النّهايات الخلفيّة لـ GtkPrintBackend التي ستستخدم إفتراضيّا" -#: gtk/gtksettings.c:783 +#: gtk/gtksettings.c:784 msgid "Default command to run when displaying a print preview" msgstr "الأمر الإفتراضي المشغل عند عرض الطبع" -#: gtk/gtksettings.c:784 +#: gtk/gtksettings.c:785 msgid "Command to run when displaying a print preview" msgstr "الأمر المشغل عند عرض الطبع" -#: gtk/gtksettings.c:800 +#: gtk/gtksettings.c:801 msgid "Enable Mnemonics" msgstr "مكّن التزيينات" -#: gtk/gtksettings.c:801 +#: gtk/gtksettings.c:802 msgid "Whether labels should have mnemonics" msgstr "اذا يجب أن يكون للتسميات تزيينات" -#: gtk/gtksettings.c:817 +#: gtk/gtksettings.c:818 msgid "Enable Accelerators" msgstr "فعّل المسرّعات" -#: gtk/gtksettings.c:818 +#: gtk/gtksettings.c:819 msgid "Whether menu items should have accelerators" msgstr "فيما إذا يجب أن تحتوي عناصر القوائم مسرعات" -#: gtk/gtksettings.c:835 +#: gtk/gtksettings.c:836 msgid "Recent Files Limit" msgstr "العدد الأقصى للملفّات الحديثة" -#: gtk/gtksettings.c:836 +#: gtk/gtksettings.c:837 msgid "Number of recently used files" msgstr "عدد الملفّات المستخدمة حديثا" -#: gtk/gtksettings.c:854 +#: gtk/gtksettings.c:855 msgid "Default IM module" msgstr "وحدة IM الإفتراضية" -#: gtk/gtksettings.c:855 +#: gtk/gtksettings.c:856 msgid "Which IM module should be used by default" msgstr "وحدة IM الإفتراضية" -#: gtk/gtksettings.c:873 +#: gtk/gtksettings.c:874 msgid "Recent Files Max Age" msgstr "العمر الأقصى للملفّات الحديثة" -#: gtk/gtksettings.c:874 +#: gtk/gtksettings.c:875 msgid "Maximum age of recently used files, in days" msgstr "العمر الأقصى للملفات المستخدمة حديثاً، بالأيام" -#: gtk/gtksettings.c:883 +#: gtk/gtksettings.c:884 msgid "Fontconfig configuration timestamp" msgstr "الطابع الزمني لإعدادت fontconfig" -#: gtk/gtksettings.c:884 +#: gtk/gtksettings.c:885 msgid "Timestamp of current fontconfig configuration" msgstr "الطابع الزمني لإعدادت fontconfig الحالية" -#: gtk/gtksettings.c:906 +#: gtk/gtksettings.c:907 msgid "Sound Theme Name" msgstr "اسم سمة الصوت" -#: gtk/gtksettings.c:907 +#: gtk/gtksettings.c:908 msgid "XDG sound theme name" msgstr "اسم سمة صوت XDG" #. Translators: this means sounds that are played as feedback to user input -#: gtk/gtksettings.c:929 +#: gtk/gtksettings.c:930 msgid "Audible Input Feedback" msgstr "دخل تغذية راجعة سمعية" -#: gtk/gtksettings.c:930 +#: gtk/gtksettings.c:931 msgid "Whether to play event sounds as feedback to user input" msgstr "فيما إذا كان تشغيل أصوات الأحداث كرد فعل على إدخال المستخدم" -#: gtk/gtksettings.c:951 +#: gtk/gtksettings.c:952 msgid "Enable Event Sounds" msgstr "مكّن أصوات الأحدات" -#: gtk/gtksettings.c:952 +#: gtk/gtksettings.c:953 msgid "Whether to play any event sounds at all" msgstr "فيما إذا كان سيشغّل أي من أصوات الأحداث على الإطلاق" -#: gtk/gtksettings.c:967 +#: gtk/gtksettings.c:968 msgid "Enable Tooltips" msgstr "مكّن التلميحات" -#: gtk/gtksettings.c:968 +#: gtk/gtksettings.c:969 msgid "Whether tooltips should be shown on widgets" msgstr "فيما إذا كانت التلميحات ستعرض على الودجات" -#: gtk/gtksettings.c:981 +#: gtk/gtksettings.c:982 msgid "Toolbar style" msgstr "نمط شريط الأدوات" -#: gtk/gtksettings.c:982 +#: gtk/gtksettings.c:983 msgid "" "Whether default toolbars have text only, text and icons, icons only, etc." msgstr "" "ما إذا كانت أشرطة ا?دوات الافتراضية لها نص فقط، نص مع أيقونات، أيقونات فقط، " "إلخ." -#: gtk/gtksettings.c:996 +#: gtk/gtksettings.c:997 #, fuzzy msgid "Toolbar Icon Size" msgstr "حجم أيقونة شريط الأدوات" -#: gtk/gtksettings.c:997 +#: gtk/gtksettings.c:998 #, fuzzy msgid "The size of icons in default toolbars." msgstr "حجم ا?يقونات في أشرطة ا?دوات الافتراضية" -#: gtk/gtksettings.c:1014 +#: gtk/gtksettings.c:1015 #, fuzzy msgid "Auto Mnemonics" msgstr "مكّن التزيينات" -#: gtk/gtksettings.c:1015 +#: gtk/gtksettings.c:1016 msgid "" "Whether mnemonics should be automatically shown and hidden when the user " "presses the mnemonic activator." msgstr "" -#: gtk/gtksizegroup.c:301 +#: gtk/gtksettings.c:1041 +#, fuzzy +msgid "Application prefers a dark theme" +msgstr "التطبيق قابل للرسم" + +#: gtk/gtksettings.c:1042 +#, fuzzy +msgid "Whether the application prefers to have a dark theme." +msgstr "فيما إذا كانت العملية مفعلة." + +#: gtk/gtksizegroup.c:320 msgid "Mode" msgstr "النسق" -#: gtk/gtksizegroup.c:302 +#: gtk/gtksizegroup.c:321 msgid "" "The directions in which the size group affects the requested sizes of its " "component widgets" msgstr "" "الاتجاه الذي تؤثر فيه مجموعة الحجم على الحجوم المطلوبة للودجات المكونة لها" -#: gtk/gtksizegroup.c:318 +#: gtk/gtksizegroup.c:337 msgid "Ignore hidden" msgstr "أهمل المخفي" -#: gtk/gtksizegroup.c:319 +#: gtk/gtksizegroup.c:338 msgid "" "If TRUE, unmapped widgets are ignored when determining the size of the group" msgstr "اذا كان صحيحاً ، يتم تجاهل القطع غير المرسومة عند تحديد حجم المجموعة" @@ -5612,61 +5420,61 @@ msgstr "فيما إذا كان لعمود الحالة " msgid "Style of bevel around the statusbar text" msgstr "أسلوب الحافة حول نص عمود الحالة" -#: gtk/gtkstatusicon.c:271 +#: gtk/gtkstatusicon.c:276 msgid "The size of the icon" msgstr "حجم الأيقونة" -#: gtk/gtkstatusicon.c:281 +#: gtk/gtkstatusicon.c:286 msgid "The screen where this status icon will be displayed" msgstr "الشاشة التي ستعرض فيها ايقونة الحالة" -#: gtk/gtkstatusicon.c:288 +#: gtk/gtkstatusicon.c:293 msgid "Blinking" msgstr "ومّاض" -#: gtk/gtkstatusicon.c:289 +#: gtk/gtkstatusicon.c:294 msgid "Whether or not the status icon is blinking" msgstr "فيما إذا كانت أيقونة الحالة وامضة" -#: gtk/gtkstatusicon.c:297 +#: gtk/gtkstatusicon.c:302 msgid "Whether or not the status icon is visible" msgstr "فيما إذا كانت أيقونة الحالة مرئية." -#: gtk/gtkstatusicon.c:313 +#: gtk/gtkstatusicon.c:318 msgid "Whether or not the status icon is embedded" msgstr "فيما إذا كانت أيقونة الحالة داخلية" -#: gtk/gtkstatusicon.c:329 gtk/gtktrayicon-x11.c:111 +#: gtk/gtkstatusicon.c:334 gtk/gtktrayicon-x11.c:123 msgid "The orientation of the tray" msgstr "إتجاه الطبق." -#: gtk/gtkstatusicon.c:356 gtk/gtkwidget.c:702 +#: gtk/gtkstatusicon.c:361 gtk/gtkwidget.c:722 msgid "Has tooltip" msgstr "له تلميحة" -#: gtk/gtkstatusicon.c:357 +#: gtk/gtkstatusicon.c:362 #, fuzzy msgid "Whether this tray icon has a tooltip" msgstr "إذا كان لهذه الودجة تلميحة" -#: gtk/gtkstatusicon.c:382 gtk/gtkwidget.c:723 +#: gtk/gtkstatusicon.c:387 gtk/gtkwidget.c:743 msgid "Tooltip Text" msgstr "نص التلميحة" -#: gtk/gtkstatusicon.c:383 gtk/gtkwidget.c:724 gtk/gtkwidget.c:745 +#: gtk/gtkstatusicon.c:388 gtk/gtkwidget.c:744 gtk/gtkwidget.c:765 msgid "The contents of the tooltip for this widget" msgstr "نص تلميحة لهذه الودجة" -#: gtk/gtkstatusicon.c:406 gtk/gtkwidget.c:744 +#: gtk/gtkstatusicon.c:411 gtk/gtkwidget.c:764 msgid "Tooltip markup" msgstr "خصائص التلميحة " -#: gtk/gtkstatusicon.c:407 +#: gtk/gtkstatusicon.c:412 #, fuzzy msgid "The contents of the tooltip for this tray icon" msgstr "نص تلميحة لهذه الودجة" -#: gtk/gtkstatusicon.c:425 +#: gtk/gtkstatusicon.c:430 #, fuzzy msgid "The title of this tray icon" msgstr "حجم الأيقونة" @@ -5768,30 +5576,6 @@ msgid "" "pixels" msgstr "الفضاء·الإضافي·الذي·سيوضع·بين·الإبن·وجيرانه·في·الأعلى·و·الأسفل·بالبكسلات" -#: gtk/gtktext.c:546 -msgid "Horizontal adjustment for the text widget" -msgstr "الضبط الأفقي لودجة النص" - -#: gtk/gtktext.c:554 -msgid "Vertical adjustment for the text widget" -msgstr "الضبط العمودي لودجة النص" - -#: gtk/gtktext.c:561 -msgid "Line Wrap" -msgstr "قسم السطر" - -#: gtk/gtktext.c:562 -msgid "Whether lines are wrapped at widget edges" -msgstr "فيما إذا كانت السطور ستقسم عند حواف الودجات" - -#: gtk/gtktext.c:569 -msgid "Word Wrap" -msgstr "قسم الكلمات" - -#: gtk/gtktext.c:570 -msgid "Whether words are wrapped at widget edges" -msgstr "فيما إذا كانت الكلمات ستقسم عند حواف الودجات" - #: gtk/gtktextbuffer.c:180 msgid "Tag Table" msgstr "جدول الشارات" @@ -6217,15 +6001,15 @@ msgstr "خطأ في لون التسطير" msgid "Color with which to draw error-indication underlines" msgstr "اللون الذي يتم به رسم التسطيرات المؤشرة للأخطاء" -#: gtk/gtktoggleaction.c:104 +#: gtk/gtktoggleaction.c:115 msgid "Create the same proxies as a radio action" msgstr "إنشاء البروكسيات المتوافقة كفعل مشع" -#: gtk/gtktoggleaction.c:105 +#: gtk/gtktoggleaction.c:116 msgid "Whether the proxies for this action look like radio action proxies" msgstr "فيما إذا ستبدو بروكسيّات هذا الحدث كبروكسيّات حدث مشعّة" -#: gtk/gtktoggleaction.c:120 +#: gtk/gtktoggleaction.c:131 msgid "If the toggle action should be active in or not" msgstr "ما إذا توجب أن يكون زر التغيير نشطا أم لا" @@ -6245,87 +6029,79 @@ msgstr "رسم المؤشر" msgid "If the toggle part of the button is displayed" msgstr "ما إذا كان جزء القفل من الرز سيتم عرضه" -#: gtk/gtktoolbar.c:494 gtk/gtktoolpalette.c:1020 +#: gtk/gtktoolbar.c:456 gtk/gtktoolpalette.c:1021 msgid "Toolbar Style" msgstr "منط شريط الأدوات" -#: gtk/gtktoolbar.c:495 +#: gtk/gtktoolbar.c:457 msgid "How to draw the toolbar" msgstr "كيفية رسم شريط ا?دوات" -#: gtk/gtktoolbar.c:502 +#: gtk/gtktoolbar.c:464 msgid "Show Arrow" msgstr "عرض السهم" -#: gtk/gtktoolbar.c:503 +#: gtk/gtktoolbar.c:465 msgid "If an arrow should be shown if the toolbar doesn't fit" msgstr "فيما إذا سيعرض سهم إذا لم يتلائم عمود الأدوات" -#: gtk/gtktoolbar.c:518 -msgid "Tooltips" -msgstr "تلميحات" - -#: gtk/gtktoolbar.c:519 -msgid "If the tooltips of the toolbar should be active or not" -msgstr "فيما إذا وجب تنشيط تلميحات شريط الأدوات " - -#: gtk/gtktoolbar.c:541 +#: gtk/gtktoolbar.c:486 msgid "Size of icons in this toolbar" msgstr "حجم الأيقونات في عمود الأدوات" -#: gtk/gtktoolbar.c:556 gtk/gtktoolpalette.c:1006 +#: gtk/gtktoolbar.c:501 gtk/gtktoolpalette.c:1007 msgid "Icon size set" msgstr "حجم الأيقونات محدّد" -#: gtk/gtktoolbar.c:557 gtk/gtktoolpalette.c:1007 +#: gtk/gtktoolbar.c:502 gtk/gtktoolpalette.c:1008 msgid "Whether the icon-size property has been set" msgstr "فيما إذا كتم تحديد icon-size" -#: gtk/gtktoolbar.c:566 +#: gtk/gtktoolbar.c:511 msgid "Whether the item should receive extra space when the toolbar grows" msgstr "فيما إذا سيتلقى العنصر فضاء اضافيّا عند نموّ عمود الأدوات" -#: gtk/gtktoolbar.c:574 gtk/gtktoolitemgroup.c:1589 +#: gtk/gtktoolbar.c:519 gtk/gtktoolitemgroup.c:1597 msgid "Whether the item should be the same size as other homogeneous items" msgstr "ما إذا يجب أن يكون العنصر بنفس الحجم كالعناصر المتجانسة الأخرى" -#: gtk/gtktoolbar.c:581 +#: gtk/gtktoolbar.c:526 msgid "Spacer size" msgstr "حجم الفاصل" -#: gtk/gtktoolbar.c:582 +#: gtk/gtktoolbar.c:527 msgid "Size of spacers" msgstr "حجم الفواصل" -#: gtk/gtktoolbar.c:591 +#: gtk/gtktoolbar.c:536 msgid "Amount of border space between the toolbar shadow and the buttons" msgstr "كمية مسافة الحد بين ظل شريط ا?دوات وا?زرار" -#: gtk/gtktoolbar.c:599 +#: gtk/gtktoolbar.c:544 msgid "Maximum child expand" msgstr "التوسيع العلوي للابن " -#: gtk/gtktoolbar.c:600 +#: gtk/gtktoolbar.c:545 msgid "Maximum amount of space an expandable item will be given" msgstr "أكبر حجم للفراغ المعطى للعنصر القابل للتوسيع" -#: gtk/gtktoolbar.c:608 +#: gtk/gtktoolbar.c:553 msgid "Space style" msgstr "نمط الفاصل" -#: gtk/gtktoolbar.c:609 +#: gtk/gtktoolbar.c:554 msgid "Whether spacers are vertical lines or just blank" msgstr "ما إذا كانت الفواصل خطوط عمودية أو فقط فراغات" -#: gtk/gtktoolbar.c:616 +#: gtk/gtktoolbar.c:561 msgid "Button relief" msgstr "تحرير الزر" -#: gtk/gtktoolbar.c:617 +#: gtk/gtktoolbar.c:562 msgid "Type of bevel around toolbar buttons" msgstr "نوع الانحدار حول أزرار شريط الأدوات" -#: gtk/gtktoolbar.c:624 +#: gtk/gtktoolbar.c:569 msgid "Style of bevel around the toolbar" msgstr "نمط الانحدار حول شريط الأدوات" @@ -6377,7 +6153,7 @@ msgstr "تَبَاعُد الأيقونة" msgid "Spacing in pixels between the icon and label" msgstr "الفراغ بالبكسل بين الأيقونة و الشارة" -#: gtk/gtktoolitem.c:207 +#: gtk/gtktoolitem.c:200 msgid "" "Whether the toolbar item is considered important. When TRUE, toolbar buttons " "show text in GTK_TOOLBAR_BOTH_HORIZ mode" @@ -6385,103 +6161,140 @@ msgstr "" "فيما إذا يعتبر عنصر عمود الأدوات مهمّ. إذا ضبط لـ TRUE فستعرض أورار عمود " "الأدوات النص بنسق GTK_TOOLBAR_BOTH_HORIZ" -#: gtk/gtktoolitemgroup.c:1536 +#: gtk/gtktoolitemgroup.c:1544 #, fuzzy msgid "The human-readable title of this item group" msgstr "وصف للحالة بصورة مفهومة للبشر" -#: gtk/gtktoolitemgroup.c:1543 +#: gtk/gtktoolitemgroup.c:1551 #, fuzzy msgid "A widget to display in place of the usual label" msgstr "ودجة للعرض عوض شارة الاظار المعتادة" -#: gtk/gtktoolitemgroup.c:1549 +#: gtk/gtktoolitemgroup.c:1557 msgid "Collapsed" msgstr "" -#: gtk/gtktoolitemgroup.c:1550 +#: gtk/gtktoolitemgroup.c:1558 #, fuzzy msgid "Wether the group has been collapsed and items are hidden" msgstr "فيما إذا وقع فتح الموسع للكشف عن الودجة الإبنة" -#: gtk/gtktoolitemgroup.c:1556 +#: gtk/gtktoolitemgroup.c:1564 #, fuzzy msgid "ellipsize" msgstr "قص" -#: gtk/gtktoolitemgroup.c:1557 +#: gtk/gtktoolitemgroup.c:1565 msgid "Ellipsize for item group headers" msgstr "" -#: gtk/gtktoolitemgroup.c:1563 +#: gtk/gtktoolitemgroup.c:1571 #, fuzzy msgid "Header Relief" msgstr "صورة الرأس" -#: gtk/gtktoolitemgroup.c:1564 +#: gtk/gtktoolitemgroup.c:1572 #, fuzzy msgid "Relief of the group header button" msgstr "أظهر أزرار رؤوس العمود" -#: gtk/gtktoolitemgroup.c:1579 +#: gtk/gtktoolitemgroup.c:1587 #, fuzzy msgid "Header Spacing" msgstr "حشو الرأس" -#: gtk/gtktoolitemgroup.c:1580 +#: gtk/gtktoolitemgroup.c:1588 #, fuzzy msgid "Spacing between expander arrow and caption" msgstr "الفراغات حول سهم الموسع" -#: gtk/gtktoolitemgroup.c:1596 +#: gtk/gtktoolitemgroup.c:1604 #, fuzzy msgid "Whether the item should receive extra space when the group grows" msgstr "فيما إذا سيتلقى العنصر فضاء اضافيّا عند نموّ عمود الأدوات" -#: gtk/gtktoolitemgroup.c:1603 +#: gtk/gtktoolitemgroup.c:1611 #, fuzzy msgid "Whether the item should fill the available space" msgstr "ما إذا سيكون كل الأبناء بنفس الحجم" -#: gtk/gtktoolitemgroup.c:1609 +#: gtk/gtktoolitemgroup.c:1617 msgid "New Row" msgstr "" -#: gtk/gtktoolitemgroup.c:1610 +#: gtk/gtktoolitemgroup.c:1618 #, fuzzy msgid "Whether the item should start a new row" msgstr "فيما إذا يتم عرض العناصر بعدد" -#: gtk/gtktoolitemgroup.c:1617 +#: gtk/gtktoolitemgroup.c:1625 #, fuzzy msgid "Position of the item within this group" msgstr "موقع العلامة على المسطرة" -#: gtk/gtktoolpalette.c:991 +#: gtk/gtktoolpalette.c:992 #, fuzzy msgid "Size of icons in this tool palette" msgstr "حجم الأيقونات في عمود الأدوات" -#: gtk/gtktoolpalette.c:1021 +#: gtk/gtktoolpalette.c:1022 #, fuzzy msgid "Style of items in the tool palette" msgstr "نمط الانحدار حول شريط الأدوات" -#: gtk/gtktoolpalette.c:1037 +#: gtk/gtktoolpalette.c:1038 msgid "Exclusive" msgstr "" -#: gtk/gtktoolpalette.c:1038 +#: gtk/gtktoolpalette.c:1039 #, fuzzy msgid "Whether the item group should be the only expanded at a given time" msgstr "فيما إذا يتم عرض العناصر بعدد" -#: gtk/gtktoolpalette.c:1053 +#: gtk/gtktoolpalette.c:1054 #, fuzzy msgid "" "Whether the item group should receive extra space when the palette grows" msgstr "فيما إذا وجب أن يتلقى الإبن فضاءا أكبر عند نمو أبيه" +#: gtk/gtktrayicon-x11.c:132 +#, fuzzy +msgid "Foreground color for symbolic icons" +msgstr "لون الواجهة الأمامية كسلسلة" + +#: gtk/gtktrayicon-x11.c:139 +#, fuzzy +msgid "Error color" +msgstr "لون المؤشر" + +#: gtk/gtktrayicon-x11.c:140 +msgid "Error color for symbolic icons" +msgstr "" + +#: gtk/gtktrayicon-x11.c:147 +#, fuzzy +msgid "Warning color" +msgstr "لون الخلفية" + +#: gtk/gtktrayicon-x11.c:148 +msgid "Warning color for symbolic icons" +msgstr "" + +#: gtk/gtktrayicon-x11.c:155 +#, fuzzy +msgid "Success color" +msgstr "لون المؤشر" + +#: gtk/gtktrayicon-x11.c:156 +msgid "Success color for symbolic icons" +msgstr "" + +#: gtk/gtktrayicon-x11.c:164 +#, fuzzy +msgid "Padding that should be put around icons in the tray" +msgstr "فيما إذا يفترض عرض أيقونة أمام العنصر" + #: gtk/gtktreemodelsort.c:278 msgid "TreeModelSort Model" msgstr "نمط ترتيب العرض الشجري" @@ -6490,227 +6303,227 @@ msgstr "نمط ترتيب العرض الشجري" msgid "The model for the TreeModelSort to sort" msgstr "نمط فرز العرض الشجري المستخدم للفرز" -#: gtk/gtktreeview.c:564 +#: gtk/gtktreeview.c:566 msgid "TreeView Model" msgstr "نمط العرض الشجري" -#: gtk/gtktreeview.c:565 +#: gtk/gtktreeview.c:567 msgid "The model for the tree view" msgstr "نمط عرض الشجرة" -#: gtk/gtktreeview.c:573 +#: gtk/gtktreeview.c:575 msgid "Horizontal Adjustment for the widget" msgstr "الضبط الأفقي للودجة" -#: gtk/gtktreeview.c:581 +#: gtk/gtktreeview.c:583 msgid "Vertical Adjustment for the widget" msgstr "الضبط العمودي للودجة" -#: gtk/gtktreeview.c:588 +#: gtk/gtktreeview.c:590 msgid "Headers Visible" msgstr "العناوين مرئية" -#: gtk/gtktreeview.c:589 +#: gtk/gtktreeview.c:591 msgid "Show the column header buttons" msgstr "أظهر أزرار رؤوس العمود" -#: gtk/gtktreeview.c:596 +#: gtk/gtktreeview.c:598 msgid "Headers Clickable" msgstr "الرؤوس قابلة للنقر" -#: gtk/gtktreeview.c:597 +#: gtk/gtktreeview.c:599 msgid "Column headers respond to click events" msgstr "رؤوس العمود تستجيب لأحداث النقر" -#: gtk/gtktreeview.c:604 +#: gtk/gtktreeview.c:606 msgid "Expander Column" msgstr "عمود موسع" -#: gtk/gtktreeview.c:605 +#: gtk/gtktreeview.c:607 msgid "Set the column for the expander column" msgstr "تعين العمود للعمود الموسع" -#: gtk/gtktreeview.c:620 +#: gtk/gtktreeview.c:622 msgid "Rules Hint" msgstr "تلميحة القواعد" -#: gtk/gtktreeview.c:621 +#: gtk/gtktreeview.c:623 msgid "Set a hint to the theme engine to draw rows in alternating colors" msgstr "تعين تلميحة لآلة التيمة حتى ترسم صفوفا بألوان متغايرة" -#: gtk/gtktreeview.c:628 +#: gtk/gtktreeview.c:630 msgid "Enable Search" msgstr "تفعيل البحث" -#: gtk/gtktreeview.c:629 +#: gtk/gtktreeview.c:631 msgid "View allows user to search through columns interactively" msgstr "عرض يسمح للمستخدم بالبحث خلال الأعمدة بتفاعل" -#: gtk/gtktreeview.c:636 +#: gtk/gtktreeview.c:638 msgid "Search Column" msgstr "عمود بحث" -#: gtk/gtktreeview.c:637 +#: gtk/gtktreeview.c:639 #, fuzzy msgid "Model column to search through during interactive search" msgstr "عمود النمط الذي يتم البحث خلاله أثناء البحث خلال الكود" -#: gtk/gtktreeview.c:657 +#: gtk/gtktreeview.c:659 msgid "Fixed Height Mode" msgstr "نسق الارتفاع الثابت" -#: gtk/gtktreeview.c:658 +#: gtk/gtktreeview.c:660 msgid "Speeds up GtkTreeView by assuming that all rows have the same height" msgstr "يسرع GtkTreeView باعتبار جميع الأعمدة ذات إرتفاع موحد" -#: gtk/gtktreeview.c:678 +#: gtk/gtktreeview.c:680 msgid "Hover Selection" msgstr "اختيار الحوم" -#: gtk/gtktreeview.c:679 +#: gtk/gtktreeview.c:681 msgid "Whether the selection should follow the pointer" msgstr "فيما اذا كان المنتقى يتبع المؤشر" -#: gtk/gtktreeview.c:698 +#: gtk/gtktreeview.c:700 msgid "Hover Expand" msgstr "تمديد الحوم" -#: gtk/gtktreeview.c:699 +#: gtk/gtktreeview.c:701 msgid "" "Whether rows should be expanded/collapsed when the pointer moves over them" msgstr "ما إذا وجب توسيع وانهيار الصفوف عندما يقوم المؤشر بتحريكها" -#: gtk/gtktreeview.c:713 +#: gtk/gtktreeview.c:715 msgid "Show Expanders" msgstr "اظهار الموسعات" -#: gtk/gtktreeview.c:714 +#: gtk/gtktreeview.c:716 msgid "View has expanders" msgstr "المظهر له موسعات" -#: gtk/gtktreeview.c:728 +#: gtk/gtktreeview.c:730 msgid "Level Indentation" msgstr "مستوى التثليم" -#: gtk/gtktreeview.c:729 +#: gtk/gtktreeview.c:731 msgid "Extra indentation for each level" msgstr "إزاحة اضافية لكل مستوى" # In french = etirement -#: gtk/gtktreeview.c:738 +#: gtk/gtktreeview.c:740 msgid "Rubber Banding" msgstr "التمديد" -#: gtk/gtktreeview.c:739 +#: gtk/gtktreeview.c:741 msgid "" "Whether to enable selection of multiple items by dragging the mouse pointer" msgstr "ما إذا سيتم السماح بانتقاء عناصر متعددة باستعمال الفأرة" -#: gtk/gtktreeview.c:746 +#: gtk/gtktreeview.c:748 msgid "Enable Grid Lines" msgstr "مكّن خطوط الشبكة" -#: gtk/gtktreeview.c:747 +#: gtk/gtktreeview.c:749 msgid "Whether grid lines should be drawn in the tree view" msgstr "فيما إذا كان سيتم عرض خطوط الشبكة في مظهر الشجرة" -#: gtk/gtktreeview.c:755 +#: gtk/gtktreeview.c:757 msgid "Enable Tree Lines" msgstr "مكّن خطوط الشجرة" -#: gtk/gtktreeview.c:756 +#: gtk/gtktreeview.c:758 msgid "Whether tree lines should be drawn in the tree view" msgstr "فيما إذا كان سيتم عرض خطوط الشجرة في مظهر الشجرة" -#: gtk/gtktreeview.c:764 +#: gtk/gtktreeview.c:766 msgid "The column in the model containing the tooltip texts for the rows" msgstr "عمود النموذج المحتوي على نصوص التلميحات للصفوف" -#: gtk/gtktreeview.c:786 +#: gtk/gtktreeview.c:788 msgid "Vertical Separator Width" msgstr "العرض العمودي للفاصل" -#: gtk/gtktreeview.c:787 +#: gtk/gtktreeview.c:789 msgid "Vertical space between cells. Must be an even number" msgstr "الفراغ العمودي بين الخلايا. يجب أن يكون رقما زوجيا" -#: gtk/gtktreeview.c:795 +#: gtk/gtktreeview.c:797 msgid "Horizontal Separator Width" msgstr "العرض الأفقي للفاصل" -#: gtk/gtktreeview.c:796 +#: gtk/gtktreeview.c:798 msgid "Horizontal space between cells. Must be an even number" msgstr "الفراغ الأفقي بين الخلايا. يجب أن يكون رقما زوجيا" -#: gtk/gtktreeview.c:804 +#: gtk/gtktreeview.c:806 msgid "Allow Rules" msgstr "اسمح بالقواعد" -#: gtk/gtktreeview.c:805 +#: gtk/gtktreeview.c:807 msgid "Allow drawing of alternating color rows" msgstr "السماح برسم أعمدة ملونة متوالية" -#: gtk/gtktreeview.c:811 +#: gtk/gtktreeview.c:813 msgid "Indent Expanders" msgstr "إزاحة الموسعات" -#: gtk/gtktreeview.c:812 +#: gtk/gtktreeview.c:814 msgid "Make the expanders indented" msgstr "جعل الموسعات مجوفة" -#: gtk/gtktreeview.c:818 +#: gtk/gtktreeview.c:820 msgid "Even Row Color" msgstr "لون السطر الزوجي" -#: gtk/gtktreeview.c:819 +#: gtk/gtktreeview.c:821 msgid "Color to use for even rows" msgstr "اللون للاستخدام للسطور الزوجية" -#: gtk/gtktreeview.c:825 +#: gtk/gtktreeview.c:827 msgid "Odd Row Color" msgstr "لون السطر الغريب" -#: gtk/gtktreeview.c:826 +#: gtk/gtktreeview.c:828 msgid "Color to use for odd rows" msgstr "اللون للاستخدام للسطور الغريبة" -#: gtk/gtktreeview.c:832 +#: gtk/gtktreeview.c:834 msgid "Row Ending details" msgstr "تفاصيل نهاية الصف" -#: gtk/gtktreeview.c:833 +#: gtk/gtktreeview.c:835 msgid "Enable extended row background theming" msgstr "تفعيل التنسيق الممدّد لخلفية الأعمدة" -#: gtk/gtktreeview.c:839 +#: gtk/gtktreeview.c:841 msgid "Grid line width" msgstr "عرض خط الشبكة" -#: gtk/gtktreeview.c:840 +#: gtk/gtktreeview.c:842 msgid "Width, in pixels, of the tree view grid lines" msgstr "العرض بالبكسلات لأسطر الشبكة لمظهر الشجرة" -#: gtk/gtktreeview.c:846 +#: gtk/gtktreeview.c:848 msgid "Tree line width" msgstr "عرض سطر الشجرة" -#: gtk/gtktreeview.c:847 +#: gtk/gtktreeview.c:849 msgid "Width, in pixels, of the tree view lines" msgstr "العرض بالبكسلات لأسطر مظهر الشجرة" -#: gtk/gtktreeview.c:853 +#: gtk/gtktreeview.c:855 msgid "Grid line pattern" msgstr "نمط خط الشبكة" -#: gtk/gtktreeview.c:854 +#: gtk/gtktreeview.c:856 msgid "Dash pattern used to draw the tree view grid lines" msgstr "نمط الخط الفاصل لرسم أسطر شبكة مظهر الشجرة" -#: gtk/gtktreeview.c:860 +#: gtk/gtktreeview.c:862 msgid "Tree line pattern" msgstr "نمط سطر الشجرة" -#: gtk/gtktreeview.c:861 +#: gtk/gtktreeview.c:863 msgid "Dash pattern used to draw the tree view lines" msgstr "نمط الخط الفاصل لرسم أسطر مظهر الشجرة" @@ -6718,7 +6531,7 @@ msgstr "نمط الخط الفاصل لرسم أسطر مظهر الشجرة" msgid "Whether to display the column" msgstr "ما إذا يعرض العمود" -#: gtk/gtktreeviewcolumn.c:200 gtk/gtkwindow.c:542 +#: gtk/gtktreeviewcolumn.c:200 gtk/gtkwindow.c:566 msgid "Resizable" msgstr "قابل للتحجيم" @@ -6835,231 +6648,231 @@ msgstr "تعريف واجهة مستخدم مدمجة" msgid "An XML string describing the merged UI" msgstr "سلسلة XML تصف واجهة المستخدم المدمجة" -#: gtk/gtkviewport.c:107 +#: gtk/gtkviewport.c:135 msgid "" "The GtkAdjustment that determines the values of the horizontal position for " "this viewport" msgstr "GtkAdjustment·المحدّد·لقيم·الموقع·الأفقي·لمنفذ·المشهد" -#: gtk/gtkviewport.c:115 +#: gtk/gtkviewport.c:143 msgid "" "The GtkAdjustment that determines the values of the vertical position for " "this viewport" msgstr "GtkAdjustment المحدّد لقيم الموقع العمودي لمنفذ المشهد" -#: gtk/gtkviewport.c:123 +#: gtk/gtkviewport.c:151 msgid "Determines how the shadowed box around the viewport is drawn" msgstr "يحدّد كيفيّة رسم الصندوق المضلّل حول منفذ المشهد" -#: gtk/gtkwidget.c:553 +#: gtk/gtkwidget.c:573 msgid "Widget name" msgstr "اسم الودجة" -#: gtk/gtkwidget.c:554 +#: gtk/gtkwidget.c:574 msgid "The name of the widget" msgstr "اسم الودجة" -#: gtk/gtkwidget.c:560 +#: gtk/gtkwidget.c:580 msgid "Parent widget" msgstr "الودجة الأب" -#: gtk/gtkwidget.c:561 +#: gtk/gtkwidget.c:581 msgid "The parent widget of this widget. Must be a Container widget" msgstr "الودجة الأب لهذه الودجة. يجب أن يكون ودجة حاوية" -#: gtk/gtkwidget.c:568 +#: gtk/gtkwidget.c:588 msgid "Width request" msgstr "طلب عرض" -#: gtk/gtkwidget.c:569 +#: gtk/gtkwidget.c:589 msgid "" "Override for width request of the widget, or -1 if natural request should be " "used" msgstr "طلب تنميق لعرض الودجة، أو -1 إذا وجب استخدام طلب اعتيادي" -#: gtk/gtkwidget.c:577 +#: gtk/gtkwidget.c:597 msgid "Height request" msgstr "طلب ارتفاع" -#: gtk/gtkwidget.c:578 +#: gtk/gtkwidget.c:598 msgid "" "Override for height request of the widget, or -1 if natural request should " "be used" msgstr "طلب تنميق لإرتفاع الودجة، أو -1 إذا وجب استخدام طلب اعتيادي" -#: gtk/gtkwidget.c:587 +#: gtk/gtkwidget.c:607 msgid "Whether the widget is visible" msgstr "ما إذا كان الكائن ظاهرا" -#: gtk/gtkwidget.c:594 +#: gtk/gtkwidget.c:614 msgid "Whether the widget responds to input" msgstr "ما إذا كان الكائن يرد على الإدخال" -#: gtk/gtkwidget.c:600 +#: gtk/gtkwidget.c:620 msgid "Application paintable" msgstr "التطبيق قابل للرسم" -#: gtk/gtkwidget.c:601 +#: gtk/gtkwidget.c:621 msgid "Whether the application will paint directly on the widget" msgstr "ما إذا كان التطبيق سيرسم مباشرة على الودجة" -#: gtk/gtkwidget.c:607 +#: gtk/gtkwidget.c:627 msgid "Can focus" msgstr "ممكن تلقي البؤرة" -#: gtk/gtkwidget.c:608 +#: gtk/gtkwidget.c:628 msgid "Whether the widget can accept the input focus" msgstr "ما إذا كان بقدرة الكائن قبول بؤرة الإدخال" -#: gtk/gtkwidget.c:614 +#: gtk/gtkwidget.c:634 msgid "Has focus" msgstr "له بؤرة" -#: gtk/gtkwidget.c:615 +#: gtk/gtkwidget.c:635 msgid "Whether the widget has the input focus" msgstr "ما إذا كان الكائن له بؤرة الإدخال" -#: gtk/gtkwidget.c:621 +#: gtk/gtkwidget.c:641 msgid "Is focus" msgstr "هو تركيز" -#: gtk/gtkwidget.c:622 +#: gtk/gtkwidget.c:642 msgid "Whether the widget is the focus widget within the toplevel" msgstr "ما إذا كانت الودجة هي ودجة التركيز ضمن المستوى الأعلى" -#: gtk/gtkwidget.c:628 +#: gtk/gtkwidget.c:648 msgid "Can default" msgstr "ممكن الافتراض" -#: gtk/gtkwidget.c:629 +#: gtk/gtkwidget.c:649 msgid "Whether the widget can be the default widget" msgstr "ما إذا كانت الودجة ستصبح الودجة الافتراضية" -#: gtk/gtkwidget.c:635 +#: gtk/gtkwidget.c:655 msgid "Has default" msgstr "له افتراض" -#: gtk/gtkwidget.c:636 +#: gtk/gtkwidget.c:656 msgid "Whether the widget is the default widget" msgstr "ما إذا كانت الودجة هي الودجة الافتراضية" -#: gtk/gtkwidget.c:642 +#: gtk/gtkwidget.c:662 msgid "Receives default" msgstr "استقبال الافتراض" -#: gtk/gtkwidget.c:643 +#: gtk/gtkwidget.c:663 msgid "If TRUE, the widget will receive the default action when it is focused" msgstr "إذا كان TRUE، فستتلقى الودجة الحدث الافتراضي عند تركيزها" -#: gtk/gtkwidget.c:649 +#: gtk/gtkwidget.c:669 msgid "Composite child" msgstr "ابن مركب" -#: gtk/gtkwidget.c:650 +#: gtk/gtkwidget.c:670 msgid "Whether the widget is part of a composite widget" msgstr "ما إذا كانت الودجة جزء من ودجة مركبة" -#: gtk/gtkwidget.c:656 +#: gtk/gtkwidget.c:676 msgid "Style" msgstr "نمط" -#: gtk/gtkwidget.c:657 +#: gtk/gtkwidget.c:677 msgid "" "The style of the widget, which contains information about how it will look " "(colors etc)" msgstr "أسلوب الودجة، المحتوية على معلومات حول مظهرها (الألوان الخ)" -#: gtk/gtkwidget.c:663 +#: gtk/gtkwidget.c:683 msgid "Events" msgstr "أحداث" -#: gtk/gtkwidget.c:664 +#: gtk/gtkwidget.c:684 msgid "The event mask that decides what kind of GdkEvents this widget gets" msgstr "غلاف الأحداث الدي يحدّد أي نوع من GdkEvents ستتلقى هذه الودجة" -#: gtk/gtkwidget.c:671 +#: gtk/gtkwidget.c:691 msgid "Extension events" msgstr "أحداث امتداد" -#: gtk/gtkwidget.c:672 +#: gtk/gtkwidget.c:692 msgid "The mask that decides what kind of extension events this widget gets" msgstr "الغلاف الذي يحدّد أي إمتدادات الأحداث ستتلقّى هذه الودجة" -#: gtk/gtkwidget.c:679 +#: gtk/gtkwidget.c:699 msgid "No show all" msgstr "لا عرض للكل" -#: gtk/gtkwidget.c:680 +#: gtk/gtkwidget.c:700 msgid "Whether gtk_widget_show_all() should not affect this widget" msgstr "فيما إذا لن يؤثّر gtk_widget_show_all() هذه الودجة" -#: gtk/gtkwidget.c:703 +#: gtk/gtkwidget.c:723 msgid "Whether this widget has a tooltip" msgstr "إذا كان لهذه الودجة تلميحة" -#: gtk/gtkwidget.c:759 +#: gtk/gtkwidget.c:779 msgid "Window" msgstr "نافذة" -#: gtk/gtkwidget.c:760 +#: gtk/gtkwidget.c:780 msgid "The widget's window if it is realized" msgstr "نافذة الودجة عند تحقيقها" -#: gtk/gtkwidget.c:774 +#: gtk/gtkwidget.c:794 #, fuzzy msgid "Double Buffered" msgstr "ذاكرة وسيطة" -#: gtk/gtkwidget.c:775 +#: gtk/gtkwidget.c:795 #, fuzzy msgid "Whether or not the widget is double buffered" msgstr "اذا كان الملحق داخليا" -#: gtk/gtkwidget.c:2403 +#: gtk/gtkwidget.c:2427 msgid "Interior Focus" msgstr "بؤرة داخلية" -#: gtk/gtkwidget.c:2404 +#: gtk/gtkwidget.c:2428 msgid "Whether to draw the focus indicator inside widgets" msgstr "ما إذا يرسم مؤشر التركيز داخل الودجات" -#: gtk/gtkwidget.c:2410 +#: gtk/gtkwidget.c:2434 msgid "Focus linewidth" msgstr "عرض خط البؤرة" -#: gtk/gtkwidget.c:2411 +#: gtk/gtkwidget.c:2435 msgid "Width, in pixels, of the focus indicator line" msgstr "العرض بالبكسلات لسطر مؤشر التركيز" -#: gtk/gtkwidget.c:2417 +#: gtk/gtkwidget.c:2441 msgid "Focus line dash pattern" msgstr "خط البؤرة بالنقش المتقطع" -#: gtk/gtkwidget.c:2418 +#: gtk/gtkwidget.c:2442 msgid "Dash pattern used to draw the focus indicator" msgstr "نمط الخط الفاصل المستعمل لرسم مؤشر التكيز" -#: gtk/gtkwidget.c:2423 +#: gtk/gtkwidget.c:2447 msgid "Focus padding" msgstr "حشو البؤرة" -#: gtk/gtkwidget.c:2424 +#: gtk/gtkwidget.c:2448 msgid "Width, in pixels, between focus indicator and the widget 'box'" msgstr "العرض بالبكسلات بين مؤشر التركيز و ودجة 'صندوق'" -#: gtk/gtkwidget.c:2429 +#: gtk/gtkwidget.c:2453 msgid "Cursor color" msgstr "لون المؤشر" -#: gtk/gtkwidget.c:2430 +#: gtk/gtkwidget.c:2454 msgid "Color with which to draw insertion cursor" msgstr "اللون الذي يتم به رسم مؤشر ا?دخال" -#: gtk/gtkwidget.c:2435 +#: gtk/gtkwidget.c:2459 msgid "Secondary cursor color" msgstr "مؤشر ا?دخال الثانوي" -#: gtk/gtkwidget.c:2436 +#: gtk/gtkwidget.c:2460 msgid "" "Color with which to draw the secondary insertion cursor when editing mixed " "right-to-left and left-to-right text" @@ -7067,117 +6880,117 @@ msgstr "" "اللون الذي سيرسم يه مؤشر الإدخال الثانوي عند تحرير نص مختلط من اليمين إلى " "اليسار و من اليسار إلى اليمين" -#: gtk/gtkwidget.c:2441 +#: gtk/gtkwidget.c:2465 msgid "Cursor line aspect ratio" msgstr "نسبة الطول للعرض لمؤشر السطر" -#: gtk/gtkwidget.c:2442 +#: gtk/gtkwidget.c:2466 msgid "Aspect ratio with which to draw insertion cursor" msgstr "نسبة الطول للعرض التي سيرسم بها مؤشر إدخال." -#: gtk/gtkwidget.c:2456 +#: gtk/gtkwidget.c:2480 msgid "Draw Border" msgstr "ارسم الحدّ" -#: gtk/gtkwidget.c:2457 +#: gtk/gtkwidget.c:2481 msgid "Size of areas outside the widget's allocation to draw" msgstr "حجم المساحات المرسومة خارج مكان الودجة " -#: gtk/gtkwidget.c:2470 +#: gtk/gtkwidget.c:2494 msgid "Unvisited Link Color" msgstr "لون الوصلة غير المزارة" -#: gtk/gtkwidget.c:2471 +#: gtk/gtkwidget.c:2495 msgid "Color of unvisited links" msgstr "لون الوصلات غير المزارة" -#: gtk/gtkwidget.c:2484 +#: gtk/gtkwidget.c:2508 msgid "Visited Link Color" msgstr "لون الوصلة المزارة" -#: gtk/gtkwidget.c:2485 +#: gtk/gtkwidget.c:2509 msgid "Color of visited links" msgstr "لون الوصلات المزارة" -#: gtk/gtkwidget.c:2499 +#: gtk/gtkwidget.c:2523 msgid "Wide Separators" msgstr "فواصل عريضة" -#: gtk/gtkwidget.c:2500 +#: gtk/gtkwidget.c:2524 msgid "" "Whether separators have configurable width and should be drawn using a box " "instead of a line" msgstr "إذا كان للفواصل عرض متغير مرسوم باستعمال علبة عوضا عن خط" -#: gtk/gtkwidget.c:2514 +#: gtk/gtkwidget.c:2538 msgid "Separator Width" msgstr "عرض الفاصل" -#: gtk/gtkwidget.c:2515 +#: gtk/gtkwidget.c:2539 msgid "The width of separators if wide-separators is TRUE" msgstr "عرض الفواصل إذا كان wide-separators محددا بـ TRUE" -#: gtk/gtkwidget.c:2529 +#: gtk/gtkwidget.c:2553 msgid "Separator Height" msgstr "ارتفاع الفاصل" -#: gtk/gtkwidget.c:2530 +#: gtk/gtkwidget.c:2554 msgid "The height of separators if \"wide-separators\" is TRUE" msgstr "ارتفاع الفواصل إذا كان \"wide-separators\" محددا بـ TRUE" -#: gtk/gtkwidget.c:2544 +#: gtk/gtkwidget.c:2568 msgid "Horizontal Scroll Arrow Length" msgstr "طول أسهم شريط التدرج الأفقي" -#: gtk/gtkwidget.c:2545 +#: gtk/gtkwidget.c:2569 msgid "The length of horizontal scroll arrows" msgstr "طول أسهم شريط التدرج الأفقي" -#: gtk/gtkwidget.c:2559 +#: gtk/gtkwidget.c:2583 msgid "Vertical Scroll Arrow Length" msgstr "طول أسهم شريط التدرج العمودي" -#: gtk/gtkwidget.c:2560 +#: gtk/gtkwidget.c:2584 msgid "The length of vertical scroll arrows" msgstr "عرض أسهم شريط التدرج العمودي" -#: gtk/gtkwindow.c:483 +#: gtk/gtkwindow.c:507 msgid "Window Type" msgstr "نوع النافذة" -#: gtk/gtkwindow.c:484 +#: gtk/gtkwindow.c:508 msgid "The type of the window" msgstr "نوع النافذة" -#: gtk/gtkwindow.c:492 +#: gtk/gtkwindow.c:516 msgid "Window Title" msgstr "عنوان النافذة" -#: gtk/gtkwindow.c:493 +#: gtk/gtkwindow.c:517 msgid "The title of the window" msgstr "عنوان النافذة" -#: gtk/gtkwindow.c:500 +#: gtk/gtkwindow.c:524 msgid "Window Role" msgstr "دور النافذة" -#: gtk/gtkwindow.c:501 +#: gtk/gtkwindow.c:525 msgid "Unique identifier for the window to be used when restoring a session" msgstr "معرف وحيد للنافذة يستخدم عند استرجاع جلسة" -#: gtk/gtkwindow.c:517 +#: gtk/gtkwindow.c:541 msgid "Startup ID" msgstr "هوية البدأ" -#: gtk/gtkwindow.c:518 +#: gtk/gtkwindow.c:542 msgid "Unique startup identifier for the window used by startup-notification" msgstr "معرف وحيد لعملية البدأ للنافذة المستعملة من طرف startup-notification" -#: gtk/gtkwindow.c:525 +#: gtk/gtkwindow.c:549 msgid "Allow Shrink" msgstr "اسمح بالانكماش" -#: gtk/gtkwindow.c:527 +#: gtk/gtkwindow.c:551 #, no-c-format msgid "" "If TRUE, the window has no mimimum size. Setting this to TRUE is 99% of the " @@ -7186,23 +6999,23 @@ msgstr "" "إذا ضبط لـ TRUE فلن يكون للنافذة حجم أدنى. ضبط هذا لـ TRUE فكرة سيّئة في 99% " "من الحالات." -#: gtk/gtkwindow.c:534 +#: gtk/gtkwindow.c:558 msgid "Allow Grow" msgstr "اسمح بالنمو" -#: gtk/gtkwindow.c:535 +#: gtk/gtkwindow.c:559 msgid "If TRUE, users can expand the window beyond its minimum size" msgstr "اذا كان TRUE، فسيتمكن المستخدمون من تمديد النافذة فوق حجمها الأدنى" -#: gtk/gtkwindow.c:543 +#: gtk/gtkwindow.c:567 msgid "If TRUE, users can resize the window" msgstr "إذا كان TRUE، باستطاعة المستخدمين تحجيم النافذة." -#: gtk/gtkwindow.c:550 +#: gtk/gtkwindow.c:574 msgid "Modal" msgstr "سائدة" -#: gtk/gtkwindow.c:551 +#: gtk/gtkwindow.c:575 msgid "" "If TRUE, the window is modal (other windows are not usable while this one is " "up)" @@ -7210,160 +7023,160 @@ msgstr "" "إذا ضبط لـ TRUE فستكون النافذة سائدة (لن يمكن استخدام نوافذ أخرى عند تكيز " "هذه النافذة)" -#: gtk/gtkwindow.c:558 +#: gtk/gtkwindow.c:582 msgid "Window Position" msgstr "موقع النافذة" -#: gtk/gtkwindow.c:559 +#: gtk/gtkwindow.c:583 msgid "The initial position of the window" msgstr "موقع النافذة الأولي" -#: gtk/gtkwindow.c:567 +#: gtk/gtkwindow.c:591 msgid "Default Width" msgstr "العرض الافتراضي" -#: gtk/gtkwindow.c:568 +#: gtk/gtkwindow.c:592 msgid "The default width of the window, used when initially showing the window" msgstr "عرض النافذة الإفتراضي، مستخدم عند عرض النافذة في المرة الأولى" -#: gtk/gtkwindow.c:577 +#: gtk/gtkwindow.c:601 msgid "Default Height" msgstr "الإرتفاع الإفتراضي" -#: gtk/gtkwindow.c:578 +#: gtk/gtkwindow.c:602 msgid "" "The default height of the window, used when initially showing the window" msgstr "ارتفاع النافذة الإفتراضي، مستخدم عند عرض النافذة في المرة الأولى" -#: gtk/gtkwindow.c:587 +#: gtk/gtkwindow.c:611 msgid "Destroy with Parent" msgstr "تدمير مع الأم" -#: gtk/gtkwindow.c:588 +#: gtk/gtkwindow.c:612 msgid "If this window should be destroyed when the parent is destroyed" msgstr "فيما إذا وجب تدمير هذه النافذة عند تدمير النافذة الأم" -#: gtk/gtkwindow.c:596 +#: gtk/gtkwindow.c:620 msgid "Icon for this window" msgstr "أيقونة لهذه النافذة" -#: gtk/gtkwindow.c:602 +#: gtk/gtkwindow.c:626 #, fuzzy msgid "Mnemonics Visible" msgstr "مفتاح الإختصار المسطّر" -#: gtk/gtkwindow.c:603 +#: gtk/gtkwindow.c:627 #, fuzzy msgid "Whether mnemonics are currently visible in this window" msgstr "فيما إذا كان المستوى الأعلى هو النافذة النشطة" -#: gtk/gtkwindow.c:619 +#: gtk/gtkwindow.c:643 msgid "Name of the themed icon for this window" msgstr "اسم أيقونة هذه النافذة" -#: gtk/gtkwindow.c:634 +#: gtk/gtkwindow.c:658 msgid "Is Active" msgstr "نشط" -#: gtk/gtkwindow.c:635 +#: gtk/gtkwindow.c:659 msgid "Whether the toplevel is the current active window" msgstr "فيما إذا كان المستوى الأعلى هو النافذة النشطة" -#: gtk/gtkwindow.c:642 +#: gtk/gtkwindow.c:666 msgid "Focus in Toplevel" msgstr "تركيز في المستوى الأعلى" -#: gtk/gtkwindow.c:643 +#: gtk/gtkwindow.c:667 msgid "Whether the input focus is within this GtkWindow" msgstr "ما اذا يكون تركيز الإدخال ضمن GtkWindow الحالي" -#: gtk/gtkwindow.c:650 +#: gtk/gtkwindow.c:674 msgid "Type hint" msgstr "أكتب التلميحة" -#: gtk/gtkwindow.c:651 +#: gtk/gtkwindow.c:675 msgid "" "Hint to help the desktop environment understand what kind of window this is " "and how to treat it." msgstr "تلميحة لمساعدة بيئة سطح المكتب في فهم نوع النافذة و طريقة التعاكل معها" -#: gtk/gtkwindow.c:659 +#: gtk/gtkwindow.c:683 msgid "Skip taskbar" msgstr "تخطي عمود المهام" -#: gtk/gtkwindow.c:660 +#: gtk/gtkwindow.c:684 msgid "TRUE if the window should not be in the task bar." msgstr "TRUE إذا وجب أن لا تكون النافذة في عمود المهام." -#: gtk/gtkwindow.c:667 +#: gtk/gtkwindow.c:691 msgid "Skip pager" msgstr "تخطي المتصفح" -#: gtk/gtkwindow.c:668 +#: gtk/gtkwindow.c:692 msgid "TRUE if the window should not be in the pager." msgstr "يضبط لـ TRUE إذا وجب أن لا تكون النافذة في المتصفح." -#: gtk/gtkwindow.c:675 +#: gtk/gtkwindow.c:699 msgid "Urgent" msgstr "إستعجالي" -#: gtk/gtkwindow.c:676 +#: gtk/gtkwindow.c:700 msgid "TRUE if the window should be brought to the user's attention." msgstr "يضبط لـ TRUE إذا وجب تنبيه المستخدم بالنافذة" -#: gtk/gtkwindow.c:690 +#: gtk/gtkwindow.c:714 msgid "Accept focus" msgstr "تقبل التركيز" -#: gtk/gtkwindow.c:691 +#: gtk/gtkwindow.c:715 msgid "TRUE if the window should receive the input focus." msgstr "يضبط لـ TRUE إذا وجب للنافذة أن تتلقى تركيز الإدخال." -#: gtk/gtkwindow.c:705 +#: gtk/gtkwindow.c:729 msgid "Focus on map" msgstr "تركيز على الخارطة" -#: gtk/gtkwindow.c:706 +#: gtk/gtkwindow.c:730 msgid "TRUE if the window should receive the input focus when mapped." msgstr "يضبط لـ TRUE إذا وجب للنافذة أن تتلقى تركيز الإدخال." -#: gtk/gtkwindow.c:720 +#: gtk/gtkwindow.c:744 msgid "Decorated" msgstr "مزوق" -#: gtk/gtkwindow.c:721 +#: gtk/gtkwindow.c:745 msgid "Whether the window should be decorated by the window manager" msgstr "ما إذا وجب تزويق النافذة بمدير النوافذ" -#: gtk/gtkwindow.c:735 +#: gtk/gtkwindow.c:759 msgid "Deletable" msgstr "قابل للحذف" -#: gtk/gtkwindow.c:736 +#: gtk/gtkwindow.c:760 msgid "Whether the window frame should have a close button" msgstr "ما إذا يكون لإطار النافذة زر إغلاق" -#: gtk/gtkwindow.c:752 +#: gtk/gtkwindow.c:776 msgid "Gravity" msgstr "الجاذبية" -#: gtk/gtkwindow.c:753 +#: gtk/gtkwindow.c:777 msgid "The window gravity of the window" msgstr "جاذيبة الشباك للشباك" -#: gtk/gtkwindow.c:770 +#: gtk/gtkwindow.c:794 msgid "Transient for Window" msgstr "عابر النافذة" -#: gtk/gtkwindow.c:771 +#: gtk/gtkwindow.c:795 msgid "The transient parent of the dialog" msgstr "العابر الوالد للنافذة" -#: gtk/gtkwindow.c:786 +#: gtk/gtkwindow.c:810 msgid "Opacity for Window" msgstr "شفافية النافذة" -#: gtk/gtkwindow.c:787 +#: gtk/gtkwindow.c:811 msgid "The opacity of the window, from 0 to 1" msgstr "شفافية النافذة، من 0 إلى 1" @@ -7383,6 +7196,184 @@ msgstr "أسلوب حالة طريقة الإدخال" msgid "How to draw the input method statusbar" msgstr "كيفية رسم عمود الحالة لطريقة الإدخال" +#~ msgid "Enable arrow keys" +#~ msgstr "تفعيل مفاتيح الأسهم" + +#~ msgid "Whether the arrow keys move through the list of items" +#~ msgstr "إن كانت مفاتيح الأسهم تتنقل خلال قائمة العناصر" + +#~ msgid "Always enable arrows" +#~ msgstr "تفعيل الأسهم دائما" + +#~ msgid "Obsolete property, ignored" +#~ msgstr "خاصية باطلة، تجاهل" + +#~ msgid "Case sensitive" +#~ msgstr "حساس للحالة" + +#~ msgid "Whether list item matching is case sensitive" +#~ msgstr "فيما إذا كان تطابق عناصر القائمة حساس للحالة" + +#~ msgid "Allow empty" +#~ msgstr "السماح بالفراغ" + +#~ msgid "Whether an empty value may be entered in this field" +#~ msgstr "فيما اذا كان من الممكن إدخال قيمة فارغة في هذا الحقل" + +#~ msgid "Value in list" +#~ msgstr "القيمة في القائمة" + +#~ msgid "Whether entered values must already be present in the list" +#~ msgstr "فيما إذا وجب على القيم المدخلة أن تكون موجودةً في القائمة" + +#~ msgid "Curve type" +#~ msgstr "نوع المنحنى" + +#~ msgid "Is this curve linear, spline interpolated, or free-form" +#~ msgstr "هل هذا المنحنى خطي أو نقاط توجيه مستفات أو ذي شكل حر" + +#~ msgid "Minimum X" +#~ msgstr "س الدنيا" + +#~ msgid "Minimum possible value for X" +#~ msgstr "القيمة الممكنة الدنيا لـ س" + +#~ msgid "Maximum X" +#~ msgstr "س الأقصى" + +#~ msgid "Maximum possible X value" +#~ msgstr "القيمة القصوى الممكنة لـ س" + +#~ msgid "Minimum Y" +#~ msgstr "ص الأدنى" + +#~ msgid "Minimum possible value for Y" +#~ msgstr "القيمة الممكنة الدنيا لـ ص" + +#~ msgid "Maximum Y" +#~ msgstr "ص الأقصى" + +#~ msgid "Maximum possible value for Y" +#~ msgstr "القيمة الممكنة القصوى لـ ص" + +#~ msgid "File System Backend" +#~ msgstr "خلفية نظام الملفات" + +#~ msgid "Name of file system backend to use" +#~ msgstr "اسم خلفية نظام الملفات التي ستستخدم" + +#~ msgid "The currently selected filename" +#~ msgstr "اسم الملف المنتقى حاليا" + +#~ msgid "Show file operations" +#~ msgstr "إظهار عمليات الملفات" + +#~ msgid "Whether buttons for creating/manipulating files should be displayed" +#~ msgstr "فيم اذا وجب عرض أزرار لإنشاء أو معالجة الملفات" + +#~ msgid "Tab Border" +#~ msgstr "حد اللسان" + +#~ msgid "Width of the border around the tab labels" +#~ msgstr "عرض الحد حول شارات الألسنة" + +#~ msgid "Horizontal Tab Border" +#~ msgstr "حد اللسان الأفقي" + +#~ msgid "Width of the horizontal border of tab labels" +#~ msgstr "عرض الحد الأفقي لشارات الألسنة" + +#~ msgid "Vertical Tab Border" +#~ msgstr "الحد العمودي للسان" + +#~ msgid "Width of the vertical border of tab labels" +#~ msgstr "عرض الحد العمودي لشارات اللسان" + +#~ msgid "Whether tabs should have homogeneous sizes" +#~ msgstr "فيما إذا وجب أن يكون للألسنة أحجام متناسقة" + +#~ msgid "Group ID" +#~ msgstr "هويّة المجموعة" + +#~ msgid "Group ID for tabs drag and drop" +#~ msgstr "هويّة المجموعة لسحب و إلقاء الألسنة" + +#~ msgid "User Data" +#~ msgstr "البيانات الشخصية" + +#~ msgid "Anonymous User Data Pointer" +#~ msgstr "مؤشّر لبيانات شخص مجهول" + +#~ msgid "The menu of options" +#~ msgstr "قائمة الخيارات" + +#~ msgid "Size of dropdown indicator" +#~ msgstr "حجم مؤشر الإسقاط السفلي" + +#~ msgid "Spacing around indicator" +#~ msgstr "الفراغات حول المؤشر" + +#~ msgid "" +#~ "Whether the preview widget should take up the entire space it is allocated" +#~ msgstr "فيما إذا وجب أن تملأ ودجة·التلميح كامل المساحة التي خصصة لها" + +#~ msgid "The GtkAdjustment connected to the progress bar (Deprecated)" +#~ msgstr "GtkAdjustment المرتبط بعمود التطوّر (ملغى)" + +#~ msgid "Bar style" +#~ msgstr "أسلوب العمود" + +#~ msgid "" +#~ "Specifies the visual style of the bar in percentage mode (Deprecated)" +#~ msgstr "يحدد الأسلوب المرئي للعمود بنسق النسبة المائوية (ملغاة)" + +#~ msgid "Activity Step" +#~ msgstr "خطوة النشاط" + +#~ msgid "The increment used for each iteration in activity mode (Deprecated)" +#~ msgstr "التزايد المستخدم لكل تكرار في نسق النشاط (ملغى)" + +#~ msgid "Activity Blocks" +#~ msgstr "قوالب النشاط" + +#~ msgid "" +#~ "The number of blocks which can fit in the progress bar area in activity " +#~ "mode (Deprecated)" +#~ msgstr "" +#~ "عدد القوالب التي يمكن أن تلائم منطقة عمود التقدم في نسق النشاط (ملغاة)" + +#~ msgid "Discrete Blocks" +#~ msgstr "القوالب المتقطعة" + +#~ msgid "" +#~ "The number of discrete blocks in a progress bar (when shown in the " +#~ "discrete style)" +#~ msgstr "عدد القوالب المتقطعة في عمود التقدم (عند عرضها بالأسلوب المتقطع)" + +#~ msgid "Horizontal adjustment for the text widget" +#~ msgstr "الضبط الأفقي لودجة النص" + +#~ msgid "Vertical adjustment for the text widget" +#~ msgstr "الضبط العمودي لودجة النص" + +#~ msgid "Line Wrap" +#~ msgstr "قسم السطر" + +#~ msgid "Whether lines are wrapped at widget edges" +#~ msgstr "فيما إذا كانت السطور ستقسم عند حواف الودجات" + +#~ msgid "Word Wrap" +#~ msgstr "قسم الكلمات" + +#~ msgid "Whether words are wrapped at widget edges" +#~ msgstr "فيما إذا كانت الكلمات ستقسم عند حواف الودجات" + +#~ msgid "Tooltips" +#~ msgstr "تلميحات" + +#~ msgid "If the tooltips of the toolbar should be active or not" +#~ msgstr "فيما إذا وجب تنشيط تلميحات شريط الأدوات " + #~ msgid "The orientation of the toolbar" #~ msgstr "اتجاه شريط ا?دوات" diff --git a/po-properties/as.po b/po-properties/as.po index 64aee184ba..2c7ec3e0aa 100644 --- a/po-properties/as.po +++ b/po-properties/as.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: as\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-03-22 23:35-0400\n" +"POT-Creation-Date: 2010-05-25 20:10-0400\n" "PO-Revision-Date: 2009-09-16 11:40+0530\n" "Last-Translator: \n" "Language-Team: American English <>\n" @@ -59,7 +59,7 @@ msgstr "প্ৰতিটো নমুনাৰ বাবে বিট" msgid "The number of bits per sample" msgstr "প্ৰতিটো নমুনাৰ বাবে বিটৰ সংখ্যা" -#: gdk-pixbuf/gdk-pixbuf.c:132 gtk/gtklayout.c:633 gtk/gtktreeviewcolumn.c:208 +#: gdk-pixbuf/gdk-pixbuf.c:132 gtk/gtklayout.c:597 gtk/gtktreeviewcolumn.c:208 msgid "Width" msgstr "বহল" @@ -67,7 +67,7 @@ msgstr "বহল" msgid "The number of columns of the pixbuf" msgstr "pixbuf ৰ স্তম্ভৰ সংখ্যা" -#: gdk-pixbuf/gdk-pixbuf.c:142 gtk/gtklayout.c:642 +#: gdk-pixbuf/gdk-pixbuf.c:142 gtk/gtklayout.c:606 msgid "Height" msgstr "উচ্চতা" @@ -101,7 +101,7 @@ msgid "The default display for GDK" msgstr "GDK ৰ অবিকল্পিত প্ৰদৰ্শন" #: gdk/gdkpango.c:538 gtk/gtkinvisible.c:86 gtk/gtkmountoperation.c:176 -#: gtk/gtkstatusicon.c:280 gtk/gtkwindow.c:626 +#: gtk/gtkstatusicon.c:285 gtk/gtkwindow.c:650 msgid "Screen" msgstr "পৰ্দ্দা" @@ -125,7 +125,7 @@ msgstr "ফন্টৰ বিভাজন" msgid "The resolution for fonts on the screen" msgstr "পৰ্দ্দাৰ ফন্টৰ বিভাজন" -#: gdk/gdkwindow.c:496 gdk/gdkwindow.c:497 +#: gdk/gdkwindow.c:565 gdk/gdkwindow.c:566 msgid "Cursor" msgstr "কাৰ্ছাৰ" @@ -245,119 +245,119 @@ msgstr "লাইছেঞ্চ মেৰাই দিয়ক" msgid "Whether to wrap the license text." msgstr "লাইছেঞ্চৰ শব্দক মেৰোৱা হ'ব নে নাই ।" -#: gtk/gtkaccellabel.c:178 +#: gtk/gtkaccellabel.c:189 msgid "Accelerator Closure" msgstr "Accelerator Closure" -#: gtk/gtkaccellabel.c:179 +#: gtk/gtkaccellabel.c:190 msgid "The closure to be monitored for accelerator changes" msgstr "acceleratorৰ সাল সলনিৰ বাবে যি closure ক নিৰীক্ষণ কৰিব লাগিব" -#: gtk/gtkaccellabel.c:185 +#: gtk/gtkaccellabel.c:196 msgid "Accelerator Widget" msgstr "Accelerator Widget" -#: gtk/gtkaccellabel.c:186 +#: gtk/gtkaccellabel.c:197 msgid "The widget to be monitored for accelerator changes" msgstr "acceleratorৰ সাল সলনিৰ বাবে যি widget ক নিৰীক্ষণ কৰিব লাগিব" -#: gtk/gtkaction.c:181 gtk/gtkactiongroup.c:170 gtk/gtkprinter.c:111 +#: gtk/gtkaction.c:220 gtk/gtkactiongroup.c:170 gtk/gtkprinter.c:130 #: gtk/gtktextmark.c:89 msgid "Name" msgstr "নাম" -#: gtk/gtkaction.c:182 +#: gtk/gtkaction.c:221 msgid "A unique name for the action." msgstr "এই কামৰ বাবে এটা অদ্বিতীয় নাম ।" -#: gtk/gtkaction.c:200 gtk/gtkbutton.c:219 gtk/gtkexpander.c:195 -#: gtk/gtkframe.c:105 gtk/gtklabel.c:506 gtk/gtkmenuitem.c:305 -#: gtk/gtktoolbutton.c:204 gtk/gtktoolitemgroup.c:1535 +#: gtk/gtkaction.c:239 gtk/gtkbutton.c:227 gtk/gtkexpander.c:195 +#: gtk/gtkframe.c:114 gtk/gtklabel.c:528 gtk/gtkmenuitem.c:305 +#: gtk/gtktoolbutton.c:204 gtk/gtktoolitemgroup.c:1543 msgid "Label" msgstr "লেবেল" -#: gtk/gtkaction.c:201 +#: gtk/gtkaction.c:240 msgid "The label used for menu items and buttons that activate this action." msgstr "এই কাম সক্ৰিয় কৰা তালিকাৰ বস্তু আৰু বুটামত ব্যৱহৃত লেবেল ।" -#: gtk/gtkaction.c:217 +#: gtk/gtkaction.c:256 msgid "Short label" msgstr "সংক্ষিপ্ত লেবেল" -#: gtk/gtkaction.c:218 +#: gtk/gtkaction.c:257 msgid "A shorter label that may be used on toolbar buttons." msgstr "টুলবাৰৰ বুটামত ব্যৱহাৰযোগ্য এটা সংক্ষিপ্ত লেবেল ।" -#: gtk/gtkaction.c:226 +#: gtk/gtkaction.c:265 msgid "Tooltip" msgstr "টুলটিপ" -#: gtk/gtkaction.c:227 +#: gtk/gtkaction.c:266 msgid "A tooltip for this action." msgstr "এই কামটোৰ বাবে এটা টুলটিপ ।" -#: gtk/gtkaction.c:242 +#: gtk/gtkaction.c:281 msgid "Stock Icon" msgstr "Stock আইকন" -#: gtk/gtkaction.c:243 +#: gtk/gtkaction.c:282 msgid "The stock icon displayed in widgets representing this action." msgstr "বিভিন্ন উইজেটত এই কাম নিৰ্দেশকাৰী Stock আইকন।" -#: gtk/gtkaction.c:263 gtk/gtkstatusicon.c:253 +#: gtk/gtkaction.c:302 gtk/gtkstatusicon.c:258 msgid "GIcon" msgstr "GIcon" -#: gtk/gtkaction.c:264 gtk/gtkcellrendererpixbuf.c:206 gtk/gtkimage.c:339 -#: gtk/gtkstatusicon.c:254 +#: gtk/gtkaction.c:303 gtk/gtkcellrendererpixbuf.c:206 gtk/gtkimage.c:344 +#: gtk/gtkstatusicon.c:259 msgid "The GIcon being displayed" msgstr "প্ৰদৰ্শন কৰা GIcon" -#: gtk/gtkaction.c:284 gtk/gtkcellrendererpixbuf.c:171 gtk/gtkimage.c:321 -#: gtk/gtkprinter.c:160 gtk/gtkstatusicon.c:237 gtk/gtkwindow.c:618 +#: gtk/gtkaction.c:323 gtk/gtkcellrendererpixbuf.c:171 gtk/gtkimage.c:326 +#: gtk/gtkprinter.c:179 gtk/gtkstatusicon.c:242 gtk/gtkwindow.c:642 msgid "Icon Name" msgstr "আইকনৰ নাম" -#: gtk/gtkaction.c:285 gtk/gtkcellrendererpixbuf.c:172 gtk/gtkimage.c:322 -#: gtk/gtkstatusicon.c:238 +#: gtk/gtkaction.c:324 gtk/gtkcellrendererpixbuf.c:172 gtk/gtkimage.c:327 +#: gtk/gtkstatusicon.c:243 msgid "The name of the icon from the icon theme" msgstr "আইকন থিমৰ পৰা প্ৰাপ্ত আইকনৰ নাম" -#: gtk/gtkaction.c:292 gtk/gtktoolitem.c:192 +#: gtk/gtkaction.c:331 gtk/gtktoolitem.c:185 msgid "Visible when horizontal" msgstr "পথালিকে দেখা দিয়া" -#: gtk/gtkaction.c:293 gtk/gtktoolitem.c:193 +#: gtk/gtkaction.c:332 gtk/gtktoolitem.c:186 msgid "" "Whether the toolbar item is visible when the toolbar is in a horizontal " "orientation." msgstr "টুলবাৰ পথালিকে থাকিলে টুলবাৰৰ বস্তু দেখা যাব নে নাই ।" -#: gtk/gtkaction.c:308 +#: gtk/gtkaction.c:347 msgid "Visible when overflown" msgstr "overflown অৱস্থাত দৃশ্যমান" -#: gtk/gtkaction.c:309 +#: gtk/gtkaction.c:348 msgid "" "When TRUE, toolitem proxies for this action are represented in the toolbar " "overflow menu." msgstr "TRUE হ'লে, টুলবাৰ overflow তালিকাত এই কামৰ টুল আইটেমৰ নিযুক্তকক দেখুৱা হয় ।" -#: gtk/gtkaction.c:316 gtk/gtktoolitem.c:199 +#: gtk/gtkaction.c:355 gtk/gtktoolitem.c:192 msgid "Visible when vertical" msgstr "উলম্ব অৱস্থাত দৃশ্যমান" -#: gtk/gtkaction.c:317 gtk/gtktoolitem.c:200 +#: gtk/gtkaction.c:356 gtk/gtktoolitem.c:193 msgid "" "Whether the toolbar item is visible when the toolbar is in a vertical " "orientation." msgstr "টুলবাৰ উলম্ব অৱস্থাত থাকিলে টুলবাৰৰ বস্তু দৃশ্যমান থাকিব নে নাই ।" -#: gtk/gtkaction.c:324 gtk/gtktoolitem.c:206 +#: gtk/gtkaction.c:363 gtk/gtktoolitem.c:199 msgid "Is important" msgstr "গুৰুত্বপূৰ্ণ হয়" -#: gtk/gtkaction.c:325 +#: gtk/gtkaction.c:364 msgid "" "Whether the action is considered important. When TRUE, toolitem proxies for " "this action show text in GTK_TOOLBAR_BOTH_HORIZ mode." @@ -365,37 +365,37 @@ msgstr "" "কামটোক গুৰুত্বপূৰ্ণ বিবেচনা কৰা হয় নে নহয় । ইয়াৰ মান TRUE হ'লে টুল-আইটেম নিযুক্তক " "GTK_TOOLBAR_BOTH_HORIZ মোডত লিপি প্ৰদৰ্শন কৰি ।" -#: gtk/gtkaction.c:333 +#: gtk/gtkaction.c:372 msgid "Hide if empty" msgstr "ৰিক্ত হ'লে লুকাই ৰাখক" -#: gtk/gtkaction.c:334 +#: gtk/gtkaction.c:373 msgid "When TRUE, empty menu proxies for this action are hidden." msgstr "TRUE হ'লে এই কামৰ ৰিক্ত তালিকা নিযুক্তকক লুকাই ৰখা হয় ।" -#: gtk/gtkaction.c:340 gtk/gtkactiongroup.c:177 gtk/gtkcellrenderer.c:193 -#: gtk/gtkwidget.c:593 +#: gtk/gtkaction.c:379 gtk/gtkactiongroup.c:177 gtk/gtkcellrenderer.c:193 +#: gtk/gtkwidget.c:613 msgid "Sensitive" msgstr "সংবেদনশীল" -#: gtk/gtkaction.c:341 +#: gtk/gtkaction.c:380 msgid "Whether the action is enabled." msgstr "কামটো সক্ৰিয় হয় নে নহয়" -#: gtk/gtkaction.c:347 gtk/gtkactiongroup.c:184 gtk/gtkstatusicon.c:296 -#: gtk/gtktreeviewcolumn.c:192 gtk/gtkwidget.c:586 +#: gtk/gtkaction.c:386 gtk/gtkactiongroup.c:184 gtk/gtkstatusicon.c:301 +#: gtk/gtktreeviewcolumn.c:192 gtk/gtkwidget.c:606 msgid "Visible" msgstr "দৃশ্যমান" -#: gtk/gtkaction.c:348 +#: gtk/gtkaction.c:387 msgid "Whether the action is visible." msgstr "কামটো দৃশ্যমান নে নহয় ।" -#: gtk/gtkaction.c:354 +#: gtk/gtkaction.c:393 msgid "Action Group" msgstr "কাৰ্য্যৰ গোট" -#: gtk/gtkaction.c:355 +#: gtk/gtkaction.c:394 msgid "" "The GtkActionGroup this GtkAction is associated with, or NULL (for internal " "use)." @@ -403,12 +403,12 @@ msgstr "" "এই GtkAction-টো যি GtkActionGroup ৰ সৈতে সংশ্লিষ্ট, বা NULL (ভিতৰুৱা ভাবে " "ব্যৱহাৰ কৰিব লগা) ।" -#: gtk/gtkaction.c:373 gtk/gtkimagemenuitem.c:169 +#: gtk/gtkaction.c:412 gtk/gtkimagemenuitem.c:169 msgid "Always show image" msgstr "Always show image" # -#: gtk/gtkaction.c:374 gtk/gtkimagemenuitem.c:170 +#: gtk/gtkaction.c:413 gtk/gtkimagemenuitem.c:170 msgid "Whether the image will always be shown" msgstr "Whether the image will always be shown" @@ -441,7 +441,7 @@ msgid "Whether to use the related actions appearance properties" msgstr "সম্বন্ধিত কাৰ্য্যৰ প্ৰদৰ্শনৰ গুণ ব্যৱহাৰ কৰা যাব নে নাই" #: gtk/gtkadjustment.c:93 gtk/gtkcellrendererprogress.c:128 -#: gtk/gtkscalebutton.c:206 gtk/gtkspinbutton.c:269 +#: gtk/gtkscalebutton.c:222 gtk/gtkspinbutton.c:269 msgid "Value" msgstr "মান" @@ -489,11 +489,11 @@ msgstr "পৃষ্ঠাৰ আকাৰ" msgid "The page size of the adjustment" msgstr "adjustment সৰ পৃষ্ঠাৰ আকাৰ" -#: gtk/gtkalignment.c:90 +#: gtk/gtkalignment.c:117 msgid "Horizontal alignment" msgstr "পথালিকে কৰা সংৰেখন" -#: gtk/gtkalignment.c:91 gtk/gtkbutton.c:270 +#: gtk/gtkalignment.c:118 gtk/gtkbutton.c:278 msgid "" "Horizontal position of child in available space. 0.0 is left aligned, 1.0 is " "right aligned" @@ -501,11 +501,11 @@ msgstr "" "ব্যৱহাৰযোগ্য স্থানত চাইল্ডৰ পথালি অৱস্থান । ০.০ হ'লে বাওঁৰ পৰা সংৰেখন কৰা হয় আৰু " "১.০ হ'লে সোঁ-ফালৰ পৰা সংৰেখন কৰা হয়" -#: gtk/gtkalignment.c:100 +#: gtk/gtkalignment.c:127 msgid "Vertical alignment" msgstr "উলম্বভাবে সংৰেখন কৰা" -#: gtk/gtkalignment.c:101 gtk/gtkbutton.c:289 +#: gtk/gtkalignment.c:128 gtk/gtkbutton.c:297 msgid "" "Vertical position of child in available space. 0.0 is top aligned, 1.0 is " "bottom aligned" @@ -513,11 +513,11 @@ msgstr "" "ব্যৱহাৰযোগ্য স্থানত চাইল্ডৰ উলম্ব অৱস্থান । ০.০ হ'লে ওপৰৰ পৰা সংৰেখন কৰা হয় আৰু ১.০ " "হ'লে তলৰ পৰা সংৰেখন কৰা হয়" -#: gtk/gtkalignment.c:109 +#: gtk/gtkalignment.c:136 msgid "Horizontal scale" msgstr "পথালি মাপদণ্ড" -#: gtk/gtkalignment.c:110 +#: gtk/gtkalignment.c:137 msgid "" "If available horizontal space is bigger than needed for the child, how much " "of it to use for the child. 0.0 means none, 1.0 means all" @@ -526,11 +526,11 @@ msgstr "" "স্থান ব্যৱহাৰ কৰা হ'ব । ইয়াৰ মান ০.০ হ'লে কোন স্থান ব্যৱহাৰ কৰা নহ'ব আৰ মান ১.০ " "হ'লে সম্পূৰ্ণ স্থান ব্যৱহাৰ কৰা হ'ব" -#: gtk/gtkalignment.c:118 +#: gtk/gtkalignment.c:145 msgid "Vertical scale" msgstr "উলম্ব মাপদণ্ড" -#: gtk/gtkalignment.c:119 +#: gtk/gtkalignment.c:146 msgid "" "If available vertical space is bigger than needed for the child, how much of " "it to use for the child. 0.0 means none, 1.0 means all" @@ -539,187 +539,187 @@ msgstr "" "স্থান ব্যৱহাৰ কৰা হ'ব । ইয়াৰ মান ০.০ হ'লে কোন স্থান ব্যৱহাৰ কৰা নহ'ব আৰ মান ১.০ " "হ'লে সম্পূৰ্ণ স্থান ব্যৱহাৰ কৰা হ'ব" -#: gtk/gtkalignment.c:136 +#: gtk/gtkalignment.c:163 msgid "Top Padding" msgstr "ওপৰৰ অংশৰ পেডিং" -#: gtk/gtkalignment.c:137 +#: gtk/gtkalignment.c:164 msgid "The padding to insert at the top of the widget." msgstr "উইজেটৰ ওপৰৰ অংশত যি পেডিং ভৰোৱা হ'ব ।" -#: gtk/gtkalignment.c:153 +#: gtk/gtkalignment.c:180 msgid "Bottom Padding" msgstr "তলৰ পেডিং" -#: gtk/gtkalignment.c:154 +#: gtk/gtkalignment.c:181 msgid "The padding to insert at the bottom of the widget." msgstr "উইজেটৰ তলৰ অংশত যি পেডিং ভৰোৱা হ'ব ।" -#: gtk/gtkalignment.c:170 +#: gtk/gtkalignment.c:197 msgid "Left Padding" msgstr "বাওঁ ফালৰ পেডিং" -#: gtk/gtkalignment.c:171 +#: gtk/gtkalignment.c:198 msgid "The padding to insert at the left of the widget." msgstr "উইজেটৰ বাওঁফালে যি পেডিং ভৰোৱা হ'ব।" -#: gtk/gtkalignment.c:187 +#: gtk/gtkalignment.c:214 msgid "Right Padding" msgstr "সোঁফালৰ পেডিং" -#: gtk/gtkalignment.c:188 +#: gtk/gtkalignment.c:215 msgid "The padding to insert at the right of the widget." msgstr "উইজেটৰ সোঁফালে যি পেডিং ভৰোৱা হ'ব।" -#: gtk/gtkarrow.c:75 +#: gtk/gtkarrow.c:95 msgid "Arrow direction" msgstr "নিৰ্দেশকৰ দিশ" -#: gtk/gtkarrow.c:76 +#: gtk/gtkarrow.c:96 msgid "The direction the arrow should point" msgstr "নিৰ্দেশকে যি দিশত দেখোৱা উচিত" -#: gtk/gtkarrow.c:84 +#: gtk/gtkarrow.c:104 msgid "Arrow shadow" msgstr "নিৰ্দেশকৰ ছাঁ" -#: gtk/gtkarrow.c:85 +#: gtk/gtkarrow.c:105 msgid "Appearance of the shadow surrounding the arrow" msgstr "কাঁড় চিহ্নৰ কাষত থকা ছাঁৰ চেহেৰা" -#: gtk/gtkarrow.c:92 gtk/gtkmenu.c:711 gtk/gtkmenuitem.c:368 +#: gtk/gtkarrow.c:112 gtk/gtkmenu.c:718 gtk/gtkmenuitem.c:368 msgid "Arrow Scaling" msgstr "কাঁড়ৰ Scaling" -#: gtk/gtkarrow.c:93 +#: gtk/gtkarrow.c:113 msgid "Amount of space used up by arrow" msgstr "কাঁড়ৰ দ্বাৰা ব্যৱহৃত স্থান" -#: gtk/gtkaspectframe.c:79 +#: gtk/gtkaspectframe.c:93 msgid "Horizontal Alignment" msgstr "পথালিকে সংৰেখন কৰা" -#: gtk/gtkaspectframe.c:80 +#: gtk/gtkaspectframe.c:94 msgid "X alignment of the child" msgstr "চাইল্ডৰ X সংৰেখন" -#: gtk/gtkaspectframe.c:86 +#: gtk/gtkaspectframe.c:100 msgid "Vertical Alignment" msgstr "উলম্বভাবে সংৰেখন" -#: gtk/gtkaspectframe.c:87 +#: gtk/gtkaspectframe.c:101 msgid "Y alignment of the child" msgstr "চাইল্ডৰ Y সংৰেখন" -#: gtk/gtkaspectframe.c:93 +#: gtk/gtkaspectframe.c:107 msgid "Ratio" msgstr "অনুপাত" -#: gtk/gtkaspectframe.c:94 +#: gtk/gtkaspectframe.c:108 msgid "Aspect ratio if obey_child is FALSE" msgstr "obey_chile ৰ মান FALSE হ'লে প্ৰযোজ্য দৃষ্টি কোণৰ অনুপাত" -#: gtk/gtkaspectframe.c:100 +#: gtk/gtkaspectframe.c:114 msgid "Obey child" msgstr "চাইল্ডক মানক" -#: gtk/gtkaspectframe.c:101 +#: gtk/gtkaspectframe.c:115 msgid "Force aspect ratio to match that of the frame's child" msgstr "দৃষ্টি কোণৰ অনুপাতক বলবৎভাবে ফ্ৰেমৰ চাইল্ডৰ সমান কৰক" -#: gtk/gtkassistant.c:284 +#: gtk/gtkassistant.c:306 msgid "Header Padding" msgstr "হেডাৰ পেডিং" -#: gtk/gtkassistant.c:285 +#: gtk/gtkassistant.c:307 msgid "Number of pixels around the header." msgstr "হেডাৰৰ কাষত থকা পিক্সেলৰ সংখ্যা ।" -#: gtk/gtkassistant.c:292 +#: gtk/gtkassistant.c:314 msgid "Content Padding" msgstr "বিসয়বস্তুৰ পেডিং" -#: gtk/gtkassistant.c:293 +#: gtk/gtkassistant.c:315 msgid "Number of pixels around the content pages." msgstr "বিষয়বস্তুৰ পৃষ্ঠাত থকা পিক্সেলৰ সংখ্যা ।" -#: gtk/gtkassistant.c:309 +#: gtk/gtkassistant.c:331 msgid "Page type" msgstr "পৃষ্ঠাৰ ধৰণ" -#: gtk/gtkassistant.c:310 +#: gtk/gtkassistant.c:332 msgid "The type of the assistant page" msgstr "সহায়ক পৃষ্ঠাৰ ধৰণ" -#: gtk/gtkassistant.c:327 +#: gtk/gtkassistant.c:349 msgid "Page title" msgstr "পৃষ্ঠাৰ শিৰোনামা" -#: gtk/gtkassistant.c:328 +#: gtk/gtkassistant.c:350 msgid "The title of the assistant page" msgstr "সহায়ক পৃষ্ঠাৰ শিৰোনামা" -#: gtk/gtkassistant.c:344 +#: gtk/gtkassistant.c:366 msgid "Header image" msgstr "হেডাৰ প্ৰতিমূৰ্ত্তি" -#: gtk/gtkassistant.c:345 +#: gtk/gtkassistant.c:367 msgid "Header image for the assistant page" msgstr "সহায়ক পৃষ্ঠাৰ বাবে হেডাৰৰ প্ৰতিমূৰ্ত্তি" -#: gtk/gtkassistant.c:361 +#: gtk/gtkassistant.c:383 msgid "Sidebar image" msgstr "Sidebar ৰ প্ৰতিমূৰ্ত্তি" -#: gtk/gtkassistant.c:362 +#: gtk/gtkassistant.c:384 msgid "Sidebar image for the assistant page" msgstr "সহায়ক পৃষ্ঠাৰ বাবে Sidebar ৰ প্ৰতিমূৰ্ত্তি" -#: gtk/gtkassistant.c:377 +#: gtk/gtkassistant.c:399 msgid "Page complete" msgstr "পৃষ্ঠা সম্পূৰ্ণ" -#: gtk/gtkassistant.c:378 +#: gtk/gtkassistant.c:400 msgid "Whether all required fields on the page have been filled out" msgstr "পৃষ্ঠাৰ প্ৰয়োজনীয় অংশসমূহ পূৰ্ণ কৰা হ'ল নে নাই" -#: gtk/gtkbbox.c:101 +#: gtk/gtkbbox.c:129 msgid "Minimum child width" msgstr "চাইল্ডৰ সৰ্বনিম্ন প্ৰস্থ" -#: gtk/gtkbbox.c:102 +#: gtk/gtkbbox.c:130 msgid "Minimum width of buttons inside the box" msgstr "বক্সৰ ভিতৰৰ বুটামৰ সৰ্বনিম্ন প্ৰস্থ" -#: gtk/gtkbbox.c:110 +#: gtk/gtkbbox.c:138 msgid "Minimum child height" msgstr "চাইল্ডৰ সৰ্বনিম্ন উচ্চতা" -#: gtk/gtkbbox.c:111 +#: gtk/gtkbbox.c:139 msgid "Minimum height of buttons inside the box" msgstr "বক্সৰ ভিতৰৰ বুটামৰ সৰ্বনিম্ন উচ্চতা" -#: gtk/gtkbbox.c:119 +#: gtk/gtkbbox.c:147 msgid "Child internal width padding" msgstr "প্ৰস্থ" -#: gtk/gtkbbox.c:120 +#: gtk/gtkbbox.c:148 msgid "Amount to increase child's size on either side" msgstr "চাইল্ডৰ আকাৰ দুয়ো দিশে যি পৰিমাণে বৃদ্ধি কৰা হ'ব" -#: gtk/gtkbbox.c:128 +#: gtk/gtkbbox.c:156 msgid "Child internal height padding" msgstr "চাইল্ডৰ অভ্যন্তৰীণ উচ্চতাৰ পেডিং (Padding)" -#: gtk/gtkbbox.c:129 +#: gtk/gtkbbox.c:157 msgid "Amount to increase child's size on the top and bottom" msgstr "চাইল্ডৰ আকাৰ ওপৰে তলে যি পৰিমাণে বৃদ্ধি কৰা হ'ব" -#: gtk/gtkbbox.c:137 +#: gtk/gtkbbox.c:165 msgid "Layout style" msgstr "পৰিকল্পনাৰ ধৰন" -#: gtk/gtkbbox.c:138 +#: gtk/gtkbbox.c:166 msgid "" "How to layout the buttons in the box. Possible values are default, spread, " "edge, start and end" @@ -727,11 +727,11 @@ msgstr "" "বুটামসমূহক যি ধৰণে বক্সত স্থাপন কৰা হ'ব । সাম্ভাব্য মানসমূহ হ'ল অবিকল্পিত, বিয়পি " "যোৱা, প্ৰান্ত, প্ৰথম আৰু শেষ" -#: gtk/gtkbbox.c:146 +#: gtk/gtkbbox.c:174 msgid "Secondary" msgstr "দ্বিতীয়" -#: gtk/gtkbbox.c:147 +#: gtk/gtkbbox.c:175 msgid "" "If TRUE, the child appears in a secondary group of children, suitable for, e." "g., help buttons" @@ -739,39 +739,38 @@ msgstr "" "TRUE হ'লে, তেন্তে চাইল্ডক এটা দ্বিতীয় চিলড্ৰেন গোটত দেখা যায়; ই সহায়িকা " "প্ৰদৰ্শনকাৰী বুটামৰ বাবে বিশেষ উপযোগী" -#: gtk/gtkbox.c:130 gtk/gtkexpander.c:219 gtk/gtkiconview.c:665 +#: gtk/gtkbox.c:217 gtk/gtkexpander.c:219 gtk/gtkiconview.c:667 #: gtk/gtktreeviewcolumn.c:217 msgid "Spacing" msgstr "মধ্যৱৰ্তী স্থান" -#: gtk/gtkbox.c:131 +#: gtk/gtkbox.c:218 msgid "The amount of space between children" msgstr "চিলড্ৰেনৰ মাজত ৰিক্ত স্থানৰ পৰিমাণ" -#: gtk/gtkbox.c:140 gtk/gtknotebook.c:657 gtk/gtktable.c:165 -#: gtk/gtktoolbar.c:573 gtk/gtktoolitemgroup.c:1588 +#: gtk/gtkbox.c:227 gtk/gtktable.c:165 gtk/gtktoolbar.c:518 +#: gtk/gtktoolitemgroup.c:1596 msgid "Homogeneous" msgstr "সমজাতীয়" -#: gtk/gtkbox.c:141 +#: gtk/gtkbox.c:228 msgid "Whether the children should all be the same size" msgstr "সকলো চিলড্ৰেনৰ আকৃতি সমান হ'ব নে নাই" -#: gtk/gtkbox.c:148 gtk/gtkpreview.c:101 gtk/gtktoolbar.c:565 -#: gtk/gtktoolitemgroup.c:1595 gtk/gtktoolpalette.c:1052 -#: gtk/gtktreeviewcolumn.c:273 +#: gtk/gtkbox.c:235 gtk/gtktoolbar.c:510 gtk/gtktoolitemgroup.c:1603 +#: gtk/gtktoolpalette.c:1053 gtk/gtktreeviewcolumn.c:273 msgid "Expand" msgstr "প্ৰসাৰণ" -#: gtk/gtkbox.c:149 +#: gtk/gtkbox.c:236 msgid "Whether the child should receive extra space when the parent grows" msgstr "পেৰেন্টৰ আকৃতি বৃদ্ধি পালে চাইল্ডে অতিৰক্ত স্থান পাব নে নাই" -#: gtk/gtkbox.c:155 gtk/gtktoolitemgroup.c:1602 +#: gtk/gtkbox.c:242 gtk/gtktoolitemgroup.c:1610 msgid "Fill" msgstr "ভৰ্ত্তি কৰক" -#: gtk/gtkbox.c:156 +#: gtk/gtkbox.c:243 msgid "" "Whether extra space given to the child should be allocated to the child or " "used as padding" @@ -779,54 +778,54 @@ msgstr "" "চাইল্ডৰ বাবে দিয়া অতিৰিক্ত স্থান চাইল্ডৰ বাবে ব্যৱহাৰ কৰা হ'ব নে পেডিং হিচাপে " "ব্যৱহৃত হ'ব" -#: gtk/gtkbox.c:162 +#: gtk/gtkbox.c:249 gtk/gtktrayicon-x11.c:163 msgid "Padding" msgstr "পেডিং" -#: gtk/gtkbox.c:163 +#: gtk/gtkbox.c:250 msgid "Extra space to put between the child and its neighbors, in pixels" msgstr "পিক্সেলত, চাইল্ড আৰু তাৰ চুবুৰীয়াৰ মাজৰ স্থানৰ মান" -#: gtk/gtkbox.c:169 +#: gtk/gtkbox.c:256 msgid "Pack type" msgstr "Pack ৰ ধৰন" -#: gtk/gtkbox.c:170 gtk/gtknotebook.c:724 +#: gtk/gtkbox.c:257 gtk/gtknotebook.c:667 msgid "" "A GtkPackType indicating whether the child is packed with reference to the " "start or end of the parent" msgstr "" "এটা GtkPackType যি নিৰ্দেশ কৰি যে চাইল্ড পেৰেন্টৰ আৰম্ভ নে শেষৰ সাপেক্ষে স্থাপিত" -#: gtk/gtkbox.c:176 gtk/gtknotebook.c:702 gtk/gtkpaned.c:241 -#: gtk/gtkruler.c:148 gtk/gtktoolitemgroup.c:1616 +#: gtk/gtkbox.c:263 gtk/gtknotebook.c:645 gtk/gtkpaned.c:242 +#: gtk/gtkruler.c:148 gtk/gtktoolitemgroup.c:1624 msgid "Position" msgstr "স্থান" -#: gtk/gtkbox.c:177 gtk/gtknotebook.c:703 +#: gtk/gtkbox.c:264 gtk/gtknotebook.c:646 msgid "The index of the child in the parent" msgstr "পেৰেন্টত চাইল্ডৰ ক্ৰমিক সংখ্যা" -#: gtk/gtkbuilder.c:96 +#: gtk/gtkbuilder.c:314 msgid "Translation Domain" msgstr "অনুবাদৰ ডোমেইন" -#: gtk/gtkbuilder.c:97 +#: gtk/gtkbuilder.c:315 msgid "The translation domain used by gettext" msgstr "gettext - এ ব্যৱহাৰ কৰা অনুবাদৰ ডোমেইন" -#: gtk/gtkbutton.c:220 +#: gtk/gtkbutton.c:228 msgid "" "Text of the label widget inside the button, if the button contains a label " "widget" msgstr "যদি বুটামত কোনো লেবেল উইজেট থাকে, তেন্তে এই উইজেটৰ লিখিত শব্দ" -#: gtk/gtkbutton.c:227 gtk/gtkexpander.c:203 gtk/gtklabel.c:527 +#: gtk/gtkbutton.c:235 gtk/gtkexpander.c:203 gtk/gtklabel.c:549 #: gtk/gtkmenuitem.c:320 gtk/gtktoolbutton.c:211 msgid "Use underline" msgstr "নিম্নৰেখাঙ্কন কৰক" -#: gtk/gtkbutton.c:228 gtk/gtkexpander.c:204 gtk/gtklabel.c:528 +#: gtk/gtkbutton.c:236 gtk/gtkexpander.c:204 gtk/gtklabel.c:550 #: gtk/gtkmenuitem.c:321 msgid "" "If set, an underline in the text indicates the next character should be used " @@ -835,70 +834,70 @@ msgstr "" "যদি নিৰ্ধাৰিত থাকে, টেক্সটৰ তলত ৰেখা থাকিলে নেম'নিক গতিবৰ্ধকৰ বাবে পৰৱৰ্তী অক্ষৰ " "ব্যৱহৃত হ'ব " -#: gtk/gtkbutton.c:235 gtk/gtkimagemenuitem.c:150 +#: gtk/gtkbutton.c:243 gtk/gtkimagemenuitem.c:150 msgid "Use stock" msgstr "Stock ব্যৱহাৰ কৰক" -#: gtk/gtkbutton.c:236 +#: gtk/gtkbutton.c:244 msgid "" "If set, the label is used to pick a stock item instead of being displayed" msgstr "" "নিৰ্ধাৰিত থাকিলে, প্ৰদৰ্শনৰ বিকল্পে লেবেলক এটা স্টকৰ বস্তু নিৰ্ব্বাচন কৰিবলৈ ব্যৱহৃত হয়" -#: gtk/gtkbutton.c:243 gtk/gtkcombobox.c:796 gtk/gtkfilechooserbutton.c:393 +#: gtk/gtkbutton.c:251 gtk/gtkcombobox.c:799 gtk/gtkfilechooserbutton.c:393 msgid "Focus on click" msgstr "ক্লিক কৰিলে ফ'কাচ হ'ব" -#: gtk/gtkbutton.c:244 gtk/gtkfilechooserbutton.c:394 +#: gtk/gtkbutton.c:252 gtk/gtkfilechooserbutton.c:394 msgid "Whether the button grabs focus when it is clicked with the mouse" msgstr "মাউছেৰে ক্লিক কৰিলে বুটামে তাক ফ'কাচত ল'ব পাৰে নে নাই" -#: gtk/gtkbutton.c:251 +#: gtk/gtkbutton.c:259 msgid "Border relief" msgstr "প্ৰান্তীয় ৰিলিফ" -#: gtk/gtkbutton.c:252 +#: gtk/gtkbutton.c:260 msgid "The border relief style" msgstr "প্ৰান্তীয় ৰিলিফৰ ধৰন" -#: gtk/gtkbutton.c:269 +#: gtk/gtkbutton.c:277 msgid "Horizontal alignment for child" msgstr "চাইল্ডৰ বাবে পথালিকে সংৰেখন" -#: gtk/gtkbutton.c:288 +#: gtk/gtkbutton.c:296 msgid "Vertical alignment for child" msgstr "চাইল্ডৰ বাবে উলম্ব সংৰেখন" -#: gtk/gtkbutton.c:305 gtk/gtkimagemenuitem.c:135 +#: gtk/gtkbutton.c:313 gtk/gtkimagemenuitem.c:135 msgid "Image widget" msgstr "প্ৰতিমূৰ্ত্তিৰ উইজেট" -#: gtk/gtkbutton.c:306 +#: gtk/gtkbutton.c:314 msgid "Child widget to appear next to the button text" msgstr "বুটামৰ শব্দৰ ওচৰত যি চাইল্ড উইজেট দেখা যাবস" -#: gtk/gtkbutton.c:320 +#: gtk/gtkbutton.c:328 msgid "Image position" msgstr "প্ৰতিমূৰ্ত্তিৰ স্থান" -#: gtk/gtkbutton.c:321 +#: gtk/gtkbutton.c:329 msgid "The position of the image relative to the text" msgstr "লিপিৰ আনুপাতিক প্ৰতিমূৰ্ত্তিৰ স্থান" -#: gtk/gtkbutton.c:441 +#: gtk/gtkbutton.c:449 msgid "Default Spacing" msgstr "অবিকল্পিত ৰিক্ত স্থান" -#: gtk/gtkbutton.c:442 +#: gtk/gtkbutton.c:450 #, fuzzy msgid "Extra space to add for GTK_CAN_DEFAULT buttons" msgstr "CAN_DEFAULT বুটামৰ বাবে যোগ কৰিব লগা অতিৰিক্ত স্থান" -#: gtk/gtkbutton.c:456 +#: gtk/gtkbutton.c:464 msgid "Default Outside Spacing" msgstr "অবিকল্পিত বহিস্থ স্থান স্থাপন প্ৰক্ৰিয়া" -#: gtk/gtkbutton.c:457 +#: gtk/gtkbutton.c:465 #, fuzzy msgid "" "Extra space to add for GTK_CAN_DEFAULT buttons that is always drawn outside " @@ -906,56 +905,56 @@ msgid "" msgstr "" "সৰ্বদা প্ৰান্তৰে বাহিৰে অঙ্কিত CAN_DEFAULT বুটামৰ বাবে অতিৰিক্ত স্থান যোগ কৰতে হ'ব" -#: gtk/gtkbutton.c:462 +#: gtk/gtkbutton.c:470 msgid "Child X Displacement" msgstr "চাইল্ডৰ এক্স অক্ষীয় বিচ্যুতি" -#: gtk/gtkbutton.c:463 +#: gtk/gtkbutton.c:471 msgid "" "How far in the x direction to move the child when the button is depressed" msgstr "বুটামটি চাপা অবস্থায় চাইল্ডটিকে এক্স অক্ষ বৰাবৰ যি পৰিমাণ সৰানো হ'ব" -#: gtk/gtkbutton.c:470 +#: gtk/gtkbutton.c:478 msgid "Child Y Displacement" msgstr "চাইল্ডৰ ওয়াই অক্ষীয় বিচ্যুতি" -#: gtk/gtkbutton.c:471 +#: gtk/gtkbutton.c:479 msgid "" "How far in the y direction to move the child when the button is depressed" msgstr "বুটামটি চাপা অবস্থায় চাইল্ডটিকে ওয়াই অক্ষ বৰাবৰ যি পৰিমাণ সৰানো হ'ব" -#: gtk/gtkbutton.c:487 +#: gtk/gtkbutton.c:495 msgid "Displace focus" msgstr "ফোকাস সৰাও" -#: gtk/gtkbutton.c:488 +#: gtk/gtkbutton.c:496 msgid "" "Whether the child_displacement_x/_y properties should also affect the focus " "rectangle" msgstr "" "child_displacement_x/_y বৈশিষ্ট্য ফোকাসকাৰী আয়তক্ষেত্ৰকেও প্ৰভাবিত কৰিব নে নাই" -#: gtk/gtkbutton.c:501 gtk/gtkentry.c:695 gtk/gtkentry.c:1740 +#: gtk/gtkbutton.c:509 gtk/gtkentry.c:697 gtk/gtkentry.c:1742 msgid "Inner Border" msgstr "Border" -#: gtk/gtkbutton.c:502 +#: gtk/gtkbutton.c:510 msgid "Border between button edges and child." msgstr "Border child." -#: gtk/gtkbutton.c:515 +#: gtk/gtkbutton.c:523 msgid "Image spacing" msgstr "Image" -#: gtk/gtkbutton.c:516 +#: gtk/gtkbutton.c:524 msgid "Spacing in pixels between the image and label" msgstr "মধ্যবৰ্তী স্থান পিকসেল" -#: gtk/gtkbutton.c:530 +#: gtk/gtkbutton.c:538 msgid "Show button images" msgstr "বুটামৰ ছবি প্ৰদৰ্শন কৰো" -#: gtk/gtkbutton.c:531 +#: gtk/gtkbutton.c:539 msgid "Whether images should be shown on buttons" msgstr "বুটামত ছবি প্ৰদৰ্শন কৰা হ'ব নে নাই" @@ -1043,12 +1042,12 @@ msgstr "বিৱৰণ দেখুৱাওক" msgid "If TRUE, details are shown" msgstr "সত্য হ'লে, বিৱৰণ দেখুওৱা হৈছে" -#: gtk/gtkcelleditable.c:76 +#: gtk/gtkcelleditable.c:43 #, fuzzy msgid "Editing Canceled" msgstr "সম্পাদন কৰা হৈছে" -#: gtk/gtkcelleditable.c:77 +#: gtk/gtkcelleditable.c:44 msgid "Indicates that editing has been canceled" msgstr "" @@ -1168,35 +1167,35 @@ msgstr "ছেলৰ পটভূমি সমষ্টি" msgid "Whether this tag affects the cell background color" msgstr "এই ট্যাগটি ছেলৰপটভূমিৰ ৰংকে প্ৰভাবিত কৰি নে নাই" -#: gtk/gtkcellrendereraccel.c:114 +#: gtk/gtkcellrendereraccel.c:124 msgid "Accelerator key" msgstr "কৰ্মবৰ্ধক-কি" -#: gtk/gtkcellrendereraccel.c:115 +#: gtk/gtkcellrendereraccel.c:125 msgid "The keyval of the accelerator" msgstr "সৰ্বমোট" -#: gtk/gtkcellrendereraccel.c:131 +#: gtk/gtkcellrendereraccel.c:141 msgid "Accelerator modifiers" msgstr "গতিবৰ্ধক পৰিবৰ্তনকাৰী" -#: gtk/gtkcellrendereraccel.c:132 +#: gtk/gtkcellrendereraccel.c:142 msgid "The modifier mask of the accelerator" msgstr "সৰ্বমোট" -#: gtk/gtkcellrendereraccel.c:149 +#: gtk/gtkcellrendereraccel.c:159 msgid "Accelerator keycode" msgstr "গতিবৰ্দ্ধকৰ কী-কোড" -#: gtk/gtkcellrendereraccel.c:150 +#: gtk/gtkcellrendereraccel.c:160 msgid "The hardware keycode of the accelerator" msgstr "সৰ্বমোট" -#: gtk/gtkcellrendereraccel.c:169 +#: gtk/gtkcellrendereraccel.c:179 msgid "Accelerator Mode" msgstr "গতিবৰ্ধক মোড" -#: gtk/gtkcellrendereraccel.c:170 +#: gtk/gtkcellrendereraccel.c:180 msgid "The type of accelerators" msgstr "সৰ্বমোট" @@ -1248,7 +1247,7 @@ msgstr "Pixbuf প্ৰসাৰক বন্ধ আছে" msgid "Pixbuf for closed expander" msgstr "বন্ধ প্ৰসাৰকেৰ বাবে Pixbuf" -#: gtk/gtkcellrendererpixbuf.c:135 gtk/gtkimage.c:263 gtk/gtkstatusicon.c:229 +#: gtk/gtkcellrendererpixbuf.c:135 gtk/gtkimage.c:268 gtk/gtkstatusicon.c:234 msgid "Stock ID" msgstr "স্টক (Stock) আই.ডি. (ID)" @@ -1257,7 +1256,7 @@ msgid "The stock ID of the stock icon to render" msgstr "যি স্টক (Stock) আইকনটিকে আঁকা হ'ব তাৰ স্টক আইডি (ID)" #: gtk/gtkcellrendererpixbuf.c:143 gtk/gtkcellrendererspinner.c:158 -#: gtk/gtkrecentmanager.c:245 gtk/gtkstatusicon.c:270 +#: gtk/gtkrecentmanager.c:245 gtk/gtkstatusicon.c:275 msgid "Size" msgstr "মাপ" @@ -1281,7 +1280,7 @@ msgstr "স্টেট অনুসৰণ কৰো" msgid "Whether the rendered pixbuf should be colorized according to the state" msgstr "অঙ্কিত পিক্সবাফকে স্টেট অনুসাৰে ৰং কৰা হ'ব নে নাই" -#: gtk/gtkcellrendererpixbuf.c:205 gtk/gtkimage.c:338 gtk/gtkwindow.c:595 +#: gtk/gtkcellrendererpixbuf.c:205 gtk/gtkimage.c:343 gtk/gtkwindow.c:619 msgid "Icon" msgstr "আইকন" @@ -1290,8 +1289,8 @@ msgid "Value of the progress bar" msgstr "প্ৰ'গ্ৰেছবাৰৰ মান" #: gtk/gtkcellrendererprogress.c:146 gtk/gtkcellrenderertext.c:195 -#: gtk/gtkentry.c:738 gtk/gtkentrybuffer.c:353 gtk/gtkmessagedialog.c:153 -#: gtk/gtkprogressbar.c:184 gtk/gtktextbuffer.c:198 +#: gtk/gtkentry.c:740 gtk/gtkentrybuffer.c:353 gtk/gtkmessagedialog.c:200 +#: gtk/gtkprogressbar.c:137 gtk/gtktextbuffer.c:198 msgid "Text" msgstr "লিপি" @@ -1329,18 +1328,18 @@ msgstr "টেক্সটৰ y সংৰেখন" msgid "The vertical text alignment, from 0 (top) to 1 (bottom)." msgstr "উলম্ব অ্যালাইনমেন্ট, ০ (ওপৰত) ৰ পৰা ১ (তল)" -#: gtk/gtkcellrendererprogress.c:221 gtk/gtkiconview.c:729 -#: gtk/gtkorientable.c:74 gtk/gtkprogressbar.c:126 gtk/gtkstatusicon.c:328 -#: gtk/gtktrayicon-x11.c:110 +#: gtk/gtkcellrendererprogress.c:221 gtk/gtkiconview.c:731 +#: gtk/gtkorientable.c:63 gtk/gtkprogressbar.c:112 gtk/gtkstatusicon.c:333 +#: gtk/gtktrayicon-x11.c:122 msgid "Orientation" msgstr "দিশ" -#: gtk/gtkcellrendererprogress.c:222 gtk/gtkprogressbar.c:127 +#: gtk/gtkcellrendererprogress.c:222 gtk/gtkprogressbar.c:113 msgid "Orientation and growth direction of the progress bar" msgstr "প্ৰগ্ৰেছ বাৰৰ প্ৰাথমিক অবস্থান আৰু বৃদ্ধি পাওয়াৰ দিক" -#: gtk/gtkcellrendererspin.c:93 gtk/gtkprogressbar.c:118 gtk/gtkrange.c:367 -#: gtk/gtkscalebutton.c:225 gtk/gtkspinbutton.c:208 +#: gtk/gtkcellrendererspin.c:93 gtk/gtkrange.c:394 gtk/gtkscalebutton.c:241 +#: gtk/gtkspinbutton.c:208 msgid "Adjustment" msgstr "সমন্বয়" @@ -1366,7 +1365,7 @@ msgid "The number of decimal places to display" msgstr "দশমিকেৰ পৰ যি সংখ্যক অংক প্ৰদৰ্শন কৰা হ'ব" #: gtk/gtkcellrendererspinner.c:124 gtk/gtkcheckmenuitem.c:98 -#: gtk/gtkmenu.c:501 gtk/gtkspinner.c:128 gtk/gtktoggleaction.c:119 +#: gtk/gtkmenu.c:508 gtk/gtkspinner.c:128 gtk/gtktoggleaction.c:130 #: gtk/gtktogglebutton.c:115 gtk/gtktoggletoolbutton.c:114 msgid "Active" msgstr "সক্ৰিয়" @@ -1398,7 +1397,7 @@ msgstr "মাৰ্কআপ" msgid "Marked up text to render" msgstr "প্ৰদৰ্শন কৰাৰ বাবে মাৰ্কআপ কৰা টেক্সট" -#: gtk/gtkcellrenderertext.c:211 gtk/gtklabel.c:513 +#: gtk/gtkcellrenderertext.c:211 gtk/gtklabel.c:535 msgid "Attributes" msgstr "বৈশিষ্ট্যাবলী" @@ -1439,6 +1438,7 @@ msgid "Foreground color as a string" msgstr "পংক্তি হিচাপে পুৰোভূমিৰ ৰং" #: gtk/gtkcellrenderertext.c:252 gtk/gtktexttag.c:225 +#: gtk/gtktrayicon-x11.c:131 msgid "Foreground color" msgstr "পুৰোভূমিৰ ৰং" @@ -1446,7 +1446,7 @@ msgstr "পুৰোভূমিৰ ৰং" msgid "Foreground color as a GdkColor" msgstr "GdkColor হিচাপে পুৰোভূমিৰ ৰং" -#: gtk/gtkcellrenderertext.c:261 gtk/gtkentry.c:662 gtk/gtktexttag.c:251 +#: gtk/gtkcellrenderertext.c:261 gtk/gtkentry.c:664 gtk/gtktexttag.c:251 #: gtk/gtktextview.c:577 msgid "Editable" msgstr "সম্পাদনযোগ্য" @@ -1555,7 +1555,7 @@ msgstr "" "এই ভাষাটিৰ আই.এস.ও. কোড। টেক্সট আঁকাৰ সময় পেনগো এই কোডটিকে ইঙ্গিত হিচাপে ব্যৱহাৰ " "কৰতে পাৰে। যদি আপনি এই ব্যাপাৰটি বুঝতে না পাৰেন তেন্তে আপনাৰ এটিৰ প্ৰয়োজন নেই" -#: gtk/gtkcellrenderertext.c:411 gtk/gtklabel.c:638 gtk/gtkprogressbar.c:206 +#: gtk/gtkcellrenderertext.c:411 gtk/gtklabel.c:660 gtk/gtkprogressbar.c:159 msgid "Ellipsize" msgstr "উপবৃত্তকৰণ" @@ -1568,11 +1568,11 @@ msgstr "" "have enough room to display the entire string" #: gtk/gtkcellrenderertext.c:431 gtk/gtkfilechooserbutton.c:421 -#: gtk/gtklabel.c:658 +#: gtk/gtklabel.c:681 msgid "Width In Characters" msgstr "অক্ষৰ হিচাপে প্ৰস্থ" -#: gtk/gtkcellrenderertext.c:432 gtk/gtklabel.c:659 +#: gtk/gtkcellrenderertext.c:432 gtk/gtklabel.c:682 msgid "The desired width of the label, in characters" msgstr "অক্ষৰ হিচাপে লেবেলৰ আকাঙ্খিত প্ৰস্থ" @@ -1588,7 +1588,7 @@ msgstr "" "সেল ৰেন্ডাৰাৰে সম্পূৰ্ণ পঙ্‌ক্তি প্ৰদৰ্শনেৰ বাবে পৰ্যাপ্ত স্থান না থাকলে, যিভাবে পঙ্‌ক্তিকে " "একাধিক লাইনে ভেঙ্গে প্ৰদৰ্শন কৰা হ'ব" -#: gtk/gtkcellrenderertext.c:470 gtk/gtkcombobox.c:685 +#: gtk/gtkcellrenderertext.c:470 gtk/gtkcombobox.c:688 msgid "Wrap width" msgstr "গুটিয়ে যাওয়াৰ দৈৰ্ঘ্য" @@ -1782,11 +1782,11 @@ msgstr "CellView model" msgid "The model for cell view" msgstr "উল্লিখিত সময় অবধি" -#: gtk/gtkcheckbutton.c:69 gtk/gtkcheckmenuitem.c:121 gtk/gtkoptionmenu.c:168 +#: gtk/gtkcheckbutton.c:69 gtk/gtkcheckmenuitem.c:121 msgid "Indicator Size" msgstr "নিৰ্দেশকেৰ আকাৰ" -#: gtk/gtkcheckbutton.c:77 gtk/gtkexpander.c:245 gtk/gtkoptionmenu.c:174 +#: gtk/gtkcheckbutton.c:77 gtk/gtkexpander.c:245 msgid "Indicator Spacing" msgstr "নিৰ্ধাৰক স্থান" @@ -1823,7 +1823,7 @@ msgid "Whether or not to give the color an alpha value" msgstr "ৰংটিকে এটা আলফা মান দিয়া হ'ব নে নাই" #: gtk/gtkcolorbutton.c:186 gtk/gtkfilechooserbutton.c:407 -#: gtk/gtkfontbutton.c:142 gtk/gtkprintjob.c:116 gtk/gtkstatusicon.c:424 +#: gtk/gtkfontbutton.c:142 gtk/gtkprintjob.c:116 gtk/gtkstatusicon.c:429 #: gtk/gtktreeviewcolumn.c:265 msgid "Title" msgstr "শিৰোনাম" @@ -1832,7 +1832,7 @@ msgstr "শিৰোনাম" msgid "The title of the color selection dialog" msgstr "ৰং বাছাইকাৰক ডায়ালগেৰ শিৰোনাম" -#: gtk/gtkcolorbutton.c:201 gtk/gtkcolorsel.c:293 +#: gtk/gtkcolorbutton.c:201 gtk/gtkcolorsel.c:295 msgid "Current Color" msgstr "বৰ্তমান ৰং" @@ -1840,7 +1840,7 @@ msgstr "বৰ্তমান ৰং" msgid "The selected color" msgstr "বাছাইকৃত ৰং" -#: gtk/gtkcolorbutton.c:216 gtk/gtkcolorsel.c:300 +#: gtk/gtkcolorbutton.c:216 gtk/gtkcolorsel.c:302 msgid "Current Alpha" msgstr "বৰ্তমান আলফা" @@ -1849,36 +1849,36 @@ msgid "The selected opacity value (0 fully transparent, 65535 fully opaque)" msgstr "" "স্বচ্ছতাৰ (Opacity) বাছাইকৃত মান (পূৰ্ণ স্বচ্ছতাৰ বাবে ০, পূৰ্ণ অস্বচ্ছতাৰ বাবে ৬৫৫৩৫)" -#: gtk/gtkcolorsel.c:279 +#: gtk/gtkcolorsel.c:281 msgid "Has Opacity Control" msgstr "ওপাসিটি (অস্বচ্ছতা) নিয়ন্ত্ৰণ আছে" -#: gtk/gtkcolorsel.c:280 +#: gtk/gtkcolorsel.c:282 msgid "Whether the color selector should allow setting opacity" msgstr "ৰং নিৰ্বাচকৰ পৰা ওপাসিটি (অস্বচ্ছতা) নিৰ্ধাৰণ কৰা যাব নে নাই" -#: gtk/gtkcolorsel.c:286 +#: gtk/gtkcolorsel.c:288 msgid "Has palette" msgstr "পেলেট আছে" -#: gtk/gtkcolorsel.c:287 +#: gtk/gtkcolorsel.c:289 msgid "Whether a palette should be used" msgstr "পেলেট ব্যৱহৃত হ'ব নে নাই" -#: gtk/gtkcolorsel.c:294 +#: gtk/gtkcolorsel.c:296 msgid "The current color" msgstr "বৰ্তমান ৰংটি" -#: gtk/gtkcolorsel.c:301 +#: gtk/gtkcolorsel.c:303 msgid "The current opacity value (0 fully transparent, 65535 fully opaque)" msgstr "" "অস্বচ্ছতা (Opacity) বৰ্তমান মান (পূৰ্ণ স্বচ্ছতাৰ বাবে ০, পূৰ্ণ অস্বচ্ছতাৰ বাবে ৬৫৫৩৫)" -#: gtk/gtkcolorsel.c:315 +#: gtk/gtkcolorsel.c:317 msgid "Custom palette" msgstr "স্বনিৰ্বাচিত পেলেট" -#: gtk/gtkcolorsel.c:316 +#: gtk/gtkcolorsel.c:318 msgid "Palette to use in the color selector" msgstr "ৰং নিৰ্বাচকে যি পেলেট ব্যৱহাৰ কৰা হ'ব" @@ -1921,156 +1921,112 @@ msgstr "মেসেজ বুটাম" msgid "The help button of the dialog." msgstr "মেসেজ বুটামত প্ৰদৰ্শিত বুটাম" -#: gtk/gtkcombo.c:145 -msgid "Enable arrow keys" -msgstr "অ্যাৰো (তীৰচিহ্ন প্ৰদৰ্শনকাৰী) কী (Key) সক্ৰিয় কৰো" - -#: gtk/gtkcombo.c:146 -msgid "Whether the arrow keys move through the list of items" -msgstr "" -"অ্যাৰো (তীৰচিহ্ন প্ৰদৰ্শনকাৰী) কী (Key) তালিকাৰ নামগুলোৰ মধ্য দিয়ে চলতে পাৰবে নে " -"নাই" - -#: gtk/gtkcombo.c:152 -msgid "Always enable arrows" -msgstr "সৰ্বদা অ্যাৰো (তীৰচিহ্ন প্ৰদৰ্শনকাৰী) সক্ৰিয় ৰাখা হোক" - -#: gtk/gtkcombo.c:153 -msgid "Obsolete property, ignored" -msgstr "বাতিল বৈশিষ্ট্য, অগ্ৰাহ্য কৰা হৈছে" - -#: gtk/gtkcombo.c:159 -msgid "Case sensitive" -msgstr "বড় বা ছোট হাতেৰ অক্ষৰ পৃথকভাবে বিবেচনা কৰি" - -#: gtk/gtkcombo.c:160 -msgid "Whether list item matching is case sensitive" -msgstr "" -"তালিকাৰ সদস্যদেৰ মিলিয়ে দেখাৰ সময় বড় বা ছোট হাতেৰ অক্ষৰ পৃথকভাবে বিবেচনা কৰা " -"হ'ব নে নাই" - -#: gtk/gtkcombo.c:167 -msgid "Allow empty" -msgstr "ৰিক্ত অনুমোদন কৰো" - -#: gtk/gtkcombo.c:168 -msgid "Whether an empty value may be entered in this field" -msgstr "এই ক্ষেত্ৰে (Field) কোন ৰিক্ত মান লেখা যাব নে নাই" - -#: gtk/gtkcombo.c:175 -msgid "Value in list" -msgstr "মানটি তালিকায় আছে" - -#: gtk/gtkcombo.c:176 -msgid "Whether entered values must already be present in the list" -msgstr "যিসব মান লেখা হ'ব সেগুলো সৰ্বদা তালিকায় থাকতে হ'ব নে নাই" - -#: gtk/gtkcombobox.c:668 +#: gtk/gtkcombobox.c:671 msgid "ComboBox model" msgstr "কম্বোবক্স মডেল" -#: gtk/gtkcombobox.c:669 +#: gtk/gtkcombobox.c:672 msgid "The model for the combo box" msgstr "কম্বোবক্সৰ মডেল" -#: gtk/gtkcombobox.c:686 +#: gtk/gtkcombobox.c:689 msgid "Wrap width for laying out the items in a grid" msgstr "গুটানো প্ৰস্থ উল্লিখিত সময় অবধি" -#: gtk/gtkcombobox.c:708 +#: gtk/gtkcombobox.c:711 msgid "Row span column" msgstr "প্ৰতি শাৰীতে স্তম্ভেৰ সংখ্যা" -#: gtk/gtkcombobox.c:709 +#: gtk/gtkcombobox.c:712 msgid "TreeModel column containing the row span values" msgstr "শাৰীৰ প্ৰস্থেৰ মান ধাৰনকাৰী TreeModel স্তম্ভ" -#: gtk/gtkcombobox.c:730 +#: gtk/gtkcombobox.c:733 msgid "Column span column" msgstr "প্ৰতি স্তম্ভে স্তম্ভেৰ সংখ্যা" -#: gtk/gtkcombobox.c:731 +#: gtk/gtkcombobox.c:734 msgid "TreeModel column containing the column span values" msgstr "স্তম্ভেৰ প্ৰস্থেৰ মান ধাৰনকাৰী TreeModel স্তম্ভ" -#: gtk/gtkcombobox.c:752 +#: gtk/gtkcombobox.c:755 msgid "Active item" msgstr "সক্ৰিয় আইটেম" -#: gtk/gtkcombobox.c:753 +#: gtk/gtkcombobox.c:756 msgid "The item which is currently active" msgstr "বৰ্তমানে সক্ৰিয় আইটেম" -#: gtk/gtkcombobox.c:772 gtk/gtkuimanager.c:226 +#: gtk/gtkcombobox.c:775 gtk/gtkuimanager.c:226 msgid "Add tearoffs to menus" msgstr "মেনুতে টিয়াৰঅফ (Tearoff) যোগ কৰো" -#: gtk/gtkcombobox.c:773 +#: gtk/gtkcombobox.c:776 msgid "Whether dropdowns should have a tearoff menu item" msgstr "ড্ৰপডাউনে কোন টিয়াৰ-অফ তালিকা বস্তু থাকবে নে নাই" -#: gtk/gtkcombobox.c:788 gtk/gtkentry.c:687 +#: gtk/gtkcombobox.c:791 gtk/gtkentry.c:689 msgid "Has Frame" msgstr "ফ্ৰেম আছে" -#: gtk/gtkcombobox.c:789 +#: gtk/gtkcombobox.c:792 msgid "Whether the combo box draws a frame around the child" msgstr "চাইল্ডৰ চাৰদিকে কম্বো বাক্স কোন ফ্ৰেম আঁকবে নে নাই" -#: gtk/gtkcombobox.c:797 +#: gtk/gtkcombobox.c:800 msgid "Whether the combo box grabs focus when it is clicked with the mouse" msgstr "মাউছৰ সহায়ত কম্বো বাক্সকে ক্লিক কৰা হলে তা ফ'কাচ হয়ে যাব নে নাই" -#: gtk/gtkcombobox.c:812 gtk/gtkmenu.c:556 +#: gtk/gtkcombobox.c:815 gtk/gtkmenu.c:563 msgid "Tearoff Title" msgstr "বিচ্ছিন্ন শিৰোনাম" -#: gtk/gtkcombobox.c:813 +#: gtk/gtkcombobox.c:816 msgid "" "A title that may be displayed by the window manager when the popup is torn-" "off" msgstr "প'পআপ হলো" -#: gtk/gtkcombobox.c:830 +#: gtk/gtkcombobox.c:833 msgid "Popup shown" msgstr "পপ-আপ" -#: gtk/gtkcombobox.c:831 +#: gtk/gtkcombobox.c:834 msgid "Whether the combo's dropdown is shown" msgstr "হলো" -#: gtk/gtkcombobox.c:847 +#: gtk/gtkcombobox.c:850 msgid "Button Sensitivity" msgstr "Button Sensitivity" # -#: gtk/gtkcombobox.c:848 +#: gtk/gtkcombobox.c:851 msgid "Whether the dropdown button is sensitive when the model is empty" msgstr "কোন বুটামৰ মাউছৰ সহায়ত ক্লিক কৰা হলে তা ফ'কাচ হয়ে যাব নে নাই" -#: gtk/gtkcombobox.c:855 +#: gtk/gtkcombobox.c:858 msgid "Appears as list" msgstr "তালিকাৰ মত মনে হয়" -#: gtk/gtkcombobox.c:856 +#: gtk/gtkcombobox.c:859 msgid "Whether dropdowns should look like lists rather than menus" msgstr "ড্ৰপডাউনেৰ চেহাৰা তালিকাৰ মত নহ'বকি মেনুৰ মত" -#: gtk/gtkcombobox.c:872 +#: gtk/gtkcombobox.c:875 msgid "Arrow Size" msgstr "মাপ" -#: gtk/gtkcombobox.c:873 +#: gtk/gtkcombobox.c:876 msgid "The minimum size of the arrow in the combo box" msgstr "সৰ্বমোট" -#: gtk/gtkcombobox.c:888 gtk/gtkentry.c:787 gtk/gtkhandlebox.c:174 -#: gtk/gtkmenubar.c:194 gtk/gtkstatusbar.c:193 gtk/gtktoolbar.c:623 -#: gtk/gtkviewport.c:122 +#: gtk/gtkcombobox.c:891 gtk/gtkentry.c:789 gtk/gtkhandlebox.c:175 +#: gtk/gtkmenubar.c:194 gtk/gtkstatusbar.c:193 gtk/gtktoolbar.c:568 +#: gtk/gtkviewport.c:150 msgid "Shadow type" msgstr "ছায়াৰ ধৰন" -#: gtk/gtkcombobox.c:889 +#: gtk/gtkcombobox.c:892 msgid "Which kind of shadow to draw around the combo box" msgstr "সৰ্বমোট" @@ -2098,46 +2054,6 @@ msgstr "চাইল্ড" msgid "Can be used to add a new child to the container" msgstr "কনটেইনাৰে এটা নতুন চাইল্ড যোগ কৰতে ব্যৱহাৰ কৰা যাব" -#: gtk/gtkcurve.c:126 -msgid "Curve type" -msgstr "বক্ৰৰেখাৰ ধৰন" - -#: gtk/gtkcurve.c:127 -msgid "Is this curve linear, spline interpolated, or free-form" -msgstr "এই বক্ৰৰেখাটি কি লিনিয়াৰ, স্প্লাইন ইন্টাৰপোলাটেড নাকি ফ্ৰী-ফৰ্ম" - -#: gtk/gtkcurve.c:134 -msgid "Minimum X" -msgstr "সৰ্বনিম্ন এক্স অক্ষ" - -#: gtk/gtkcurve.c:135 -msgid "Minimum possible value for X" -msgstr "এক্সৰ সম্ভাব্য সৰ্বনিম্ন মান" - -#: gtk/gtkcurve.c:143 -msgid "Maximum X" -msgstr "এক্স ইয়াৰ সৰ্বোচ্চ মান" - -#: gtk/gtkcurve.c:144 -msgid "Maximum possible X value" -msgstr "এক্সৰ সম্ভাব্য সৰ্বোচ্চ মান" - -#: gtk/gtkcurve.c:152 -msgid "Minimum Y" -msgstr "ওয়াই ইয়াৰ সৰ্বনিম্ন মান" - -#: gtk/gtkcurve.c:153 -msgid "Minimum possible value for Y" -msgstr "ওয়াই ইয়াৰ সম্ভাব্য সৰ্বনিম্ন মান" - -#: gtk/gtkcurve.c:161 -msgid "Maximum Y" -msgstr "ওয়াই ইয়াৰ সৰ্বনিম্ন মান" - -#: gtk/gtkcurve.c:162 -msgid "Maximum possible value for Y" -msgstr "ওয়াই ইয়াৰ সম্ভাব্য সৰ্বোচ্চ মান" - #: gtk/gtkdialog.c:145 msgid "Has separator" msgstr "বিভাজক আছে" @@ -2180,48 +2096,48 @@ msgstr "কৰ্মক্ষেত্ৰৰ (Action area) প্ৰান্ত msgid "Width of border around the button area at the bottom of the dialog" msgstr "ডায়ালগেৰ তলৰ দিকে অবস্থিত বুটামৰ চাৰপাশৰ প্ৰস্থ" -#: gtk/gtkentry.c:634 +#: gtk/gtkentry.c:636 msgid "Text Buffer" msgstr "টেক্সট বাফাৰ" -#: gtk/gtkentry.c:635 +#: gtk/gtkentry.c:637 msgid "Text buffer object which actually stores entry text" msgstr "টেকস্ট বাফাৰ অব্জেক্ট যি প্ৰকৃততে নিবেশৰ লিপি ৰক্ষা কৰে" -#: gtk/gtkentry.c:642 gtk/gtklabel.c:601 +#: gtk/gtkentry.c:644 gtk/gtklabel.c:623 msgid "Cursor Position" msgstr "কাৰ্ছাৰৰ অবস্থান" -#: gtk/gtkentry.c:643 gtk/gtklabel.c:602 +#: gtk/gtkentry.c:645 gtk/gtklabel.c:624 msgid "The current position of the insertion cursor in chars" msgstr "অক্ষৰ হিচাপে লেখা ভৰোৱাৰ (Insertion) কাৰ্ছাৰৰ অবস্থান" -#: gtk/gtkentry.c:652 gtk/gtklabel.c:611 +#: gtk/gtkentry.c:654 gtk/gtklabel.c:633 msgid "Selection Bound" msgstr "চিহ্নিত কৰাৰ সীমানা" -#: gtk/gtkentry.c:653 gtk/gtklabel.c:612 +#: gtk/gtkentry.c:655 gtk/gtklabel.c:634 msgid "" "The position of the opposite end of the selection from the cursor in chars" msgstr "অক্ষৰ হিচাপে চিহ্নিত অংশৰ বিপৰীত প্ৰান্তৰ অবস্থান" -#: gtk/gtkentry.c:663 +#: gtk/gtkentry.c:665 msgid "Whether the entry contents can be edited" msgstr "অন্তৰ্ভুক্তিৰ (Entry) অভ্যন্তৰীণ বস্তু (Content) এডিট কৰা যাব নে নাই" -#: gtk/gtkentry.c:670 gtk/gtkentrybuffer.c:383 +#: gtk/gtkentry.c:672 gtk/gtkentrybuffer.c:383 msgid "Maximum length" msgstr "সৰ্বোচ্চ দৈৰ্ঘ্য" -#: gtk/gtkentry.c:671 gtk/gtkentrybuffer.c:384 +#: gtk/gtkentry.c:673 gtk/gtkentrybuffer.c:384 msgid "Maximum number of characters for this entry. Zero if no maximum" msgstr "এই অন্তৰ্ভুক্তিৰ বাবে সৰ্বোচ্চ সংখ্যক অক্ষৰ। ইয়াৰ মান শূণ্য হতে পাৰবেন না" -#: gtk/gtkentry.c:679 +#: gtk/gtkentry.c:681 msgid "Visibility" msgstr "দৃষ্টিগ্ৰাহ্যতা" -#: gtk/gtkentry.c:680 +#: gtk/gtkentry.c:682 msgid "" "FALSE displays the \"invisible char\" instead of the actual text (password " "mode)" @@ -2229,30 +2145,30 @@ msgstr "" "যদি FALSE হয় তেন্তে প্ৰকৃত টেক্সটৰ পৰিবৰ্তে \"অদৃশ্য অক্ষৰ\" দেখা যায় (পাসওয়াৰ্ডেৰ " "ক্ষেত্ৰে প্ৰযোজ্য)" -#: gtk/gtkentry.c:688 +#: gtk/gtkentry.c:690 msgid "FALSE removes outside bevel from entry" msgstr "FASLE তালিকাৰ পৰা বহিঃস্থ বেভেলকে অপসাৰণ কৰি" -#: gtk/gtkentry.c:696 +#: gtk/gtkentry.c:698 msgid "" "Border between text and frame. Overrides the inner-border style property" msgstr "Border" -#: gtk/gtkentry.c:703 gtk/gtkentry.c:1269 +#: gtk/gtkentry.c:705 gtk/gtkentry.c:1271 msgid "Invisible character" msgstr "অদৃশ্য অক্ষৰ" -#: gtk/gtkentry.c:704 gtk/gtkentry.c:1270 +#: gtk/gtkentry.c:706 gtk/gtkentry.c:1272 msgid "The character to use when masking entry contents (in \"password mode\")" msgstr "" "অন্তৰ্ভুক্তিৰ (Entry) বিষয়বস্তু আড়াল কৰাৰ বাবে ব্যৱহৃত অক্ষৰ (\"পাসওয়াৰ্ড মোড\" এ " "ব্যৱহৃত)" -#: gtk/gtkentry.c:711 +#: gtk/gtkentry.c:713 msgid "Activates default" msgstr "অবিকল্পিতকে সক্ৰিয় কৰি" -#: gtk/gtkentry.c:712 +#: gtk/gtkentry.c:714 msgid "" "Whether to activate the default widget (such as the default button in a " "dialog) when Enter is pressed" @@ -2260,100 +2176,100 @@ msgstr "" "Enter বুটাম চাপলে অবিকল্পিতকে সক্ৰিয় কৰা হ'ব নে নাই (যিমন কোন ডায়ালগেৰ অবিকল্পিত " "বুটাম)" -#: gtk/gtkentry.c:718 +#: gtk/gtkentry.c:720 msgid "Width in chars" msgstr "অক্ষৰৰ প্ৰস্থ" -#: gtk/gtkentry.c:719 +#: gtk/gtkentry.c:721 msgid "Number of characters to leave space for in the entry" msgstr "প্ৰতি অন্তৰ্ভুক্তিতে যত অক্ষৰ ৰিক্ত ৰাখিব" -#: gtk/gtkentry.c:728 +#: gtk/gtkentry.c:730 msgid "Scroll offset" msgstr "স্ক্ৰল অফসেট" -#: gtk/gtkentry.c:729 +#: gtk/gtkentry.c:731 msgid "Number of pixels of the entry scrolled off the screen to the left" msgstr "অন্তৰ্ভুক্তিৰ (Entry) যি সংখ্যক পিক্সেলকে পৰ্দ্দাৰ বামে সৰিয়ে নিয়ে যাওয়া হৈছে" -#: gtk/gtkentry.c:739 +#: gtk/gtkentry.c:741 msgid "The contents of the entry" msgstr "অন্তৰ্ভুক্তিৰ (Entry) অভ্যন্তৰীণ বস্তু" -#: gtk/gtkentry.c:754 gtk/gtkmisc.c:73 +#: gtk/gtkentry.c:756 gtk/gtkmisc.c:73 msgid "X align" msgstr "এক্স অক্ষ" -#: gtk/gtkentry.c:755 gtk/gtkmisc.c:74 +#: gtk/gtkentry.c:757 gtk/gtkmisc.c:74 msgid "" "The horizontal alignment, from 0 (left) to 1 (right). Reversed for RTL " "layouts." msgstr "পথালি সংৰেখন, ০ (বাম)ৰ পৰা ১ (ডান)। RTL নকশাৰ বাবে বিপৰীত" -#: gtk/gtkentry.c:771 +#: gtk/gtkentry.c:773 msgid "Truncate multiline" msgstr "Truncate multiline" -#: gtk/gtkentry.c:772 +#: gtk/gtkentry.c:774 msgid "Whether to truncate multiline pastes to one line." msgstr "Whether to truncate multiline pastes to one line." -#: gtk/gtkentry.c:788 +#: gtk/gtkentry.c:790 msgid "Which kind of shadow to draw around the entry when has-frame is set" msgstr "সৰ্বমোট হলো" -#: gtk/gtkentry.c:803 gtk/gtktextview.c:657 +#: gtk/gtkentry.c:805 gtk/gtktextview.c:657 msgid "Overwrite mode" msgstr "ওপৰ দিয়ে লেখাৰ মোড" # -#: gtk/gtkentry.c:804 +#: gtk/gtkentry.c:806 msgid "Whether new text overwrites existing text" msgstr "যি টেক্সট লেখা হ'ব তা বিদ্যমান টেক্সটৰ ওপৰ দিয়ে লেখা হ'ব নে নাই" -#: gtk/gtkentry.c:818 gtk/gtkentrybuffer.c:368 +#: gtk/gtkentry.c:820 gtk/gtkentrybuffer.c:368 msgid "Text length" msgstr "টেক্সটৰ দৈৰ্ঘ্য" -#: gtk/gtkentry.c:819 +#: gtk/gtkentry.c:821 msgid "Length of the text currently in the entry" msgstr "Length of the text currently in the entry" # -#: gtk/gtkentry.c:834 +#: gtk/gtkentry.c:836 msgid "Invisible char set" msgstr "অদৃশ্য সেট" # -#: gtk/gtkentry.c:835 +#: gtk/gtkentry.c:837 msgid "Whether the invisible char has been set" msgstr "কামটো দৃশ্যমান নে নাই।" -#: gtk/gtkentry.c:853 +#: gtk/gtkentry.c:855 msgid "Caps Lock warning" msgstr "Caps Lock warning" -#: gtk/gtkentry.c:854 +#: gtk/gtkentry.c:856 msgid "Whether password entries will show a warning when Caps Lock is on" msgstr "Whether password entries will show a warning when Caps Lock is on" # -#: gtk/gtkentry.c:868 +#: gtk/gtkentry.c:870 msgid "Progress Fraction" msgstr "ভগ্নাংশ" # -#: gtk/gtkentry.c:869 +#: gtk/gtkentry.c:871 msgid "The current fraction of the task that's been completed" msgstr "পুৰো কামটাৰ যি ভগ্নাংশ সম্পূৰ্ণ হৈছে" # -#: gtk/gtkentry.c:886 +#: gtk/gtkentry.c:888 msgid "Progress Pulse Step" msgstr "স্পন্দন ধাপ" # -#: gtk/gtkentry.c:887 +#: gtk/gtkentry.c:889 msgid "" "The fraction of total entry width to move the progress bouncing block for " "each call to gtk_entry_progress_pulse()" @@ -2361,226 +2277,226 @@ msgstr "" "মোট কামৰ যি ভগাংশ পৰিমাণ সম্পন্ন হলে স্পন্দনেৰ ফলে লাফাতে থাকা ব্লকটিকে সৰানো যাব " # -#: gtk/gtkentry.c:903 +#: gtk/gtkentry.c:905 msgid "Primary pixbuf" msgstr "পিক্সবাফ" # -#: gtk/gtkentry.c:904 +#: gtk/gtkentry.c:906 msgid "Primary pixbuf for the entry" msgstr "খোলা প্ৰসাৰকেৰ বাবে Pixbuf" # -#: gtk/gtkentry.c:918 +#: gtk/gtkentry.c:920 msgid "Secondary pixbuf" msgstr "দ্বিতীয় Text" # -#: gtk/gtkentry.c:919 +#: gtk/gtkentry.c:921 msgid "Secondary pixbuf for the entry" msgstr "সম্মুখগামী গৌণ স্টেপাৰ" -#: gtk/gtkentry.c:933 +#: gtk/gtkentry.c:935 msgid "Primary stock ID" msgstr "Primary stock ID" -#: gtk/gtkentry.c:934 +#: gtk/gtkentry.c:936 msgid "Stock ID for primary icon" msgstr "Stock ID for primary icon" # -#: gtk/gtkentry.c:948 +#: gtk/gtkentry.c:950 msgid "Secondary stock ID" msgstr "দ্বিতীয় Text" -#: gtk/gtkentry.c:949 +#: gtk/gtkentry.c:951 msgid "Stock ID for secondary icon" msgstr "Stock ID for secondary icon" # -#: gtk/gtkentry.c:963 +#: gtk/gtkentry.c:965 msgid "Primary icon name" msgstr "তালিকা সৰ্বমোট" -#: gtk/gtkentry.c:964 +#: gtk/gtkentry.c:966 msgid "Icon name for primary icon" msgstr "Icon name for primary icon" # -#: gtk/gtkentry.c:978 +#: gtk/gtkentry.c:980 msgid "Secondary icon name" msgstr "দ্বিতীয় Text" -#: gtk/gtkentry.c:979 +#: gtk/gtkentry.c:981 msgid "Icon name for secondary icon" msgstr "Icon name for secondary icon" -#: gtk/gtkentry.c:993 +#: gtk/gtkentry.c:995 msgid "Primary GIcon" msgstr "Primary GIcon" # -#: gtk/gtkentry.c:994 +#: gtk/gtkentry.c:996 msgid "GIcon for primary icon" msgstr "এই উইন্ডোৰ বাবে আইকন" # -#: gtk/gtkentry.c:1008 +#: gtk/gtkentry.c:1010 msgid "Secondary GIcon" msgstr "দ্বিতীয়" -#: gtk/gtkentry.c:1009 +#: gtk/gtkentry.c:1011 msgid "GIcon for secondary icon" msgstr "GIcon for secondary icon" # -#: gtk/gtkentry.c:1023 +#: gtk/gtkentry.c:1025 msgid "Primary storage type" msgstr "ভান্ডাৰৰ (Storage) ধৰন" # -#: gtk/gtkentry.c:1024 +#: gtk/gtkentry.c:1026 msgid "The representation being used for primary icon" msgstr "তথ্যচিত্ৰে বাবে যি উপস্থাপনা ব্যৱহাৰ কৰা হচ্ছে" # -#: gtk/gtkentry.c:1039 +#: gtk/gtkentry.c:1041 msgid "Secondary storage type" msgstr "সম্মুখগামী গৌণ স্টেপাৰ" # -#: gtk/gtkentry.c:1040 +#: gtk/gtkentry.c:1042 msgid "The representation being used for secondary icon" msgstr "তথ্যচিত্ৰে বাবে যি উপস্থাপনা ব্যৱহাৰ কৰা হচ্ছে" -#: gtk/gtkentry.c:1061 +#: gtk/gtkentry.c:1063 msgid "Primary icon activatable" msgstr "Primary icon activatable" # -#: gtk/gtkentry.c:1062 +#: gtk/gtkentry.c:1064 msgid "Whether the primary icon is activatable" msgstr "কামটো সক্ৰিয় হয় নে নহয়" # -#: gtk/gtkentry.c:1082 +#: gtk/gtkentry.c:1084 msgid "Secondary icon activatable" msgstr "কাৰ্ছাৰ আঁকায় ব্যৱহৃত দ্বিতীয় ৰং" # -#: gtk/gtkentry.c:1083 +#: gtk/gtkentry.c:1085 msgid "Whether the secondary icon is activatable" msgstr "কামটো সক্ৰিয় হয় নে নহয়" # -#: gtk/gtkentry.c:1105 +#: gtk/gtkentry.c:1107 msgid "Primary icon sensitive" msgstr "সেল sensitive প্ৰদৰ্শন কৰো" # -#: gtk/gtkentry.c:1106 +#: gtk/gtkentry.c:1108 msgid "Whether the primary icon is sensitive" msgstr "" "তালিকাৰ সদস্যদেৰ মিলিয়ে দেখাৰ সময় বড় বা ছোট হাতেৰ অক্ষৰ পৃথকভাবে বিবেচনা কৰা " "হ'ব নে নাই" # -#: gtk/gtkentry.c:1127 +#: gtk/gtkentry.c:1129 msgid "Secondary icon sensitive" msgstr "দ্বিতীয় Text" # -#: gtk/gtkentry.c:1128 +#: gtk/gtkentry.c:1130 msgid "Whether the secondary icon is sensitive" msgstr "কামটো সক্ৰিয় হয় নে নহয়" # -#: gtk/gtkentry.c:1144 +#: gtk/gtkentry.c:1146 msgid "Primary icon tooltip text" msgstr "সেল sensitive প্ৰদৰ্শন কৰো" # -#: gtk/gtkentry.c:1145 gtk/gtkentry.c:1181 +#: gtk/gtkentry.c:1147 gtk/gtkentry.c:1183 msgid "The contents of the tooltip on the primary icon" msgstr "সৰ্বমোট উল্লিখিত সময় অবধি" # -#: gtk/gtkentry.c:1161 +#: gtk/gtkentry.c:1163 msgid "Secondary icon tooltip text" msgstr "কাৰ্ছাৰ আঁকায় ব্যৱহৃত দ্বিতীয় ৰং" # -#: gtk/gtkentry.c:1162 gtk/gtkentry.c:1200 +#: gtk/gtkentry.c:1164 gtk/gtkentry.c:1202 msgid "The contents of the tooltip on the secondary icon" msgstr "সৰ্বমোট উল্লিখিত সময় অবধি" # -#: gtk/gtkentry.c:1180 +#: gtk/gtkentry.c:1182 msgid "Primary icon tooltip markup" msgstr "তালিকা সৰ্বমোট" # -#: gtk/gtkentry.c:1199 +#: gtk/gtkentry.c:1201 msgid "Secondary icon tooltip markup" msgstr "দ্বিতীয় Text" # -#: gtk/gtkentry.c:1219 gtk/gtktextview.c:685 +#: gtk/gtkentry.c:1221 gtk/gtktextview.c:685 msgid "IM module" msgstr "অবিকল্পিত প্ৰস্থ" # -#: gtk/gtkentry.c:1220 gtk/gtktextview.c:686 +#: gtk/gtkentry.c:1222 gtk/gtktextview.c:686 msgid "Which IM module should be used" msgstr "পেলেট ব্যৱহৃত হ'ব নে নাই" # -#: gtk/gtkentry.c:1234 +#: gtk/gtkentry.c:1236 msgid "Icon Prelight" msgstr "উচ্চতা" # -#: gtk/gtkentry.c:1235 +#: gtk/gtkentry.c:1237 msgid "Whether activatable icons should prelight when hovered" msgstr "ট্যাব প্ৰদৰ্শন কৰা হ'ব নে নাই" # -#: gtk/gtkentry.c:1248 +#: gtk/gtkentry.c:1250 msgid "Progress Border" msgstr "দীৰ্ঘ বক্সৰ প্ৰান্ত" # -#: gtk/gtkentry.c:1249 +#: gtk/gtkentry.c:1251 msgid "Border around the progress bar" msgstr "প্ৰগ্ৰেছবাৰত যি লিপি প্ৰদৰ্শন কৰা হ'ব" -#: gtk/gtkentry.c:1741 +#: gtk/gtkentry.c:1743 msgid "Border between text and frame." msgstr "Border." # -#: gtk/gtkentry.c:1755 +#: gtk/gtkentry.c:1757 msgid "State Hint" msgstr "অবস্থা বাক্য" # -#: gtk/gtkentry.c:1756 +#: gtk/gtkentry.c:1758 msgid "Whether to pass a proper state when drawing shadow or background" msgstr "টেক্সটৰ পটভূমি আঁকাৰ সময় যি বিটম্যাপকে মাস্ক হিচাপে ব্যৱহাৰ কৰা হ'ব" -#: gtk/gtkentry.c:1761 gtk/gtklabel.c:858 +#: gtk/gtkentry.c:1763 gtk/gtklabel.c:882 msgid "Select on focus" msgstr "ফোকাস কৰলে চিহ্নিত হ'ব" -#: gtk/gtkentry.c:1762 +#: gtk/gtkentry.c:1764 msgid "Whether to select the contents of an entry when it is focused" msgstr "কোন অন্তৰ্ভুক্তিৰ (Entry) অভ্যন্তৰীণ বস্তুকে ফ'কাচ কৰলে তা চিহ্নিত হ'ব নে নাই" -#: gtk/gtkentry.c:1776 +#: gtk/gtkentry.c:1778 msgid "Password Hint Timeout" msgstr "গুপ্তশব্দ" -#: gtk/gtkentry.c:1777 +#: gtk/gtkentry.c:1779 msgid "How long to show the last input character in hidden entries" msgstr "শেষ" @@ -2608,7 +2524,7 @@ msgstr "মূলশব্দেৰ (Key) সৰ্বনিম্ন দৈৰ msgid "Minimum length of the search key in order to look up matches" msgstr "মিল খোঁজায় ব্যৱহৃত মূলশব্দেৰ (Key) সৰ্বনিম্ন দৈৰ্ঘ্য" -#: gtk/gtkentrycompletion.c:303 gtk/gtkiconview.c:586 +#: gtk/gtkentrycompletion.c:303 gtk/gtkiconview.c:588 msgid "Text column" msgstr "টেক্সট স্তম্ভ" @@ -2689,11 +2605,11 @@ msgstr "চাইল্ড উইজেটটি দেখানোৰ বাব msgid "Text of the expander's label" msgstr "এক্সপেন্ডাৰৰ লেবেলৰ ওপৰতে লেখা টেক্সট" -#: gtk/gtkexpander.c:211 gtk/gtklabel.c:520 +#: gtk/gtkexpander.c:211 gtk/gtklabel.c:542 msgid "Use markup" msgstr "মাৰ্কআপ ব্যৱহাৰ কৰো" -#: gtk/gtkexpander.c:212 gtk/gtklabel.c:521 +#: gtk/gtkexpander.c:212 gtk/gtklabel.c:543 msgid "The text of the label includes XML markup. See pango_parse_markup()" msgstr "লেবেলৰ টেক্সটে এক্সএমএল মাৰ্ক আপ অন্তৰ্ভুক্ত আছে। pango_parse_markup() দেখুন" @@ -2701,8 +2617,8 @@ msgstr "লেবেলৰ টেক্সটে এক্সএমএল মা msgid "Space to put between the label and the child" msgstr "লেবেল এবং চাইল্ডৰ মধ্যবৰ্তী শূণ্যস্থান" -#: gtk/gtkexpander.c:229 gtk/gtkframe.c:147 gtk/gtktoolbutton.c:218 -#: gtk/gtktoolitemgroup.c:1542 +#: gtk/gtkexpander.c:229 gtk/gtkframe.c:156 gtk/gtktoolbutton.c:218 +#: gtk/gtktoolitemgroup.c:1550 msgid "Label widget" msgstr "লেবেল উইজেট" @@ -2710,11 +2626,11 @@ msgstr "লেবেল উইজেট" msgid "A widget to display in place of the usual expander label" msgstr "স্বাভাবিক এক্সপেন্ডাৰৰ লেবেলৰ পৰিবৰ্তে যি উইজেটটি প্ৰদৰ্শিত হ'ব" -#: gtk/gtkexpander.c:236 gtk/gtktoolitemgroup.c:1570 gtk/gtktreeview.c:777 +#: gtk/gtkexpander.c:236 gtk/gtktoolitemgroup.c:1578 gtk/gtktreeview.c:779 msgid "Expander Size" msgstr "অধিকৃতি দৈৰ্ঘ্য" -#: gtk/gtkexpander.c:237 gtk/gtktoolitemgroup.c:1571 gtk/gtktreeview.c:778 +#: gtk/gtkexpander.c:237 gtk/gtktoolitemgroup.c:1579 gtk/gtktreeview.c:780 msgid "Size of the expander arrow" msgstr "অধিকৃতি চিহ্নেৰ দৈৰ্ঘ্য" @@ -2722,107 +2638,99 @@ msgstr "অধিকৃতি চিহ্নেৰ দৈৰ্ঘ্য" msgid "Spacing around expander arrow" msgstr "অধিকৃতি চিহ্নেৰ পাৰিপাৰ্শ্বিক স্থান" -#: gtk/gtkfilechooser.c:758 +#: gtk/gtkfilechooser.c:759 msgid "Action" msgstr "কাম" -#: gtk/gtkfilechooser.c:759 +#: gtk/gtkfilechooser.c:760 msgid "The type of operation that the file selector is performing" msgstr "এই ফাইল-নিৰ্বাচকটি যি ধৰনেৰ কাম কৰছে" -#: gtk/gtkfilechooser.c:765 -msgid "File System Backend" -msgstr "ফাইল-সিস্টেম ব্যাকএন্ড" - -#: gtk/gtkfilechooser.c:766 -msgid "Name of file system backend to use" -msgstr "যি ফাইল-সিস্টেম ব্যাকএন্ড'টি ব্যৱহাৰ কৰা হ'ব তাৰ নাম" - -#: gtk/gtkfilechooser.c:771 gtk/gtkrecentchooser.c:264 +#: gtk/gtkfilechooser.c:766 gtk/gtkrecentchooser.c:281 msgid "Filter" msgstr "ফিল্টাৰ" -#: gtk/gtkfilechooser.c:772 +#: gtk/gtkfilechooser.c:767 msgid "The current filter for selecting which files are displayed" msgstr "" "যি সকল ফাইলৰ নাম দেখানো হ'ব, তাদেৰ বাছাই কৰাৰ কামে বৰ্তমানে যি ফিল্টাৰটি ব্যৱহৃত " "হচ্ছে" -#: gtk/gtkfilechooser.c:777 +#: gtk/gtkfilechooser.c:772 msgid "Local Only" msgstr "অকল স্থানীয়" -#: gtk/gtkfilechooser.c:778 +#: gtk/gtkfilechooser.c:773 msgid "Whether the selected file(s) should be limited to local file: URLs" msgstr "ফাইল বাছাইকৰণ অকল স্থানীয়ৰ ফাইলৰ মাজতই সীমাবদ্ধ থাকবে নে নাই: ইউআৰএল" -#: gtk/gtkfilechooser.c:783 +#: gtk/gtkfilechooser.c:778 msgid "Preview widget" msgstr "প্ৰাকদৰ্শনে ব্যৱহৃত উইজেট" -#: gtk/gtkfilechooser.c:784 +#: gtk/gtkfilechooser.c:779 msgid "Application supplied widget for custom previews." msgstr "স্বনিৰ্বাচিত প্ৰাকদৰ্শনে ব্যৱহাৰৰ বাবে অ্যাপলিকেশন কৰ্তৃক সৰবৰাহকৃত উইজেট।" -#: gtk/gtkfilechooser.c:789 +#: gtk/gtkfilechooser.c:784 msgid "Preview Widget Active" msgstr "প্ৰাকদৰ্শনে ব্যৱহৃত উইজেট সক্ৰিয় আছে" -#: gtk/gtkfilechooser.c:790 +#: gtk/gtkfilechooser.c:785 msgid "" "Whether the application supplied widget for custom previews should be shown." msgstr "" "স্বনিৰ্বাচিত প্ৰাকদৰ্শনে ব্যৱহাৰৰ বাবে অ্যাপলিকেশন কৰ্তৃক সৰবৰাহকৃত উইজেট প্ৰদৰ্শন কৰা " "হ'ব নে নাই।" -#: gtk/gtkfilechooser.c:795 +#: gtk/gtkfilechooser.c:790 msgid "Use Preview Label" msgstr "প্ৰাকদৰ্শনে ব্যৱহৃত লেবেল ব্যৱহাৰ কৰো" -#: gtk/gtkfilechooser.c:796 +#: gtk/gtkfilechooser.c:791 msgid "Whether to display a stock label with the name of the previewed file." msgstr "" "প্ৰাকদৰ্শনকৃত ফাইলৰ নামেৰ সহায়ত এটা স্টক (Stock) লেবেল প্ৰদৰ্শন কৰা হ'ব নে নাই।" -#: gtk/gtkfilechooser.c:801 +#: gtk/gtkfilechooser.c:796 msgid "Extra widget" msgstr "অতিৰিক্ত উইজেট" -#: gtk/gtkfilechooser.c:802 +#: gtk/gtkfilechooser.c:797 msgid "Application supplied widget for extra options." msgstr "অতিৰিক্ত বিকল্পেৰ বাবে অ্যাপলিকেশন কৰ্তৃক সৰবৰাহকৃত উইজেট।" -#: gtk/gtkfilechooser.c:807 gtk/gtkfilesel.c:540 gtk/gtkrecentchooser.c:203 +#: gtk/gtkfilechooser.c:802 gtk/gtkrecentchooser.c:220 msgid "Select Multiple" msgstr "একাধিক জিনিষ বাছাই কৰো" -#: gtk/gtkfilechooser.c:808 gtk/gtkfilesel.c:541 +#: gtk/gtkfilechooser.c:803 msgid "Whether to allow multiple files to be selected" msgstr "একাধিক ফাইলকে চিহ্নিত কৰা যাব নে নাই" -#: gtk/gtkfilechooser.c:814 +#: gtk/gtkfilechooser.c:809 msgid "Show Hidden" msgstr "লুক্কায়িত জিনিষ প্ৰদৰ্শন কৰো" -#: gtk/gtkfilechooser.c:815 +#: gtk/gtkfilechooser.c:810 msgid "Whether the hidden files and folders should be displayed" msgstr "লুক্কায়িত ফাইল আৰু ফোল্ডাৰ প্ৰদৰ্শন কৰা হ'ব নে নাই" -#: gtk/gtkfilechooser.c:830 +#: gtk/gtkfilechooser.c:825 msgid "Do overwrite confirmation" msgstr "ওপৰ দিয়ে লেখাৰ পূৰ্বে নিশ্চিত হও" -#: gtk/gtkfilechooser.c:831 +#: gtk/gtkfilechooser.c:826 msgid "" "Whether a file chooser in save mode will present an overwrite confirmation " "dialog if necessary." msgstr "ফাইল মোড." -#: gtk/gtkfilechooser.c:847 +#: gtk/gtkfilechooser.c:842 msgid "Allow folders creation" msgstr "ফোল্ডাৰৰ সৃষ্টিৰ অনুমতি দিয়ক" -#: gtk/gtkfilechooser.c:848 +#: gtk/gtkfilechooser.c:843 msgid "" "Whether a file chooser not in open mode will offer the user to create new " "folders." @@ -2845,36 +2753,19 @@ msgstr "ফাইল নিৰ্বাচক ডায়ালগেৰ শিৰ msgid "The desired width of the button widget, in characters." msgstr "অক্ষৰ হিচাপে বুটাম উইজেটেৰ আকাঙ্খিত প্ৰস্থ।" -#: gtk/gtkfilesel.c:526 gtk/gtkimage.c:254 gtk/gtkrecentmanager.c:214 -#: gtk/gtkstatusicon.c:221 -msgid "Filename" -msgstr "ফাইলৰ নাম" - -#: gtk/gtkfilesel.c:527 -msgid "The currently selected filename" -msgstr "বৰ্তমানে বাছাইকৃত ফাইলনাম" - -#: gtk/gtkfilesel.c:533 -msgid "Show file operations" -msgstr "ফাইল সংক্ৰান্ত কামকৰ্ম দেখানো হোক" - -#: gtk/gtkfilesel.c:534 -msgid "Whether buttons for creating/manipulating files should be displayed" -msgstr "ফাইল তৈৰিৰ/পৰিবৰ্তনেৰ বুটাম প্ৰদৰ্শন কৰা হ'ব নে নাই" - -#: gtk/gtkfixed.c:90 gtk/gtklayout.c:597 +#: gtk/gtkfixed.c:90 gtk/gtklayout.c:561 msgid "X position" msgstr "এক্স অবস্থান" -#: gtk/gtkfixed.c:91 gtk/gtklayout.c:598 +#: gtk/gtkfixed.c:91 gtk/gtklayout.c:562 msgid "X position of child widget" msgstr "চাইল্ড উইজেটেৰ এক্স অক্ষ বৰাবৰ অবস্থান" -#: gtk/gtkfixed.c:100 gtk/gtklayout.c:607 +#: gtk/gtkfixed.c:100 gtk/gtklayout.c:571 msgid "Y position" msgstr "ওয়াই অবস্থান" -#: gtk/gtkfixed.c:101 gtk/gtklayout.c:608 +#: gtk/gtkfixed.c:101 gtk/gtklayout.c:572 msgid "Y position of child widget" msgstr "চাইল্ড উইজেটেৰ ওয়াই অক্ষ বৰাবৰ অবস্থান" @@ -2943,81 +2834,81 @@ msgstr "প্ৰাকদৰ্শনে ব্যৱহৃত টেক্স msgid "The text to display in order to demonstrate the selected font" msgstr "চিহ্নিত ফন্টকে প্ৰদৰ্শনীৰ উদ্দেশ্যি যি টেক্সট লেখা হ'ব" -#: gtk/gtkframe.c:106 +#: gtk/gtkframe.c:115 msgid "Text of the frame's label" msgstr "টেক্সট" -#: gtk/gtkframe.c:113 +#: gtk/gtkframe.c:122 msgid "Label xalign" msgstr "শিৰোনাম" -#: gtk/gtkframe.c:114 +#: gtk/gtkframe.c:123 msgid "The horizontal alignment of the label" msgstr "লেবেলৰ পথালি সংৰেখন" -#: gtk/gtkframe.c:122 +#: gtk/gtkframe.c:131 msgid "Label yalign" msgstr "শিৰোনাম" -#: gtk/gtkframe.c:123 +#: gtk/gtkframe.c:132 msgid "The vertical alignment of the label" msgstr "লেবেলৰ উলম্ব সংৰেখন" -#: gtk/gtkframe.c:131 gtk/gtkhandlebox.c:167 +#: gtk/gtkframe.c:140 gtk/gtkhandlebox.c:168 msgid "Deprecated property, use shadow_type instead" msgstr "" "এই বৈশিষ্ট্যটি অনুমোদিত নয়, ইয়াৰ পৰিবৰ্তে ছায়া _ধৰন (Shadow type) ব্যৱহাৰ কৰক" -#: gtk/gtkframe.c:138 +#: gtk/gtkframe.c:147 msgid "Frame shadow" msgstr "ফ্ৰেমেৰ ছায়া" -#: gtk/gtkframe.c:139 +#: gtk/gtkframe.c:148 msgid "Appearance of the frame border" msgstr "ফ্ৰেম প্ৰান্তৰ চেহাৰা" -#: gtk/gtkframe.c:148 +#: gtk/gtkframe.c:157 msgid "A widget to display in place of the usual frame label" msgstr "সাধাৰণত প্ৰদৰ্শিত ফ্ৰেম লেবেলৰ পৰিবৰ্তে যি উইজেটটি দেখানো হ'ব" -#: gtk/gtkhandlebox.c:175 +#: gtk/gtkhandlebox.c:176 msgid "Appearance of the shadow that surrounds the container" msgstr "কনটেইনাৰকে ঘিৰে থাকা ছায়াৰ চেহাৰা" -#: gtk/gtkhandlebox.c:183 +#: gtk/gtkhandlebox.c:184 msgid "Handle position" msgstr "হাতলৰ অবস্থান" -#: gtk/gtkhandlebox.c:184 +#: gtk/gtkhandlebox.c:185 msgid "Position of the handle relative to the child widget" msgstr "চাইল্ড উইজেটেৰ সাপেক্ষে হাতলৰ অবস্থান" -#: gtk/gtkhandlebox.c:192 +#: gtk/gtkhandlebox.c:193 msgid "Snap edge" msgstr "উজ্জ্বল প্ৰান্ত" -#: gtk/gtkhandlebox.c:193 +#: gtk/gtkhandlebox.c:194 msgid "" "Side of the handlebox that's lined up with the docking point to dock the " "handlebox" msgstr "হ্যান্ডলবাক্সৰ পাৰ্শ্ব যাৰ ডকিং পয়েন্টেৰ সৈতে যুক্ত হয়" -#: gtk/gtkhandlebox.c:201 +#: gtk/gtkhandlebox.c:202 msgid "Snap edge set" msgstr "উজ্জ্বল প্ৰান্তৰ সেট" -#: gtk/gtkhandlebox.c:202 +#: gtk/gtkhandlebox.c:203 msgid "" "Whether to use the value from the snap_edge property or a value derived from " "handle_position" msgstr "" "snap_edge নাকি handle_position ইয়াৰ বৈশিষ্ট্যৰ পৰা নেয়া মানটি ব্যৱহাৰ কৰা হ'ব" -#: gtk/gtkhandlebox.c:209 +#: gtk/gtkhandlebox.c:210 msgid "Child Detached" msgstr "Child Detached" -#: gtk/gtkhandlebox.c:210 +#: gtk/gtkhandlebox.c:211 msgid "" "A boolean value indicating whether the handlebox's child is attached or " "detached." @@ -3025,210 +2916,214 @@ msgstr "" "A boolean value indicating whether the handlebox's child is attached or " "detached." -#: gtk/gtkiconview.c:549 +#: gtk/gtkiconview.c:551 msgid "Selection mode" msgstr "Selection mode" -#: gtk/gtkiconview.c:550 +#: gtk/gtkiconview.c:552 msgid "The selection mode" msgstr "বাছাইকৰণ মোড" -#: gtk/gtkiconview.c:568 +#: gtk/gtkiconview.c:570 msgid "Pixbuf column" msgstr "পিক্সবাফ স্তম্ভ" -#: gtk/gtkiconview.c:569 +#: gtk/gtkiconview.c:571 msgid "Model column used to retrieve the icon pixbuf from" msgstr "মডেল স্তম্ভ ব্যৱহাৰ কৰি যিখানৰ পৰা আইকন পিক্সবাফ আহৰণ কৰা হৈছে - " -#: gtk/gtkiconview.c:587 +#: gtk/gtkiconview.c:589 msgid "Model column used to retrieve the text from" msgstr "মডেল স্তম্ভ ব্যৱহাৰ কৰি যিখানৰ পৰা টেক্সট আহৰণ কৰা হৈছে - " -#: gtk/gtkiconview.c:606 +#: gtk/gtkiconview.c:608 msgid "Markup column" msgstr "মাৰ্কআপ স্তম্ভ" -#: gtk/gtkiconview.c:607 +#: gtk/gtkiconview.c:609 msgid "Model column used to retrieve the text if using Pango markup" msgstr "পেনগো মাৰ্কআপ ব্যৱহাৰ কৰলে মডেল স্তম্ভ ব্যৱহাৰ কৰি টেক্সট আহৰণ কৰা হয়" -#: gtk/gtkiconview.c:614 +#: gtk/gtkiconview.c:616 msgid "Icon View Model" msgstr "আইকন-ভিউ মডেল" -#: gtk/gtkiconview.c:615 +#: gtk/gtkiconview.c:617 msgid "The model for the icon view" msgstr "আইকন-ভিউ তৰ মডেল" -#: gtk/gtkiconview.c:631 +#: gtk/gtkiconview.c:633 msgid "Number of columns" msgstr "স্তম্ভ সংখ্যা" -#: gtk/gtkiconview.c:632 +#: gtk/gtkiconview.c:634 msgid "Number of columns to display" msgstr "যি সংখ্যক স্তম্ভ প্ৰদৰ্শন কৰা হ'ব" -#: gtk/gtkiconview.c:649 +#: gtk/gtkiconview.c:651 msgid "Width for each item" msgstr "প্ৰতিটি বস্তুৰ প্ৰস্থ" -#: gtk/gtkiconview.c:650 +#: gtk/gtkiconview.c:652 msgid "The width used for each item" msgstr "প্ৰতিটি বস্তুৰ প্ৰস্থ" -#: gtk/gtkiconview.c:666 +#: gtk/gtkiconview.c:668 msgid "Space which is inserted between cells of an item" msgstr "প্ৰতিটি বস্তুৰ ঘৰগুলোৰ মাজত যি সংখ্যক স্থান ভৰোৱা হয়" -#: gtk/gtkiconview.c:681 +#: gtk/gtkiconview.c:683 msgid "Row Spacing" msgstr "শাৰীৰ স্থান তৰ সংখ্যা" -#: gtk/gtkiconview.c:682 +#: gtk/gtkiconview.c:684 msgid "Space which is inserted between grid rows" msgstr "গ্ৰীড শাৰীগুলোৰ মাজত যি সংখ্যক স্থান ভৰোৱা হয়" -#: gtk/gtkiconview.c:697 +#: gtk/gtkiconview.c:699 msgid "Column Spacing" msgstr "শাৰীৰ স্থান তৰ সংখ্যা" -#: gtk/gtkiconview.c:698 +#: gtk/gtkiconview.c:700 msgid "Space which is inserted between grid columns" msgstr "হলো স্তম্ভ" -#: gtk/gtkiconview.c:713 +#: gtk/gtkiconview.c:715 msgid "Margin" msgstr "মাৰ্জিন" -#: gtk/gtkiconview.c:714 +#: gtk/gtkiconview.c:716 msgid "Space which is inserted at the edges of the icon view" msgstr "আইকন-ভিউ তৰ প্ৰান্তে যি সংখ্যক স্থান ভৰোৱা হয়" -#: gtk/gtkiconview.c:730 +#: gtk/gtkiconview.c:732 msgid "" "How the text and icon of each item are positioned relative to each other" msgstr "প্ৰতিটি বস্তুৰ আইকন আৰু টেক্সটক পৰস্পৰৰ সাপেক্ষে যি ভাবে ৰাখা হয়" -#: gtk/gtkiconview.c:746 gtk/gtktreeview.c:612 gtk/gtktreeviewcolumn.c:308 +#: gtk/gtkiconview.c:748 gtk/gtktreeview.c:614 gtk/gtktreeviewcolumn.c:308 msgid "Reorderable" msgstr "পুনৰায় সজোৱাৰ যোগ্য" -#: gtk/gtkiconview.c:747 gtk/gtktreeview.c:613 +#: gtk/gtkiconview.c:749 gtk/gtktreeview.c:615 msgid "View is reorderable" msgstr "প্ৰদৰ্শিত দৃশ্য পুনৰায় সজোৱাৰ যোগ্য" -#: gtk/gtkiconview.c:754 gtk/gtktreeview.c:763 +#: gtk/gtkiconview.c:756 gtk/gtktreeview.c:765 msgid "Tooltip Column" msgstr "টুলটিপ স্তম্ভ" -#: gtk/gtkiconview.c:755 +#: gtk/gtkiconview.c:757 msgid "The column in the model containing the tooltip texts for the items" msgstr "উল্লিখিত সময় অবধি" -#: gtk/gtkiconview.c:772 +#: gtk/gtkiconview.c:774 msgid "Item Padding" msgstr "বস্তুৰ পেডিং" -#: gtk/gtkiconview.c:773 +#: gtk/gtkiconview.c:775 msgid "Padding around icon view items" msgstr "আইকন প্ৰদৰ্শন বস্তুৰ ওচৰত পেডিং" -#: gtk/gtkiconview.c:782 +#: gtk/gtkiconview.c:784 msgid "Selection Box Color" msgstr "নিৰ্বাচক বক্সৰ ৰং" -#: gtk/gtkiconview.c:783 +#: gtk/gtkiconview.c:785 msgid "Color of the selection box" msgstr "নিৰ্বাচক বক্সৰ ৰং" -#: gtk/gtkiconview.c:789 +#: gtk/gtkiconview.c:791 msgid "Selection Box Alpha" msgstr "নিৰ্বাচক বক্সৰ আলফা" -#: gtk/gtkiconview.c:790 +#: gtk/gtkiconview.c:792 msgid "Opacity of the selection box" msgstr "নিৰ্বাচক বক্সৰ স্বচ্ছতা" -#: gtk/gtkimage.c:222 gtk/gtkstatusicon.c:213 +#: gtk/gtkimage.c:227 gtk/gtkstatusicon.c:218 msgid "Pixbuf" msgstr "পিক্সবাফ" -#: gtk/gtkimage.c:223 gtk/gtkstatusicon.c:214 +#: gtk/gtkimage.c:228 gtk/gtkstatusicon.c:219 msgid "A GdkPixbuf to display" msgstr "প্ৰদৰ্শনেৰ বাবে এটা GdkPixbuf" -#: gtk/gtkimage.c:230 +#: gtk/gtkimage.c:235 msgid "Pixmap" msgstr "পিক্সম্যাপ" -#: gtk/gtkimage.c:231 +#: gtk/gtkimage.c:236 msgid "A GdkPixmap to display" msgstr "প্ৰদৰ্শনেৰ বাবে এটা GdkPixmap" -#: gtk/gtkimage.c:238 gtk/gtkmessagedialog.c:215 +#: gtk/gtkimage.c:243 gtk/gtkmessagedialog.c:262 msgid "Image" msgstr "Image" -#: gtk/gtkimage.c:239 +#: gtk/gtkimage.c:244 msgid "A GdkImage to display" msgstr "প্ৰদৰ্শনেৰ বাবে এটা GdkImage" -#: gtk/gtkimage.c:246 +#: gtk/gtkimage.c:251 msgid "Mask" msgstr "ছাঁচ" -#: gtk/gtkimage.c:247 +#: gtk/gtkimage.c:252 msgid "Mask bitmap to use with GdkImage or GdkPixmap" msgstr "GdkImage বা GdkPixmap ইয়াৰ সৈতে ব্যৱহাৰৰ বাবে মাস্ক" -#: gtk/gtkimage.c:255 gtk/gtkstatusicon.c:222 +#: gtk/gtkimage.c:259 gtk/gtkrecentmanager.c:214 gtk/gtkstatusicon.c:226 +msgid "Filename" +msgstr "ফাইলৰ নাম" + +#: gtk/gtkimage.c:260 gtk/gtkstatusicon.c:227 msgid "Filename to load and display" msgstr "লোড কৰি দেখাবাৰ বাবে ফাইলৰ নাম" -#: gtk/gtkimage.c:264 gtk/gtkstatusicon.c:230 +#: gtk/gtkimage.c:269 gtk/gtkstatusicon.c:235 msgid "Stock ID for a stock image to display" msgstr "যি স্টক চিত্ৰটি প্ৰদৰ্শন কৰা হ'ব তাৰ স্টক আইডি" -#: gtk/gtkimage.c:271 +#: gtk/gtkimage.c:276 msgid "Icon set" msgstr "আইকন সেট" -#: gtk/gtkimage.c:272 +#: gtk/gtkimage.c:277 msgid "Icon set to display" msgstr "প্ৰদৰ্শন কৰাৰ বাবে আইকন সেট" -#: gtk/gtkimage.c:279 gtk/gtkscalebutton.c:216 gtk/gtktoolbar.c:540 -#: gtk/gtktoolpalette.c:990 +#: gtk/gtkimage.c:284 gtk/gtkscalebutton.c:232 gtk/gtktoolbar.c:485 +#: gtk/gtktoolpalette.c:991 msgid "Icon size" msgstr "আইকনেৰ আয়তন" -#: gtk/gtkimage.c:280 +#: gtk/gtkimage.c:285 msgid "Symbolic size to use for stock icon, icon set or named icon" msgstr "" "সাধাৰণ আইকন, আইকন সেট বা নামযুক্ত আইকনেৰ বাবে যি প্ৰতীকী আকাৰ ব্যৱহাৰ কৰা হ'ব" -#: gtk/gtkimage.c:296 +#: gtk/gtkimage.c:301 msgid "Pixel size" msgstr "পিক্ছেলৰআকাৰ" -#: gtk/gtkimage.c:297 +#: gtk/gtkimage.c:302 msgid "Pixel size to use for named icon" msgstr "নামযুক্ত আইকনেৰ বাবে ব্যৱহৃত পিক্সেল-আকাৰ" -#: gtk/gtkimage.c:305 +#: gtk/gtkimage.c:310 msgid "Animation" msgstr "আ্যনিমেশন" -#: gtk/gtkimage.c:306 +#: gtk/gtkimage.c:311 msgid "GdkPixbufAnimation to display" msgstr "যি GdkPixbufAnimation প্ৰদৰ্শন কৰা হ'ব" -#: gtk/gtkimage.c:346 gtk/gtkstatusicon.c:261 +#: gtk/gtkimage.c:351 gtk/gtkstatusicon.c:266 msgid "Storage type" msgstr "ভান্ডাৰৰ (Storage) ধৰন" -#: gtk/gtkimage.c:347 gtk/gtkstatusicon.c:262 +#: gtk/gtkimage.c:352 gtk/gtkstatusicon.c:267 msgid "The representation being used for image data" msgstr "তথ্যচিত্ৰে বাবে যি উপস্থাপনা ব্যৱহাৰ কৰা হচ্ছে" @@ -3242,7 +3137,7 @@ msgid "Whether to use the label text to create a stock menu item" msgstr "মাউছৰ সহায়ত লেবেলৰ টেক্সটক চিহ্নিত কৰা যাব নে নাই" # -#: gtk/gtkimagemenuitem.c:184 gtk/gtkmenu.c:516 +#: gtk/gtkimagemenuitem.c:184 gtk/gtkmenu.c:523 msgid "Accel Group" msgstr "Accel Group" @@ -3259,11 +3154,11 @@ msgstr "Show menu images" msgid "Whether images should be shown in menus" msgstr "Whether images should be shown in menus" -#: gtk/gtkinfobar.c:384 gtk/gtkmessagedialog.c:128 +#: gtk/gtkinfobar.c:384 gtk/gtkmessagedialog.c:175 msgid "Message Type" msgstr "বাৰ্তাৰ ধৰন" -#: gtk/gtkinfobar.c:385 gtk/gtkmessagedialog.c:129 +#: gtk/gtkinfobar.c:385 gtk/gtkmessagedialog.c:176 msgid "The type of message" msgstr "বাৰ্তাৰ ধৰন" @@ -3279,23 +3174,23 @@ msgstr "ক্ষেত্ৰত পদাৰ্থৰ মাজৰ ৰিক্ msgid "Width of border around the action area" msgstr "কাৰ্য্যক্ষেত্ৰ ওচৰৰ প্ৰান্তৰ প্ৰস্থ" -#: gtk/gtkinvisible.c:87 gtk/gtkwindow.c:627 +#: gtk/gtkinvisible.c:87 gtk/gtkwindow.c:651 msgid "The screen where this window will be displayed" msgstr "এই উইন্ডোটি যি পৰ্দ্দায় প্ৰদৰ্শিত হ'ব" -#: gtk/gtklabel.c:507 +#: gtk/gtklabel.c:529 msgid "The text of the label" msgstr "লেবেলৰ টেক্সট" -#: gtk/gtklabel.c:514 +#: gtk/gtklabel.c:536 msgid "A list of style attributes to apply to the text of the label" msgstr "লেবেলৰ টেক্সটে প্ৰয়োগ কৰাৰ মত কিছু বৈশিষ্ট্যিৰ এটা তালিকা" -#: gtk/gtklabel.c:535 gtk/gtktexttag.c:359 gtk/gtktextview.c:594 +#: gtk/gtklabel.c:557 gtk/gtktexttag.c:359 gtk/gtktextview.c:594 msgid "Justification" msgstr "সমপ্ৰান্ত নিৰ্ধাৰণ" -#: gtk/gtklabel.c:536 +#: gtk/gtklabel.c:558 msgid "" "The alignment of the lines in the text of the label relative to each other. " "This does NOT affect the alignment of the label within its allocation. See " @@ -3304,57 +3199,57 @@ msgstr "" "লেবেলৰ টেক্সটৰ লাইনগুলোৰ সংৰেখন পৰস্পৰৰ সাপেক্ষে। ইয়াক লেবেলৰ সংৰেখনকে প্ৰভাবিত " "কৰি না। এবাবে GtkMisc::xalign দেখুন" -#: gtk/gtklabel.c:544 +#: gtk/gtklabel.c:566 msgid "Pattern" msgstr "পেটাৰ্ন" -#: gtk/gtklabel.c:545 +#: gtk/gtklabel.c:567 msgid "" "A string with _ characters in positions correspond to characters in the text " "to underline" msgstr "এই পঙ্‌ক্তিটিৰ যিসব স্থানে _ আছে, টেক্সটৰ সেসব স্থানেৰ অক্ষৰ নিম্নৰেখাঙ্কিত হ'ব" -#: gtk/gtklabel.c:552 +#: gtk/gtklabel.c:574 msgid "Line wrap" msgstr "লাইন গুটানো" -#: gtk/gtklabel.c:553 +#: gtk/gtklabel.c:575 msgid "If set, wrap lines if the text becomes too wide" msgstr "এটি বাছাই কৰা থাকলে লাইনেৰ দৈৰ্ঘ্য অত্যধিক বেশি হয়ে গেলে লাইনটি গুটিয়ে যায়" -#: gtk/gtklabel.c:568 +#: gtk/gtklabel.c:590 msgid "Line wrap mode" msgstr "মোড" -#: gtk/gtklabel.c:569 +#: gtk/gtklabel.c:591 msgid "If wrap is set, controls how linewrapping is done" msgstr "হলো হলো" -#: gtk/gtklabel.c:576 +#: gtk/gtklabel.c:598 msgid "Selectable" msgstr "চিহ্নিত কৰাৰ যোগ্য" -#: gtk/gtklabel.c:577 +#: gtk/gtklabel.c:599 msgid "Whether the label text can be selected with the mouse" msgstr "মাউছৰ সহায়ত লেবেলৰ টেক্সটক চিহ্নিত কৰা যাব নে নাই" -#: gtk/gtklabel.c:583 +#: gtk/gtklabel.c:605 msgid "Mnemonic key" msgstr "নেমোনিক কী (Key)" -#: gtk/gtklabel.c:584 +#: gtk/gtklabel.c:606 msgid "The mnemonic accelerator key for this label" msgstr "এই লেবেলৰ নেমোনিক গতিবৰ্ধক কী (Key)" -#: gtk/gtklabel.c:592 +#: gtk/gtklabel.c:614 msgid "Mnemonic widget" msgstr "নেমোনিক উইজেট" -#: gtk/gtklabel.c:593 +#: gtk/gtklabel.c:615 msgid "The widget to be activated when the label's mnemonic key is pressed" msgstr "লেবেলৰ নেমোনিক কী (Key) চাপা হলে যি উইজেটকে সক্ৰিয় কৰা হ'ব" -#: gtk/gtklabel.c:639 +#: gtk/gtklabel.c:661 msgid "" "The preferred place to ellipsize the string, if the label does not have " "enough room to display the entire string" @@ -3362,63 +3257,63 @@ msgstr "" "The preferred place to ellipsize the string, if the label does not have " "enough room to display the entire string" -#: gtk/gtklabel.c:679 +#: gtk/gtklabel.c:702 msgid "Single Line Mode" msgstr "একক লাইন মোড" -#: gtk/gtklabel.c:680 +#: gtk/gtklabel.c:703 msgid "Whether the label is in single line mode" msgstr "লেবেলটি একক লাইন মোডে আছে নে নাই" -#: gtk/gtklabel.c:697 +#: gtk/gtklabel.c:720 msgid "Angle" msgstr "কোণ" -#: gtk/gtklabel.c:698 +#: gtk/gtklabel.c:721 msgid "Angle at which the label is rotated" msgstr "লেবেলকে যি কোণে ঘোৰানো হৈছে" -#: gtk/gtklabel.c:718 +#: gtk/gtklabel.c:742 msgid "Maximum Width In Characters" msgstr "অক্ষৰ হিচাপে সৰ্বোচ্চ প্ৰস্থ" -#: gtk/gtklabel.c:719 +#: gtk/gtklabel.c:743 msgid "The desired maximum width of the label, in characters" msgstr "অক্ষৰ হিচাপে লেবেলৰ সৰ্বোচ্চ আকাঙ্খিত প্ৰস্থ" -#: gtk/gtklabel.c:737 +#: gtk/gtklabel.c:761 msgid "Track visited links" msgstr "প্ৰদৰ্শন কৰা সংযোগক ট্ৰেক কৰক" -#: gtk/gtklabel.c:738 +#: gtk/gtklabel.c:762 msgid "Whether visited links should be tracked" msgstr "দৰ্শন কৰা সংযোগক ট্ৰেক কৰিব লাগে নে নাই" -#: gtk/gtklabel.c:859 +#: gtk/gtklabel.c:883 msgid "Whether to select the contents of a selectable label when it is focused" msgstr "সৰ্বমোট হলো" -#: gtk/gtklayout.c:617 gtk/gtkviewport.c:106 +#: gtk/gtklayout.c:581 gtk/gtkviewport.c:134 msgid "Horizontal adjustment" msgstr "পথালি সমন্বয়" -#: gtk/gtklayout.c:618 gtk/gtkscrolledwindow.c:219 +#: gtk/gtklayout.c:582 gtk/gtkscrolledwindow.c:236 msgid "The GtkAdjustment for the horizontal position" msgstr "পথালি অবস্থানেৰ বাবে GtkAdjustment" -#: gtk/gtklayout.c:625 gtk/gtkviewport.c:114 +#: gtk/gtklayout.c:589 gtk/gtkviewport.c:142 msgid "Vertical adjustment" msgstr "উলম্ব সমন্বয়" -#: gtk/gtklayout.c:626 gtk/gtkscrolledwindow.c:226 +#: gtk/gtklayout.c:590 gtk/gtkscrolledwindow.c:243 msgid "The GtkAdjustment for the vertical position" msgstr "উলম্ব অবস্থানেৰ বাবে GtkAdjustment" -#: gtk/gtklayout.c:634 +#: gtk/gtklayout.c:598 msgid "The width of the layout" msgstr "নকশাৰ (Layout) প্ৰস্থ" -#: gtk/gtklayout.c:643 +#: gtk/gtklayout.c:607 msgid "The height of the layout" msgstr "নকশাৰ (Layout) উচ্চতা" @@ -3442,183 +3337,183 @@ msgid "Whether this link has been visited." msgstr "কামটো দৃশ্যমান নে নাই।" # -#: gtk/gtkmenu.c:502 +#: gtk/gtkmenu.c:509 msgid "The currently selected menu item" msgstr "বৰ্তমানে বাছাইকৃত ফাইলনাম" # -#: gtk/gtkmenu.c:517 +#: gtk/gtkmenu.c:524 msgid "The accel group holding accelerators for the menu" msgstr "এই লেবেলৰ নেমোনিক গতিবৰ্ধক কী (Key)" -#: gtk/gtkmenu.c:531 gtk/gtkmenuitem.c:290 +#: gtk/gtkmenu.c:538 gtk/gtkmenuitem.c:290 msgid "Accel Path" msgstr "Accel Path" -#: gtk/gtkmenu.c:532 +#: gtk/gtkmenu.c:539 msgid "An accel path used to conveniently construct accel paths of child items" msgstr "" "An accel path used to conveniently construct accel paths of child items" # -#: gtk/gtkmenu.c:548 +#: gtk/gtkmenu.c:555 msgid "Attach Widget" msgstr "অতিৰিক্ত উইজেট" # -#: gtk/gtkmenu.c:549 +#: gtk/gtkmenu.c:556 msgid "The widget the menu is attached to" msgstr "মেনুৰ বস্তুতে টিক দেয়া হৈছে নে নাই" -#: gtk/gtkmenu.c:557 +#: gtk/gtkmenu.c:564 msgid "" "A title that may be displayed by the window manager when this menu is torn-" "off" msgstr "" "এই মেনুটি বিচ্ছিন্ন (???) থাকলে উইন্ডো ম্যানেজাৰ যি শিৰোনামটি প্ৰদৰ্শন কৰতে পাৰবে" -#: gtk/gtkmenu.c:571 +#: gtk/gtkmenu.c:578 msgid "Tearoff State" msgstr "টিয়াৰ-অফ অবস্থা" -#: gtk/gtkmenu.c:572 +#: gtk/gtkmenu.c:579 msgid "A boolean that indicates whether the menu is torn-off" msgstr "এটা বুলিয়ান মান যাৰ নিৰ্দেশ কৰি যি মেনুটি বিচ্ছিন্ন নে নাই (Torn-off)" # -#: gtk/gtkmenu.c:586 +#: gtk/gtkmenu.c:593 msgid "Monitor" msgstr "মণিটৰ" -#: gtk/gtkmenu.c:587 +#: gtk/gtkmenu.c:594 msgid "The monitor the menu will be popped up on" msgstr "দেখুৱাব লগা তালিকা যি মণিটৰত ওলাব" -#: gtk/gtkmenu.c:593 +#: gtk/gtkmenu.c:600 msgid "Vertical Padding" msgstr "উলম্ব পেডিং (Padding)" -#: gtk/gtkmenu.c:594 +#: gtk/gtkmenu.c:601 msgid "Extra space at the top and bottom of the menu" msgstr "উইজেটেৰ ওপৰত আৰু নীচে যতগুলো স্থান যোগ কৰা হ'ব" -#: gtk/gtkmenu.c:616 +#: gtk/gtkmenu.c:623 msgid "Reserve Toggle Size" msgstr "টগলৰ আকাৰ ওভটাওক" -#: gtk/gtkmenu.c:617 +#: gtk/gtkmenu.c:624 msgid "" "A boolean that indicates whether the menu reserves space for toggles and " "icons" msgstr "" "এটা বুলিয়ান মান যাৰ নিৰ্দেশত টগল আৰু আইকণৰ কাৰণে তালিকা সংৰক্ষিত কৰা হ'ব নে নাই" -#: gtk/gtkmenu.c:623 +#: gtk/gtkmenu.c:630 msgid "Horizontal Padding" msgstr "স্থান নষ্ট কৰা (Padding)" -#: gtk/gtkmenu.c:624 +#: gtk/gtkmenu.c:631 msgid "Extra space at the left and right edges of the menu" msgstr "সৰ্বমোট" -#: gtk/gtkmenu.c:632 +#: gtk/gtkmenu.c:639 msgid "Vertical Offset" msgstr "উলম্ব অফসেট" -#: gtk/gtkmenu.c:633 +#: gtk/gtkmenu.c:640 msgid "" "When the menu is a submenu, position it this number of pixels offset " "vertically" msgstr "এটি যদি সাবমেনু হয়, তেন্তে একে এই সংখ্যক পিক্সেল উলম্ব অফসেটে স্থাপন কৰো" -#: gtk/gtkmenu.c:641 +#: gtk/gtkmenu.c:648 msgid "Horizontal Offset" msgstr "পথালি অফসেট" -#: gtk/gtkmenu.c:642 +#: gtk/gtkmenu.c:649 msgid "" "When the menu is a submenu, position it this number of pixels offset " "horizontally" msgstr "এটি যদি সাবমেনু হয়, তেন্তে একে এই সংখ্যক পিক্সেল পথালি অফসেটে স্থাপন কৰো" -#: gtk/gtkmenu.c:650 +#: gtk/gtkmenu.c:657 msgid "Double Arrows" msgstr "Double Arrows" -#: gtk/gtkmenu.c:651 +#: gtk/gtkmenu.c:658 msgid "When scrolling, always show both arrows." msgstr "When scrolling, always show both arrows." # -#: gtk/gtkmenu.c:664 +#: gtk/gtkmenu.c:671 msgid "Arrow Placement" msgstr "এক্স অক্ষ বৰাবৰ তীৰচিহ্ন সৰানো" -#: gtk/gtkmenu.c:665 +#: gtk/gtkmenu.c:672 msgid "Indicates where scroll arrows should be placed" msgstr "Indicates where scroll arrows should be placed" -#: gtk/gtkmenu.c:673 +#: gtk/gtkmenu.c:680 msgid "Left Attach" msgstr "Left Attach" -#: gtk/gtkmenu.c:674 gtk/gtktable.c:174 +#: gtk/gtkmenu.c:681 gtk/gtktable.c:174 msgid "The column number to attach the left side of the child to" msgstr "The column number to attach the left side of the child to" -#: gtk/gtkmenu.c:681 +#: gtk/gtkmenu.c:688 msgid "Right Attach" msgstr "Right Attach" -#: gtk/gtkmenu.c:682 +#: gtk/gtkmenu.c:689 msgid "The column number to attach the right side of the child to" msgstr "The column number to attach the right side of the child to" -#: gtk/gtkmenu.c:689 +#: gtk/gtkmenu.c:696 msgid "Top Attach" msgstr "ঊৰ্ধ্ব সংযুক্তি" -#: gtk/gtkmenu.c:690 +#: gtk/gtkmenu.c:697 msgid "The row number to attach the top of the child to" msgstr "চাইল্ডৰ ওপৰতেৰ অংশে যি শাৰী নম্বৰ যুক্ত হ'ব" -#: gtk/gtkmenu.c:697 +#: gtk/gtkmenu.c:704 msgid "Bottom Attach" msgstr "নিম্ন সংযুক্তি" -#: gtk/gtkmenu.c:698 gtk/gtktable.c:195 +#: gtk/gtkmenu.c:705 gtk/gtktable.c:195 msgid "The row number to attach the bottom of the child to" msgstr "চাইল্ডৰ তলৰ অংশে যি শাৰী নম্বৰ যুক্ত হ'ব" -#: gtk/gtkmenu.c:712 +#: gtk/gtkmenu.c:719 msgid "Arbitrary constant to scale down the size of the scroll arrow" msgstr "Arbitrary constant to scale down the size of the scroll arrow" -#: gtk/gtkmenu.c:799 +#: gtk/gtkmenu.c:806 msgid "Can change accelerators" msgstr "চটপট কী (Key) পৰিবৰ্তন কৰতে পাৰে" -#: gtk/gtkmenu.c:800 +#: gtk/gtkmenu.c:807 msgid "" "Whether menu accelerators can be changed by pressing a key over the menu item" msgstr "মেনু আইটেমেৰ ওপৰ চাপ দিয়ে চটপট কী (Key) পৰিবৰ্তন কৰা যাব নে নাই" -#: gtk/gtkmenu.c:805 +#: gtk/gtkmenu.c:812 msgid "Delay before submenus appear" msgstr "সাবমেনু দেখা যাওয়াৰ পূৰ্বে বিলম্ব" -#: gtk/gtkmenu.c:806 +#: gtk/gtkmenu.c:813 msgid "" "Minimum time the pointer must stay over a menu item before the submenu appear" msgstr "" "সাবমেনু দেখা যাওয়াৰ পূৰ্বে সৰ্বনিম্ন যি সময় যাবত্‍ পইন্টাৰটি মেনুতে প্ৰদৰ্শিত সাবমেনুৰ " "নামেৰ ওপৰ থাকবে" -#: gtk/gtkmenu.c:813 +#: gtk/gtkmenu.c:820 msgid "Delay before hiding a submenu" msgstr "সাবমেনু আড়াল কৰাৰ পূৰ্বে বিলম্ব" -#: gtk/gtkmenu.c:814 +#: gtk/gtkmenu.c:821 msgid "" "The time before hiding a submenu when the pointer is moving towards the " "submenu" @@ -3644,7 +3539,7 @@ msgstr "মেনুবাৰৰ চাইল্ড পেক তৰ দিক" msgid "Style of bevel around the menubar" msgstr "মেনুবাৰৰ চাৰদিকে বেভেলৰ ধৰন" -#: gtk/gtkmenubar.c:202 gtk/gtktoolbar.c:590 +#: gtk/gtkmenubar.c:202 gtk/gtktoolbar.c:535 msgid "Internal padding" msgstr "অভ্যন্তৰীণ পেডিং (Padding)" @@ -3702,76 +3597,76 @@ msgstr "অক্ষৰ হিচাপে প্ৰস্থ" msgid "The minimum desired width of the menu item in characters" msgstr "অক্ষৰ হিচাপে লেবেলৰ আকাঙ্খিত প্ৰস্থ" -#: gtk/gtkmenushell.c:379 +#: gtk/gtkmenushell.c:382 msgid "Take Focus" msgstr "ফোকাস নাও" -#: gtk/gtkmenushell.c:380 +#: gtk/gtkmenushell.c:383 msgid "A boolean that determines whether the menu grabs the keyboard focus" msgstr "এটা বুলিয়ান মান যাৰ নিৰ্দেশ কৰি যি মেনুটি কীবোৰ্ডেৰ ফ'কাচ নেয় নে নাই" -#: gtk/gtkmenutoolbutton.c:245 gtk/gtkoptionmenu.c:161 +#: gtk/gtkmenutoolbutton.c:243 msgid "Menu" msgstr "মেনু" -#: gtk/gtkmenutoolbutton.c:246 +#: gtk/gtkmenutoolbutton.c:244 msgid "The dropdown menu" msgstr "ড্ৰপ-ডাউন মেনু" -#: gtk/gtkmessagedialog.c:98 +#: gtk/gtkmessagedialog.c:145 msgid "Image/label border" msgstr "ছবি/লেবেল ইয়াৰ প্ৰান্ত" -#: gtk/gtkmessagedialog.c:99 +#: gtk/gtkmessagedialog.c:146 msgid "Width of border around the label and image in the message dialog" msgstr "মেসেজ ডায়ালগে লেবেল আৰু ছবিৰ চাৰপাশস্থ প্ৰান্তৰ প্ৰস্থ " -#: gtk/gtkmessagedialog.c:114 +#: gtk/gtkmessagedialog.c:161 msgid "Use separator" msgstr "বিভাজক ব্যৱহাৰ কৰো" -#: gtk/gtkmessagedialog.c:115 +#: gtk/gtkmessagedialog.c:162 msgid "" "Whether to put a separator between the message dialog's text and the buttons" msgstr "ডায়ালগেৰ টেক্সট আৰু বুটামৰ মধ্যবৰ্তী স্থানে কোন বিভাজক ব্যৱহাৰ কৰা হ'ব নে নাই" -#: gtk/gtkmessagedialog.c:136 +#: gtk/gtkmessagedialog.c:183 msgid "Message Buttons" msgstr "মেসেজ বুটাম" -#: gtk/gtkmessagedialog.c:137 +#: gtk/gtkmessagedialog.c:184 msgid "The buttons shown in the message dialog" msgstr "মেসেজ বুটামত প্ৰদৰ্শিত বুটাম" -#: gtk/gtkmessagedialog.c:154 +#: gtk/gtkmessagedialog.c:201 msgid "The primary text of the message dialog" msgstr "সৰ্বমোট বাৰ্তা" -#: gtk/gtkmessagedialog.c:169 +#: gtk/gtkmessagedialog.c:216 msgid "Use Markup" msgstr "মাৰ্কআপ" -#: gtk/gtkmessagedialog.c:170 +#: gtk/gtkmessagedialog.c:217 msgid "The primary text of the title includes Pango markup." msgstr "সৰ্বমোট." -#: gtk/gtkmessagedialog.c:184 +#: gtk/gtkmessagedialog.c:231 msgid "Secondary Text" msgstr "দ্বিতীয় Text" -#: gtk/gtkmessagedialog.c:185 +#: gtk/gtkmessagedialog.c:232 msgid "The secondary text of the message dialog" msgstr "সৰ্বমোট বাৰ্তা" -#: gtk/gtkmessagedialog.c:200 +#: gtk/gtkmessagedialog.c:247 msgid "Use Markup in secondary" msgstr "মাৰ্কআপ" -#: gtk/gtkmessagedialog.c:201 +#: gtk/gtkmessagedialog.c:248 msgid "The secondary text includes Pango markup." msgstr "The secondary text includes Pango markup." -#: gtk/gtkmessagedialog.c:216 +#: gtk/gtkmessagedialog.c:263 msgid "The image" msgstr "The image" @@ -3825,77 +3720,53 @@ msgstr "Are we showing a dialog" msgid "The screen where this window will be displayed." msgstr "এই উইন্ডোটি যি পৰ্দ্দায় প্ৰদৰ্শিত হ'ব" -#: gtk/gtknotebook.c:585 +#: gtk/gtknotebook.c:571 msgid "Page" msgstr "পৃষ্ঠা" -#: gtk/gtknotebook.c:586 +#: gtk/gtknotebook.c:572 msgid "The index of the current page" msgstr "বৰ্তমান পাতাৰ সূচী" -#: gtk/gtknotebook.c:594 +#: gtk/gtknotebook.c:580 msgid "Tab Position" msgstr "ট্যাবৰ অবস্থান" -#: gtk/gtknotebook.c:595 +#: gtk/gtknotebook.c:581 msgid "Which side of the notebook holds the tabs" msgstr "নোট বইয়েৰ কোন দিকটি ট্যাব ধাৰণ কৰি" -#: gtk/gtknotebook.c:602 -msgid "Tab Border" -msgstr "ট্যাবৰ প্ৰান্ত" - -#: gtk/gtknotebook.c:603 -msgid "Width of the border around the tab labels" -msgstr "ট্যাব লেবেলৰ প্ৰান্তৰ প্ৰস্থ" - -#: gtk/gtknotebook.c:611 -msgid "Horizontal Tab Border" -msgstr "ট্যাবৰ পথালি প্ৰান্ত" - -#: gtk/gtknotebook.c:612 -msgid "Width of the horizontal border of tab labels" -msgstr "ট্যাব লেবেলৰ পথালি প্ৰান্তৰ প্ৰস্থ" - -#: gtk/gtknotebook.c:620 -msgid "Vertical Tab Border" -msgstr "ট্যাবৰ উলম্ব প্ৰান্ত" - -#: gtk/gtknotebook.c:621 -msgid "Width of the vertical border of tab labels" -msgstr "ট্যাব লেবেলৰ উলম্ব প্ৰান্তৰ প্ৰস্থ" - -#: gtk/gtknotebook.c:629 +#: gtk/gtknotebook.c:588 msgid "Show Tabs" msgstr "ট্যাব প্ৰদৰ্শন কৰো" -#: gtk/gtknotebook.c:630 +#: gtk/gtknotebook.c:589 msgid "Whether tabs should be shown or not" msgstr "ট্যাব প্ৰদৰ্শন কৰা হ'ব নে নাই" -#: gtk/gtknotebook.c:636 +#: gtk/gtknotebook.c:595 msgid "Show Border" msgstr "প্ৰান্ত প্ৰদৰ্শন কৰো" -#: gtk/gtknotebook.c:637 +#: gtk/gtknotebook.c:596 msgid "Whether the border should be shown or not" msgstr "প্ৰান্ত প্ৰদৰ্শন কৰা হ'ব নে নাই" -#: gtk/gtknotebook.c:643 +#: gtk/gtknotebook.c:602 msgid "Scrollable" msgstr "স্ক্ৰল কৰাৰ যোগ্য" -#: gtk/gtknotebook.c:644 +#: gtk/gtknotebook.c:603 msgid "If TRUE, scroll arrows are added if there are too many tabs to fit" msgstr "" "ইয়াৰ মান সত্য (TRUE) হলে, ট্যাবৰ সংখ্যা যদি অত্যধিক হয় তেন্তে স্ক্ৰলযোগ্য তীৰচিহ্ন " "যোগ কৰা হ'ব" -#: gtk/gtknotebook.c:650 +#: gtk/gtknotebook.c:609 msgid "Enable Popup" msgstr "পপ আপ সক্ৰিয় কৰো" -#: gtk/gtknotebook.c:651 +#: gtk/gtknotebook.c:610 msgid "" "If TRUE, pressing the right mouse button on the notebook pops up a menu that " "you can use to go to a page" @@ -3903,224 +3774,192 @@ msgstr "" "যদি TRUE হয় তেন্তে নোটবইয়ে মাউছৰ ডান বুটাম চাপলে এটা তালিকা দেখা যাব যিখানৰ " "পৰা অন্যান্য পৃষ্ঠায় যাওয়া যাব" -#: gtk/gtknotebook.c:658 -msgid "Whether tabs should have homogeneous sizes" -msgstr "সকল ট্যাবৰ আকাৰ একই হ'ব নে নাই" - -#: gtk/gtknotebook.c:664 -msgid "Group ID" -msgstr "দল" - -#: gtk/gtknotebook.c:665 -msgid "Group ID for tabs drag and drop" -msgstr "দল উল্লিখিত সময় অবধি" - -#: gtk/gtknotebook.c:681 gtk/gtkradioaction.c:128 gtk/gtkradiobutton.c:82 +#: gtk/gtknotebook.c:624 gtk/gtkradioaction.c:140 gtk/gtkradiobutton.c:159 #: gtk/gtkradiomenuitem.c:353 gtk/gtkradiotoolbutton.c:65 msgid "Group" msgstr "দল" -#: gtk/gtknotebook.c:682 +#: gtk/gtknotebook.c:625 msgid "Group for tabs drag and drop" msgstr "দল উল্লিখিত সময় অবধি" -#: gtk/gtknotebook.c:688 +#: gtk/gtknotebook.c:631 msgid "Tab label" msgstr "ট্যাবৰ লেবেল" -#: gtk/gtknotebook.c:689 +#: gtk/gtknotebook.c:632 msgid "The string displayed on the child's tab label" msgstr "চাইল্ডৰ ট্যাব লেবেলে প্ৰদৰ্শিত পংক্তি" -#: gtk/gtknotebook.c:695 +#: gtk/gtknotebook.c:638 msgid "Menu label" msgstr "মেনুৰ লেবেল" -#: gtk/gtknotebook.c:696 +#: gtk/gtknotebook.c:639 msgid "The string displayed in the child's menu entry" msgstr "চাইল্ডৰ তালিকা এন্ট্ৰিতে প্ৰদৰ্শিত পংক্তি" -#: gtk/gtknotebook.c:709 +#: gtk/gtknotebook.c:652 msgid "Tab expand" msgstr "ট্যাব প্ৰসাৰণ" -#: gtk/gtknotebook.c:710 +#: gtk/gtknotebook.c:653 msgid "Whether to expand the child's tab or not" msgstr "চাইল্ডৰ ট্যাব প্ৰসাৰিত কৰা হ'ব নে নাই" -#: gtk/gtknotebook.c:716 +#: gtk/gtknotebook.c:659 msgid "Tab fill" msgstr "ট্যাব পূৰণ" -#: gtk/gtknotebook.c:717 +#: gtk/gtknotebook.c:660 msgid "Whether the child's tab should fill the allocated area or not" msgstr "চাইল্ডৰ ট্যাব বৰাদ্দকৃত ক্ষেত্ৰ পূৰণ কৰিব নে নাই" -#: gtk/gtknotebook.c:723 +#: gtk/gtknotebook.c:666 msgid "Tab pack type" msgstr "ট্যাব আটানোৰ (Pack) ধৰন" -#: gtk/gtknotebook.c:730 +#: gtk/gtknotebook.c:673 msgid "Tab reorderable" msgstr "Tab reorderable" -#: gtk/gtknotebook.c:731 +#: gtk/gtknotebook.c:674 msgid "Whether the tab is reorderable by user action or not" msgstr "হলো" -#: gtk/gtknotebook.c:737 +#: gtk/gtknotebook.c:680 msgid "Tab detachable" msgstr "Tab detachable" -#: gtk/gtknotebook.c:738 +#: gtk/gtknotebook.c:681 msgid "Whether the tab is detachable" msgstr "হলো" -#: gtk/gtknotebook.c:753 gtk/gtkscrollbar.c:81 +#: gtk/gtknotebook.c:696 gtk/gtkscrollbar.c:81 msgid "Secondary backward stepper" msgstr "পশ্চাত্‍গামী গৌণ স্টেপাৰ" -#: gtk/gtknotebook.c:754 +#: gtk/gtknotebook.c:697 msgid "" "Display a second backward arrow button on the opposite end of the tab area" msgstr "" "ট্যাব অংশৰ বিপৰীত প্ৰান্তে এটা পশ্চাত্‍গামী গৌণ স্টেপাৰ তীৰচিহ্নধাৰী বুটাম প্ৰদৰ্শন কৰো" -#: gtk/gtknotebook.c:769 gtk/gtkscrollbar.c:88 +#: gtk/gtknotebook.c:712 gtk/gtkscrollbar.c:88 msgid "Secondary forward stepper" msgstr "সম্মুখগামী গৌণ স্টেপাৰ" -#: gtk/gtknotebook.c:770 +#: gtk/gtknotebook.c:713 msgid "" "Display a second forward arrow button on the opposite end of the tab area" msgstr "" "ট্যাব অংশৰ বিপৰীত প্ৰান্তে এটা সম্মুখগামী গৌণ স্টেপাৰ তীৰচিহ্নধাৰী বুটাম প্ৰদৰ্শন কৰো" -#: gtk/gtknotebook.c:784 gtk/gtkscrollbar.c:67 +#: gtk/gtknotebook.c:727 gtk/gtkscrollbar.c:67 msgid "Backward stepper" msgstr "পশ্চাত্‍গামী স্টেপাৰ" -#: gtk/gtknotebook.c:785 gtk/gtkscrollbar.c:68 +#: gtk/gtknotebook.c:728 gtk/gtkscrollbar.c:68 msgid "Display the standard backward arrow button" msgstr "পশ্চাত্‍গামী প্ৰমিত তীৰচিহ্নধাৰী বুটাম প্ৰদৰ্শন কৰো" -#: gtk/gtknotebook.c:799 gtk/gtkscrollbar.c:74 +#: gtk/gtknotebook.c:742 gtk/gtkscrollbar.c:74 msgid "Forward stepper" msgstr "সম্মুখগামী স্টেপাৰ" -#: gtk/gtknotebook.c:800 gtk/gtkscrollbar.c:75 +#: gtk/gtknotebook.c:743 gtk/gtkscrollbar.c:75 msgid "Display the standard forward arrow button" msgstr "সম্মুখগামী প্ৰমিত তীৰচিহ্নধাৰী বুটাম প্ৰদৰ্শন কৰো" -#: gtk/gtknotebook.c:814 +#: gtk/gtknotebook.c:757 msgid "Tab overlap" msgstr "Tab overlap" -#: gtk/gtknotebook.c:815 +#: gtk/gtknotebook.c:758 msgid "Size of tab overlap area" msgstr "মাপ সৰ্বমোট" -#: gtk/gtknotebook.c:830 +#: gtk/gtknotebook.c:773 msgid "Tab curvature" msgstr "Tab curvature" -#: gtk/gtknotebook.c:831 +#: gtk/gtknotebook.c:774 msgid "Size of tab curvature" msgstr "মাপ সৰ্বমোট" # -#: gtk/gtknotebook.c:847 +#: gtk/gtknotebook.c:790 msgid "Arrow spacing" msgstr "প্ৰতি শাৰী স্থান তৰ সংখ্যা" # -#: gtk/gtknotebook.c:848 +#: gtk/gtknotebook.c:791 msgid "Scroll arrow spacing" msgstr "স্ক্ৰলবাৰে ৰিক্ত স্থানৰ সংখ্যা" -#: gtk/gtkobject.c:370 -msgid "User Data" -msgstr "ব্যৱহাৰকৰ্তাৰ ডাটা" - -#: gtk/gtkobject.c:371 -msgid "Anonymous User Data Pointer" -msgstr "Anonymous" - -#: gtk/gtkoptionmenu.c:162 -msgid "The menu of options" -msgstr "বিকল্প প্ৰদৰ্শনকাৰী মেনু" - -#: gtk/gtkoptionmenu.c:169 -msgid "Size of dropdown indicator" -msgstr "ড্ৰপডাউন নিৰ্দেশকেৰ আকাৰ" - -#: gtk/gtkoptionmenu.c:175 -msgid "Spacing around indicator" -msgstr "নিৰ্দেশকেৰ চাৰপাশে স্থান স্থাপন" - # -#: gtk/gtkorientable.c:75 +#: gtk/gtkorientable.c:64 msgid "The orientation of the orientable" msgstr "সৰ্বমোট" -#: gtk/gtkpaned.c:242 +#: gtk/gtkpaned.c:243 msgid "" "Position of paned separator in pixels (0 means all the way to the left/top)" msgstr "পিক্সেল হিচাপে পেন্‌ড বিভাজকেৰ অবস্থান (০ হলে ওপৰতে এবং বামপাৰ্শ্বে অবস্থিত)" -#: gtk/gtkpaned.c:251 +#: gtk/gtkpaned.c:252 msgid "Position Set" msgstr "অবস্থান সমাষ্টি" -#: gtk/gtkpaned.c:252 +#: gtk/gtkpaned.c:253 msgid "TRUE if the Position property should be used" msgstr "অবস্থানেৰ বৈশিষ্ট্য ব্যৱহাৰ কৰা হলে TRUE" -#: gtk/gtkpaned.c:258 +#: gtk/gtkpaned.c:259 msgid "Handle Size" msgstr "হাতলৰ (Handle) আকাৰ" -#: gtk/gtkpaned.c:259 +#: gtk/gtkpaned.c:260 msgid "Width of handle" msgstr "হাতলৰ প্ৰস্থ" -#: gtk/gtkpaned.c:275 +#: gtk/gtkpaned.c:276 msgid "Minimal Position" msgstr "ন্যুনতম অবস্থান" -#: gtk/gtkpaned.c:276 +#: gtk/gtkpaned.c:277 msgid "Smallest possible value for the \"position\" property" msgstr "\"অবস্থাসূচক\" বৈশিষ্ট্যিৰ সৰ্বনিম্ন মান" -#: gtk/gtkpaned.c:293 +#: gtk/gtkpaned.c:294 msgid "Maximal Position" msgstr "সৰ্বোচ্চ অবস্থান" -#: gtk/gtkpaned.c:294 +#: gtk/gtkpaned.c:295 msgid "Largest possible value for the \"position\" property" msgstr "\"অবস্থাসূচক\" বৈশিষ্ট্যিৰ সৰ্বোচ্চ মান" -#: gtk/gtkpaned.c:311 +#: gtk/gtkpaned.c:312 msgid "Resize" msgstr "আকাৰ পৰিবৰ্তন" -#: gtk/gtkpaned.c:312 +#: gtk/gtkpaned.c:313 msgid "If TRUE, the child expands and shrinks along with the paned widget" msgstr "" "ইয়াৰ মান সত্য (TRUE) হলে, পেন তৰ ভেতৰ অবস্থিত উইজেটেৰ সৈতে চাইল্ড উইজেটও " "প্ৰসাৰিত আৰু সংকুচিত হয়" -#: gtk/gtkpaned.c:327 +#: gtk/gtkpaned.c:328 msgid "Shrink" msgstr "সঙ্কোচন" -#: gtk/gtkpaned.c:328 +#: gtk/gtkpaned.c:329 msgid "If TRUE, the child can be made smaller than its requisition" msgstr "" "ইয়াৰ মান সত্য হলে (TRUE), চাইল্ড উইজেটেৰ আকাৰ ইয়াৰ প্ৰয়োজন অপেক্ষা ক্ষুদ্ৰতৰ কৰা যায়" # -#: gtk/gtkplug.c:171 gtk/gtkstatusicon.c:312 +#: gtk/gtkplug.c:171 gtk/gtkstatusicon.c:317 msgid "Embedded" msgstr "এমবেড কৰা" @@ -4137,93 +3976,86 @@ msgstr "Socket Window" msgid "The window of the socket the plug is embedded in" msgstr "হলো" -#: gtk/gtkpreview.c:102 -msgid "" -"Whether the preview widget should take up the entire space it is allocated" -msgstr "" -"প্ৰাকদৰ্শন উইজেটেৰ বাবে যি পৰিমাণ স্থান বৰাদ্দ কৰা হ'ব তাৰ সম্পূৰ্ণ অংশই ব্যৱহৃত হ'ব " -"নে নাই" - -#: gtk/gtkprinter.c:112 +#: gtk/gtkprinter.c:131 msgid "Name of the printer" msgstr "নাম সৰ্বমোট" -#: gtk/gtkprinter.c:118 +#: gtk/gtkprinter.c:137 msgid "Backend" msgstr "Backend" -#: gtk/gtkprinter.c:119 +#: gtk/gtkprinter.c:138 msgid "Backend for the printer" msgstr "উল্লিখিত সময় অবধি" -#: gtk/gtkprinter.c:125 +#: gtk/gtkprinter.c:144 msgid "Is Virtual" msgstr "Is Virtual" -#: gtk/gtkprinter.c:126 +#: gtk/gtkprinter.c:145 msgid "FALSE if this represents a real hardware printer" msgstr "FALSE if this represents a real hardware printer" -#: gtk/gtkprinter.c:132 +#: gtk/gtkprinter.c:151 msgid "Accepts PDF" msgstr "Accepts PDF" -#: gtk/gtkprinter.c:133 +#: gtk/gtkprinter.c:152 msgid "TRUE if this printer can accept PDF" msgstr "TRUE if this printer can accept PDF" -#: gtk/gtkprinter.c:139 +#: gtk/gtkprinter.c:158 msgid "Accepts PostScript" msgstr "Accepts PostScript" -#: gtk/gtkprinter.c:140 +#: gtk/gtkprinter.c:159 msgid "TRUE if this printer can accept PostScript" msgstr "TRUE if this printer can accept PostScript" -#: gtk/gtkprinter.c:146 +#: gtk/gtkprinter.c:165 msgid "State Message" msgstr "State Message" -#: gtk/gtkprinter.c:147 +#: gtk/gtkprinter.c:166 msgid "String giving the current state of the printer" msgstr "String giving the current state of the printer" -#: gtk/gtkprinter.c:153 +#: gtk/gtkprinter.c:172 msgid "Location" msgstr "স্থান" -#: gtk/gtkprinter.c:154 +#: gtk/gtkprinter.c:173 msgid "The location of the printer" msgstr "সৰ্বমোট" -#: gtk/gtkprinter.c:161 +#: gtk/gtkprinter.c:180 msgid "The icon name to use for the printer" msgstr "উল্লিখিত সময় অবধি" -#: gtk/gtkprinter.c:167 +#: gtk/gtkprinter.c:186 msgid "Job Count" msgstr "গণনা" -#: gtk/gtkprinter.c:168 +#: gtk/gtkprinter.c:187 msgid "Number of jobs queued in the printer" msgstr "সৰ্বমোট" # -#: gtk/gtkprinter.c:186 +#: gtk/gtkprinter.c:205 msgid "Paused Printer" msgstr "Selected" # -#: gtk/gtkprinter.c:187 +#: gtk/gtkprinter.c:206 msgid "TRUE if this printer is paused" msgstr "অবস্থানেৰ বৈশিষ্ট্য ব্যৱহাৰ কৰা হলে TRUE" # -#: gtk/gtkprinter.c:200 +#: gtk/gtkprinter.c:219 msgid "Accepting Jobs" msgstr "ফোকাস অনুমোদন কৰো" -#: gtk/gtkprinter.c:201 +#: gtk/gtkprinter.c:220 msgid "TRUE if this printer is accepting new jobs" msgstr "TRUE if this printer is accepting new jobs" @@ -4393,7 +4225,8 @@ msgid "Has Selection" msgstr "নিৰ্বাচন আছে" #: gtk/gtkprintoperation.c:1297 -msgid "TRUE if a selecion exists." +#, fuzzy +msgid "TRUE if a selection exists." msgstr "TRUE যদি এটা নিৰ্বাচন আছে ।" #: gtk/gtkprintoperation.c:1312 gtk/gtkprintunixdialog.c:361 @@ -4463,69 +4296,28 @@ msgstr "টেক্সট প্ৰদৰ্শন কৰো" msgid "Whether the progress is shown as text." msgstr "হলো." -#: gtk/gtkprogressbar.c:119 -msgid "The GtkAdjustment connected to the progress bar (Deprecated)" -msgstr "প্ৰগ্ৰেছ বাৰৰ সৈতে যুক্ত GtkAdjustment (অনুমোদিত নয়)" - -#: gtk/gtkprogressbar.c:135 -msgid "Bar style" -msgstr "বাৰৰ ধৰন" - -#: gtk/gtkprogressbar.c:136 -msgid "Specifies the visual style of the bar in percentage mode (Deprecated)" -msgstr "শতকৰা হিসাবে বাৰ প্ৰদৰ্শনেৰ ধৰন (অনুমোদিত নয়)" - -#: gtk/gtkprogressbar.c:144 -msgid "Activity Step" -msgstr "সক্ৰিয়তা নিৰ্দেশক ধাপ" - -#: gtk/gtkprogressbar.c:145 -msgid "The increment used for each iteration in activity mode (Deprecated)" -msgstr "সক্ৰিয় অবস্থায় প্ৰতিটি ধাপেৰ বাবে যি পৰিমাণ বৃদ্ধি কৰা হ'ব (অনুমোদিত নয়)" - -#: gtk/gtkprogressbar.c:152 -msgid "Activity Blocks" -msgstr "সক্ৰিয়তা নিৰ্দেশক ব্লক" - -#: gtk/gtkprogressbar.c:153 -msgid "" -"The number of blocks which can fit in the progress bar area in activity mode " -"(Deprecated)" -msgstr "সক্ৰিয় অবস্থায় প্ৰগ্ৰেছ বাৰে যি সংখ্যক ব্লক ৰাখা যায় (অনুমোদিত নয়)" - -#: gtk/gtkprogressbar.c:160 -msgid "Discrete Blocks" -msgstr "বিচ্ছিন্ন ব্লক" - -#: gtk/gtkprogressbar.c:161 -msgid "" -"The number of discrete blocks in a progress bar (when shown in the discrete " -"style)" -msgstr "" -"প্ৰগ্ৰেছ বাৰে প্ৰদৰ্শিত বিচ্ছিন্ন ব্লকেৰ সংখ্যা (যখন বিচ্ছিন্ন অবস্থায় প্ৰদৰ্শন কৰা হয়)" - -#: gtk/gtkprogressbar.c:168 +#: gtk/gtkprogressbar.c:121 msgid "Fraction" msgstr "ভগ্নাংশ" -#: gtk/gtkprogressbar.c:169 +#: gtk/gtkprogressbar.c:122 msgid "The fraction of total work that has been completed" msgstr "পুৰো কামটাৰ যি ভগ্নাংশ সম্পূৰ্ণ হৈছে" -#: gtk/gtkprogressbar.c:176 +#: gtk/gtkprogressbar.c:129 msgid "Pulse Step" msgstr "স্পন্দন ধাপ" -#: gtk/gtkprogressbar.c:177 +#: gtk/gtkprogressbar.c:130 msgid "The fraction of total progress to move the bouncing block when pulsed" msgstr "" "মোট কামৰ যি ভগাংশ পৰিমাণ সম্পন্ন হলে স্পন্দনেৰ ফলে লাফাতে থাকা ব্লকটিকে সৰানো যাব " -#: gtk/gtkprogressbar.c:185 +#: gtk/gtkprogressbar.c:138 msgid "Text to be displayed in the progress bar" msgstr "প্ৰগ্ৰেছ বাৰে যি টেক্সট প্ৰদৰ্শন কৰা হ'ব" -#: gtk/gtkprogressbar.c:207 +#: gtk/gtkprogressbar.c:160 msgid "" "The preferred place to ellipsize the string, if the progress bar does not " "have enough room to display the entire string, if at all." @@ -4533,68 +4325,68 @@ msgstr "" "The preferred place to ellipsize the string, if the progress bar does not " "have enough room to display the entire string, if at all." -#: gtk/gtkprogressbar.c:214 +#: gtk/gtkprogressbar.c:167 msgid "XSpacing" msgstr "XSpacing" -#: gtk/gtkprogressbar.c:215 +#: gtk/gtkprogressbar.c:168 msgid "Extra spacing applied to the width of a progress bar." msgstr "প্ৰস্থ সৰ্বমোট." -#: gtk/gtkprogressbar.c:220 +#: gtk/gtkprogressbar.c:173 msgid "YSpacing" msgstr "YSpacing" # -#: gtk/gtkprogressbar.c:221 +#: gtk/gtkprogressbar.c:174 msgid "Extra spacing applied to the height of a progress bar." msgstr "প্ৰস্থ সৰ্বমোট." # -#: gtk/gtkprogressbar.c:234 +#: gtk/gtkprogressbar.c:187 msgid "Min horizontal bar width" msgstr "পথালি বিভাজকেৰ প্ৰস্থ" # -#: gtk/gtkprogressbar.c:235 +#: gtk/gtkprogressbar.c:188 msgid "The minimum horizontal width of the progress bar" msgstr "লেবেলৰ পথালি সংৰেখন" # -#: gtk/gtkprogressbar.c:247 +#: gtk/gtkprogressbar.c:200 msgid "Min horizontal bar height" msgstr "পথালি সংৰেখন" # -#: gtk/gtkprogressbar.c:248 +#: gtk/gtkprogressbar.c:201 msgid "Minimum horizontal height of the progress bar" msgstr "প্ৰগ্ৰেছবাৰৰ মান" # -#: gtk/gtkprogressbar.c:260 +#: gtk/gtkprogressbar.c:213 msgid "Min vertical bar width" msgstr "উলম্ব বিভাজকেৰ প্ৰস্থ" # -#: gtk/gtkprogressbar.c:261 +#: gtk/gtkprogressbar.c:214 msgid "The minimum vertical width of the progress bar" msgstr "প্ৰগ্ৰেছবাৰে যি টেক্সট প্ৰদৰ্শন কৰা হ'ব" # -#: gtk/gtkprogressbar.c:273 +#: gtk/gtkprogressbar.c:226 msgid "Min vertical bar height" msgstr "চাইল্ডৰ সৰ্বনিম্ন উচ্চতা" # -#: gtk/gtkprogressbar.c:274 +#: gtk/gtkprogressbar.c:227 msgid "The minimum vertical height of the progress bar" msgstr "প্ৰগ্ৰেছবাৰৰ মান" -#: gtk/gtkradioaction.c:111 +#: gtk/gtkradioaction.c:123 msgid "The value" msgstr "মান" -#: gtk/gtkradioaction.c:112 +#: gtk/gtkradioaction.c:124 msgid "" "The value returned by gtk_radio_action_get_current_value() when this action " "is the current action of its group." @@ -4602,21 +4394,21 @@ msgstr "" "এই অ্যাকশনটি এই অ্যাকশন গ্ৰুপেৰ বৰ্তমান অ্যাকশন হলে " "gtk_radio_action_get_current_value() কৰ্তৃক উত্‍পন্ন মান।" -#: gtk/gtkradioaction.c:129 +#: gtk/gtkradioaction.c:141 msgid "The radio action whose group this action belongs to." msgstr "এই কাম যি ৰেডিও অ্যাকশন গ্ৰুপেৰ অংশ" -#: gtk/gtkradioaction.c:144 +#: gtk/gtkradioaction.c:156 msgid "The current value" msgstr "The current value" -#: gtk/gtkradioaction.c:145 +#: gtk/gtkradioaction.c:157 msgid "" "The value property of the currently active member of the group to which this " "action belongs." msgstr "সৰ্বমোট সৰ্বমোট." -#: gtk/gtkradiobutton.c:83 +#: gtk/gtkradiobutton.c:160 msgid "The radio button whose group this widget belongs to." msgstr "এই উইজেটটি যি গ্ৰুপেৰ অংশ উক্ত গ্ৰুপেৰ ৰেডিও বুটাম" @@ -4629,125 +4421,125 @@ msgstr "The radio menu item whose group this widget belongs to." msgid "The radio tool button whose group this button belongs to." msgstr "এই উইজেটটি যি গ্ৰুপেৰ অংশ উক্ত গ্ৰুপেৰ ৰেডিও বুটাম" -#: gtk/gtkrange.c:358 +#: gtk/gtkrange.c:385 msgid "Update policy" msgstr "আপডেট কৰাৰ নীতি" -#: gtk/gtkrange.c:359 +#: gtk/gtkrange.c:386 msgid "How the range should be updated on the screen" msgstr "পৰ্দ্দায় যিভাবে সীমাটি আপগ্ৰেড কৰা হ'ব" -#: gtk/gtkrange.c:368 +#: gtk/gtkrange.c:395 msgid "The GtkAdjustment that contains the current value of this range object" msgstr "যি GtkAdjustment এই সীমাসূচক অবজেক্টেৰ বৰ্তমান মান ধাৰণ কৰি" -#: gtk/gtkrange.c:375 +#: gtk/gtkrange.c:402 msgid "Inverted" msgstr "বিপৰীত" -#: gtk/gtkrange.c:376 +#: gtk/gtkrange.c:403 msgid "Invert direction slider moves to increase range value" msgstr "সীমা বৃদ্ধিৰ বাবে স্লাইডাৰটি বিপৰীত দিকে যায়" -#: gtk/gtkrange.c:383 +#: gtk/gtkrange.c:410 msgid "Lower stepper sensitivity" msgstr "নিম্নতৰ" -#: gtk/gtkrange.c:384 +#: gtk/gtkrange.c:411 msgid "" "The sensitivity policy for the stepper that points to the adjustment's lower " "side" msgstr "উল্লিখিত সময় অবধি" -#: gtk/gtkrange.c:392 +#: gtk/gtkrange.c:419 msgid "Upper stepper sensitivity" msgstr "ঊৰ্ধ্ব" -#: gtk/gtkrange.c:393 +#: gtk/gtkrange.c:420 msgid "" "The sensitivity policy for the stepper that points to the adjustment's upper " "side" msgstr "উল্লিখিত সময় অবধি" -#: gtk/gtkrange.c:410 +#: gtk/gtkrange.c:437 msgid "Show Fill Level" msgstr "ভৰাটকৰণ" -#: gtk/gtkrange.c:411 +#: gtk/gtkrange.c:438 msgid "Whether to display a fill level indicator graphics on trough." msgstr "সক্ৰিয়." -#: gtk/gtkrange.c:427 +#: gtk/gtkrange.c:454 msgid "Restrict to Fill Level" msgstr "ভৰাটকৰণ" -#: gtk/gtkrange.c:428 +#: gtk/gtkrange.c:455 msgid "Whether to restrict the upper boundary to the fill level." msgstr "Whether to restrict the upper boundary to the fill level." -#: gtk/gtkrange.c:443 +#: gtk/gtkrange.c:470 msgid "Fill Level" msgstr "ভৰাটকৰণ" -#: gtk/gtkrange.c:444 +#: gtk/gtkrange.c:471 msgid "The fill level." msgstr "The fill level." -#: gtk/gtkrange.c:452 +#: gtk/gtkrange.c:479 msgid "Slider Width" msgstr "স্লাইডাৰৰ প্ৰস্থ" -#: gtk/gtkrange.c:453 +#: gtk/gtkrange.c:480 msgid "Width of scrollbar or scale thumb" msgstr "স্ক্ৰলবাৰ বা স্কেল থাম্ব ইয়াৰ প্ৰস্থ" -#: gtk/gtkrange.c:460 +#: gtk/gtkrange.c:487 msgid "Trough Border" msgstr "দীৰ্ঘ বক্সৰ প্ৰান্ত" -#: gtk/gtkrange.c:461 +#: gtk/gtkrange.c:488 msgid "Spacing between thumb/steppers and outer trough bevel" msgstr "থাম্ব/স্টেপাৰ এবং বহিঃস্থ দীৰ্ঘ বক্সৰ ন্যায় বেভেলৰ মধ্যবৰ্তী ৰিক্ত স্থানৰ পৰিমাণ" -#: gtk/gtkrange.c:468 +#: gtk/gtkrange.c:495 msgid "Stepper Size" msgstr "স্টেপাৰৰ আকাৰ" -#: gtk/gtkrange.c:469 +#: gtk/gtkrange.c:496 msgid "Length of step buttons at ends" msgstr "প্ৰান্তীয় স্টেপ বুটামৰ দৈৰ্ঘ্য" -#: gtk/gtkrange.c:484 +#: gtk/gtkrange.c:511 msgid "Stepper Spacing" msgstr "স্টেপাৰ ইয়াৰ বাবে স্থান ইয়াৰ পৰিমাণ" -#: gtk/gtkrange.c:485 +#: gtk/gtkrange.c:512 msgid "Spacing between step buttons and thumb" msgstr "স্টেপ বুটাম আৰু থাম্ব ইয়াৰ মধ্যবৰ্তী স্থান ইয়াৰ পৰিমাণ" -#: gtk/gtkrange.c:492 +#: gtk/gtkrange.c:519 msgid "Arrow X Displacement" msgstr "এক্স অক্ষ বৰাবৰ তীৰচিহ্ন সৰানো" -#: gtk/gtkrange.c:493 +#: gtk/gtkrange.c:520 msgid "" "How far in the x direction to move the arrow when the button is depressed" msgstr "বুটাম চাপা অবস্থায় তীৰচিহ্নকে এক্স অক্ষ বৰাবৰ যি পৰিমাণ সৰানো হ'ব" -#: gtk/gtkrange.c:500 +#: gtk/gtkrange.c:527 msgid "Arrow Y Displacement" msgstr "ওয়াই অক্ষ বৰাবৰ তীৰচিহ্ন সৰানো" -#: gtk/gtkrange.c:501 +#: gtk/gtkrange.c:528 msgid "" "How far in the y direction to move the arrow when the button is depressed" msgstr "বুটাম চাপা অবস্থায় তীৰচিহ্নকে ওয়াই অক্ষ বৰাবৰ যি পৰিমাণ সৰানো হ'ব" -#: gtk/gtkrange.c:509 +#: gtk/gtkrange.c:536 msgid "Draw slider ACTIVE during drag" msgstr "অঙ্কন" -#: gtk/gtkrange.c:510 +#: gtk/gtkrange.c:537 msgid "" "With this option set to TRUE, sliders will be drawn ACTIVE and with shadow " "IN while they are dragged" @@ -4755,113 +4547,113 @@ msgstr "" "With this option set to TRUE, sliders will be drawn ACTIVE and with shadow " "IN while they are dragged" -#: gtk/gtkrange.c:524 +#: gtk/gtkrange.c:551 msgid "Trough Side Details" msgstr "বিৱৰণ" -#: gtk/gtkrange.c:525 +#: gtk/gtkrange.c:552 msgid "" "When TRUE, the parts of the trough on the two sides of the slider are drawn " "with different details" msgstr "সৰ্বমোট সক্ৰিয় সৰ্বমোট" -#: gtk/gtkrange.c:541 +#: gtk/gtkrange.c:568 msgid "Trough Under Steppers" msgstr "Trough Under Steppers" -#: gtk/gtkrange.c:542 +#: gtk/gtkrange.c:569 msgid "" "Whether to draw trough for full length of range or exclude the steppers and " "spacing" msgstr "উল্লিখিত সময় অবধি সৰ্বমোট" # -#: gtk/gtkrange.c:555 +#: gtk/gtkrange.c:582 msgid "Arrow scaling" msgstr "কাঁড়ৰ Scaling" -#: gtk/gtkrange.c:556 +#: gtk/gtkrange.c:583 msgid "Arrow scaling with regard to scroll button size" msgstr "Arrow scaling with regard to scroll button size" -#: gtk/gtkrecentaction.c:616 gtk/gtkrecentchoosermenu.c:227 +#: gtk/gtkrecentaction.c:633 gtk/gtkrecentchoosermenu.c:255 msgid "Show Numbers" msgstr "সংখ্যা" -#: gtk/gtkrecentaction.c:617 gtk/gtkrecentchoosermenu.c:228 +#: gtk/gtkrecentaction.c:634 gtk/gtkrecentchoosermenu.c:256 msgid "Whether the items should be displayed with a number" msgstr "Whether the items should be displayed with a number" -#: gtk/gtkrecentchooser.c:132 +#: gtk/gtkrecentchooser.c:149 msgid "Recent Manager" msgstr "মেনেজাৰ" -#: gtk/gtkrecentchooser.c:133 +#: gtk/gtkrecentchooser.c:150 msgid "The RecentManager object to use" msgstr "The RecentManager object to use" -#: gtk/gtkrecentchooser.c:147 +#: gtk/gtkrecentchooser.c:164 msgid "Show Private" msgstr "ব্যক্তিগত" -#: gtk/gtkrecentchooser.c:148 +#: gtk/gtkrecentchooser.c:165 msgid "Whether the private items should be displayed" msgstr "Whether the private items should be displayed" -#: gtk/gtkrecentchooser.c:161 +#: gtk/gtkrecentchooser.c:178 msgid "Show Tooltips" msgstr "টুলটিপ" -#: gtk/gtkrecentchooser.c:162 +#: gtk/gtkrecentchooser.c:179 msgid "Whether there should be a tooltip on the item" msgstr "সক্ৰিয়" -#: gtk/gtkrecentchooser.c:174 +#: gtk/gtkrecentchooser.c:191 msgid "Show Icons" msgstr "Show Icons" -#: gtk/gtkrecentchooser.c:175 +#: gtk/gtkrecentchooser.c:192 msgid "Whether there should be an icon near the item" msgstr "Whether there should be an icon near the item" -#: gtk/gtkrecentchooser.c:190 +#: gtk/gtkrecentchooser.c:207 msgid "Show Not Found" msgstr "Show Not Found" -#: gtk/gtkrecentchooser.c:191 +#: gtk/gtkrecentchooser.c:208 msgid "Whether the items pointing to unavailable resources should be displayed" msgstr "" "Whether the items pointing to unavailable resources should be displayed" -#: gtk/gtkrecentchooser.c:204 +#: gtk/gtkrecentchooser.c:221 msgid "Whether to allow multiple items to be selected" msgstr "Whether to allow multiple items to be selected" -#: gtk/gtkrecentchooser.c:217 +#: gtk/gtkrecentchooser.c:234 msgid "Local only" msgstr "স্থানীয়" -#: gtk/gtkrecentchooser.c:218 +#: gtk/gtkrecentchooser.c:235 msgid "Whether the selected resource(s) should be limited to local file: URIs" msgstr "ফাইল" -#: gtk/gtkrecentchooser.c:234 gtk/gtkrecentmanager.c:229 +#: gtk/gtkrecentchooser.c:251 gtk/gtkrecentmanager.c:229 msgid "Limit" msgstr "Limit" -#: gtk/gtkrecentchooser.c:235 +#: gtk/gtkrecentchooser.c:252 msgid "The maximum number of items to be displayed" msgstr "সৰ্বমোট" -#: gtk/gtkrecentchooser.c:249 +#: gtk/gtkrecentchooser.c:266 msgid "Sort Type" msgstr "ক্ৰমবিন্যাস ধৰন" -#: gtk/gtkrecentchooser.c:250 +#: gtk/gtkrecentchooser.c:267 msgid "The sorting order of the items displayed" msgstr "সৰ্বমোট" -#: gtk/gtkrecentchooser.c:265 +#: gtk/gtkrecentchooser.c:282 msgid "The current filter for selecting which resources are displayed" msgstr "উল্লিখিত সময় অবধি" @@ -4950,25 +4742,25 @@ msgstr "স্পেসিং তৰ মান" msgid "Space between value text and the slider/trough area" msgstr "মানসূচক টেক্সট আৰু স্লাইডাৰ/থ্ৰু অংশৰ মধ্যবৰ্তী স্থান তৰ সংখ্যা" -#: gtk/gtkscalebutton.c:207 +#: gtk/gtkscalebutton.c:223 msgid "The value of the scale" msgstr "সৰ্বমোট" -#: gtk/gtkscalebutton.c:217 +#: gtk/gtkscalebutton.c:233 msgid "The icon size" msgstr "The icon size" -#: gtk/gtkscalebutton.c:226 +#: gtk/gtkscalebutton.c:242 msgid "" "The GtkAdjustment that contains the current value of this scale button object" msgstr "ধাৰন কৰি সৰ্বমোট" # -#: gtk/gtkscalebutton.c:254 +#: gtk/gtkscalebutton.c:270 msgid "Icons" msgstr "আইকন" -#: gtk/gtkscalebutton.c:255 +#: gtk/gtkscalebutton.c:271 msgid "List of icon names" msgstr "তালিকা সৰ্বমোট" @@ -4998,97 +4790,97 @@ msgid "" "Display a second forward arrow button on the opposite end of the scrollbar" msgstr "প্ৰদৰ্শন দ্বিতীয় সক্ৰিয় সৰ্বমোট" -#: gtk/gtkscrolledwindow.c:218 gtk/gtktext.c:545 gtk/gtktreeview.c:572 +#: gtk/gtkscrolledwindow.c:235 gtk/gtktreeview.c:574 msgid "Horizontal Adjustment" msgstr "পথালি সমন্বয়" -#: gtk/gtkscrolledwindow.c:225 gtk/gtktext.c:553 gtk/gtktreeview.c:580 +#: gtk/gtkscrolledwindow.c:242 gtk/gtktreeview.c:582 msgid "Vertical Adjustment" msgstr "উলম্ব সমন্বয়" -#: gtk/gtkscrolledwindow.c:232 +#: gtk/gtkscrolledwindow.c:249 msgid "Horizontal Scrollbar Policy" msgstr "পথালি স্ক্ৰলবাৰৰ নীতি" -#: gtk/gtkscrolledwindow.c:233 +#: gtk/gtkscrolledwindow.c:250 msgid "When the horizontal scrollbar is displayed" msgstr "যখন পথালি স্ক্ৰলবাৰ প্ৰদৰ্শিত হ'ব" -#: gtk/gtkscrolledwindow.c:240 +#: gtk/gtkscrolledwindow.c:257 msgid "Vertical Scrollbar Policy" msgstr "উলম্ব স্ক্ৰলবাৰৰ নীতি" -#: gtk/gtkscrolledwindow.c:241 +#: gtk/gtkscrolledwindow.c:258 msgid "When the vertical scrollbar is displayed" msgstr "যখন উলম্ব স্ক্ৰলবাৰ প্ৰদৰ্শিত হ'ব" -#: gtk/gtkscrolledwindow.c:249 +#: gtk/gtkscrolledwindow.c:266 msgid "Window Placement" msgstr "উইন্ডো স্থাপন" -#: gtk/gtkscrolledwindow.c:250 +#: gtk/gtkscrolledwindow.c:267 msgid "" "Where the contents are located with respect to the scrollbars. This property " "only takes effect if \"window-placement-set\" is TRUE." msgstr "হলো." -#: gtk/gtkscrolledwindow.c:267 +#: gtk/gtkscrolledwindow.c:284 msgid "Window Placement Set" msgstr "Window Placement Set" -#: gtk/gtkscrolledwindow.c:268 +#: gtk/gtkscrolledwindow.c:285 msgid "" "Whether \"window-placement\" should be used to determine the location of the " "contents with respect to the scrollbars." msgstr "সৰ্বমোট." -#: gtk/gtkscrolledwindow.c:274 +#: gtk/gtkscrolledwindow.c:291 msgid "Shadow Type" msgstr "ছায়াৰ ধৰন" -#: gtk/gtkscrolledwindow.c:275 +#: gtk/gtkscrolledwindow.c:292 msgid "Style of bevel around the contents" msgstr "অভ্যন্তৰস্থ বস্তুৰ (Content) চাৰপাশে অবস্থিত বেভেলৰ ধৰন" -#: gtk/gtkscrolledwindow.c:289 +#: gtk/gtkscrolledwindow.c:306 msgid "Scrollbars within bevel" msgstr "Scrollbars within bevel" -#: gtk/gtkscrolledwindow.c:290 +#: gtk/gtkscrolledwindow.c:307 msgid "Place scrollbars within the scrolled window's bevel" msgstr "Place scrollbars within the scrolled window's bevel" -#: gtk/gtkscrolledwindow.c:296 +#: gtk/gtkscrolledwindow.c:313 msgid "Scrollbar spacing" msgstr "স্ক্ৰলবাৰে ৰিক্ত স্থানৰ সংখ্যা" -#: gtk/gtkscrolledwindow.c:297 +#: gtk/gtkscrolledwindow.c:314 msgid "Number of pixels between the scrollbars and the scrolled window" msgstr "স্ক্ৰলবাৰ এবং স্ক্ৰলবাৰৰ সৈতে সংযুক্ত উইন্ডোৰ মধ্যবৰ্তী পিক্ছেলৰসংখ্যা" -#: gtk/gtkscrolledwindow.c:312 +#: gtk/gtkscrolledwindow.c:329 msgid "Scrolled Window Placement" msgstr "Scrolled Window Placement" -#: gtk/gtkscrolledwindow.c:313 +#: gtk/gtkscrolledwindow.c:330 msgid "" "Where the contents of scrolled windows are located with respect to the " "scrollbars, if not overridden by the scrolled window's own placement." msgstr "সৰ্বমোট." -#: gtk/gtkseparatortoolitem.c:105 +#: gtk/gtkseparatortoolitem.c:125 msgid "Draw" msgstr "অঙ্কন" -#: gtk/gtkseparatortoolitem.c:106 +#: gtk/gtkseparatortoolitem.c:126 msgid "Whether the separator is drawn, or just blank" msgstr "বিভাজকটি আঁকা হৈছে নাকি ৰিক্ত" -#: gtk/gtksettings.c:224 +#: gtk/gtksettings.c:225 msgid "Double Click Time" msgstr "দুইবাৰ ক্লিক কৰতে ব্যতীত সময়" -#: gtk/gtksettings.c:225 +#: gtk/gtksettings.c:226 msgid "" "Maximum time allowed between two clicks for them to be considered a double " "click (in milliseconds)" @@ -5096,11 +4888,11 @@ msgstr "" "সৰ্বোচ্চ যি সময়েৰ ভেতৰ পৰপৰ দুইবাৰ ক্লিক কৰলে তা জোড়া ক্লিক হিচাপে গণ্য হ'ব " "(মিলিসেকেন্ডে)" -#: gtk/gtksettings.c:232 +#: gtk/gtksettings.c:233 msgid "Double Click Distance" msgstr "জোড়া ক্লিকেৰ সময়েৰ ব্যৱধান" -#: gtk/gtksettings.c:233 +#: gtk/gtksettings.c:234 msgid "" "Maximum distance allowed between two clicks for them to be considered a " "double click (in pixels)" @@ -5108,35 +4900,35 @@ msgstr "" "সৰ্বোচ্চ যি সময়েৰ ভেতৰ পৰপৰ দুইবাৰ ক্লিক কৰলে তা জোড়া ক্লিক হিচাপে গণ্য হ'ব " "(পিক্সেল হিসেবে)" -#: gtk/gtksettings.c:249 +#: gtk/gtksettings.c:250 msgid "Cursor Blink" msgstr "কাৰ্ছাৰৰ " -#: gtk/gtksettings.c:250 +#: gtk/gtksettings.c:251 msgid "Whether the cursor should blink" msgstr "কাৰ্ছাৰ ঝলকানো হ'ব কি না" -#: gtk/gtksettings.c:257 +#: gtk/gtksettings.c:258 msgid "Cursor Blink Time" msgstr "কাৰ্ছাৰ ৰ সময়" -#: gtk/gtksettings.c:258 +#: gtk/gtksettings.c:259 msgid "Length of the cursor blink cycle, in milliseconds" msgstr "কাৰ্ছাৰ ৰ সময়কালৰ দৈৰ্ঘ্য, মিলিসেকেন্ডে ব্যক্ত " -#: gtk/gtksettings.c:277 +#: gtk/gtksettings.c:278 msgid "Cursor Blink Timeout" msgstr "Cursor Blink Timeout" -#: gtk/gtksettings.c:278 +#: gtk/gtksettings.c:279 msgid "Time after which the cursor stops blinking, in seconds" msgstr "সময় পৰে সেকেন্ড" -#: gtk/gtksettings.c:285 +#: gtk/gtksettings.c:286 msgid "Split Cursor" msgstr "বিভক্ত কাৰ্ছাৰ" -#: gtk/gtksettings.c:286 +#: gtk/gtksettings.c:287 msgid "" "Whether two cursors should be displayed for mixed left-to-right and right-to-" "left text" @@ -5144,159 +4936,159 @@ msgstr "" "বাম-থেকে-ডান এবং ডান-থেকে-বাম এধৰনেৰ টেক্সটৰ মিশ্ৰণ প্ৰদৰ্শনেৰ সময় দুটি কাৰ্ছাৰ " "ব্যৱহাৰ কৰা হ'ব নে নাই" -#: gtk/gtksettings.c:293 +#: gtk/gtksettings.c:294 msgid "Theme Name" msgstr "থিমেৰ নাম" -#: gtk/gtksettings.c:294 +#: gtk/gtksettings.c:295 msgid "Name of theme RC file to load" msgstr "যি থিম আৰসি (RC) ফাইলটি পড়া হ'ব" -#: gtk/gtksettings.c:302 +#: gtk/gtksettings.c:303 msgid "Icon Theme Name" msgstr "আইকন থিমেৰ নাম" -#: gtk/gtksettings.c:303 +#: gtk/gtksettings.c:304 msgid "Name of icon theme to use" msgstr "যি আইকন থিম ব্যৱহাৰ কৰা হ'ব তাৰ নাম" -#: gtk/gtksettings.c:311 +#: gtk/gtksettings.c:312 msgid "Fallback Icon Theme Name" msgstr "আইকন নাম" -#: gtk/gtksettings.c:312 +#: gtk/gtksettings.c:313 msgid "Name of a icon theme to fall back to" msgstr "নাম সৰ্বমোট" -#: gtk/gtksettings.c:320 +#: gtk/gtksettings.c:321 msgid "Key Theme Name" msgstr "মূল (Key) থিমেৰ নাম" -#: gtk/gtksettings.c:321 +#: gtk/gtksettings.c:322 msgid "Name of key theme RC file to load" msgstr "যি মূল থিম আৰসি ফাইল লোড কৰা হ'ব তাৰ নাম" -#: gtk/gtksettings.c:329 +#: gtk/gtksettings.c:330 msgid "Menu bar accelerator" msgstr "মেনু বাৰৰ চটপট কী (Key)" -#: gtk/gtksettings.c:330 +#: gtk/gtksettings.c:331 msgid "Keybinding to activate the menu bar" msgstr "যি সকল কী (Key) সমষ্টি মেনুবাৰকে সক্ৰিয় কৰি" -#: gtk/gtksettings.c:338 +#: gtk/gtksettings.c:339 msgid "Drag threshold" msgstr "টেনে আনাৰ সৰ্বোচ্চ সীমা" -#: gtk/gtksettings.c:339 +#: gtk/gtksettings.c:340 msgid "Number of pixels the cursor can move before dragging" msgstr "টেনে নেওয়াৰ পূৰ্বে কাৰ্ছাৰটি যি সংখ্যক পিক্সেল নড়তে পাৰে" -#: gtk/gtksettings.c:347 +#: gtk/gtksettings.c:348 msgid "Font Name" msgstr "ফন্টৰ নাম" -#: gtk/gtksettings.c:348 +#: gtk/gtksettings.c:349 msgid "Name of default font to use" msgstr "যি অবিকল্পিত ফন্টটি ব্যৱহাৰ কৰা হ'ব তাৰ নাম" -#: gtk/gtksettings.c:370 +#: gtk/gtksettings.c:371 msgid "Icon Sizes" msgstr "আইকনেৰ আয়তন" -#: gtk/gtksettings.c:371 +#: gtk/gtksettings.c:372 msgid "List of icon sizes (gtk-menu=16,16:gtk-button=20,20..." msgstr "আইকনেৰ আকাৰৰ তালিকা (gtk-menu= ১৬, ১৬:gtk-button=২০,২০..." -#: gtk/gtksettings.c:379 +#: gtk/gtksettings.c:380 msgid "GTK Modules" msgstr "জি.টি.কে. মডিউল" -#: gtk/gtksettings.c:380 +#: gtk/gtksettings.c:381 msgid "List of currently active GTK modules" msgstr "বৰ্তমানে সক্ৰিয় জি.টি.কে. মডিউলৰ তালিকা" -#: gtk/gtksettings.c:389 +#: gtk/gtksettings.c:390 msgid "Xft Antialias" msgstr "Xft এন্টিএলিয়াসিং" -#: gtk/gtksettings.c:390 +#: gtk/gtksettings.c:391 msgid "Whether to antialias Xft fonts; 0=no, 1=yes, -1=default" msgstr "Xft ফন্টৰ ওপৰ এন্টিএলিয়াস প্ৰযোজ্য হ'ব নে নাই; ০=না, ১=হ্যাঁ, -১=অবিকল্পিত" -#: gtk/gtksettings.c:399 +#: gtk/gtksettings.c:400 msgid "Xft Hinting" msgstr "Xft হিন্টিং" -#: gtk/gtksettings.c:400 +#: gtk/gtksettings.c:401 msgid "Whether to hint Xft fonts; 0=no, 1=yes, -1=default" msgstr "Xft ফন্টৰ ওপৰ হিন্ট প্ৰযোজ্য হ'ব নে নাই; ০=না, ১=হ্যাঁ, -১=অবিকল্পিত" -#: gtk/gtksettings.c:409 +#: gtk/gtksettings.c:410 msgid "Xft Hint Style" msgstr "Xft হিন্টেৰ ধৰন" -#: gtk/gtksettings.c:410 +#: gtk/gtksettings.c:411 msgid "" "What degree of hinting to use; hintnone, hintslight, hintmedium, or hintfull" msgstr "যি মাত্ৰাৰ হিন্টিং ব্যৱহাৰ কৰা হ'ব; কিছুই না, স্বল্প, মধ্যম, বা সম্পূৰ্ণ" -#: gtk/gtksettings.c:419 +#: gtk/gtksettings.c:420 msgid "Xft RGBA" msgstr "Xft আৰজিবিএ" -#: gtk/gtksettings.c:420 +#: gtk/gtksettings.c:421 msgid "Type of subpixel antialiasing; none, rgb, bgr, vrgb, vbgr" msgstr "সাবপিক্সেল এন্টিএলিয়াসিং তৰ ধৰন; কিছুই না, স্বল্প, মধ্যম, বা সম্পূৰ্ণ" -#: gtk/gtksettings.c:429 +#: gtk/gtksettings.c:430 msgid "Xft DPI" msgstr "Xft ডিপিএএই" -#: gtk/gtksettings.c:430 +#: gtk/gtksettings.c:431 msgid "Resolution for Xft, in 1024 * dots/inch. -1 to use default value" msgstr "" "১০২৪ * ডট/ইঞ্চি হিচাপে Xft তৰ বিভাজন। -১ হলে অবিকল্পিত মান ব্যৱহাৰ কৰা হ'ব" -#: gtk/gtksettings.c:439 +#: gtk/gtksettings.c:440 msgid "Cursor theme name" msgstr "কাৰ্ছাৰ থিমেৰ নাম" -#: gtk/gtksettings.c:440 +#: gtk/gtksettings.c:441 msgid "Name of the cursor theme to use, or NULL to use the default theme" msgstr "নাম সৰ্বমোট" -#: gtk/gtksettings.c:448 +#: gtk/gtksettings.c:449 msgid "Cursor theme size" msgstr "কাৰ্ছাৰ থিমেৰ আকাৰ" -#: gtk/gtksettings.c:449 +#: gtk/gtksettings.c:450 msgid "Size to use for cursors, or 0 to use the default size" msgstr "মাপ উল্লিখিত সময় অবধি" -#: gtk/gtksettings.c:459 +#: gtk/gtksettings.c:460 msgid "Alternative button order" msgstr "বিকল্প বুটাম-বিন্যাস" -#: gtk/gtksettings.c:460 +#: gtk/gtksettings.c:461 msgid "Whether buttons in dialogs should use the alternative button order" msgstr "ডায়ালগেৰ বুটামসমূহ বিকল্প বুটাম-বিন্যাস ব্যৱহাৰ কৰিব নে নাই" -#: gtk/gtksettings.c:477 +#: gtk/gtksettings.c:478 msgid "Alternative sort indicator direction" msgstr "Alternative ক্ৰমবিন্যাস" -#: gtk/gtksettings.c:478 +#: gtk/gtksettings.c:479 msgid "" "Whether the direction of the sort indicators in list and tree views is " "inverted compared to the default (where down means ascending)" msgstr "সৰ্বমোট ক্ৰমবিন্যাস তালিকা হলো" -#: gtk/gtksettings.c:486 +#: gtk/gtksettings.c:487 msgid "Show the 'Input Methods' menu" msgstr "'ইনপুট পদ্ধতি' নামক তালিকা প্ৰদৰ্শিত হ'ব" -#: gtk/gtksettings.c:487 +#: gtk/gtksettings.c:488 msgid "" "Whether the context menus of entries and text views should offer to change " "the input method" @@ -5304,11 +5096,11 @@ msgstr "" "এন্ট্ৰিৰ কনটেক্সট তালিকা আৰু টেক্সট প্ৰদৰ্শন ব্যৱস্থাৰ দ্বাৰা ইনপুট পদ্ধতি পৰিবৰ্তনেৰ " "সুবিধা উপলব্ধ কৰা হ'ব কি না" -#: gtk/gtksettings.c:495 +#: gtk/gtksettings.c:496 msgid "Show the 'Insert Unicode Control Character' menu" msgstr "সন্নিবেশ কৰক Unicode" -#: gtk/gtksettings.c:496 +#: gtk/gtksettings.c:497 msgid "" "Whether the context menus of entries and text views should offer to insert " "control characters" @@ -5316,272 +5108,282 @@ msgstr "" "এন্ট্ৰিৰ কনটেক্সট তালিকা আৰু টেক্সট প্ৰদৰ্শন ব্যৱস্থাৰ দ্বাৰা কন্ট্ৰোল ক্যাৰেক্টাৰ " "সন্নিবেশৰ সুবিধা উপলব্ধ কৰা হ'ব কি না" -#: gtk/gtksettings.c:504 +#: gtk/gtksettings.c:505 msgid "Start timeout" msgstr "আৰম্ভ" -#: gtk/gtksettings.c:505 +#: gtk/gtksettings.c:506 msgid "Starting value for timeouts, when button is pressed" msgstr "উল্লিখিত সময় অবধি হলো" -#: gtk/gtksettings.c:514 +#: gtk/gtksettings.c:515 msgid "Repeat timeout" msgstr "Repeat timeout" -#: gtk/gtksettings.c:515 +#: gtk/gtksettings.c:516 msgid "Repeat value for timeouts, when button is pressed" msgstr "উল্লিখিত সময় অবধি হলো" -#: gtk/gtksettings.c:524 +#: gtk/gtksettings.c:525 msgid "Expand timeout" msgstr "প্ৰসাৰণ" -#: gtk/gtksettings.c:525 +#: gtk/gtksettings.c:526 msgid "Expand value for timeouts, when a widget is expanding a new region" msgstr "প্ৰসাৰণ উল্লিখিত সময় অবধি হলো" -#: gtk/gtksettings.c:560 +#: gtk/gtksettings.c:561 msgid "Color scheme" msgstr "ৰং যোজনা " -#: gtk/gtksettings.c:561 +#: gtk/gtksettings.c:562 msgid "A palette of named colors for use in themes" msgstr "সৰ্বমোট উল্লিখিত সময় অবধি" -#: gtk/gtksettings.c:570 +#: gtk/gtksettings.c:571 msgid "Enable Animations" msgstr "অ্যানিমেশন সক্ৰিয় কৰা হ'ব" -#: gtk/gtksettings.c:571 +#: gtk/gtksettings.c:572 msgid "Whether to enable toolkit-wide animations." msgstr "Whether to enable toolkit-wide animations." -#: gtk/gtksettings.c:589 +#: gtk/gtksettings.c:590 msgid "Enable Touchscreen Mode" msgstr "সক্ৰিয় কৰক মোড (Mode)" -#: gtk/gtksettings.c:590 +#: gtk/gtksettings.c:591 msgid "When TRUE, there are no motion notify events delivered on this screen" msgstr "না সক্ৰিয়" -#: gtk/gtksettings.c:607 +#: gtk/gtksettings.c:608 msgid "Tooltip timeout" msgstr "টুলটিপ" -#: gtk/gtksettings.c:608 +#: gtk/gtksettings.c:609 msgid "Timeout before tooltip is shown" msgstr "পূৰ্বে হলো" -#: gtk/gtksettings.c:633 +#: gtk/gtksettings.c:634 msgid "Tooltip browse timeout" msgstr "টুলটিপ" -#: gtk/gtksettings.c:634 +#: gtk/gtksettings.c:635 msgid "Timeout before tooltip is shown when browse mode is enabled" msgstr "পূৰ্বে হলো মোড হলো" -#: gtk/gtksettings.c:655 +#: gtk/gtksettings.c:656 msgid "Tooltip browse mode timeout" msgstr "টুলটিপ মোড" -#: gtk/gtksettings.c:656 +#: gtk/gtksettings.c:657 msgid "Timeout after which browse mode is disabled" msgstr "পৰে মোড হলো" -#: gtk/gtksettings.c:675 +#: gtk/gtksettings.c:676 msgid "Keynav Cursor Only" msgstr "Keynav Cursor Only" -#: gtk/gtksettings.c:676 +#: gtk/gtksettings.c:677 msgid "When TRUE, there are only cursor keys available to navigate widgets" msgstr "When TRUE, there are only cursor keys available to navigate widgets" -#: gtk/gtksettings.c:693 +#: gtk/gtksettings.c:694 msgid "Keynav Wrap Around" msgstr "গুটানো" -#: gtk/gtksettings.c:694 +#: gtk/gtksettings.c:695 msgid "Whether to wrap around when keyboard-navigating widgets" msgstr "Whether to wrap around when keyboard-navigating widgets" -#: gtk/gtksettings.c:714 +#: gtk/gtksettings.c:715 msgid "Error Bell" msgstr "ত্ৰুটি" -#: gtk/gtksettings.c:715 +#: gtk/gtksettings.c:716 msgid "When TRUE, keyboard navigation and other errors will cause a beep" msgstr "অন্যান্য" -#: gtk/gtksettings.c:732 +#: gtk/gtksettings.c:733 msgid "Color Hash" msgstr "Color Hash" -#: gtk/gtksettings.c:733 +#: gtk/gtksettings.c:734 msgid "A hash table representation of the color scheme." msgstr "সৰ্বমোট ৰং." -#: gtk/gtksettings.c:741 +#: gtk/gtksettings.c:742 msgid "Default file chooser backend" msgstr "স্বাভাবিক অবস্থায় ব্যৱহৃত ফাইল বাছাইকাৰী ব্যাকএন্ড" -#: gtk/gtksettings.c:742 +#: gtk/gtksettings.c:743 msgid "Name of the GtkFileChooser backend to use by default" msgstr "স্বাভাবিক অবস্থায় যি GtkFileChooser ব্যাকএন্ড ব্যৱহাৰ কৰা হ'ব তাৰ নাম" -#: gtk/gtksettings.c:759 +#: gtk/gtksettings.c:760 msgid "Default print backend" msgstr "অবিকল্পিত" -#: gtk/gtksettings.c:760 +#: gtk/gtksettings.c:761 msgid "List of the GtkPrintBackend backends to use by default" msgstr "তালিকা সৰ্বমোট" -#: gtk/gtksettings.c:783 +#: gtk/gtksettings.c:784 msgid "Default command to run when displaying a print preview" msgstr "অবিকল্পিত" -#: gtk/gtksettings.c:784 +#: gtk/gtksettings.c:785 msgid "Command to run when displaying a print preview" msgstr "Command to run when displaying a print preview" -#: gtk/gtksettings.c:800 +#: gtk/gtksettings.c:801 msgid "Enable Mnemonics" msgstr "সক্ৰিয় কৰক" -#: gtk/gtksettings.c:801 +#: gtk/gtksettings.c:802 msgid "Whether labels should have mnemonics" msgstr "Whether labels should have mnemonics" -#: gtk/gtksettings.c:817 +#: gtk/gtksettings.c:818 msgid "Enable Accelerators" msgstr "সক্ৰিয় কৰক" -#: gtk/gtksettings.c:818 +#: gtk/gtksettings.c:819 msgid "Whether menu items should have accelerators" msgstr "Whether menu items should have accelerators" -#: gtk/gtksettings.c:835 +#: gtk/gtksettings.c:836 msgid "Recent Files Limit" msgstr "Recent Files Limit" -#: gtk/gtksettings.c:836 +#: gtk/gtksettings.c:837 msgid "Number of recently used files" msgstr "সৰ্বমোট" # -#: gtk/gtksettings.c:854 +#: gtk/gtksettings.c:855 msgid "Default IM module" msgstr "অবিকল্পিত প্ৰস্থ" # -#: gtk/gtksettings.c:855 +#: gtk/gtksettings.c:856 msgid "Which IM module should be used by default" msgstr "পেলেট ব্যৱহৃত হ'ব নে নাই" # -#: gtk/gtksettings.c:873 +#: gtk/gtksettings.c:874 msgid "Recent Files Max Age" msgstr "মেনেজাৰ" # -#: gtk/gtksettings.c:874 +#: gtk/gtksettings.c:875 msgid "Maximum age of recently used files, in days" msgstr "সৰ্বমোট" -#: gtk/gtksettings.c:883 +#: gtk/gtksettings.c:884 msgid "Fontconfig configuration timestamp" msgstr "Fontconfig configuration timestamp" -#: gtk/gtksettings.c:884 +#: gtk/gtksettings.c:885 msgid "Timestamp of current fontconfig configuration" msgstr "Timestamp of current fontconfig configuration" # -#: gtk/gtksettings.c:906 +#: gtk/gtksettings.c:907 msgid "Sound Theme Name" msgstr "শব্দেৰ থিমেৰ নাম" # -#: gtk/gtksettings.c:907 +#: gtk/gtksettings.c:908 msgid "XDG sound theme name" msgstr "কাৰ্ছাৰ থিমেৰ নাম" #. Translators: this means sounds that are played as feedback to user input -#: gtk/gtksettings.c:929 +#: gtk/gtksettings.c:930 msgid "Audible Input Feedback" msgstr "Audible Input Feedback" # -#: gtk/gtksettings.c:930 +#: gtk/gtksettings.c:931 msgid "Whether to play event sounds as feedback to user input" msgstr "ইনপুটেৰ প্ৰতি উইজেট সাড়া দেয় নে নাই" # -#: gtk/gtksettings.c:951 +#: gtk/gtksettings.c:952 msgid "Enable Event Sounds" msgstr "অ্যানিমেশন সক্ৰিয় কৰা হ'ব" # -#: gtk/gtksettings.c:952 +#: gtk/gtksettings.c:953 msgid "Whether to play any event sounds at all" msgstr "\"অসামঞ্জস্যপূৰ্ণ\" অবস্থা প্ৰদৰ্শন কৰা হ'ব নে নাই" # -#: gtk/gtksettings.c:967 +#: gtk/gtksettings.c:968 msgid "Enable Tooltips" msgstr "টুল-টিপ সক্ৰিয় কৰা হ'ব" # -#: gtk/gtksettings.c:968 +#: gtk/gtksettings.c:969 msgid "Whether tooltips should be shown on widgets" msgstr "ট্যাব প্ৰদৰ্শন কৰা হ'ব নে নাই" -#: gtk/gtksettings.c:981 +#: gtk/gtksettings.c:982 msgid "Toolbar style" msgstr "টুলবাৰৰ ধৰন" -#: gtk/gtksettings.c:982 +#: gtk/gtksettings.c:983 msgid "" "Whether default toolbars have text only, text and icons, icons only, etc." msgstr "" "অবিকল্পিত টুলবাৰে অকল টেক্সট বা টেক্সট আৰু আইকন বা অকল আইকন, ইত্যাদি থাকবে নে নাই" -#: gtk/gtksettings.c:996 +#: gtk/gtksettings.c:997 #, fuzzy msgid "Toolbar Icon Size" msgstr "টুলবাৰৰ আইকনেৰ আয়তন" -#: gtk/gtksettings.c:997 +#: gtk/gtksettings.c:998 #, fuzzy msgid "The size of icons in default toolbars." msgstr "অবিকল্পিত টুলবাৰে আইকনেৰ আয়তন" -#: gtk/gtksettings.c:1014 +#: gtk/gtksettings.c:1015 #, fuzzy msgid "Auto Mnemonics" msgstr "সক্ৰিয় কৰক" -#: gtk/gtksettings.c:1015 +#: gtk/gtksettings.c:1016 msgid "" "Whether mnemonics should be automatically shown and hidden when the user " "presses the mnemonic activator." msgstr "" -#: gtk/gtksizegroup.c:301 +#: gtk/gtksettings.c:1041 +#, fuzzy +msgid "Application prefers a dark theme" +msgstr "আঁকাৰযোগ্য অ্যাপলিকেশন" + +#: gtk/gtksettings.c:1042 +#, fuzzy +msgid "Whether the application prefers to have a dark theme." +msgstr "অনুপ্ৰয়োগত নিৰ্বাচন আছে নে নাই" + +#: gtk/gtksizegroup.c:320 msgid "Mode" msgstr "মোড (Mode)" -#: gtk/gtksizegroup.c:302 +#: gtk/gtksizegroup.c:321 msgid "" "The directions in which the size group affects the requested sizes of its " "component widgets" msgstr "আকাৰৰ গ্ৰুপ তাৰ কম্পোনেন্ট উইজেটগুলোৰ আবেদনকৃত আকাৰকে যি দিকে প্ৰভাবিত কৰি" -#: gtk/gtksizegroup.c:318 +#: gtk/gtksizegroup.c:337 msgid "Ignore hidden" msgstr "লুকানো উইজেটকে অগ্ৰাহ্য কৰো" -#: gtk/gtksizegroup.c:319 +#: gtk/gtksizegroup.c:338 msgid "" "If TRUE, unmapped widgets are ignored when determining the size of the group" msgstr "সৰ্বমোট" @@ -5679,62 +5481,62 @@ msgstr "ওপৰতেৰ স্তৰৰ আকাৰ পৰিবৰ্তন msgid "Style of bevel around the statusbar text" msgstr "স্ট্যাটাসবাৰ টেক্সটৰ চাৰপাশে প্ৰদৰ্শিত বেভেলৰ ধৰন" -#: gtk/gtkstatusicon.c:271 +#: gtk/gtkstatusicon.c:276 msgid "The size of the icon" msgstr "সৰ্বমোট" -#: gtk/gtkstatusicon.c:281 +#: gtk/gtkstatusicon.c:286 msgid "The screen where this status icon will be displayed" msgstr "The screen where this status icon will be displayed" # -#: gtk/gtkstatusicon.c:288 +#: gtk/gtkstatusicon.c:293 msgid "Blinking" msgstr "ঢিমিক-ঢামাক " -#: gtk/gtkstatusicon.c:289 +#: gtk/gtkstatusicon.c:294 msgid "Whether or not the status icon is blinking" msgstr "হলো" -#: gtk/gtkstatusicon.c:297 +#: gtk/gtkstatusicon.c:302 msgid "Whether or not the status icon is visible" msgstr "হলো দৃশ্যমান" -#: gtk/gtkstatusicon.c:313 +#: gtk/gtkstatusicon.c:318 msgid "Whether or not the status icon is embedded" msgstr "হলো" -#: gtk/gtkstatusicon.c:329 gtk/gtktrayicon-x11.c:111 +#: gtk/gtkstatusicon.c:334 gtk/gtktrayicon-x11.c:123 msgid "The orientation of the tray" msgstr "সৰ্বমোট" -#: gtk/gtkstatusicon.c:356 gtk/gtkwidget.c:702 +#: gtk/gtkstatusicon.c:361 gtk/gtkwidget.c:722 msgid "Has tooltip" msgstr "Has tooltip" # -#: gtk/gtkstatusicon.c:357 +#: gtk/gtkstatusicon.c:362 msgid "Whether this tray icon has a tooltip" msgstr "এই ট্যাগ (tag) ফন্ট আকাৰকে প্ৰভাবিত কৰি নে নাই" -#: gtk/gtkstatusicon.c:382 gtk/gtkwidget.c:723 +#: gtk/gtkstatusicon.c:387 gtk/gtkwidget.c:743 msgid "Tooltip Text" msgstr "টুলটিপ Text" -#: gtk/gtkstatusicon.c:383 gtk/gtkwidget.c:724 gtk/gtkwidget.c:745 +#: gtk/gtkstatusicon.c:388 gtk/gtkwidget.c:744 gtk/gtkwidget.c:765 msgid "The contents of the tooltip for this widget" msgstr "সৰ্বমোট উল্লিখিত সময় অবধি" -#: gtk/gtkstatusicon.c:406 gtk/gtkwidget.c:744 +#: gtk/gtkstatusicon.c:411 gtk/gtkwidget.c:764 msgid "Tooltip markup" msgstr "টুলটিপ" # -#: gtk/gtkstatusicon.c:407 +#: gtk/gtkstatusicon.c:412 msgid "The contents of the tooltip for this tray icon" msgstr "সৰ্বমোট উল্লিখিত সময় অবধি" -#: gtk/gtkstatusicon.c:425 +#: gtk/gtkstatusicon.c:430 msgid "The title of this tray icon" msgstr "এই ট্ৰে আইকণৰ শিৰোনাম" @@ -5838,30 +5640,6 @@ msgstr "" "চাইল্ড এবং তাৰ ওপৰত আৰু তলৰ বস্তুৰ মাজত যি অতিৰিক্ত ৰিক্ত স্থান ৰাখিব তাৰ পিক্সেল " "সংখ্যা" -#: gtk/gtktext.c:546 -msgid "Horizontal adjustment for the text widget" -msgstr "টেক্সট উইজেটেৰ বাবে পথালি সংৰেখন" - -#: gtk/gtktext.c:554 -msgid "Vertical adjustment for the text widget" -msgstr "টেক্সট উইজেটেৰ বাবে উলম্ব সংৰেখন" - -#: gtk/gtktext.c:561 -msgid "Line Wrap" -msgstr "লাইন গুটানো" - -#: gtk/gtktext.c:562 -msgid "Whether lines are wrapped at widget edges" -msgstr "উইজেটেৰ প্ৰান্তে লাইন গুটানো হ'ব নে নাই" - -#: gtk/gtktext.c:569 -msgid "Word Wrap" -msgstr "শব্দ গুটানো" - -#: gtk/gtktext.c:570 -msgid "Whether words are wrapped at widget edges" -msgstr "শব্দ গুটানো হ'ব নে নাই" - #: gtk/gtktextbuffer.c:180 msgid "Tag Table" msgstr "ট্যাগ ছক" @@ -6291,15 +6069,15 @@ msgstr "ভুল নিৰ্দেশক নিম্নৰেখাৰ ৰং msgid "Color with which to draw error-indication underlines" msgstr "ভুল নিৰ্দেশক নিম্নৰেখা আঁকতে যি ৰং ব্যৱহৃত হ'ব" -#: gtk/gtktoggleaction.c:104 +#: gtk/gtktoggleaction.c:115 msgid "Create the same proxies as a radio action" msgstr "এই নিযুক্তকসমূহকই ৰেডিও বুটাম হিচাপে তৈৰি কৰো" -#: gtk/gtktoggleaction.c:105 +#: gtk/gtktoggleaction.c:116 msgid "Whether the proxies for this action look like radio action proxies" msgstr "এই অ্যাকশনেৰ নিযুক্তককে ৰেডিও অ্যাকশনেৰ নিযুক্তকৰ মত মনে হয় নে নাই" -#: gtk/gtktoggleaction.c:120 +#: gtk/gtktoggleaction.c:131 msgid "If the toggle action should be active in or not" msgstr "অদলবদল" @@ -6319,87 +6097,79 @@ msgstr "নিৰ্দেশক আঁকো" msgid "If the toggle part of the button is displayed" msgstr "যদি বুটামৰ টোগল অংশটি প্ৰদৰ্শন কৰা হয়" -#: gtk/gtktoolbar.c:494 gtk/gtktoolpalette.c:1020 +#: gtk/gtktoolbar.c:456 gtk/gtktoolpalette.c:1021 msgid "Toolbar Style" msgstr "টুল-বাৰৰ বিন্যাস" -#: gtk/gtktoolbar.c:495 +#: gtk/gtktoolbar.c:457 msgid "How to draw the toolbar" msgstr "যিভাবে টুলবাৰ আঁকা হ'ব" -#: gtk/gtktoolbar.c:502 +#: gtk/gtktoolbar.c:464 msgid "Show Arrow" msgstr "তীৰচিহ্ন প্ৰদৰ্শন কৰো" -#: gtk/gtktoolbar.c:503 +#: gtk/gtktoolbar.c:465 msgid "If an arrow should be shown if the toolbar doesn't fit" msgstr "টুলবাৰে না আঁটলেও তীৰচিহ্ন প্ৰদৰ্শন কৰা হ'ব নে নাই" -#: gtk/gtktoolbar.c:518 -msgid "Tooltips" -msgstr "টুলটিপ" - -#: gtk/gtktoolbar.c:519 -msgid "If the tooltips of the toolbar should be active or not" -msgstr "টুলবাৰৰ টুলটিপ সক্ৰিয় থাকবে নে নাই" - -#: gtk/gtktoolbar.c:541 +#: gtk/gtktoolbar.c:486 msgid "Size of icons in this toolbar" msgstr "মাপ সৰ্বমোট" -#: gtk/gtktoolbar.c:556 gtk/gtktoolpalette.c:1006 +#: gtk/gtktoolbar.c:501 gtk/gtktoolpalette.c:1007 msgid "Icon size set" msgstr "আইকন" -#: gtk/gtktoolbar.c:557 gtk/gtktoolpalette.c:1007 +#: gtk/gtktoolbar.c:502 gtk/gtktoolpalette.c:1008 msgid "Whether the icon-size property has been set" msgstr "Whether the icon-size property has been set" -#: gtk/gtktoolbar.c:566 +#: gtk/gtktoolbar.c:511 msgid "Whether the item should receive extra space when the toolbar grows" msgstr "টুলবাৰৰ আকৃতি বৃদ্ধি পেলে জিনিষটি অতিৰিক্ত স্থান দখল কৰিব নে নাই" -#: gtk/gtktoolbar.c:574 gtk/gtktoolitemgroup.c:1589 +#: gtk/gtktoolbar.c:519 gtk/gtktoolitemgroup.c:1597 msgid "Whether the item should be the same size as other homogeneous items" msgstr "এই জিনিষটিৰ আকাৰ অন্যান্য সমজাতীয় জিনিষেৰ মতই হ'ব নে নাই" -#: gtk/gtktoolbar.c:581 +#: gtk/gtktoolbar.c:526 msgid "Spacer size" msgstr "স্পেসাৰ (Spacer) ইয়াৰ আকাৰ" -#: gtk/gtktoolbar.c:582 +#: gtk/gtktoolbar.c:527 msgid "Size of spacers" msgstr "স্পেসাৰ (Spacer) ইয়াৰ আকাৰ" -#: gtk/gtktoolbar.c:591 +#: gtk/gtktoolbar.c:536 msgid "Amount of border space between the toolbar shadow and the buttons" msgstr "টুলবাৰৰ ছায়া আৰু বুটামসমূহেৰ মাজত প্ৰান্তীয় স্থান" -#: gtk/gtktoolbar.c:599 +#: gtk/gtktoolbar.c:544 msgid "Maximum child expand" msgstr "child প্ৰসাৰণ" -#: gtk/gtktoolbar.c:600 +#: gtk/gtktoolbar.c:545 msgid "Maximum amount of space an expandable item will be given" msgstr "সৰ্বমোট" -#: gtk/gtktoolbar.c:608 +#: gtk/gtktoolbar.c:553 msgid "Space style" msgstr "ৰিক্ত স্থানৰ ধৰন" -#: gtk/gtktoolbar.c:609 +#: gtk/gtktoolbar.c:554 msgid "Whether spacers are vertical lines or just blank" msgstr "স্পেসাৰসমূহ উলম্ব লাইন অথবা শুধুই ৰিক্ত স্থান নে নাই" -#: gtk/gtktoolbar.c:616 +#: gtk/gtktoolbar.c:561 msgid "Button relief" msgstr "বুটাম ছেড়ে দেয়া" -#: gtk/gtktoolbar.c:617 +#: gtk/gtktoolbar.c:562 msgid "Type of bevel around toolbar buttons" msgstr "টুলবাৰে অবস্থিত বুটামৰ চাৰদিকে বেভেলৰ ধৰন" -#: gtk/gtktoolbar.c:624 +#: gtk/gtktoolbar.c:569 msgid "Style of bevel around the toolbar" msgstr "টুলবাৰৰ চাৰদিকে বেভেলৰ ধৰন" @@ -6451,7 +6221,7 @@ msgstr "আইকন" msgid "Spacing in pixels between the icon and label" msgstr "মধ্যবৰ্তী স্থান পিকসেল" -#: gtk/gtktoolitem.c:207 +#: gtk/gtktoolitem.c:200 msgid "" "Whether the toolbar item is considered important. When TRUE, toolbar buttons " "show text in GTK_TOOLBAR_BOTH_HORIZ mode" @@ -6459,103 +6229,140 @@ msgstr "" "টুলবাৰ আইটেমকে গুৰুত্বপূৰ্ণ বিবেচনা কৰা হয় নে নাই। ইয়াৰ মান সত্য (TRUE) হলে, টুলবাৰ " "বুটাম GTK_TOOLBAR_BOTH_HORIZ মোডে টেক্সট প্ৰদৰ্শন কৰি" -#: gtk/gtktoolitemgroup.c:1536 +#: gtk/gtktoolitemgroup.c:1544 #, fuzzy msgid "The human-readable title of this item group" msgstr "বিবৰণ সৰ্বমোট" -#: gtk/gtktoolitemgroup.c:1543 +#: gtk/gtktoolitemgroup.c:1551 #, fuzzy msgid "A widget to display in place of the usual label" msgstr "সাধাৰণত প্ৰদৰ্শিত ফ্ৰেম লেবেলৰ পৰিবৰ্তে যি উইজেটটি দেখানো হ'ব" -#: gtk/gtktoolitemgroup.c:1549 +#: gtk/gtktoolitemgroup.c:1557 msgid "Collapsed" msgstr "" -#: gtk/gtktoolitemgroup.c:1550 +#: gtk/gtktoolitemgroup.c:1558 #, fuzzy msgid "Wether the group has been collapsed and items are hidden" msgstr "চাইল্ড উইজেটটি দেখানোৰ বাবে এক্সপেন্ডাৰটি খোলা হৈছে নে নাই" -#: gtk/gtktoolitemgroup.c:1556 +#: gtk/gtktoolitemgroup.c:1564 #, fuzzy msgid "ellipsize" msgstr "উপবৃত্তকৰণ" -#: gtk/gtktoolitemgroup.c:1557 +#: gtk/gtktoolitemgroup.c:1565 msgid "Ellipsize for item group headers" msgstr "" -#: gtk/gtktoolitemgroup.c:1563 +#: gtk/gtktoolitemgroup.c:1571 #, fuzzy msgid "Header Relief" msgstr "হেডাৰ প্ৰতিমূৰ্ত্তি" -#: gtk/gtktoolitemgroup.c:1564 +#: gtk/gtktoolitemgroup.c:1572 #, fuzzy msgid "Relief of the group header button" msgstr "স্তম্ভ হেডাৰৰ বুটাম প্ৰদৰ্শন কৰো" -#: gtk/gtktoolitemgroup.c:1579 +#: gtk/gtktoolitemgroup.c:1587 #, fuzzy msgid "Header Spacing" msgstr "হেডাৰ পেডিং" -#: gtk/gtktoolitemgroup.c:1580 +#: gtk/gtktoolitemgroup.c:1588 #, fuzzy msgid "Spacing between expander arrow and caption" msgstr "অধিকৃতি চিহ্নেৰ পাৰিপাৰ্শ্বিক স্থান" -#: gtk/gtktoolitemgroup.c:1596 +#: gtk/gtktoolitemgroup.c:1604 #, fuzzy msgid "Whether the item should receive extra space when the group grows" msgstr "টুলবাৰৰ আকৃতি বৃদ্ধি পেলে জিনিষটি অতিৰিক্ত স্থান দখল কৰিব নে নাই" -#: gtk/gtktoolitemgroup.c:1603 +#: gtk/gtktoolitemgroup.c:1611 #, fuzzy msgid "Whether the item should fill the available space" msgstr "সকলো চিলড্ৰেনৰ আকৃতি সমান হ'ব নে নাই" -#: gtk/gtktoolitemgroup.c:1609 +#: gtk/gtktoolitemgroup.c:1617 msgid "New Row" msgstr "" -#: gtk/gtktoolitemgroup.c:1610 +#: gtk/gtktoolitemgroup.c:1618 #, fuzzy msgid "Whether the item should start a new row" msgstr "Whether the items should be displayed with a number" -#: gtk/gtktoolitemgroup.c:1617 +#: gtk/gtktoolitemgroup.c:1625 #, fuzzy msgid "Position of the item within this group" msgstr "মাপদন্ডেৰ ওপৰ অবস্থানসূচক দাগ" -#: gtk/gtktoolpalette.c:991 +#: gtk/gtktoolpalette.c:992 #, fuzzy msgid "Size of icons in this tool palette" msgstr "মাপ সৰ্বমোট" -#: gtk/gtktoolpalette.c:1021 +#: gtk/gtktoolpalette.c:1022 #, fuzzy msgid "Style of items in the tool palette" msgstr "টুলবাৰৰ চাৰদিকে বেভেলৰ ধৰন" -#: gtk/gtktoolpalette.c:1037 +#: gtk/gtktoolpalette.c:1038 msgid "Exclusive" msgstr "" -#: gtk/gtktoolpalette.c:1038 +#: gtk/gtktoolpalette.c:1039 #, fuzzy msgid "Whether the item group should be the only expanded at a given time" msgstr "Whether the items should be displayed with a number" -#: gtk/gtktoolpalette.c:1053 +#: gtk/gtktoolpalette.c:1054 #, fuzzy msgid "" "Whether the item group should receive extra space when the palette grows" msgstr "পেৰেন্টৰ আকৃতি বৃদ্ধি পালে চাইল্ডে অতিৰক্ত স্থান পাব নে নাই" +#: gtk/gtktrayicon-x11.c:132 +#, fuzzy +msgid "Foreground color for symbolic icons" +msgstr "পংক্তি হিচাপে পুৰোভূমিৰ ৰং" + +#: gtk/gtktrayicon-x11.c:139 +#, fuzzy +msgid "Error color" +msgstr "কাৰ্ছাৰৰ ৰং " + +#: gtk/gtktrayicon-x11.c:140 +msgid "Error color for symbolic icons" +msgstr "" + +#: gtk/gtktrayicon-x11.c:147 +#, fuzzy +msgid "Warning color" +msgstr "পটভূমিৰ ৰং" + +#: gtk/gtktrayicon-x11.c:148 +msgid "Warning color for symbolic icons" +msgstr "" + +#: gtk/gtktrayicon-x11.c:155 +#, fuzzy +msgid "Success color" +msgstr "কাৰ্ছাৰৰ ৰং " + +#: gtk/gtktrayicon-x11.c:156 +msgid "Success color for symbolic icons" +msgstr "" + +#: gtk/gtktrayicon-x11.c:164 +#, fuzzy +msgid "Padding that should be put around icons in the tray" +msgstr "Whether there should be an icon near the item" + #: gtk/gtktreemodelsort.c:278 msgid "TreeModelSort Model" msgstr "TreeModelSort মডেল" @@ -6564,229 +6371,229 @@ msgstr "TreeModelSort মডেল" msgid "The model for the TreeModelSort to sort" msgstr "TreeModelSort তৰ যি মডেলকে ক্ৰমানুসাৰ সজোৱাৰ হ'ব" -#: gtk/gtktreeview.c:564 +#: gtk/gtktreeview.c:566 msgid "TreeView Model" msgstr "ট্ৰি-ভিউ মডেল" -#: gtk/gtktreeview.c:565 +#: gtk/gtktreeview.c:567 msgid "The model for the tree view" msgstr "ট্ৰি-ভিউ তৰ মডেল" -#: gtk/gtktreeview.c:573 +#: gtk/gtktreeview.c:575 msgid "Horizontal Adjustment for the widget" msgstr "উইজেটেৰ পথালি সমন্বয়" -#: gtk/gtktreeview.c:581 +#: gtk/gtktreeview.c:583 msgid "Vertical Adjustment for the widget" msgstr "উইজেটেৰ উলম্ব সমন্বয়" -#: gtk/gtktreeview.c:588 +#: gtk/gtktreeview.c:590 msgid "Headers Visible" msgstr "হেডাৰ দৃশ্যমান থাকবে" -#: gtk/gtktreeview.c:589 +#: gtk/gtktreeview.c:591 msgid "Show the column header buttons" msgstr "স্তম্ভ হেডাৰৰ বুটাম প্ৰদৰ্শন কৰো" -#: gtk/gtktreeview.c:596 +#: gtk/gtktreeview.c:598 msgid "Headers Clickable" msgstr "ক্লিক কৰাৰ যোগ্য হেডাৰ" -#: gtk/gtktreeview.c:597 +#: gtk/gtktreeview.c:599 msgid "Column headers respond to click events" msgstr "স্তম্ভ হেডাৰ ক্লিক ইভেন্টসমূহে সাড়া দেয়" -#: gtk/gtktreeview.c:604 +#: gtk/gtktreeview.c:606 msgid "Expander Column" msgstr "বৰ্ধিষ্ণু (Expander) স্তম্ভ" -#: gtk/gtktreeview.c:605 +#: gtk/gtktreeview.c:607 msgid "Set the column for the expander column" msgstr "স্তম্ভটি প্ৰকৃতি বৰ্ধিষ্ণু (Expander) স্তম্ভ হিচাপে নিৰ্ধাৰণ কৰো" -#: gtk/gtktreeview.c:620 +#: gtk/gtktreeview.c:622 msgid "Rules Hint" msgstr "নিয়ম সংক্ৰান্ত ইঙ্গিত" -#: gtk/gtktreeview.c:621 +#: gtk/gtktreeview.c:623 msgid "Set a hint to the theme engine to draw rows in alternating colors" msgstr "" "পৰিবৰ্তনশীল ৰঙে শাৰী আঁকাৰ উদ্দেশ্যি থিম ইঞ্জিনেৰ বাবেি এটা ইঙ্গিত নিৰ্ধাৰণ কৰো" -#: gtk/gtktreeview.c:628 +#: gtk/gtktreeview.c:630 msgid "Enable Search" msgstr "অনুসন্ধান প্ৰক্ৰিয়া সক্ৰিয় কৰো" -#: gtk/gtktreeview.c:629 +#: gtk/gtktreeview.c:631 msgid "View allows user to search through columns interactively" msgstr "" "এই দৃশ্যটি ব্যৱহাৰকাৰীৰ অংশগ্ৰহণেৰ মধ্য দিয়ে (Interactive) স্তম্ভৰ পৰা অনুসন্ধান " "চালাতে দেয়" -#: gtk/gtktreeview.c:636 +#: gtk/gtktreeview.c:638 msgid "Search Column" msgstr "অনুসন্ধানেৰ স্তম্ভ" # -#: gtk/gtktreeview.c:637 +#: gtk/gtktreeview.c:639 msgid "Model column to search through during interactive search" msgstr "কোড অনুসন্ধানেৰ সময় যি মডেল স্তম্ভে অনুসন্ধান চালানো হ'ব" -#: gtk/gtktreeview.c:657 +#: gtk/gtktreeview.c:659 msgid "Fixed Height Mode" msgstr "পূৰ্বনিৰ্দিষ্ট উচ্চতা ব্যৱহাৰকাৰী মোড" -#: gtk/gtktreeview.c:658 +#: gtk/gtktreeview.c:660 msgid "Speeds up GtkTreeView by assuming that all rows have the same height" msgstr "সকল শাৰীৰ উচ্চতা সমান বিবেচনা কৰি GtkTreeView-কে দ্ৰুততৰ কৰি" -#: gtk/gtktreeview.c:678 +#: gtk/gtktreeview.c:680 msgid "Hover Selection" msgstr "ভাসমান (Hover) নিৰ্বাচন" -#: gtk/gtktreeview.c:679 +#: gtk/gtktreeview.c:681 msgid "Whether the selection should follow the pointer" msgstr "পইন্টাৰক অনুসৰণ কৰি নিৰ্বাচন কৰা হ'ব নে নাই" -#: gtk/gtktreeview.c:698 +#: gtk/gtktreeview.c:700 msgid "Hover Expand" msgstr "ভাসমান (Hover) সম্প্ৰসাৰণ" -#: gtk/gtktreeview.c:699 +#: gtk/gtktreeview.c:701 msgid "" "Whether rows should be expanded/collapsed when the pointer moves over them" msgstr "কোন শাৰীৰ ওপৰ পইন্টাৰ ৰাখা হলে তাকে সম্প্ৰসাৰিত-কৰা/খোলা হ'ব নে নাই" -#: gtk/gtktreeview.c:713 +#: gtk/gtktreeview.c:715 msgid "Show Expanders" msgstr "Show Expanders" -#: gtk/gtktreeview.c:714 +#: gtk/gtktreeview.c:716 msgid "View has expanders" msgstr "প্ৰদৰ্শন" -#: gtk/gtktreeview.c:728 +#: gtk/gtktreeview.c:730 msgid "Level Indentation" msgstr "Level Indentation" -#: gtk/gtktreeview.c:729 +#: gtk/gtktreeview.c:731 msgid "Extra indentation for each level" msgstr "উল্লিখিত সময় অবধি" -#: gtk/gtktreeview.c:738 +#: gtk/gtktreeview.c:740 msgid "Rubber Banding" msgstr "Rubber Banding" -#: gtk/gtktreeview.c:739 +#: gtk/gtktreeview.c:741 msgid "" "Whether to enable selection of multiple items by dragging the mouse pointer" msgstr "সৰ্বমোট" -#: gtk/gtktreeview.c:746 +#: gtk/gtktreeview.c:748 msgid "Enable Grid Lines" msgstr "সক্ৰিয় কৰক পংক্তি" -#: gtk/gtktreeview.c:747 +#: gtk/gtktreeview.c:749 msgid "Whether grid lines should be drawn in the tree view" msgstr "খানি পংক্তিৰ বাবে" -#: gtk/gtktreeview.c:755 +#: gtk/gtktreeview.c:757 msgid "Enable Tree Lines" msgstr "সক্ৰিয় কৰক ট্ৰি পংক্তি" -#: gtk/gtktreeview.c:756 +#: gtk/gtktreeview.c:758 msgid "Whether tree lines should be drawn in the tree view" msgstr "খানি পংক্তিৰ বাবে" -#: gtk/gtktreeview.c:764 +#: gtk/gtktreeview.c:766 msgid "The column in the model containing the tooltip texts for the rows" msgstr "উল্লিখিত সময় অবধি শাৰী" -#: gtk/gtktreeview.c:786 +#: gtk/gtktreeview.c:788 msgid "Vertical Separator Width" msgstr "উলম্ব বিভাজকেৰ প্ৰস্থ" -#: gtk/gtktreeview.c:787 +#: gtk/gtktreeview.c:789 msgid "Vertical space between cells. Must be an even number" msgstr "দুটি ঘৰৰ মাজত উলম্ব স্থান। ইয়াক অবশ্যই এটা জোড় সংখ্যা হ'ব" -#: gtk/gtktreeview.c:795 +#: gtk/gtktreeview.c:797 msgid "Horizontal Separator Width" msgstr "পথালি বিভাজকেৰ প্ৰস্থ" -#: gtk/gtktreeview.c:796 +#: gtk/gtktreeview.c:798 msgid "Horizontal space between cells. Must be an even number" msgstr "দুটি ঘৰৰ মাজত পথালি স্থান। ইয়াক অবশ্যই এটা জোড় সংখ্যা হ'ব" -#: gtk/gtktreeview.c:804 +#: gtk/gtktreeview.c:806 msgid "Allow Rules" msgstr "নিয়ম অনুমোদন কৰো" -#: gtk/gtktreeview.c:805 +#: gtk/gtktreeview.c:807 msgid "Allow drawing of alternating color rows" msgstr "পৰিবৰ্তনশীল ৰং দিয়ে শাৰী আঁকা অনুমোদন কৰো" -#: gtk/gtktreeview.c:811 +#: gtk/gtktreeview.c:813 msgid "Indent Expanders" msgstr "অবচ্ছেদ (Indent) প্ৰসাৰক" -#: gtk/gtktreeview.c:812 +#: gtk/gtktreeview.c:814 msgid "Make the expanders indented" msgstr "প্ৰসাৰকসমূহক অবচ্ছেদিত (Indented) কৰো" -#: gtk/gtktreeview.c:818 +#: gtk/gtktreeview.c:820 msgid "Even Row Color" msgstr "জোড় নম্বৰৰ শাৰীৰ ৰং" -#: gtk/gtktreeview.c:819 +#: gtk/gtktreeview.c:821 msgid "Color to use for even rows" msgstr "জোড় নম্বৰৰ শাৰীতে ব্যৱহৃত ৰং" -#: gtk/gtktreeview.c:825 +#: gtk/gtktreeview.c:827 msgid "Odd Row Color" msgstr "বেজোড় নম্বৰৰ শাৰীৰ ৰং" -#: gtk/gtktreeview.c:826 +#: gtk/gtktreeview.c:828 msgid "Color to use for odd rows" msgstr "বেজোড় নম্বৰৰ শাৰীতে ব্যৱহৃত ৰং" -#: gtk/gtktreeview.c:832 +#: gtk/gtktreeview.c:834 msgid "Row Ending details" msgstr "শাৰী" -#: gtk/gtktreeview.c:833 +#: gtk/gtktreeview.c:835 msgid "Enable extended row background theming" msgstr "সক্ৰিয় কৰক" -#: gtk/gtktreeview.c:839 +#: gtk/gtktreeview.c:841 msgid "Grid line width" msgstr "প্ৰস্থ" -#: gtk/gtktreeview.c:840 +#: gtk/gtktreeview.c:842 msgid "Width, in pixels, of the tree view grid lines" msgstr "Width পিকসেল সৰ্বমোট খানি পংক্তিৰ বাবে" -#: gtk/gtktreeview.c:846 +#: gtk/gtktreeview.c:848 msgid "Tree line width" msgstr "ট্ৰি প্ৰস্থ" -#: gtk/gtktreeview.c:847 +#: gtk/gtktreeview.c:849 msgid "Width, in pixels, of the tree view lines" msgstr "Width পিকসেল সৰ্বমোট খানি পংক্তিৰ বাবে" -#: gtk/gtktreeview.c:853 +#: gtk/gtktreeview.c:855 msgid "Grid line pattern" msgstr "Grid line pattern" -#: gtk/gtktreeview.c:854 +#: gtk/gtktreeview.c:856 msgid "Dash pattern used to draw the tree view grid lines" msgstr "খানি পংক্তিৰ বাবে" -#: gtk/gtktreeview.c:860 +#: gtk/gtktreeview.c:862 msgid "Tree line pattern" msgstr "ট্ৰি" -#: gtk/gtktreeview.c:861 +#: gtk/gtktreeview.c:863 msgid "Dash pattern used to draw the tree view lines" msgstr "খানি পংক্তিৰ বাবে" @@ -6794,7 +6601,7 @@ msgstr "খানি পংক্তিৰ বাবে" msgid "Whether to display the column" msgstr "স্তম্ভ প্ৰদৰ্শন কৰা হ'ব নে নাই" -#: gtk/gtktreeviewcolumn.c:200 gtk/gtkwindow.c:542 +#: gtk/gtktreeviewcolumn.c:200 gtk/gtkwindow.c:566 msgid "Resizable" msgstr "পৰিবৰ্তনযোগ্য আকাৰ" @@ -6910,43 +6717,43 @@ msgstr "একত্ৰিত UI তৰ বিবৰণ" msgid "An XML string describing the merged UI" msgstr "একত্ৰিত UI তৰ বিবৰণ প্ৰদানকাৰী এটা এক্সএমএল পঙ্‌ক্তি" -#: gtk/gtkviewport.c:107 +#: gtk/gtkviewport.c:135 msgid "" "The GtkAdjustment that determines the values of the horizontal position for " "this viewport" msgstr "ভিউপোৰ্টেৰ পথালি অবস্থান নিৰ্ধাৰণকাৰী GtkAdjustment" -#: gtk/gtkviewport.c:115 +#: gtk/gtkviewport.c:143 msgid "" "The GtkAdjustment that determines the values of the vertical position for " "this viewport" msgstr "ভিউপোৰ্টেৰ উলম্ব অবস্থান নিৰ্ধাৰণকাৰী GtkAdjustment" -#: gtk/gtkviewport.c:123 +#: gtk/gtkviewport.c:151 msgid "Determines how the shadowed box around the viewport is drawn" msgstr "শ্যাডো বাক্স'ৰ চাৰপাশে কিভাবে ভিউপোৰ্ট আঁকা হ'ব তা নিৰ্ধাৰণ কৰি" -#: gtk/gtkwidget.c:553 +#: gtk/gtkwidget.c:573 msgid "Widget name" msgstr "উইজেটেৰ নাম" -#: gtk/gtkwidget.c:554 +#: gtk/gtkwidget.c:574 msgid "The name of the widget" msgstr "উইজেটেৰ নাম" -#: gtk/gtkwidget.c:560 +#: gtk/gtkwidget.c:580 msgid "Parent widget" msgstr "পেৰেন্ট উইজেট" -#: gtk/gtkwidget.c:561 +#: gtk/gtkwidget.c:581 msgid "The parent widget of this widget. Must be a Container widget" msgstr "এই উইজেটেৰ পেৰেন্ট উইজেট। এটিকে অবশ্যই এটা কনটেইনাৰ উইজেট হতে হ'ব" -#: gtk/gtkwidget.c:568 +#: gtk/gtkwidget.c:588 msgid "Width request" msgstr "প্ৰস্থেৰ বাবে অনুৰোধ" -#: gtk/gtkwidget.c:569 +#: gtk/gtkwidget.c:589 msgid "" "Override for width request of the widget, or -1 if natural request should be " "used" @@ -6954,11 +6761,11 @@ msgstr "" "উইজেটেৰ প্ৰস্থ বিষয়ক আবেদন অগ্ৰাহ্যকাৰী মান; ইয়াৰ মান -১ হলে স্বাভাবিক আবেদন " "অনুমোদন কৰা হ'ব" -#: gtk/gtkwidget.c:577 +#: gtk/gtkwidget.c:597 msgid "Height request" msgstr "উচ্চতাৰ বাবে অনুৰোধ" -#: gtk/gtkwidget.c:578 +#: gtk/gtkwidget.c:598 msgid "" "Override for height request of the widget, or -1 if natural request should " "be used" @@ -6966,179 +6773,179 @@ msgstr "" "উইজেটেৰ দৈৰ্ঘ্য বিষয়ক আবেদন অগ্ৰাহ্যকাৰী মান; ইয়াৰ মান -১ হলে স্বাভাবিক আবেদন " "অনুমোদন কৰা হ'ব" -#: gtk/gtkwidget.c:587 +#: gtk/gtkwidget.c:607 msgid "Whether the widget is visible" msgstr "উইজেট দৃশ্যমান নে নাই" -#: gtk/gtkwidget.c:594 +#: gtk/gtkwidget.c:614 msgid "Whether the widget responds to input" msgstr "ইনপুটেৰ প্ৰতি উইজেট সাড়া দেয় নে নাই" -#: gtk/gtkwidget.c:600 +#: gtk/gtkwidget.c:620 msgid "Application paintable" msgstr "আঁকাৰযোগ্য অ্যাপলিকেশন" -#: gtk/gtkwidget.c:601 +#: gtk/gtkwidget.c:621 msgid "Whether the application will paint directly on the widget" msgstr "অ্যাপলিকেশনটি সৰাসৰি উইজেটে আঁকবে নে নাই" -#: gtk/gtkwidget.c:607 +#: gtk/gtkwidget.c:627 msgid "Can focus" msgstr "ফোকাস কৰতে পাৰে" -#: gtk/gtkwidget.c:608 +#: gtk/gtkwidget.c:628 msgid "Whether the widget can accept the input focus" msgstr "উইজেটটি ইনপুটেৰ ফ'কাচ গ্ৰহণ কৰতে পাৰে নে নাই" -#: gtk/gtkwidget.c:614 +#: gtk/gtkwidget.c:634 msgid "Has focus" msgstr "ফোকাস আছে" -#: gtk/gtkwidget.c:615 +#: gtk/gtkwidget.c:635 msgid "Whether the widget has the input focus" msgstr "উইজেটটিৰ ইনপুট ফ'কাচ আছে নে নাই" -#: gtk/gtkwidget.c:621 +#: gtk/gtkwidget.c:641 msgid "Is focus" msgstr "ফোকাস" -#: gtk/gtkwidget.c:622 +#: gtk/gtkwidget.c:642 msgid "Whether the widget is the focus widget within the toplevel" msgstr "উইজেটটি সৰ্বোচ্চ স্তৰৰ ফ'কাচ উইজেট নে নাই" -#: gtk/gtkwidget.c:628 +#: gtk/gtkwidget.c:648 msgid "Can default" msgstr "অবিকল্পিত হতে পাৰে" -#: gtk/gtkwidget.c:629 +#: gtk/gtkwidget.c:649 msgid "Whether the widget can be the default widget" msgstr "উইজেটটি অবিকল্পিত উইজেট হতে পাৰবে নে নাই" -#: gtk/gtkwidget.c:635 +#: gtk/gtkwidget.c:655 msgid "Has default" msgstr "অবিকল্পিত আছে" -#: gtk/gtkwidget.c:636 +#: gtk/gtkwidget.c:656 msgid "Whether the widget is the default widget" msgstr "উইজেটটি অবিকল্পিত উইজেট নে নাই" -#: gtk/gtkwidget.c:642 +#: gtk/gtkwidget.c:662 msgid "Receives default" msgstr "অবিকল্পিত গ্ৰহণ কৰি" -#: gtk/gtkwidget.c:643 +#: gtk/gtkwidget.c:663 msgid "If TRUE, the widget will receive the default action when it is focused" msgstr "যদি TRUE হয় তেন্তে ফোকাসকৃত অবস্থায় উইজেটটি অবিকল্পিত অ্যাকশন গ্ৰহণ কৰিব" -#: gtk/gtkwidget.c:649 +#: gtk/gtkwidget.c:669 msgid "Composite child" msgstr "কম্পোসিট চাইল্ড" -#: gtk/gtkwidget.c:650 +#: gtk/gtkwidget.c:670 msgid "Whether the widget is part of a composite widget" msgstr "উইজেটটি কোন কম্পোসিট চাইল্ডৰ অংশ নে নাই" -#: gtk/gtkwidget.c:656 +#: gtk/gtkwidget.c:676 msgid "Style" msgstr "বিন্যাস" -#: gtk/gtkwidget.c:657 +#: gtk/gtkwidget.c:677 msgid "" "The style of the widget, which contains information about how it will look " "(colors etc)" msgstr "উইজেটেৰ ধৰন, যাৰ উইজেটেৰ চেহাৰা সংক্ৰান্ত তথ্য ধাৰণ কৰি (ৰং ইত্যাদি)" -#: gtk/gtkwidget.c:663 +#: gtk/gtkwidget.c:683 msgid "Events" msgstr "ঘটনাসমূহ " -#: gtk/gtkwidget.c:664 +#: gtk/gtkwidget.c:684 msgid "The event mask that decides what kind of GdkEvents this widget gets" msgstr "" "যি ইভেন্ট মাস্কটি নিৰ্ধাৰণ কৰি এই উইজেটটি কি ধৰনেৰ GdkEvents গ্ৰহণ কৰতে পাৰে" -#: gtk/gtkwidget.c:671 +#: gtk/gtkwidget.c:691 msgid "Extension events" msgstr "বৰ্ধিত ইভেন্ট" -#: gtk/gtkwidget.c:672 +#: gtk/gtkwidget.c:692 msgid "The mask that decides what kind of extension events this widget gets" msgstr "যি মাস্কটি নিৰ্ধাৰণ কৰি এই উইজেটটি কি ধৰনেৰ বৰ্ধিত ইভেন্ট গ্ৰহণ কৰতে পাৰে" -#: gtk/gtkwidget.c:679 +#: gtk/gtkwidget.c:699 msgid "No show all" msgstr "সবকিছু দেখাও অকেজো" -#: gtk/gtkwidget.c:680 +#: gtk/gtkwidget.c:700 msgid "Whether gtk_widget_show_all() should not affect this widget" msgstr "gtk_widget_show_all() এই উইজেটকে প্ৰভাবিত কৰিব না নে নাই" -#: gtk/gtkwidget.c:703 +#: gtk/gtkwidget.c:723 msgid "Whether this widget has a tooltip" msgstr "Whether this widget has a tooltip" # -#: gtk/gtkwidget.c:759 +#: gtk/gtkwidget.c:779 msgid "Window" msgstr "সংযোগ পথ" -#: gtk/gtkwidget.c:760 +#: gtk/gtkwidget.c:780 msgid "The widget's window if it is realized" msgstr "The widget's window if it is realized" -#: gtk/gtkwidget.c:774 +#: gtk/gtkwidget.c:794 msgid "Double Buffered" msgstr "ডাবুল বাফাৰ" -#: gtk/gtkwidget.c:775 +#: gtk/gtkwidget.c:795 msgid "Whether or not the widget is double buffered" msgstr "ৱিজেটক ডাবুল বাফাৰ কৰা হৈছে নে নাই" -#: gtk/gtkwidget.c:2403 +#: gtk/gtkwidget.c:2427 msgid "Interior Focus" msgstr "অভ্যন্তৰীণ ফোকাস" -#: gtk/gtkwidget.c:2404 +#: gtk/gtkwidget.c:2428 msgid "Whether to draw the focus indicator inside widgets" msgstr "ফোকাস নিৰ্দেশকটি উইজেটেৰ ভেতৰ আঁকা হ'ব নে নাই" -#: gtk/gtkwidget.c:2410 +#: gtk/gtkwidget.c:2434 msgid "Focus linewidth" msgstr "ফোকাসৰ লাইনব্যাপ্তি" -#: gtk/gtkwidget.c:2411 +#: gtk/gtkwidget.c:2435 msgid "Width, in pixels, of the focus indicator line" msgstr "পিক্সেল হিচাপে ফ'কাচ নিৰ্দেশক লাইনেৰ প্ৰস্থ" -#: gtk/gtkwidget.c:2417 +#: gtk/gtkwidget.c:2441 msgid "Focus line dash pattern" msgstr "ফোকাস লাইনেৰ ড্যাশ পেটাৰ্ন" -#: gtk/gtkwidget.c:2418 +#: gtk/gtkwidget.c:2442 msgid "Dash pattern used to draw the focus indicator" msgstr "ফোকাস নিৰ্দেশক আঁকতে যি ধৰনেৰ ড্যাশ পেটাৰ্ন আঁকতে হ'ব" -#: gtk/gtkwidget.c:2423 +#: gtk/gtkwidget.c:2447 msgid "Focus padding" msgstr "ফোকাস পেডিং" -#: gtk/gtkwidget.c:2424 +#: gtk/gtkwidget.c:2448 msgid "Width, in pixels, between focus indicator and the widget 'box'" msgstr "পিক্সেল হিচাপে ফ'কাচ নিৰ্দেশক আৰু উইজেট 'বক্সৰ' মধ্যবৰ্তী স্থানেৰ প্ৰস্থ" -#: gtk/gtkwidget.c:2429 +#: gtk/gtkwidget.c:2453 msgid "Cursor color" msgstr "কাৰ্ছাৰৰ ৰং " -#: gtk/gtkwidget.c:2430 +#: gtk/gtkwidget.c:2454 msgid "Color with which to draw insertion cursor" msgstr "অক্ষৰ ভৰোৱাৰ (Insertion) কাৰ্ছাৰ আঁকতে যি ৰং ব্যৱহৃত হ'ব" -#: gtk/gtkwidget.c:2435 +#: gtk/gtkwidget.c:2459 msgid "Secondary cursor color" msgstr "কাৰ্ছাৰ আঁকায় ব্যৱহৃত দ্বিতীয় ৰং" -#: gtk/gtkwidget.c:2436 +#: gtk/gtkwidget.c:2460 msgid "" "Color with which to draw the secondary insertion cursor when editing mixed " "right-to-left and left-to-right text" @@ -7146,43 +6953,43 @@ msgstr "" "ডান-থেকে-বাম এবং বাম-থেকে-ডান এ লেখায় হয় ইয়াৰকম টেক্সটৰ মিশ্ৰণ এডিট কৰাৰ সময় " "অক্ষৰ ভৰোৱাৰ (Insertion) কাৰ্ছাৰ আঁকতে যি ৰং ব্যৱহৃত হ'ব" -#: gtk/gtkwidget.c:2441 +#: gtk/gtkwidget.c:2465 msgid "Cursor line aspect ratio" msgstr "কাৰ্ছাৰ লাইনেৰ আবয়ব অনুপাত" -#: gtk/gtkwidget.c:2442 +#: gtk/gtkwidget.c:2466 msgid "Aspect ratio with which to draw insertion cursor" msgstr "যি আবয়ব অনুপাতে অক্ষৰ ভৰোৱাৰ (Insertion) কাৰ্ছাৰ আঁকা হ'ব" -#: gtk/gtkwidget.c:2456 +#: gtk/gtkwidget.c:2480 msgid "Draw Border" msgstr "প্ৰান্ত আঁকো" -#: gtk/gtkwidget.c:2457 +#: gtk/gtkwidget.c:2481 msgid "Size of areas outside the widget's allocation to draw" msgstr "উইজেটেৰ বৰাদ্দকৃত অংশৰ বাইৰে যিখানে আঁকা হ'ব তাৰ আকাৰ" -#: gtk/gtkwidget.c:2470 +#: gtk/gtkwidget.c:2494 msgid "Unvisited Link Color" msgstr "সংযোগ" -#: gtk/gtkwidget.c:2471 +#: gtk/gtkwidget.c:2495 msgid "Color of unvisited links" msgstr "সৰ্বমোট" -#: gtk/gtkwidget.c:2484 +#: gtk/gtkwidget.c:2508 msgid "Visited Link Color" msgstr "পৰিদৰ্শিত সংযোগেৰ ৰং" -#: gtk/gtkwidget.c:2485 +#: gtk/gtkwidget.c:2509 msgid "Color of visited links" msgstr "সৰ্বমোট" -#: gtk/gtkwidget.c:2499 +#: gtk/gtkwidget.c:2523 msgid "Wide Separators" msgstr "Wide Separators" -#: gtk/gtkwidget.c:2500 +#: gtk/gtkwidget.c:2524 msgid "" "Whether separators have configurable width and should be drawn using a box " "instead of a line" @@ -7190,75 +6997,75 @@ msgstr "" "Whether separators have configurable width and should be drawn using a box " "instead of a line" -#: gtk/gtkwidget.c:2514 +#: gtk/gtkwidget.c:2538 msgid "Separator Width" msgstr "বিভাজন ৰেখা Width" -#: gtk/gtkwidget.c:2515 +#: gtk/gtkwidget.c:2539 msgid "The width of separators if wide-separators is TRUE" msgstr "প্ৰস্থ সৰ্বমোট হলো" -#: gtk/gtkwidget.c:2529 +#: gtk/gtkwidget.c:2553 msgid "Separator Height" msgstr "বিভাজন ৰেখা উচ্চতা" -#: gtk/gtkwidget.c:2530 +#: gtk/gtkwidget.c:2554 msgid "The height of separators if \"wide-separators\" is TRUE" msgstr "দৈৰ্ঘ্য সৰ্বমোট হলো" -#: gtk/gtkwidget.c:2544 +#: gtk/gtkwidget.c:2568 msgid "Horizontal Scroll Arrow Length" msgstr "Horizontal Scroll Arrow Length" -#: gtk/gtkwidget.c:2545 +#: gtk/gtkwidget.c:2569 msgid "The length of horizontal scroll arrows" msgstr "সৰ্বমোট" -#: gtk/gtkwidget.c:2559 +#: gtk/gtkwidget.c:2583 msgid "Vertical Scroll Arrow Length" msgstr "Vertical Scroll Arrow Length" -#: gtk/gtkwidget.c:2560 +#: gtk/gtkwidget.c:2584 msgid "The length of vertical scroll arrows" msgstr "সৰ্বমোট" -#: gtk/gtkwindow.c:483 +#: gtk/gtkwindow.c:507 msgid "Window Type" msgstr "উইন্ডোৰ ধৰন" -#: gtk/gtkwindow.c:484 +#: gtk/gtkwindow.c:508 msgid "The type of the window" msgstr "উইন্ডোৰ ধৰন " -#: gtk/gtkwindow.c:492 +#: gtk/gtkwindow.c:516 msgid "Window Title" msgstr "উইন্ডোৰ শিৰোনাম " -#: gtk/gtkwindow.c:493 +#: gtk/gtkwindow.c:517 msgid "The title of the window" msgstr "উইন্ডোৰ শিৰোনাম " -#: gtk/gtkwindow.c:500 +#: gtk/gtkwindow.c:524 msgid "Window Role" msgstr "উইন্ডোৰ ভূমিকা" -#: gtk/gtkwindow.c:501 +#: gtk/gtkwindow.c:525 msgid "Unique identifier for the window to be used when restoring a session" msgstr "কোন সেশন পুনৰুদ্ধাৰৰ সময় উইন্ডোৰ বাবে যি একক (Unique) নিৰ্দেশক ব্যৱহৃত হ'ব" -#: gtk/gtkwindow.c:517 +#: gtk/gtkwindow.c:541 msgid "Startup ID" msgstr "Startup ID" -#: gtk/gtkwindow.c:518 +#: gtk/gtkwindow.c:542 msgid "Unique startup identifier for the window used by startup-notification" msgstr "উল্লিখিত সময় অবধি" -#: gtk/gtkwindow.c:525 +#: gtk/gtkwindow.c:549 msgid "Allow Shrink" msgstr "সঙ্কোচন অনুমোদন কৰো" -#: gtk/gtkwindow.c:527 +#: gtk/gtkwindow.c:551 #, no-c-format msgid "" "If TRUE, the window has no mimimum size. Setting this to TRUE is 99% of the " @@ -7267,25 +7074,25 @@ msgstr "" "যদি TRUE হয় তেন্তে উইন্ডোটিৰ কোন সৰ্বনিম্ন আকাৰ নেই। ইয়াৰ মান TRUE নিৰ্ধাৰণ কৰাটা " "৯৯% ক্ষেত্ৰে এটা বাজে সিদ্ধান্ত" -#: gtk/gtkwindow.c:534 +#: gtk/gtkwindow.c:558 msgid "Allow Grow" msgstr "বড় হতে দেয়া হোক" -#: gtk/gtkwindow.c:535 +#: gtk/gtkwindow.c:559 msgid "If TRUE, users can expand the window beyond its minimum size" msgstr "" "যদি TRUE হয় তেন্তে ব্যৱহাৰকাৰীগণ উইন্ডোটিকে তাৰ সৰ্বনিম্ন আকাৰ অপেক্ষা বড় কৰতে " "পাৰবেন" -#: gtk/gtkwindow.c:543 +#: gtk/gtkwindow.c:567 msgid "If TRUE, users can resize the window" msgstr "যদি TRUE হয় তেন্তে ব্যৱহাৰকাৰীগণ উইন্ডোৰ আকাৰ পৰিবৰ্তন কৰতে পাৰবেন" -#: gtk/gtkwindow.c:550 +#: gtk/gtkwindow.c:574 msgid "Modal" msgstr "মোডাল (Modal)" -#: gtk/gtkwindow.c:551 +#: gtk/gtkwindow.c:575 msgid "" "If TRUE, the window is modal (other windows are not usable while this one is " "up)" @@ -7293,78 +7100,78 @@ msgstr "" "যদি TRUE হয় তেন্তে উইন্ডোটো মোডাল (এই উইন্ডোটি যখন দেখা যাব থাকবে তখন অন্যান্য " "উইন্ডো ব্যৱহাৰ কৰা যাব না)" -#: gtk/gtkwindow.c:558 +#: gtk/gtkwindow.c:582 msgid "Window Position" msgstr "উইন্ডোৰ অবস্থান" -#: gtk/gtkwindow.c:559 +#: gtk/gtkwindow.c:583 msgid "The initial position of the window" msgstr "উইন্ডোৰ প্ৰাথমিক অবস্থান" -#: gtk/gtkwindow.c:567 +#: gtk/gtkwindow.c:591 msgid "Default Width" msgstr "অবিকল্পিত প্ৰস্থ" -#: gtk/gtkwindow.c:568 +#: gtk/gtkwindow.c:592 msgid "The default width of the window, used when initially showing the window" msgstr "উইন্ডোটি প্ৰথমবাৰ প্ৰদৰ্শনেৰ সময় যি অবিকল্পিত প্ৰস্থ ব্যৱহাৰ কৰা হ'ব" -#: gtk/gtkwindow.c:577 +#: gtk/gtkwindow.c:601 msgid "Default Height" msgstr "অবিকল্পিত উচ্চতা" -#: gtk/gtkwindow.c:578 +#: gtk/gtkwindow.c:602 msgid "" "The default height of the window, used when initially showing the window" msgstr "উইন্ডোটি প্ৰথমবাৰ প্ৰদৰ্শনেৰ সময় যি অবিকল্পিত উচ্চতা ব্যৱহাৰ কৰা হ'ব" -#: gtk/gtkwindow.c:587 +#: gtk/gtkwindow.c:611 msgid "Destroy with Parent" msgstr "পেৰেন্ট সাথেই বন্ধ কৰো" -#: gtk/gtkwindow.c:588 +#: gtk/gtkwindow.c:612 msgid "If this window should be destroyed when the parent is destroyed" msgstr "পেৰেন্ট উইন্ডো বন্ধ কৰি দিলে এই উইন্ডোটিও বন্ধ কৰা হ'ব নে নাই" -#: gtk/gtkwindow.c:596 +#: gtk/gtkwindow.c:620 msgid "Icon for this window" msgstr "এই উইন্ডোৰ বাবে আইকন" -#: gtk/gtkwindow.c:602 +#: gtk/gtkwindow.c:626 #, fuzzy msgid "Mnemonics Visible" msgstr "নেমোনিক কী (Key)" -#: gtk/gtkwindow.c:603 +#: gtk/gtkwindow.c:627 #, fuzzy msgid "Whether mnemonics are currently visible in this window" msgstr "সৰ্বোচ্চ স্তৰটি বৰ্তমানে সক্ৰিয় উইন্ডো নে নাই" -#: gtk/gtkwindow.c:619 +#: gtk/gtkwindow.c:643 msgid "Name of the themed icon for this window" msgstr "এই উইন্ডোৰ বাবে থিমযুক্ত আইকনেৰ নাম" -#: gtk/gtkwindow.c:634 +#: gtk/gtkwindow.c:658 msgid "Is Active" msgstr "সক্ৰিয় অবস্থায় আছে" -#: gtk/gtkwindow.c:635 +#: gtk/gtkwindow.c:659 msgid "Whether the toplevel is the current active window" msgstr "সৰ্বোচ্চ স্তৰটি বৰ্তমানে সক্ৰিয় উইন্ডো নে নাই" -#: gtk/gtkwindow.c:642 +#: gtk/gtkwindow.c:666 msgid "Focus in Toplevel" msgstr "ওপৰতেৰ স্তৰৰ ফোকাস" -#: gtk/gtkwindow.c:643 +#: gtk/gtkwindow.c:667 msgid "Whether the input focus is within this GtkWindow" msgstr "ইনপুটেৰ ফ'কাচ GtkWindow'ৰ মাজত আছে নে নাই" -#: gtk/gtkwindow.c:650 +#: gtk/gtkwindow.c:674 msgid "Type hint" msgstr "ধৰন সংক্ৰান্ত ইঙ্গিত" -#: gtk/gtkwindow.c:651 +#: gtk/gtkwindow.c:675 msgid "" "Hint to help the desktop environment understand what kind of window this is " "and how to treat it." @@ -7372,83 +7179,83 @@ msgstr "" "এটি কি ধৰনেৰ উইন্ডো এবং ইয়াক কিভাবে ব্যৱহাৰ কৰতে হ'ব সে ব্যাপাৰে ডেস্কটপকে " "সাহায্য কৰাৰ বাবে ইঙ্গিত।" -#: gtk/gtkwindow.c:659 +#: gtk/gtkwindow.c:683 msgid "Skip taskbar" msgstr "টাস্কবাৰ এড়িয়ে যাওয়া হোক" -#: gtk/gtkwindow.c:660 +#: gtk/gtkwindow.c:684 msgid "TRUE if the window should not be in the task bar." msgstr "উইন্ডোটি টাস্কবাৰে না থাকলে TRUE ।" -#: gtk/gtkwindow.c:667 +#: gtk/gtkwindow.c:691 msgid "Skip pager" msgstr "পেজাৰ এড়িয়ে যাওয়া হোক" -#: gtk/gtkwindow.c:668 +#: gtk/gtkwindow.c:692 msgid "TRUE if the window should not be in the pager." msgstr "পেজাৰে উইন্ডোটি না থাকলে TRUE ।" -#: gtk/gtkwindow.c:675 +#: gtk/gtkwindow.c:699 msgid "Urgent" msgstr "জৰুৰি" -#: gtk/gtkwindow.c:676 +#: gtk/gtkwindow.c:700 msgid "TRUE if the window should be brought to the user's attention." msgstr "এটিৰ মান সত্য (TRUE) হলে, উইন্ডোকে ব্যৱহাৰকাৰীৰ গোচৰে আনা হ'ব।" -#: gtk/gtkwindow.c:690 +#: gtk/gtkwindow.c:714 msgid "Accept focus" msgstr "ফোকাস অনুমোদন কৰো" -#: gtk/gtkwindow.c:691 +#: gtk/gtkwindow.c:715 msgid "TRUE if the window should receive the input focus." msgstr "উইন্ডোটি ইনপুট ফোকাসৰ লক্ষ্য হলে ইয়াৰ মান TRUE ।" -#: gtk/gtkwindow.c:705 +#: gtk/gtkwindow.c:729 msgid "Focus on map" msgstr "মানচিত্ৰৰ ওপৰ ফ'কাচ কৰো" -#: gtk/gtkwindow.c:706 +#: gtk/gtkwindow.c:730 msgid "TRUE if the window should receive the input focus when mapped." msgstr "ইয়াৰ মান সত্য (TRUE) হলে উইন্ডোটি ইনপুট ফোকাসৰ লক্ষ্য হ'ব।" -#: gtk/gtkwindow.c:720 +#: gtk/gtkwindow.c:744 msgid "Decorated" msgstr "সজ্জিত" -#: gtk/gtkwindow.c:721 +#: gtk/gtkwindow.c:745 msgid "Whether the window should be decorated by the window manager" msgstr "উইন্ডো ব্যৱস্থাপক উইন্ডোটি সজ্জিত কৰিব নে নাই" -#: gtk/gtkwindow.c:735 +#: gtk/gtkwindow.c:759 msgid "Deletable" msgstr "Deletable" -#: gtk/gtkwindow.c:736 +#: gtk/gtkwindow.c:760 msgid "Whether the window frame should have a close button" msgstr "Whether the window frame should have a close button" -#: gtk/gtkwindow.c:752 +#: gtk/gtkwindow.c:776 msgid "Gravity" msgstr "মাধ্যাকৰ্ষণ" -#: gtk/gtkwindow.c:753 +#: gtk/gtkwindow.c:777 msgid "The window gravity of the window" msgstr "এই উইন্ডোটিৰ উইন্ডো মাধ্যাকৰ্ষণ" -#: gtk/gtkwindow.c:770 +#: gtk/gtkwindow.c:794 msgid "Transient for Window" msgstr "উল্লিখিত সময় অবধি" -#: gtk/gtkwindow.c:771 +#: gtk/gtkwindow.c:795 msgid "The transient parent of the dialog" msgstr "parent সৰ্বমোট" -#: gtk/gtkwindow.c:786 +#: gtk/gtkwindow.c:810 msgid "Opacity for Window" msgstr "উল্লিখিত সময় অবধি" -#: gtk/gtkwindow.c:787 +#: gtk/gtkwindow.c:811 msgid "The opacity of the window, from 0 to 1" msgstr "সৰ্বমোট ১" @@ -7468,6 +7275,190 @@ msgstr "IM তৰ অবস্থাসূচক ধৰন" msgid "How to draw the input method statusbar" msgstr "যি ভাবে ইনপুট পদ্ধতিৰ স্ট্যাটাসবাৰ" +#~ msgid "Enable arrow keys" +#~ msgstr "অ্যাৰো (তীৰচিহ্ন প্ৰদৰ্শনকাৰী) কী (Key) সক্ৰিয় কৰো" + +#~ msgid "Whether the arrow keys move through the list of items" +#~ msgstr "" +#~ "অ্যাৰো (তীৰচিহ্ন প্ৰদৰ্শনকাৰী) কী (Key) তালিকাৰ নামগুলোৰ মধ্য দিয়ে চলতে পাৰবে " +#~ "নে নাই" + +#~ msgid "Always enable arrows" +#~ msgstr "সৰ্বদা অ্যাৰো (তীৰচিহ্ন প্ৰদৰ্শনকাৰী) সক্ৰিয় ৰাখা হোক" + +#~ msgid "Obsolete property, ignored" +#~ msgstr "বাতিল বৈশিষ্ট্য, অগ্ৰাহ্য কৰা হৈছে" + +#~ msgid "Case sensitive" +#~ msgstr "বড় বা ছোট হাতেৰ অক্ষৰ পৃথকভাবে বিবেচনা কৰি" + +#~ msgid "Whether list item matching is case sensitive" +#~ msgstr "" +#~ "তালিকাৰ সদস্যদেৰ মিলিয়ে দেখাৰ সময় বড় বা ছোট হাতেৰ অক্ষৰ পৃথকভাবে বিবেচনা কৰা " +#~ "হ'ব নে নাই" + +#~ msgid "Allow empty" +#~ msgstr "ৰিক্ত অনুমোদন কৰো" + +#~ msgid "Whether an empty value may be entered in this field" +#~ msgstr "এই ক্ষেত্ৰে (Field) কোন ৰিক্ত মান লেখা যাব নে নাই" + +#~ msgid "Value in list" +#~ msgstr "মানটি তালিকায় আছে" + +#~ msgid "Whether entered values must already be present in the list" +#~ msgstr "যিসব মান লেখা হ'ব সেগুলো সৰ্বদা তালিকায় থাকতে হ'ব নে নাই" + +#~ msgid "Curve type" +#~ msgstr "বক্ৰৰেখাৰ ধৰন" + +#~ msgid "Is this curve linear, spline interpolated, or free-form" +#~ msgstr "এই বক্ৰৰেখাটি কি লিনিয়াৰ, স্প্লাইন ইন্টাৰপোলাটেড নাকি ফ্ৰী-ফৰ্ম" + +#~ msgid "Minimum X" +#~ msgstr "সৰ্বনিম্ন এক্স অক্ষ" + +#~ msgid "Minimum possible value for X" +#~ msgstr "এক্সৰ সম্ভাব্য সৰ্বনিম্ন মান" + +#~ msgid "Maximum X" +#~ msgstr "এক্স ইয়াৰ সৰ্বোচ্চ মান" + +#~ msgid "Maximum possible X value" +#~ msgstr "এক্সৰ সম্ভাব্য সৰ্বোচ্চ মান" + +#~ msgid "Minimum Y" +#~ msgstr "ওয়াই ইয়াৰ সৰ্বনিম্ন মান" + +#~ msgid "Minimum possible value for Y" +#~ msgstr "ওয়াই ইয়াৰ সম্ভাব্য সৰ্বনিম্ন মান" + +#~ msgid "Maximum Y" +#~ msgstr "ওয়াই ইয়াৰ সৰ্বনিম্ন মান" + +#~ msgid "Maximum possible value for Y" +#~ msgstr "ওয়াই ইয়াৰ সম্ভাব্য সৰ্বোচ্চ মান" + +#~ msgid "File System Backend" +#~ msgstr "ফাইল-সিস্টেম ব্যাকএন্ড" + +#~ msgid "Name of file system backend to use" +#~ msgstr "যি ফাইল-সিস্টেম ব্যাকএন্ড'টি ব্যৱহাৰ কৰা হ'ব তাৰ নাম" + +#~ msgid "The currently selected filename" +#~ msgstr "বৰ্তমানে বাছাইকৃত ফাইলনাম" + +#~ msgid "Show file operations" +#~ msgstr "ফাইল সংক্ৰান্ত কামকৰ্ম দেখানো হোক" + +#~ msgid "Whether buttons for creating/manipulating files should be displayed" +#~ msgstr "ফাইল তৈৰিৰ/পৰিবৰ্তনেৰ বুটাম প্ৰদৰ্শন কৰা হ'ব নে নাই" + +#~ msgid "Tab Border" +#~ msgstr "ট্যাবৰ প্ৰান্ত" + +#~ msgid "Width of the border around the tab labels" +#~ msgstr "ট্যাব লেবেলৰ প্ৰান্তৰ প্ৰস্থ" + +#~ msgid "Horizontal Tab Border" +#~ msgstr "ট্যাবৰ পথালি প্ৰান্ত" + +#~ msgid "Width of the horizontal border of tab labels" +#~ msgstr "ট্যাব লেবেলৰ পথালি প্ৰান্তৰ প্ৰস্থ" + +#~ msgid "Vertical Tab Border" +#~ msgstr "ট্যাবৰ উলম্ব প্ৰান্ত" + +#~ msgid "Width of the vertical border of tab labels" +#~ msgstr "ট্যাব লেবেলৰ উলম্ব প্ৰান্তৰ প্ৰস্থ" + +#~ msgid "Whether tabs should have homogeneous sizes" +#~ msgstr "সকল ট্যাবৰ আকাৰ একই হ'ব নে নাই" + +#~ msgid "Group ID" +#~ msgstr "দল" + +#~ msgid "Group ID for tabs drag and drop" +#~ msgstr "দল উল্লিখিত সময় অবধি" + +#~ msgid "User Data" +#~ msgstr "ব্যৱহাৰকৰ্তাৰ ডাটা" + +#~ msgid "Anonymous User Data Pointer" +#~ msgstr "Anonymous" + +#~ msgid "The menu of options" +#~ msgstr "বিকল্প প্ৰদৰ্শনকাৰী মেনু" + +#~ msgid "Size of dropdown indicator" +#~ msgstr "ড্ৰপডাউন নিৰ্দেশকেৰ আকাৰ" + +#~ msgid "Spacing around indicator" +#~ msgstr "নিৰ্দেশকেৰ চাৰপাশে স্থান স্থাপন" + +#~ msgid "" +#~ "Whether the preview widget should take up the entire space it is allocated" +#~ msgstr "" +#~ "প্ৰাকদৰ্শন উইজেটেৰ বাবে যি পৰিমাণ স্থান বৰাদ্দ কৰা হ'ব তাৰ সম্পূৰ্ণ অংশই ব্যৱহৃত " +#~ "হ'ব নে নাই" + +#~ msgid "The GtkAdjustment connected to the progress bar (Deprecated)" +#~ msgstr "প্ৰগ্ৰেছ বাৰৰ সৈতে যুক্ত GtkAdjustment (অনুমোদিত নয়)" + +#~ msgid "Bar style" +#~ msgstr "বাৰৰ ধৰন" + +#~ msgid "" +#~ "Specifies the visual style of the bar in percentage mode (Deprecated)" +#~ msgstr "শতকৰা হিসাবে বাৰ প্ৰদৰ্শনেৰ ধৰন (অনুমোদিত নয়)" + +#~ msgid "Activity Step" +#~ msgstr "সক্ৰিয়তা নিৰ্দেশক ধাপ" + +#~ msgid "The increment used for each iteration in activity mode (Deprecated)" +#~ msgstr "সক্ৰিয় অবস্থায় প্ৰতিটি ধাপেৰ বাবে যি পৰিমাণ বৃদ্ধি কৰা হ'ব (অনুমোদিত নয়)" + +#~ msgid "Activity Blocks" +#~ msgstr "সক্ৰিয়তা নিৰ্দেশক ব্লক" + +#~ msgid "" +#~ "The number of blocks which can fit in the progress bar area in activity " +#~ "mode (Deprecated)" +#~ msgstr "সক্ৰিয় অবস্থায় প্ৰগ্ৰেছ বাৰে যি সংখ্যক ব্লক ৰাখা যায় (অনুমোদিত নয়)" + +#~ msgid "Discrete Blocks" +#~ msgstr "বিচ্ছিন্ন ব্লক" + +#~ msgid "" +#~ "The number of discrete blocks in a progress bar (when shown in the " +#~ "discrete style)" +#~ msgstr "" +#~ "প্ৰগ্ৰেছ বাৰে প্ৰদৰ্শিত বিচ্ছিন্ন ব্লকেৰ সংখ্যা (যখন বিচ্ছিন্ন অবস্থায় প্ৰদৰ্শন কৰা হয়)" + +#~ msgid "Horizontal adjustment for the text widget" +#~ msgstr "টেক্সট উইজেটেৰ বাবে পথালি সংৰেখন" + +#~ msgid "Vertical adjustment for the text widget" +#~ msgstr "টেক্সট উইজেটেৰ বাবে উলম্ব সংৰেখন" + +#~ msgid "Line Wrap" +#~ msgstr "লাইন গুটানো" + +#~ msgid "Whether lines are wrapped at widget edges" +#~ msgstr "উইজেটেৰ প্ৰান্তে লাইন গুটানো হ'ব নে নাই" + +#~ msgid "Word Wrap" +#~ msgstr "শব্দ গুটানো" + +#~ msgid "Whether words are wrapped at widget edges" +#~ msgstr "শব্দ গুটানো হ'ব নে নাই" + +#~ msgid "Tooltips" +#~ msgstr "টুলটিপ" + +#~ msgid "If the tooltips of the toolbar should be active or not" +#~ msgstr "টুলবাৰৰ টুলটিপ সক্ৰিয় থাকবে নে নাই" + #~ msgid "The orientation of the toolbar" #~ msgstr "টুলবাৰেৰ দিক" diff --git a/po-properties/ast.po b/po-properties/ast.po index 30258d66f5..ca99c587c4 100644 --- a/po-properties/ast.po +++ b/po-properties/ast.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: gtk+-properties\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-03-22 23:35-0400\n" +"POT-Creation-Date: 2010-05-25 20:10-0400\n" "PO-Revision-Date: 2010-01-11 22:48+0100\n" "Last-Translator: astur \n" "Language-Team: Asturian \n" @@ -57,7 +57,7 @@ msgstr "Bits por amuesa" msgid "The number of bits per sample" msgstr "El númberu de bits por amuesa" -#: gdk-pixbuf/gdk-pixbuf.c:132 gtk/gtklayout.c:633 gtk/gtktreeviewcolumn.c:208 +#: gdk-pixbuf/gdk-pixbuf.c:132 gtk/gtklayout.c:597 gtk/gtktreeviewcolumn.c:208 msgid "Width" msgstr "Anchu" @@ -65,7 +65,7 @@ msgstr "Anchu" msgid "The number of columns of the pixbuf" msgstr "El númberu de columnes del búfer d'imaxe" -#: gdk-pixbuf/gdk-pixbuf.c:142 gtk/gtklayout.c:642 +#: gdk-pixbuf/gdk-pixbuf.c:142 gtk/gtklayout.c:606 msgid "Height" msgstr "Altor" @@ -100,7 +100,7 @@ msgid "The default display for GDK" msgstr "La pantalla predeterminada pa GDK" #: gdk/gdkpango.c:538 gtk/gtkinvisible.c:86 gtk/gtkmountoperation.c:176 -#: gtk/gtkstatusicon.c:280 gtk/gtkwindow.c:626 +#: gtk/gtkstatusicon.c:285 gtk/gtkwindow.c:650 msgid "Screen" msgstr "Pantalla" @@ -124,7 +124,7 @@ msgstr "Resolución de la fonte" msgid "The resolution for fonts on the screen" msgstr "La resolución pa les fontes na pantalla" -#: gdk/gdkwindow.c:496 gdk/gdkwindow.c:497 +#: gdk/gdkwindow.c:565 gdk/gdkwindow.c:566 msgid "Cursor" msgstr "Cursor" @@ -246,93 +246,93 @@ msgstr "Axustar llicencia" msgid "Whether to wrap the license text." msgstr "Indica si se tien d'axustar el testu de la llicencia." -#: gtk/gtkaccellabel.c:178 +#: gtk/gtkaccellabel.c:189 msgid "Accelerator Closure" msgstr "Zarru del acelerador" -#: gtk/gtkaccellabel.c:179 +#: gtk/gtkaccellabel.c:190 msgid "The closure to be monitored for accelerator changes" msgstr "El cierre a monitorizar pa cambeos nel acelerador" -#: gtk/gtkaccellabel.c:185 +#: gtk/gtkaccellabel.c:196 msgid "Accelerator Widget" msgstr "Widget acelerador" -#: gtk/gtkaccellabel.c:186 +#: gtk/gtkaccellabel.c:197 msgid "The widget to be monitored for accelerator changes" msgstr "El widget a monitorizar pa cambeos nel acelerador" -#: gtk/gtkaction.c:181 gtk/gtkactiongroup.c:170 gtk/gtkprinter.c:111 +#: gtk/gtkaction.c:220 gtk/gtkactiongroup.c:170 gtk/gtkprinter.c:130 #: gtk/gtktextmark.c:89 msgid "Name" msgstr "Nome" -#: gtk/gtkaction.c:182 +#: gtk/gtkaction.c:221 msgid "A unique name for the action." msgstr "Un nome únicu pa l'aición." -#: gtk/gtkaction.c:200 gtk/gtkbutton.c:219 gtk/gtkexpander.c:195 -#: gtk/gtkframe.c:105 gtk/gtklabel.c:506 gtk/gtkmenuitem.c:305 -#: gtk/gtktoolbutton.c:204 gtk/gtktoolitemgroup.c:1535 +#: gtk/gtkaction.c:239 gtk/gtkbutton.c:227 gtk/gtkexpander.c:195 +#: gtk/gtkframe.c:114 gtk/gtklabel.c:528 gtk/gtkmenuitem.c:305 +#: gtk/gtktoolbutton.c:204 gtk/gtktoolitemgroup.c:1543 msgid "Label" msgstr "Etiqueta" -#: gtk/gtkaction.c:201 +#: gtk/gtkaction.c:240 msgid "The label used for menu items and buttons that activate this action." msgstr "" "La etiqueta que s'usa pa los elementos de menú y botones qu'activen esta " "aición." -#: gtk/gtkaction.c:217 +#: gtk/gtkaction.c:256 msgid "Short label" msgstr "Etiqueta curtia" -#: gtk/gtkaction.c:218 +#: gtk/gtkaction.c:257 msgid "A shorter label that may be used on toolbar buttons." msgstr "" "Una etiqueta más curtia que podría usase nos botones de la barra de " "ferramientes." -#: gtk/gtkaction.c:226 +#: gtk/gtkaction.c:265 msgid "Tooltip" msgstr "Conseyu" -#: gtk/gtkaction.c:227 +#: gtk/gtkaction.c:266 msgid "A tooltip for this action." msgstr "Un conseyu pa esta aición." -#: gtk/gtkaction.c:242 +#: gtk/gtkaction.c:281 msgid "Stock Icon" msgstr "Iconu d'inventariu" -#: gtk/gtkaction.c:243 +#: gtk/gtkaction.c:282 msgid "The stock icon displayed in widgets representing this action." msgstr "L'iconu d'inventariu amosáu nos widgets representando esta aición." -#: gtk/gtkaction.c:263 gtk/gtkstatusicon.c:253 +#: gtk/gtkaction.c:302 gtk/gtkstatusicon.c:258 msgid "GIcon" msgstr "GIcon" -#: gtk/gtkaction.c:264 gtk/gtkcellrendererpixbuf.c:206 gtk/gtkimage.c:339 -#: gtk/gtkstatusicon.c:254 +#: gtk/gtkaction.c:303 gtk/gtkcellrendererpixbuf.c:206 gtk/gtkimage.c:344 +#: gtk/gtkstatusicon.c:259 msgid "The GIcon being displayed" msgstr "L'iconu amosáu" -#: gtk/gtkaction.c:284 gtk/gtkcellrendererpixbuf.c:171 gtk/gtkimage.c:321 -#: gtk/gtkprinter.c:160 gtk/gtkstatusicon.c:237 gtk/gtkwindow.c:618 +#: gtk/gtkaction.c:323 gtk/gtkcellrendererpixbuf.c:171 gtk/gtkimage.c:326 +#: gtk/gtkprinter.c:179 gtk/gtkstatusicon.c:242 gtk/gtkwindow.c:642 msgid "Icon Name" msgstr "Nome del iconu" -#: gtk/gtkaction.c:285 gtk/gtkcellrendererpixbuf.c:172 gtk/gtkimage.c:322 -#: gtk/gtkstatusicon.c:238 +#: gtk/gtkaction.c:324 gtk/gtkcellrendererpixbuf.c:172 gtk/gtkimage.c:327 +#: gtk/gtkstatusicon.c:243 msgid "The name of the icon from the icon theme" msgstr "El nome del iconu del tema d'iconos" -#: gtk/gtkaction.c:292 gtk/gtktoolitem.c:192 +#: gtk/gtkaction.c:331 gtk/gtktoolitem.c:185 msgid "Visible when horizontal" msgstr "Visible si ye horizontal" -#: gtk/gtkaction.c:293 gtk/gtktoolitem.c:193 +#: gtk/gtkaction.c:332 gtk/gtktoolitem.c:186 msgid "" "Whether the toolbar item is visible when the toolbar is in a horizontal " "orientation." @@ -340,11 +340,11 @@ msgstr "" "Indica si l'elementu de la barra de ferramientes ye visible cuando la barra " "tea n'orientación horizontal." -#: gtk/gtkaction.c:308 +#: gtk/gtkaction.c:347 msgid "Visible when overflown" msgstr "Visible cuando rebosa" -#: gtk/gtkaction.c:309 +#: gtk/gtkaction.c:348 msgid "" "When TRUE, toolitem proxies for this action are represented in the toolbar " "overflow menu." @@ -352,11 +352,11 @@ msgstr "" "Cuando seya TRUE, represéntanse elementos de proximidá pa esta aición nel " "menú de rebosamientu de la barra de ferramientes." -#: gtk/gtkaction.c:316 gtk/gtktoolitem.c:199 +#: gtk/gtkaction.c:355 gtk/gtktoolitem.c:192 msgid "Visible when vertical" msgstr "Visible si ye vertical" -#: gtk/gtkaction.c:317 gtk/gtktoolitem.c:200 +#: gtk/gtkaction.c:356 gtk/gtktoolitem.c:193 msgid "" "Whether the toolbar item is visible when the toolbar is in a vertical " "orientation." @@ -364,11 +364,11 @@ msgstr "" "Indica si l'elementu de la barra de ferramientes ye visible cuando la barra " "tea n'orientación vertical." -#: gtk/gtkaction.c:324 gtk/gtktoolitem.c:206 +#: gtk/gtkaction.c:363 gtk/gtktoolitem.c:199 msgid "Is important" msgstr "Ye importante" -#: gtk/gtkaction.c:325 +#: gtk/gtkaction.c:364 msgid "" "Whether the action is considered important. When TRUE, toolitem proxies for " "this action show text in GTK_TOOLBAR_BOTH_HORIZ mode." @@ -376,39 +376,39 @@ msgstr "" "Indica si l'aición considérase importante. Cuando seya TRUE (braero), los " "proxies del elementu toolitem amuesen testu nel mou GTK_TOOLBAR_BOTH_HORIZ." -#: gtk/gtkaction.c:333 +#: gtk/gtkaction.c:372 msgid "Hide if empty" msgstr "Anubrir si ta baleru" -#: gtk/gtkaction.c:334 +#: gtk/gtkaction.c:373 msgid "When TRUE, empty menu proxies for this action are hidden." msgstr "" "Cuando seya TRUE (braero), los proxies de menú baleros pa esta aplicación " "anubriránse." -#: gtk/gtkaction.c:340 gtk/gtkactiongroup.c:177 gtk/gtkcellrenderer.c:193 -#: gtk/gtkwidget.c:593 +#: gtk/gtkaction.c:379 gtk/gtkactiongroup.c:177 gtk/gtkcellrenderer.c:193 +#: gtk/gtkwidget.c:613 msgid "Sensitive" msgstr "Sensible" -#: gtk/gtkaction.c:341 +#: gtk/gtkaction.c:380 msgid "Whether the action is enabled." msgstr "Indica si l'aición ta activada." -#: gtk/gtkaction.c:347 gtk/gtkactiongroup.c:184 gtk/gtkstatusicon.c:296 -#: gtk/gtktreeviewcolumn.c:192 gtk/gtkwidget.c:586 +#: gtk/gtkaction.c:386 gtk/gtkactiongroup.c:184 gtk/gtkstatusicon.c:301 +#: gtk/gtktreeviewcolumn.c:192 gtk/gtkwidget.c:606 msgid "Visible" msgstr "Visible" -#: gtk/gtkaction.c:348 +#: gtk/gtkaction.c:387 msgid "Whether the action is visible." msgstr "Indica si l'aición ye visible." -#: gtk/gtkaction.c:354 +#: gtk/gtkaction.c:393 msgid "Action Group" msgstr "Grupu d'aición" -#: gtk/gtkaction.c:355 +#: gtk/gtkaction.c:394 msgid "" "The GtkActionGroup this GtkAction is associated with, or NULL (for internal " "use)." @@ -416,11 +416,11 @@ msgstr "" "El GtkActionGroup col que ésta GtkAction ta asociada, o NULL (pa usu " "internu)." -#: gtk/gtkaction.c:373 gtk/gtkimagemenuitem.c:169 +#: gtk/gtkaction.c:412 gtk/gtkimagemenuitem.c:169 msgid "Always show image" msgstr "Siempre amosar la imaxe" -#: gtk/gtkaction.c:374 gtk/gtkimagemenuitem.c:170 +#: gtk/gtkaction.c:413 gtk/gtkimagemenuitem.c:170 msgid "Whether the image will always be shown" msgstr "Indica si la imaxe s'amosará siempres" @@ -454,7 +454,7 @@ msgid "Whether to use the related actions appearance properties" msgstr "Indica si hai d'usar les propiedaes d'aspeutu d'aiciones rellacionaes" #: gtk/gtkadjustment.c:93 gtk/gtkcellrendererprogress.c:128 -#: gtk/gtkscalebutton.c:206 gtk/gtkspinbutton.c:269 +#: gtk/gtkscalebutton.c:222 gtk/gtkspinbutton.c:269 msgid "Value" msgstr "Valor" @@ -502,11 +502,11 @@ msgstr "Tamañu de páxina" msgid "The page size of the adjustment" msgstr "El tamañu de páxina del axuste" -#: gtk/gtkalignment.c:90 +#: gtk/gtkalignment.c:117 msgid "Horizontal alignment" msgstr "Alliniación horizontal" -#: gtk/gtkalignment.c:91 gtk/gtkbutton.c:270 +#: gtk/gtkalignment.c:118 gtk/gtkbutton.c:278 msgid "" "Horizontal position of child in available space. 0.0 is left aligned, 1.0 is " "right aligned" @@ -514,11 +514,11 @@ msgstr "" "Posición horizontal del fíu nel espaciu disponible. 0.0 allíniase a la " "esquierda, 1.0 allíniase a la drecha" -#: gtk/gtkalignment.c:100 +#: gtk/gtkalignment.c:127 msgid "Vertical alignment" msgstr "Alliniación vertical" -#: gtk/gtkalignment.c:101 gtk/gtkbutton.c:289 +#: gtk/gtkalignment.c:128 gtk/gtkbutton.c:297 msgid "" "Vertical position of child in available space. 0.0 is top aligned, 1.0 is " "bottom aligned" @@ -526,11 +526,11 @@ msgstr "" "Posición vertical del fíu nel espaciu disponible. 0.0 allíniase arriba, 1.0 " "allíniase abaxo" -#: gtk/gtkalignment.c:109 +#: gtk/gtkalignment.c:136 msgid "Horizontal scale" msgstr "Escala horizontal" -#: gtk/gtkalignment.c:110 +#: gtk/gtkalignment.c:137 msgid "" "If available horizontal space is bigger than needed for the child, how much " "of it to use for the child. 0.0 means none, 1.0 means all" @@ -538,11 +538,11 @@ msgstr "" "Si l'espaciu horizontal disponible ye mayor que'l necesariu pal fíu, cuánto " "se tien d'usar pal fíu. 0.0 significa res, 1.0 significa too" -#: gtk/gtkalignment.c:118 +#: gtk/gtkalignment.c:145 msgid "Vertical scale" msgstr "Escala vertical" -#: gtk/gtkalignment.c:119 +#: gtk/gtkalignment.c:146 msgid "" "If available vertical space is bigger than needed for the child, how much of " "it to use for the child. 0.0 means none, 1.0 means all" @@ -550,187 +550,187 @@ msgstr "" "Si l'espaciu vertical disponible ye mayor que'l necesariu pal fíu, cuánto se " "tien d'usar pal fíu. 0.0 significa res, 1.0 significa too" -#: gtk/gtkalignment.c:136 +#: gtk/gtkalignment.c:163 msgid "Top Padding" msgstr "Rellenu superior" -#: gtk/gtkalignment.c:137 +#: gtk/gtkalignment.c:164 msgid "The padding to insert at the top of the widget." msgstr "El rellenu a introducir per enriba del widget." -#: gtk/gtkalignment.c:153 +#: gtk/gtkalignment.c:180 msgid "Bottom Padding" msgstr "Rellenu inferior" -#: gtk/gtkalignment.c:154 +#: gtk/gtkalignment.c:181 msgid "The padding to insert at the bottom of the widget." msgstr "El rellenu a introducir per debaxo del widget." -#: gtk/gtkalignment.c:170 +#: gtk/gtkalignment.c:197 msgid "Left Padding" msgstr "Rellenu pela esquierda" -#: gtk/gtkalignment.c:171 +#: gtk/gtkalignment.c:198 msgid "The padding to insert at the left of the widget." msgstr "El rellenu a introducir pel llau esquierdu del widget." -#: gtk/gtkalignment.c:187 +#: gtk/gtkalignment.c:214 msgid "Right Padding" msgstr "Rellenu pela drecha" -#: gtk/gtkalignment.c:188 +#: gtk/gtkalignment.c:215 msgid "The padding to insert at the right of the widget." msgstr "El rellenu a introducir pel llau drechu del widget." -#: gtk/gtkarrow.c:75 +#: gtk/gtkarrow.c:95 msgid "Arrow direction" msgstr "Direición de la flecha" -#: gtk/gtkarrow.c:76 +#: gtk/gtkarrow.c:96 msgid "The direction the arrow should point" msgstr "La direición a la que la flecha tendrá d'apuntar" -#: gtk/gtkarrow.c:84 +#: gtk/gtkarrow.c:104 msgid "Arrow shadow" msgstr "Solombra de la flecha" -#: gtk/gtkarrow.c:85 +#: gtk/gtkarrow.c:105 msgid "Appearance of the shadow surrounding the arrow" msgstr "Apariencia de la solombra qu'arrodia la flecha" -#: gtk/gtkarrow.c:92 gtk/gtkmenu.c:711 gtk/gtkmenuitem.c:368 +#: gtk/gtkarrow.c:112 gtk/gtkmenu.c:718 gtk/gtkmenuitem.c:368 msgid "Arrow Scaling" msgstr "Escaláu de fleches" -#: gtk/gtkarrow.c:93 +#: gtk/gtkarrow.c:113 msgid "Amount of space used up by arrow" msgstr "Cantidá d'espaciu ocupáu per flecha" -#: gtk/gtkaspectframe.c:79 +#: gtk/gtkaspectframe.c:93 msgid "Horizontal Alignment" msgstr "Alliniación horizontal" -#: gtk/gtkaspectframe.c:80 +#: gtk/gtkaspectframe.c:94 msgid "X alignment of the child" msgstr "Alliniación X pal fíu" -#: gtk/gtkaspectframe.c:86 +#: gtk/gtkaspectframe.c:100 msgid "Vertical Alignment" msgstr "Alliniación vertical" -#: gtk/gtkaspectframe.c:87 +#: gtk/gtkaspectframe.c:101 msgid "Y alignment of the child" msgstr "Alliniación Y pal fíu" -#: gtk/gtkaspectframe.c:93 +#: gtk/gtkaspectframe.c:107 msgid "Ratio" msgstr "Proporción" -#: gtk/gtkaspectframe.c:94 +#: gtk/gtkaspectframe.c:108 msgid "Aspect ratio if obey_child is FALSE" msgstr "Proporción si obey_child es FALSE" -#: gtk/gtkaspectframe.c:100 +#: gtk/gtkaspectframe.c:114 msgid "Obey child" msgstr "Obedecer al fíu" -#: gtk/gtkaspectframe.c:101 +#: gtk/gtkaspectframe.c:115 msgid "Force aspect ratio to match that of the frame's child" msgstr "Forciar la proporción pa que concase cola forma del fíu" -#: gtk/gtkassistant.c:284 +#: gtk/gtkassistant.c:306 msgid "Header Padding" msgstr "Separtación de la cabecera" -#: gtk/gtkassistant.c:285 +#: gtk/gtkassistant.c:307 msgid "Number of pixels around the header." msgstr "Númberu de píxeles al rodiu de la cabecera." -#: gtk/gtkassistant.c:292 +#: gtk/gtkassistant.c:314 msgid "Content Padding" msgstr "Separtación del conteníu" -#: gtk/gtkassistant.c:293 +#: gtk/gtkassistant.c:315 msgid "Number of pixels around the content pages." msgstr "Númberu de píxeles al rodiu de les páxines de conteníos." -#: gtk/gtkassistant.c:309 +#: gtk/gtkassistant.c:331 msgid "Page type" msgstr "Triba de páxina" -#: gtk/gtkassistant.c:310 +#: gtk/gtkassistant.c:332 msgid "The type of the assistant page" msgstr "La triba de páxina del asistente" -#: gtk/gtkassistant.c:327 +#: gtk/gtkassistant.c:349 msgid "Page title" msgstr "Títulu de páxina" -#: gtk/gtkassistant.c:328 +#: gtk/gtkassistant.c:350 msgid "The title of the assistant page" msgstr "El títulu de la páxina del asistente" -#: gtk/gtkassistant.c:344 +#: gtk/gtkassistant.c:366 msgid "Header image" msgstr "Imaxe de la cabecera" -#: gtk/gtkassistant.c:345 +#: gtk/gtkassistant.c:367 msgid "Header image for the assistant page" msgstr "Imaxe de la cabecera pa la páxina del asistente" -#: gtk/gtkassistant.c:361 +#: gtk/gtkassistant.c:383 msgid "Sidebar image" msgstr "Imaxe de barra llateral" -#: gtk/gtkassistant.c:362 +#: gtk/gtkassistant.c:384 msgid "Sidebar image for the assistant page" msgstr "Imaxe de barra llateral pa la páxina del asistente" -#: gtk/gtkassistant.c:377 +#: gtk/gtkassistant.c:399 msgid "Page complete" msgstr "Páxina completa" -#: gtk/gtkassistant.c:378 +#: gtk/gtkassistant.c:400 msgid "Whether all required fields on the page have been filled out" msgstr "Indica si tolos campos requeríos na páxina se rellenaren" -#: gtk/gtkbbox.c:101 +#: gtk/gtkbbox.c:129 msgid "Minimum child width" msgstr "Anchu mínimu del fíu" -#: gtk/gtkbbox.c:102 +#: gtk/gtkbbox.c:130 msgid "Minimum width of buttons inside the box" msgstr "Anchu mínimu de los botones dientro de la caxa" -#: gtk/gtkbbox.c:110 +#: gtk/gtkbbox.c:138 msgid "Minimum child height" msgstr "Altor mínimu del fíu" -#: gtk/gtkbbox.c:111 +#: gtk/gtkbbox.c:139 msgid "Minimum height of buttons inside the box" msgstr "Altor mínimu de los botones dientro de la caxa" -#: gtk/gtkbbox.c:119 +#: gtk/gtkbbox.c:147 msgid "Child internal width padding" msgstr "Anchu internu de rellenu del fíu" -#: gtk/gtkbbox.c:120 +#: gtk/gtkbbox.c:148 msgid "Amount to increase child's size on either side" msgstr "Cantidá na que s'incrementa el tamañu del fíu per cada llau" -#: gtk/gtkbbox.c:128 +#: gtk/gtkbbox.c:156 msgid "Child internal height padding" msgstr "Altor internu de rellenu del fíu" -#: gtk/gtkbbox.c:129 +#: gtk/gtkbbox.c:157 msgid "Amount to increase child's size on the top and bottom" msgstr "Cantidá na que se incrementa el tamañu del fíu por arriba y por abaxo" -#: gtk/gtkbbox.c:137 +#: gtk/gtkbbox.c:165 msgid "Layout style" msgstr "Estilu de la distribución" -#: gtk/gtkbbox.c:138 +#: gtk/gtkbbox.c:166 msgid "" "How to layout the buttons in the box. Possible values are default, spread, " "edge, start and end" @@ -738,11 +738,11 @@ msgstr "" "Cómo disponer los botones na caxa. Los valores dables son: predetermináu, " "espardíos, esquines, aniciu y final" -#: gtk/gtkbbox.c:146 +#: gtk/gtkbbox.c:174 msgid "Secondary" msgstr "Secundariu" -#: gtk/gtkbbox.c:147 +#: gtk/gtkbbox.c:175 msgid "" "If TRUE, the child appears in a secondary group of children, suitable for, e." "g., help buttons" @@ -750,39 +750,38 @@ msgstr "" "Si ye TRUE, el fíu aparez nún grupu secundariu de fíos, útil por exemplu pa " "botones d'aida." -#: gtk/gtkbox.c:130 gtk/gtkexpander.c:219 gtk/gtkiconview.c:665 +#: gtk/gtkbox.c:217 gtk/gtkexpander.c:219 gtk/gtkiconview.c:667 #: gtk/gtktreeviewcolumn.c:217 msgid "Spacing" msgstr "Espaciáu" -#: gtk/gtkbox.c:131 +#: gtk/gtkbox.c:218 msgid "The amount of space between children" msgstr "La cantidá d'espaciu ente fíos" -#: gtk/gtkbox.c:140 gtk/gtknotebook.c:657 gtk/gtktable.c:165 -#: gtk/gtktoolbar.c:573 gtk/gtktoolitemgroup.c:1588 +#: gtk/gtkbox.c:227 gtk/gtktable.c:165 gtk/gtktoolbar.c:518 +#: gtk/gtktoolitemgroup.c:1596 msgid "Homogeneous" msgstr "Homoxéneu" -#: gtk/gtkbox.c:141 +#: gtk/gtkbox.c:228 msgid "Whether the children should all be the same size" msgstr "Indica si tolos fíos tienen ser del mesmu tamañu" -#: gtk/gtkbox.c:148 gtk/gtkpreview.c:101 gtk/gtktoolbar.c:565 -#: gtk/gtktoolitemgroup.c:1595 gtk/gtktoolpalette.c:1052 -#: gtk/gtktreeviewcolumn.c:273 +#: gtk/gtkbox.c:235 gtk/gtktoolbar.c:510 gtk/gtktoolitemgroup.c:1603 +#: gtk/gtktoolpalette.c:1053 gtk/gtktreeviewcolumn.c:273 msgid "Expand" msgstr "Espander" -#: gtk/gtkbox.c:149 +#: gtk/gtkbox.c:236 msgid "Whether the child should receive extra space when the parent grows" msgstr "Indica si'l fíu tien de recibir espaciu estra cuando'l padre xorrez" -#: gtk/gtkbox.c:155 gtk/gtktoolitemgroup.c:1602 +#: gtk/gtkbox.c:242 gtk/gtktoolitemgroup.c:1610 msgid "Fill" msgstr "Rellenu" -#: gtk/gtkbox.c:156 +#: gtk/gtkbox.c:243 msgid "" "Whether extra space given to the child should be allocated to the child or " "used as padding" @@ -790,19 +789,19 @@ msgstr "" "Indica si tien de dase espaciu estra pa que'l fíu pueda asignase nel fíu o " "usáu como rellenu" -#: gtk/gtkbox.c:162 +#: gtk/gtkbox.c:249 gtk/gtktrayicon-x11.c:163 msgid "Padding" msgstr "Rellenu" -#: gtk/gtkbox.c:163 +#: gtk/gtkbox.c:250 msgid "Extra space to put between the child and its neighbors, in pixels" msgstr "Espaciu estra p'allugar ente'l fíu y los sos vecinos, en píxeles" -#: gtk/gtkbox.c:169 +#: gtk/gtkbox.c:256 msgid "Pack type" msgstr "Triba de empaquetáu" -#: gtk/gtkbox.c:170 gtk/gtknotebook.c:724 +#: gtk/gtkbox.c:257 gtk/gtknotebook.c:667 msgid "" "A GtkPackType indicating whether the child is packed with reference to the " "start or end of the parent" @@ -810,24 +809,24 @@ msgstr "" "Un GtkPackType que indica si'l fíu tendría d'empaquetase con referencia al " "aniciu o al final del padre" -#: gtk/gtkbox.c:176 gtk/gtknotebook.c:702 gtk/gtkpaned.c:241 -#: gtk/gtkruler.c:148 gtk/gtktoolitemgroup.c:1616 +#: gtk/gtkbox.c:263 gtk/gtknotebook.c:645 gtk/gtkpaned.c:242 +#: gtk/gtkruler.c:148 gtk/gtktoolitemgroup.c:1624 msgid "Position" msgstr "Posición" -#: gtk/gtkbox.c:177 gtk/gtknotebook.c:703 +#: gtk/gtkbox.c:264 gtk/gtknotebook.c:646 msgid "The index of the child in the parent" msgstr "La posición del fíu nel padre" -#: gtk/gtkbuilder.c:96 +#: gtk/gtkbuilder.c:314 msgid "Translation Domain" msgstr "Dominiu de torna" -#: gtk/gtkbuilder.c:97 +#: gtk/gtkbuilder.c:315 msgid "The translation domain used by gettext" msgstr "El dominiu de torna qu'usa gettext" -#: gtk/gtkbutton.c:220 +#: gtk/gtkbutton.c:228 msgid "" "Text of the label widget inside the button, if the button contains a label " "widget" @@ -835,12 +834,12 @@ msgstr "" "Testu del widget etiqueta dientro del botón, si'l botón caltién un widget " "etiqueta" -#: gtk/gtkbutton.c:227 gtk/gtkexpander.c:203 gtk/gtklabel.c:527 +#: gtk/gtkbutton.c:235 gtk/gtkexpander.c:203 gtk/gtklabel.c:549 #: gtk/gtkmenuitem.c:320 gtk/gtktoolbutton.c:211 msgid "Use underline" msgstr "Usar solliñáu" -#: gtk/gtkbutton.c:228 gtk/gtkexpander.c:204 gtk/gtklabel.c:528 +#: gtk/gtkbutton.c:236 gtk/gtkexpander.c:204 gtk/gtklabel.c:550 #: gtk/gtkmenuitem.c:321 msgid "" "If set, an underline in the text indicates the next character should be used " @@ -849,70 +848,70 @@ msgstr "" "Si s'esbilla, un solliñáu nel testu indica que'l siguiente caráuter tien " "d'usase como'l nemotécnicu de la combinación de tecles" -#: gtk/gtkbutton.c:235 gtk/gtkimagemenuitem.c:150 +#: gtk/gtkbutton.c:243 gtk/gtkimagemenuitem.c:150 msgid "Use stock" msgstr "Usar inventariu" -#: gtk/gtkbutton.c:236 +#: gtk/gtkbutton.c:244 msgid "" "If set, the label is used to pick a stock item instead of being displayed" msgstr "" "Si s'esbilla, la etiqueta úsase pa tomar un elementu del inventariu en " "llugar d'amosase" -#: gtk/gtkbutton.c:243 gtk/gtkcombobox.c:796 gtk/gtkfilechooserbutton.c:393 +#: gtk/gtkbutton.c:251 gtk/gtkcombobox.c:799 gtk/gtkfilechooserbutton.c:393 msgid "Focus on click" msgstr "Enfocar al calcar" -#: gtk/gtkbutton.c:244 gtk/gtkfilechooserbutton.c:394 +#: gtk/gtkbutton.c:252 gtk/gtkfilechooserbutton.c:394 msgid "Whether the button grabs focus when it is clicked with the mouse" msgstr "Indica si'l botón obtién el focu al calcalu col mur" -#: gtk/gtkbutton.c:251 +#: gtk/gtkbutton.c:259 msgid "Border relief" msgstr "Relieve del berbesu" -#: gtk/gtkbutton.c:252 +#: gtk/gtkbutton.c:260 msgid "The border relief style" msgstr "Estilu del relieve del berbesu" -#: gtk/gtkbutton.c:269 +#: gtk/gtkbutton.c:277 msgid "Horizontal alignment for child" msgstr "Alliniación horizontal pal descendiente" -#: gtk/gtkbutton.c:288 +#: gtk/gtkbutton.c:296 msgid "Vertical alignment for child" msgstr "Alliniación vertical pal descendiente" -#: gtk/gtkbutton.c:305 gtk/gtkimagemenuitem.c:135 +#: gtk/gtkbutton.c:313 gtk/gtkimagemenuitem.c:135 msgid "Image widget" msgstr "Widget imaxe" -#: gtk/gtkbutton.c:306 +#: gtk/gtkbutton.c:314 msgid "Child widget to appear next to the button text" msgstr "Widget fíu qu'aparecerá al llau del testu del botón" -#: gtk/gtkbutton.c:320 +#: gtk/gtkbutton.c:328 msgid "Image position" msgstr "Posición de la imaxe" -#: gtk/gtkbutton.c:321 +#: gtk/gtkbutton.c:329 msgid "The position of the image relative to the text" msgstr "Posición de la imaxe rellativa al testu" -#: gtk/gtkbutton.c:441 +#: gtk/gtkbutton.c:449 msgid "Default Spacing" msgstr "Espaciáu predetermináu" -#: gtk/gtkbutton.c:442 +#: gtk/gtkbutton.c:450 msgid "Extra space to add for GTK_CAN_DEFAULT buttons" msgstr "Espaciu estra a amestar pa los botones GTK_CAN_DEFAULT" -#: gtk/gtkbutton.c:456 +#: gtk/gtkbutton.c:464 msgid "Default Outside Spacing" msgstr "Espaciáu esterior prefetermináu" -#: gtk/gtkbutton.c:457 +#: gtk/gtkbutton.c:465 msgid "" "Extra space to add for GTK_CAN_DEFAULT buttons that is always drawn outside " "the border" @@ -920,31 +919,31 @@ msgstr "" "Espaciu estra a amestar pa los botones GTK_CAN_DEFAULT que tán siempres " "dibuxaos fuera del berbesu" -#: gtk/gtkbutton.c:462 +#: gtk/gtkbutton.c:470 msgid "Child X Displacement" msgstr "Desplazamientu X del fíu" -#: gtk/gtkbutton.c:463 +#: gtk/gtkbutton.c:471 msgid "" "How far in the x direction to move the child when the button is depressed" msgstr "" "Distancia na direición x que tien de movese'l fíu cuando se suelta'l botón" -#: gtk/gtkbutton.c:470 +#: gtk/gtkbutton.c:478 msgid "Child Y Displacement" msgstr "Desplazamientu Y del fíu" -#: gtk/gtkbutton.c:471 +#: gtk/gtkbutton.c:479 msgid "" "How far in the y direction to move the child when the button is depressed" msgstr "" "Distancia na direición y que tien de movese'l fíu cuando se suelta'l botón" -#: gtk/gtkbutton.c:487 +#: gtk/gtkbutton.c:495 msgid "Displace focus" msgstr "Desplazar el focu" -#: gtk/gtkbutton.c:488 +#: gtk/gtkbutton.c:496 msgid "" "Whether the child_displacement_x/_y properties should also affect the focus " "rectangle" @@ -952,27 +951,27 @@ msgstr "" "Indica si les propiedaes child_displacement_x/_y tendría d'afeutar tamién al " "reutángulu del focu" -#: gtk/gtkbutton.c:501 gtk/gtkentry.c:695 gtk/gtkentry.c:1740 +#: gtk/gtkbutton.c:509 gtk/gtkentry.c:697 gtk/gtkentry.c:1742 msgid "Inner Border" msgstr "Berbesu interior" -#: gtk/gtkbutton.c:502 +#: gtk/gtkbutton.c:510 msgid "Border between button edges and child." msgstr "Berbesu ente los berbesos del botón y el fíu." -#: gtk/gtkbutton.c:515 +#: gtk/gtkbutton.c:523 msgid "Image spacing" msgstr "Espaciáu d'imaxe" -#: gtk/gtkbutton.c:516 +#: gtk/gtkbutton.c:524 msgid "Spacing in pixels between the image and label" msgstr "Espaciáu en píxeles ente la imaxe y la etiqueta" -#: gtk/gtkbutton.c:530 +#: gtk/gtkbutton.c:538 msgid "Show button images" msgstr "Amosar imáxenes nos botones" -#: gtk/gtkbutton.c:531 +#: gtk/gtkbutton.c:539 msgid "Whether images should be shown on buttons" msgstr "Indica si se tiened d'mosar les imáxenes nos botones" @@ -1060,11 +1059,11 @@ msgstr "Amosar detalles" msgid "If TRUE, details are shown" msgstr "Si ye TRUE, amuésense los detalles" -#: gtk/gtkcelleditable.c:76 +#: gtk/gtkcelleditable.c:43 msgid "Editing Canceled" msgstr "Encaboxóse la edición" -#: gtk/gtkcelleditable.c:77 +#: gtk/gtkcelleditable.c:44 msgid "Indicates that editing has been canceled" msgstr "Indica qu'encaboxóse la edición" @@ -1184,35 +1183,35 @@ msgstr "Afitar el fondu de la caxella" msgid "Whether this tag affects the cell background color" msgstr "Indica si esta marca afeuta al color de fondu de la caxella" -#: gtk/gtkcellrendereraccel.c:114 +#: gtk/gtkcellrendereraccel.c:124 msgid "Accelerator key" msgstr "Tecla aceleradora" -#: gtk/gtkcellrendereraccel.c:115 +#: gtk/gtkcellrendereraccel.c:125 msgid "The keyval of the accelerator" msgstr "El valor de la tecla del acelerador" -#: gtk/gtkcellrendereraccel.c:131 +#: gtk/gtkcellrendereraccel.c:141 msgid "Accelerator modifiers" msgstr "Modificadores del acelerador" -#: gtk/gtkcellrendereraccel.c:132 +#: gtk/gtkcellrendereraccel.c:142 msgid "The modifier mask of the accelerator" msgstr "La mázcara del modificador del acelerador" -#: gtk/gtkcellrendereraccel.c:149 +#: gtk/gtkcellrendereraccel.c:159 msgid "Accelerator keycode" msgstr "Códigu de tecla del acelerador" -#: gtk/gtkcellrendereraccel.c:150 +#: gtk/gtkcellrendereraccel.c:160 msgid "The hardware keycode of the accelerator" msgstr "El códigu de tecla hardware del acelerador" -#: gtk/gtkcellrendereraccel.c:169 +#: gtk/gtkcellrendereraccel.c:179 msgid "Accelerator Mode" msgstr "Mou del acelerador" -#: gtk/gtkcellrendereraccel.c:170 +#: gtk/gtkcellrendereraccel.c:180 msgid "The type of accelerators" msgstr "La triba d'aceleradores" @@ -1265,7 +1264,7 @@ msgstr "Estensor cerráu pixbuf" msgid "Pixbuf for closed expander" msgstr "El pixbuf pal expansor zarráu" -#: gtk/gtkcellrendererpixbuf.c:135 gtk/gtkimage.c:263 gtk/gtkstatusicon.c:229 +#: gtk/gtkcellrendererpixbuf.c:135 gtk/gtkimage.c:268 gtk/gtkstatusicon.c:234 msgid "Stock ID" msgstr "ID del inventariu" @@ -1274,7 +1273,7 @@ msgid "The stock ID of the stock icon to render" msgstr "El ID inventariu del iconu d'inventariu a renderizar" #: gtk/gtkcellrendererpixbuf.c:143 gtk/gtkcellrendererspinner.c:158 -#: gtk/gtkrecentmanager.c:245 gtk/gtkstatusicon.c:270 +#: gtk/gtkrecentmanager.c:245 gtk/gtkstatusicon.c:275 msgid "Size" msgstr "Tamañu" @@ -1298,7 +1297,7 @@ msgstr "Seguir estáu" msgid "Whether the rendered pixbuf should be colorized according to the state" msgstr "Indica si'l pixbuf renderizáu tendría colorease d'alcuerdu al estáu" -#: gtk/gtkcellrendererpixbuf.c:205 gtk/gtkimage.c:338 gtk/gtkwindow.c:595 +#: gtk/gtkcellrendererpixbuf.c:205 gtk/gtkimage.c:343 gtk/gtkwindow.c:619 msgid "Icon" msgstr "Iconu" @@ -1307,8 +1306,8 @@ msgid "Value of the progress bar" msgstr "Valor de la barra de progresu" #: gtk/gtkcellrendererprogress.c:146 gtk/gtkcellrenderertext.c:195 -#: gtk/gtkentry.c:738 gtk/gtkentrybuffer.c:353 gtk/gtkmessagedialog.c:153 -#: gtk/gtkprogressbar.c:184 gtk/gtktextbuffer.c:198 +#: gtk/gtkentry.c:740 gtk/gtkentrybuffer.c:353 gtk/gtkmessagedialog.c:200 +#: gtk/gtkprogressbar.c:137 gtk/gtktextbuffer.c:198 msgid "Text" msgstr "Testu" @@ -1348,18 +1347,18 @@ msgstr "Alliniación y testu" msgid "The vertical text alignment, from 0 (top) to 1 (bottom)." msgstr "L'alliniación vertical del testu, dende 0 (superior) a 1 (inferior)." -#: gtk/gtkcellrendererprogress.c:221 gtk/gtkiconview.c:729 -#: gtk/gtkorientable.c:74 gtk/gtkprogressbar.c:126 gtk/gtkstatusicon.c:328 -#: gtk/gtktrayicon-x11.c:110 +#: gtk/gtkcellrendererprogress.c:221 gtk/gtkiconview.c:731 +#: gtk/gtkorientable.c:63 gtk/gtkprogressbar.c:112 gtk/gtkstatusicon.c:333 +#: gtk/gtktrayicon-x11.c:122 msgid "Orientation" msgstr "Orientación" -#: gtk/gtkcellrendererprogress.c:222 gtk/gtkprogressbar.c:127 +#: gtk/gtkcellrendererprogress.c:222 gtk/gtkprogressbar.c:113 msgid "Orientation and growth direction of the progress bar" msgstr "Orientación y direición del crecimientu de la barra de progresu" -#: gtk/gtkcellrendererspin.c:93 gtk/gtkprogressbar.c:118 gtk/gtkrange.c:367 -#: gtk/gtkscalebutton.c:225 gtk/gtkspinbutton.c:208 +#: gtk/gtkcellrendererspin.c:93 gtk/gtkrange.c:394 gtk/gtkscalebutton.c:241 +#: gtk/gtkspinbutton.c:208 msgid "Adjustment" msgstr "Axuste" @@ -1384,7 +1383,7 @@ msgid "The number of decimal places to display" msgstr "El númberu de llugares decimales a amosar" #: gtk/gtkcellrendererspinner.c:124 gtk/gtkcheckmenuitem.c:98 -#: gtk/gtkmenu.c:501 gtk/gtkspinner.c:128 gtk/gtktoggleaction.c:119 +#: gtk/gtkmenu.c:508 gtk/gtkspinner.c:128 gtk/gtktoggleaction.c:130 #: gtk/gtktogglebutton.c:115 gtk/gtktoggletoolbutton.c:114 msgid "Active" msgstr "Activu" @@ -1416,7 +1415,7 @@ msgstr "Marcáu" msgid "Marked up text to render" msgstr "Testu resaltáu a renderizar" -#: gtk/gtkcellrenderertext.c:211 gtk/gtklabel.c:513 +#: gtk/gtkcellrenderertext.c:211 gtk/gtklabel.c:535 msgid "Attributes" msgstr "Atributos" @@ -1457,6 +1456,7 @@ msgid "Foreground color as a string" msgstr "Color de primer planu como una cadena" #: gtk/gtkcellrenderertext.c:252 gtk/gtktexttag.c:225 +#: gtk/gtktrayicon-x11.c:131 msgid "Foreground color" msgstr "Color de primer planu" @@ -1464,7 +1464,7 @@ msgstr "Color de primer planu" msgid "Foreground color as a GdkColor" msgstr "Color de primer planu como GdkColor" -#: gtk/gtkcellrenderertext.c:261 gtk/gtkentry.c:662 gtk/gtktexttag.c:251 +#: gtk/gtkcellrenderertext.c:261 gtk/gtkentry.c:664 gtk/gtktexttag.c:251 #: gtk/gtktextview.c:577 msgid "Editable" msgstr "Editable" @@ -1576,7 +1576,7 @@ msgstr "" "como una aida cuando esta renderizando'l testu. Si nun comprende esti " "parámetru dablemente nun lo necesite" -#: gtk/gtkcellrenderertext.c:411 gtk/gtklabel.c:638 gtk/gtkprogressbar.c:206 +#: gtk/gtkcellrenderertext.c:411 gtk/gtklabel.c:660 gtk/gtkprogressbar.c:159 msgid "Ellipsize" msgstr "Elipsis" @@ -1589,11 +1589,11 @@ msgstr "" "caxella nun tien espaciu abondu p'amosar la cadena completa" #: gtk/gtkcellrenderertext.c:431 gtk/gtkfilechooserbutton.c:421 -#: gtk/gtklabel.c:658 +#: gtk/gtklabel.c:681 msgid "Width In Characters" msgstr "Anchu en carauteres" -#: gtk/gtkcellrenderertext.c:432 gtk/gtklabel.c:659 +#: gtk/gtkcellrenderertext.c:432 gtk/gtklabel.c:682 msgid "The desired width of the label, in characters" msgstr "L'anchu deseyáu de la etiqueta, en carauteres" @@ -1609,7 +1609,7 @@ msgstr "" "Cómo frañar la cadena en llinies múltiples, si'l renderizador de la caxella " "nun tien abondu espaciu p'amosar la cadena completa" -#: gtk/gtkcellrenderertext.c:470 gtk/gtkcombobox.c:685 +#: gtk/gtkcellrenderertext.c:470 gtk/gtkcombobox.c:688 msgid "Wrap width" msgstr "Axustar anchu" @@ -1802,11 +1802,11 @@ msgstr "Modelu CellView" msgid "The model for cell view" msgstr "El modelu pa la vista de caxella" -#: gtk/gtkcheckbutton.c:69 gtk/gtkcheckmenuitem.c:121 gtk/gtkoptionmenu.c:168 +#: gtk/gtkcheckbutton.c:69 gtk/gtkcheckmenuitem.c:121 msgid "Indicator Size" msgstr "Tamañu del indicador" -#: gtk/gtkcheckbutton.c:77 gtk/gtkexpander.c:245 gtk/gtkoptionmenu.c:174 +#: gtk/gtkcheckbutton.c:77 gtk/gtkexpander.c:245 msgid "Indicator Spacing" msgstr "Espaciu del indicador" @@ -1844,7 +1844,7 @@ msgstr "Indica si tien de dase o non un valor alfa al color" # components/music/nautilus-music-view.c:198 #: gtk/gtkcolorbutton.c:186 gtk/gtkfilechooserbutton.c:407 -#: gtk/gtkfontbutton.c:142 gtk/gtkprintjob.c:116 gtk/gtkstatusicon.c:424 +#: gtk/gtkfontbutton.c:142 gtk/gtkprintjob.c:116 gtk/gtkstatusicon.c:429 #: gtk/gtktreeviewcolumn.c:265 msgid "Title" msgstr "Títulu" @@ -1853,7 +1853,7 @@ msgstr "Títulu" msgid "The title of the color selection dialog" msgstr "El títulu del diálogu d'Escoyeta del color" -#: gtk/gtkcolorbutton.c:201 gtk/gtkcolorsel.c:293 +#: gtk/gtkcolorbutton.c:201 gtk/gtkcolorsel.c:295 msgid "Current Color" msgstr "Color actual" @@ -1861,7 +1861,7 @@ msgstr "Color actual" msgid "The selected color" msgstr "El color esbilláu" -#: gtk/gtkcolorbutton.c:216 gtk/gtkcolorsel.c:300 +#: gtk/gtkcolorbutton.c:216 gtk/gtkcolorsel.c:302 msgid "Current Alpha" msgstr "Alfa actual" @@ -1870,37 +1870,37 @@ msgid "The selected opacity value (0 fully transparent, 65535 fully opaque)" msgstr "" "El valor d'opacidá actual (0 ye dafechu tresparente, 65535 ye opacu ensembre)" -#: gtk/gtkcolorsel.c:279 +#: gtk/gtkcolorsel.c:281 msgid "Has Opacity Control" msgstr "Tien control d'opacidá" -#: gtk/gtkcolorsel.c:280 +#: gtk/gtkcolorsel.c:282 msgid "Whether the color selector should allow setting opacity" msgstr "Indica si'l selector de color permite seleicionar la opacidá" -#: gtk/gtkcolorsel.c:286 +#: gtk/gtkcolorsel.c:288 msgid "Has palette" msgstr "Tien paleta" -#: gtk/gtkcolorsel.c:287 +#: gtk/gtkcolorsel.c:289 msgid "Whether a palette should be used" msgstr "Indica si se tien d'usar una paleta" -#: gtk/gtkcolorsel.c:294 +#: gtk/gtkcolorsel.c:296 msgid "The current color" msgstr "El color actual" -#: gtk/gtkcolorsel.c:301 +#: gtk/gtkcolorsel.c:303 msgid "The current opacity value (0 fully transparent, 65535 fully opaque)" msgstr "" "El valor de opacidá actual (0 ye dafechu tresparente, 65535 ye opacu " "ensembre)" -#: gtk/gtkcolorsel.c:315 +#: gtk/gtkcolorsel.c:317 msgid "Custom palette" msgstr "Paleta personalizada" -#: gtk/gtkcolorsel.c:316 +#: gtk/gtkcolorsel.c:318 msgid "Palette to use in the color selector" msgstr "Paleta que s'usará nel seleutor de colores" @@ -1936,157 +1936,114 @@ msgstr "Botón Aida" msgid "The help button of the dialog." msgstr "El botón Aida del diálogu." -#: gtk/gtkcombo.c:145 -msgid "Enable arrow keys" -msgstr "Activar tecles de flecha" - -#: gtk/gtkcombo.c:146 -msgid "Whether the arrow keys move through the list of items" -msgstr "" -"Indica si les tecles de flecha se mueven a traviés de la llista d'elementos" - -#: gtk/gtkcombo.c:152 -msgid "Always enable arrows" -msgstr "Siempre activar fleches" - -#: gtk/gtkcombo.c:153 -msgid "Obsolete property, ignored" -msgstr "Propiedá obsoleta, inorada" - -#: gtk/gtkcombo.c:159 -msgid "Case sensitive" -msgstr "Sensible al caso" - -#: gtk/gtkcombo.c:160 -msgid "Whether list item matching is case sensitive" -msgstr "" -"Indica si la llista d'elementos coincidentes ye sensible a la capitalización" - -#: gtk/gtkcombo.c:167 -msgid "Allow empty" -msgstr "Permitir baleru" - -#: gtk/gtkcombo.c:168 -msgid "Whether an empty value may be entered in this field" -msgstr "Indica si se puede introducir nesti campu en valor baleru." - -#: gtk/gtkcombo.c:175 -msgid "Value in list" -msgstr "Valor na llista" - -#: gtk/gtkcombo.c:176 -msgid "Whether entered values must already be present in the list" -msgstr "" -"Indica si los valores introducidos tienen de tar yá presentes na llista" - -#: gtk/gtkcombobox.c:668 +#: gtk/gtkcombobox.c:671 msgid "ComboBox model" msgstr "Modelu de CaxaCombo" -#: gtk/gtkcombobox.c:669 +#: gtk/gtkcombobox.c:672 msgid "The model for the combo box" msgstr "El modelu pa la caxa combo" -#: gtk/gtkcombobox.c:686 +#: gtk/gtkcombobox.c:689 msgid "Wrap width for laying out the items in a grid" msgstr "Axusta l'anchu pa distribuyir los elementos nuna rexella" -#: gtk/gtkcombobox.c:708 +#: gtk/gtkcombobox.c:711 msgid "Row span column" msgstr "Espander fileres a columnes" -#: gtk/gtkcombobox.c:709 +#: gtk/gtkcombobox.c:712 msgid "TreeModel column containing the row span values" msgstr "Columna TreeModel que caltién los valores d'espansión de la filera" -#: gtk/gtkcombobox.c:730 +#: gtk/gtkcombobox.c:733 msgid "Column span column" msgstr "Columna espande columna" -#: gtk/gtkcombobox.c:731 +#: gtk/gtkcombobox.c:734 msgid "TreeModel column containing the column span values" msgstr "Columna TreeModel que caltién los valores d'espansión de columna" -#: gtk/gtkcombobox.c:752 +#: gtk/gtkcombobox.c:755 msgid "Active item" msgstr "Elementu activu" -#: gtk/gtkcombobox.c:753 +#: gtk/gtkcombobox.c:756 msgid "The item which is currently active" msgstr "L'elementu que ta activu anguaño" -#: gtk/gtkcombobox.c:772 gtk/gtkuimanager.c:226 +#: gtk/gtkcombobox.c:775 gtk/gtkuimanager.c:226 msgid "Add tearoffs to menus" msgstr "Amestar tiradores a los menús" -#: gtk/gtkcombobox.c:773 +#: gtk/gtkcombobox.c:776 msgid "Whether dropdowns should have a tearoff menu item" msgstr "" "Indica si los desplegables deben tener un elementu del menú como tirador" -#: gtk/gtkcombobox.c:788 gtk/gtkentry.c:687 +#: gtk/gtkcombobox.c:791 gtk/gtkentry.c:689 msgid "Has Frame" msgstr "Tien marcu" -#: gtk/gtkcombobox.c:789 +#: gtk/gtkcombobox.c:792 msgid "Whether the combo box draws a frame around the child" msgstr "Indica si la caxa combo tien un marcu al rodiu del fíu" -#: gtk/gtkcombobox.c:797 +#: gtk/gtkcombobox.c:800 msgid "Whether the combo box grabs focus when it is clicked with the mouse" msgstr "Indica si la caxa combo obtién el focu cuando se calca col mur" -#: gtk/gtkcombobox.c:812 gtk/gtkmenu.c:556 +#: gtk/gtkcombobox.c:815 gtk/gtkmenu.c:563 msgid "Tearoff Title" msgstr "Títulu del separtador" -#: gtk/gtkcombobox.c:813 +#: gtk/gtkcombobox.c:816 msgid "" "A title that may be displayed by the window manager when the popup is torn-" "off" msgstr "" "Un títulu que podría amosar el xestor de ventanes al desprender l'emerxente" -#: gtk/gtkcombobox.c:830 +#: gtk/gtkcombobox.c:833 msgid "Popup shown" msgstr "Emerxente amosáu" -#: gtk/gtkcombobox.c:831 +#: gtk/gtkcombobox.c:834 msgid "Whether the combo's dropdown is shown" msgstr "Indica si s'amuesa el desplegable del combo" -#: gtk/gtkcombobox.c:847 +#: gtk/gtkcombobox.c:850 msgid "Button Sensitivity" msgstr "Sensibilidá del botón" -#: gtk/gtkcombobox.c:848 +#: gtk/gtkcombobox.c:851 msgid "Whether the dropdown button is sensitive when the model is empty" msgstr "Indica si'l botón desplegable ye sensible cuando'l modelu ta baleru" -#: gtk/gtkcombobox.c:855 +#: gtk/gtkcombobox.c:858 msgid "Appears as list" msgstr "Aparez como una llista" -#: gtk/gtkcombobox.c:856 +#: gtk/gtkcombobox.c:859 msgid "Whether dropdowns should look like lists rather than menus" msgstr "" "Indica si los desplegables tienen de parecese a llistes en vegada de a menús" -#: gtk/gtkcombobox.c:872 +#: gtk/gtkcombobox.c:875 msgid "Arrow Size" msgstr "Tamañu de la flecha" -#: gtk/gtkcombobox.c:873 +#: gtk/gtkcombobox.c:876 msgid "The minimum size of the arrow in the combo box" msgstr "El tamañu mínimu de la flecha na caxa combo" -#: gtk/gtkcombobox.c:888 gtk/gtkentry.c:787 gtk/gtkhandlebox.c:174 -#: gtk/gtkmenubar.c:194 gtk/gtkstatusbar.c:193 gtk/gtktoolbar.c:623 -#: gtk/gtkviewport.c:122 +#: gtk/gtkcombobox.c:891 gtk/gtkentry.c:789 gtk/gtkhandlebox.c:175 +#: gtk/gtkmenubar.c:194 gtk/gtkstatusbar.c:193 gtk/gtktoolbar.c:568 +#: gtk/gtkviewport.c:150 msgid "Shadow type" msgstr "Triba de solombra" -#: gtk/gtkcombobox.c:889 +#: gtk/gtkcombobox.c:892 msgid "Which kind of shadow to draw around the combo box" msgstr "Qué clas de solombra dibuxar al rodiu de la caxa combo" @@ -2114,47 +2071,6 @@ msgstr "Fíu" msgid "Can be used to add a new child to the container" msgstr "Puede usase p'amestar un fíu nuevu al contenedor" -#: gtk/gtkcurve.c:126 -msgid "Curve type" -msgstr "Triba de curva" - -#: gtk/gtkcurve.c:127 -msgid "Is this curve linear, spline interpolated, or free-form" -msgstr "" -"Indica si esta curva ye llinial, interpolada de splines, o forma llibre" - -#: gtk/gtkcurve.c:134 -msgid "Minimum X" -msgstr "X mínimu" - -#: gtk/gtkcurve.c:135 -msgid "Minimum possible value for X" -msgstr "Valor mínimu dable pa X" - -#: gtk/gtkcurve.c:143 -msgid "Maximum X" -msgstr "X máximu" - -#: gtk/gtkcurve.c:144 -msgid "Maximum possible X value" -msgstr "Máximu valor dable pa X" - -#: gtk/gtkcurve.c:152 -msgid "Minimum Y" -msgstr "Y mínimu" - -#: gtk/gtkcurve.c:153 -msgid "Minimum possible value for Y" -msgstr "Valor mínimu dable pa Y" - -#: gtk/gtkcurve.c:161 -msgid "Maximum Y" -msgstr "Y máximu" - -#: gtk/gtkcurve.c:162 -msgid "Maximum possible value for Y" -msgstr "Máximu valor dable pa Y" - #: gtk/gtkdialog.c:145 msgid "Has separator" msgstr "Tien separtador" @@ -2197,49 +2113,49 @@ msgstr "" "Anchor del berbesu al rodiu de la estaya del botón na parte inferior de la " "ventana" -#: gtk/gtkentry.c:634 +#: gtk/gtkentry.c:636 msgid "Text Buffer" msgstr "Búfer de testu" -#: gtk/gtkentry.c:635 +#: gtk/gtkentry.c:637 msgid "Text buffer object which actually stores entry text" msgstr "Oxetu de búfer de testu que daveres atroxa la entrada de testu" -#: gtk/gtkentry.c:642 gtk/gtklabel.c:601 +#: gtk/gtkentry.c:644 gtk/gtklabel.c:623 msgid "Cursor Position" msgstr "Posición del cursor" -#: gtk/gtkentry.c:643 gtk/gtklabel.c:602 +#: gtk/gtkentry.c:645 gtk/gtklabel.c:624 msgid "The current position of the insertion cursor in chars" msgstr "La posición actual del cursor d'inserción en carauteres" -#: gtk/gtkentry.c:652 gtk/gtklabel.c:611 +#: gtk/gtkentry.c:654 gtk/gtklabel.c:633 msgid "Selection Bound" msgstr "Límite d'Escoyeta" -#: gtk/gtkentry.c:653 gtk/gtklabel.c:612 +#: gtk/gtkentry.c:655 gtk/gtklabel.c:634 msgid "" "The position of the opposite end of the selection from the cursor in chars" msgstr "" "La posición en carauteres del estremu aviesu de la Escoyeta dende'l cursor" -#: gtk/gtkentry.c:663 +#: gtk/gtkentry.c:665 msgid "Whether the entry contents can be edited" msgstr "Indica si los conteníos de la entrada pueden editase" -#: gtk/gtkentry.c:670 gtk/gtkentrybuffer.c:383 +#: gtk/gtkentry.c:672 gtk/gtkentrybuffer.c:383 msgid "Maximum length" msgstr "Llargor máximu" -#: gtk/gtkentry.c:671 gtk/gtkentrybuffer.c:384 +#: gtk/gtkentry.c:673 gtk/gtkentrybuffer.c:384 msgid "Maximum number of characters for this entry. Zero if no maximum" msgstr "Cantidá máxima de carauteres pa esta entrada. Cero si nun hai máximu" -#: gtk/gtkentry.c:679 +#: gtk/gtkentry.c:681 msgid "Visibility" msgstr "Visibilidá" -#: gtk/gtkentry.c:680 +#: gtk/gtkentry.c:682 msgid "" "FALSE displays the \"invisible char\" instead of the actual text (password " "mode)" @@ -2247,32 +2163,32 @@ msgstr "" "FALSE amuesa'l «caráuter invisible» en llugar del testu actual (mou " "contraseña)" -#: gtk/gtkentry.c:688 +#: gtk/gtkentry.c:690 msgid "FALSE removes outside bevel from entry" msgstr "FALSE quita'l bisel esterior de la entrada" -#: gtk/gtkentry.c:696 +#: gtk/gtkentry.c:698 msgid "" "Border between text and frame. Overrides the inner-border style property" msgstr "" "Berbesu ente'l testu y el marcu. Toma precedencia sobro la propiedá d'estilu " "del berbesu internu" -#: gtk/gtkentry.c:703 gtk/gtkentry.c:1269 +#: gtk/gtkentry.c:705 gtk/gtkentry.c:1271 msgid "Invisible character" msgstr "Caráuter invisible" -#: gtk/gtkentry.c:704 gtk/gtkentry.c:1270 +#: gtk/gtkentry.c:706 gtk/gtkentry.c:1272 msgid "The character to use when masking entry contents (in \"password mode\")" msgstr "" "El caráuter a usar cuando s'anubren los conteníos de la entrada (en «mou " "contraseña»)" -#: gtk/gtkentry.c:711 +#: gtk/gtkentry.c:713 msgid "Activates default" msgstr "Activar por omisión" -#: gtk/gtkentry.c:712 +#: gtk/gtkentry.c:714 msgid "" "Whether to activate the default widget (such as the default button in a " "dialog) when Enter is pressed" @@ -2280,33 +2196,33 @@ msgstr "" "Indica si se tien d'activar el widget predetermináu (como'l botón " "predetermináu nuna ventana) cuando se calca INTRO" -#: gtk/gtkentry.c:718 +#: gtk/gtkentry.c:720 msgid "Width in chars" msgstr "Anchor en carauteres" -#: gtk/gtkentry.c:719 +#: gtk/gtkentry.c:721 msgid "Number of characters to leave space for in the entry" msgstr "Númberu de carauteres pa dexar d'espaciu pa esta entrada" -#: gtk/gtkentry.c:728 +#: gtk/gtkentry.c:730 msgid "Scroll offset" msgstr "Compensación del desplazamientu" -#: gtk/gtkentry.c:729 +#: gtk/gtkentry.c:731 msgid "Number of pixels of the entry scrolled off the screen to the left" msgstr "" "Cantidá de píxeles de la entrada desplazaos fuera de la pantalla haza la " "esquierda" -#: gtk/gtkentry.c:739 +#: gtk/gtkentry.c:741 msgid "The contents of the entry" msgstr "El conteníu de la entrada" -#: gtk/gtkentry.c:754 gtk/gtkmisc.c:73 +#: gtk/gtkentry.c:756 gtk/gtkmisc.c:73 msgid "X align" msgstr "X alliniación" -#: gtk/gtkentry.c:755 gtk/gtkmisc.c:74 +#: gtk/gtkentry.c:757 gtk/gtkmisc.c:74 msgid "" "The horizontal alignment, from 0 (left) to 1 (right). Reversed for RTL " "layouts." @@ -2314,67 +2230,67 @@ msgstr "" "L'alliniación horizontal, dende 0 (esquierda) fasta 1 (drecha). Al revés pa " "distribuciones D-->I." -#: gtk/gtkentry.c:771 +#: gtk/gtkentry.c:773 msgid "Truncate multiline" msgstr "Truncar multillinia" -#: gtk/gtkentry.c:772 +#: gtk/gtkentry.c:774 msgid "Whether to truncate multiline pastes to one line." msgstr "Indica si se trunquen les pegaes multillinies a una llinia." -#: gtk/gtkentry.c:788 +#: gtk/gtkentry.c:790 msgid "Which kind of shadow to draw around the entry when has-frame is set" msgstr "" "Qué clase de solombra dibuxar al rodiu de la entrada cuando has-frame ta " "activáu" -#: gtk/gtkentry.c:803 gtk/gtktextview.c:657 +#: gtk/gtkentry.c:805 gtk/gtktextview.c:657 msgid "Overwrite mode" msgstr "Mou de sobroscritura" -#: gtk/gtkentry.c:804 +#: gtk/gtkentry.c:806 msgid "Whether new text overwrites existing text" msgstr "Indica si'l testu introducíu sobroscribe l'esistente" -#: gtk/gtkentry.c:818 gtk/gtkentrybuffer.c:368 +#: gtk/gtkentry.c:820 gtk/gtkentrybuffer.c:368 msgid "Text length" msgstr "Llonxitú del testu" -#: gtk/gtkentry.c:819 +#: gtk/gtkentry.c:821 msgid "Length of the text currently in the entry" msgstr "Llonxitú del testu actual na entrada" -#: gtk/gtkentry.c:834 +#: gtk/gtkentry.c:836 msgid "Invisible char set" msgstr "Conxuntu de carauteres invisible" -#: gtk/gtkentry.c:835 +#: gtk/gtkentry.c:837 msgid "Whether the invisible char has been set" msgstr "Indica si s'afitó la invisibilidá de los carauteres" -#: gtk/gtkentry.c:853 +#: gtk/gtkentry.c:855 msgid "Caps Lock warning" msgstr "Alvertencia de bloquéu de mayúscules" -#: gtk/gtkentry.c:854 +#: gtk/gtkentry.c:856 msgid "Whether password entries will show a warning when Caps Lock is on" msgstr "" "Indica si nes entraes de contraseñes s'amuesa una alvertencia cuando'l " "bloquéu de mayúscules ta activu" -#: gtk/gtkentry.c:868 +#: gtk/gtkentry.c:870 msgid "Progress Fraction" msgstr "Fraición de progresu" -#: gtk/gtkentry.c:869 +#: gtk/gtkentry.c:871 msgid "The current fraction of the task that's been completed" msgstr "La fraición actual completada de la xera" -#: gtk/gtkentry.c:886 +#: gtk/gtkentry.c:888 msgid "Progress Pulse Step" msgstr "Progresu del pasu del pulsu" -#: gtk/gtkentry.c:887 +#: gtk/gtkentry.c:889 msgid "" "The fraction of total entry width to move the progress bouncing block for " "each call to gtk_entry_progress_pulse()" @@ -2382,196 +2298,196 @@ msgstr "" "La fraición del anchor total de la entrada pa mover el bloque de rebote de " "progresu pa cada llamada a gtk_entry_progress_pulse()" -#: gtk/gtkentry.c:903 +#: gtk/gtkentry.c:905 msgid "Primary pixbuf" msgstr "Pixbuf primariu" -#: gtk/gtkentry.c:904 +#: gtk/gtkentry.c:906 msgid "Primary pixbuf for the entry" msgstr "El pixbuf primariu pa la entrada" -#: gtk/gtkentry.c:918 +#: gtk/gtkentry.c:920 msgid "Secondary pixbuf" msgstr "Pixbuf secundariu" -#: gtk/gtkentry.c:919 +#: gtk/gtkentry.c:921 msgid "Secondary pixbuf for the entry" msgstr "El pixbuf secundariu pa la entrada" -#: gtk/gtkentry.c:933 +#: gtk/gtkentry.c:935 msgid "Primary stock ID" msgstr "ID d'atroxamientu primariu" -#: gtk/gtkentry.c:934 +#: gtk/gtkentry.c:936 msgid "Stock ID for primary icon" msgstr "ID d'atroxamientu pal iconu primariu" -#: gtk/gtkentry.c:948 +#: gtk/gtkentry.c:950 msgid "Secondary stock ID" msgstr "ID d'atroxamientu secundariu" -#: gtk/gtkentry.c:949 +#: gtk/gtkentry.c:951 msgid "Stock ID for secondary icon" msgstr "ID d'atroxamientu pal iconu secundariu" -#: gtk/gtkentry.c:963 +#: gtk/gtkentry.c:965 msgid "Primary icon name" msgstr "Nome del iconu primariu" -#: gtk/gtkentry.c:964 +#: gtk/gtkentry.c:966 msgid "Icon name for primary icon" msgstr "Nome del iconu pal iconu primariu" -#: gtk/gtkentry.c:978 +#: gtk/gtkentry.c:980 msgid "Secondary icon name" msgstr "Nome del iconu secundariu" -#: gtk/gtkentry.c:979 +#: gtk/gtkentry.c:981 msgid "Icon name for secondary icon" msgstr "Nome del iconu pal iconu secundariu" -#: gtk/gtkentry.c:993 +#: gtk/gtkentry.c:995 msgid "Primary GIcon" msgstr "GIcon primariu" -#: gtk/gtkentry.c:994 +#: gtk/gtkentry.c:996 msgid "GIcon for primary icon" msgstr "GIcon pal iconu primariu" -#: gtk/gtkentry.c:1008 +#: gtk/gtkentry.c:1010 msgid "Secondary GIcon" msgstr "GIcon secundariu" -#: gtk/gtkentry.c:1009 +#: gtk/gtkentry.c:1011 msgid "GIcon for secondary icon" msgstr "GIcon pal iconu secundariu" -#: gtk/gtkentry.c:1023 +#: gtk/gtkentry.c:1025 msgid "Primary storage type" msgstr "Triba d'atroxamientu primariu" -#: gtk/gtkentry.c:1024 +#: gtk/gtkentry.c:1026 msgid "The representation being used for primary icon" msgstr "La representación emplegada pal iconu primariu" -#: gtk/gtkentry.c:1039 +#: gtk/gtkentry.c:1041 msgid "Secondary storage type" msgstr "Triba d'atroxamientu secundariu" -#: gtk/gtkentry.c:1040 +#: gtk/gtkentry.c:1042 msgid "The representation being used for secondary icon" msgstr "La representación emplegada pal iconu secundariu" -#: gtk/gtkentry.c:1061 +#: gtk/gtkentry.c:1063 msgid "Primary icon activatable" msgstr "Iconu primariu activable" -#: gtk/gtkentry.c:1062 +#: gtk/gtkentry.c:1064 msgid "Whether the primary icon is activatable" msgstr "Indica si l'iconu primariu ye activable" -#: gtk/gtkentry.c:1082 +#: gtk/gtkentry.c:1084 msgid "Secondary icon activatable" msgstr "Iconu secundariu activable" -#: gtk/gtkentry.c:1083 +#: gtk/gtkentry.c:1085 msgid "Whether the secondary icon is activatable" msgstr "Indica si l'iconu secundariu ye activable" -#: gtk/gtkentry.c:1105 +#: gtk/gtkentry.c:1107 msgid "Primary icon sensitive" msgstr "Sensibilidá del iconu primariu" -#: gtk/gtkentry.c:1106 +#: gtk/gtkentry.c:1108 msgid "Whether the primary icon is sensitive" msgstr "Indica si l'iconu primariu ye sensible" -#: gtk/gtkentry.c:1127 +#: gtk/gtkentry.c:1129 msgid "Secondary icon sensitive" msgstr "Sensibilidá del iconu secundariu" -#: gtk/gtkentry.c:1128 +#: gtk/gtkentry.c:1130 msgid "Whether the secondary icon is sensitive" msgstr "Indica si l'iconu secundariu ye sensible" -#: gtk/gtkentry.c:1144 +#: gtk/gtkentry.c:1146 msgid "Primary icon tooltip text" msgstr "Testu del conseyu del iconu primariu" -#: gtk/gtkentry.c:1145 gtk/gtkentry.c:1181 +#: gtk/gtkentry.c:1147 gtk/gtkentry.c:1183 msgid "The contents of the tooltip on the primary icon" msgstr "El conteníu del conseyu pal iconu primariu" -#: gtk/gtkentry.c:1161 +#: gtk/gtkentry.c:1163 msgid "Secondary icon tooltip text" msgstr "Testu del conseyu del iconu secundariu" -#: gtk/gtkentry.c:1162 gtk/gtkentry.c:1200 +#: gtk/gtkentry.c:1164 gtk/gtkentry.c:1202 msgid "The contents of the tooltip on the secondary icon" msgstr "El conteníu del conseyu pal iconu secundariu" -#: gtk/gtkentry.c:1180 +#: gtk/gtkentry.c:1182 msgid "Primary icon tooltip markup" msgstr "Marcáu del conseyu del iconu primariu" -#: gtk/gtkentry.c:1199 +#: gtk/gtkentry.c:1201 msgid "Secondary icon tooltip markup" msgstr "Marcáu del conseyu del iconu secundariu" -#: gtk/gtkentry.c:1219 gtk/gtktextview.c:685 +#: gtk/gtkentry.c:1221 gtk/gtktextview.c:685 msgid "IM module" msgstr "Módulu ME" -#: gtk/gtkentry.c:1220 gtk/gtktextview.c:686 +#: gtk/gtkentry.c:1222 gtk/gtktextview.c:686 msgid "Which IM module should be used" msgstr "Qué módulu de ME se tien d'usar" -#: gtk/gtkentry.c:1234 +#: gtk/gtkentry.c:1236 msgid "Icon Prelight" msgstr "Illuminación d'iconu" -#: gtk/gtkentry.c:1235 +#: gtk/gtkentry.c:1237 msgid "Whether activatable icons should prelight when hovered" msgstr "" "Indica si los iconos activables tienen d'illuminase al pasar el mur sobro " "ellos" -#: gtk/gtkentry.c:1248 +#: gtk/gtkentry.c:1250 msgid "Progress Border" msgstr "Berbesu del progresu" -#: gtk/gtkentry.c:1249 +#: gtk/gtkentry.c:1251 msgid "Border around the progress bar" msgstr "Berbesu al rodiu de la barra de progresu" -#: gtk/gtkentry.c:1741 +#: gtk/gtkentry.c:1743 msgid "Border between text and frame." msgstr "Berbesu ente'l testu y el marcu." -#: gtk/gtkentry.c:1755 +#: gtk/gtkentry.c:1757 msgid "State Hint" msgstr "Suxerencia d'estáu" -#: gtk/gtkentry.c:1756 +#: gtk/gtkentry.c:1758 msgid "Whether to pass a proper state when drawing shadow or background" msgstr "" "Indica si se tien de pasar un estáu apropiáu al dibuxar una solombra o fondu" -#: gtk/gtkentry.c:1761 gtk/gtklabel.c:858 +#: gtk/gtkentry.c:1763 gtk/gtklabel.c:882 msgid "Select on focus" msgstr "Seleicionar nel focu" -#: gtk/gtkentry.c:1762 +#: gtk/gtkentry.c:1764 msgid "Whether to select the contents of an entry when it is focused" msgstr "" "Indica si se tienen seleicionar los conteníos d'una entrada cuando obtién el " "focu" -#: gtk/gtkentry.c:1776 +#: gtk/gtkentry.c:1778 msgid "Password Hint Timeout" msgstr "Tiempu d'espiración del hint de contraseña" -#: gtk/gtkentry.c:1777 +#: gtk/gtkentry.c:1779 msgid "How long to show the last input character in hidden entries" msgstr "" "Indica durante cuánto tiempu amosar el caberu caráuter nes entraes anubríes" @@ -2600,7 +2516,7 @@ msgstr "Llonxitú mínima de contraseña" msgid "Minimum length of the search key in order to look up matches" msgstr "Llonxitú mínima de la contraseña de busca pa guetar coincidencies" -#: gtk/gtkentrycompletion.c:303 gtk/gtkiconview.c:586 +#: gtk/gtkentrycompletion.c:303 gtk/gtkiconview.c:588 msgid "Text column" msgstr "Columna de testu" @@ -2684,11 +2600,11 @@ msgstr "Indica si l'estensor s'abrió pa revelar el widget fíu" msgid "Text of the expander's label" msgstr "Testu de la etiqueta del estensor" -#: gtk/gtkexpander.c:211 gtk/gtklabel.c:520 +#: gtk/gtkexpander.c:211 gtk/gtklabel.c:542 msgid "Use markup" msgstr "Usar marcáu" -#: gtk/gtkexpander.c:212 gtk/gtklabel.c:521 +#: gtk/gtkexpander.c:212 gtk/gtklabel.c:543 msgid "The text of the label includes XML markup. See pango_parse_markup()" msgstr "El testu de la etiqueta incluye marques XML. Ver pango_parse_markup()" @@ -2696,8 +2612,8 @@ msgstr "El testu de la etiqueta incluye marques XML. Ver pango_parse_markup()" msgid "Space to put between the label and the child" msgstr "Espaciu p'allugar ente la etiqueta y el fíu" -#: gtk/gtkexpander.c:229 gtk/gtkframe.c:147 gtk/gtktoolbutton.c:218 -#: gtk/gtktoolitemgroup.c:1542 +#: gtk/gtkexpander.c:229 gtk/gtkframe.c:156 gtk/gtktoolbutton.c:218 +#: gtk/gtktoolitemgroup.c:1550 msgid "Label widget" msgstr "Widget etiqueta" @@ -2705,11 +2621,11 @@ msgstr "Widget etiqueta" msgid "A widget to display in place of the usual expander label" msgstr "Un widget p'amosar en llugar de la etiqueta usual del estensor" -#: gtk/gtkexpander.c:236 gtk/gtktoolitemgroup.c:1570 gtk/gtktreeview.c:777 +#: gtk/gtkexpander.c:236 gtk/gtktoolitemgroup.c:1578 gtk/gtktreeview.c:779 msgid "Expander Size" msgstr "Tamañu del estensor" -#: gtk/gtkexpander.c:237 gtk/gtktoolitemgroup.c:1571 gtk/gtktreeview.c:778 +#: gtk/gtkexpander.c:237 gtk/gtktoolitemgroup.c:1579 gtk/gtktreeview.c:780 msgid "Size of the expander arrow" msgstr "Tamañu de la flecha del estensor" @@ -2717,97 +2633,89 @@ msgstr "Tamañu de la flecha del estensor" msgid "Spacing around expander arrow" msgstr "Espaciáu al rodiu de la flecha del estensor" -#: gtk/gtkfilechooser.c:758 +#: gtk/gtkfilechooser.c:759 msgid "Action" msgstr "Aición" -#: gtk/gtkfilechooser.c:759 +#: gtk/gtkfilechooser.c:760 msgid "The type of operation that the file selector is performing" msgstr "La triba d'operación que'l seleutor de ficheru ta faciendo" -#: gtk/gtkfilechooser.c:765 -msgid "File System Backend" -msgstr "Backend del sistema de ficheros" - -#: gtk/gtkfilechooser.c:766 -msgid "Name of file system backend to use" -msgstr "Nome del backend del sistema de ficheros a usar" - -#: gtk/gtkfilechooser.c:771 gtk/gtkrecentchooser.c:264 +#: gtk/gtkfilechooser.c:766 gtk/gtkrecentchooser.c:281 msgid "Filter" msgstr "Filtru" -#: gtk/gtkfilechooser.c:772 +#: gtk/gtkfilechooser.c:767 msgid "The current filter for selecting which files are displayed" msgstr "El filtru actual pa seleicionar qué ficheros se tan amosando" -#: gtk/gtkfilechooser.c:777 +#: gtk/gtkfilechooser.c:772 msgid "Local Only" msgstr "Namái llocal" -#: gtk/gtkfilechooser.c:778 +#: gtk/gtkfilechooser.c:773 msgid "Whether the selected file(s) should be limited to local file: URLs" msgstr "" "Indica si los ficheros esbillaos tendríen de llimitase a ficheros llocales: " "URLs" -#: gtk/gtkfilechooser.c:783 +#: gtk/gtkfilechooser.c:778 msgid "Preview widget" msgstr "Widget de vista previa" -#: gtk/gtkfilechooser.c:784 +#: gtk/gtkfilechooser.c:779 msgid "Application supplied widget for custom previews." msgstr "Widget d'aplicación suministráu pa vistes prelliminares personalizaes." -#: gtk/gtkfilechooser.c:789 +#: gtk/gtkfilechooser.c:784 msgid "Preview Widget Active" msgstr "Widget de vista previa activu" -#: gtk/gtkfilechooser.c:790 +#: gtk/gtkfilechooser.c:785 msgid "" "Whether the application supplied widget for custom previews should be shown." msgstr "" "Indica si'l widget suministráu pola aplicación pa vistes previes " "personalizaes tendría d'amosase." -#: gtk/gtkfilechooser.c:795 +#: gtk/gtkfilechooser.c:790 msgid "Use Preview Label" msgstr "Usar etiqueta de vista previa" -#: gtk/gtkfilechooser.c:796 +#: gtk/gtkfilechooser.c:791 msgid "Whether to display a stock label with the name of the previewed file." msgstr "" "Indica si se tien d'amosar una etiqueta col nome del ficheru previsualizáu." -#: gtk/gtkfilechooser.c:801 +#: gtk/gtkfilechooser.c:796 msgid "Extra widget" msgstr "Widget estra" -#: gtk/gtkfilechooser.c:802 +#: gtk/gtkfilechooser.c:797 msgid "Application supplied widget for extra options." msgstr "Widget d'aplicación suministráu pa opciones estra." -#: gtk/gtkfilechooser.c:807 gtk/gtkfilesel.c:540 gtk/gtkrecentchooser.c:203 +#: gtk/gtkfilechooser.c:802 gtk/gtkrecentchooser.c:220 msgid "Select Multiple" msgstr "Escoyeta múltiple" -#: gtk/gtkfilechooser.c:808 gtk/gtkfilesel.c:541 +#: gtk/gtkfilechooser.c:803 msgid "Whether to allow multiple files to be selected" msgstr "Indica si se pueden esbilalr múltiples ficheros" -#: gtk/gtkfilechooser.c:814 +#: gtk/gtkfilechooser.c:809 msgid "Show Hidden" msgstr "Amosar anubríos" -#: gtk/gtkfilechooser.c:815 +#: gtk/gtkfilechooser.c:810 msgid "Whether the hidden files and folders should be displayed" msgstr "Indica si los ficheros y carpetes anubríes tienen d'amosase" -#: gtk/gtkfilechooser.c:830 +#: gtk/gtkfilechooser.c:825 msgid "Do overwrite confirmation" msgstr "Facer confirmación de sobroscritura" -#: gtk/gtkfilechooser.c:831 +#: gtk/gtkfilechooser.c:826 msgid "" "Whether a file chooser in save mode will present an overwrite confirmation " "dialog if necessary." @@ -2815,11 +2723,11 @@ msgstr "" "Indica si un seleutor de ficheros en mou guardar presentará un diálogu de " "confirmación de sobroscritura si fuese necesariu." -#: gtk/gtkfilechooser.c:847 +#: gtk/gtkfilechooser.c:842 msgid "Allow folders creation" msgstr "Permitir la creación de carpetes" -#: gtk/gtkfilechooser.c:848 +#: gtk/gtkfilechooser.c:843 msgid "" "Whether a file chooser not in open mode will offer the user to create new " "folders." @@ -2843,37 +2751,19 @@ msgstr "El títulu del diálogu d'Escoyeta de ficheros" msgid "The desired width of the button widget, in characters." msgstr "L'anchu deseyáu del widget del botón, en carauteres." -#: gtk/gtkfilesel.c:526 gtk/gtkimage.c:254 gtk/gtkrecentmanager.c:214 -#: gtk/gtkstatusicon.c:221 -msgid "Filename" -msgstr "Nome de ficheru" - -#: gtk/gtkfilesel.c:527 -msgid "The currently selected filename" -msgstr "El nome del ficheru anguaño esbilláu" - -#: gtk/gtkfilesel.c:533 -msgid "Show file operations" -msgstr "Amosar operaciones de ficheru" - -#: gtk/gtkfilesel.c:534 -msgid "Whether buttons for creating/manipulating files should be displayed" -msgstr "" -"Indica si los botones de creación/manipulación de ficheros tienen d'amosase" - -#: gtk/gtkfixed.c:90 gtk/gtklayout.c:597 +#: gtk/gtkfixed.c:90 gtk/gtklayout.c:561 msgid "X position" msgstr "Posición X" -#: gtk/gtkfixed.c:91 gtk/gtklayout.c:598 +#: gtk/gtkfixed.c:91 gtk/gtklayout.c:562 msgid "X position of child widget" msgstr "Posición X del widget fíu" -#: gtk/gtkfixed.c:100 gtk/gtklayout.c:607 +#: gtk/gtkfixed.c:100 gtk/gtklayout.c:571 msgid "Y position" msgstr "Posición Y" -#: gtk/gtkfixed.c:101 gtk/gtklayout.c:608 +#: gtk/gtkfixed.c:101 gtk/gtklayout.c:572 msgid "Y position of child widget" msgstr "Posición Y del widget fíu" @@ -2941,59 +2831,59 @@ msgstr "Vista previa del testu" msgid "The text to display in order to demonstrate the selected font" msgstr "El testu a amosar como exemplu p'amosar la fonte esbillada" -#: gtk/gtkframe.c:106 +#: gtk/gtkframe.c:115 msgid "Text of the frame's label" msgstr "Testu de la etiqueta del marcu" -#: gtk/gtkframe.c:113 +#: gtk/gtkframe.c:122 msgid "Label xalign" msgstr "xalign de la etiqueta" -#: gtk/gtkframe.c:114 +#: gtk/gtkframe.c:123 msgid "The horizontal alignment of the label" msgstr "L'alliniación horizontal de la etiqueta" -#: gtk/gtkframe.c:122 +#: gtk/gtkframe.c:131 msgid "Label yalign" msgstr "yalign de la etiqueta" -#: gtk/gtkframe.c:123 +#: gtk/gtkframe.c:132 msgid "The vertical alignment of the label" msgstr "L'alliniación vertical de la etiqueta" -#: gtk/gtkframe.c:131 gtk/gtkhandlebox.c:167 +#: gtk/gtkframe.c:140 gtk/gtkhandlebox.c:168 msgid "Deprecated property, use shadow_type instead" msgstr "Propiedá obsoleta, use shadow_type en so llugar" -#: gtk/gtkframe.c:138 +#: gtk/gtkframe.c:147 msgid "Frame shadow" msgstr "Solombra del marcu" -#: gtk/gtkframe.c:139 +#: gtk/gtkframe.c:148 msgid "Appearance of the frame border" msgstr "Aspeutu del berbesu del marcu" -#: gtk/gtkframe.c:148 +#: gtk/gtkframe.c:157 msgid "A widget to display in place of the usual frame label" msgstr "Un widget a amosar n'arróu de la usual etiqueta del marcu" -#: gtk/gtkhandlebox.c:175 +#: gtk/gtkhandlebox.c:176 msgid "Appearance of the shadow that surrounds the container" msgstr "Aspeutu de la solombra qu'arrodia al contenedor" -#: gtk/gtkhandlebox.c:183 +#: gtk/gtkhandlebox.c:184 msgid "Handle position" msgstr "Remanador de posición" -#: gtk/gtkhandlebox.c:184 +#: gtk/gtkhandlebox.c:185 msgid "Position of the handle relative to the child widget" msgstr "Posición del remanador rellativu al widget fíu" -#: gtk/gtkhandlebox.c:192 +#: gtk/gtkhandlebox.c:193 msgid "Snap edge" msgstr "Berbesu axustáu" -#: gtk/gtkhandlebox.c:193 +#: gtk/gtkhandlebox.c:194 msgid "" "Side of the handlebox that's lined up with the docking point to dock the " "handlebox" @@ -3001,11 +2891,11 @@ msgstr "" "Llau de la caxa remanadora que ta alliniada col puntu d'anclaxe pa bloquiar " "la caxa remanadora" -#: gtk/gtkhandlebox.c:201 +#: gtk/gtkhandlebox.c:202 msgid "Snap edge set" msgstr "Afitar el quiebre del berbesu" -#: gtk/gtkhandlebox.c:202 +#: gtk/gtkhandlebox.c:203 msgid "" "Whether to use the value from the snap_edge property or a value derived from " "handle_position" @@ -3013,11 +2903,11 @@ msgstr "" "Indica si se tien d'usar el valor dende la propiedá snap_edge o un valor " "deriváu de handle_position" -#: gtk/gtkhandlebox.c:209 +#: gtk/gtkhandlebox.c:210 msgid "Child Detached" msgstr "Fíu desacopláu" -#: gtk/gtkhandlebox.c:210 +#: gtk/gtkhandlebox.c:211 msgid "" "A boolean value indicating whether the handlebox's child is attached or " "detached." @@ -3025,212 +2915,216 @@ msgstr "" "Una variable booleana indicando si'l fíu del remanador de la caxa ta acopláu " "o desacopláu." -#: gtk/gtkiconview.c:549 +#: gtk/gtkiconview.c:551 msgid "Selection mode" msgstr "Mou d'Escoyeta" -#: gtk/gtkiconview.c:550 +#: gtk/gtkiconview.c:552 msgid "The selection mode" msgstr "El mou d'Escoyeta" -#: gtk/gtkiconview.c:568 +#: gtk/gtkiconview.c:570 msgid "Pixbuf column" msgstr "Columna de pixbuf" -#: gtk/gtkiconview.c:569 +#: gtk/gtkiconview.c:571 msgid "Model column used to retrieve the icon pixbuf from" msgstr "Columna modelu usada pa obtener el pixbuf del iconu" -#: gtk/gtkiconview.c:587 +#: gtk/gtkiconview.c:589 msgid "Model column used to retrieve the text from" msgstr "Columna modelu usada pa obtener el testu" -#: gtk/gtkiconview.c:606 +#: gtk/gtkiconview.c:608 msgid "Markup column" msgstr "Columna de marcáu" -#: gtk/gtkiconview.c:607 +#: gtk/gtkiconview.c:609 msgid "Model column used to retrieve the text if using Pango markup" msgstr "Columna modelu usada pa obtener el testu si s'usa marcáu Pango" -#: gtk/gtkiconview.c:614 +#: gtk/gtkiconview.c:616 msgid "Icon View Model" msgstr "Modelu de vista d'iconu" -#: gtk/gtkiconview.c:615 +#: gtk/gtkiconview.c:617 msgid "The model for the icon view" msgstr "El modelu pa la vista d'iconu" -#: gtk/gtkiconview.c:631 +#: gtk/gtkiconview.c:633 msgid "Number of columns" msgstr "Númberu de columnes" -#: gtk/gtkiconview.c:632 +#: gtk/gtkiconview.c:634 msgid "Number of columns to display" msgstr "El númberu de columnes que s'amosarán" -#: gtk/gtkiconview.c:649 +#: gtk/gtkiconview.c:651 msgid "Width for each item" msgstr "Anchu de cada elementu" -#: gtk/gtkiconview.c:650 +#: gtk/gtkiconview.c:652 msgid "The width used for each item" msgstr "L'anchu usáu por cada elementu" -#: gtk/gtkiconview.c:666 +#: gtk/gtkiconview.c:668 msgid "Space which is inserted between cells of an item" msgstr "Espaciu que s'introduz ente les caxelles d'un elementu" -#: gtk/gtkiconview.c:681 +#: gtk/gtkiconview.c:683 msgid "Row Spacing" msgstr "Espaciáu ente fileres" -#: gtk/gtkiconview.c:682 +#: gtk/gtkiconview.c:684 msgid "Space which is inserted between grid rows" msgstr "Espaciu que s'introduz ente les fileres de la rexella" -#: gtk/gtkiconview.c:697 +#: gtk/gtkiconview.c:699 msgid "Column Spacing" msgstr "Espaciáu ente columnes" -#: gtk/gtkiconview.c:698 +#: gtk/gtkiconview.c:700 msgid "Space which is inserted between grid columns" msgstr "Espaciu que s'inxerta ente les columnes de la rexella" -#: gtk/gtkiconview.c:713 +#: gtk/gtkiconview.c:715 msgid "Margin" msgstr "Marxe" -#: gtk/gtkiconview.c:714 +#: gtk/gtkiconview.c:716 msgid "Space which is inserted at the edges of the icon view" msgstr "Espaciu que s'introduz ente los berbesos de la vista d'iconu" -#: gtk/gtkiconview.c:730 +#: gtk/gtkiconview.c:732 msgid "" "How the text and icon of each item are positioned relative to each other" msgstr "" "Cómo s'alluguen el testu y l'iconu pa cada elementu rellativu a los demás" -#: gtk/gtkiconview.c:746 gtk/gtktreeview.c:612 gtk/gtktreeviewcolumn.c:308 +#: gtk/gtkiconview.c:748 gtk/gtktreeview.c:614 gtk/gtktreeviewcolumn.c:308 msgid "Reorderable" msgstr "Reordenable" -#: gtk/gtkiconview.c:747 gtk/gtktreeview.c:613 +#: gtk/gtkiconview.c:749 gtk/gtktreeview.c:615 msgid "View is reorderable" msgstr "Vista ye reordenable" -#: gtk/gtkiconview.c:754 gtk/gtktreeview.c:763 +#: gtk/gtkiconview.c:756 gtk/gtktreeview.c:765 msgid "Tooltip Column" msgstr "Columna de pista" -#: gtk/gtkiconview.c:755 +#: gtk/gtkiconview.c:757 msgid "The column in the model containing the tooltip texts for the items" msgstr "La columna nel modelu que caltién los testos pista pa los elementos" -#: gtk/gtkiconview.c:772 +#: gtk/gtkiconview.c:774 msgid "Item Padding" msgstr "Separtación del elementu" -#: gtk/gtkiconview.c:773 +#: gtk/gtkiconview.c:775 msgid "Padding around icon view items" msgstr "Separtación alrodiu de la vista d'iconos" -#: gtk/gtkiconview.c:782 +#: gtk/gtkiconview.c:784 msgid "Selection Box Color" msgstr "Color Caxa Escoyeta" -#: gtk/gtkiconview.c:783 +#: gtk/gtkiconview.c:785 msgid "Color of the selection box" msgstr "Color de la caxa d'Escoyeta" -#: gtk/gtkiconview.c:789 +#: gtk/gtkiconview.c:791 msgid "Selection Box Alpha" msgstr "Alfa de la caxa d'Escoyeta" -#: gtk/gtkiconview.c:790 +#: gtk/gtkiconview.c:792 msgid "Opacity of the selection box" msgstr "Opacidá de la caxa d'Escoyeta" -#: gtk/gtkimage.c:222 gtk/gtkstatusicon.c:213 +#: gtk/gtkimage.c:227 gtk/gtkstatusicon.c:218 msgid "Pixbuf" msgstr "Pixbuf" -#: gtk/gtkimage.c:223 gtk/gtkstatusicon.c:214 +#: gtk/gtkimage.c:228 gtk/gtkstatusicon.c:219 msgid "A GdkPixbuf to display" msgstr "Un GdkPixbuf a amosar" -#: gtk/gtkimage.c:230 +#: gtk/gtkimage.c:235 msgid "Pixmap" msgstr "Mapa de píxeles" -#: gtk/gtkimage.c:231 +#: gtk/gtkimage.c:236 msgid "A GdkPixmap to display" msgstr "Un GdkPixmap a amosar" -#: gtk/gtkimage.c:238 gtk/gtkmessagedialog.c:215 +#: gtk/gtkimage.c:243 gtk/gtkmessagedialog.c:262 msgid "Image" msgstr "Imaxe" -#: gtk/gtkimage.c:239 +#: gtk/gtkimage.c:244 msgid "A GdkImage to display" msgstr "Un GdkImage a amosar" -#: gtk/gtkimage.c:246 +#: gtk/gtkimage.c:251 msgid "Mask" msgstr "Mázcara" -#: gtk/gtkimage.c:247 +#: gtk/gtkimage.c:252 msgid "Mask bitmap to use with GdkImage or GdkPixmap" msgstr "Mázcara de mapa de bits pa usar con GdkImage o GdkPixmap" -#: gtk/gtkimage.c:255 gtk/gtkstatusicon.c:222 +#: gtk/gtkimage.c:259 gtk/gtkrecentmanager.c:214 gtk/gtkstatusicon.c:226 +msgid "Filename" +msgstr "Nome de ficheru" + +#: gtk/gtkimage.c:260 gtk/gtkstatusicon.c:227 msgid "Filename to load and display" msgstr "Nome del ficheru a cargar y amosar" -#: gtk/gtkimage.c:264 gtk/gtkstatusicon.c:230 +#: gtk/gtkimage.c:269 gtk/gtkstatusicon.c:235 msgid "Stock ID for a stock image to display" msgstr "ID d'inventariu pa una imaxe d'inventariu a amosar" -#: gtk/gtkimage.c:271 +#: gtk/gtkimage.c:276 msgid "Icon set" msgstr "Afitar iconu" -#: gtk/gtkimage.c:272 +#: gtk/gtkimage.c:277 msgid "Icon set to display" msgstr "Afitar iconu a amosar" -#: gtk/gtkimage.c:279 gtk/gtkscalebutton.c:216 gtk/gtktoolbar.c:540 -#: gtk/gtktoolpalette.c:990 +#: gtk/gtkimage.c:284 gtk/gtkscalebutton.c:232 gtk/gtktoolbar.c:485 +#: gtk/gtktoolpalette.c:991 msgid "Icon size" msgstr "Tamañu del iconu" -#: gtk/gtkimage.c:280 +#: gtk/gtkimage.c:285 msgid "Symbolic size to use for stock icon, icon set or named icon" msgstr "" "Tamañu simbólicu a usar pal iconu de fábrica, conxuntu d'iconos o iconu con " "nome" -#: gtk/gtkimage.c:296 +#: gtk/gtkimage.c:301 msgid "Pixel size" msgstr "Tamañu del píxel" -#: gtk/gtkimage.c:297 +#: gtk/gtkimage.c:302 msgid "Pixel size to use for named icon" msgstr "Tamañu de pixel a usar pal iconu con nome" -#: gtk/gtkimage.c:305 +#: gtk/gtkimage.c:310 msgid "Animation" msgstr "Animación" -#: gtk/gtkimage.c:306 +#: gtk/gtkimage.c:311 msgid "GdkPixbufAnimation to display" msgstr "GdkPixbufAnimation a amosar" -#: gtk/gtkimage.c:346 gtk/gtkstatusicon.c:261 +#: gtk/gtkimage.c:351 gtk/gtkstatusicon.c:266 msgid "Storage type" msgstr "Triba d'atroxamientu" -#: gtk/gtkimage.c:347 gtk/gtkstatusicon.c:262 +#: gtk/gtkimage.c:352 gtk/gtkstatusicon.c:267 msgid "The representation being used for image data" msgstr "La representación emplegada pa los datos de la imaxe" @@ -3244,7 +3138,7 @@ msgstr "" "Indica si se tien d'usar el testu de la etiqueta pa criar un elementu del " "menú de stock" -#: gtk/gtkimagemenuitem.c:184 gtk/gtkmenu.c:516 +#: gtk/gtkimagemenuitem.c:184 gtk/gtkmenu.c:523 msgid "Accel Group" msgstr "Grupu d'aceleración" @@ -3260,11 +3154,11 @@ msgstr "Amosar imáxenes del menú" msgid "Whether images should be shown in menus" msgstr "Indica si tienen d'amosase o non les imáxenes nos menús" -#: gtk/gtkinfobar.c:384 gtk/gtkmessagedialog.c:128 +#: gtk/gtkinfobar.c:384 gtk/gtkmessagedialog.c:175 msgid "Message Type" msgstr "Triba de mensaxe" -#: gtk/gtkinfobar.c:385 gtk/gtkmessagedialog.c:129 +#: gtk/gtkinfobar.c:385 gtk/gtkmessagedialog.c:176 msgid "The type of message" msgstr "La triba de mensaxe.." @@ -3280,23 +3174,23 @@ msgstr "Espaciu ente los elementos del área" msgid "Width of border around the action area" msgstr "Anchor del berbesu alredor del área d'aición" -#: gtk/gtkinvisible.c:87 gtk/gtkwindow.c:627 +#: gtk/gtkinvisible.c:87 gtk/gtkwindow.c:651 msgid "The screen where this window will be displayed" msgstr "La pantalla au s'amosará esta ventana" -#: gtk/gtklabel.c:507 +#: gtk/gtklabel.c:529 msgid "The text of the label" msgstr "El testu de la etiqueta" -#: gtk/gtklabel.c:514 +#: gtk/gtklabel.c:536 msgid "A list of style attributes to apply to the text of the label" msgstr "Un llista d'atributos d'estilos p'aplicar al testu de la etiqueta" -#: gtk/gtklabel.c:535 gtk/gtktexttag.c:359 gtk/gtktextview.c:594 +#: gtk/gtklabel.c:557 gtk/gtktexttag.c:359 gtk/gtktextview.c:594 msgid "Justification" msgstr "Xustificación" -#: gtk/gtklabel.c:536 +#: gtk/gtklabel.c:558 msgid "" "The alignment of the lines in the text of the label relative to each other. " "This does NOT affect the alignment of the label within its allocation. See " @@ -3306,11 +3200,11 @@ msgstr "" "Esto NUN afeuta l'alliniación de la etiqueta dientro de la so ubicación. " "Ver GtkMisc::xalign pa ello" -#: gtk/gtklabel.c:544 +#: gtk/gtklabel.c:566 msgid "Pattern" msgstr "Modelu" -#: gtk/gtklabel.c:545 +#: gtk/gtklabel.c:567 msgid "" "A string with _ characters in positions correspond to characters in the text " "to underline" @@ -3318,47 +3212,47 @@ msgstr "" "Un cadena con carauteres _ en posiciones correspondientes a carauteres nel " "testu a sorrayar" -#: gtk/gtklabel.c:552 +#: gtk/gtklabel.c:574 msgid "Line wrap" msgstr "Axustar llinia" -#: gtk/gtklabel.c:553 +#: gtk/gtklabel.c:575 msgid "If set, wrap lines if the text becomes too wide" msgstr "Si ta definío, axusta les llinies si'l testu se vuelve enforma anchu" -#: gtk/gtklabel.c:568 +#: gtk/gtklabel.c:590 msgid "Line wrap mode" msgstr "Mou de axuste de llinia" -#: gtk/gtklabel.c:569 +#: gtk/gtklabel.c:591 msgid "If wrap is set, controls how linewrapping is done" msgstr "Si s'afita l'axuste, remana cómo se fai l'axuste de llinia" -#: gtk/gtklabel.c:576 +#: gtk/gtklabel.c:598 msgid "Selectable" msgstr "Esbillable" -#: gtk/gtklabel.c:577 +#: gtk/gtklabel.c:599 msgid "Whether the label text can be selected with the mouse" msgstr "Indica si'l testu de la etiqueta puede ser esbilláu col mur" -#: gtk/gtklabel.c:583 +#: gtk/gtklabel.c:605 msgid "Mnemonic key" msgstr "Contraseña nemónica" -#: gtk/gtklabel.c:584 +#: gtk/gtklabel.c:606 msgid "The mnemonic accelerator key for this label" msgstr "La tecla nemotécnica de la combinación de tecles pa esta etiqueta" -#: gtk/gtklabel.c:592 +#: gtk/gtklabel.c:614 msgid "Mnemonic widget" msgstr "Widget nemónico" -#: gtk/gtklabel.c:593 +#: gtk/gtklabel.c:615 msgid "The widget to be activated when the label's mnemonic key is pressed" msgstr "El widget s'activará cuando se calque la tecla mnemotécnica" -#: gtk/gtklabel.c:639 +#: gtk/gtklabel.c:661 msgid "" "The preferred place to ellipsize the string, if the label does not have " "enough room to display the entire string" @@ -3366,65 +3260,65 @@ msgstr "" "El llugar preferíu pa la elipsis de la cadena, si la etiqueta nun tien " "suficiente espaciu p'amosar la cadena completa" -#: gtk/gtklabel.c:679 +#: gtk/gtklabel.c:702 msgid "Single Line Mode" msgstr "Mou de llinia única" -#: gtk/gtklabel.c:680 +#: gtk/gtklabel.c:703 msgid "Whether the label is in single line mode" msgstr "Indica si la etiqueta ta en mou de llinia única" -#: gtk/gtklabel.c:697 +#: gtk/gtklabel.c:720 msgid "Angle" msgstr "Ángulu" -#: gtk/gtklabel.c:698 +#: gtk/gtklabel.c:721 msgid "Angle at which the label is rotated" msgstr "ángulo nel que la etiqueta se voltia" -#: gtk/gtklabel.c:718 +#: gtk/gtklabel.c:742 msgid "Maximum Width In Characters" msgstr "Anchu máximu en carauteres" -#: gtk/gtklabel.c:719 +#: gtk/gtklabel.c:743 msgid "The desired maximum width of the label, in characters" msgstr "L'anchu máximu deseyáu de la etiqueta, en carauteres" -#: gtk/gtklabel.c:737 +#: gtk/gtklabel.c:761 msgid "Track visited links" msgstr "Siguir los enllaces visitaos" -#: gtk/gtklabel.c:738 +#: gtk/gtklabel.c:762 msgid "Whether visited links should be tracked" msgstr "Indica si han siguise los enllaces visitaos" -#: gtk/gtklabel.c:859 +#: gtk/gtklabel.c:883 msgid "Whether to select the contents of a selectable label when it is focused" msgstr "" "Indica si se tien de seleicionar el conteníu d'una etiqueta esbillable " "cuando obtién el focu" -#: gtk/gtklayout.c:617 gtk/gtkviewport.c:106 +#: gtk/gtklayout.c:581 gtk/gtkviewport.c:134 msgid "Horizontal adjustment" msgstr "Axuste horizontal" -#: gtk/gtklayout.c:618 gtk/gtkscrolledwindow.c:219 +#: gtk/gtklayout.c:582 gtk/gtkscrolledwindow.c:236 msgid "The GtkAdjustment for the horizontal position" msgstr "El GtkAdjustment pa la posición horizontal" -#: gtk/gtklayout.c:625 gtk/gtkviewport.c:114 +#: gtk/gtklayout.c:589 gtk/gtkviewport.c:142 msgid "Vertical adjustment" msgstr "Axuste vertical" -#: gtk/gtklayout.c:626 gtk/gtkscrolledwindow.c:226 +#: gtk/gtklayout.c:590 gtk/gtkscrolledwindow.c:243 msgid "The GtkAdjustment for the vertical position" msgstr "El GtkAdjustment pa la posición vertical" -#: gtk/gtklayout.c:634 +#: gtk/gtklayout.c:598 msgid "The width of the layout" msgstr "L'anchu de la disposición" -#: gtk/gtklayout.c:643 +#: gtk/gtklayout.c:607 msgid "The height of the layout" msgstr "L'altor de la disposición" @@ -3444,33 +3338,33 @@ msgstr "Visitáu" msgid "Whether this link has been visited." msgstr "Indica si esti enllaz se visitó." -#: gtk/gtkmenu.c:502 +#: gtk/gtkmenu.c:509 msgid "The currently selected menu item" msgstr "L'elementu del menú anguaño esbilláu" -#: gtk/gtkmenu.c:517 +#: gtk/gtkmenu.c:524 msgid "The accel group holding accelerators for the menu" msgstr "El grupu d'aceleración que caltién los aceleradores pal menú" -#: gtk/gtkmenu.c:531 gtk/gtkmenuitem.c:290 +#: gtk/gtkmenu.c:538 gtk/gtkmenuitem.c:290 msgid "Accel Path" msgstr "Camín del acelerador" -#: gtk/gtkmenu.c:532 +#: gtk/gtkmenu.c:539 msgid "An accel path used to conveniently construct accel paths of child items" msgstr "" "Una camín d'acelerador usáu pa construyir convenientemente rutes " "d'aceleración d'elementos fíu" -#: gtk/gtkmenu.c:548 +#: gtk/gtkmenu.c:555 msgid "Attach Widget" msgstr "Acoplar widget" -#: gtk/gtkmenu.c:549 +#: gtk/gtkmenu.c:556 msgid "The widget the menu is attached to" msgstr "El menú al que ta acopláu el widget" -#: gtk/gtkmenu.c:557 +#: gtk/gtkmenu.c:564 msgid "" "A title that may be displayed by the window manager when this menu is torn-" "off" @@ -3478,54 +3372,54 @@ msgstr "" "Un títulu que tien d'amosase pol alministrador de ventanes cuando esti menú " "s'alcuentre zarráu" -#: gtk/gtkmenu.c:571 +#: gtk/gtkmenu.c:578 msgid "Tearoff State" msgstr "Estáu de desprendimientu" -#: gtk/gtkmenu.c:572 +#: gtk/gtkmenu.c:579 msgid "A boolean that indicates whether the menu is torn-off" msgstr "Un booleano qu'indica si'l menú se desprendió" -#: gtk/gtkmenu.c:586 +#: gtk/gtkmenu.c:593 msgid "Monitor" msgstr "Monitor" -#: gtk/gtkmenu.c:587 +#: gtk/gtkmenu.c:594 msgid "The monitor the menu will be popped up on" msgstr "El monitor nel que s'amosará el menú" -#: gtk/gtkmenu.c:593 +#: gtk/gtkmenu.c:600 msgid "Vertical Padding" msgstr "Rellenu vertical" -#: gtk/gtkmenu.c:594 +#: gtk/gtkmenu.c:601 msgid "Extra space at the top and bottom of the menu" msgstr "L'espaciu adicional por enriba y por debaxo del menú" -#: gtk/gtkmenu.c:616 +#: gtk/gtkmenu.c:623 msgid "Reserve Toggle Size" msgstr "Reservar tamañu pa conmutar" -#: gtk/gtkmenu.c:617 +#: gtk/gtkmenu.c:624 msgid "" "A boolean that indicates whether the menu reserves space for toggles and " "icons" msgstr "" "Un booleanu qu'indica si'l menú reserva espaciu pa conmutadores ya iconos" -#: gtk/gtkmenu.c:623 +#: gtk/gtkmenu.c:630 msgid "Horizontal Padding" msgstr "Separtación horizontal" -#: gtk/gtkmenu.c:624 +#: gtk/gtkmenu.c:631 msgid "Extra space at the left and right edges of the menu" msgstr "L'espaciu adicional nos berbesos drechu e esquierdu del menú" -#: gtk/gtkmenu.c:632 +#: gtk/gtkmenu.c:639 msgid "Vertical Offset" msgstr "Desplazamientu vertical" -#: gtk/gtkmenu.c:633 +#: gtk/gtkmenu.c:640 msgid "" "When the menu is a submenu, position it this number of pixels offset " "vertically" @@ -3533,11 +3427,11 @@ msgstr "" "Cuando'l menú ye un submenú, allugalu esti númberu de píxeles desplazáu " "verticalmente" -#: gtk/gtkmenu.c:641 +#: gtk/gtkmenu.c:648 msgid "Horizontal Offset" msgstr "Desplazamientu horizontal" -#: gtk/gtkmenu.c:642 +#: gtk/gtkmenu.c:649 msgid "" "When the menu is a submenu, position it this number of pixels offset " "horizontally" @@ -3545,87 +3439,87 @@ msgstr "" "Cuando'l menú ye un submenú, allugalu esti númberu de píxeles desplazáu " "horizontalmente" -#: gtk/gtkmenu.c:650 +#: gtk/gtkmenu.c:657 msgid "Double Arrows" msgstr "Dubles fleches" -#: gtk/gtkmenu.c:651 +#: gtk/gtkmenu.c:658 msgid "When scrolling, always show both arrows." msgstr "Al desplazar, siempres amosar dambes fleches." -#: gtk/gtkmenu.c:664 +#: gtk/gtkmenu.c:671 msgid "Arrow Placement" msgstr "Allugamientu de flecha" -#: gtk/gtkmenu.c:665 +#: gtk/gtkmenu.c:672 msgid "Indicates where scroll arrows should be placed" msgstr "Indica si les fleches de desplazamientu se tienen d'allugar" -#: gtk/gtkmenu.c:673 +#: gtk/gtkmenu.c:680 msgid "Left Attach" msgstr "Axuntu esquierdu" -#: gtk/gtkmenu.c:674 gtk/gtktable.c:174 +#: gtk/gtkmenu.c:681 gtk/gtktable.c:174 msgid "The column number to attach the left side of the child to" msgstr "La cantidá de columnes a amestase haza'l llau esquierdu del fíu" -#: gtk/gtkmenu.c:681 +#: gtk/gtkmenu.c:688 msgid "Right Attach" msgstr "Axuntu drechu" -#: gtk/gtkmenu.c:682 +#: gtk/gtkmenu.c:689 msgid "The column number to attach the right side of the child to" msgstr "La cantidá de columnes a amestase haza'l llau drechu del fíu" -#: gtk/gtkmenu.c:689 +#: gtk/gtkmenu.c:696 msgid "Top Attach" msgstr "Axuntu superior" -#: gtk/gtkmenu.c:690 +#: gtk/gtkmenu.c:697 msgid "The row number to attach the top of the child to" msgstr "El númberu de fileres a amestase haza arriba del fíu" -#: gtk/gtkmenu.c:697 +#: gtk/gtkmenu.c:704 msgid "Bottom Attach" msgstr "Axuntu inferior" -#: gtk/gtkmenu.c:698 gtk/gtktable.c:195 +#: gtk/gtkmenu.c:705 gtk/gtktable.c:195 msgid "The row number to attach the bottom of the child to" msgstr "El númberu de fileres a amestase haza abaxo del fíu" -#: gtk/gtkmenu.c:712 +#: gtk/gtkmenu.c:719 msgid "Arbitrary constant to scale down the size of the scroll arrow" msgstr "" "Constante arbitraria p'amenorgar l'escaláu del tamañu de la flecha de " "desplazamientu" -#: gtk/gtkmenu.c:799 +#: gtk/gtkmenu.c:806 msgid "Can change accelerators" msgstr "Puede camudar combinaciones" -#: gtk/gtkmenu.c:800 +#: gtk/gtkmenu.c:807 msgid "" "Whether menu accelerators can be changed by pressing a key over the menu item" msgstr "" "Indica si les combinaciones de tecles del menú pueden camudase calcando una " "tecla sobro l'elementu de menú" -#: gtk/gtkmenu.c:805 +#: gtk/gtkmenu.c:812 msgid "Delay before submenus appear" msgstr "Allanciu enantes de que'l submenú apareza" -#: gtk/gtkmenu.c:806 +#: gtk/gtkmenu.c:813 msgid "" "Minimum time the pointer must stay over a menu item before the submenu appear" msgstr "" "Tiempu mínimu nel que'l punteru tien de permanecer sobro un elementu de menú " "enantes de que'l submenú apareza" -#: gtk/gtkmenu.c:813 +#: gtk/gtkmenu.c:820 msgid "Delay before hiding a submenu" msgstr "Allanciu enantes d'anubrir un submenú" -#: gtk/gtkmenu.c:814 +#: gtk/gtkmenu.c:821 msgid "" "The time before hiding a submenu when the pointer is moving towards the " "submenu" @@ -3653,7 +3547,7 @@ msgstr "La orientación del empaquetáu fíu de la barra de menú" msgid "Style of bevel around the menubar" msgstr "Estilu del bisel al rodiu de la barra de menús" -#: gtk/gtkmenubar.c:202 gtk/gtktoolbar.c:590 +#: gtk/gtkmenubar.c:202 gtk/gtktoolbar.c:535 msgid "Internal padding" msgstr "Rellenu internu" @@ -3712,79 +3606,79 @@ msgstr "Anchu en carauteres" msgid "The minimum desired width of the menu item in characters" msgstr "L'anchu mínimu deseyáu del elementu del menú en carauteres" -#: gtk/gtkmenushell.c:379 +#: gtk/gtkmenushell.c:382 msgid "Take Focus" msgstr "Toma focu" -#: gtk/gtkmenushell.c:380 +#: gtk/gtkmenushell.c:383 msgid "A boolean that determines whether the menu grabs the keyboard focus" msgstr "Un booleano qu'indica si'l menú toma'l focu del tecláu" -#: gtk/gtkmenutoolbutton.c:245 gtk/gtkoptionmenu.c:161 +#: gtk/gtkmenutoolbutton.c:243 msgid "Menu" msgstr "Menú" -#: gtk/gtkmenutoolbutton.c:246 +#: gtk/gtkmenutoolbutton.c:244 msgid "The dropdown menu" msgstr "El menú estenderexable" -#: gtk/gtkmessagedialog.c:98 +#: gtk/gtkmessagedialog.c:145 msgid "Image/label border" msgstr "Berbesu de la imaxe/etiqueta" -#: gtk/gtkmessagedialog.c:99 +#: gtk/gtkmessagedialog.c:146 msgid "Width of border around the label and image in the message dialog" msgstr "" "Anchor del berbesu al rodiu de la etiqueta y la imaxe na ventana de mensaxes" -#: gtk/gtkmessagedialog.c:114 +#: gtk/gtkmessagedialog.c:161 msgid "Use separator" msgstr "Usar separtador" -#: gtk/gtkmessagedialog.c:115 +#: gtk/gtkmessagedialog.c:162 msgid "" "Whether to put a separator between the message dialog's text and the buttons" msgstr "" "Indica si se tien de poner un separtador ente'l testu de diálogu del mensaxe " "y los botones." -#: gtk/gtkmessagedialog.c:136 +#: gtk/gtkmessagedialog.c:183 msgid "Message Buttons" msgstr "Botones de mensaxe" -#: gtk/gtkmessagedialog.c:137 +#: gtk/gtkmessagedialog.c:184 msgid "The buttons shown in the message dialog" msgstr "Los botones amosaos nel diálogu de mensaxe" -#: gtk/gtkmessagedialog.c:154 +#: gtk/gtkmessagedialog.c:201 msgid "The primary text of the message dialog" msgstr "El testu primariu del diálogu de mensaxe" -#: gtk/gtkmessagedialog.c:169 +#: gtk/gtkmessagedialog.c:216 msgid "Use Markup" msgstr "Usar marcáu" -#: gtk/gtkmessagedialog.c:170 +#: gtk/gtkmessagedialog.c:217 msgid "The primary text of the title includes Pango markup." msgstr "El testu primariu del títulu inclúi marcáu Pango." -#: gtk/gtkmessagedialog.c:184 +#: gtk/gtkmessagedialog.c:231 msgid "Secondary Text" msgstr "Testu secundariu" -#: gtk/gtkmessagedialog.c:185 +#: gtk/gtkmessagedialog.c:232 msgid "The secondary text of the message dialog" msgstr "El testu secundariu del diálogu de mensaxe" -#: gtk/gtkmessagedialog.c:200 +#: gtk/gtkmessagedialog.c:247 msgid "Use Markup in secondary" msgstr "Usar marcáu nel secundariu" -#: gtk/gtkmessagedialog.c:201 +#: gtk/gtkmessagedialog.c:248 msgid "The secondary text includes Pango markup." msgstr "El testu secundariu inclúi marcáu Pango." -#: gtk/gtkmessagedialog.c:216 +#: gtk/gtkmessagedialog.c:263 msgid "The image" msgstr "La imaxe" @@ -3838,77 +3732,53 @@ msgstr "Tamos amosando un diálogu" msgid "The screen where this window will be displayed." msgstr "La pantalla au s'amosará esta ventana." -#: gtk/gtknotebook.c:585 +#: gtk/gtknotebook.c:571 msgid "Page" msgstr "Páxina" -#: gtk/gtknotebook.c:586 +#: gtk/gtknotebook.c:572 msgid "The index of the current page" msgstr "La posición de la páxina actual" -#: gtk/gtknotebook.c:594 +#: gtk/gtknotebook.c:580 msgid "Tab Position" msgstr "Posición del tabulador" -#: gtk/gtknotebook.c:595 +#: gtk/gtknotebook.c:581 msgid "Which side of the notebook holds the tabs" msgstr "Qué llau del cuadernu caltién les llingüetes" -#: gtk/gtknotebook.c:602 -msgid "Tab Border" -msgstr "Berbesu de la llingüeta" - -#: gtk/gtknotebook.c:603 -msgid "Width of the border around the tab labels" -msgstr "Anchor del berbesu al rodiu de les etiquetes de la llingüeta" - -#: gtk/gtknotebook.c:611 -msgid "Horizontal Tab Border" -msgstr "Berbesu de la llingüeta horizontal" - -#: gtk/gtknotebook.c:612 -msgid "Width of the horizontal border of tab labels" -msgstr "Anchor del berbesu horizontal de les etiquetes de les llingüeta" - -#: gtk/gtknotebook.c:620 -msgid "Vertical Tab Border" -msgstr "Berbesu de la llingüeta vertical" - -#: gtk/gtknotebook.c:621 -msgid "Width of the vertical border of tab labels" -msgstr "Anchor del berbesu vertical de les etiquetes de les llingüetes" - -#: gtk/gtknotebook.c:629 +#: gtk/gtknotebook.c:588 msgid "Show Tabs" msgstr "Amosar llingüetes" -#: gtk/gtknotebook.c:630 +#: gtk/gtknotebook.c:589 msgid "Whether tabs should be shown or not" msgstr "Indica si les llingüetes tienen d'amosase o non" -#: gtk/gtknotebook.c:636 +#: gtk/gtknotebook.c:595 msgid "Show Border" msgstr "Amosar berbesu" -#: gtk/gtknotebook.c:637 +#: gtk/gtknotebook.c:596 msgid "Whether the border should be shown or not" msgstr "Indica si'l berbesu tien d'amosase o non" -#: gtk/gtknotebook.c:643 +#: gtk/gtknotebook.c:602 msgid "Scrollable" msgstr "Desplazable" -#: gtk/gtknotebook.c:644 +#: gtk/gtknotebook.c:603 msgid "If TRUE, scroll arrows are added if there are too many tabs to fit" msgstr "" "Si ye TRUE, amiéstense fleches de desplazamientu si hai abondes llingüetes " "pa entrar" -#: gtk/gtknotebook.c:650 +#: gtk/gtknotebook.c:609 msgid "Enable Popup" msgstr "Activar emerxente" -#: gtk/gtknotebook.c:651 +#: gtk/gtknotebook.c:610 msgid "" "If TRUE, pressing the right mouse button on the notebook pops up a menu that " "you can use to go to a page" @@ -3916,224 +3786,192 @@ msgstr "" "Si ye TRUE, calcando'l botón drechu del mur nel cuadernu emerxe un menú que " "puede usar pa dir a una páxina" -#: gtk/gtknotebook.c:658 -msgid "Whether tabs should have homogeneous sizes" -msgstr "Indica si les llingüetes tienen de tener tamaños homoxéneos" - -#: gtk/gtknotebook.c:664 -msgid "Group ID" -msgstr "ID de grupu" - -#: gtk/gtknotebook.c:665 -msgid "Group ID for tabs drag and drop" -msgstr "ID de grupu p'arrastre y suelte de les llingüetes" - -#: gtk/gtknotebook.c:681 gtk/gtkradioaction.c:128 gtk/gtkradiobutton.c:82 +#: gtk/gtknotebook.c:624 gtk/gtkradioaction.c:140 gtk/gtkradiobutton.c:159 #: gtk/gtkradiomenuitem.c:353 gtk/gtkradiotoolbutton.c:65 msgid "Group" msgstr "Grupu" -#: gtk/gtknotebook.c:682 +#: gtk/gtknotebook.c:625 msgid "Group for tabs drag and drop" msgstr "Grupu p'arrastre y suelte de les llingüetes" -#: gtk/gtknotebook.c:688 +#: gtk/gtknotebook.c:631 msgid "Tab label" msgstr "Etiqueta de la llingüeta" -#: gtk/gtknotebook.c:689 +#: gtk/gtknotebook.c:632 msgid "The string displayed on the child's tab label" msgstr "La cadena amosada na etiqueta de la llingüeta fía" -#: gtk/gtknotebook.c:695 +#: gtk/gtknotebook.c:638 msgid "Menu label" msgstr "Etiqueta de menú" -#: gtk/gtknotebook.c:696 +#: gtk/gtknotebook.c:639 msgid "The string displayed in the child's menu entry" msgstr "La cadena amosada na entrada de menú fía" -#: gtk/gtknotebook.c:709 +#: gtk/gtknotebook.c:652 msgid "Tab expand" msgstr "Espansión de la llingüeta" -#: gtk/gtknotebook.c:710 +#: gtk/gtknotebook.c:653 msgid "Whether to expand the child's tab or not" msgstr "Indica si se tienen d'espander les llingüetes fíes o non" -#: gtk/gtknotebook.c:716 +#: gtk/gtknotebook.c:659 msgid "Tab fill" msgstr "Rellenu de la llingüeta" -#: gtk/gtknotebook.c:717 +#: gtk/gtknotebook.c:660 msgid "Whether the child's tab should fill the allocated area or not" msgstr "" "Indica si les llingüetes fíes deberíen rellenar el estaya asignada o non" -#: gtk/gtknotebook.c:723 +#: gtk/gtknotebook.c:666 msgid "Tab pack type" msgstr "Triba d'empaquetáu de la llingüeta" -#: gtk/gtknotebook.c:730 +#: gtk/gtknotebook.c:673 msgid "Tab reorderable" msgstr "Llingüeta reordenable" -#: gtk/gtknotebook.c:731 +#: gtk/gtknotebook.c:674 msgid "Whether the tab is reorderable by user action or not" msgstr "" "Indica si la llingüeta se puede o non se puede reordenar por una aición del " "usuariu" -#: gtk/gtknotebook.c:737 +#: gtk/gtknotebook.c:680 msgid "Tab detachable" msgstr "Llingüeta desprendible" -#: gtk/gtknotebook.c:738 +#: gtk/gtknotebook.c:681 msgid "Whether the tab is detachable" msgstr "Indica si la llingüeta ye desprendible" -#: gtk/gtknotebook.c:753 gtk/gtkscrollbar.c:81 +#: gtk/gtknotebook.c:696 gtk/gtkscrollbar.c:81 msgid "Secondary backward stepper" msgstr "Separtador traseru secundariu" -#: gtk/gtknotebook.c:754 +#: gtk/gtknotebook.c:697 msgid "" "Display a second backward arrow button on the opposite end of the tab area" msgstr "" "Amuesa un segunda flecha de retrocesu nel estremu aviesu de la estaya de " "tabulación" -#: gtk/gtknotebook.c:769 gtk/gtkscrollbar.c:88 +#: gtk/gtknotebook.c:712 gtk/gtkscrollbar.c:88 msgid "Secondary forward stepper" msgstr "Separtador delanteru secundariu" -#: gtk/gtknotebook.c:770 +#: gtk/gtknotebook.c:713 msgid "" "Display a second forward arrow button on the opposite end of the tab area" msgstr "" "Amosar una segunda flecha d'avance nel estremu aviesu de la estaya de " "tabulación" -#: gtk/gtknotebook.c:784 gtk/gtkscrollbar.c:67 +#: gtk/gtknotebook.c:727 gtk/gtkscrollbar.c:67 msgid "Backward stepper" msgstr "Separtador traseru" -#: gtk/gtknotebook.c:785 gtk/gtkscrollbar.c:68 +#: gtk/gtknotebook.c:728 gtk/gtkscrollbar.c:68 msgid "Display the standard backward arrow button" msgstr "Amosar el botón standard de flecha de retrocesu" -#: gtk/gtknotebook.c:799 gtk/gtkscrollbar.c:74 +#: gtk/gtknotebook.c:742 gtk/gtkscrollbar.c:74 msgid "Forward stepper" msgstr "Separtador delanteru" -#: gtk/gtknotebook.c:800 gtk/gtkscrollbar.c:75 +#: gtk/gtknotebook.c:743 gtk/gtkscrollbar.c:75 msgid "Display the standard forward arrow button" msgstr "Amosar el botón standard de flecha d'avance" -#: gtk/gtknotebook.c:814 +#: gtk/gtknotebook.c:757 msgid "Tab overlap" msgstr "Solapamientu de la llingüeta" -#: gtk/gtknotebook.c:815 +#: gtk/gtknotebook.c:758 msgid "Size of tab overlap area" msgstr "Tamañu de la estaya de solapamientu de la llingüeta" -#: gtk/gtknotebook.c:830 +#: gtk/gtknotebook.c:773 msgid "Tab curvature" msgstr "Curvatura de la llingüeta" -#: gtk/gtknotebook.c:831 +#: gtk/gtknotebook.c:774 msgid "Size of tab curvature" msgstr "Tamañu de la curvatura de la llingüeta" -#: gtk/gtknotebook.c:847 +#: gtk/gtknotebook.c:790 msgid "Arrow spacing" msgstr "Espaciáu de les fleches" -#: gtk/gtknotebook.c:848 +#: gtk/gtknotebook.c:791 msgid "Scroll arrow spacing" msgstr "Espaciáu del desplazamientu de les fleches" -#: gtk/gtkobject.c:370 -msgid "User Data" -msgstr "Datos del usuariu" - -#: gtk/gtkobject.c:371 -msgid "Anonymous User Data Pointer" -msgstr "Puntero de datos de l'usuariu anónimu" - -#: gtk/gtkoptionmenu.c:162 -msgid "The menu of options" -msgstr "El menú d'opciones" - -#: gtk/gtkoptionmenu.c:169 -msgid "Size of dropdown indicator" -msgstr "Tamañu del indicador descolingable" - -#: gtk/gtkoptionmenu.c:175 -msgid "Spacing around indicator" -msgstr "Espaciáu al rodiu del indicador" - -#: gtk/gtkorientable.c:75 +#: gtk/gtkorientable.c:64 msgid "The orientation of the orientable" msgstr "La orientación del orientable" -#: gtk/gtkpaned.c:242 +#: gtk/gtkpaned.c:243 msgid "" "Position of paned separator in pixels (0 means all the way to the left/top)" msgstr "" "Posición del separtador enmarcáu en píxeles (0 significa tol trayeutu haza " "la esquierda/arriba)" -#: gtk/gtkpaned.c:251 +#: gtk/gtkpaned.c:252 msgid "Position Set" msgstr "Afitar posición" -#: gtk/gtkpaned.c:252 +#: gtk/gtkpaned.c:253 msgid "TRUE if the Position property should be used" msgstr "TRUE si la propiedá posición tien d'usase" -#: gtk/gtkpaned.c:258 +#: gtk/gtkpaned.c:259 msgid "Handle Size" msgstr "Tamañu del tirador" -#: gtk/gtkpaned.c:259 +#: gtk/gtkpaned.c:260 msgid "Width of handle" msgstr "Anchu del tirador" -#: gtk/gtkpaned.c:275 +#: gtk/gtkpaned.c:276 msgid "Minimal Position" msgstr "Posición mínima" -#: gtk/gtkpaned.c:276 +#: gtk/gtkpaned.c:277 msgid "Smallest possible value for the \"position\" property" msgstr "El valor más pequeñu dable pa la propiedá «posición»" -#: gtk/gtkpaned.c:293 +#: gtk/gtkpaned.c:294 msgid "Maximal Position" msgstr "Posición máxima" -#: gtk/gtkpaned.c:294 +#: gtk/gtkpaned.c:295 msgid "Largest possible value for the \"position\" property" msgstr "El valor más grande dable pa la propiedá «posición»" -#: gtk/gtkpaned.c:311 +#: gtk/gtkpaned.c:312 msgid "Resize" msgstr "Redimensionar" -#: gtk/gtkpaned.c:312 +#: gtk/gtkpaned.c:313 msgid "If TRUE, the child expands and shrinks along with the paned widget" msgstr "Si ye TRUE, el fíu espándese y encuéyese xunto col widget" -#: gtk/gtkpaned.c:327 +#: gtk/gtkpaned.c:328 msgid "Shrink" msgstr "Encoyer" -#: gtk/gtkpaned.c:328 +#: gtk/gtkpaned.c:329 msgid "If TRUE, the child can be made smaller than its requisition" msgstr "Si ye TRUE, el fíu puede facese más pequeñu que los sos requisitos" -#: gtk/gtkplug.c:171 gtk/gtkstatusicon.c:312 +#: gtk/gtkplug.c:171 gtk/gtkstatusicon.c:317 msgid "Embedded" msgstr "Empotráu" @@ -4149,90 +3987,83 @@ msgstr "Ventana del socket" msgid "The window of the socket the plug is embedded in" msgstr "La ventana del socket na que l'enchufe ta embebíu" -#: gtk/gtkpreview.c:102 -msgid "" -"Whether the preview widget should take up the entire space it is allocated" -msgstr "" -"Indica si'l widget de vista previa tien de tomar l'espaciu enteru au " -"s'alcuentra asignáu" - -#: gtk/gtkprinter.c:112 +#: gtk/gtkprinter.c:131 msgid "Name of the printer" msgstr "Nome de la imprentadora" -#: gtk/gtkprinter.c:118 +#: gtk/gtkprinter.c:137 msgid "Backend" msgstr "Backend" -#: gtk/gtkprinter.c:119 +#: gtk/gtkprinter.c:138 msgid "Backend for the printer" msgstr "Backend pa la imprentadora" -#: gtk/gtkprinter.c:125 +#: gtk/gtkprinter.c:144 msgid "Is Virtual" msgstr "Ye virtual" -#: gtk/gtkprinter.c:126 +#: gtk/gtkprinter.c:145 msgid "FALSE if this represents a real hardware printer" msgstr "FALSE si esto representa una imprentadora de hardware real" -#: gtk/gtkprinter.c:132 +#: gtk/gtkprinter.c:151 msgid "Accepts PDF" msgstr "Aceuta PDF" -#: gtk/gtkprinter.c:133 +#: gtk/gtkprinter.c:152 msgid "TRUE if this printer can accept PDF" msgstr "TRUE si esta imprentadora puede aceutar PDF" -#: gtk/gtkprinter.c:139 +#: gtk/gtkprinter.c:158 msgid "Accepts PostScript" msgstr "Aceuta tabuladores PostScript" -#: gtk/gtkprinter.c:140 +#: gtk/gtkprinter.c:159 msgid "TRUE if this printer can accept PostScript" msgstr "TRUE si esta imprentadora puede aceutar PostScript" -#: gtk/gtkprinter.c:146 +#: gtk/gtkprinter.c:165 msgid "State Message" msgstr "Mensax d'estáu" -#: gtk/gtkprinter.c:147 +#: gtk/gtkprinter.c:166 msgid "String giving the current state of the printer" msgstr "Cadena dando l'estáu actual de la imprentadora" -#: gtk/gtkprinter.c:153 +#: gtk/gtkprinter.c:172 msgid "Location" msgstr "Llugar" -#: gtk/gtkprinter.c:154 +#: gtk/gtkprinter.c:173 msgid "The location of the printer" msgstr "La ubicación de la imprentadora" -#: gtk/gtkprinter.c:161 +#: gtk/gtkprinter.c:180 msgid "The icon name to use for the printer" msgstr "El nome del iconu a usar pa la imprentadora" -#: gtk/gtkprinter.c:167 +#: gtk/gtkprinter.c:186 msgid "Job Count" msgstr "Cuenta de xeres" -#: gtk/gtkprinter.c:168 +#: gtk/gtkprinter.c:187 msgid "Number of jobs queued in the printer" msgstr "El númberu de xeres encolaes na imprentadora" -#: gtk/gtkprinter.c:186 +#: gtk/gtkprinter.c:205 msgid "Paused Printer" msgstr "Imprentadora posada" -#: gtk/gtkprinter.c:187 +#: gtk/gtkprinter.c:206 msgid "TRUE if this printer is paused" msgstr "TRUE si esta imprentadora ta posada" -#: gtk/gtkprinter.c:200 +#: gtk/gtkprinter.c:219 msgid "Accepting Jobs" msgstr "Aceutando trabayos" -#: gtk/gtkprinter.c:201 +#: gtk/gtkprinter.c:220 msgid "TRUE if this printer is accepting new jobs" msgstr "TRUE si esta imprentadora ta aceutando trabayos nuevos" @@ -4407,7 +4238,8 @@ msgid "Has Selection" msgstr "Tien seleición" #: gtk/gtkprintoperation.c:1297 -msgid "TRUE if a selecion exists." +#, fuzzy +msgid "TRUE if a selection exists." msgstr "TRUE si esiste una seleición." #: gtk/gtkprintoperation.c:1312 gtk/gtkprintunixdialog.c:361 @@ -4484,72 +4316,28 @@ msgstr "Amosar testu" msgid "Whether the progress is shown as text." msgstr "Indica si'l progresu s'amuesa como testu." -#: gtk/gtkprogressbar.c:119 -msgid "The GtkAdjustment connected to the progress bar (Deprecated)" -msgstr "El GtkAdjustment coneutáu a la barra de progresu (obsoletu)" - -#: gtk/gtkprogressbar.c:135 -msgid "Bar style" -msgstr "Estilu de la barra" - -#: gtk/gtkprogressbar.c:136 -msgid "Specifies the visual style of the bar in percentage mode (Deprecated)" -msgstr "Indica l'estilu visual de la barra nel mou porcentaxe (obsoletu)" - -#: gtk/gtkprogressbar.c:144 -msgid "Activity Step" -msgstr "Avance d'actividá" - -#: gtk/gtkprogressbar.c:145 -msgid "The increment used for each iteration in activity mode (Deprecated)" -msgstr "L'incrementu usáu pa cada iteración nel mou actividá (obsoletu)" - -#: gtk/gtkprogressbar.c:152 -msgid "Activity Blocks" -msgstr "Bloques d'actividá" - -#: gtk/gtkprogressbar.c:153 -msgid "" -"The number of blocks which can fit in the progress bar area in activity mode " -"(Deprecated)" -msgstr "" -"La cantidá de bloques que pueden caber na estaya de la barra de progresu nel " -"mou actividá (obsoletu)" - -#: gtk/gtkprogressbar.c:160 -msgid "Discrete Blocks" -msgstr "Bloques discretos" - -#: gtk/gtkprogressbar.c:161 -msgid "" -"The number of discrete blocks in a progress bar (when shown in the discrete " -"style)" -msgstr "" -"El númberu de bloques discretos na barra de progresu (cuando s'amuese nel " -"estilu discretu)" - -#: gtk/gtkprogressbar.c:168 +#: gtk/gtkprogressbar.c:121 msgid "Fraction" msgstr "Fraición" -#: gtk/gtkprogressbar.c:169 +#: gtk/gtkprogressbar.c:122 msgid "The fraction of total work that has been completed" msgstr "La fraición del trabayu total que se completó" -#: gtk/gtkprogressbar.c:176 +#: gtk/gtkprogressbar.c:129 msgid "Pulse Step" msgstr "Avance del pulsu" -#: gtk/gtkprogressbar.c:177 +#: gtk/gtkprogressbar.c:130 msgid "The fraction of total progress to move the bouncing block when pulsed" msgstr "" "La fraición del progresu total pa mover el bloque rebotador cuando se calca" -#: gtk/gtkprogressbar.c:185 +#: gtk/gtkprogressbar.c:138 msgid "Text to be displayed in the progress bar" msgstr "Testu que s'amosará na barra de progresu" -#: gtk/gtkprogressbar.c:207 +#: gtk/gtkprogressbar.c:160 msgid "" "The preferred place to ellipsize the string, if the progress bar does not " "have enough room to display the entire string, if at all." @@ -4557,59 +4345,59 @@ msgstr "" "El llugar preferíu pa la elipsis de la cadena, si la barra de progresu nun " "tien espaciu abondu p'amosar la cadena completa." -#: gtk/gtkprogressbar.c:214 +#: gtk/gtkprogressbar.c:167 msgid "XSpacing" msgstr "EspaciáuX" -#: gtk/gtkprogressbar.c:215 +#: gtk/gtkprogressbar.c:168 msgid "Extra spacing applied to the width of a progress bar." msgstr "Espaciu estra aplicáu a l'anchor d'una barra de progresu." -#: gtk/gtkprogressbar.c:220 +#: gtk/gtkprogressbar.c:173 msgid "YSpacing" msgstr "EspaciáuY" -#: gtk/gtkprogressbar.c:221 +#: gtk/gtkprogressbar.c:174 msgid "Extra spacing applied to the height of a progress bar." msgstr "Espaciu adicional aplicáu a l'altor d'una barra de progresu." -#: gtk/gtkprogressbar.c:234 +#: gtk/gtkprogressbar.c:187 msgid "Min horizontal bar width" msgstr "Anchor mínimu de la barra horizontal" -#: gtk/gtkprogressbar.c:235 +#: gtk/gtkprogressbar.c:188 msgid "The minimum horizontal width of the progress bar" msgstr "L'anchor mínimu horizontal de la barra de progresu" -#: gtk/gtkprogressbar.c:247 +#: gtk/gtkprogressbar.c:200 msgid "Min horizontal bar height" msgstr "Altor mínimu de la barra horizontal" -#: gtk/gtkprogressbar.c:248 +#: gtk/gtkprogressbar.c:201 msgid "Minimum horizontal height of the progress bar" msgstr "L'altor mínimu horizontal de la barra de progresu" -#: gtk/gtkprogressbar.c:260 +#: gtk/gtkprogressbar.c:213 msgid "Min vertical bar width" msgstr "Anchor mínimu horizontal de la barra" -#: gtk/gtkprogressbar.c:261 +#: gtk/gtkprogressbar.c:214 msgid "The minimum vertical width of the progress bar" msgstr "L'anchor mínimu vertical de la barra de progresu" -#: gtk/gtkprogressbar.c:273 +#: gtk/gtkprogressbar.c:226 msgid "Min vertical bar height" msgstr "Altor mínimu vertical de la barra" -#: gtk/gtkprogressbar.c:274 +#: gtk/gtkprogressbar.c:227 msgid "The minimum vertical height of the progress bar" msgstr "L'altor mínimu vertical de la barra de progresu" -#: gtk/gtkradioaction.c:111 +#: gtk/gtkradioaction.c:123 msgid "The value" msgstr "El valor" -#: gtk/gtkradioaction.c:112 +#: gtk/gtkradioaction.c:124 msgid "" "The value returned by gtk_radio_action_get_current_value() when this action " "is the current action of its group." @@ -4617,15 +4405,15 @@ msgstr "" "El valor devueltu por gtk_radio_action_get_current_value() cuando esta " "aición ye l'aición actual del so grupu." -#: gtk/gtkradioaction.c:129 +#: gtk/gtkradioaction.c:141 msgid "The radio action whose group this action belongs to." msgstr "El botón de radio a cuyu grupu pertenez esta aición." -#: gtk/gtkradioaction.c:144 +#: gtk/gtkradioaction.c:156 msgid "The current value" msgstr "El valor actual" -#: gtk/gtkradioaction.c:145 +#: gtk/gtkradioaction.c:157 msgid "" "The value property of the currently active member of the group to which this " "action belongs." @@ -4633,7 +4421,7 @@ msgstr "" "La propiedá del valor del miembru anguaño activu del grupu al que ésta " "aición pertenez." -#: gtk/gtkradiobutton.c:83 +#: gtk/gtkradiobutton.c:160 msgid "The radio button whose group this widget belongs to." msgstr "El botón de radio del grupu al que pertenez esti widget." @@ -4645,33 +4433,33 @@ msgstr "L'elementu del menú de radio a cuyu grupu pertenez esti widget." msgid "The radio tool button whose group this button belongs to." msgstr "La ferramienta de botón de radio a cuyu grupu pertenez esti widget." -#: gtk/gtkrange.c:358 +#: gtk/gtkrange.c:385 msgid "Update policy" msgstr "Política d'anovamientos" -#: gtk/gtkrange.c:359 +#: gtk/gtkrange.c:386 msgid "How the range should be updated on the screen" msgstr "Cómo se tien d'anovar el rangu na pantalla" -#: gtk/gtkrange.c:368 +#: gtk/gtkrange.c:395 msgid "The GtkAdjustment that contains the current value of this range object" msgstr "El GtkAdjustment que caltién el valor actual d'esti rangu d'oxetos." -#: gtk/gtkrange.c:375 +#: gtk/gtkrange.c:402 msgid "Inverted" msgstr "Invertíu" -#: gtk/gtkrange.c:376 +#: gtk/gtkrange.c:403 msgid "Invert direction slider moves to increase range value" msgstr "" "Invierte la direición na que se mueve'l divisor pa incrementar el valor del " "rangu" -#: gtk/gtkrange.c:383 +#: gtk/gtkrange.c:410 msgid "Lower stepper sensitivity" msgstr "Sensibilidá de la flecha inferior" -#: gtk/gtkrange.c:384 +#: gtk/gtkrange.c:411 msgid "" "The sensitivity policy for the stepper that points to the adjustment's lower " "side" @@ -4679,11 +4467,11 @@ msgstr "" "La directiva de sensibilidá del botón de desplazamientu qu'apunta al llau " "más baxu del axuste" -#: gtk/gtkrange.c:392 +#: gtk/gtkrange.c:419 msgid "Upper stepper sensitivity" msgstr "Sensibilidá de la flecha superior" -#: gtk/gtkrange.c:393 +#: gtk/gtkrange.c:420 msgid "" "The sensitivity policy for the stepper that points to the adjustment's upper " "side" @@ -4691,91 +4479,91 @@ msgstr "" "La directiva de sensibilidá del botón de flecha qu'apunta al llau más altu " "del axuste" -#: gtk/gtkrange.c:410 +#: gtk/gtkrange.c:437 msgid "Show Fill Level" msgstr "Amosar nivel de rellenu" -#: gtk/gtkrange.c:411 +#: gtk/gtkrange.c:438 msgid "Whether to display a fill level indicator graphics on trough." msgstr "" "Indica si se tien d'amosar l'indicador de nivel de llenáu nos gráficos " "mientres s'enllena." -#: gtk/gtkrange.c:427 +#: gtk/gtkrange.c:454 msgid "Restrict to Fill Level" msgstr "Restrinxir al nivel de llenáu" -#: gtk/gtkrange.c:428 +#: gtk/gtkrange.c:455 msgid "Whether to restrict the upper boundary to the fill level." msgstr "" "Indica si se tien de restrinxir el berbesu superior al nivel de llenáu." -#: gtk/gtkrange.c:443 +#: gtk/gtkrange.c:470 msgid "Fill Level" msgstr "Nivel de llenáu" -#: gtk/gtkrange.c:444 +#: gtk/gtkrange.c:471 msgid "The fill level." msgstr "El nivel de llenáu." -#: gtk/gtkrange.c:452 +#: gtk/gtkrange.c:479 msgid "Slider Width" msgstr "Anchor del divisor" -#: gtk/gtkrange.c:453 +#: gtk/gtkrange.c:480 msgid "Width of scrollbar or scale thumb" msgstr "Anchor de la barra de desplazamientu o escala de buelga" -#: gtk/gtkrange.c:460 +#: gtk/gtkrange.c:487 msgid "Trough Border" msgstr "Berbesu de la canal" -#: gtk/gtkrange.c:461 +#: gtk/gtkrange.c:488 msgid "Spacing between thumb/steppers and outer trough bevel" msgstr "Espaciáu ente la buelga/separtadores y los biseles esteriores" -#: gtk/gtkrange.c:468 +#: gtk/gtkrange.c:495 msgid "Stepper Size" msgstr "Tamañu del separtador" -#: gtk/gtkrange.c:469 +#: gtk/gtkrange.c:496 msgid "Length of step buttons at ends" msgstr "Llonxitú de los botones de pasu al final" -#: gtk/gtkrange.c:484 +#: gtk/gtkrange.c:511 msgid "Stepper Spacing" msgstr "Espaciáu del separtador" -#: gtk/gtkrange.c:485 +#: gtk/gtkrange.c:512 msgid "Spacing between step buttons and thumb" msgstr "Espaciáu ente los botones de separación y la buelga" -#: gtk/gtkrange.c:492 +#: gtk/gtkrange.c:519 msgid "Arrow X Displacement" msgstr "Elevación de la flecha X" -#: gtk/gtkrange.c:493 +#: gtk/gtkrange.c:520 msgid "" "How far in the x direction to move the arrow when the button is depressed" msgstr "" "Cuánto de llonxe mover la flecha na direición «X», cuando un botón se suelta" -#: gtk/gtkrange.c:500 +#: gtk/gtkrange.c:527 msgid "Arrow Y Displacement" msgstr "Elevación de la flecha Y" -#: gtk/gtkrange.c:501 +#: gtk/gtkrange.c:528 msgid "" "How far in the y direction to move the arrow when the button is depressed" msgstr "" "Distancia na direición «Y» na que se moverá la flecha cuando se suelte un " "botón" -#: gtk/gtkrange.c:509 +#: gtk/gtkrange.c:536 msgid "Draw slider ACTIVE during drag" msgstr "Dibuxar eslizador ACTIVU durante l'arrastre" -#: gtk/gtkrange.c:510 +#: gtk/gtkrange.c:537 msgid "" "With this option set to TRUE, sliders will be drawn ACTIVE and with shadow " "IN while they are dragged" @@ -4783,11 +4571,11 @@ msgstr "" "Con esta opción puesta a TRUE, los eslizadores dibuxaránse ACTIVOS y con " "solombra DIENTRO al arrastrarlos" -#: gtk/gtkrange.c:524 +#: gtk/gtkrange.c:551 msgid "Trough Side Details" msgstr "Detalles del llau del carril" -#: gtk/gtkrange.c:525 +#: gtk/gtkrange.c:552 msgid "" "When TRUE, the parts of the trough on the two sides of the slider are drawn " "with different details" @@ -4795,11 +4583,11 @@ msgstr "" "Cuando seya TRUE, les partes del carril nos dos llaos del eslizador " "dibuxaránse con detalles diferentes" -#: gtk/gtkrange.c:541 +#: gtk/gtkrange.c:568 msgid "Trough Under Steppers" msgstr "Carril baxo les fleches d'eslizamientu" -#: gtk/gtkrange.c:542 +#: gtk/gtkrange.c:569 msgid "" "Whether to draw trough for full length of range or exclude the steppers and " "spacing" @@ -4807,95 +4595,95 @@ msgstr "" "Indica si se tien de dibuxar pal llargor completu del rangu o escluyir les " "fleches de desplazamientu y l'espaciáu" -#: gtk/gtkrange.c:555 +#: gtk/gtkrange.c:582 msgid "Arrow scaling" msgstr "Escaláu de fleches" -#: gtk/gtkrange.c:556 +#: gtk/gtkrange.c:583 msgid "Arrow scaling with regard to scroll button size" msgstr "" "Escaláu de fleches en consideración col tamañu del botón de desplazamientu" -#: gtk/gtkrecentaction.c:616 gtk/gtkrecentchoosermenu.c:227 +#: gtk/gtkrecentaction.c:633 gtk/gtkrecentchoosermenu.c:255 msgid "Show Numbers" msgstr "Amosar númberos" -#: gtk/gtkrecentaction.c:617 gtk/gtkrecentchoosermenu.c:228 +#: gtk/gtkrecentaction.c:634 gtk/gtkrecentchoosermenu.c:256 msgid "Whether the items should be displayed with a number" msgstr "Indica si los elementos tienen d'amosase con un númberu" -#: gtk/gtkrecentchooser.c:132 +#: gtk/gtkrecentchooser.c:149 msgid "Recent Manager" msgstr "Xestor de recientes" -#: gtk/gtkrecentchooser.c:133 +#: gtk/gtkrecentchooser.c:150 msgid "The RecentManager object to use" msgstr "L'oxetu RecentManager qu'usar" -#: gtk/gtkrecentchooser.c:147 +#: gtk/gtkrecentchooser.c:164 msgid "Show Private" msgstr "Amosar privaos" -#: gtk/gtkrecentchooser.c:148 +#: gtk/gtkrecentchooser.c:165 msgid "Whether the private items should be displayed" msgstr "Indica si tienen d'amosase los elementos privaos" -#: gtk/gtkrecentchooser.c:161 +#: gtk/gtkrecentchooser.c:178 msgid "Show Tooltips" msgstr "Amosar conseyos" -#: gtk/gtkrecentchooser.c:162 +#: gtk/gtkrecentchooser.c:179 msgid "Whether there should be a tooltip on the item" msgstr "Indica si tien d'haber un conseyu nel elementu" -#: gtk/gtkrecentchooser.c:174 +#: gtk/gtkrecentchooser.c:191 msgid "Show Icons" msgstr "Amosar iconos" -#: gtk/gtkrecentchooser.c:175 +#: gtk/gtkrecentchooser.c:192 msgid "Whether there should be an icon near the item" msgstr "Indica si tien d'haber un iconu cerca del elementu" -#: gtk/gtkrecentchooser.c:190 +#: gtk/gtkrecentchooser.c:207 msgid "Show Not Found" msgstr "Amosar non alcontraos" -#: gtk/gtkrecentchooser.c:191 +#: gtk/gtkrecentchooser.c:208 msgid "Whether the items pointing to unavailable resources should be displayed" msgstr "" "Indica si tienen d'amosase los elementos qu'apunten a recursos non " "disponibles" -#: gtk/gtkrecentchooser.c:204 +#: gtk/gtkrecentchooser.c:221 msgid "Whether to allow multiple items to be selected" msgstr "Indica si se permite la Escoyeta de múltiples elementos" -#: gtk/gtkrecentchooser.c:217 +#: gtk/gtkrecentchooser.c:234 msgid "Local only" msgstr "Sólo llocal" -#: gtk/gtkrecentchooser.c:218 +#: gtk/gtkrecentchooser.c:235 msgid "Whether the selected resource(s) should be limited to local file: URIs" msgstr "" "Indica si los recursos esbillaos tienen de llimitase a URI llocales file:" -#: gtk/gtkrecentchooser.c:234 gtk/gtkrecentmanager.c:229 +#: gtk/gtkrecentchooser.c:251 gtk/gtkrecentmanager.c:229 msgid "Limit" msgstr "Llímite" -#: gtk/gtkrecentchooser.c:235 +#: gtk/gtkrecentchooser.c:252 msgid "The maximum number of items to be displayed" msgstr "El númberu máximu d'elementos a amosar" -#: gtk/gtkrecentchooser.c:249 +#: gtk/gtkrecentchooser.c:266 msgid "Sort Type" msgstr "Triba d'orde" -#: gtk/gtkrecentchooser.c:250 +#: gtk/gtkrecentchooser.c:267 msgid "The sorting order of the items displayed" msgstr "L'orde d'allugamientu de los elementos amosaos" -#: gtk/gtkrecentchooser.c:265 +#: gtk/gtkrecentchooser.c:282 msgid "The current filter for selecting which resources are displayed" msgstr "El filtru actual pa esbillar qué recursos s'amuesen" @@ -4985,25 +4773,25 @@ msgstr "Espaciáu del valor" msgid "Space between value text and the slider/trough area" msgstr "Espaciu ente los valores de testu y la estaya del divisor" -#: gtk/gtkscalebutton.c:207 +#: gtk/gtkscalebutton.c:223 msgid "The value of the scale" msgstr "El valor de la escala" -#: gtk/gtkscalebutton.c:217 +#: gtk/gtkscalebutton.c:233 msgid "The icon size" msgstr "El tamañu del iconu" -#: gtk/gtkscalebutton.c:226 +#: gtk/gtkscalebutton.c:242 msgid "" "The GtkAdjustment that contains the current value of this scale button object" msgstr "" "El GtkAdjustment que caltién el valor actual d'esti oxetu de botón d'escala" -#: gtk/gtkscalebutton.c:254 +#: gtk/gtkscalebutton.c:270 msgid "Icons" msgstr "Iconos" -#: gtk/gtkscalebutton.c:255 +#: gtk/gtkscalebutton.c:271 msgid "List of icon names" msgstr "Llista de nomes d'iconos" @@ -5037,35 +4825,35 @@ msgstr "" "Amuesa un botón secundariu con flecha d'avance nel estremu aviesu de la " "barra de desplazamientu" -#: gtk/gtkscrolledwindow.c:218 gtk/gtktext.c:545 gtk/gtktreeview.c:572 +#: gtk/gtkscrolledwindow.c:235 gtk/gtktreeview.c:574 msgid "Horizontal Adjustment" msgstr "Axuste horizontal" -#: gtk/gtkscrolledwindow.c:225 gtk/gtktext.c:553 gtk/gtktreeview.c:580 +#: gtk/gtkscrolledwindow.c:242 gtk/gtktreeview.c:582 msgid "Vertical Adjustment" msgstr "Axuste vertical" -#: gtk/gtkscrolledwindow.c:232 +#: gtk/gtkscrolledwindow.c:249 msgid "Horizontal Scrollbar Policy" msgstr "Comportamientu de la barra de desplazamientu horizontal" -#: gtk/gtkscrolledwindow.c:233 +#: gtk/gtkscrolledwindow.c:250 msgid "When the horizontal scrollbar is displayed" msgstr "Cuando la barra de desplazamientu horizontal s'amuesa" -#: gtk/gtkscrolledwindow.c:240 +#: gtk/gtkscrolledwindow.c:257 msgid "Vertical Scrollbar Policy" msgstr "Comportamientu de la barra de desplazamientu vertical" -#: gtk/gtkscrolledwindow.c:241 +#: gtk/gtkscrolledwindow.c:258 msgid "When the vertical scrollbar is displayed" msgstr "Cuando s'amuese la barra de desplazamientu vertical" -#: gtk/gtkscrolledwindow.c:249 +#: gtk/gtkscrolledwindow.c:266 msgid "Window Placement" msgstr "Allugamientu de la ventana" -#: gtk/gtkscrolledwindow.c:250 +#: gtk/gtkscrolledwindow.c:267 msgid "" "Where the contents are located with respect to the scrollbars. This property " "only takes effect if \"window-placement-set\" is TRUE." @@ -5073,11 +4861,11 @@ msgstr "" "Au s'alluguen los conteníos respeutu a les barres de desplazamientu. Esta " "propiedá namái tien efeutu si \"window-placement-set\" ye TRUE." -#: gtk/gtkscrolledwindow.c:267 +#: gtk/gtkscrolledwindow.c:284 msgid "Window Placement Set" msgstr "Afita l'allugamientu de la ventana" -#: gtk/gtkscrolledwindow.c:268 +#: gtk/gtkscrolledwindow.c:285 msgid "" "Whether \"window-placement\" should be used to determine the location of the " "contents with respect to the scrollbars." @@ -5085,36 +4873,36 @@ msgstr "" "Indica si tien d'usase \"window-placement\" pa determinar el llugar del " "conteníu respeutu a les barres de desplazamientu." -#: gtk/gtkscrolledwindow.c:274 +#: gtk/gtkscrolledwindow.c:291 msgid "Shadow Type" msgstr "Triba de solombra" -#: gtk/gtkscrolledwindow.c:275 +#: gtk/gtkscrolledwindow.c:292 msgid "Style of bevel around the contents" msgstr "Estilu de bisel al rodiu de los conteníos" -#: gtk/gtkscrolledwindow.c:289 +#: gtk/gtkscrolledwindow.c:306 msgid "Scrollbars within bevel" msgstr "Barres de desplazamientu ente biseles" -#: gtk/gtkscrolledwindow.c:290 +#: gtk/gtkscrolledwindow.c:307 msgid "Place scrollbars within the scrolled window's bevel" msgstr "Allugar barres de desplazamientu ente'l bisel de la ventana desplazada" -#: gtk/gtkscrolledwindow.c:296 +#: gtk/gtkscrolledwindow.c:313 msgid "Scrollbar spacing" msgstr "Espaciáu de la barra de desplazamientu" -#: gtk/gtkscrolledwindow.c:297 +#: gtk/gtkscrolledwindow.c:314 msgid "Number of pixels between the scrollbars and the scrolled window" msgstr "" "Númberu de píxeles ente les barres de desplazamientos y la ventana desplazada" -#: gtk/gtkscrolledwindow.c:312 +#: gtk/gtkscrolledwindow.c:329 msgid "Scrolled Window Placement" msgstr "Allugamientu de la ventana au se desplazó" -#: gtk/gtkscrolledwindow.c:313 +#: gtk/gtkscrolledwindow.c:330 msgid "" "Where the contents of scrolled windows are located with respect to the " "scrollbars, if not overridden by the scrolled window's own placement." @@ -5123,19 +4911,19 @@ msgstr "" "barres de desplazamientu, si nun toma precedencia pol propiu emplazamientu " "de la ventana au se fizo scroll." -#: gtk/gtkseparatortoolitem.c:105 +#: gtk/gtkseparatortoolitem.c:125 msgid "Draw" msgstr "Dibuxar" -#: gtk/gtkseparatortoolitem.c:106 +#: gtk/gtkseparatortoolitem.c:126 msgid "Whether the separator is drawn, or just blank" msgstr "Indica si'l separtador se dibuxa, o namái de dexa en blanco" -#: gtk/gtksettings.c:224 +#: gtk/gtksettings.c:225 msgid "Double Click Time" msgstr "Tiempu del duble pulsación" -#: gtk/gtksettings.c:225 +#: gtk/gtksettings.c:226 msgid "" "Maximum time allowed between two clicks for them to be considered a double " "click (in milliseconds)" @@ -5143,11 +4931,11 @@ msgstr "" "Tiempu máximu permitíu ente dos pulsaciones pa ser consideraos como una " "pulsación duble (en milisegundos)" -#: gtk/gtksettings.c:232 +#: gtk/gtksettings.c:233 msgid "Double Click Distance" msgstr "Distancia de la pulsación duble" -#: gtk/gtksettings.c:233 +#: gtk/gtksettings.c:234 msgid "" "Maximum distance allowed between two clicks for them to be considered a " "double click (in pixels)" @@ -5155,35 +4943,35 @@ msgstr "" "Distancia máxima permitía ente dos pulsaciones pa ser consideraos como una " "pulsación duble (en píxeles)" -#: gtk/gtksettings.c:249 +#: gtk/gtksettings.c:250 msgid "Cursor Blink" msgstr "Parpaguéu del cursor" -#: gtk/gtksettings.c:250 +#: gtk/gtksettings.c:251 msgid "Whether the cursor should blink" msgstr "Indica si'l cursor tien de parpaguiar" -#: gtk/gtksettings.c:257 +#: gtk/gtksettings.c:258 msgid "Cursor Blink Time" msgstr "Tiempu de parpaguéu del cursor" -#: gtk/gtksettings.c:258 +#: gtk/gtksettings.c:259 msgid "Length of the cursor blink cycle, in milliseconds" msgstr "Llonxitú del ciclu de parpaguéu del cursor, en milisegundos" -#: gtk/gtksettings.c:277 +#: gtk/gtksettings.c:278 msgid "Cursor Blink Timeout" msgstr "Intervalu de parpaguéu del cursor" -#: gtk/gtksettings.c:278 +#: gtk/gtksettings.c:279 msgid "Time after which the cursor stops blinking, in seconds" msgstr "Tiempu tres d'el que'l cursor para de parpaguiar, en segundos" -#: gtk/gtksettings.c:285 +#: gtk/gtksettings.c:286 msgid "Split Cursor" msgstr "Cursor dixebráu" -#: gtk/gtksettings.c:286 +#: gtk/gtksettings.c:287 msgid "" "Whether two cursors should be displayed for mixed left-to-right and right-to-" "left text" @@ -5191,159 +4979,159 @@ msgstr "" "Indica si tienen d'amosase dos cursores pal testu mecíu d'esquierda-a-drecha " "y drecha-a-esquierda" -#: gtk/gtksettings.c:293 +#: gtk/gtksettings.c:294 msgid "Theme Name" msgstr "Nome del tema" -#: gtk/gtksettings.c:294 +#: gtk/gtksettings.c:295 msgid "Name of theme RC file to load" msgstr "Nome del ficheru de tema RC a cargar" -#: gtk/gtksettings.c:302 +#: gtk/gtksettings.c:303 msgid "Icon Theme Name" msgstr "Nome del tema d'iconos" -#: gtk/gtksettings.c:303 +#: gtk/gtksettings.c:304 msgid "Name of icon theme to use" msgstr "Nome del tema d'iconos a usar" -#: gtk/gtksettings.c:311 +#: gtk/gtksettings.c:312 msgid "Fallback Icon Theme Name" msgstr "Nome del tema d'iconos de reserva" -#: gtk/gtksettings.c:312 +#: gtk/gtksettings.c:313 msgid "Name of a icon theme to fall back to" msgstr "Nome del tema d'iconos qu'usar en casu de fallu" -#: gtk/gtksettings.c:320 +#: gtk/gtksettings.c:321 msgid "Key Theme Name" msgstr "Nome del tema principal" -#: gtk/gtksettings.c:321 +#: gtk/gtksettings.c:322 msgid "Name of key theme RC file to load" msgstr "Nome del ficheru de tema RC principal a cargar" -#: gtk/gtksettings.c:329 +#: gtk/gtksettings.c:330 msgid "Menu bar accelerator" msgstr "Combinación de tecles de la barra de menús" -#: gtk/gtksettings.c:330 +#: gtk/gtksettings.c:331 msgid "Keybinding to activate the menu bar" msgstr "Combinación de tecles p'activar la barra de menús" -#: gtk/gtksettings.c:338 +#: gtk/gtksettings.c:339 msgid "Drag threshold" msgstr "Umbral del arrastre" -#: gtk/gtksettings.c:339 +#: gtk/gtksettings.c:340 msgid "Number of pixels the cursor can move before dragging" msgstr "" "Cantidá de píxeles que'l cursor puede mover enantes d'entamar l'arrastre" -#: gtk/gtksettings.c:347 +#: gtk/gtksettings.c:348 msgid "Font Name" msgstr "Nome de la fonte" -#: gtk/gtksettings.c:348 +#: gtk/gtksettings.c:349 msgid "Name of default font to use" msgstr "Nome de la fonte predeterminada a usar" -#: gtk/gtksettings.c:370 +#: gtk/gtksettings.c:371 msgid "Icon Sizes" msgstr "Tamaños de los iconos" -#: gtk/gtksettings.c:371 +#: gtk/gtksettings.c:372 msgid "List of icon sizes (gtk-menu=16,16:gtk-button=20,20..." msgstr "" "Llista de los tamaños de los iconos (gtk-menu=16,16:gtk-button=20,20..." -#: gtk/gtksettings.c:379 +#: gtk/gtksettings.c:380 msgid "GTK Modules" msgstr "Módulos GTK" -#: gtk/gtksettings.c:380 +#: gtk/gtksettings.c:381 msgid "List of currently active GTK modules" msgstr "Llista de módulos GTK anguaño activos" -#: gtk/gtksettings.c:389 +#: gtk/gtksettings.c:390 msgid "Xft Antialias" msgstr "Suavizáu Xft" -#: gtk/gtksettings.c:390 +#: gtk/gtksettings.c:391 msgid "Whether to antialias Xft fonts; 0=no, 1=yes, -1=default" msgstr "" "Indica si se tienen de suavizar los berbesos de les fontes Xft; 0=no,1=sí, -" "1=predetermináu" -#: gtk/gtksettings.c:399 +#: gtk/gtksettings.c:400 msgid "Xft Hinting" msgstr "Suxerencies Xft" -#: gtk/gtksettings.c:400 +#: gtk/gtksettings.c:401 msgid "Whether to hint Xft fonts; 0=no, 1=yes, -1=default" msgstr "" "Indica si se tienen d'usar les suxerencies de les fontes Xft; 0=no, 1 =sí, -" "1=predetermináu" -#: gtk/gtksettings.c:409 +#: gtk/gtksettings.c:410 msgid "Xft Hint Style" msgstr "Estilu de suxerencies Xft" -#: gtk/gtksettings.c:410 +#: gtk/gtksettings.c:411 msgid "" "What degree of hinting to use; hintnone, hintslight, hintmedium, or hintfull" msgstr "Qué gráu de suxerencies usar: dengún, llixeru, mediu o completu" -#: gtk/gtksettings.c:419 +#: gtk/gtksettings.c:420 msgid "Xft RGBA" msgstr "Xft RGBA" -#: gtk/gtksettings.c:420 +#: gtk/gtksettings.c:421 msgid "Type of subpixel antialiasing; none, rgb, bgr, vrgb, vbgr" msgstr "Triba de suavizáu de subpíxel: dengún, rgb, bgr, vrgb, vbgr" -#: gtk/gtksettings.c:429 +#: gtk/gtksettings.c:430 msgid "Xft DPI" msgstr "PPP Xft (DPI)" -#: gtk/gtksettings.c:430 +#: gtk/gtksettings.c:431 msgid "Resolution for Xft, in 1024 * dots/inch. -1 to use default value" msgstr "" "Resolución pa Xft, en 1024 * puntos/pulgada. -1 pa usar el valor " "predetermináu." -#: gtk/gtksettings.c:439 +#: gtk/gtksettings.c:440 msgid "Cursor theme name" msgstr "Nome del tema del cursor" -#: gtk/gtksettings.c:440 +#: gtk/gtksettings.c:441 msgid "Name of the cursor theme to use, or NULL to use the default theme" msgstr "Nome del tema de cursor qu'usar, o NULL pa usar el tema predetermináu" -#: gtk/gtksettings.c:448 +#: gtk/gtksettings.c:449 msgid "Cursor theme size" msgstr "Tamañu del tema del cursor" -#: gtk/gtksettings.c:449 +#: gtk/gtksettings.c:450 msgid "Size to use for cursors, or 0 to use the default size" msgstr "" "Tamañu que se va a usar pa los cursores, o 0 pa usar el tamañu predetermináu" -#: gtk/gtksettings.c:459 +#: gtk/gtksettings.c:460 msgid "Alternative button order" msgstr "Orde de los botones alternativu" -#: gtk/gtksettings.c:460 +#: gtk/gtksettings.c:461 msgid "Whether buttons in dialogs should use the alternative button order" msgstr "" "Indica si los botones nos diálogos tienen d'usar un orde de botones " "alternativu" -#: gtk/gtksettings.c:477 +#: gtk/gtksettings.c:478 msgid "Alternative sort indicator direction" msgstr "Direición alternativa del indicador d'ordenamientu" -#: gtk/gtksettings.c:478 +#: gtk/gtksettings.c:479 msgid "" "Whether the direction of the sort indicators in list and tree views is " "inverted compared to the default (where down means ascending)" @@ -5352,11 +5140,11 @@ msgstr "" "de árbol ta invertía en comparación cola predeterminada (au abaxo significa " "ascendente)" -#: gtk/gtksettings.c:486 +#: gtk/gtksettings.c:487 msgid "Show the 'Input Methods' menu" msgstr "Amosar el menú de métodos d'entrada" -#: gtk/gtksettings.c:487 +#: gtk/gtksettings.c:488 msgid "" "Whether the context menus of entries and text views should offer to change " "the input method" @@ -5364,11 +5152,11 @@ msgstr "" "Indica si los menús de contestu y les vistes de testu tienen d'ufrir camudar " "el métodu d'entrada" -#: gtk/gtksettings.c:495 +#: gtk/gtksettings.c:496 msgid "Show the 'Insert Unicode Control Character' menu" msgstr "Amosar el menú «Inxertar caráuter de control Unicode»" -#: gtk/gtksettings.c:496 +#: gtk/gtksettings.c:497 msgid "" "Whether the context menus of entries and text views should offer to insert " "control characters" @@ -5376,253 +5164,253 @@ msgstr "" "Indica si los menús de contestu de les entraes y les vistes de testu tienen " "d'ufrir inxertar carauteres de control" -#: gtk/gtksettings.c:504 +#: gtk/gtksettings.c:505 msgid "Start timeout" msgstr "Tiempu d'espiración de aniciu" -#: gtk/gtksettings.c:505 +#: gtk/gtksettings.c:506 msgid "Starting value for timeouts, when button is pressed" msgstr "Valor d'aniciu pa les espiraciones, cuando se calca'l botón" -#: gtk/gtksettings.c:514 +#: gtk/gtksettings.c:515 msgid "Repeat timeout" msgstr "Espiración de repetición" -#: gtk/gtksettings.c:515 +#: gtk/gtksettings.c:516 msgid "Repeat value for timeouts, when button is pressed" msgstr "Valor de repetición pa espiraciones, cuando'l botón se calca" -#: gtk/gtksettings.c:524 +#: gtk/gtksettings.c:525 msgid "Expand timeout" msgstr "Espiración del espansor" -#: gtk/gtksettings.c:525 +#: gtk/gtksettings.c:526 msgid "Expand value for timeouts, when a widget is expanding a new region" msgstr "" "Valor d'espansión pa les espiraciones, cuando un widget ta espandiendo una " "rexón nueva" -#: gtk/gtksettings.c:560 +#: gtk/gtksettings.c:561 msgid "Color scheme" msgstr "Esquema de color" -#: gtk/gtksettings.c:561 +#: gtk/gtksettings.c:562 msgid "A palette of named colors for use in themes" msgstr "Una paleta de colores con nome pa usar nos temes" -#: gtk/gtksettings.c:570 +#: gtk/gtksettings.c:571 msgid "Enable Animations" msgstr "Activar animaciones" -#: gtk/gtksettings.c:571 +#: gtk/gtksettings.c:572 msgid "Whether to enable toolkit-wide animations." msgstr "Indica si s'activen les animaciones pa tol toolkit." -#: gtk/gtksettings.c:589 +#: gtk/gtksettings.c:590 msgid "Enable Touchscreen Mode" msgstr "Activar mou pantalla táctil" -#: gtk/gtksettings.c:590 +#: gtk/gtksettings.c:591 msgid "When TRUE, there are no motion notify events delivered on this screen" msgstr "" "Cuando tea a TRUE, nun hai eventos de notificación de movimientu entregaos " "nesta pantalla" -#: gtk/gtksettings.c:607 +#: gtk/gtksettings.c:608 msgid "Tooltip timeout" msgstr "Tiempu d'espiración del conseyu" -#: gtk/gtksettings.c:608 +#: gtk/gtksettings.c:609 msgid "Timeout before tooltip is shown" msgstr "Tiempu d'espiración enantes de que s'amuese el conseyu" -#: gtk/gtksettings.c:633 +#: gtk/gtksettings.c:634 msgid "Tooltip browse timeout" msgstr "Tiempu de los conseyos de restolación" -#: gtk/gtksettings.c:634 +#: gtk/gtksettings.c:635 msgid "Timeout before tooltip is shown when browse mode is enabled" msgstr "" "Tiempu d'espiración enantes de que s'amuese el conseyu cuando'l mou de " "restolación ta activáu" -#: gtk/gtksettings.c:655 +#: gtk/gtksettings.c:656 msgid "Tooltip browse mode timeout" msgstr "Tiempu de los conseyos en mou restolación" -#: gtk/gtksettings.c:656 +#: gtk/gtksettings.c:657 msgid "Timeout after which browse mode is disabled" msgstr "Tiempu d'espiración dempués del cual se desactiva'l mou de restolación" -#: gtk/gtksettings.c:675 +#: gtk/gtksettings.c:676 msgid "Keynav Cursor Only" msgstr "Namái cursor pa restolar con tecles" -#: gtk/gtksettings.c:676 +#: gtk/gtksettings.c:677 msgid "When TRUE, there are only cursor keys available to navigate widgets" msgstr "" "Cuando seya TRUE, namái hai tecles de cursos disponibles pa restolar polos " "widgets" -#: gtk/gtksettings.c:693 +#: gtk/gtksettings.c:694 msgid "Keynav Wrap Around" msgstr "Saltar al restolar col tecláu" -#: gtk/gtksettings.c:694 +#: gtk/gtksettings.c:695 msgid "Whether to wrap around when keyboard-navigating widgets" msgstr "" "Indica si se tien de saltar al rodiu cuando se restole polos widgets col " "tecláu" -#: gtk/gtksettings.c:714 +#: gtk/gtksettings.c:715 msgid "Error Bell" msgstr "Campana de fallu" -#: gtk/gtksettings.c:715 +#: gtk/gtksettings.c:716 msgid "When TRUE, keyboard navigation and other errors will cause a beep" msgstr "" "Cuando seya TRUE, la restolación col tecláu y otros fallos causarán un bip" -#: gtk/gtksettings.c:732 +#: gtk/gtksettings.c:733 msgid "Color Hash" msgstr "Hash del color" -#: gtk/gtksettings.c:733 +#: gtk/gtksettings.c:734 msgid "A hash table representation of the color scheme." msgstr "Una representación en tabla hash del esquema de color." -#: gtk/gtksettings.c:741 +#: gtk/gtksettings.c:742 msgid "Default file chooser backend" msgstr "Backend predetermináu del seleutor de ficheros" -#: gtk/gtksettings.c:742 +#: gtk/gtksettings.c:743 msgid "Name of the GtkFileChooser backend to use by default" msgstr "Nome del backend del GtkFilechooser a usar por omisión" -#: gtk/gtksettings.c:759 +#: gtk/gtksettings.c:760 msgid "Default print backend" msgstr "Backend predetermináu d'imprentación" -#: gtk/gtksettings.c:760 +#: gtk/gtksettings.c:761 msgid "List of the GtkPrintBackend backends to use by default" msgstr "Llista de backends GtkPrintBackend pa usar por omisión" -#: gtk/gtksettings.c:783 +#: gtk/gtksettings.c:784 msgid "Default command to run when displaying a print preview" msgstr "" "Comandu predetermináu qu'executar al amosar una vista previa d'imprentación" -#: gtk/gtksettings.c:784 +#: gtk/gtksettings.c:785 msgid "Command to run when displaying a print preview" msgstr "Comandu qu'executar al amosar una vista previa d'imprentación" -#: gtk/gtksettings.c:800 +#: gtk/gtksettings.c:801 msgid "Enable Mnemonics" msgstr "Activar mnemónicos" -#: gtk/gtksettings.c:801 +#: gtk/gtksettings.c:802 msgid "Whether labels should have mnemonics" msgstr "Indica si les etiquetes tienen de tener mnemónicos" -#: gtk/gtksettings.c:817 +#: gtk/gtksettings.c:818 msgid "Enable Accelerators" msgstr "Activar aceleradores" -#: gtk/gtksettings.c:818 +#: gtk/gtksettings.c:819 msgid "Whether menu items should have accelerators" msgstr "Indica si los elementos del menú tienen de tener aceleradores" -#: gtk/gtksettings.c:835 +#: gtk/gtksettings.c:836 msgid "Recent Files Limit" msgstr "Llímite de ficheros recientes" -#: gtk/gtksettings.c:836 +#: gtk/gtksettings.c:837 msgid "Number of recently used files" msgstr "Númberu de ficheros usados recientemente" -#: gtk/gtksettings.c:854 +#: gtk/gtksettings.c:855 msgid "Default IM module" msgstr "Módulo de métodu d'entrada predetermináu" -#: gtk/gtksettings.c:855 +#: gtk/gtksettings.c:856 msgid "Which IM module should be used by default" msgstr "Qué módulu de métodu d'entrada se tien d'usar de mou predetermináu" -#: gtk/gtksettings.c:873 +#: gtk/gtksettings.c:874 msgid "Recent Files Max Age" msgstr "Antigüedá máxima de los ficheros recientes" -#: gtk/gtksettings.c:874 +#: gtk/gtksettings.c:875 msgid "Maximum age of recently used files, in days" msgstr "Máxima antigüedá pa los ficheros recientemente usaos, en díes" -#: gtk/gtksettings.c:883 +#: gtk/gtksettings.c:884 msgid "Fontconfig configuration timestamp" msgstr "Configuración de la marca de tiempu de fontconfig" -#: gtk/gtksettings.c:884 +#: gtk/gtksettings.c:885 msgid "Timestamp of current fontconfig configuration" msgstr "Marca de tiempu de la configuración actual de fontconfig" -#: gtk/gtksettings.c:906 +#: gtk/gtksettings.c:907 msgid "Sound Theme Name" msgstr "Nome del tema de soníu" -#: gtk/gtksettings.c:907 +#: gtk/gtksettings.c:908 msgid "XDG sound theme name" msgstr "Nome del tema de soníu XDG" #. Translators: this means sounds that are played as feedback to user input -#: gtk/gtksettings.c:929 +#: gtk/gtksettings.c:930 msgid "Audible Input Feedback" msgstr "Contestu d'entrada audible" -#: gtk/gtksettings.c:930 +#: gtk/gtksettings.c:931 msgid "Whether to play event sounds as feedback to user input" msgstr "" "Indica si se tienen de reproducir eventos como rempuesta a les entraes del " "usuariu" -#: gtk/gtksettings.c:951 +#: gtk/gtksettings.c:952 msgid "Enable Event Sounds" msgstr "Activar eventos de soníu" -#: gtk/gtksettings.c:952 +#: gtk/gtksettings.c:953 msgid "Whether to play any event sounds at all" msgstr "Indica si se tien de reproducir cualesquier eventu de soníu" -#: gtk/gtksettings.c:967 +#: gtk/gtksettings.c:968 msgid "Enable Tooltips" msgstr "Activar conseyos" -#: gtk/gtksettings.c:968 +#: gtk/gtksettings.c:969 msgid "Whether tooltips should be shown on widgets" msgstr "Indica si se tienen d'amosar los conseyos nos widgets" -#: gtk/gtksettings.c:981 +#: gtk/gtksettings.c:982 msgid "Toolbar style" msgstr "Estilu de la barra de ferramientes" -#: gtk/gtksettings.c:982 +#: gtk/gtksettings.c:983 msgid "" "Whether default toolbars have text only, text and icons, icons only, etc." msgstr "" "Indica si les barres de ferramientes predeterminaes tienen namái testu, " "testu ya iconos, namái iconos, etc." -#: gtk/gtksettings.c:996 +#: gtk/gtksettings.c:997 msgid "Toolbar Icon Size" msgstr "Tamañu del iconu de la barra de ferramientes" -#: gtk/gtksettings.c:997 +#: gtk/gtksettings.c:998 msgid "The size of icons in default toolbars." msgstr "Tamañu de los iconos nes barres de ferramientes predeterminaes" -#: gtk/gtksettings.c:1014 +#: gtk/gtksettings.c:1015 msgid "Auto Mnemonics" msgstr "Auto mnemónicos" -#: gtk/gtksettings.c:1015 +#: gtk/gtksettings.c:1016 msgid "" "Whether mnemonics should be automatically shown and hidden when the user " "presses the mnemonic activator." @@ -5630,11 +5418,21 @@ msgstr "" "Indica si hai d'amosar y anubrir los mnemónicos cuando l'usuariu calca nel " "activador mnemónicu." -#: gtk/gtksizegroup.c:301 +#: gtk/gtksettings.c:1041 +#, fuzzy +msgid "Application prefers a dark theme" +msgstr "Pintable pola aplicación" + +#: gtk/gtksettings.c:1042 +#, fuzzy +msgid "Whether the application prefers to have a dark theme." +msgstr "Indica si l'aplicación tien una seleición" + +#: gtk/gtksizegroup.c:320 msgid "Mode" msgstr "Mou" -#: gtk/gtksizegroup.c:302 +#: gtk/gtksizegroup.c:321 msgid "" "The directions in which the size group affects the requested sizes of its " "component widgets" @@ -5642,11 +5440,11 @@ msgstr "" "Les direcciones nes cuales el tamañu del grupu afeuta a los tamaños " "solicitaos de los sos widgets componentes" -#: gtk/gtksizegroup.c:318 +#: gtk/gtksizegroup.c:337 msgid "Ignore hidden" msgstr "Inorar anubríes" -#: gtk/gtksizegroup.c:319 +#: gtk/gtksizegroup.c:338 msgid "" "If TRUE, unmapped widgets are ignored when determining the size of the group" msgstr "" @@ -5750,59 +5548,59 @@ msgstr "" msgid "Style of bevel around the statusbar text" msgstr "Estilu del bisel al rodiu del testu de la barra d'estáu" -#: gtk/gtkstatusicon.c:271 +#: gtk/gtkstatusicon.c:276 msgid "The size of the icon" msgstr "El tamañu del iconu" -#: gtk/gtkstatusicon.c:281 +#: gtk/gtkstatusicon.c:286 msgid "The screen where this status icon will be displayed" msgstr "La pantalla au s'amosará esti iconu d'estáu" -#: gtk/gtkstatusicon.c:288 +#: gtk/gtkstatusicon.c:293 msgid "Blinking" msgstr "Parpaguéu" -#: gtk/gtkstatusicon.c:289 +#: gtk/gtkstatusicon.c:294 msgid "Whether or not the status icon is blinking" msgstr "Indica si l'iconu d'estáu parpaguea" -#: gtk/gtkstatusicon.c:297 +#: gtk/gtkstatusicon.c:302 msgid "Whether or not the status icon is visible" msgstr "Indica si l'aición ye visible" -#: gtk/gtkstatusicon.c:313 +#: gtk/gtkstatusicon.c:318 msgid "Whether or not the status icon is embedded" msgstr "Indica si l'iconu d'estáu ta empotráu" -#: gtk/gtkstatusicon.c:329 gtk/gtktrayicon-x11.c:111 +#: gtk/gtkstatusicon.c:334 gtk/gtktrayicon-x11.c:123 msgid "The orientation of the tray" msgstr "La orientación de la bandexa" -#: gtk/gtkstatusicon.c:356 gtk/gtkwidget.c:702 +#: gtk/gtkstatusicon.c:361 gtk/gtkwidget.c:722 msgid "Has tooltip" msgstr "Tien conseyu" -#: gtk/gtkstatusicon.c:357 +#: gtk/gtkstatusicon.c:362 msgid "Whether this tray icon has a tooltip" msgstr "Indica si l'iconu de la bandexa tien un conseyu" -#: gtk/gtkstatusicon.c:382 gtk/gtkwidget.c:723 +#: gtk/gtkstatusicon.c:387 gtk/gtkwidget.c:743 msgid "Tooltip Text" msgstr "Testu del conseyu" -#: gtk/gtkstatusicon.c:383 gtk/gtkwidget.c:724 gtk/gtkwidget.c:745 +#: gtk/gtkstatusicon.c:388 gtk/gtkwidget.c:744 gtk/gtkwidget.c:765 msgid "The contents of the tooltip for this widget" msgstr "El conteníu de los conseyos pa esti widget" -#: gtk/gtkstatusicon.c:406 gtk/gtkwidget.c:744 +#: gtk/gtkstatusicon.c:411 gtk/gtkwidget.c:764 msgid "Tooltip markup" msgstr "Marcáu de conseyos" -#: gtk/gtkstatusicon.c:407 +#: gtk/gtkstatusicon.c:412 msgid "The contents of the tooltip for this tray icon" msgstr "El conteníu de los conseyos pa esti iconu de la bandexa" -#: gtk/gtkstatusicon.c:425 +#: gtk/gtkstatusicon.c:430 msgid "The title of this tray icon" msgstr "El títulu d'esti iconu de la bandexa" @@ -5906,30 +5704,6 @@ msgstr "" "Espaciu estra a allugar ente'l fíu y los sos vecinos superiores e " "inferiores, en píxeles" -#: gtk/gtktext.c:546 -msgid "Horizontal adjustment for the text widget" -msgstr "Axuste horizontal pal widget de testu" - -#: gtk/gtktext.c:554 -msgid "Vertical adjustment for the text widget" -msgstr "Axuste vertical pal widget de testu" - -#: gtk/gtktext.c:561 -msgid "Line Wrap" -msgstr "Axuste de llinia" - -#: gtk/gtktext.c:562 -msgid "Whether lines are wrapped at widget edges" -msgstr "Indica si les llinies s'axusten a los berbesos del widget" - -#: gtk/gtktext.c:569 -msgid "Word Wrap" -msgstr "Axuste de pallabra" - -#: gtk/gtktext.c:570 -msgid "Whether words are wrapped at widget edges" -msgstr "Indica si les pallabras axústense a los berbesos del widget" - #: gtk/gtktextbuffer.c:180 msgid "Tag Table" msgstr "Tabla de marques" @@ -6374,17 +6148,17 @@ msgstr "Color de sorrayáu de fallos" msgid "Color with which to draw error-indication underlines" msgstr "Color col que dibuxar el sorrayáu d'indicación de fallos" -#: gtk/gtktoggleaction.c:104 +#: gtk/gtktoggleaction.c:115 msgid "Create the same proxies as a radio action" msgstr "Criar los mesmos proxies como una aición de radio" -#: gtk/gtktoggleaction.c:105 +#: gtk/gtktoggleaction.c:116 msgid "Whether the proxies for this action look like radio action proxies" msgstr "" "Indica si l'apariencia de los proxies pa esta aición ye como un proxy de " "aición de radio" -#: gtk/gtktoggleaction.c:120 +#: gtk/gtktoggleaction.c:131 msgid "If the toggle action should be active in or not" msgstr "Si l'aición de conmutación tien detar activa o non" @@ -6404,94 +6178,85 @@ msgstr "Indicador de dibuxu" msgid "If the toggle part of the button is displayed" msgstr "Si la parte d'activación del botón s'amuesa" -#: gtk/gtktoolbar.c:494 gtk/gtktoolpalette.c:1020 +#: gtk/gtktoolbar.c:456 gtk/gtktoolpalette.c:1021 msgid "Toolbar Style" msgstr "Estilu de la barra de ferramientes" -#: gtk/gtktoolbar.c:495 +#: gtk/gtktoolbar.c:457 msgid "How to draw the toolbar" msgstr "Cómo dibuxar la barra de ferramientes" -#: gtk/gtktoolbar.c:502 +#: gtk/gtktoolbar.c:464 msgid "Show Arrow" msgstr "Amosar flecha" -#: gtk/gtktoolbar.c:503 +#: gtk/gtktoolbar.c:465 msgid "If an arrow should be shown if the toolbar doesn't fit" msgstr "" "Indica si tien d'amosase una flecha si nun cabe la barra de ferramientes" -#: gtk/gtktoolbar.c:518 -msgid "Tooltips" -msgstr "Conseyos" - -#: gtk/gtktoolbar.c:519 -msgid "If the tooltips of the toolbar should be active or not" -msgstr "" -"Si los conseyos de la barra de ferramientes tienen de tar activaos o non" - -#: gtk/gtktoolbar.c:541 +#: gtk/gtktoolbar.c:486 msgid "Size of icons in this toolbar" msgstr "Tamañu de los iconos nesta barra de ferramientes" -#: gtk/gtktoolbar.c:556 gtk/gtktoolpalette.c:1006 +#: gtk/gtktoolbar.c:501 gtk/gtktoolpalette.c:1007 msgid "Icon size set" msgstr "Tamañu del iconu afitáu" -#: gtk/gtktoolbar.c:557 gtk/gtktoolpalette.c:1007 +#: gtk/gtktoolbar.c:502 gtk/gtktoolpalette.c:1008 msgid "Whether the icon-size property has been set" msgstr "Indica si s'afitó la propiedá de tamañu del iconu" -#: gtk/gtktoolbar.c:566 +#: gtk/gtktoolbar.c:511 msgid "Whether the item should receive extra space when the toolbar grows" msgstr "" "Indica si'l elementu tendría recibir espaciu estra cuando la barra xorreza" -#: gtk/gtktoolbar.c:574 gtk/gtktoolitemgroup.c:1589 +#: gtk/gtktoolbar.c:519 gtk/gtktoolitemgroup.c:1597 msgid "Whether the item should be the same size as other homogeneous items" msgstr "" "Indica si'l elementu tendría ser del mesmu tamañu qu'otros elementos " "homoxéneos" -#: gtk/gtktoolbar.c:581 +#: gtk/gtktoolbar.c:526 msgid "Spacer size" msgstr "Tamañu del espaciador" -#: gtk/gtktoolbar.c:582 +#: gtk/gtktoolbar.c:527 msgid "Size of spacers" msgstr "Tamañu de los espaciadores" -#: gtk/gtktoolbar.c:591 +#: gtk/gtktoolbar.c:536 msgid "Amount of border space between the toolbar shadow and the buttons" msgstr "" "Cantidá d'espaciu del berbesu ente la solombra de la barra de ferramientes y " "los botones" -#: gtk/gtktoolbar.c:599 +#: gtk/gtktoolbar.c:544 msgid "Maximum child expand" msgstr "Espansión máxima de fíos" -#: gtk/gtktoolbar.c:600 +#: gtk/gtktoolbar.c:545 msgid "Maximum amount of space an expandable item will be given" msgstr "Cantidá máxima d'espaciu que se-y dará a un elementu espandible" -#: gtk/gtktoolbar.c:608 +#: gtk/gtktoolbar.c:553 msgid "Space style" msgstr "Estilu del espaciu" -#: gtk/gtktoolbar.c:609 +#: gtk/gtktoolbar.c:554 msgid "Whether spacers are vertical lines or just blank" msgstr "Indica si los espaciadores son llinies verticales o namái blancos" -#: gtk/gtktoolbar.c:616 +#: gtk/gtktoolbar.c:561 msgid "Button relief" msgstr "Relieve del botón" -#: gtk/gtktoolbar.c:617 +#: gtk/gtktoolbar.c:562 msgid "Type of bevel around toolbar buttons" msgstr "Triba de bisel al rodiu de los botones de la barra de ferramientes" -#: gtk/gtktoolbar.c:624 +#: gtk/gtktoolbar.c:569 msgid "Style of bevel around the toolbar" msgstr "Estilu del bisel al rodiu de la barra de ferramientes" @@ -6544,7 +6309,7 @@ msgstr "Espaciáu ente iconos" msgid "Spacing in pixels between the icon and label" msgstr "Espaciáu en píxeles ente l'iconu y la etiqueta" -#: gtk/gtktoolitem.c:207 +#: gtk/gtktoolitem.c:200 msgid "" "Whether the toolbar item is considered important. When TRUE, toolbar buttons " "show text in GTK_TOOLBAR_BOTH_HORIZ mode" @@ -6553,104 +6318,141 @@ msgstr "" "ta a TRUE, los botones de la barra de ferramientes amuesen testu en mou " "GTK_TOOLBAR_BOTH_HORIZ" -#: gtk/gtktoolitemgroup.c:1536 +#: gtk/gtktoolitemgroup.c:1544 #, fuzzy msgid "The human-readable title of this item group" msgstr "Una descripción del estáu lleíble por humanos" -#: gtk/gtktoolitemgroup.c:1543 +#: gtk/gtktoolitemgroup.c:1551 #, fuzzy msgid "A widget to display in place of the usual label" msgstr "Un widget a amosar n'arróu de la usual etiqueta del marcu" -#: gtk/gtktoolitemgroup.c:1549 +#: gtk/gtktoolitemgroup.c:1557 msgid "Collapsed" msgstr "" -#: gtk/gtktoolitemgroup.c:1550 +#: gtk/gtktoolitemgroup.c:1558 #, fuzzy msgid "Wether the group has been collapsed and items are hidden" msgstr "Indica si l'estensor s'abrió pa revelar el widget fíu" -#: gtk/gtktoolitemgroup.c:1556 +#: gtk/gtktoolitemgroup.c:1564 #, fuzzy msgid "ellipsize" msgstr "Elipsis" -#: gtk/gtktoolitemgroup.c:1557 +#: gtk/gtktoolitemgroup.c:1565 msgid "Ellipsize for item group headers" msgstr "" -#: gtk/gtktoolitemgroup.c:1563 +#: gtk/gtktoolitemgroup.c:1571 #, fuzzy msgid "Header Relief" msgstr "Imaxe de la cabecera" -#: gtk/gtktoolitemgroup.c:1564 +#: gtk/gtktoolitemgroup.c:1572 #, fuzzy msgid "Relief of the group header button" msgstr "Amosar botones nos encabezaos de columna" -#: gtk/gtktoolitemgroup.c:1579 +#: gtk/gtktoolitemgroup.c:1587 #, fuzzy msgid "Header Spacing" msgstr "Separtación de la cabecera" -#: gtk/gtktoolitemgroup.c:1580 +#: gtk/gtktoolitemgroup.c:1588 #, fuzzy msgid "Spacing between expander arrow and caption" msgstr "Espaciáu al rodiu de la flecha del estensor" -#: gtk/gtktoolitemgroup.c:1596 +#: gtk/gtktoolitemgroup.c:1604 #, fuzzy msgid "Whether the item should receive extra space when the group grows" msgstr "" "Indica si'l elementu tendría recibir espaciu estra cuando la barra xorreza" -#: gtk/gtktoolitemgroup.c:1603 +#: gtk/gtktoolitemgroup.c:1611 #, fuzzy msgid "Whether the item should fill the available space" msgstr "Indica si tolos fíos tienen ser del mesmu tamañu" -#: gtk/gtktoolitemgroup.c:1609 +#: gtk/gtktoolitemgroup.c:1617 msgid "New Row" msgstr "" -#: gtk/gtktoolitemgroup.c:1610 +#: gtk/gtktoolitemgroup.c:1618 #, fuzzy msgid "Whether the item should start a new row" msgstr "Indica si los elementos tienen d'amosase con un númberu" -#: gtk/gtktoolitemgroup.c:1617 +#: gtk/gtktoolitemgroup.c:1625 #, fuzzy msgid "Position of the item within this group" msgstr "Posición de la marca na regla" -#: gtk/gtktoolpalette.c:991 +#: gtk/gtktoolpalette.c:992 #, fuzzy msgid "Size of icons in this tool palette" msgstr "Tamañu de los iconos nesta barra de ferramientes" -#: gtk/gtktoolpalette.c:1021 +#: gtk/gtktoolpalette.c:1022 #, fuzzy msgid "Style of items in the tool palette" msgstr "Estilu del bisel al rodiu de la barra de ferramientes" -#: gtk/gtktoolpalette.c:1037 +#: gtk/gtktoolpalette.c:1038 msgid "Exclusive" msgstr "" -#: gtk/gtktoolpalette.c:1038 +#: gtk/gtktoolpalette.c:1039 #, fuzzy msgid "Whether the item group should be the only expanded at a given time" msgstr "Indica si los elementos tienen d'amosase con un númberu" -#: gtk/gtktoolpalette.c:1053 +#: gtk/gtktoolpalette.c:1054 #, fuzzy msgid "" "Whether the item group should receive extra space when the palette grows" msgstr "Indica si'l fíu tien de recibir espaciu estra cuando'l padre xorrez" +#: gtk/gtktrayicon-x11.c:132 +#, fuzzy +msgid "Foreground color for symbolic icons" +msgstr "Color de primer planu como una cadena" + +#: gtk/gtktrayicon-x11.c:139 +#, fuzzy +msgid "Error color" +msgstr "Color del cursor" + +#: gtk/gtktrayicon-x11.c:140 +msgid "Error color for symbolic icons" +msgstr "" + +#: gtk/gtktrayicon-x11.c:147 +#, fuzzy +msgid "Warning color" +msgstr "Color de fondu" + +#: gtk/gtktrayicon-x11.c:148 +msgid "Warning color for symbolic icons" +msgstr "" + +#: gtk/gtktrayicon-x11.c:155 +#, fuzzy +msgid "Success color" +msgstr "Color del cursor" + +#: gtk/gtktrayicon-x11.c:156 +msgid "Success color for symbolic icons" +msgstr "" + +#: gtk/gtktrayicon-x11.c:164 +#, fuzzy +msgid "Padding that should be put around icons in the tray" +msgstr "Indica si tien d'haber un iconu cerca del elementu" + #: gtk/gtktreemodelsort.c:278 msgid "TreeModelSort Model" msgstr "Modelu TreeModelSort" @@ -6659,234 +6461,234 @@ msgstr "Modelu TreeModelSort" msgid "The model for the TreeModelSort to sort" msgstr "El modelu pal TreeModelSort a axeitar" -#: gtk/gtktreeview.c:564 +#: gtk/gtktreeview.c:566 msgid "TreeView Model" msgstr "Modelu TreeView" -#: gtk/gtktreeview.c:565 +#: gtk/gtktreeview.c:567 msgid "The model for the tree view" msgstr "El modelu pa la vista d'árbol" -#: gtk/gtktreeview.c:573 +#: gtk/gtktreeview.c:575 msgid "Horizontal Adjustment for the widget" msgstr "Axuste horizontal pal widget" -#: gtk/gtktreeview.c:581 +#: gtk/gtktreeview.c:583 msgid "Vertical Adjustment for the widget" msgstr "Axuste vertical pal widget" -#: gtk/gtktreeview.c:588 +#: gtk/gtktreeview.c:590 msgid "Headers Visible" msgstr "Cabeceres visibles" -#: gtk/gtktreeview.c:589 +#: gtk/gtktreeview.c:591 msgid "Show the column header buttons" msgstr "Amosar botones nos encabezaos de columna" -#: gtk/gtktreeview.c:596 +#: gtk/gtktreeview.c:598 msgid "Headers Clickable" msgstr "Cabeceres pulsables" -#: gtk/gtktreeview.c:597 +#: gtk/gtktreeview.c:599 msgid "Column headers respond to click events" msgstr "Les cabeceres de les columnes respuenden a los eventos de pulsación" -#: gtk/gtktreeview.c:604 +#: gtk/gtktreeview.c:606 msgid "Expander Column" msgstr "Columna estensora" -#: gtk/gtktreeview.c:605 +#: gtk/gtktreeview.c:607 msgid "Set the column for the expander column" msgstr "Define la columna pa la columna estensora" -#: gtk/gtktreeview.c:620 +#: gtk/gtktreeview.c:622 msgid "Rules Hint" msgstr "Conseyu de les regles" -#: gtk/gtktreeview.c:621 +#: gtk/gtktreeview.c:623 msgid "Set a hint to the theme engine to draw rows in alternating colors" msgstr "" "Define un conseyu pal motor del tema pa dibuxar les fileres con colores " "alternativos" -#: gtk/gtktreeview.c:628 +#: gtk/gtktreeview.c:630 msgid "Enable Search" msgstr "Activar gueta" -#: gtk/gtktreeview.c:629 +#: gtk/gtktreeview.c:631 msgid "View allows user to search through columns interactively" msgstr "" "La vista permite a los usuarios guetar en mou interactivu a traviés de les " "columnes" -#: gtk/gtktreeview.c:636 +#: gtk/gtktreeview.c:638 msgid "Search Column" msgstr "Columna de gueta" -#: gtk/gtktreeview.c:637 +#: gtk/gtktreeview.c:639 msgid "Model column to search through during interactive search" msgstr "Columna modelu pa guetar a traviés d'ella nuna gueta interactiva" -#: gtk/gtktreeview.c:657 +#: gtk/gtktreeview.c:659 msgid "Fixed Height Mode" msgstr "Mou d'altor fixu" -#: gtk/gtktreeview.c:658 +#: gtk/gtktreeview.c:660 msgid "Speeds up GtkTreeView by assuming that all rows have the same height" msgstr "Acelera GtkTreeView asumiendo que toles fileres tienen el mesmu altor" -#: gtk/gtktreeview.c:678 +#: gtk/gtktreeview.c:680 msgid "Hover Selection" msgstr "Escoyeta al pasar per enriba" -#: gtk/gtktreeview.c:679 +#: gtk/gtktreeview.c:681 msgid "Whether the selection should follow the pointer" msgstr "Indica si la Escoyeta tendría de siguir al punteru" -#: gtk/gtktreeview.c:698 +#: gtk/gtktreeview.c:700 msgid "Hover Expand" msgstr "Espander al poner el cursor enriba" -#: gtk/gtktreeview.c:699 +#: gtk/gtktreeview.c:701 msgid "" "Whether rows should be expanded/collapsed when the pointer moves over them" msgstr "" "Indica si les fileres tienen d'espandise/contrayese cuando'l punteru se " "mueve sobro elles" -#: gtk/gtktreeview.c:713 +#: gtk/gtktreeview.c:715 msgid "Show Expanders" msgstr "Amosar espansores" -#: gtk/gtktreeview.c:714 +#: gtk/gtktreeview.c:716 msgid "View has expanders" msgstr "La vista tien espansores" -#: gtk/gtktreeview.c:728 +#: gtk/gtktreeview.c:730 msgid "Level Indentation" msgstr "Nivel de sangráu" -#: gtk/gtktreeview.c:729 +#: gtk/gtktreeview.c:731 msgid "Extra indentation for each level" msgstr "Sangría estra pa cada nivel" -#: gtk/gtktreeview.c:738 +#: gtk/gtktreeview.c:740 msgid "Rubber Banding" msgstr "Bandes de goma" -#: gtk/gtktreeview.c:739 +#: gtk/gtktreeview.c:741 msgid "" "Whether to enable selection of multiple items by dragging the mouse pointer" msgstr "" "Indica si se tien d'activar la Escoyeta de múltiples elementos arrastrando'l " "punteru del mur" -#: gtk/gtktreeview.c:746 +#: gtk/gtktreeview.c:748 msgid "Enable Grid Lines" msgstr "Activar llinies de la rexella" -#: gtk/gtktreeview.c:747 +#: gtk/gtktreeview.c:749 msgid "Whether grid lines should be drawn in the tree view" msgstr "Indica si tien d'haber un iconu cerca del elementu" -#: gtk/gtktreeview.c:755 +#: gtk/gtktreeview.c:757 msgid "Enable Tree Lines" msgstr "Activar llinies del árbol" -#: gtk/gtktreeview.c:756 +#: gtk/gtktreeview.c:758 msgid "Whether tree lines should be drawn in the tree view" msgstr "Indica si hai de dibuxar les llinies na vista del árbol" -#: gtk/gtktreeview.c:764 +#: gtk/gtktreeview.c:766 msgid "The column in the model containing the tooltip texts for the rows" msgstr "La columna nel modelu que caltién los testos pista pa les fileres" -#: gtk/gtktreeview.c:786 +#: gtk/gtktreeview.c:788 msgid "Vertical Separator Width" msgstr "Anchu del separtador vertical" -#: gtk/gtktreeview.c:787 +#: gtk/gtktreeview.c:789 msgid "Vertical space between cells. Must be an even number" msgstr "Espaciu vertical ente caxelles. Tien de ser un númberu par" -#: gtk/gtktreeview.c:795 +#: gtk/gtktreeview.c:797 msgid "Horizontal Separator Width" msgstr "Anchu del separtador horizontal" -#: gtk/gtktreeview.c:796 +#: gtk/gtktreeview.c:798 msgid "Horizontal space between cells. Must be an even number" msgstr "Espaciu horizontal ente caxelles. Tien de ser un númberu par" -#: gtk/gtktreeview.c:804 +#: gtk/gtktreeview.c:806 msgid "Allow Rules" msgstr "Permitir regles" -#: gtk/gtktreeview.c:805 +#: gtk/gtktreeview.c:807 msgid "Allow drawing of alternating color rows" msgstr "Permitir el dibuxáu de fileres con colores alternativos" -#: gtk/gtktreeview.c:811 +#: gtk/gtktreeview.c:813 msgid "Indent Expanders" msgstr "Sangrar estensores" -#: gtk/gtktreeview.c:812 +#: gtk/gtktreeview.c:814 msgid "Make the expanders indented" msgstr "Cria los estensores sangraos" -#: gtk/gtktreeview.c:818 +#: gtk/gtktreeview.c:820 msgid "Even Row Color" msgstr "Color de la filera par" -#: gtk/gtktreeview.c:819 +#: gtk/gtktreeview.c:821 msgid "Color to use for even rows" msgstr "Color a usar pa les fileres pares" -#: gtk/gtktreeview.c:825 +#: gtk/gtktreeview.c:827 msgid "Odd Row Color" msgstr "Color de la filera impar" -#: gtk/gtktreeview.c:826 +#: gtk/gtktreeview.c:828 msgid "Color to use for odd rows" msgstr "Color a usar pa les fileres impares" -#: gtk/gtktreeview.c:832 +#: gtk/gtktreeview.c:834 msgid "Row Ending details" msgstr "Detalles de terminación de filera" -#: gtk/gtktreeview.c:833 +#: gtk/gtktreeview.c:835 msgid "Enable extended row background theming" msgstr "Activar tema del fondu de estendíu de filera" -#: gtk/gtktreeview.c:839 +#: gtk/gtktreeview.c:841 msgid "Grid line width" msgstr "Anchu de la llinia de la rexella" -#: gtk/gtktreeview.c:840 +#: gtk/gtktreeview.c:842 msgid "Width, in pixels, of the tree view grid lines" msgstr "Anchu, en píxeles, de la llinia indicadora del focu" -#: gtk/gtktreeview.c:846 +#: gtk/gtktreeview.c:848 msgid "Tree line width" msgstr "Anchu de la llinia del árbol" -#: gtk/gtktreeview.c:847 +#: gtk/gtktreeview.c:849 msgid "Width, in pixels, of the tree view lines" msgstr "Anchu, en píxeles, de la llinia indicadora del focu" -#: gtk/gtktreeview.c:853 +#: gtk/gtktreeview.c:855 msgid "Grid line pattern" msgstr "Patrón de la llinia de la rexella" -#: gtk/gtktreeview.c:854 +#: gtk/gtktreeview.c:856 msgid "Dash pattern used to draw the tree view grid lines" msgstr "" "Patrón de guiones usáu pa dibuxar les llinies de rexella de la vista de árbol" -#: gtk/gtktreeview.c:860 +#: gtk/gtktreeview.c:862 msgid "Tree line pattern" msgstr "Patrón de la llinia del árbol" -#: gtk/gtktreeview.c:861 +#: gtk/gtktreeview.c:863 msgid "Dash pattern used to draw the tree view lines" msgstr "Patrón de guiones usáu pa dibuxar les llinies de la vista d'árbol" @@ -6894,7 +6696,7 @@ msgstr "Patrón de guiones usáu pa dibuxar les llinies de la vista d'árbol" msgid "Whether to display the column" msgstr "Indica si se tien d'amosar la columna" -#: gtk/gtktreeviewcolumn.c:200 gtk/gtkwindow.c:542 +#: gtk/gtktreeviewcolumn.c:200 gtk/gtkwindow.c:566 msgid "Resizable" msgstr "Redimensionable" @@ -7014,7 +6816,7 @@ msgstr "Definición del IU combináu" msgid "An XML string describing the merged UI" msgstr "Una cadena XML describiendo'l IU combináu" -#: gtk/gtkviewport.c:107 +#: gtk/gtkviewport.c:135 msgid "" "The GtkAdjustment that determines the values of the horizontal position for " "this viewport" @@ -7022,7 +6824,7 @@ msgstr "" "El GtkAdjustment que determina los valores de la posición horizontal pa esti " "puertu de visión" -#: gtk/gtkviewport.c:115 +#: gtk/gtkviewport.c:143 msgid "" "The GtkAdjustment that determines the values of the vertical position for " "this viewport" @@ -7030,32 +6832,32 @@ msgstr "" "El GtkAdjustment que determina los valores de la posición vertical d'esti " "puertu de visión" -#: gtk/gtkviewport.c:123 +#: gtk/gtkviewport.c:151 msgid "Determines how the shadowed box around the viewport is drawn" msgstr "" "Determina como se dibuxa'l marcu sombreáu al rodiu del puertu de visión" -#: gtk/gtkwidget.c:553 +#: gtk/gtkwidget.c:573 msgid "Widget name" msgstr "Nome del widget" -#: gtk/gtkwidget.c:554 +#: gtk/gtkwidget.c:574 msgid "The name of the widget" msgstr "El nome del widget" -#: gtk/gtkwidget.c:560 +#: gtk/gtkwidget.c:580 msgid "Parent widget" msgstr "Widget padre" -#: gtk/gtkwidget.c:561 +#: gtk/gtkwidget.c:581 msgid "The parent widget of this widget. Must be a Container widget" msgstr "El widget padre d'esti widget. Tien de ser un widget contenedor" -#: gtk/gtkwidget.c:568 +#: gtk/gtkwidget.c:588 msgid "Width request" msgstr "Petición d'anchor" -#: gtk/gtkwidget.c:569 +#: gtk/gtkwidget.c:589 msgid "" "Override for width request of the widget, or -1 if natural request should be " "used" @@ -7063,11 +6865,11 @@ msgstr "" "Sobroscribir l'anchor solicitáu del widget, o -1 si tien d'usase la solicitú " "natural" -#: gtk/gtkwidget.c:577 +#: gtk/gtkwidget.c:597 msgid "Height request" msgstr "Petición d'altor" -#: gtk/gtkwidget.c:578 +#: gtk/gtkwidget.c:598 msgid "" "Override for height request of the widget, or -1 if natural request should " "be used" @@ -7075,84 +6877,84 @@ msgstr "" "Sobroscribir l'altor solicitáu del widget, o -1 si tien d'usase la solicitud " "natural" -#: gtk/gtkwidget.c:587 +#: gtk/gtkwidget.c:607 msgid "Whether the widget is visible" msgstr "Indica si'l widget ye visible" -#: gtk/gtkwidget.c:594 +#: gtk/gtkwidget.c:614 msgid "Whether the widget responds to input" msgstr "Indica si'l widget respuende al ingresu" -#: gtk/gtkwidget.c:600 +#: gtk/gtkwidget.c:620 msgid "Application paintable" msgstr "Pintable pola aplicación" -#: gtk/gtkwidget.c:601 +#: gtk/gtkwidget.c:621 msgid "Whether the application will paint directly on the widget" msgstr "Indica si l'aplicación pintará direutamente sobro'l widget" -#: gtk/gtkwidget.c:607 +#: gtk/gtkwidget.c:627 msgid "Can focus" msgstr "Puede enfocar" -#: gtk/gtkwidget.c:608 +#: gtk/gtkwidget.c:628 msgid "Whether the widget can accept the input focus" msgstr "Indica si'l widget puede aceutar el focu d'entrada" -#: gtk/gtkwidget.c:614 +#: gtk/gtkwidget.c:634 msgid "Has focus" msgstr "Tien focu" -#: gtk/gtkwidget.c:615 +#: gtk/gtkwidget.c:635 msgid "Whether the widget has the input focus" msgstr "Indica si'l widget tien el focu d'entrada" -#: gtk/gtkwidget.c:621 +#: gtk/gtkwidget.c:641 msgid "Is focus" msgstr "Tien el focu" -#: gtk/gtkwidget.c:622 +#: gtk/gtkwidget.c:642 msgid "Whether the widget is the focus widget within the toplevel" msgstr "Indica si'l widget ye'l widget con focu dientro del nivel superior" -#: gtk/gtkwidget.c:628 +#: gtk/gtkwidget.c:648 msgid "Can default" msgstr "Puede por omisión" -#: gtk/gtkwidget.c:629 +#: gtk/gtkwidget.c:649 msgid "Whether the widget can be the default widget" msgstr "Indica si'l widget puede ser el widget predetermináu" -#: gtk/gtkwidget.c:635 +#: gtk/gtkwidget.c:655 msgid "Has default" msgstr "Tien por omisión" -#: gtk/gtkwidget.c:636 +#: gtk/gtkwidget.c:656 msgid "Whether the widget is the default widget" msgstr "Indica si'l widget ye'l widget predetermináu" -#: gtk/gtkwidget.c:642 +#: gtk/gtkwidget.c:662 msgid "Receives default" msgstr "Recibe por omisión" -#: gtk/gtkwidget.c:643 +#: gtk/gtkwidget.c:663 msgid "If TRUE, the widget will receive the default action when it is focused" msgstr "" "Si ye TRUE el widget recibirá l'aición predeterminada cuando obtién el focu" -#: gtk/gtkwidget.c:649 +#: gtk/gtkwidget.c:669 msgid "Composite child" msgstr "Fíu compuestu" -#: gtk/gtkwidget.c:650 +#: gtk/gtkwidget.c:670 msgid "Whether the widget is part of a composite widget" msgstr "Indica si'l widget ye parte d'un widget compuestu" -#: gtk/gtkwidget.c:656 +#: gtk/gtkwidget.c:676 msgid "Style" msgstr "Estilu" -#: gtk/gtkwidget.c:657 +#: gtk/gtkwidget.c:677 msgid "" "The style of the widget, which contains information about how it will look " "(colors etc)" @@ -7160,97 +6962,97 @@ msgstr "" "L'estilu del widget, que caltién información sobro l'apariencia (colores, " "etc)" -#: gtk/gtkwidget.c:663 +#: gtk/gtkwidget.c:683 msgid "Events" msgstr "Eventos" -#: gtk/gtkwidget.c:664 +#: gtk/gtkwidget.c:684 msgid "The event mask that decides what kind of GdkEvents this widget gets" msgstr "" "La mázcara d'eventos que decide qué triba de GtkEvents recibe esti widget" -#: gtk/gtkwidget.c:671 +#: gtk/gtkwidget.c:691 msgid "Extension events" msgstr "Eventos de estensión" -#: gtk/gtkwidget.c:672 +#: gtk/gtkwidget.c:692 msgid "The mask that decides what kind of extension events this widget gets" msgstr "" "La mázcara que decide qué clase d'eventos d'estensión conseguirá esti widget" -#: gtk/gtkwidget.c:679 +#: gtk/gtkwidget.c:699 msgid "No show all" msgstr "Nun amosar too" -#: gtk/gtkwidget.c:680 +#: gtk/gtkwidget.c:700 msgid "Whether gtk_widget_show_all() should not affect this widget" msgstr "Indica que gtk_widget_show_all() nun tien d'afeutar a esti widget" -#: gtk/gtkwidget.c:703 +#: gtk/gtkwidget.c:723 msgid "Whether this widget has a tooltip" msgstr "Indica si'l widget tien un conseyu" -#: gtk/gtkwidget.c:759 +#: gtk/gtkwidget.c:779 msgid "Window" msgstr "Ventana" -#: gtk/gtkwidget.c:760 +#: gtk/gtkwidget.c:780 msgid "The widget's window if it is realized" msgstr "La ventana del widget si se fai" -#: gtk/gtkwidget.c:774 +#: gtk/gtkwidget.c:794 msgid "Double Buffered" msgstr "Double Buffered" -#: gtk/gtkwidget.c:775 +#: gtk/gtkwidget.c:795 msgid "Whether or not the widget is double buffered" msgstr "Indica si'l widget tien búfer duble" -#: gtk/gtkwidget.c:2403 +#: gtk/gtkwidget.c:2427 msgid "Interior Focus" msgstr "Focu interior" -#: gtk/gtkwidget.c:2404 +#: gtk/gtkwidget.c:2428 msgid "Whether to draw the focus indicator inside widgets" msgstr "Indica si dibuxar el focu indicador dientro de los widgets" -#: gtk/gtkwidget.c:2410 +#: gtk/gtkwidget.c:2434 msgid "Focus linewidth" msgstr "Dar focu al anchor de llinia" -#: gtk/gtkwidget.c:2411 +#: gtk/gtkwidget.c:2435 msgid "Width, in pixels, of the focus indicator line" msgstr "Anchor, en píxeles, de la llinia indicadora del focu" -#: gtk/gtkwidget.c:2417 +#: gtk/gtkwidget.c:2441 msgid "Focus line dash pattern" msgstr "Dar focu a la llinia con patrón punteáu" -#: gtk/gtkwidget.c:2418 +#: gtk/gtkwidget.c:2442 msgid "Dash pattern used to draw the focus indicator" msgstr "Patrón punteáu usáu pa dibuxar l'indicador de focu" -#: gtk/gtkwidget.c:2423 +#: gtk/gtkwidget.c:2447 msgid "Focus padding" msgstr "Rellenu del focu" -#: gtk/gtkwidget.c:2424 +#: gtk/gtkwidget.c:2448 msgid "Width, in pixels, between focus indicator and the widget 'box'" msgstr "Anchor, en píxeles, ente l'indicador de focu y la «caxa» del widget" -#: gtk/gtkwidget.c:2429 +#: gtk/gtkwidget.c:2453 msgid "Cursor color" msgstr "Color del cursor" -#: gtk/gtkwidget.c:2430 +#: gtk/gtkwidget.c:2454 msgid "Color with which to draw insertion cursor" msgstr "Color col que dibuxar el cursor d'inxerción" -#: gtk/gtkwidget.c:2435 +#: gtk/gtkwidget.c:2459 msgid "Secondary cursor color" msgstr "Color secundariu del cursor" -#: gtk/gtkwidget.c:2436 +#: gtk/gtkwidget.c:2460 msgid "" "Color with which to draw the secondary insertion cursor when editing mixed " "right-to-left and left-to-right text" @@ -7258,43 +7060,43 @@ msgstr "" "Color col que dibuxar el cursor d'inxerción secundariu cuando se ta editando " "un mezu de testu de drecha-a-esquierda y esquierda-a-drecha" -#: gtk/gtkwidget.c:2441 +#: gtk/gtkwidget.c:2465 msgid "Cursor line aspect ratio" msgstr "Proporción de la llinia del cursor" -#: gtk/gtkwidget.c:2442 +#: gtk/gtkwidget.c:2466 msgid "Aspect ratio with which to draw insertion cursor" msgstr "La proporción cola que dibuxar el cursor d'inxerción" -#: gtk/gtkwidget.c:2456 +#: gtk/gtkwidget.c:2480 msgid "Draw Border" msgstr "Dibuxar berbesu" -#: gtk/gtkwidget.c:2457 +#: gtk/gtkwidget.c:2481 msgid "Size of areas outside the widget's allocation to draw" msgstr "Tamañu de les estayes fuera de la reserva del widget pa dibuxar" -#: gtk/gtkwidget.c:2470 +#: gtk/gtkwidget.c:2494 msgid "Unvisited Link Color" msgstr "Color del enllaz non visitáu" -#: gtk/gtkwidget.c:2471 +#: gtk/gtkwidget.c:2495 msgid "Color of unvisited links" msgstr "Color de los enllaces non visitaos" -#: gtk/gtkwidget.c:2484 +#: gtk/gtkwidget.c:2508 msgid "Visited Link Color" msgstr "Color del enllaz visitáu" -#: gtk/gtkwidget.c:2485 +#: gtk/gtkwidget.c:2509 msgid "Color of visited links" msgstr "Color de los enllaces visitaos" -#: gtk/gtkwidget.c:2499 +#: gtk/gtkwidget.c:2523 msgid "Wide Separators" msgstr "Separtadores anchos" -#: gtk/gtkwidget.c:2500 +#: gtk/gtkwidget.c:2524 msgid "" "Whether separators have configurable width and should be drawn using a box " "instead of a line" @@ -7302,76 +7104,76 @@ msgstr "" "Indica si los separtadores tienen anchu configurable y tienen de dibuxase " "usando una caxa n'arróu d'una llinia" -#: gtk/gtkwidget.c:2514 +#: gtk/gtkwidget.c:2538 msgid "Separator Width" msgstr "Anchu del separtador" -#: gtk/gtkwidget.c:2515 +#: gtk/gtkwidget.c:2539 msgid "The width of separators if wide-separators is TRUE" msgstr "L'anchor de los separtadores si «wide-separators« ye TRUE" -#: gtk/gtkwidget.c:2529 +#: gtk/gtkwidget.c:2553 msgid "Separator Height" msgstr "Altor del separtador" -#: gtk/gtkwidget.c:2530 +#: gtk/gtkwidget.c:2554 msgid "The height of separators if \"wide-separators\" is TRUE" msgstr "L'altor de los separtadores si «wide-separators» ye TRUE" -#: gtk/gtkwidget.c:2544 +#: gtk/gtkwidget.c:2568 msgid "Horizontal Scroll Arrow Length" msgstr "Llonxitú de la flecha de desplazamientu horizontal" -#: gtk/gtkwidget.c:2545 +#: gtk/gtkwidget.c:2569 msgid "The length of horizontal scroll arrows" msgstr "El llargor de les fleches de desplazamientu horizontal" -#: gtk/gtkwidget.c:2559 +#: gtk/gtkwidget.c:2583 msgid "Vertical Scroll Arrow Length" msgstr "Llonxitú de les fleches de desplazamientu vertical" -#: gtk/gtkwidget.c:2560 +#: gtk/gtkwidget.c:2584 msgid "The length of vertical scroll arrows" msgstr "El llargor de les fleches de desplazamientu vertical" -#: gtk/gtkwindow.c:483 +#: gtk/gtkwindow.c:507 msgid "Window Type" msgstr "Triba de ventana" -#: gtk/gtkwindow.c:484 +#: gtk/gtkwindow.c:508 msgid "The type of the window" msgstr "La triba de la ventana" -#: gtk/gtkwindow.c:492 +#: gtk/gtkwindow.c:516 msgid "Window Title" msgstr "Títulu de la ventana" -#: gtk/gtkwindow.c:493 +#: gtk/gtkwindow.c:517 msgid "The title of the window" msgstr "El títulu de la ventana" -#: gtk/gtkwindow.c:500 +#: gtk/gtkwindow.c:524 msgid "Window Role" msgstr "Rol de la ventana" -#: gtk/gtkwindow.c:501 +#: gtk/gtkwindow.c:525 msgid "Unique identifier for the window to be used when restoring a session" msgstr "Identificador únicu pa la ventana a ser usáu al restaurar la sesión" -#: gtk/gtkwindow.c:517 +#: gtk/gtkwindow.c:541 msgid "Startup ID" msgstr "ID d'aniciu" -#: gtk/gtkwindow.c:518 +#: gtk/gtkwindow.c:542 msgid "Unique startup identifier for the window used by startup-notification" msgstr "" "Identificador únicu d'aniciu pa la ventana usáu por startup-notification" -#: gtk/gtkwindow.c:525 +#: gtk/gtkwindow.c:549 msgid "Allow Shrink" msgstr "Permitir encoyer" -#: gtk/gtkwindow.c:527 +#: gtk/gtkwindow.c:551 #, no-c-format msgid "" "If TRUE, the window has no mimimum size. Setting this to TRUE is 99% of the " @@ -7380,25 +7182,25 @@ msgstr "" "Si ye TRUE la ventana nun tien tamañu mínimu. Allugar esti valor como TRUE " "ye una mala idega el 99% de les vegaes" -#: gtk/gtkwindow.c:534 +#: gtk/gtkwindow.c:558 msgid "Allow Grow" msgstr "Permitir crecimientu" -#: gtk/gtkwindow.c:535 +#: gtk/gtkwindow.c:559 msgid "If TRUE, users can expand the window beyond its minimum size" msgstr "" "Si ye TRUE los usuarios pueden espander la ventana mas allá del so tamañu " "mínimu" -#: gtk/gtkwindow.c:543 +#: gtk/gtkwindow.c:567 msgid "If TRUE, users can resize the window" msgstr "Si ye TRUE los usuariu pueden redimensionar la ventana" -#: gtk/gtkwindow.c:550 +#: gtk/gtkwindow.c:574 msgid "Modal" msgstr "Modal" -#: gtk/gtkwindow.c:551 +#: gtk/gtkwindow.c:575 msgid "" "If TRUE, the window is modal (other windows are not usable while this one is " "up)" @@ -7406,80 +7208,80 @@ msgstr "" "Si ye TRUE, esta ventana ye modal (nun pueden usase otres ventanes mientres " "ésta tea enriba)" -#: gtk/gtkwindow.c:558 +#: gtk/gtkwindow.c:582 msgid "Window Position" msgstr "Posición de la ventana" -#: gtk/gtkwindow.c:559 +#: gtk/gtkwindow.c:583 msgid "The initial position of the window" msgstr "La posición inicial de la ventana" -#: gtk/gtkwindow.c:567 +#: gtk/gtkwindow.c:591 msgid "Default Width" msgstr "Anchu predetermináu" -#: gtk/gtkwindow.c:568 +#: gtk/gtkwindow.c:592 msgid "The default width of the window, used when initially showing the window" msgstr "" "L'anchor predetermináu de la ventana, usáu cuando s'amuesa inicialmente la " "ventana" -#: gtk/gtkwindow.c:577 +#: gtk/gtkwindow.c:601 msgid "Default Height" msgstr "Altor predetermináu" -#: gtk/gtkwindow.c:578 +#: gtk/gtkwindow.c:602 msgid "" "The default height of the window, used when initially showing the window" msgstr "" "L'altor predetermináu de la ventana, usáu cuando s'amuesa inicialmente la " "ventana" -#: gtk/gtkwindow.c:587 +#: gtk/gtkwindow.c:611 msgid "Destroy with Parent" msgstr "Destruyir col padre" -#: gtk/gtkwindow.c:588 +#: gtk/gtkwindow.c:612 msgid "If this window should be destroyed when the parent is destroyed" msgstr "Si esta ventana tendría d'afarase cuando'l s'afara el padre" -#: gtk/gtkwindow.c:596 +#: gtk/gtkwindow.c:620 msgid "Icon for this window" msgstr "Iconu pa esta ventana" -#: gtk/gtkwindow.c:602 +#: gtk/gtkwindow.c:626 msgid "Mnemonics Visible" msgstr "Mnemonics Visibles" -#: gtk/gtkwindow.c:603 +#: gtk/gtkwindow.c:627 msgid "Whether mnemonics are currently visible in this window" msgstr "Indica si los mnemónicos son visibles actualmente nesta ventana" -#: gtk/gtkwindow.c:619 +#: gtk/gtkwindow.c:643 msgid "Name of the themed icon for this window" msgstr "Nome del iconu del tema pa esta ventana" -#: gtk/gtkwindow.c:634 +#: gtk/gtkwindow.c:658 msgid "Is Active" msgstr "Ta activu" -#: gtk/gtkwindow.c:635 +#: gtk/gtkwindow.c:659 msgid "Whether the toplevel is the current active window" msgstr "Indica si'l nivel superior ye la ventana activa actual" -#: gtk/gtkwindow.c:642 +#: gtk/gtkwindow.c:666 msgid "Focus in Toplevel" msgstr "Focu nel nivel superior" -#: gtk/gtkwindow.c:643 +#: gtk/gtkwindow.c:667 msgid "Whether the input focus is within this GtkWindow" msgstr "Indica si'l focu d'entrada ta dientro d'esti GtkWindow" -#: gtk/gtkwindow.c:650 +#: gtk/gtkwindow.c:674 msgid "Type hint" msgstr "Conseyu de triba" -#: gtk/gtkwindow.c:651 +#: gtk/gtkwindow.c:675 msgid "" "Hint to help the desktop environment understand what kind of window this is " "and how to treat it." @@ -7487,83 +7289,83 @@ msgstr "" "Conseyu p'aidar al ambiente d'escritoriu a atalantar qué triba de ventana ye " "ésta y cómo tratar colla." -#: gtk/gtkwindow.c:659 +#: gtk/gtkwindow.c:683 msgid "Skip taskbar" msgstr "Inorar barra de xeres" -#: gtk/gtkwindow.c:660 +#: gtk/gtkwindow.c:684 msgid "TRUE if the window should not be in the task bar." msgstr "TRUE si la ventana nun tendría de tar na barra de xeres." -#: gtk/gtkwindow.c:667 +#: gtk/gtkwindow.c:691 msgid "Skip pager" msgstr "Inorar paxinador" -#: gtk/gtkwindow.c:668 +#: gtk/gtkwindow.c:692 msgid "TRUE if the window should not be in the pager." msgstr "TRUE si la ventana nun tien de tar nel paxinador" -#: gtk/gtkwindow.c:675 +#: gtk/gtkwindow.c:699 msgid "Urgent" msgstr "Urxente" -#: gtk/gtkwindow.c:676 +#: gtk/gtkwindow.c:700 msgid "TRUE if the window should be brought to the user's attention." msgstr "TRUE si la ventana tien de llamar l'atención del usuariu." -#: gtk/gtkwindow.c:690 +#: gtk/gtkwindow.c:714 msgid "Accept focus" msgstr "Aceutar focu" -#: gtk/gtkwindow.c:691 +#: gtk/gtkwindow.c:715 msgid "TRUE if the window should receive the input focus." msgstr "TRUE si la ventana tendría de recibir el focu d'entrada." -#: gtk/gtkwindow.c:705 +#: gtk/gtkwindow.c:729 msgid "Focus on map" msgstr "Focu nel mapa" -#: gtk/gtkwindow.c:706 +#: gtk/gtkwindow.c:730 msgid "TRUE if the window should receive the input focus when mapped." msgstr "TRUE si la ventana tendría recibir el focu d'entrada al mapease." -#: gtk/gtkwindow.c:720 +#: gtk/gtkwindow.c:744 msgid "Decorated" msgstr "Decoráu" -#: gtk/gtkwindow.c:721 +#: gtk/gtkwindow.c:745 msgid "Whether the window should be decorated by the window manager" msgstr "Indica si la ventana tendría de decorase pol xestor de ventanes" -#: gtk/gtkwindow.c:735 +#: gtk/gtkwindow.c:759 msgid "Deletable" msgstr "Desaniciable" -#: gtk/gtkwindow.c:736 +#: gtk/gtkwindow.c:760 msgid "Whether the window frame should have a close button" msgstr "Indica si'l marcu de la ventana tien de tener un botón de zarru" -#: gtk/gtkwindow.c:752 +#: gtk/gtkwindow.c:776 msgid "Gravity" msgstr "Gravedá" -#: gtk/gtkwindow.c:753 +#: gtk/gtkwindow.c:777 msgid "The window gravity of the window" msgstr "La triba de gravedá de la ventana" -#: gtk/gtkwindow.c:770 +#: gtk/gtkwindow.c:794 msgid "Transient for Window" msgstr "Transitoriu pa la ventana" -#: gtk/gtkwindow.c:771 +#: gtk/gtkwindow.c:795 msgid "The transient parent of the dialog" msgstr "El padre transitoriu del diálogu" -#: gtk/gtkwindow.c:786 +#: gtk/gtkwindow.c:810 msgid "Opacity for Window" msgstr "Opacidá pa la ventana" -#: gtk/gtkwindow.c:787 +#: gtk/gtkwindow.c:811 msgid "The opacity of the window, from 0 to 1" msgstr "La opacidá de la ventana, dende 0 fasta 1" @@ -7582,3 +7384,195 @@ msgstr "Estilu del estáu IM" #: modules/input/gtkimcontextxim.c:344 msgid "How to draw the input method statusbar" msgstr "Cómo dibuxar el métodu d'entrada de la barra d'estáu" + +#~ msgid "Enable arrow keys" +#~ msgstr "Activar tecles de flecha" + +#~ msgid "Whether the arrow keys move through the list of items" +#~ msgstr "" +#~ "Indica si les tecles de flecha se mueven a traviés de la llista " +#~ "d'elementos" + +#~ msgid "Always enable arrows" +#~ msgstr "Siempre activar fleches" + +#~ msgid "Obsolete property, ignored" +#~ msgstr "Propiedá obsoleta, inorada" + +#~ msgid "Case sensitive" +#~ msgstr "Sensible al caso" + +#~ msgid "Whether list item matching is case sensitive" +#~ msgstr "" +#~ "Indica si la llista d'elementos coincidentes ye sensible a la " +#~ "capitalización" + +#~ msgid "Allow empty" +#~ msgstr "Permitir baleru" + +#~ msgid "Whether an empty value may be entered in this field" +#~ msgstr "Indica si se puede introducir nesti campu en valor baleru." + +#~ msgid "Value in list" +#~ msgstr "Valor na llista" + +#~ msgid "Whether entered values must already be present in the list" +#~ msgstr "" +#~ "Indica si los valores introducidos tienen de tar yá presentes na llista" + +#~ msgid "Curve type" +#~ msgstr "Triba de curva" + +#~ msgid "Is this curve linear, spline interpolated, or free-form" +#~ msgstr "" +#~ "Indica si esta curva ye llinial, interpolada de splines, o forma llibre" + +#~ msgid "Minimum X" +#~ msgstr "X mínimu" + +#~ msgid "Minimum possible value for X" +#~ msgstr "Valor mínimu dable pa X" + +#~ msgid "Maximum X" +#~ msgstr "X máximu" + +#~ msgid "Maximum possible X value" +#~ msgstr "Máximu valor dable pa X" + +#~ msgid "Minimum Y" +#~ msgstr "Y mínimu" + +#~ msgid "Minimum possible value for Y" +#~ msgstr "Valor mínimu dable pa Y" + +#~ msgid "Maximum Y" +#~ msgstr "Y máximu" + +#~ msgid "Maximum possible value for Y" +#~ msgstr "Máximu valor dable pa Y" + +#~ msgid "File System Backend" +#~ msgstr "Backend del sistema de ficheros" + +#~ msgid "Name of file system backend to use" +#~ msgstr "Nome del backend del sistema de ficheros a usar" + +#~ msgid "The currently selected filename" +#~ msgstr "El nome del ficheru anguaño esbilláu" + +#~ msgid "Show file operations" +#~ msgstr "Amosar operaciones de ficheru" + +#~ msgid "Whether buttons for creating/manipulating files should be displayed" +#~ msgstr "" +#~ "Indica si los botones de creación/manipulación de ficheros tienen " +#~ "d'amosase" + +#~ msgid "Tab Border" +#~ msgstr "Berbesu de la llingüeta" + +#~ msgid "Width of the border around the tab labels" +#~ msgstr "Anchor del berbesu al rodiu de les etiquetes de la llingüeta" + +#~ msgid "Horizontal Tab Border" +#~ msgstr "Berbesu de la llingüeta horizontal" + +#~ msgid "Width of the horizontal border of tab labels" +#~ msgstr "Anchor del berbesu horizontal de les etiquetes de les llingüeta" + +#~ msgid "Vertical Tab Border" +#~ msgstr "Berbesu de la llingüeta vertical" + +#~ msgid "Width of the vertical border of tab labels" +#~ msgstr "Anchor del berbesu vertical de les etiquetes de les llingüetes" + +#~ msgid "Whether tabs should have homogeneous sizes" +#~ msgstr "Indica si les llingüetes tienen de tener tamaños homoxéneos" + +#~ msgid "Group ID" +#~ msgstr "ID de grupu" + +#~ msgid "Group ID for tabs drag and drop" +#~ msgstr "ID de grupu p'arrastre y suelte de les llingüetes" + +#~ msgid "User Data" +#~ msgstr "Datos del usuariu" + +#~ msgid "Anonymous User Data Pointer" +#~ msgstr "Puntero de datos de l'usuariu anónimu" + +#~ msgid "The menu of options" +#~ msgstr "El menú d'opciones" + +#~ msgid "Size of dropdown indicator" +#~ msgstr "Tamañu del indicador descolingable" + +#~ msgid "Spacing around indicator" +#~ msgstr "Espaciáu al rodiu del indicador" + +#~ msgid "" +#~ "Whether the preview widget should take up the entire space it is allocated" +#~ msgstr "" +#~ "Indica si'l widget de vista previa tien de tomar l'espaciu enteru au " +#~ "s'alcuentra asignáu" + +#~ msgid "The GtkAdjustment connected to the progress bar (Deprecated)" +#~ msgstr "El GtkAdjustment coneutáu a la barra de progresu (obsoletu)" + +#~ msgid "Bar style" +#~ msgstr "Estilu de la barra" + +#~ msgid "" +#~ "Specifies the visual style of the bar in percentage mode (Deprecated)" +#~ msgstr "Indica l'estilu visual de la barra nel mou porcentaxe (obsoletu)" + +#~ msgid "Activity Step" +#~ msgstr "Avance d'actividá" + +#~ msgid "The increment used for each iteration in activity mode (Deprecated)" +#~ msgstr "L'incrementu usáu pa cada iteración nel mou actividá (obsoletu)" + +#~ msgid "Activity Blocks" +#~ msgstr "Bloques d'actividá" + +#~ msgid "" +#~ "The number of blocks which can fit in the progress bar area in activity " +#~ "mode (Deprecated)" +#~ msgstr "" +#~ "La cantidá de bloques que pueden caber na estaya de la barra de progresu " +#~ "nel mou actividá (obsoletu)" + +#~ msgid "Discrete Blocks" +#~ msgstr "Bloques discretos" + +#~ msgid "" +#~ "The number of discrete blocks in a progress bar (when shown in the " +#~ "discrete style)" +#~ msgstr "" +#~ "El númberu de bloques discretos na barra de progresu (cuando s'amuese nel " +#~ "estilu discretu)" + +#~ msgid "Horizontal adjustment for the text widget" +#~ msgstr "Axuste horizontal pal widget de testu" + +#~ msgid "Vertical adjustment for the text widget" +#~ msgstr "Axuste vertical pal widget de testu" + +#~ msgid "Line Wrap" +#~ msgstr "Axuste de llinia" + +#~ msgid "Whether lines are wrapped at widget edges" +#~ msgstr "Indica si les llinies s'axusten a los berbesos del widget" + +#~ msgid "Word Wrap" +#~ msgstr "Axuste de pallabra" + +#~ msgid "Whether words are wrapped at widget edges" +#~ msgstr "Indica si les pallabras axústense a los berbesos del widget" + +#~ msgid "Tooltips" +#~ msgstr "Conseyos" + +#~ msgid "If the tooltips of the toolbar should be active or not" +#~ msgstr "" +#~ "Si los conseyos de la barra de ferramientes tienen de tar activaos o non" diff --git a/po-properties/az.po b/po-properties/az.po index 46678679b6..59a8da5c68 100644 --- a/po-properties/az.po +++ b/po-properties/az.po @@ -32,7 +32,7 @@ msgid "" msgstr "" "Project-Id-Version: gtk+-properties.HEAD\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-03-22 23:35-0400\n" +"POT-Creation-Date: 2010-05-25 20:10-0400\n" "PO-Revision-Date: 2004-03-07 18:05+0200\n" "Last-Translator: Mətin Əmirov \n" "Language-Team: Azerbaijani Turkish