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 --build-list 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 --build-list 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 libdir gtk-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 GdkScreen s
+
+
+
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 (XEvent s for the X11
-backend, MSG s 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
+
+
- --disable-modules and
- --enable-modules
+ --disable-modules and
+ --enable-modules
-
- 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.
+
- --with-included-loaders
+ --with-included-loaders
-
+
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.
-
+
- --with-included-immodules
+ --with-included-immodules
-
+
This option allows you to specify which input method modules you
- want to include.
-
+ want to include.
+
--enable-debug
-
+
- 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
- --enable-debug=no 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
+ --enable-debug=no 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
--enable-explicit-deps and
--disable-explicit-deps
- 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.
--disable-shm and
--enable-shm
-
+
- 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
--disable-xim and
--enable-xim
-
+
- 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.
--disable-xim-inst and
--enable-xim-inst
-
+
- 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.
--disable-xkb and
--enable-xkb
-
+
- 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.
--disable-xinerama and
--enable-xinerama
-
+
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
- --disable-gtk-doc and
- --enable-gtk-doc
+ --disable-gtk-doc and
+ --enable-gtk-doc
-
- 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.
+
- --disable-cups and
- --enable-cups
+ --disable-cups and
+ --enable-cups
-
+
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
+
+ --disable-papi and
+ --enable-papi
+
+
+ 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.
+
+
+
--with-xinput
- 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.
- --with-gdktarget
+ --with-gdktarget
-
- 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.
-
+
--disable-introspection
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
- -DGTK_DISABLE_COMPAT_H to disable
- the compatibility aliases.
-
- Here is the list of the old names and replacements:
-
-
-
-
-Old Replacement
-
-
-gtk_accel_label_accelerator_width gtk_accel_label_get_accel_width
-gtk_check_menu_item_set_state gtk_check_menu_item_set_active
-gtk_container_border_width gtk_container_set_border_width
-gtk_label_set gtk_label_set_text
-gtk_notebook_current_page gtk_notebook_get_current_page
-gtk_packer_configure gtk_packer_set_child_packing
-gtk_paned_gutter_size gtk_paned_set_gutter_size
-gtk_paned_handle_size gtk_paned_set_handle_size
-gtk_scale_value_width gtk_scale_get_value_width
-gtk_style_apply_default_pixmap gtk_style_apply_default_background
-gtk_toggle_button_set_state gtk_toggle_button_set_active
-gtk_window_position gtk_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:
-
-
-
-
-Removed Replacement
-
-
-gtk_clist_set_border gtk_clist_set_shadow_type
-gtk_container_block_resize gtk_container_set_resize_mode
-gtk_container_unblock_resize gtk_container_set_resize_mode
-gtk_container_need_resize gtk_container_check_resize
-gtk_ctree_show_stub gtk_ctree_set_show_stub
-gtk_ctree_set_reorderable gtk_clist_set_reorderable
-gtk_ctree_set_use_drag_icons gtk_clist_set_use_drag_icons
-gtk_entry_adjust_scroll -
-gtk_object_class_add_user_signal gtk_object_class_user_signal_new
-gtk_preview_put_row gtk_preview_put
-gtk_progress_bar_construct gtk_progress_set_adjustment
-gtk_scrolled_window_construct gtk_scrolled_window_set_{h|v}adjustment
-gtk_spin_button_construct gtk_spin_button_configure
-gtk_widget_thaw_accelerators gtk_widget_unlock_accelerators
-gtk_widget_freeze_accelerators gtk_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 --with-threads
- 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 Function Replacement
-
-
-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 GValue s. 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 function Defined As
-
-
-gdk_draw_pixmap gdk_draw_drawable
- gdk_draw_bitmap gdk_draw_drawable
-gdk_window_get_size gdk_drawable_get_size
-gdk_window_get_type gdk_window_get_window_type
-gdk_window_get_colormap gdk_drawable_get_colormap
-gdk_window_set_colormap gdk_drawable_set_colormap
-gdk_window_get_visual gdk_drawable_get_visual
-gdk_window_ref gdk_drawable_ref
-gdk_window_unref gdk_drawable_unref
-gdk_bitmap_ref gdk_drawable_ref
-gdk_bitmap_unref gdk_drawable_unref
-gdk_pixmap_ref gdk_drawable_ref
-gdk_pixmap_unref gdk_drawable_unref
-gdk_gc_destroy gdk_gc_unref
-gdk_image_destroy gdk_image_unref
-gdk_cursor_destroy gdk_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_cmap gdk_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 GtkWindow s, 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 function Replacement
-
-
-gtk_container_add_child_arg_type gtk_container_class_install_child_property
-gtk_container_query_child_args gtk_container_class_list_child_properties
-gtk_container_child_getv gtk_container_child_set_property
-gtk_container_child_setv gtk_container_child_get_property
-gtk_container_add_with_args gtk_container_add_with_properties
-gtk_container_addv gtk_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.)
-
-
-
-
-Variable Replacement
-
-
-gdk_null_window_warnings None - did nothing in GTK+ 1.2
-gdk_leader_window None - private variable
-gdk_screen gdk_x11_get_default_screen ()
-gdk_root_window gdk_x11_get_default_root_xwindow ()
-gdk_root_parent gdk_get_default_root_window ()
-gdk_error_code gdk_error_trap_push ()/pop ()
-gdk_error_warnings gdk_error_trap_push ()/pop ()
-gdk_display_name gdk_get_display ()
-gdk_wm_delete_window gdk_atom_intern ("WM_DELETE_WINDOW", FALSE)
-gdk_wm_take_focus gdk_atom_intern ("WM_TAKE_FOCUS", FALSE)
-gdk_wm_protocols gdk_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 libdir gtk-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
Shift F10
@@ -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:
+
-
-
- 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
- Shift F10
- 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
+ Shift F10
+ 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.
--gtk-module module
-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.
--gtk-debug options
-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
---enable-debug=yes .
+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 --enable-debug=yes .
@@ -68,9 +67,8 @@ This option is only available if GTK+ has been configured with
--gtk-no-debug options
-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
--enable-debug=yes .
@@ -84,7 +82,7 @@ list them here for completeness nevertheless.
--class class
-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.
--gdk-debug options
-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 --enable-debug=yes .
@@ -111,7 +109,7 @@ configured with --enable-debug=yes .
--gdk-no-debug options
-A list of debug options
+A list of debug options
to turn off. This option is only available if GTK+ has been configured with
--enable-debug=yes .
@@ -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 ).
GTK2_RC_FILES
-
+
Specifies a list of RC files to parse instead of the default ones;
see Resource Files.
@@ -283,7 +280,7 @@ additional environment variables.
GTK_EXE_PREFIX
- 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.
GDK_PIXBUF_MODULE_FILE
- 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
---prefix or --sysconfdir 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.
+--prefix or --sysconfdir 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.
-
---gxid-host host
-
-
-The host to contact the gxid daemon on; overrides
-the GXID_HOST environment variable.
-
-
-
-
---gxid-port port
-
-
-The port for the connection to gxid ; overrides
-the GXID_PORT environment variable.
-This option is only available if GTK+ has been configured with
---gdk-target=x11 .
-
-
-
-
-
-
-X11-specific environment variables
-
-
-The X backend can be influenced with some
-additional environment variables.
-
-
-
- GXID_HOST , GXID_PORT
-
-
- 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 --with-xinput=gxi .
- The XFree86 and Xorg
- X servers don't have this
- restriction.
-
-
-
-
- GDK_USE_XFT
-
-
- 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 (XEvent s for the X11
+ * backend, MSG s 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