Merge remote-tracking branch 'origin/master' into gdk-backend-wayland

Conflicts:
	gdk/gdkdisplaymanager.c
This commit is contained in:
Kristian Høgsberg 2011-02-26 14:44:29 -05:00
commit 287d91e5f9
167 changed files with 6741 additions and 5063 deletions

View File

@ -9,23 +9,23 @@ GTK+ requires the following packages:
GdkPixbuf @GDK_PIXBUF_REQUIRED_VERSION@, ATK @ATK_REQUIRED_VERSION@
and cairo @CAIRO_REQUIRED_VERSION@.
- gobject-introspection 0.9.3 or newer.
- gobject-introspection @INTROSPECTION_REQUIRED_VERSION@ or newer.
Simple install procedure
========================
% gzip -cd gtk+-@GTK_VERSION@.tar.gz | tar xvf - # unpack the sources
% cd gtk+-@GTK_VERSION@ # change to the toplevel directory
% ./configure # run the `configure' script
% make # build GTK+
% cd gtk+-@GTK_VERSION@ # change to the toplevel directory
% ./configure # run the `configure' script
% make # build GTK+
[ Become root if necessary ]
% make install # install GTK+
% make install # install GTK+
The Details
===========
Complete information about installing GTK+ and related libraries can be found
in the file:
Complete information about installing GTK+ and related libraries
can be found in the file:
docs/reference/gtk/html/gtk-building.html

32
NEWS
View File

@ -1,3 +1,35 @@
Overview of Changes in GTK+ 3.0.0
=================================
* Library sonames have been changed from libgdk-3.0 and libgtk-3.0
to libgdk-3 and libgtk-3.
* Bugs fixed:
632775 Back / Forward button's icons don't respect RTL settings
639846 GdkEventScroll events are sent twice
639945 Gtk.Widget does not have drag_* methods (but in pygtk it did)
640801 Crash gtk_tree_view_reset_header_styles at gtktreeview.c:11871
641196 Fix another GtkFixed regression, in gtk_fixed_forall()
641302 show something nicer than XF86AudioMute etc
641367 [region] gnome-applications ignore layout switching
641409 not chaining up in ::style-updated
641429 Errors creating a GtkWidget without a display
641431 Apply button goes grey after two mode switching
641517 "Migrating from libunique to GtkApplication" examples do not do...
641558 GtkCssProvider leaks path string
641621 Use faster new G_VALUE_COLLECT_INIT variant instead...
641640 Update autotools configuration
* Translation updates:
Arabic
English
Galician
Hebrew
Korean
Norwegian bokmål
Polish
Overview of Changes in GTK+ 2.99.3
==================================

View File

@ -25,3 +25,22 @@ Installation
============
See the file 'INSTALL'
Release notes for 3.0
=====================
* GTK+ 3 is a major new version of GTK+, which is parallel installable
with GTK+ 2.x. For information about porting applications from GTK+ 2.x
to GTK+ 3, see the file:
docs/reference/gtk/html/migrating.html
Or online at:
http://library.gnome.org/devel/gtk/3.0/migrating.html
* Note that the library sonames in this release have been changed from
libgtk-3.0 and libgdk-3.0 to libgtk-3 and libgdk-3, to prevent the
library versions from going backwards, compared to the 2.90/91/99
releases. Applications will have to be recompiled.

View File

@ -139,7 +139,7 @@
<File RelativePath="..\..\..\gdk\win32\gdkselection-win32.c" />
<File RelativePath="..\..\..\gdk\win32\gdktestutils-win32.c" />
<File RelativePath="..\..\..\gdk\win32\gdkvisual-win32.c" />
<File RelativePath="..\..\..\gdk\win32\gdkwin32displaymanager.c" />
<File RelativePath="..\..\..\gdk\win32\gdkdisplaymanager-win32.c" />
<File RelativePath="..\..\..\gdk\win32\gdkwin32id.c" />
<File RelativePath="..\..\..\gdk\win32\gdkwindow-win32.c" />
</Filter>

View File

@ -316,7 +316,6 @@ copy ..\..\..\gtk\gtkwidget.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#
copy ..\..\..\gtk\gtkwidgetpath.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
copy ..\..\..\gtk\gtkwindow.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&#x0D;&#x0A;
mkdir $(OutDir)\lib\gtk-$(GtkApiVersion)\include&#x0D;&#x0A;
copy ..\..\..\gdk\gdkconfig.h $(OutDir)\include\gtk-3.0\gdk&#x0D;&#x0A;
copy $(ConfigurationName)\$(PlatformName)\bin\*-$(GtkApiVersion).lib $(OutDir)\lib&#x0D;&#x0A;

View File

@ -8,10 +8,10 @@
# if backwards compatibility has been broken,
# set GTK_BINARY_AGE and GTK_INTERFACE_AGE to 0.
m4_define([gtk_major_version], [2])
m4_define([gtk_minor_version], [99])
m4_define([gtk_micro_version], [4])
m4_define([gtk_interface_age], [0])
m4_define([gtk_major_version], [3])
m4_define([gtk_minor_version], [0])
m4_define([gtk_micro_version], [1])
m4_define([gtk_interface_age], [1])
m4_define([gtk_binary_age],
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
m4_define([gtk_version],
@ -38,22 +38,25 @@ AC_CONFIG_MACRO_DIR([m4])
m4_define([gtk_binary_version], [3.0.0])
# required versions of other packages
m4_define([glib_required_version], [2.27.5])
m4_define([glib_required_version], [2.28.0])
m4_define([pango_required_version], [1.20])
m4_define([atk_required_version], [1.29.2])
m4_define([atk_required_version], [1.30])
m4_define([cairo_required_version], [1.10.0])
m4_define([gdk_pixbuf_required_version], [2.21.0])
m4_define([gdk_pixbuf_required_version], [2.22.0])
m4_define([introspection_required_version], [0.10.1])
GLIB_REQUIRED_VERSION=glib_required_version
PANGO_REQUIRED_VERSION=pango_required_version
ATK_REQUIRED_VERSION=atk_required_version
CAIRO_REQUIRED_VERSION=cairo_required_version
GDK_PIXBUF_REQUIRED_VERSION=gdk_pixbuf_required_version
INTROSPECTION_REQUIRED_VERSION=introspection_required_version
AC_SUBST(GLIB_REQUIRED_VERSION)
AC_SUBST(PANGO_REQUIRED_VERSION)
AC_SUBST(ATK_REQUIRED_VERSION)
AC_SUBST(CAIRO_REQUIRED_VERSION)
AC_SUBST(GDK_PIXBUF_REQUIRED_VERSION)
AC_SUBST(INTROSPECTION_REQUIRED_VERSION)
# Save this value here, since automake will set cflags later
cflags_set=${CFLAGS+set}
@ -170,12 +173,16 @@ dnl
AC_CHECK_TOOLS(CXX, [$CCC c++ g++ gcc CC cxx cc++ cl], gcc)
AC_LANG_PUSH([C++])
AC_TRY_COMPILE(,[class a { int b; } c;], ,CXX=)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],
[[class a { int b; } c;]])],
[],[CXX=])
AM_CONDITIONAL(HAVE_CXX, test "$CXX" != "")
gtk_save_cxxflags="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -x objective-c++"
AC_TRY_COMPILE([@interface Foo @end],,OBJC=yes,OBJC=no)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@interface Foo @end]],
[[]])],
[OBJC=yes],[OBJC=no])
AM_CONDITIONAL(HAVE_OBJC, test "$OBJC" = "yes")
CXXFLAGS="$gtk_save_cxxflags"
AC_LANG_POP([C++])
@ -233,61 +240,61 @@ m4_define([debug_default],
dnl declare --enable-* args and collect ac_help strings
AC_ARG_ENABLE(debug,
AC_HELP_STRING([--enable-debug=@<:@no/minimum/yes@:>@],
[turn on debugging @<:@default=debug_default@:>@]),,
enable_debug=debug_default)
[AS_HELP_STRING([--enable-debug=@<:@no/minimum/yes@:>@],
[turn on debugging @<:@default=debug_default@:>@])],,
[enable_debug=debug_default])
AC_ARG_ENABLE(rebuilds,
[AC_HELP_STRING([--disable-rebuilds],
[AS_HELP_STRING([--disable-rebuilds],
[disable all source autogeneration rules])],,
[enable_rebuilds=yes])
AC_ARG_ENABLE(gtk2-dependency,
AC_HELP_STRING([--enable-gtk2-dependency],
[Do not build gtk-update-icon-cache and other shared tools]),,
[AS_HELP_STRING([--enable-gtk2-dependency],
[Do not build gtk-update-icon-cache and other shared tools])],,
[enable_gtk2_dependency=no])
AM_CONDITIONAL(BUILD_ICON_CACHE, [test "x$enable_gtk2_dependency" = xno])
AC_ARG_ENABLE(xkb,
[AC_HELP_STRING([--enable-xkb],
[AS_HELP_STRING([--enable-xkb],
[support XKB extension [default=maybe]])],,
[enable_xkb="maybe"])
AC_ARG_ENABLE(xinerama,
[AC_HELP_STRING([--enable-xinerama],
[AS_HELP_STRING([--enable-xinerama],
[support Xinerama extension if available [default=maybe]])],,
[enable_xinerama="maybe"])
AC_ARG_ENABLE(xinput,
[AC_HELP_STRING([--enable-xinput],
[AS_HELP_STRING([--enable-xinput],
[support XInput extension if available [default=yes]])],,
[enable_xinput="maybe"])
AC_ARG_ENABLE(xrandr,
[AC_HELP_STRING([--enable-xrandr],
[AS_HELP_STRING([--enable-xrandr],
[support XRandR extension if available [default=maybe]])],,
[enable_xrandr="maybe"])
AC_ARG_ENABLE(xfixes,
[AC_HELP_STRING([--enable-xfixes],
[AS_HELP_STRING([--enable-xfixes],
[support XFixes extension if available [default=maybe]])],,
[enable_xfixes="maybe"])
AC_ARG_ENABLE(xcomposite,
[AC_HELP_STRING([--enable-xcomposite],
[AS_HELP_STRING([--enable-xcomposite],
[support X Composite extension if available [default=maybe]])],,
[enable_xcomposite="maybe"])
AC_ARG_ENABLE(xdamage,
[AC_HELP_STRING([--enable-xdamage],
[AS_HELP_STRING([--enable-xdamage],
[support X Damage extension if available [default=maybe]])],,
[enable_xdamage="maybe"])
AC_ARG_ENABLE(x11-backend,
[AC_HELP_STRING([--enable-x11-backend],
[AS_HELP_STRING([--enable-x11-backend],
[enable the X11 gdk backend])],
[backend_set=yes])
AC_ARG_ENABLE(win32-backend,
[AC_HELP_STRING([--enable-win32-backend],
[AS_HELP_STRING([--enable-win32-backend],
[enable the Win32 gdk backend])],
[backend_set=yes])
AC_ARG_ENABLE(quartz-backend,
[AC_HELP_STRING([--enable-quartz-backend],
[AS_HELP_STRING([--enable-quartz-backend],
[enable the quartz gdk backend])],
[backend_set=yes])
AC_ARG_ENABLE(wayland-backend,
@ -479,7 +486,7 @@ dnl * See whether to include shared library dependencies *
dnl ******************************************************
AC_ARG_ENABLE(explicit-deps,
[AC_HELP_STRING([--enable-explicit-deps=@<:@yes/no/auto@:>@],
[AS_HELP_STRING([--enable-explicit-deps=@<:@yes/no/auto@:>@],
[use explicit dependencies in .pc files [default=auto]])],,
[enable_explicit_deps=auto])
@ -524,10 +531,10 @@ AC_CHECK_FUNCS(localtime_r)
# _NL_TIME_FIRST_WEEKDAY is an enum and not a define
AC_MSG_CHECKING([for _NL_TIME_FIRST_WEEKDAY])
AC_TRY_LINK([#include <langinfo.h>], [
char c;
c = *((unsigned char *) nl_langinfo(_NL_TIME_FIRST_WEEKDAY));
], gtk_ok=yes, gtk_ok=no)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]],
[[char c;
c = *((unsigned char *) nl_langinfo(_NL_TIME_FIRST_WEEKDAY));]])],
[gtk_ok=yes], [gtk_ok=no])
AC_MSG_RESULT($gtk_ok)
if test "$gtk_ok" = "yes"; then
AC_DEFINE([HAVE__NL_TIME_FIRST_WEEKDAY], [1],
@ -536,10 +543,10 @@ fi
# _NL_MEASUREMENT_MEASUREMENT is an enum and not a define
AC_MSG_CHECKING([for _NL_MEASUREMENT_MEASUREMENT])
AC_TRY_LINK([#include <langinfo.h>], [
char c;
c = *((unsigned char *) nl_langinfo(_NL_MEASUREMENT_MEASUREMENT));
], gtk_ok=yes, gtk_ok=no)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]],
[[char c;
c = *((unsigned char *) nl_langinfo(_NL_MEASUREMENT_MEASUREMENT));]])],
[gtk_ok=yes], [gtk_ok=no])
AC_MSG_RESULT($gtk_ok)
if test "$gtk_ok" = "yes"; then
AC_DEFINE([HAVE__NL_MEASUREMENT_MEASUREMENT], [1],
@ -548,10 +555,10 @@ fi
# _NL_PAPER_HEIGHT is an enum and not a define
AC_MSG_CHECKING([for _NL_PAPER_HEIGHT])
AC_TRY_LINK([#include <langinfo.h>], [
char c;
c = *((unsigned char *) nl_langinfo(_NL_PAPER_HEIGHT));
], gtk_ok=yes, gtk_ok=no)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]],
[[char c;
c = *((unsigned char *) nl_langinfo(_NL_PAPER_HEIGHT));]])],
[gtk_ok=yes], [gtk_ok=no])
AC_MSG_RESULT($gtk_ok)
if test "$gtk_ok" = "yes"; then
AC_DEFINE([HAVE__NL_PAPER_HEIGHT], [1],
@ -560,10 +567,10 @@ fi
# _NL_PAPER_WIDTH is an enum and not a define
AC_MSG_CHECKING([for _NL_PAPER_WIDTH])
AC_TRY_LINK([#include <langinfo.h>], [
char c;
c = *((unsigned char *) nl_langinfo(_NL_PAPER_WIDTH));
], gtk_ok=yes, gtk_ok=no)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]],
[[char c;
c = *((unsigned char *) nl_langinfo(_NL_PAPER_WIDTH));]])],
[gtk_ok=yes], [gtk_ok=no])
AC_MSG_RESULT($gtk_ok)
if test "$gtk_ok" = "yes"; then
AC_DEFINE([HAVE__NL_PAPER_WIDTH], [1],
@ -574,9 +581,11 @@ fi
ALL_LINGUAS="`grep -v '^#' "$srcdir/po/LINGUAS" | tr '\n' ' '`"
AM_GLIB_GNU_GETTEXT
LIBS="$LIBS $INTLLIBS"
AC_OUTPUT_COMMANDS([case "$CONFIG_FILES" in *po-properties/Makefile.in*)
sed -e "/POTFILES =/r po-properties/POTFILES" po-properties/Makefile.in > po-properties/Makefile
esac])
AC_CONFIG_COMMANDS([po-properties],
[[case "$CONFIG_FILES" in *po-properties/Makefile.in*)
sed -e "/POTFILES =/r po-properties/POTFILES" po-properties/Makefile.in > po-properties/Makefile
esac]],
[[]])
dnl Snippet below is copied from AM_GLIB_GNU_GETTEXT to generate a first
dnl po-properties/POTFILES during configure; see GNOME #573515.
@ -606,22 +615,20 @@ AC_MSG_CHECKING([for extra flags to get ANSI library prototypes])
gtk_save_LIBS=$LIBS
LIBS="$LIBS -lm"
AC_TRY_RUN([#include <math.h>
int main (void) { return (log(1) != log(1.)); }],
AC_MSG_RESULT(none needed),
gtk_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -std1"
AC_TRY_RUN([#include <math.h>
int main (void) { return (log(1) != log(1.)); }],
AC_MSG_RESULT(-std1),
AC_MSG_RESULT()
CFLAGS="$gtk_save_CFLAGS"
AC_MSG_WARN(
[No ANSI prototypes found in library. (-std1 didn't work.)]),
true
),
AC_MSG_RESULT(none needed)
)
AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <math.h>
int main (void) { return (log(1) != log(1.)); }]])],
[AC_MSG_RESULT(none needed)],
[gtk_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -std1"
AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <math.h>
int main (void) { return (log(1) != log(1.)); }]])],
[AC_MSG_RESULT(-std1)],
[AC_MSG_RESULT()
CFLAGS="$gtk_save_CFLAGS"
AC_MSG_WARN([No ANSI prototypes found in library. (-std1 did not work.)])],
[true])],
[AC_MSG_RESULT(none needed)])
LIBS=$gtk_save_LIBS
AC_MSG_CHECKING(for the BeOS)
@ -650,18 +657,6 @@ case $host_os in
;;
esac
dnl NeXTStep cc seems to need this
AC_MSG_CHECKING([for extra flags for POSIX compliance])
AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
AC_MSG_RESULT(none needed),
gtk_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -posix"
AC_TRY_COMPILE([#include <dirent.h>], [DIR *dir;],
AC_MSG_RESULT(-posix),
AC_MSG_RESULT()
CFLAGS="$gtk_save_CFLAGS"
AC_MSG_WARN([Could not determine POSIX flag. (-posix didn't work.)])))
#
# Run AM_PATH_GLIB_2_0 to make sure that GLib is installed and working
#
@ -706,9 +701,11 @@ AC_CHECK_HEADERS(ftw.h,
[Define to 1 if ftw.h is available]))
AC_MSG_CHECKING([for GNU ftw extensions])
AC_TRY_COMPILE([#define _XOPEN_SOURCE 500
#define _GNU_SOURCE
#include <ftw.h>], [int flags = FTW_ACTIONRETVAL;], gtk_ok=yes, gtk_ok=no)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#define _XOPEN_SOURCE 500
#define _GNU_SOURCE
#include <ftw.h>]],
[[int flags = FTW_ACTIONRETVAL;]])],
[gtk_ok=yes],[gtk_ok=no])
if test $gtk_ok = yes; then
AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_GNU_FTW, 1, [Have GNU ftw])
@ -720,42 +717,17 @@ saved_cflags="$CFLAGS"
saved_ldflags="$LDFLAGS"
# Checks for header files.
AC_HEADER_STDC
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
# Checks for library functions.
AC_TYPE_SIGNAL
AC_FUNC_MMAP
AC_CHECK_FUNCS(mallinfo)
AC_CHECK_FUNCS(getresuid)
AC_TYPE_UID_T
# Check if <sys/select.h> needs to be included for fd_set
AC_MSG_CHECKING([for fd_set])
AC_TRY_COMPILE([#include <sys/types.h>],
[fd_set readMask, writeMask;], gtk_ok=yes, gtk_ok=no)
if test $gtk_ok = yes; then
AC_MSG_RESULT([yes, found in sys/types.h])
else
AC_HEADER_EGREP(fd_mask, sys/select.h, gtk_ok=yes)
if test $gtk_ok = yes; then
AC_DEFINE(HAVE_SYS_SELECT_H, 1,
[Define to 1 if sys/select.h is available])
AC_MSG_RESULT([yes, found in sys/select.h])
else
AC_DEFINE(NO_FD_SET, 1,
[Define to 1 if fd_set is not available])
AC_MSG_RESULT(no)
fi
fi
# Check for uxtheme.h (for MS-Windows Engine)
AC_MSG_CHECKING(for uxtheme.h)
AC_TRY_CPP([#include <uxtheme.h>], gtk_uxtheme_h=yes, gtk_uxtheme_h=no)
AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <uxtheme.h>]])],
[gtk_uxtheme_h=yes], [gtk_uxtheme_h=no])
if test $gtk_uxtheme_h = yes; then
AC_DEFINE(HAVE_UXTHEME_H, 1, [Have uxtheme.h include file])
fi
@ -768,7 +740,7 @@ AC_CHECK_FUNCS(_NSGetEnviron)
AC_MSG_CHECKING(whether to build dynamic modules)
AC_ARG_ENABLE(modules,
[AC_HELP_STRING([--disable-modules],
[AS_HELP_STRING([--disable-modules],
[disable dynamic module loading])])
dynworks=false
@ -817,13 +789,9 @@ AM_CONDITIONAL(BUILD_DYNAMIC_MODULES, $dynworks)
#
AC_MSG_CHECKING(immodules to build)
dnl due to an autoconf bug, commas in the first arg to
dnl AC_HELP_STRING cause problems.
dnl AC_HELP_STRING([--with-included-immodules=MODULE1 MODULE2 ...],
dnl [build the specified input method modules into gtk])
AC_ARG_WITH(included_immodules,
AC_HELP_STRING([--with-included-immodules=MODULE1,MODULE2,...],
[build the specified input methods into gtk]))
[AS_HELP_STRING([--with-included-immodules=MODULE1,MODULE2,...],
[build the specified input methods into gtk])])
if $dynworks; then
:
@ -880,10 +848,6 @@ AM_CONDITIONAL(INCLUDE_IM_TI_ET, [test x"$INCLUDE_ti_et" = xyes])
AM_CONDITIONAL(INCLUDE_IM_VIQR, [test x"$INCLUDE_viqr" = xyes])
AM_CONDITIONAL(INCLUDE_IM_XIM, [test x"$INCLUDE_xim" = xyes])
AC_HEADER_SYS_WAIT
AC_TYPE_SIGNAL
# Checks to see whether we should include mediaLib
# support.
#
@ -991,17 +955,17 @@ if test "x$enable_x11_backend" == xyes; then
# Check for xReply
AC_MSG_CHECKING([if <X11/extensions/XIproto.h> is needed for xReply])
AC_TRY_COMPILE([#include <X11/Xlibint.h>],
[xReply *rep;],
[AC_MSG_RESULT([no])],
[AC_TRY_COMPILE([#include <X11/extensions/XIproto.h>
#include <X11/Xlibint.h>],
[xReply *rep;],
[AC_MSG_RESULT([yes])
AC_DEFINE([NEED_XIPROTO_H_FOR_XREPLY], 1,
[Define if <X11/extensions/XIproto.h> needed for xReply])],
[AC_MSG_RESULT([unknown])
AC_MSG_ERROR([xReply type unavailable. X11 is too old])])])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xlibint.h>]],
[[xReply *rep;]])],
[AC_MSG_RESULT([no])],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/extensions/XIproto.h>
#include <X11/Xlibint.h>]],
[[xReply *rep;]])],
[AC_MSG_RESULT([yes])
AC_DEFINE([NEED_XIPROTO_H_FOR_XREPLY], [1],
[Define if <X11/extensions/XIproto.h> needed for xReply])],
[AC_MSG_RESULT([unknown])
AC_MSG_ERROR([xReply type unavailable. X11 is too old])])])
# Check for XConvertCase, XInternAtoms (X11R6 specific)
@ -1383,7 +1347,7 @@ LIBS="$old_LIBS"
PRINT_BACKENDS="file lpr"
AC_ARG_ENABLE(cups,
[AC_HELP_STRING([--disable-cups],
[AS_HELP_STRING([--disable-cups],
[disable cups print backend])],,
[enable_cups=auto])
@ -1425,10 +1389,11 @@ else
gtk_save_cflags="$CFLAGS"
CFLAGS="$CUPS_CFLAGS"
AC_TRY_COMPILE([#include <cups/http.h>],
[http_t http; char *s = http.authstring;],
[AC_DEFINE(HAVE_HTTP_AUTHSTRING, [],
[Define if cups http_t authstring field is accessible])],)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <cups/http.h>]],
[[http_t http; char *s = http.authstring;]])],
[AC_DEFINE([HAVE_HTTP_AUTHSTRING], [],
[Define if cups http_t authstring field is accessible])],
[])
CFLAGS="$gtk_save_cflags"
AC_SUBST(HAVE_HTTP_AUTHSTRING)
@ -1444,9 +1409,9 @@ fi
#
AC_ARG_ENABLE(papi,
[AC_HELP_STRING([--disable-papi],
[AS_HELP_STRING([--disable-papi],
[disable papi print backend])],,
[enable_papi=auto])
[enable_papi=auto])
if test "x$enable_papi" = "xno"; then
AM_CONDITIONAL(HAVE_PAPI, false)
@ -1488,7 +1453,7 @@ CPPFLAGS="$gtk_save_cppflags"
AC_ARG_ENABLE(test-print-backend,
[AC_HELP_STRING([--enable-test-print-backend],
[AS_HELP_STRING([--enable-test-print-backend],
[build test print backend])],,
[enable_test_print_backend=no])
if test "x$enable_test_print_backend" != "xno" ; then
@ -1527,15 +1492,15 @@ GLIB_GSETTINGS
# GObject introspection
##################################################
GOBJECT_INTROSPECTION_CHECK([0.10.1])
GOBJECT_INTROSPECTION_CHECK(introspection_required_version)
##################################################
# Packagekit module
#################################################
AC_ARG_ENABLE(packagekit,
AC_HELP_STRING([--disable-packagekit],
[build packagekit open-with module]))
[AS_HELP_STRING([--disable-packagekit],
[build packagekit open-with module])])
build_packagekit=no
if test "os_win32" != "yes"; then
@ -1557,9 +1522,10 @@ AC_CHECK_PROG(DB2HTML, db2html, true, false)
AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML)
AC_ARG_ENABLE(man,
[AC_HELP_STRING([--enable-man],
[regenerate man pages from Docbook [default=no]])],enable_man=yes,
enable_man=no)
[AS_HELP_STRING([--enable-man],
[regenerate man pages from Docbook [default=no]])],
[enable_man=yes],
[enable_man=no])
if test "${enable_man}" != no; then
dnl
@ -1632,16 +1598,17 @@ dnl Check for -Bsymbolic-functions linker flag used to avoid
dnl intra-library PLT jumps, if available.
dnl
AC_ARG_ENABLE(Bsymbolic,
[AC_HELP_STRING([--disable-Bsymbolic],
[AS_HELP_STRING([--disable-Bsymbolic],
[avoid linking with -Bsymbolic])],,
[SAVED_LDFLAGS="${LDFLAGS}"
AC_MSG_CHECKING([for -Bsymbolic-functions linker flag])
LDFLAGS=-Wl,-Bsymbolic-functions
AC_TRY_LINK([], [int main (void) { return 0; }],
AC_MSG_RESULT(yes)
enable_Bsymbolic=yes,
AC_MSG_RESULT(no)
enable_Bsymbolic=no)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],
[[int main (void) { return 0; }]])],
[AC_MSG_RESULT(yes)
enable_Bsymbolic=yes],
[AC_MSG_RESULT(no)
enable_Bsymbolic=no])
LDFLAGS="${SAVED_LDFLAGS}"])
if test "x${enable_Bsymbolic}" = "xyes" ; then

View File

@ -12,11 +12,11 @@ INCLUDES = \
$(GTK_DEP_CFLAGS)
DEPS = \
$(top_builddir)/gtk/libgtk-3.0.la
$(top_builddir)/gtk/libgtk-3.la
LDADDS = \
$(top_builddir)/gtk/libgtk-3.0.la \
$(top_builddir)/gdk/libgdk-3.0.la \
$(top_builddir)/gtk/libgtk-3.la \
$(top_builddir)/gdk/libgdk-3.la \
$(GTK_DEP_LIBS) \
$(MATH_LIB)

View File

@ -55,11 +55,11 @@ INCLUDES = \
$(GTK_DEP_CFLAGS)
DEPS = \
$(top_builddir)/gtk/libgtk-3.0.la
$(top_builddir)/gtk/libgtk-3.la
LDADDS = \
$(top_builddir)/gtk/libgtk-3.0.la \
$(top_builddir)/gdk/libgdk-3.0.la \
$(top_builddir)/gtk/libgtk-3.la \
$(top_builddir)/gdk/libgdk-3.la \
$(GTK_DEP_LIBS) \
-lm

View File

@ -44,15 +44,14 @@ INCLUDES = \
$(GTK_DEBUG_FLAGS) \
$(GDK_DEP_CFLAGS)
GTKDOC_LIBS = $(top_builddir)/gdk/libgdk-3.0.la $(GDK_DEP_LIBS)
GTKDOC_LIBS = $(top_builddir)/gdk/libgdk-3.la $(GDK_DEP_LIBS)
# Extra options to supply to gtkdoc-mkdb
MKDB_OPTIONS=--sgml-mode --output-format=xml --name-space=gdk
# Extra SGML files that are included by DOC_MAIN_SGML_FILE
content_files = \
version.xml \
multihead.sgml
version.xml
# Images to copy into HTML directory
HTML_IMAGES = \

View File

@ -6,23 +6,24 @@
]>
<book id="index" xmlns:xi="http://www.w3.org/2003/XInclude">
<bookinfo>
<title>GDK Reference Manual</title>
<title>GDK 3 Reference Manual</title>
<releaseinfo>
for GDK &version;
The latest version of this documentation can be found on-line at
<ulink role="online-location" url="http://library.gnome.org/devel/gdk/unstable/">http://library.gnome.org/devel/gdk/unstable/</ulink>.
This document is for the GDK 3 library, version &version;
The latest versions can be found online at
<ulink role="online-location" url="http://library.gnome.org/devel/gdk3/">http://library.gnome.org/devel/gdk3/</ulink>.
If you are looking for the older GDK 2 series of libraries,
see <ulink role="online-location" url="http://library.gnome.org/devel/gdk/">http://library.gnome.org/devel/gdk/</ulink>.
</releaseinfo>
</bookinfo>
<reference id="reference">
<title>API Reference</title>
<xi:include href="xml/general.xml" />
<xi:include href="multihead.sgml" />
<xi:include href="xml/gdkdisplay.xml" />
<xi:include href="xml/gdkdisplaymanager.xml" />
<xi:include href="xml/gdkdevice.xml" />
<xi:include href="xml/gdkdevicemanager.xml" />
<xi:include href="xml/gdkdisplay.xml" />
<xi:include href="xml/gdkscreen.xml" />
<xi:include href="xml/gdkdevicemanager.xml" />
<xi:include href="xml/gdkdevice.xml" />
<xi:include href="xml/regions.xml" />
<xi:include href="xml/pixbufs.xml" />
<xi:include href="xml/colors.xml" />

View File

@ -1,128 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
]>
<refentry id="multihead" revision="1 May 2002">
<refmeta>
<refentrytitle>Multi-head Support Overview</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GDK Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>Multi-head Support Overview</refname>
<refpurpose>Overview of GdkDisplay and GdkScreen</refpurpose>
</refnamediv>
<refsect1>
<title>Overview</title>
<para>
Multihead support is based around two main object types:
<itemizedlist>
<listitem><para>GdkDisplay</para></listitem>
<listitem><para>GdkScreen</para></listitem>
</itemizedlist>
</para>
<para>
<link linkend="gdk-GdkDisplay">GdkDisplay</link> objects are the GDK
representation of the X Display which can be described as <emphasis>a
workstation consisting of a keyboard a pointing device (such as a
mouse) and one or more screens</emphasis>.
It is used to open and keep track of various <link
linkend="gdk-GdkScreen">GdkScreen</link> objects currently
instanciated by the application. It is also used to grab and release
the keyboard and the mouse pointer.
</para>
<para>
<link linkend="gdk-GdkScreen">GdkScreen</link> objects are the GDK
representation of a physical screen. It is used throughout GDK and GTK+
to specify which screen the top level windows are to be displayed on.
It is also used to query the screen specification and default settings such as
the default colormap (<link linkend="gdk-screen-get-default-colormap">gdk_screen_get_default_colormap</link>()),
the screen width (<link linkend="gdk-screen-get-width">gdk_screen_get_width</link>()), etc.
</para>
<para>
The following code samples demonstrate common usage of the objects described above.
</para>
<example>
<title>Testing the number of screen on the current display</title>
<programlisting><!--
-->gint num_screen = 0;
gchar *displayname = NULL;
GdkScreen **screen_list;
GdkDisplay *display;
gtk_init (&amp;argc, &amp;argv);
display = gdk_display_get_default ();
num_screen = gdk_display_get_n_screens (display);
displayname = gdk_display_get_name (display);
if (num_screen &lt;= 1)
{
printf ("This Xserver (%s) manages only one screen. exiting...\n",
displayname);
exit (1);
}
else
{
printf ("This Xserver (%s) manages %d screens.\n", displayname,
num_screen);
}<!--
--> </programlisting>
</example>
<example>
<title>Opening a second display</title>
<programlisting><!--
-->gchar *second_screen_name;
GdkDisplay *second_display;
GdkScreen *second_screen;
GtkWidget *window;
gtk_init (&amp;argc, &amp;argv);
/* screen2_name needs to be initialized before calling
/* gdk_display_new() */
second_display = gdk_display_new (&amp;argc, &amp;argv, second_screen_name);
if (second_display)
second_screen = gdk_display_get_default_screen (second_display);
else
{
g_print ("Can't open display :\n\t%s\n\n",
second_screen_name);
exit (1);
}
/* now GdkScreen can be assigned to GtkWindows */
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (window, second_screen);<!--
--></programlisting>
</example>
</refsect1>
<refsect1>
<title>See Also</title>
<para>
<variablelist>
<varlistentry>
<term><link linkend="GdkDisplay">GdkDisplay</link></term>
<listitem><para>the GDK Object used to represent and manipulate display
related data</para></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="GdkScreen">GdkScreen</link></term>
<listitem><para>the GDK Object used to represent and query screen related
data</para></listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
</refentry>
<!--
Local variables:
mode: sgml
sgml-parent-document: ("gdk-docs.sgml" "book" "refentry" "")
End:
-->

View File

@ -106,7 +106,7 @@ CPPFLAGS += \
-UGTK_DISABLE_SINGLE_INCLUDES
GTKDOC_LIBS = \
$(top_builddir)/gtk/libgtk-3.0.la \
$(top_builddir)/gtk/libgtk-3.la \
$(GTK_DEP_LIBS)

View File

@ -172,7 +172,7 @@ How to compile GTK+ itself
such as high level data types, Unicode manipulation, and
an object and type system to C programs. It is available
from the <ulink url="ftp://ftp.gtk.org/pub/glib/">GTK+
FTP site.</ulink>
FTP site</ulink>.
</para>
</listitem>
<listitem>
@ -180,7 +180,7 @@ How to compile GTK+ itself
<ulink url="http://www.pango.org">Pango</ulink> is a library
for internationalized text handling. It is available from
the <ulink url="ftp://ftp.gtk.org/pub/pango/">GTK+ FTP
site.</ulink>.
site</ulink>.
</para>
</listitem>
<listitem>
@ -189,7 +189,7 @@ How to compile GTK+ itself
interfaces allowing accessibility technologies such as
screen readers to interact with a graphical user interface.
It is available from the <ulink
url="ftp://ftp.gtk.org/pub/atk/">GTK+ FTP site.</ulink>
url="ftp://ftp.gtk.org/pub/atk/">GTK+ FTP site</ulink>.
</para>
</listitem>
<listitem>
@ -309,49 +309,60 @@ How to compile GTK+ itself
<cmdsynopsis>
<command>configure</command>
<sbr/>
<group>
<arg>--disable-modules</arg>
<arg>--enable-modules</arg>
</group>
<sbr/>
<group>
<arg>--with-included-immodules=MODULE1,MODULE2,...</arg>
</group>
<sbr/>
<group>
<arg>--enable-debug=[no/minimum/yes]</arg>
</group>
<sbr/>
<group>
<arg>--disable-Bsymbolic</arg>
<arg>--enable-Bsymbolic</arg>
</group>
<sbr/>
<group>
<arg>--disable-xkb</arg>
<arg>--enable-xkb</arg>
</group>
<sbr/>
<group>
<arg>--disable-xinerama</arg>
<arg>--enable-xinerama</arg>
</group>
<sbr/>
<group>
<arg>--disable-gtk-doc</arg>
<arg>--enable-gtk-doc</arg>
</group>
<sbr/>
<group>
<arg>--disable-cups</arg>
<arg>--enable-cups</arg>
</group>
<sbr/>
<group>
<arg>--disable-papi</arg>
<arg>--enable-papi</arg>
</group>
<sbr/>
<group>
<arg>--enable-xinput</arg>
<arg>--disable-xinput</arg>
</group>
<sbr/>
<group>
<arg>--enable-packagekit</arg>
<arg>--disable-packagekit</arg>
</group>
<sbr/>
<group>
<arg>--enable-x11-backend</arg>
<arg>--disable-x11-backend</arg>
@ -360,9 +371,11 @@ How to compile GTK+ itself
<arg>--enable-quartz-backend</arg>
<arg>--disable-quartz-backend</arg>
</group>
<sbr/>
<group>
<arg>--enable-introspection=[no/auto/yes]</arg>
</group>
<sbr/>
<group>
<arg>--enable-gtk2-dependency</arg>
<arg>--disable-gtk2-dependency</arg>

View File

@ -32,7 +32,7 @@ your system may be different):
$ 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-3.0 -lgdk-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
-pthread -lgtk-3 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0
</programlisting>
</para>
<para>

View File

@ -10,9 +10,11 @@
<bookinfo>
<title>GTK+ 3 Reference Manual</title>
<releaseinfo>
This document is for GTK+ 3 library; the latest version can be found online at
<ulink role="online-location" url="http://library.gnome.org/devel/gtk/unstable/">http://library.gnome.org/devel/gtk/unstable/</ulink>.
If you're looking for the older GTK+ 2 series of libraries, they can be found under their version numbers; for example, 2.22 is available at <ulink role="online-location" url="http://library.gnome.org/devel/gtk/2.22/">http://library.gnome.org/devel/gtk/2.22/</ulink>.
This document is for the GTK+ 3 library, version &version;.
The latest versions can be found online at
<ulink role="online-location" url="http://library.gnome.org/devel/gtk3/">http://library.gnome.org/devel/gtk3/</ulink>.
If you are looking for the older GTK+ 2 series of libraries,
see <ulink role="online-location" url="http://library.gnome.org/devel/gtk/">http://library.gnome.org/devel/gtk/</ulink>.
</releaseinfo>
</bookinfo>

View File

@ -5,13 +5,14 @@
<refentry id="gtk-query-immodules-3.0">
<refmeta>
<refentrytitle>gtk-query-immodules-3.0</refentrytitle>
<manvolnum>1</manvolnum>
<refentrytitle>gtk-query-immodules-3.0</refentrytitle>
<manvolnum>1</manvolnum>
<refmiscinfo class="manual">User Commands</refmiscinfo>
</refmeta>
<refnamediv>
<refname>gtk-query-immodules-3.0</refname>
<refpurpose>Input method module registration utility</refpurpose>
<refname>gtk-query-immodules-3.0</refname>
<refpurpose>Input method module registration utility</refpurpose>
</refnamediv>
<refsynopsisdiv>
@ -38,8 +39,8 @@ may be absolute or relative paths.
</para>
<para>
Normally, the output of <command>gtk-query-immodules-3.0</command> is written
to <filename><replaceable>libdir</replaceable>gtk-3.0/3.0.0/immodules.cache</filename>, where GTK+ looks for it by default. If it is written to some other
location, the environment variable <link linkend="GTK_IM_MODULE_FILE"><envar>GTK_IM_MODULE_FILE</envar></link>
to <filename><replaceable>libdir</replaceable>/gtk-3.0/3.0.0/immodules.cache</filename>, where GTK+ looks for it by default. If it is written to some other
location, the environment variable <link linkend="gtk-im-module-file"><envar>GTK_IM_MODULE_FILE</envar></link>
can be set to point GTK+ at the file.
</para>
</refsect1>
@ -56,7 +57,7 @@ can be set to point GTK+ at the file.
<refsect1><title>Environment</title>
<para>
The environment variable <link linkend="GTK_PATH"><envar>GTK_PATH</envar></link>
The environment variable <link linkend="gtk-path"><envar>GTK_PATH</envar></link>
can be used to prepend directories to the input method module path.
</para>
</refsect1>

View File

@ -5,13 +5,14 @@
<refentry id="gtk-update-icon-cache">
<refmeta>
<refentrytitle>gtk-update-icon-cache</refentrytitle>
<manvolnum>1</manvolnum>
<refentrytitle>gtk-update-icon-cache</refentrytitle>
<manvolnum>1</manvolnum>
<refmiscinfo class="manual">User Commands</refmiscinfo>
</refmeta>
<refnamediv>
<refname>gtk-update-icon-cache</refname>
<refpurpose>Icon theme caching utility</refpurpose>
<refname>gtk-update-icon-cache</refname>
<refpurpose>Icon theme caching utility</refpurpose>
</refnamediv>
<refsynopsisdiv>
@ -20,28 +21,29 @@
<arg choice="opt">--force</arg>
<arg choice="opt">--ignore-theme-index</arg>
<arg choice="opt">--index-only</arg>
<arg choice="opt">--source<arg>name</arg></arg>
<arg choice="opt">--source <arg choice="plain"><replaceable>NAME</replaceable></arg></arg>
<arg choice="opt">--quiet</arg>
<arg choice="opt">--validate</arg>
<arg choice="req">iconpath</arg>
<arg choice="plain"><replaceable>PATH</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1><title>Description</title>
<para>
<command>gtk-update-icon-cache</command> creates mmap()able cache
<command>gtk-update-icon-cache</command> creates mmapable cache
files for icon themes.
</para>
<para>
It expects to be given the path to a icon theme directory containing an
<filename>index.theme</filename>, e.g. <filename>/usr/share/icons/hicolor</filename>,
and writes a <filename>icon-theme.cache</filename> containing cached
information about the icons in the directory tree below the given directory.
It expects to be given the <replaceable>PATH</replaceable> to a icon theme
directory containing an <filename>index.theme</filename>, e.g.
<filename>/usr/share/icons/hicolor</filename>, and writes a
<filename>icon-theme.cache</filename> containing cached information about
the icons in the directory tree below the given directory.
</para>
<para>
GTK+ can use the cache files created by <command>gtk-update-icon-cache</command>
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
starts. Since the format of the cache files allows them to be mmaped
shared between multiple applications, the overall memory consumption is
reduced as well.
</para>
@ -59,8 +61,8 @@
<varlistentry>
<term>--ignore-theme-index</term>
<term>-t</term>
<listitem><para>Don't check for the existence of 'index.theme' in the icon
theme directory. Without this option, <command>gtk-update-icon-cache</command>
<listitem><para>Don't check for the existence of <filename>index.theme</filename>
in the icon theme directory. Without this option, <command>gtk-update-icon-cache</command>
refuses to create an icon cache in a directory which does not appear to
be the toplevel directory of an icon theme.
</para></listitem>
@ -77,7 +79,7 @@
<term>--source</term>
<term>-c</term>
<listitem><para>Output a C header file declaring a constant
<replaceable>name</replaceable> with the contents of the icon
<replaceable>NAME</replaceable> with the contents of the icon
cache.</para></listitem>
</varlistentry>

View File

@ -2058,6 +2058,8 @@ gtk_menu_item_deselect
gtk_menu_item_activate
gtk_menu_item_toggle_size_request
gtk_menu_item_toggle_size_allocate
gtk_menu_item_get_reserve_indicator
gtk_menu_item_set_reserve_indicator
<SUBSECTION Standard>
GTK_MENU_ITEM
GTK_IS_MENU_ITEM
@ -4202,6 +4204,7 @@ gtk_tree_view_column_set_clickable
gtk_tree_view_column_get_clickable
gtk_tree_view_column_set_widget
gtk_tree_view_column_get_widget
gtk_tree_view_column_get_button
gtk_tree_view_column_set_alignment
gtk_tree_view_column_get_alignment
gtk_tree_view_column_set_reorderable
@ -4286,6 +4289,7 @@ gtk_tree_view_row_expanded
gtk_tree_view_set_reorderable
gtk_tree_view_get_reorderable
gtk_tree_view_get_path_at_pos
gtk_tree_view_is_blank_at_pos
gtk_tree_view_get_cell_area
gtk_tree_view_get_background_area
gtk_tree_view_get_visible_rect
@ -5749,6 +5753,7 @@ gtk_style_new
gtk_style_copy
gtk_style_attach
gtk_style_detach
gtk_style_get_context
gtk_style_set_background
gtk_style_apply_default_background
gtk_style_lookup_color

View File

@ -144,8 +144,8 @@
GAppLaunchContext *context;
GError *error = NULL;
info = g_desktop_app_info_new ("epiphany.desktop");
context = gdk_display_get_app_launch_context (display);
info = (GAppInfo*) g_desktop_app_info_new ("epiphany.desktop");
context = (GAppLaunchContext*) gdk_display_get_app_launch_context (display);
g_app_info_launch (info, NULL, context, &amp;error);
if (error)
@ -157,6 +157,10 @@
g_object_unref (info);
g_object_unref (context);
</programlisting></informalexample>
Remember that you have to include
<filename>gio/gdesktopappinfo.h</filename>
and use the <filename>gio-unix-2.0</filename> pkg-config file
when using g_desktop_app_info_new().
</listitem>
<listitem>If you are launching a custom commandline, you can
still use g_app_info_launch() with a GAppInfo that is constructed

View File

@ -35,11 +35,11 @@ How do I get started with GTK+?
</para></question>
<answer><para>
The GTK+ <ulink url="http://www.gtk.org">website</ulink> offers a
<ulink url="http://www.gtk.org/tutorial">tutorial</ulink> and a
<ulink url="http://www.gtk.org/faq">FAQ</ulink>. More documentation ranging
from whitepapers to online books can be found at the
<ulink url="http://library.gnome.org/devel/">GNOME developer's site</ulink>.
The GTK+ <ulink url="http://www.gtk.org">website</ulink> offers some
<ulink url="http://www.gtk.org/documentation">tutorials</ulink> and other
documentation (most of it about GTK+ 2.x, but mostly still applicable).
More documentation ranging from whitepapers to online books can be found at
the <ulink url="http://library.gnome.org/devel/">GNOME developer's site</ulink>.
After studying these materials you should be well prepared to come back to
this reference manual for details.
</para></answer>

View File

@ -199,9 +199,13 @@ additional environment variables.
<para>
A list of modules to load. Note that GTK+ also allows to specify modules to load via a commandline option (<option>--gtk-module</option>) and with the <literal>gtk-modules</literal> setting.
</para>
<warning>
Note that this environment variable is read by GTK+ 2.x too,
which may not have the same set of modules available for loading.
</warning>
</formalpara>
<formalpara>
<formalpara id="gtk-path">
<title><envar>GTK_PATH</envar></title>
<para>
@ -211,7 +215,7 @@ additional environment variables.
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,
Otherwise, GTK+ goes in turn through the directories in <envar>GTK_PATH</envar>,
followed by the directory <filename>.gtk-3.0</filename> in the user's
home directory, followed by the system default directory,
which is <filename><replaceable>libdir</replaceable>/gtk-3.0/modules</filename>.
@ -241,6 +245,12 @@ additional environment variables.
The components of GTK_PATH are separated by the ':' character on
Linux and Unix, and the ';' character on Windows.
</para>
<warning>
Note that this environment variable is read by GTK+ 2.x too, which
makes it unsuitable for setting it system-wide (or session-wide),
since doing so will cause either GTK+ 2.x applications or GTK+ 3
applications to see incompatible modules.
</warning>
</formalpara>
<formalpara>
@ -255,7 +265,7 @@ additional environment variables.
</para>
</formalpara>
<formalpara id="im-module-file">
<formalpara id="gtk-im-module-file">
<title><envar>GTK_IM_MODULE_FILE</envar></title>
<para>
@ -268,6 +278,12 @@ additional environment variables.
The <filename>immodules.cache</filename> file is generated by the
<command>gtk-query-immodules-3.0</command> utility.
</para>
<warning>
Note that this environment variable is read by GTK+ 2.x too, which
makes it unsuitable for setting it system-wide (or session-wide),
since doing so will cause either GTK+ 2.x applications or GTK+ 3
applications to see the wrong list of IM modules.
</warning>
</formalpara>
<formalpara>
@ -375,6 +391,34 @@ nevertheless.
</para>
</formalpara>
<formalpara>
<title><envar>GDK_BACKEND</envar></title>
<para>
If set, selects the GDK backend to use. Selecting a backend requires that GTK is compiled
with support for that backend. The following backends can be selected:
<variablelist>
<varlistentry>
<term>quartz</term>
<listitem><para>Selects the native Quartz backend</para></listitem>
</varlistentry>
<varlistentry>
<term>win32</term>
<listitem><para>Selects the native backend for Microsoft Windows</para></listitem>
</varlistentry>
<varlistentry>
<term>x11</term>
<listitem><para>Selects the native backend for connecting to X11 servers.</para></listitem>
</varlistentry>
</variablelist>
For more information about selecting backends, see the gdk_display_manager_get() function.
</para>
</formalpara>
<formalpara>
<title><envar>GDK_SYNCHRONIZE</envar></title>

View File

@ -9,13 +9,13 @@ INCLUDES = \
$(GTK_DEP_CFLAGS)
DEPS = \
$(top_builddir)/gtk/libgtk-3.0.la
$(top_builddir)/gtk/libgtk-3.la
LDADDS = \
$(top_builddir)/gtk/libgtk-3.0.la \
$(top_builddir)/gdk/libgdk-3.0.la \
$(GTK_DEP_LIBS) \
$(GDK_DEP_LIBS) \
$(top_builddir)/gtk/libgtk-3.la \
$(top_builddir)/gdk/libgdk-3.la \
$(GTK_DEP_LIBS) \
$(GDK_DEP_LIBS) \
-lm
if USE_X11

View File

@ -45,11 +45,11 @@ INCLUDES = \
$(GTK_DEP_CFLAGS)
LDADD = \
$(top_builddir)/gtk/libgtk-3.0.la \
$(top_builddir)/gtk/libgtk-3.la \
$(GTK_DEP_LIBS)
drawing_LDADD = $(LDADD) \
$(top_builddir)/gdk/libgdk-3.0.la
$(top_builddir)/gdk/libgdk-3.la
noinst_PROGRAMS = \
hello-world \

View File

@ -6,6 +6,6 @@ includedir=@includedir@
Name: Gail
Description: GNOME Accessibility Implementation Library
Version: @VERSION@
Requires: atk gtk+-3.
Requires: atk gtk+-3.0
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

View File

@ -7,5 +7,5 @@ Name: Gail
Description: GNOME Accessibility Implementation Library
Version: @VERSION@
Requires: atk gtk+-3.0
Libs: -L${libdir} -lgailutil-3.0
Libs: -L${libdir} -lgailutil-3
Cflags: -I${includedir}/gail-3.0

View File

@ -8,5 +8,5 @@ Name: GDK
Description: GTK+ Drawing Kit
Version: @VERSION@
Requires: @GDK_PACKAGES@
Libs: -L${libdir} -lgdk-@GTK_API_VERSION@ @GDK_EXTRA_LIBS@
Libs: -L${libdir} -lgdk-3 @GDK_EXTRA_LIBS@
Cflags: -I${includedir}/gtk-@GTK_API_VERSION@ @GDK_EXTRA_CFLAGS@

View File

@ -157,27 +157,27 @@ common_sources = \
gdkmarshalers.c \
gdkmarshalers.h
libgdk_3_0_la_SOURCES = $(common_sources)
libgdk_3_0_la_LIBADD = $(GDK_DEP_LIBS)
libgdk_3_0_la_LDFLAGS = $(LDADD)
libgdk_3_la_SOURCES = $(common_sources)
libgdk_3_la_LIBADD = $(GDK_DEP_LIBS)
libgdk_3_la_LDFLAGS = $(LDADD)
if USE_X11
libgdk_3_0_la_LIBADD += x11/libgdk-x11.la
libgdk_3_la_LIBADD += x11/libgdk-x11.la
endif # USE_X11
if USE_QUARTZ
libgdk_3_0_la_LIBADD += quartz/libgdk-quartz.la
libgdk_3_la_LIBADD += quartz/libgdk-quartz.la
endif # USE_QUARTZ
if USE_WIN32
libgdk_3_0_la_SOURCES += gdkkeynames.c
libgdk_3_0_la_LIBADD += win32/libgdk-win32.la
libgdk_3_0_la_DEPENDENCIES = win32/libgdk-win32.la win32/rc/gdk-win32-res.o gdk.def
libgdk_3_0_la_LDFLAGS += -Wl,win32/rc/gdk-win32-res.o -export-symbols $(srcdir)/gdk.def
libgdk_3_la_SOURCES += gdkkeynames.c
libgdk_3_la_LIBADD += win32/libgdk-win32.la
libgdk_3_la_DEPENDENCIES = win32/libgdk-win32.la win32/rc/gdk-win32-res.o gdk.def
libgdk_3_la_LDFLAGS += -Wl,win32/rc/gdk-win32-res.o -export-symbols $(srcdir)/gdk.def
endif # USE_WIN32
if USE_WAYLAND
libgdk_3_0_la_LIBADD += wayland/libgdk-wayland.la
libgdk_3_la_LIBADD += wayland/libgdk-wayland.la
endif
if HAVE_INTROSPECTION
@ -188,11 +188,11 @@ introspection_files = \
gdkenumtypes.c \
gdkenumtypes.h
Gdk-3.0.gir: libgdk-3.0.la Makefile
Gdk-3.0.gir: libgdk-3.la Makefile
Gdk_3_0_gir_SCANNERFLAGS = \
--c-include="gdk/gdk.h"
Gdk_3_0_gir_INCLUDES = Gio-2.0 GdkPixbuf-2.0 Pango-1.0 cairo-1.0
Gdk_3_0_gir_LIBS = libgdk-3.0.la
Gdk_3_0_gir_LIBS = libgdk-3.la
Gdk_3_0_gir_FILES = $(introspection_files)
Gdk_3_0_gir_CFLAGS = $(INCLUDES)
Gdk_3_0_gir_EXPORT_PACKAGES = gdk-3.0
@ -239,13 +239,13 @@ x11_introspection_files = \
x11/gdkx11visual.h \
x11/gdkx11window.h
GdkX11-3.0.gir: libgdk-3.0.la Gdk-3.0.gir Makefile
GdkX11-3.0.gir: libgdk-3.la Gdk-3.0.gir Makefile
GdkX11_3_0_gir_SCANNERFLAGS = \
--identifier-prefix=Gdk \
--c-include="gdk/gdkx.h" \
--include-uninstalled=$(top_builddir)/gdk/Gdk-3.0.gir
GdkX11_3_0_gir_INCLUDES = Gio-2.0 Gdk-3.0 GdkPixbuf-2.0 Pango-1.0 xlib-2.0
GdkX11_3_0_gir_LIBS = libgdk-3.0.la
GdkX11_3_0_gir_INCLUDES = Gio-2.0 GdkPixbuf-2.0 Pango-1.0 xlib-2.0
GdkX11_3_0_gir_LIBS = libgdk-3.la
GdkX11_3_0_gir_FILES = $(x11_introspection_files)
GdkX11_3_0_gir_CFLAGS = $(INCLUDES) -L$(top_builddir)/gdk
GdkX11_3_0_gir_EXPORT_PACKAGES = gdk-x11-3.0
@ -301,7 +301,7 @@ if OS_LINUX
TESTS = abicheck.sh
endif
lib_LTLIBRARIES = libgdk-3.0.la
lib_LTLIBRARIES = libgdk-3.la
MAINTAINERCLEANFILES = $(gdk_built_sources) stamp-gdkenumtypes.h
EXTRA_DIST += $(gdk_built_sources)
@ -309,7 +309,7 @@ EXTRA_HEADERS =
install-exec-hook:
if DISABLE_EXPLICIT_DEPS
$(SHELL) $(top_srcdir)/sanitize-la.sh $(DESTDIR)$(libdir)/libgdk-3.0.la
$(SHELL) $(top_srcdir)/sanitize-la.sh $(DESTDIR)$(libdir)/libgdk-3.la
endif
#note: not gdkconfig.h
@ -353,7 +353,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_3_0_la_SOURCES); do \
for F in $(libgdk_3_la_SOURCES); do \
case $$F in \
*.c) echo ' <File RelativePath="..\..\..\gdk\'$$F'" />' \
;; \

View File

@ -1,5 +1,5 @@
#! /bin/sh
cpp -P -DGDK_WINDOWING_X11 ${srcdir:-.}/gdk.symbols | sed -e '/^$/d' -e 's/ G_GNUC.*$//' | sort | uniq > expected-abi
nm -D -g --defined-only .libs/libgdk-3.0.so | cut -d ' ' -f 3 | egrep -v '^(__bss_start|_edata|_end)' | sort > actual-abi
nm -D -g --defined-only .libs/libgdk-3.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

View File

@ -54,27 +54,7 @@
* The #GDK_WINDOWING_X11 macro is defined if the X11 backend
* is supported.
*
* Use this macro to guard code that is specific to the X11-backend.
* Since GDK may be configured with multiple backends, an additional
* runtime check for the used backend is recommended:
*
* |[
* #ifdef GDK_WINDOWING_X11
* if (GDK_IS_X11_DISPLAY (display))
* {
* /&ast; make X11-specific calls here &ast;/
* }
* else
* #endif
* #ifdef GDK_WINDOWING_QUARTZ
* if (GDK_IS_QUARTZ_DISPLAY (display))
* {
* /&ast; make Quartz-specific calls here &ast/
* }
* else
* #endif
* g_error ("Unsupported GDK backend");
* ]|
* Use this macro to guard code that is specific to the X11 backend.
*/
/**
@ -82,6 +62,8 @@
*
* The #GDK_WINDOWING_WIN32 macro is defined if the Win32 backend
* is supported.
*
* Use this macro to guard code that is specific to the Win32 backend.
*/
/**
@ -89,6 +71,8 @@
*
* The #GDK_WINDOWING_QUARTZ macro is defined if the Quartz backend
* is supported.
*
* Use this macro to guard code that is specific to the Quartz backend.
*/
typedef struct _GdkPredicate GdkPredicate;

View File

@ -8,7 +8,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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
@ -27,17 +27,18 @@
/**
* SECTION:cairo_interaction
* @Short_description: Functions to support using Cairo
* @Short_description: Functions to support using cairo
* @Title: Cairo Interaction
*
* <link href="http://cairographics.org">Cairo</link> is a graphics
* library that supports vector graphics and image compositing that
* can be used with GDK. GTK+ does all of its drawing using Cairo.
* can be used with GDK. GTK+ does all of its drawing using cairo.
*
* GDK does not wrap the Cairo API, instead it allows to create Cairo
* GDK does not wrap the cairo API, instead it allows to create cairo
* contexts which can be used to draw on #GdkWindows. Additional
* functions allow use #GdkRectangles with cairo and to use #GdkColors,
* #GdkPixbufs and #GdkWindows as sources for drawing operations.
* #GdkRGBAs, #GdkPixbufs and #GdkWindows as sources for drawing
* operations.
*/
@ -46,13 +47,13 @@
* @cr: a cairo context
* @rect: (out) (allow-none): return location for the clip, or %NULL
*
* This is a convenience function around cairo_clip_extents(). It rounds
* the clip extents to integer coordinates and returns a boolean
* indicating if a clip area exists.
* This is a convenience function around cairo_clip_extents().
* It rounds the clip extents to integer coordinates and returns
* a boolean indicating if a clip area exists.
*
* Returns: %TRUE if a clip rectangle exists, %FALSE if all of @cr is
* clipped and all drawing can be skipped.
**/
* clipped and all drawing can be skipped
*/
gboolean
gdk_cairo_get_clip_rectangle (cairo_t *cr,
GdkRectangle *rect)
@ -82,35 +83,35 @@ gdk_cairo_get_clip_rectangle (cairo_t *cr,
/**
* gdk_cairo_set_source_color:
* @cr: a #cairo_t
* @cr: a cairo context
* @color: a #GdkColor
*
* Sets the specified #GdkColor as the source color of @cr.
*
* Since: 2.8
**/
*/
void
gdk_cairo_set_source_color (cairo_t *cr,
const GdkColor *color)
const GdkColor *color)
{
g_return_if_fail (cr != NULL);
g_return_if_fail (color != NULL);
cairo_set_source_rgb (cr,
color->red / 65535.,
color->green / 65535.,
color->blue / 65535.);
color->red / 65535.,
color->green / 65535.,
color->blue / 65535.);
}
/**
* gdk_cairo_set_source_rgba:
* @cr: a #cairo_t
* @cr: a cairo context
* @rgba: a #GdkRGBA
*
* Sets the specified #GdkRGBA as the source color of @cr.
*
* Since: 3.0
**/
*/
void
gdk_cairo_set_source_rgba (cairo_t *cr,
const GdkRGBA *rgba)
@ -127,37 +128,37 @@ gdk_cairo_set_source_rgba (cairo_t *cr,
/**
* gdk_cairo_rectangle:
* @cr: a #cairo_t
* @cr: a cairo context
* @rectangle: a #GdkRectangle
*
*
* Adds the given rectangle to the current path of @cr.
*
* Since: 2.8
**/
*/
void
gdk_cairo_rectangle (cairo_t *cr,
const GdkRectangle *rectangle)
const GdkRectangle *rectangle)
{
g_return_if_fail (cr != NULL);
g_return_if_fail (rectangle != NULL);
cairo_rectangle (cr,
rectangle->x, rectangle->y,
rectangle->width, rectangle->height);
rectangle->x, rectangle->y,
rectangle->width, rectangle->height);
}
/**
* gdk_cairo_region:
* @cr: a #cairo_t
* @cr: a cairo context
* @region: a #cairo_region_t
*
*
* Adds the given region to the current path of @cr.
*
* Since: 2.8
**/
*/
void
gdk_cairo_region (cairo_t *cr,
const cairo_region_t *region)
const cairo_region_t *region)
{
cairo_rectangle_int_t box;
gint n_boxes, i;
@ -176,22 +177,23 @@ gdk_cairo_region (cairo_t *cr,
/**
* gdk_cairo_set_source_pixbuf:
* @cr: a #Cairo context
* @cr: a cairo context
* @pixbuf: a #GdkPixbuf
* @pixbuf_x: X coordinate of location to place upper left corner of @pixbuf
* @pixbuf_y: Y coordinate of location to place upper left corner of @pixbuf
*
* Sets the given pixbuf as the source pattern for the Cairo context.
*
* Sets the given pixbuf as the source pattern for @cr.
*
* The pattern has an extend mode of %CAIRO_EXTEND_NONE and is aligned
* so that the origin of @pixbuf is @pixbuf_x, @pixbuf_y
* so that the origin of @pixbuf is @pixbuf_x, @pixbuf_y.
*
* Since: 2.8
**/
*/
void
gdk_cairo_set_source_pixbuf (cairo_t *cr,
const GdkPixbuf *pixbuf,
double pixbuf_x,
double pixbuf_y)
const GdkPixbuf *pixbuf,
gdouble pixbuf_x,
gdouble pixbuf_y)
{
gint width = gdk_pixbuf_get_width (pixbuf);
gint height = gdk_pixbuf_get_height (pixbuf);
@ -217,7 +219,7 @@ gdk_cairo_set_source_pixbuf (cairo_t *cr,
width, height, cairo_stride);
cairo_surface_set_user_data (surface, &key,
cairo_pixels, (cairo_destroy_func_t)g_free);
cairo_pixels, (cairo_destroy_func_t)g_free);
for (j = height; j; j--)
{
@ -225,51 +227,51 @@ gdk_cairo_set_source_pixbuf (cairo_t *cr,
guchar *q = cairo_pixels;
if (n_channels == 3)
{
guchar *end = p + 3 * width;
while (p < end)
{
{
guchar *end = p + 3 * width;
while (p < end)
{
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
q[0] = p[2];
q[1] = p[1];
q[2] = p[0];
#else
q[1] = p[0];
q[2] = p[1];
q[3] = p[2];
q[0] = p[2];
q[1] = p[1];
q[2] = p[0];
#else
q[1] = p[0];
q[2] = p[1];
q[3] = p[2];
#endif
p += 3;
q += 4;
}
}
p += 3;
q += 4;
}
}
else
{
guchar *end = p + 4 * width;
guint t1,t2,t3;
{
guchar *end = p + 4 * width;
guint t1,t2,t3;
#define MULT(d,c,a,t) G_STMT_START { t = c * a + 0x7f; d = ((t >> 8) + t) >> 8; } G_STMT_END
while (p < end)
{
while (p < end)
{
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
MULT(q[0], p[2], p[3], t1);
MULT(q[1], p[1], p[3], t2);
MULT(q[2], p[0], p[3], t3);
q[3] = p[3];
#else
q[0] = p[3];
MULT(q[1], p[0], p[3], t1);
MULT(q[2], p[1], p[3], t2);
MULT(q[3], p[2], p[3], t3);
MULT(q[0], p[2], p[3], t1);
MULT(q[1], p[1], p[3], t2);
MULT(q[2], p[0], p[3], t3);
q[3] = p[3];
#else
q[0] = p[3];
MULT(q[1], p[0], p[3], t1);
MULT(q[2], p[1], p[3], t2);
MULT(q[3], p[2], p[3], t3);
#endif
p += 4;
q += 4;
}
p += 4;
q += 4;
}
#undef MULT
}
}
gdk_pixels += gdk_rowstride;
cairo_pixels += cairo_stride;
@ -281,12 +283,13 @@ gdk_cairo_set_source_pixbuf (cairo_t *cr,
/**
* gdk_cairo_set_source_window:
* @cr: a #Cairo context
* @cr: a cairo context
* @window: a #GdkWindow
* @x: X coordinate of location to place upper left corner of @window
* @y: Y coordinate of location to place upper left corner of @window
*
* Sets the given window as the source pattern for the Cairo context.
* Sets the given window as the source pattern for @cr.
*
* The pattern has an extend mode of %CAIRO_EXTEND_NONE and is aligned
* so that the origin of @window is @x, @y. The window contains all its
* subwindows when rendering.
@ -299,11 +302,11 @@ gdk_cairo_set_source_pixbuf (cairo_t *cr,
void
gdk_cairo_set_source_window (cairo_t *cr,
GdkWindow *window,
double x,
double y)
gdouble x,
gdouble y)
{
cairo_surface_t *surface;
g_return_if_fail (cr != NULL);
g_return_if_fail (GDK_IS_WINDOW (window));
@ -312,23 +315,24 @@ gdk_cairo_set_source_window (cairo_t *cr,
cairo_surface_destroy (surface);
}
/**
/*
* _gdk_cairo_surface_extents:
* @surface: surface to measure
* @extents: (out): rectangle to put the extents
*
* Measures the area covered by @surface and puts it into @extents.
*
* Note that this function respects device offsets set on @surface.
* if @surface is unbounded, the resulting extents will be empty and
* If @surface is unbounded, the resulting extents will be empty and
* not be a maximal sized rectangle. This is to avoid careless coding.
* You must explicitly check the return value of you want to handle
* that case.
*
* Returns: %TRUE if the extents fit in a #GdkRectangle, %FALSE if not.
**/
* Returns: %TRUE if the extents fit in a #GdkRectangle, %FALSE if not
*/
gboolean
_gdk_cairo_surface_extents (cairo_surface_t *surface,
GdkRectangle *extents)
GdkRectangle *extents)
{
double x1, x2, y1, y2;
cairo_t *cr;
@ -346,7 +350,7 @@ _gdk_cairo_surface_extents (cairo_surface_t *surface,
y2 = ceil (y2);
x2 -= x1;
y2 -= y1;
if (x1 < G_MININT || x1 > G_MAXINT ||
y1 < G_MININT || y1 > G_MAXINT ||
x2 > G_MAXINT || y2 > G_MAXINT)
@ -371,14 +375,15 @@ _gdk_cairo_surface_extents (cairo_surface_t *surface,
*/
/**
* gdk_cairo_region_create_from_surface:
* @surface: A surface
* @surface: a cairo surface
*
* Creates region that describes covers the area where the given @surface
* is more than 50% opaque. This function takes into account device
* offsets that might be set with cairo_surface_set_device_offset().
* Creates region that describes covers the area where the given
* @surface is more than 50% opaque.
*
* Returns: A #cairo_region_t. This must be freed with cairo_region_destroy()
* when you are done.
* This function takes into account device offsets that might be
* set with cairo_surface_set_device_offset().
*
* Returns: A #cairo_region_t; must be freed with cairo_region_destroy()
*/
cairo_region_t *
gdk_cairo_region_create_from_surface (cairo_surface_t *surface)
@ -417,37 +422,36 @@ gdk_cairo_region_create_from_surface (cairo_surface_t *surface)
for (y = 0; y < extents.height; y++)
{
for (x = 0; x < extents.width; x++)
{
/* Search for a continuous range of "non transparent pixels"*/
gint x0 = x;
while (x < extents.width)
{
if (((data[x / 8] >> (x%8)) & 1) == 0)
/* This pixel is "transparent"*/
break;
x++;
}
if (x > x0)
{
/* Add the pixels (x0, y) to (x, y+1) as a new rectangle
* in the region
*/
{
/* Search for a continuous range of "non transparent pixels"*/
gint x0 = x;
while (x < extents.width)
{
if (((data[x / 8] >> (x%8)) & 1) == 0)
/* This pixel is "transparent"*/
break;
x++;
}
if (x > x0)
{
/* Add the pixels (x0, y) to (x, y+1) as a new rectangle
* in the region
*/
rect.x = x0;
rect.width = x - x0;
rect.y = y;
rect.height = 1;
cairo_region_union_rectangle (region, &rect);
}
}
}
}
data += stride;
}
cairo_surface_destroy (image);
cairo_region_translate (region, extents.x, extents.y);
return region;
}

View File

@ -31,31 +31,31 @@
G_BEGIN_DECLS
cairo_t *gdk_cairo_create (GdkWindow *window);
gboolean gdk_cairo_get_clip_rectangle(cairo_t *cr,
GdkRectangle *rect);
cairo_t * gdk_cairo_create (GdkWindow *window);
gboolean gdk_cairo_get_clip_rectangle (cairo_t *cr,
GdkRectangle *rect);
void gdk_cairo_set_source_color (cairo_t *cr,
const GdkColor *color);
void gdk_cairo_set_source_rgba (cairo_t *cr,
const GdkRGBA *rgba);
void gdk_cairo_set_source_pixbuf (cairo_t *cr,
const GdkPixbuf *pixbuf,
double pixbuf_x,
double pixbuf_y);
void gdk_cairo_set_source_window (cairo_t *cr,
GdkWindow *window,
double x,
double y);
void gdk_cairo_set_source_color (cairo_t *cr,
const GdkColor *color);
void gdk_cairo_set_source_rgba (cairo_t *cr,
const GdkRGBA *rgba);
void gdk_cairo_set_source_pixbuf (cairo_t *cr,
const GdkPixbuf *pixbuf,
gdouble pixbuf_x,
gdouble pixbuf_y);
void gdk_cairo_set_source_window (cairo_t *cr,
GdkWindow *window,
gdouble x,
gdouble y);
void gdk_cairo_rectangle (cairo_t *cr,
const GdkRectangle *rectangle);
void gdk_cairo_region (cairo_t *cr,
const cairo_region_t *region);
void gdk_cairo_rectangle (cairo_t *cr,
const GdkRectangle *rectangle);
void gdk_cairo_region (cairo_t *cr,
const cairo_region_t *region);
cairo_region_t *
gdk_cairo_region_create_from_surface
(cairo_surface_t *surface);
gdk_cairo_region_create_from_surface
(cairo_surface_t *surface);
G_END_DECLS

View File

@ -37,23 +37,29 @@
* SECTION:colors
* @Short_description: Manipulation of colors
* @Title: Colors
*
* A #GdkColor represents a color.
*
* When working with cairo, it is often more convenient
* to use a #GdkRGBA instead.
*/
/**
* gdk_color_copy:
* @color: a #GdkColor.
*
* Makes a copy of a color structure. The result
* must be freed using gdk_color_free().
*
* Return value: a copy of @color.
**/
* @color: a #GdkColor
*
* Makes a copy of a color structure.
*
* The result must be freed using gdk_color_free().
*
* Return value: a copy of @color
*/
GdkColor*
gdk_color_copy (const GdkColor *color)
{
GdkColor *new_color;
g_return_val_if_fail (color != NULL, NULL);
new_color = g_slice_new (GdkColor);
@ -63,11 +69,10 @@ gdk_color_copy (const GdkColor *color)
/**
* gdk_color_free:
* @color: a #GdkColor.
*
* Frees a color structure created with
* gdk_color_copy().
**/
* @color: a #GdkColor
*
* Frees a color structure created with gdk_color_copy().
*/
void
gdk_color_free (GdkColor *color)
{
@ -78,41 +83,41 @@ gdk_color_free (GdkColor *color)
/**
* gdk_color_hash:
* @colora: a #GdkColor.
*
* @color: a #GdkColor
*
* A hash function suitable for using for a hash
* table that stores #GdkColor's.
*
* Return value: The hash function applied to @colora
**/
* table that stores #GdkColors.
*
* Return value: The hash function applied to @color
*/
guint
gdk_color_hash (const GdkColor *colora)
gdk_color_hash (const GdkColor *color)
{
return ((colora->red) +
(colora->green << 11) +
(colora->blue << 22) +
(colora->blue >> 6));
return ((color->red) +
(color->green << 11) +
(color->blue << 22) +
(color->blue >> 6));
}
/**
* gdk_color_equal:
* @colora: a #GdkColor.
* @colorb: another #GdkColor.
*
* Compares two colors.
*
* @colora: a #GdkColor
* @colorb: another #GdkColor
*
* Compares two colors.
*
* Return value: %TRUE if the two colors compare equal
**/
*/
gboolean
gdk_color_equal (const GdkColor *colora,
const GdkColor *colorb)
const GdkColor *colorb)
{
g_return_val_if_fail (colora != NULL, FALSE);
g_return_val_if_fail (colorb != NULL, FALSE);
return ((colora->red == colorb->red) &&
(colora->green == colorb->green) &&
(colora->blue == colorb->blue));
(colora->green == colorb->green) &&
(colora->blue == colorb->blue));
}
G_DEFINE_BOXED_TYPE (GdkColor, gdk_color,
@ -121,25 +126,28 @@ G_DEFINE_BOXED_TYPE (GdkColor, gdk_color,
/**
* gdk_color_parse:
* @spec: the string specifying the color.
* @spec: the string specifying the color
* @color: (out): the #GdkColor to fill in
*
* Parses a textual specification of a color and fill in the
* <structfield>red</structfield>, <structfield>green</structfield>,
* and <structfield>blue</structfield> fields of a #GdkColor
* structure. The string can either one of a large set of standard
* names. (Taken from the X11 <filename>rgb.txt</filename> file), or
* structure.
*
* The string can either one of a large set of standard names
* (taken from the X11 <filename>rgb.txt</filename> file), or
* it can be a hex value in the form '&num;rgb' '&num;rrggbb'
* '&num;rrrgggbbb' or '&num;rrrrggggbbbb' where 'r', 'g' and 'b' are
* hex digits of the red, green, and blue components of the color,
* respectively. (White in the four forms is '&num;fff' '&num;ffffff'
* '&num;fffffffff' and '&num;ffffffffffff')
*
* Return value: %TRUE if the parsing succeeded.
**/
* '&num;rrrgggbbb' or '&num;rrrrggggbbbb' where 'r', 'g' and
* 'b' are hex digits of the red, green, and blue components
* of the color, respectively. (White in the four forms is
* '&num;fff', '&num;ffffff', '&num;fffffffff' and
* '&num;ffffffffffff').
*
* Return value: %TRUE if the parsing succeeded
*/
gboolean
gdk_color_parse (const gchar *spec,
GdkColor *color)
GdkColor *color)
{
PangoColor pango_color;
@ -164,10 +172,12 @@ gdk_color_parse (const gchar *spec,
* <literal>g</literal> and <literal>b</literal> are hex digits
* representing the red, green and blue components respectively.
*
* The returned string can be parsed by gdk_color_parse().
*
* Return value: a newly-allocated text string
*
* Since: 2.12
**/
*/
gchar *
gdk_color_to_string (const GdkColor *color)
{

View File

@ -39,16 +39,16 @@ G_BEGIN_DECLS
/**
* GdkColor:
* @pixel: For allocated colors, the value used to
* draw this color on the screen.
* @pixel: For allocated colors, the pixel value used to
* draw this color on the screen. Not used anymore.
* @red: The red component of the color. This is
* a value between 0 and 65535, with 65535 indicating
* full intensitiy.
* @green: The green component of the color.
* @blue: The blue component of the color.
* a value between 0 and 65535, with 65535 indicating
* full intensitiy
* @green: The green component of the color
* @blue: The blue component of the color
*
* The #GdkColor structure is used to describe an
* allocated or unallocated color.
* The #GdkColor structure is used to describe a color,
* similar to the XColor struct used in the X11 drawing API.
*/
struct _GdkColor
{
@ -58,18 +58,20 @@ struct _GdkColor
guint16 blue;
};
#define GDK_TYPE_COLOR (gdk_color_get_type ())
#define GDK_TYPE_COLOR (gdk_color_get_type ())
GType gdk_color_get_type (void) G_GNUC_CONST;
GdkColor *gdk_color_copy (const GdkColor *color);
void gdk_color_free (GdkColor *color);
gboolean gdk_color_parse (const gchar *spec,
GdkColor *color);
guint gdk_color_hash (const GdkColor *colora);
gboolean gdk_color_equal (const GdkColor *colora,
const GdkColor *colorb);
gchar * gdk_color_to_string (const GdkColor *color);
GType gdk_color_get_type (void) G_GNUC_CONST;
guint gdk_color_hash (const GdkColor *color);
gboolean gdk_color_equal (const GdkColor *colora,
const GdkColor *colorb);
gboolean gdk_color_parse (const gchar *spec,
GdkColor *color);
gchar * gdk_color_to_string (const GdkColor *color);
G_END_DECLS

View File

@ -1,31 +1,22 @@
/* gdkconfig.h
*
* This is a pre-generated file.
* This is a generated file. Please modify `configure.ac'
*/
#ifndef GDKCONFIG_H
#define GDKCONFIG_H
#ifndef __GDKCONFIG_H__
#define __GDKCONFIG_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
#error "Only <gdk/gdk.h> can be included directly."
#endif
#include <glib.h>
G_BEGIN_DECLS
#ifndef GSEAL
/* introduce GSEAL() here for all of Gdk and Gtk+ without the need to modify GLib */
# ifdef GSEAL_ENABLE
# define GSEAL(ident) _g_sealed__ ## ident
# else
# define GSEAL(ident) ident
# endif
#endif /* !GSEAL */
#define GDK_WINDOWING_WIN32
#define GDK_HAVE_WCHAR_H 1
#define GDK_HAVE_WCTYPE_H 1
G_END_DECLS
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* GDKCONFIG_H */
#endif /* __GDKCONFIG_H__ */

View File

@ -32,7 +32,8 @@
* @Title: GdkDevice
* @See_also: #GdkDeviceManager
*
* The #GdkDevice object represents a single input device.
* The #GdkDevice object represents a single input device, such
* as a keyboard, a mouse, a touchpad, etc.
*
* See the #GdkDeviceManager documentation for more information
* about the various kinds of master and slave devices, and their
@ -48,7 +49,6 @@ struct _GdkAxisInfo
gdouble min_axis;
gdouble max_axis;
gdouble min_value;
gdouble max_value;
gdouble resolution;

View File

@ -99,7 +99,7 @@ typedef enum
* @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_YTILT: the axis is used for y tilt information.
* @GDK_AXIS_WHEEL: the axis is used for wheel information.
* @GDK_AXIS_LAST: a constant equal to the numerically highest axis value.
*

View File

@ -38,26 +38,32 @@
/**
* SECTION:gdkdisplay
* @Short_description: Controls the keyboard/mouse pointer grabs and a set of <type>GdkScreen</type>s
* @Short_description: Controls a set of GdkScreens and their associated input devices
* @Title: GdkDisplay
*
* #GdkDisplay objects purpose are two fold:
* <itemizedlist>
* <listitem><para>
* To grab/ungrab keyboard focus and mouse pointer
* </para></listitem>
* <listitem><para>
* To manage and provide information about the #GdkScreen(s)
* available for this #GdkDisplay
* </para></listitem>
* <listitem>
* To manage and provide information about input devices (pointers
* and keyboards)
* </listitem>
* <listitem>
* To manage and provide information about the available #GdkScreens
* </listitem>
* </itemizedlist>
*
* #GdkDisplay objects are the GDK representation of the X Display which can be
* described as <emphasis>a workstation consisting of a keyboard a pointing
* device (such as a mouse) and one or more screens</emphasis>.
* It is used to open and keep track of various #GdkScreen objects currently
* instanciated by the application. It is also used to grab and release the keyboard
* and the mouse pointer.
* GdkDisplay objects are the GDK representation of an X Display,
* which can be described as <emphasis>a workstation consisting of
* a keyboard, a pointing device (such as a mouse) and one or more
* screens</emphasis>.
* It is used to open and keep track of various GdkScreen objects
* currently instantiated by the application. It is also used to
* access the keyboard(s) and mouse pointer(s) of the display.
*
* Most of the input device handling has been factored out into
* the separate #GdkDeviceManager object. Every display has a
* device manager, which you can obtain using
* gdk_display_get_device_manager().
*/
@ -1536,7 +1542,7 @@ gdk_display_supports_clipboard_persistence (GdkDisplay *display)
* @display: a #GdkDisplay
* @clipboard_window: a #GdkWindow belonging to the clipboard owner
* @time_: a timestamp
* @targets: (array length=n_targets): an array of targets
* @targets: (array length=n_targets): an array of targets
* that should be saved, or %NULL
* if all available targets should be saved.
* @n_targets: length of the @targets array

View File

@ -60,6 +60,43 @@
* The purpose of the #GdkDisplayManager singleton object is to offer
* notification when displays appear or disappear or the default display
* changes.
*
* You can use gdk_display_manager_get() to obtain the GdkDisplayManager
* singleton, but that should be rarely necessary. Typically, initializing
* GTK+ opens a display that you can work with without ever accessing the
* GdkDisplayManager.
*
* The GDK library can be built with support for multiple backends.
* The GdkDisplayManager object determines which backend is used
* at runtime.
*
* When writing backend-specific code that is supposed to work with
* multiple GDK backends, you have to consider both compile time and
* runtime. At compile time, use the #GDK_WINDOWING_X11, #GDK_WINDOWING_WIN32
* macros, etc. to find out which backends are present in the GDK library
* you are building your application against. At runtime, use type-check
* macros like GDK_IS_X11_DISPLAY() to find out which backend is in use:
*
* <example id="backend-specific">
* <title>Backend-specific code</title>
* <programlisting>
* #ifdef GDK_WINDOWING_X11
* if (GDK_IS_X11_DISPLAY (display))
* {
* /&ast; make X11-specific calls here &ast;/
* }
* else
* #endif
* #ifdef GDK_WINDOWING_QUARTZ
* if (GDK_IS_QUARTZ_DISPLAY (display))
* {
* /&ast; make Quartz-specific calls here &ast;/
* }
* else
* #endif
* g_error ("Unsupported GDK backend");
* </programlisting>
* </example>
*/
@ -172,9 +209,9 @@ gdk_display_manager_get_property (GObject *object,
* Gets the singleton #GdkDisplayManager object.
*
* When called for the first time, this function consults the
* <envar>GDK_BACKEND</envar> to find out which of the supported
* GDK backends to use (in case GDK has been compiled with multiple
* backends).
* <envar>GDK_BACKEND</envar> environment variable to find out which
* of the supported GDK backends to use (in case GDK has been compiled
* with multiple backends).
*
* Returns: (transfer none): The global #GdkDisplayManager singleton;
* gdk_parse_args(), gdk_init(), or gdk_init_check() must have
@ -192,11 +229,6 @@ gdk_display_manager_get (void)
const gchar *backend;
backend = g_getenv ("GDK_BACKEND");
#ifdef GDK_WINDOWING_X11
if (backend == NULL || strcmp (backend, "x11") == 0)
manager = g_object_new (gdk_x11_display_manager_get_type (), NULL);
else
#endif
#ifdef GDK_WINDOWING_QUARTZ
if (backend == NULL || strcmp (backend, "quartz") == 0)
manager = g_object_new (gdk_quartz_display_manager_get_type (), NULL);
@ -211,6 +243,11 @@ gdk_display_manager_get (void)
if (backend == NULL || strcmp (backend, "wayland") == 0)
manager = g_object_new (gdk_wayland_display_manager_get_type (), NULL);
else
#endif
#ifdef GDK_WINDOWING_X11
if (backend == NULL || strcmp (backend, "x11") == 0)
manager = g_object_new (gdk_x11_display_manager_get_type (), NULL);
else
#endif
if (backend != NULL)
g_error ("Unsupported GDK backend: %s", backend);

View File

@ -34,12 +34,14 @@
/**
* SECTION:pixbufs
* @Short_description: Functions for rendering pixbufs on drawables
* @Short_description: Functions for obtaining pixbufs
* @Title: Pixbufs
*
* These functions allow to render pixbufs on drawables. Pixbufs are
* client-side images. For details on how to create and manipulate
* pixbufs, see the #GdkPixbuf API documentation.
* Pixbufs are client-side images. For details on how to create
* and manipulate pixbufs, see the #GdkPixbuf API documentation.
*
* The functions described here allow to obtain pixbufs from
* #GdkWindows and cairo surfaces.
*/
@ -55,7 +57,7 @@
* representation inside a #GdkPixbuf. In other words, copies
* image data from a server-side drawable to a client-side RGB(A) buffer.
* This allows you to efficiently read individual pixels on the client side.
*
*
* This function will create an RGB pixbuf with 8 bits per channel with
* the same size specified by the @width and @height arguments. The pixbuf
* will contain an alpha channel if the @window contains one.
@ -78,16 +80,18 @@
* it returns %NULL; so check the return value.)
*
* Return value: (transfer full): A newly-created pixbuf with a reference
* count of 1, or %NULL on error
**/
* count of 1, or %NULL on error
*/
GdkPixbuf *
gdk_pixbuf_get_from_window (GdkWindow *src,
int src_x, int src_y,
int width, int height)
gdk_pixbuf_get_from_window (GdkWindow *src,
gint src_x,
gint src_y,
gint width,
gint height)
{
cairo_surface_t *surface;
GdkPixbuf *dest;
g_return_val_if_fail (GDK_IS_WINDOW (src), NULL);
g_return_val_if_fail (gdk_window_is_viewable (src), NULL);
@ -99,7 +103,7 @@ gdk_pixbuf_get_from_window (GdkWindow *src,
return dest;
}
static cairo_format_t
gdk_cairo_format_for_content (cairo_content_t content)
{
@ -117,11 +121,11 @@ gdk_cairo_format_for_content (cairo_content_t content)
static cairo_surface_t *
gdk_cairo_surface_coerce_to_image (cairo_surface_t *surface,
cairo_content_t content,
int src_x,
int src_y,
int width,
int height)
cairo_content_t content,
int src_x,
int src_y,
int width,
int height)
{
cairo_surface_t *copy;
cairo_t *cr;
@ -140,14 +144,14 @@ gdk_cairo_surface_coerce_to_image (cairo_surface_t *surface,
}
static void
convert_alpha (guchar *dest_data,
int dest_stride,
guchar *src_data,
int src_stride,
int src_x,
int src_y,
int width,
int height)
convert_alpha (guchar *dest_data,
int dest_stride,
guchar *src_data,
int src_stride,
int src_x,
int src_y,
int width,
int height)
{
int x, y;
@ -180,14 +184,14 @@ convert_alpha (guchar *dest_data,
}
static void
convert_no_alpha (guchar *dest_data,
int dest_stride,
guchar *src_data,
int src_stride,
int src_x,
int src_y,
int width,
int height)
convert_no_alpha (guchar *dest_data,
int dest_stride,
guchar *src_data,
int src_stride,
int src_x,
int src_y,
int width,
int height)
{
int x, y;
@ -220,22 +224,22 @@ convert_no_alpha (guchar *dest_data,
* individual pixels from cairo surfaces. For #GdkWindows, use
* gdk_pixbuf_get_from_window() instead.
*
* This function will create an RGB pixbuf with 8 bits per channel. The pixbuf
* will contain an alpha channel if the @surface contains one.
* This function will create an RGB pixbuf with 8 bits per channel.
* The pixbuf will contain an alpha channel if the @surface contains one.
*
* Return value: (transfer full): A newly-created pixbuf with a reference count
* of 1, or %NULL on error
**/
* Return value: (transfer full): A newly-created pixbuf with a reference
* count of 1, or %NULL on error
*/
GdkPixbuf *
gdk_pixbuf_get_from_surface (cairo_surface_t *surface,
int src_x,
int src_y,
int width,
int height)
gint src_x,
gint src_y,
gint width,
gint height)
{
cairo_content_t content;
GdkPixbuf *dest;
/* General sanity checks */
g_return_val_if_fail (surface != NULL, NULL);
g_return_val_if_fail (width > 0 && height > 0, NULL);
@ -246,7 +250,8 @@ gdk_pixbuf_get_from_surface (cairo_surface_t *surface,
8,
width, height);
surface = gdk_cairo_surface_coerce_to_image (surface, content, src_x, src_y,
surface = gdk_cairo_surface_coerce_to_image (surface, content,
src_x, src_y,
width, height);
cairo_surface_flush (surface);
if (cairo_surface_status (surface) || dest == NULL)
@ -273,4 +278,3 @@ gdk_pixbuf_get_from_surface (cairo_surface_t *surface,
cairo_surface_destroy (surface);
return dest;
}

View File

@ -37,18 +37,17 @@
G_BEGIN_DECLS
/* Fetching a region from a drawable */
GdkPixbuf *gdk_pixbuf_get_from_window (GdkWindow *window,
int src_x,
int src_y,
int width,
int height);
GdkPixbuf *gdk_pixbuf_get_from_window (GdkWindow *window,
gint src_x,
gint src_y,
gint width,
gint height);
GdkPixbuf *gdk_pixbuf_get_from_surface (cairo_surface_t *surface,
int src_x,
int src_y,
int width,
int height);
GdkPixbuf *gdk_pixbuf_get_from_surface (cairo_surface_t *surface,
gint src_x,
gint src_y,
gint width,
gint height);
G_END_DECLS

View File

@ -34,7 +34,7 @@
* @Title: RGBA Colors
*
* The #GdkRGBA struct is a convenient way to pass rgba colors around.
* It's based on cairo's way to deal with colors and mirros its behavior.
* It's based on cairo's way to deal with colors and mirrors its behavior.
* All values are in the range from 0.0 to 1.0 inclusive. So the color
* (0.0, 0.0, 0.0, 0.0) represents transparent black and
* (1.0, 1.0, 1.0, 1.0) is opaque white. Other values will be clamped
@ -46,28 +46,28 @@ G_DEFINE_BOXED_TYPE (GdkRGBA, gdk_rgba,
/**
* GdkRGBA:
* @red: The intensity of the red channel from 0.0 to 1.0 inclusive.
* @green: The intensity of the green channel from 0.0 to 1.0 inclusive.
* @blue: The intensity of the blue channel from 0.0 to 1.0 inclusive.
* @red: The intensity of the red channel from 0.0 to 1.0 inclusive
* @green: The intensity of the green channel from 0.0 to 1.0 inclusive
* @blue: The intensity of the blue channel from 0.0 to 1.0 inclusive
* @alpha: The opacity of the color from 0.0 for completely translucent to
* 1.0 for opaque.
* 1.0 for opaque
*
* The GdkRGBA structure is used to pass around color data. When using it
* as struct members or on the stack, you want to use the struct directly
* and not allocate it.
* The GdkRGBA structure is used to represent a (possibly translucent)
* color, in a way that is compatible with cairos notion of color.
*/
/**
* gdk_rgba_copy:
* @rgba: a #GdkRGBA
*
* Makes a copy of a #GdkRGBA structure, the result must be freed
* through gdk_rgba_free().
* Makes a copy of a #GdkRGBA structure.
*
* Returns: A newly allocated #GdkRGBA
* The result must be freed through gdk_rgba_free().
*
* Returns: A newly allocated #GdkRGBA, with the same contents as @rgba
*
* Since: 3.0
**/
*/
GdkRGBA *
gdk_rgba_copy (const GdkRGBA *rgba)
{
@ -89,7 +89,7 @@ gdk_rgba_copy (const GdkRGBA *rgba)
* Frees a #GdkRGBA struct created with gdk_rgba_copy()
*
* Since: 3.0
**/
*/
void
gdk_rgba_free (GdkRGBA *rgba)
{
@ -111,7 +111,7 @@ gdk_rgba_free (GdkRGBA *rgba)
*/
static double
parse_rgb_value (const char *str,
char **endp)
char **endp)
{
double number;
const char *p;
@ -168,7 +168,7 @@ parse_rgb_value (const char *str,
* Returns: %TRUE if the parsing succeeded
*
* Since: 3.0
**/
*/
gboolean
gdk_rgba_parse (GdkRGBA *rgba,
const gchar *spec)
@ -193,7 +193,8 @@ gdk_rgba_parse (GdkRGBA *rgba,
PangoColor pango_color;
/* Resort on PangoColor for rgb.txt color
* map and '#' prefixed colors */
* map and '#' prefixed colors
*/
if (pango_color_parse (&pango_color, str))
{
if (rgba)
@ -272,37 +273,37 @@ gdk_rgba_parse (GdkRGBA *rgba,
/**
* gdk_rgba_hash:
* @p: (type GdkRGBA): a #GdkRGBA pointer.
* @p: (type GdkRGBA): a #GdkRGBA pointer
*
* A hash function suitable for using for a hash
* table that stores #GdkRGBA<!-- -->s.
* table that stores #GdkRGBAs.
*
* Return value: The hash function applied to @p
* Return value: The hash value for @p
*
* Since: 3.0
**/
*/
guint
gdk_rgba_hash (gconstpointer p)
{
const GdkRGBA *rgba = p;
return ((guint) (rgba->red * 65535) +
((guint) (rgba->green * 65535) << 11) +
((guint) (rgba->blue * 65535) << 22) +
((guint) (rgba->alpha * 65535) >> 6));
((guint) (rgba->green * 65535) << 11) +
((guint) (rgba->blue * 65535) << 22) +
((guint) (rgba->alpha * 65535) >> 6));
}
/**
* gdk_rgba_equal:
* @p1: (type GdkRGBA): a #GdkRGBA pointer.
* @p2: (type GdkRGBA): another #GdkRGBA pointer.
* @p1: (type GdkRGBA): a #GdkRGBA pointer
* @p2: (type GdkRGBA): another #GdkRGBA pointer
*
* Compares two RGBA colors.
*
* Return value: %TRUE if the two colors compare equal
*
* Since: 3.0
**/
*/
gboolean
gdk_rgba_equal (gconstpointer p1,
gconstpointer p2)
@ -325,27 +326,35 @@ gdk_rgba_equal (gconstpointer p1,
* gdk_rgba_to_string:
* @rgba: a #GdkRGBA
*
* Returns a textual specification of @rgba in the form <literal>rgb
* (r, g, b)</literal> or <literal>rgba (r, g, b, a)</literal>,
* where 'r', 'g', 'b' and 'a' represent the red, green, blue and alpha values
* respectively. r, g, and b are integers in the range 0 to 255, and a
* is a floating point value in the range 0 to 1.
* Returns a textual specification of @rgba in the form
* <literal>rgb (r, g, b)</literal> or
* <literal>rgba (r, g, b, a)</literal>,
* where 'r', 'g', 'b' and 'a' represent the red, green,
* blue and alpha values respectively. r, g, and b are
* represented as integers in the range 0 to 255, and a
* is represented as floating point value in the range 0 to 1.
*
* (These string forms are string forms those supported by the CSS3 colors module)
* These string forms are string forms those supported by
* the CSS3 colors module, and can be parsed by gdk_rgba_parse().
*
* Note that this string representation may loose some
* precision, since r, g and b are represented as 8-bit
* integers. If this is a concern, you should use a
* different representation.
*
* Returns: A newly allocated text string
*
* Since: 3.0
**/
*/
gchar *
gdk_rgba_to_string (const GdkRGBA *rgba)
{
if (rgba->alpha > 0.999)
{
return g_strdup_printf ("rgb(%d,%d,%d)",
(int)(0.5 + CLAMP (rgba->red, 0., 1.) * 255.),
(int)(0.5 + CLAMP (rgba->green, 0., 1.) * 255.),
(int)(0.5 + CLAMP (rgba->blue, 0., 1.) * 255.));
(int)(0.5 + CLAMP (rgba->red, 0., 1.) * 255.),
(int)(0.5 + CLAMP (rgba->green, 0., 1.) * 255.),
(int)(0.5 + CLAMP (rgba->blue, 0., 1.) * 255.));
}
else
{
@ -354,9 +363,9 @@ gdk_rgba_to_string (const GdkRGBA *rgba)
g_ascii_dtostr (alpha, G_ASCII_DTOSTR_BUF_SIZE, CLAMP (rgba->alpha, 0, 1));
return g_strdup_printf ("rgba(%d,%d,%d,%s)",
(int)(0.5 + CLAMP (rgba->red, 0., 1.) * 255.),
(int)(0.5 + CLAMP (rgba->green, 0., 1.) * 255.),
(int)(0.5 + CLAMP (rgba->blue, 0., 1.) * 255.),
alpha);
(int)(0.5 + CLAMP (rgba->red, 0., 1.) * 255.),
(int)(0.5 + CLAMP (rgba->green, 0., 1.) * 255.),
(int)(0.5 + CLAMP (rgba->blue, 0., 1.) * 255.),
alpha);
}
}

View File

@ -45,20 +45,19 @@ struct _GdkRGBA
#define GDK_TYPE_RGBA (gdk_rgba_get_type ())
GdkRGBA * gdk_rgba_copy (const GdkRGBA *rgba);
void gdk_rgba_free (GdkRGBA *rgba);
GType gdk_rgba_get_type (void) G_GNUC_CONST;
gboolean gdk_rgba_parse (GdkRGBA *rgba,
const gchar *spec);
GdkRGBA * gdk_rgba_copy (const GdkRGBA *rgba);
void gdk_rgba_free (GdkRGBA *rgba);
guint gdk_rgba_hash (gconstpointer p);
gboolean gdk_rgba_equal (gconstpointer p1,
gconstpointer p2);
guint gdk_rgba_hash (gconstpointer p);
gboolean gdk_rgba_equal (gconstpointer p1,
gconstpointer p2);
gboolean gdk_rgba_parse (GdkRGBA *rgba,
const gchar *spec);
gchar * gdk_rgba_to_string (const GdkRGBA *rgba);
GType gdk_rgba_get_type (void) G_GNUC_CONST;
G_END_DECLS

View File

@ -34,14 +34,17 @@
* @Short_description: Object representing a physical screen
* @Title: GdkScreen
*
* #GdkScreen objects are the GDK representation of a physical screen. It is used
* throughout GDK and GTK+ to specify which screen the top level windows
* are to be displayed on.
* It is also used to query the screen specification and default settings such as
* the screen width (gdk_screen_get_width()), etc.
* #GdkScreen objects are the GDK representation of the screen on
* which windows can be displayed and on which the pointer moves.
* X originally identified screens with physical screens, but
* nowadays it is more common to have a single #GdkScreen which
* combines several physical monitors (see gdk_screen_get_n_monitors()).
*
* Note that a screen may consist of multiple monitors which are merged to
* form a large screen area.
* GdkScreen is used throughout GDK and GTK+ to specify which screen
* the top level windows are to be displayed on. it is also used to
* query the screen specification and default settings such as
* the default visual (gdk_screen_get_system_visual()), the dimensions
* of the physical monitors (gdk_screen_get_monitor_geometry()), etc.
*/

View File

@ -51,12 +51,12 @@
* @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
* #GdkWindow<!-- -->s. For example, each #GtkButton has a #GdkWindow associated
* with it.
* A #GdkWindow is a (usually) 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.
*
* <refsect2 id="COMPOSITED-WINDOWS">
* <title>Composited Windows</title>
@ -1240,7 +1240,7 @@ sync_native_window_stack_position (GdkWindow *window)
}
/**
* gdk_window_new: (constructor):
* gdk_window_new: (constructor)
* @parent: (allow-none): a #GdkWindow, or %NULL to create the window as a child of
* the default root window for the default display.
* @attributes: attributes of the new window

View File

@ -12,7 +12,7 @@ AM_CPPFLAGS = \
progs_ldadd = \
$(GDK_DEP_LIBS) \
$(top_builddir)/gdk/libgdk-$(GTK_API_VERSION).la \
$(top_builddir)/gdk/libgdk-3.la \
$(NULL)
#TEST_PROGS += check-gdk-cairo

View File

@ -290,7 +290,7 @@ gdk_device_win32_query_state (GdkDevice *device,
hwndc = ChildWindowFromPoint (hwnd, point);
if (hwndc && hwndc != hwnd)
*child_window = gdk_win32_handle_table_lookup ((GdkNativeWindow) hwndc);
*child_window = gdk_win32_handle_table_lookup (hwndc);
else
*child_window = NULL; /* Direct child unknown to gdk */
}
@ -372,7 +372,7 @@ gdk_device_win32_window_at_position (GdkDevice *device,
do
{
if (get_toplevel &&
(window = gdk_win32_handle_table_lookup ((GdkNativeWindow) hwnd)) != NULL &&
(window = gdk_win32_handle_table_lookup (hwnd)) != NULL &&
GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN)
break;
@ -382,7 +382,7 @@ gdk_device_win32_window_at_position (GdkDevice *device,
}
while (hwndc != hwnd && (hwnd = hwndc, 1));
window = gdk_win32_handle_table_lookup ((GdkNativeWindow) hwnd);
window = gdk_win32_handle_table_lookup (hwnd);
if (window && (win_x || win_y))
{

View File

@ -495,10 +495,7 @@ gdk_win32_display_class_init (GdkWin32DisplayClass *klass)
display_class->supports_composite = gdk_win32_display_supports_composite;
display_class->list_devices = _gdk_win32_display_list_devices;
display_class->send_client_message = _gdk_win32_display_send_client_message;
display_class->add_client_message_filter = _gdk_win32_display_add_client_message_filter;
//? display_class->get_app_launch_context = _gdk_win32_display_get_app_launch_context;
display_class->get_drag_protocol = _gdk_win32_display_get_drag_protocol;
display_class->get_cursor_for_type = _gdk_win32_display_get_cursor_for_type;
display_class->get_cursor_for_name = _gdk_win32_display_get_cursor_for_name;
display_class->get_cursor_for_pixbuf = _gdk_win32_display_get_cursor_for_pixbuf;

View File

@ -1972,33 +1972,32 @@ _gdk_win32_dnd_do_dragdrop (void)
}
}
GdkNativeWindow
_gdk_win32_display_get_drag_protocol (GdkDisplay *display,
GdkNativeWindow xid,
GdkDragProtocol *protocol,
guint *version)
/* Untested, may not work ...
* ... but as of this writing is only used by exlusive X11 gtksocket.c
*/
GdkDragProtocol
_gdk_win32_window_get_drag_protocol (GdkWindow *window,
GdkWindow **target)
{
GdkWindow *window;
GdkDragProtocol protocol = GDK_DRAG_PROTO_NONE;
window = gdk_win32_window_lookup_for_display (display, xid);
if (window &&
gdk_window_get_window_type (window) != GDK_WINDOW_FOREIGN)
if (gdk_window_get_window_type (window) != GDK_WINDOW_FOREIGN)
{
if (g_object_get_data (G_OBJECT (window), "gdk-dnd-registered") != NULL)
{
if (use_ole2_dnd)
*protocol = GDK_DRAG_PROTO_OLE2;
protocol = GDK_DRAG_PROTO_OLE2;
else
*protocol = GDK_DRAG_PROTO_LOCAL;
/* even X11 code not always intializes it */
*version = 0;
return xid;
protocol = GDK_DRAG_PROTO_LOCAL;
}
}
return 0;
if (target)
{
*target = NULL;
}
return protocol;
}
static GdkWindow *

View File

@ -527,7 +527,7 @@ find_window_for_mouse_event (GdkWindow* reported_window,
if (!PtInRect (&rect, pt))
return _gdk_root;
other_window = gdk_win32_handle_table_lookup ((GdkNativeWindow) hwnd);
other_window = gdk_win32_handle_table_lookup (hwnd);
}
if (other_window == NULL)
@ -544,21 +544,6 @@ find_window_for_mouse_event (GdkWindow* reported_window,
return other_window;
}
void
_gdk_win32_display_add_client_message_filter (GdkDisplay *display,
GdkAtom message_type,
GdkFilterFunc func,
gpointer data)
{
GdkClientFilter *filter = g_new (GdkClientFilter, 1);
filter->type = message_type;
filter->function = func;
filter->data = data;
client_filters = g_list_append (client_filters, filter);
}
static void
build_key_event_state (GdkEvent *event,
BYTE *key_state)
@ -834,14 +819,7 @@ _gdk_win32_print_event (const GdkEvent *event)
event->dnd.context->dest_window == NULL ? NULL : GDK_WINDOW_HWND (event->dnd.context->dest_window));
break;
case GDK_CLIENT_EVENT:
g_print ("%s %d %ld %ld %ld %ld %ld",
gdk_atom_name (event->client.message_type),
event->client.data_format,
event->client.data.l[0],
event->client.data.l[1],
event->client.data.l[2],
event->client.data.l[3],
event->client.data.l[4]);
/* no more GdkEventClient */
break;
case GDK_SCROLL:
g_print ("(%.4g,%.4g) (%.4g,%.4g) %s ",
@ -1756,7 +1734,7 @@ gdk_event_translate (MSG *msg,
return TRUE;
}
window = gdk_win32_handle_table_lookup ((GdkNativeWindow) msg->hwnd);
window = gdk_win32_handle_table_lookup (msg->hwnd);
orig_window = window;
if (window == NULL)
@ -1868,15 +1846,7 @@ gdk_event_translate (MSG *msg,
goto done;
case GDK_FILTER_CONTINUE:
/* Send unknown client messages on to Gtk for it to use */
event->client.type = GDK_CLIENT_EVENT;
event->client.window = window;
event->client.message_type = GDK_POINTER_TO_ATOM (msg->wParam);
event->client.data_format = 32;
event->client.data.l[0] = msg->lParam;
for (i = 1; i < 5; i++)
event->client.data.l[i] = 0;
/* No more: Send unknown client messages on to Gtk for it to use */
GDK_NOTE (EVENTS, _gdk_win32_print_event (event));
return_val = TRUE;
goto done;
@ -2235,7 +2205,7 @@ gdk_event_translate (MSG *msg,
GDK_NOTE (EVENTS, g_print (" %d (%ld,%ld)",
HIWORD (msg->wParam), msg->pt.x, msg->pt.y));
if (!gdk_win32_handle_table_lookup ((GdkNativeWindow) WindowFromPoint (msg->pt)))
if (!gdk_win32_handle_table_lookup (WindowFromPoint (msg->pt)))
{
/* we are only interested if we don't know the new window */
if (current_toplevel)
@ -2266,7 +2236,7 @@ gdk_event_translate (MSG *msg,
break;
msg->hwnd = hwnd;
if ((new_window = gdk_win32_handle_table_lookup ((GdkNativeWindow) msg->hwnd)) == NULL)
if ((new_window = gdk_win32_handle_table_lookup (msg->hwnd)) == NULL)
break;
if (new_window != window)
@ -2994,7 +2964,7 @@ gdk_event_translate (MSG *msg,
event->selection.selection = GDK_SELECTION_CLIPBOARD;
event->selection.target = target;
event->selection.property = _gdk_selection;
event->selection.requestor = msg->hwnd;
event->selection.requestor = gdk_win32_handle_table_lookup (msg->hwnd);
event->selection.time = msg->time;
fixup_event (event);
@ -3220,41 +3190,6 @@ is_modally_blocked (GdkWindow *window)
return modal_current != NULL ? gdk_window_get_toplevel (window) != modal_current : FALSE;
}
static void
check_for_too_much_data (GdkEvent *event)
{
if (event->client.data.l[1] ||
event->client.data.l[2] ||
event->client.data.l[3] ||
event->client.data.l[4])
{
g_warning ("Only four bytes of data are passed in client messages on Win32\n");
}
}
gboolean
_gdk_win32_display_send_client_message (GdkDisplay *display,
GdkEvent *event,
GdkNativeWindow winid)
{
check_for_too_much_data (event);
return PostMessageW ((HWND) winid, client_message,
(WPARAM) event->client.message_type,
event->client.data.l[0]);
}
void
_gdk_win32_screen_broadcast_client_message (GdkScreen *screen,
GdkEvent *event)
{
check_for_too_much_data (event);
PostMessageW (HWND_BROADCAST, client_message,
(WPARAM) event->client.message_type,
event->client.data.l[0]);
}
void
_gdk_win32_display_sync (GdkDisplay * display)
{

View File

@ -164,6 +164,9 @@ void _gdk_win32_window_move_region (GdkWindow *window,
void _gdk_win32_selection_init (void);
void _gdk_win32_dnd_exit (void);
GdkDragProtocol _gdk_win32_window_get_drag_protocol (GdkWindow *window,
GdkWindow **target);
void gdk_win32_handle_table_insert (HANDLE *handle,
gpointer data);
void gdk_win32_handle_table_remove (HANDLE handle);
@ -364,11 +367,6 @@ HICON _gdk_win32_pixbuf_to_hcursor (GdkPixbuf *pixbuf,
gboolean _gdk_win32_pixbuf_to_hicon_supports_alpha (void);
/* GdkDisplay member functions */
GdkNativeWindow _gdk_win32_display_get_drag_protocol (GdkDisplay *display,
GdkNativeWindow xid,
GdkDragProtocol *protocol,
guint *version);
GdkCursor *_gdk_win32_display_get_cursor_for_type (GdkDisplay *display,
GdkCursorType cursor_type);
GdkCursor *_gdk_win32_display_get_cursor_for_name (GdkDisplay *display,
@ -388,13 +386,6 @@ gboolean _gdk_win32_display_supports_cursor_color (GdkDisplay *display);
GList *_gdk_win32_display_list_devices (GdkDisplay *dpy);
gboolean _gdk_win32_display_send_client_message (GdkDisplay *display,
GdkEvent *event,
GdkNativeWindow winid);
void _gdk_win32_display_add_client_message_filter (GdkDisplay *display,
GdkAtom message_type,
GdkFilterFunc func,
gpointer data);
void _gdk_win32_display_sync (GdkDisplay * display);
gboolean _gdk_win32_display_has_pending (GdkDisplay *display);
void _gdk_win32_display_queue_events (GdkDisplay *display);
@ -412,7 +403,7 @@ gboolean _gdk_win32_display_set_selection_owner (GdkDisplay *display,
guint32 time,
gboolean send_event);
void _gdk_win32_display_send_selection_notify (GdkDisplay *display,
GdkNativeWindow requestor,
HWND requestor,
GdkAtom selection,
GdkAtom target,
GdkAtom property,
@ -482,7 +473,6 @@ void _gdk_win32_window_delete_property (GdkWindow *window, GdkAtom property);
/* Stray GdkWin32Screen members */
GdkVisual *_gdk_win32_screen_get_system_visual (GdkScreen *screen);
void _gdk_win32_screen_broadcast_client_message (GdkScreen *screen, GdkEvent *event);
gboolean _gdk_win32_screen_get_setting (GdkScreen *screen, const gchar *name, GValue *value);
gint _gdk_win32_screen_visual_get_best_depth (GdkScreen *screen);
GdkVisualType _gdk_win32_screen_visual_get_best_type (GdkScreen *screen);

View File

@ -228,7 +228,6 @@ gdk_win32_screen_class_init (GdkWin32ScreenClass *klass)
screen_class->make_display_name = gdk_win32_screen_make_display_name;
screen_class->get_active_window = gdk_win32_screen_get_active_window;
screen_class->get_window_stack = gdk_win32_screen_get_window_stack;
screen_class->broadcast_client_message = _gdk_win32_screen_broadcast_client_message;
screen_class->get_setting = _gdk_win32_screen_get_setting;
screen_class->visual_get_best_depth = _gdk_win32_screen_visual_get_best_depth;
screen_class->visual_get_best_type = _gdk_win32_screen_visual_get_best_type;

View File

@ -324,7 +324,7 @@ _gdk_win32_display_set_selection_owner (GdkDisplay *display,
tmp_event.selection.selection = selection;
tmp_event.selection.target = _utf8_string;
tmp_event.selection.property = _gdk_selection;
tmp_event.selection.requestor = hwnd;
tmp_event.selection.requestor = gdk_win32_handle_table_lookup (hwnd);
tmp_event.selection.time = time;
gdk_event_put (&tmp_event);
@ -349,11 +349,11 @@ _gdk_win32_display_get_selection_owner (GdkDisplay *display,
if (owner == NULL)
return NULL;
return gdk_win32_handle_table_lookup ((GdkNativeWindow) owner);
return gdk_win32_handle_table_lookup (owner);
}
window = gdk_win32_window_lookup_for_display (display,
(GdkNativeWindow) g_hash_table_lookup (sel_owner_table, selection));
g_hash_table_lookup (sel_owner_table, selection));
GDK_NOTE (DND, {
gchar *sel_name = gdk_atom_name (selection);
@ -873,8 +873,8 @@ _gdk_selection_property_delete (GdkWindow *window)
}
void
_gdk_win32_display_send_selection_notify (GdkDisplay *display,
GdkNativeWindow requestor,
_gdk_win32_display_send_selection_notify (GdkDisplay *display,
HWND requestor,
GdkAtom selection,
GdkAtom target,
GdkAtom property,

View File

@ -82,7 +82,7 @@ G_BEGIN_DECLS
gboolean gdk_win32_window_is_win32 (GdkWindow *window);
/* Return the Gdk* for a particular HANDLE */
gpointer gdk_win32_handle_table_lookup (GdkNativeWindow handle);
gpointer gdk_win32_handle_table_lookup (HWND handle);
/* Translate from window to Windows handle */
HGDIOBJ gdk_win32_window_get_handle (GdkWindow *window);
@ -97,9 +97,9 @@ HICON gdk_win32_pixbuf_to_hicon_libgtk_only (GdkPixbuf *pixbuf);
void gdk_win32_set_modal_dialog_libgtk_only (HWND window);
GdkWindow * gdk_win32_window_foreign_new_for_display (GdkDisplay *display,
GdkNativeWindow anid);
HWND anid);
GdkWindow * gdk_win32_window_lookup_for_display (GdkDisplay *display,
GdkNativeWindow anid);
HWND anid);
G_END_DECLS

View File

@ -72,7 +72,7 @@ gdk_win32_handle_table_remove (HANDLE handle)
}
gpointer
gdk_win32_handle_table_lookup (GdkNativeWindow handle)
gdk_win32_handle_table_lookup (HWND handle)
{
gpointer data = NULL;

View File

@ -649,7 +649,7 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display,
GdkWindow *
gdk_win32_window_foreign_new_for_display (GdkDisplay *display,
GdkNativeWindow anid)
HWND anid)
{
GdkWindow *window;
GdkWindowImplWin32 *impl;
@ -660,14 +660,17 @@ gdk_win32_window_foreign_new_for_display (GdkDisplay *display,
g_return_val_if_fail (display == _gdk_display, NULL);
if ((window = gdk_win32_window_lookup_for_display (display, anid)) != NULL)
return g_object_ref (window);
window = _gdk_display_create_window (display);
window->visual = gdk_screen_get_system_visual (_gdk_screen);
window->impl = g_object_new (GDK_TYPE_WINDOW_IMPL_WIN32, NULL);
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
impl->wrapper = window;
parent = GetParent ((HWND)anid);
parent = GetParent (anid);
window->parent = gdk_win32_handle_table_lookup ((GdkNativeWindow) parent);
window->parent = gdk_win32_handle_table_lookup (parent);
if (!window->parent || GDK_WINDOW_TYPE (window->parent) == GDK_WINDOW_FOREIGN)
window->parent = _gdk_root;
@ -3063,8 +3066,8 @@ gdk_win32_window_shape_combine_region (GdkWindow *window,
}
GdkWindow *
gdk_win32_window_lookup_for_display (GdkDisplay *display,
GdkNativeWindow anid)
gdk_win32_window_lookup_for_display (GdkDisplay *display,
HWND anid)
{
g_return_val_if_fail (display == _gdk_display, NULL);
@ -3390,6 +3393,7 @@ gdk_window_impl_win32_class_init (GdkWindowImplWin32Class *klass)
impl_class->set_opacity = gdk_win32_window_set_opacity;
//impl_class->set_composited = gdk_win32_window_set_composited;
impl_class->destroy_notify = gdk_win32_window_destroy_notify;
impl_class->get_drag_protocol = _gdk_win32_window_get_drag_protocol;
impl_class->register_dnd = _gdk_win32_window_register_dnd;
impl_class->drag_begin = _gdk_win32_window_drag_begin;
impl_class->process_updates_recurse = gdk_win32_window_process_updates_recurse;

View File

@ -24,9 +24,13 @@ libgdk_x11_la_SOURCES = \
gdkasync.h \
gdkcursor-x11.c \
gdkdevice-core-x11.c \
gdkdevice-xi.c \
gdkdevice-xi2.c \
gdkdeviceprivate-xi.h \
gdkdevicemanager-core-x11.c \
gdkdevicemanager-x11.c \
gdkdevicemanager-xi.c \
gdkdevicemanager-xi2.c \
gdkdevicemanagerprivate-core.h \
gdkdisplaymanager-x11.c \
gdkdisplay-x11.c \
@ -56,34 +60,18 @@ libgdk_x11_la_SOURCES = \
xsettings-common.h \
xsettings-common.c
libgdkx11include_HEADERS =
if XINPUT_XFREE
libgdk_x11_la_SOURCES += \
gdkdevicemanager-xi.c \
gdkdevice-xi.c
libgdkx11include_HEADERS += \
gdkx11devicemanager-xi.h \
gdkx11device-xi.h
if XINPUT_2
libgdk_x11_la_SOURCES += \
gdkdevicemanager-xi2.c \
gdkdevice-xi2.c
libgdkx11include_HEADERS += \
gdkx11devicemanager-xi2.h \
gdkx11device-xi2.h
endif
endif
libgdkinclude_HEADERS = \
gdkx.h
libgdkx11include_HEADERS += \
libgdkx11include_HEADERS = \
gdkx11applaunchcontext.h \
gdkx11cursor.h \
gdkx11device-core.h \
gdkx11device-xi.h \
gdkx11device-xi2.h \
gdkx11devicemanager-core.h \
gdkx11devicemanager-xi.h \
gdkx11devicemanager-xi2.h \
gdkx11display.h \
gdkx11displaymanager.h \
gdkx11dnd.h \

View File

@ -20,13 +20,22 @@
#include "config.h"
#include "gdkx11device-xi.h"
#include "gdkdeviceprivate-xi.h"
#ifdef XINPUT_XFREE
#include "gdkwindow.h"
#include "gdkintl.h"
#include "gdkprivate-x11.h"
#include "gdkasync.h"
#endif
G_DEFINE_TYPE (GdkX11DeviceXI, gdk_x11_device_xi, GDK_TYPE_DEVICE)
#ifdef XINPUT_XFREE
#define MAX_DEVICE_CLASSES 13
static GQuark quark_window_input_info = 0;
@ -97,8 +106,6 @@ static void gdk_x11_device_xi_select_window_events (GdkDevice *device,
GdkEventMask mask);
G_DEFINE_TYPE (GdkX11DeviceXI, gdk_x11_device_xi, GDK_TYPE_DEVICE)
enum {
PROP_0,
PROP_DEVICE_ID
@ -639,3 +646,17 @@ _gdk_x11_device_xi_translate_axes (GdkDevice *device,
if (y)
*y = temp_y;
}
#else /* XINPUT_XFREE */
static void
gdk_x11_device_xi_class_init (GdkX11DeviceXIClass *klass)
{
}
static void
gdk_x11_device_xi_init (GdkX11DeviceXI *device)
{
}
#endif /* XINPUT_XFREE */

View File

@ -26,11 +26,15 @@
#include "gdkasync.h"
#include "gdkprivate-x11.h"
#ifdef XINPUT_2
#include <stdlib.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/extensions/XInput2.h>
#endif
struct _GdkX11DeviceXI2
{
GdkDevice parent_instance;
@ -43,6 +47,10 @@ struct _GdkX11DeviceXI2Class
GdkDeviceClass parent_class;
};
G_DEFINE_TYPE (GdkX11DeviceXI2, gdk_x11_device_xi2, GDK_TYPE_DEVICE)
#ifdef XINPUT_2
static void gdk_x11_device_xi2_get_property (GObject *object,
guint prop_id,
GValue *value,
@ -93,8 +101,6 @@ static void gdk_x11_device_xi2_select_window_events (GdkDevice *device,
GdkEventMask event_mask);
G_DEFINE_TYPE (GdkX11DeviceXI2, gdk_x11_device_xi2, GDK_TYPE_DEVICE)
enum {
PROP_0,
PROP_DEVICE_ID
@ -742,3 +748,17 @@ _gdk_x11_device_xi2_translate_state (XIModifierState *mods_state,
return state;
}
#else /* XINPUT_2 */
static void
gdk_x11_device_xi2_class_init (GdkX11DeviceXI2Class *klass)
{
}
static void
gdk_x11_device_xi2_init (GdkX11DeviceXI2 *device)
{
}
#endif /* XINPUT_2 */

View File

@ -28,8 +28,11 @@
#include "gdkintl.h"
#include "gdkprivate-x11.h"
#ifdef XINPUT_XFREE
#include <X11/extensions/XInput.h>
#endif /* XINPUT_XFREE */
struct _GdkX11DeviceManagerXI
{
@ -46,6 +49,13 @@ struct _GdkX11DeviceManagerXIClass
GdkX11DeviceManagerCoreClass parent_class;
};
static void gdk_x11_device_manager_xi_event_translator_init (GdkEventTranslatorIface *iface);
G_DEFINE_TYPE_WITH_CODE (GdkX11DeviceManagerXI, gdk_x11_device_manager_xi, GDK_TYPE_X11_DEVICE_MANAGER_CORE,
G_IMPLEMENT_INTERFACE (GDK_TYPE_EVENT_TRANSLATOR,
gdk_x11_device_manager_xi_event_translator_init))
#ifdef XINPUT_XFREE
static void gdk_x11_device_manager_xi_constructed (GObject *object);
static void gdk_x11_device_manager_xi_dispose (GObject *object);
@ -58,7 +68,6 @@ static void gdk_x11_device_manager_xi_get_property (GObject *object,
GValue *value,
GParamSpec *pspec);
static void gdk_x11_device_manager_xi_event_translator_init (GdkEventTranslatorIface *iface);
static gboolean gdk_x11_device_manager_xi_translate_event (GdkEventTranslator *translator,
GdkDisplay *display,
GdkEvent *event,
@ -67,10 +76,6 @@ static GList * gdk_x11_device_manager_xi_list_devices (GdkDeviceManager *de
GdkDeviceType type);
G_DEFINE_TYPE_WITH_CODE (GdkX11DeviceManagerXI, gdk_x11_device_manager_xi, GDK_TYPE_X11_DEVICE_MANAGER_CORE,
G_IMPLEMENT_INTERFACE (GDK_TYPE_EVENT_TRANSLATOR,
gdk_x11_device_manager_xi_event_translator_init))
enum {
PROP_0,
PROP_EVENT_BASE
@ -661,3 +666,22 @@ gdk_x11_device_manager_xi_list_devices (GdkDeviceManager *manager,
else
return NULL;
}
#else /* XINPUT_XFREE */
static void
gdk_x11_device_manager_xi_class_init (GdkX11DeviceManagerXIClass *klass)
{
}
static void
gdk_x11_device_manager_xi_init (GdkX11DeviceManagerXI *device_manager)
{
}
static void
gdk_x11_device_manager_xi_event_translator_init (GdkEventTranslatorIface *iface)
{
}
#endif /* XINPUT_XFREE */

View File

@ -22,7 +22,7 @@
#include "gdkx11devicemanager-xi2.h"
#include "gdkx11device-xi2.h"
#include "gdkdevicemanagerprivate.h"
#include "gdkdevicemanagerprivate-core.h"
#include "gdkdeviceprivate.h"
#include "gdkdisplayprivate.h"
#include "gdkeventtranslator.h"
@ -30,15 +30,19 @@
#include "gdkintl.h"
#include "gdkkeysyms.h"
#ifdef XINPUT_2
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/extensions/XInput2.h>
#include <string.h>
#endif /* XINPUT_2 */
struct _GdkX11DeviceManagerXI2
{
GdkDeviceManager parent_object;
GdkX11DeviceManagerCore parent_object;
GHashTable *id_table;
@ -52,6 +56,15 @@ struct _GdkX11DeviceManagerXI2Class
GdkDeviceManagerClass parent_class;
};
static void gdk_x11_device_manager_xi2_event_translator_init (GdkEventTranslatorIface *iface);
G_DEFINE_TYPE_WITH_CODE (GdkX11DeviceManagerXI2, gdk_x11_device_manager_xi2, GDK_TYPE_X11_DEVICE_MANAGER_CORE,
G_IMPLEMENT_INTERFACE (GDK_TYPE_EVENT_TRANSLATOR,
gdk_x11_device_manager_xi2_event_translator_init))
#ifdef XINPUT_2
#define HAS_FOCUS(toplevel) ((toplevel)->has_focus || (toplevel)->has_pointer_focus)
@ -70,8 +83,6 @@ static GList * gdk_x11_device_manager_xi2_list_devices (GdkDeviceManager *device
GdkDeviceType type);
static GdkDevice * gdk_x11_device_manager_xi2_get_client_pointer (GdkDeviceManager *device_manager);
static void gdk_x11_device_manager_xi2_event_translator_init (GdkEventTranslatorIface *iface);
static gboolean gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
GdkDisplay *display,
GdkEvent *event,
@ -82,11 +93,6 @@ static void gdk_x11_device_manager_xi2_select_window_events (GdkEventTra
GdkEventMask event_mask);
G_DEFINE_TYPE_WITH_CODE (GdkX11DeviceManagerXI2, gdk_x11_device_manager_xi2, GDK_TYPE_X11_DEVICE_MANAGER_CORE,
G_IMPLEMENT_INTERFACE (GDK_TYPE_EVENT_TRANSLATOR,
gdk_x11_device_manager_xi2_event_translator_init))
enum {
PROP_0,
PROP_OPCODE
@ -1301,3 +1307,22 @@ gdk_x11_device_manager_xi2_select_window_events (GdkEventTranslator *translator,
_gdk_x11_device_manager_xi2_select_events (device_manager, window, &event_mask);
g_free (event_mask.mask);
}
#else /* XINPUT_2 */
static void
gdk_x11_device_manager_xi2_class_init (GdkX11DeviceManagerXI2Class *klass)
{
}
static void
gdk_x11_device_manager_xi2_init (GdkX11DeviceManagerXI2 *device_manager)
{
}
static void
gdk_x11_device_manager_xi2_event_translator_init (GdkEventTranslatorIface *iface)
{
}
#endif /* XINPUT_2 */

View File

@ -41,8 +41,12 @@
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#ifdef XINPUT_XFREE
#include <X11/extensions/XInput.h>
#endif
#ifdef XINPUT_2
#include <X11/extensions/XInput2.h>
#endif
#include <cairo-xlib.h>
@ -225,6 +229,7 @@ void _gdk_x11_device_check_extension_events (GdkDevice *device);
GdkDeviceManager *_gdk_x11_device_manager_new (GdkDisplay *display);
#ifdef XINPUT_XFREE
void _gdk_x11_device_xi_update_window_info (GdkWindow *window);
void _gdk_x11_device_xi_update_axes (GdkDevice *device,
@ -237,12 +242,15 @@ void _gdk_x11_device_xi_translate_axes (GdkDevice *device,
gdouble *axes,
gdouble *x,
gdouble *y);
#endif
#ifdef XINPUT_2
guchar * _gdk_x11_device_xi2_translate_event_mask (GdkEventMask event_mask,
gint *len);
guint _gdk_x11_device_xi2_translate_state (XIModifierState *mods_state,
XIButtonState *buttons_state,
XIGroupState *group_state);
#endif
void _gdk_x11_event_translate_keyboard_string (GdkEventKey *event);

View File

@ -94,12 +94,17 @@ _gdk_x11_window_simulate_key (GdkWindow *window,
{
gint i;
for (i = 0; i < n_keys; i++)
if (keys[i].group == 0 && keys[i].level == 0)
if (keys[i].group == 0 && (keys[i].level == 0 || keys[i].level == 1))
{
xev.keycode = keys[i].keycode;
if (keys[i].level == 1)
{
/* Assume shift takes us to level 1 */
xev.state |= GDK_SHIFT_MASK;
}
break;
}
if (i >= n_keys) /* no match for group==0 and level==0 */
if (i >= n_keys) /* no match for group==0 and level==0 or 1 */
xev.keycode = keys[0].keycode;
}
g_free (keys);

View File

@ -6,5 +6,5 @@ Name: GTK+ Uninstalled
Description: GTK+ Graphical UI Library (${target} target), Not Installed
Version: @VERSION@
Requires: gdk-@GTK_API_VERSION@-uninstalled @GTK_PACKAGES@
Libs: ${pc_top_builddir}/${pcfiledir}/gtk/libgtk-@GTK_API_VERSION@.la @GTK_EXTRA_LIBS@
Libs: ${pc_top_builddir}/${pcfiledir}/gtk/libgtk-3.la @GTK_EXTRA_LIBS@
Cflags: -I${pc_top_builddir}/${pcfiledir}/@srcdir@ -I${pc_top_builddir}/${pcfiledir} @GTK_EXTRA_CFLAGS@

View File

@ -11,5 +11,5 @@ Name: GTK+
Description: GTK+ Graphical UI Library
Version: @VERSION@
Requires: gdk-@GTK_API_VERSION@ @GTK_PACKAGES@
Libs: -L${libdir} -lgtk-@GTK_API_VERSION@ @GTK_EXTRA_LIBS@
Libs: -L${libdir} -lgtk-3 @GTK_EXTRA_LIBS@
Cflags: -I${includedir}/gtk-@GTK_API_VERSION@ @GTK_EXTRA_CFLAGS@ -DGSEAL_ENABLE

View File

@ -1,4 +0,0 @@
#!/bin/sh
echo gtk-config-2.0 is no longer supported. Please use pkg-config instead 2>&1
exit 1

View File

@ -108,7 +108,7 @@ endif
libgtkincludedir = $(includedir)/gtk-3.0/gtk
libadd = \
$(top_builddir)/gdk/libgdk-3.0.la \
$(top_builddir)/gdk/libgdk-3.la \
$(GTK_DEP_LIBS)
deps =
@ -396,6 +396,7 @@ gtk_private_h_sources = \
gtkfilesystem.h \
gtkfilesystemmodel.h \
gtkiconcache.h \
gtkimageprivate.h \
gtkimcontextsimpleseqs.h \
gtkintl.h \
gtkkeyhash.h \
@ -870,15 +871,15 @@ gtktypebuiltins.c: @REBUILD@ $(gtk_public_h_sources) gtktypebuiltins.c.template
gtktypefuncs.c: @REBUILD@ stamp-gtktypebuiltins.h $(top_srcdir)/gtk/*.h $(top_srcdir)/gdk/*.h Makefile
$(AM_V_GEN) echo '#include <gtk/gtkx.h>' > xgen-gtfsrc.c && \
${CPP} $(DEFS) $(INCLUDES) -DGTK_ENABLE_BROKEN $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) xgen-gtfsrc.c | \
${CPP} $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) xgen-gtfsrc.c | \
$(GREP) -o '\bg[td]k_[a-zA-Z0-9_]*_get_type\b' | \
sort | uniq | \
$(SED) '{ s/^/*tp++ = /; s/$$/();/; }' > xgen-gtf \
$(SED) '{ s/^/*tp++ = /; s/$$/();/; s/^.*\(gdk_x11\|gtk_plug_\|gtk_socket_\).*$$/#ifdef GDK_WINDOWING_X11\n&\n#endif/; }' > xgen-gtf \
&& cp xgen-gtf $@ && rm -f xgen-gtf
gtktestutils.c: gtktypefuncs.c
# target platform:
lib_LTLIBRARIES = libgtk-3.0.la
lib_LTLIBRARIES = libgtk-3.la
gtkincludedir = $(includedir)/gtk-3.0/gtk
gtkinclude_HEADERS = $(gtk_public_h_sources) $(gtk_semi_private_h_sources) $(gtk_built_public_sources) gtkversion.h
@ -886,22 +887,22 @@ gtkinclude_HEADERS = $(gtk_public_h_sources) $(gtk_semi_private_h_sources) $(gtk
gtkunixprintincludedir = $(includedir)/gtk-3.0/unix-print/gtk
gtkunixprintinclude_HEADERS = $(gtk_unix_print_public_h_sources)
libgtk_3_0_la_SOURCES = $(gtk_c_sources)
libgtk_3_0_la_LDFLAGS = $(libtool_opts)
libgtk_3_0_la_LIBADD = $(libadd)
libgtk_3_0_la_DEPENDENCIES = $(deps)
libgtk_3_la_SOURCES = $(gtk_c_sources)
libgtk_3_la_LDFLAGS = $(libtool_opts)
libgtk_3_la_LIBADD = $(libadd)
libgtk_3_la_DEPENDENCIES = $(deps)
#libgtk_win32_3_0_la_LDFLAGS = $(libtool_opts) -Wl,-luuid
#libgtk_win32_3_la_LDFLAGS = $(libtool_opts) -Wl,-luuid
if USE_WIN32
libgtk_3_0_la_LIBADD += -lole32 -lgdi32 -lcomdlg32 -lwinspool -lcomctl32 -luuid
libgtk_3_0_la_DEPENDENCIES += $(gtk_def) $(gtk_win32_res) $(deps)
libgtk_3_la_LIBADD += -lole32 -lgdi32 -lcomdlg32 -lwinspool -lcomctl32 -luuid
libgtk_3_la_DEPENDENCIES += $(gtk_def) $(gtk_win32_res) $(deps)
libgtk_target_ldflags = $(gtk_win32_res_ldflag) $(gtk_win32_symbols)
endif
install-exec-hook:
if DISABLE_EXPLICIT_DEPS
$(SHELL) $(top_srcdir)/sanitize-la.sh $(DESTDIR)$(libdir)/libgtk-3.0.la
$(SHELL) $(top_srcdir)/sanitize-la.sh $(DESTDIR)$(libdir)/libgtk-3.la
endif
if USE_QUARTZ
@ -948,13 +949,13 @@ distclean-local:
rm -f $(MAINTAINERCLEANFILES); \
fi
DEPS = libgtk-3.0.la $(top_builddir)/gdk/libgdk-3.0.la
DEPS = libgtk-3.la $(top_builddir)/gdk/libgdk-3.la
TEST_DEPS = $(DEPS) immodules.cache
LDADDS = \
libgtk-3.0.la \
$(top_builddir)/gdk/libgdk-3.0.la \
libgtk-3.la \
$(top_builddir)/gdk/libgdk-3.la \
$(GTK_DEP_LIBS)
if HAVE_INTROSPECTION
@ -965,7 +966,7 @@ introspection_files = \
gtktypebuiltins.h \
gtktypebuiltins.c
Gtk-3.0.gir: $(INTROSPECTION_SCANNER) libgtk-3.0.la $(top_builddir)/gdk/Gdk-3.0.gir Makefile
Gtk-3.0.gir: $(INTROSPECTION_SCANNER) libgtk-3.la $(top_builddir)/gdk/Gdk-3.0.gir Makefile
Gtk_3_0_gir_SCANNERFLAGS = \
--add-include-path=$(top_builddir)/gdk \
--include-uninstalled=$(top_builddir)/gdk/Gdk-3.0.gir
@ -973,13 +974,13 @@ if USE_X11
Gtk_3_0_gir_SCANNERFLAGS += --add-include-path=$(top_builddir)/gdk/x11
endif
Gtk_3_0_gir_SCANNERFLAGS += --c-include="gtk/gtkx.h"
Gtk_3_0_gir_INCLUDES = Atk-1.0 Gdk-3.0
Gtk_3_0_gir_INCLUDES = Atk-1.0
Gtk_3_0_gir_CFLAGS = \
$(INCLUDES) \
-UGDK_DISABLE_DEPRECATED \
-UGTK_DISABLE_DEPRECATED \
-DGTK_TEXT_USE_INTERNAL_UNSUPPORTED_API
Gtk_3_0_gir_LIBS = libgtk-3.0.la
Gtk_3_0_gir_LIBS = libgtk-3.la
Gtk_3_0_gir_FILES = $(introspection_files)
Gtk_3_0_gir_EXPORT_PACKAGES = gtk+-3.0
INTROSPECTION_GIRS += Gtk-3.0.gir

View File

@ -1,5 +1,5 @@
#! /bin/sh
cpp -P -DG_OS_UNIX -DGDK_WINDOWING_X11 ${srcdir:-.}/gtk.symbols | sed -e '/^$/d' -e 's/ G_GNUC.*$//' -e 's/ PRIVATE//' | sort > expected-abi
nm -D -g --defined-only .libs/libgtk-3.0.so | cut -d ' ' -f 3 | egrep -v '^(__bss_start|_edata|_end)' | sort > actual-abi
nm -D -g --defined-only .libs/libgtk-3.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

View File

@ -374,7 +374,6 @@ gtk_cell_area_attribute_connect
gtk_cell_area_attribute_disconnect
gtk_cell_area_box_get_spacing
gtk_cell_area_box_get_type G_GNUC_CONST
gtk_cell_area_box_init_groups
gtk_cell_area_box_new
gtk_cell_area_box_pack_end
gtk_cell_area_box_pack_start
@ -1535,13 +1534,6 @@ gtk_misc_get_padding
gtk_misc_get_type G_GNUC_CONST
gtk_misc_set_alignment
gtk_misc_set_padding
gtk_modifier_style_get_type
gtk_modifier_style_map_color
gtk_modifier_style_new
gtk_modifier_style_set_background_color
gtk_modifier_style_set_color
gtk_modifier_style_set_color_property
gtk_modifier_style_set_font
gtk_mount_operation_get_parent
gtk_mount_operation_get_screen
gtk_mount_operation_get_type G_GNUC_CONST
@ -1713,6 +1705,7 @@ gtk_parse_args
gtk_path_bar_get_type G_GNUC_CONST
gtk_path_priority_type_get_type G_GNUC_CONST
gtk_path_type_get_type G_GNUC_CONST
#ifdef G_OS_UNIX
gtk_plug_construct
gtk_plug_construct_for_display
gtk_plug_get_embedded
@ -1721,6 +1714,7 @@ gtk_plug_get_socket_window
gtk_plug_get_type G_GNUC_CONST
gtk_plug_new
gtk_plug_new_for_display
#endif
gtk_policy_type_get_type G_GNUC_CONST
gtk_position_type_get_type G_GNUC_CONST
#ifdef G_OS_UNIX
@ -2354,11 +2348,13 @@ gtk_size_group_remove_widget
gtk_size_group_set_ignore_hidden
gtk_size_group_set_mode
gtk_size_request_mode_get_type G_GNUC_CONST
#ifdef G_OS_UNIX
gtk_socket_add_id
gtk_socket_get_id
gtk_socket_get_plug_window
gtk_socket_get_type G_GNUC_CONST
gtk_socket_new
#endif
gtk_sort_type_get_type G_GNUC_CONST
gtk_spin_button_configure
gtk_spin_button_get_adjustment

View File

@ -597,30 +597,34 @@ gtk_accel_label_get_string (GtkAccelLabel *accel_label)
}
/* Underscores in key names are better displayed as spaces
* E.g., Page_Up should be "Page Up"
* E.g., Page_Up should be "Page Up".
*
* Some keynames also have prefixes that are not suitable
* for display, e.g XF86AudioMute, so strip those out, too.
*
* This function is only called on untranslated keynames,
* so no need to be UTF-8 safe.
*/
static void
substitute_underscores (gchar *str)
append_without_underscores (GString *s,
gchar *str)
{
char *p;
gchar *p;
for (p = str; *p; p++)
if (*p == '_')
*p = ' ';
}
/* Some keynames have prefixes that are not suitable
* for display, e.g XF86AudioMute
*/
static gchar *
strip_prefix (gchar *str)
{
if (g_str_has_prefix (str, "XF86"))
return str + 4;
p = str + 4;
else if (g_str_has_prefix (str, "ISO_"))
return str + 4;
p = str + 4;
else
p = str;
return str;
for ( ; *p; p++)
{
if (*p == '_')
g_string_append_c (s, ' ');
else
g_string_append_c (s, *p);
}
}
/* On Mac, if the key has symbolic representation (e.g. arrow keys),
@ -846,11 +850,7 @@ _gtk_accel_label_class_get_accelerator_label (GtkAccelLabelClass *klass,
const gchar *str;
str = g_dpgettext2 (GETTEXT_PACKAGE, "keyboard label", tmp);
if (str == tmp)
{
substitute_underscores (tmp);
tmp = strip_prefix (tmp);
g_string_append (gstring, tmp);
}
append_without_underscores (gstring, tmp);
else
g_string_append (gstring, str);
}

View File

@ -753,14 +753,15 @@ gtk_app_chooser_button_append_custom_item (GtkAppChooserButton *self,
}
/**
* gtk_app_chooser_button_select_custom_item:
* gtk_app_chooser_button_set_active_custom_item:
* @self: a #GtkAppChooserButton
* @name: the name of the custom item
*
* Selects a custom item previously added with
* gtk_app_chooser_button_append_custom_item().
* Use gtk_app_chooser_refresh() to bring the selection to its initial
* state.
*
* Use gtk_app_chooser_refresh() to bring the selection
* to its initial state.
*
* Since: 3.0
*/

View File

@ -31,6 +31,8 @@
#include <gtk/gtkcombobox.h>
#include <gio/gio.h>
G_BEGIN_DECLS
#define GTK_TYPE_APP_CHOOSER_BUTTON (gtk_app_chooser_button_get_type ())
#define GTK_APP_CHOOSER_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_APP_CHOOSER_BUTTON, GtkAppChooserButton))
#define GTK_APP_CHOOSER_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_APP_CHOOSER_BUTTON, GtkAppChooserButtonClass))
@ -79,5 +81,6 @@ void gtk_app_chooser_button_set_heading (GtkAppChooserButton *self
const gchar *
gtk_app_chooser_button_get_heading (GtkAppChooserButton *self);
G_END_DECLS
#endif /* __GTK_APP_CHOOSER_BUTTON_H__ */

View File

@ -34,6 +34,8 @@
#include <gtk/gtkdialog.h>
#include <gio/gio.h>
G_BEGIN_DECLS
#define GTK_TYPE_APP_CHOOSER_DIALOG (gtk_app_chooser_dialog_get_type ())
#define GTK_APP_CHOOSER_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_APP_CHOOSER_DIALOG, GtkAppChooserDialog))
#define GTK_APP_CHOOSER_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_APP_CHOOSER_DIALOG, GtkAppChooserDialogClass))
@ -73,4 +75,6 @@ void gtk_app_chooser_dialog_set_heading (GtkAppChooserDialog *
const gchar *heading);
const gchar * gtk_app_chooser_dialog_get_heading (GtkAppChooserDialog *self);
G_END_DECLS
#endif /* __GTK_APP_CHOOSER_DIALOG_H__ */

View File

@ -35,6 +35,8 @@
#include <gtk/gtkmenu.h>
#include <gio/gio.h>
G_BEGIN_DECLS
#define GTK_TYPE_APP_CHOOSER_WIDGET (gtk_app_chooser_widget_get_type ())
#define GTK_APP_CHOOSER_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_APP_CHOOSER_WIDGET, GtkAppChooserWidget))
#define GTK_APP_CHOOSER_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_APP_CHOOSER_WIDGET, GtkAppChooserWidgetClass))
@ -98,4 +100,6 @@ void gtk_app_chooser_widget_set_default_text (GtkAppChooserWidget *
const gchar *text);
const gchar * gtk_app_chooser_widget_get_default_text (GtkAppChooserWidget *self);
G_END_DECLS
#endif /* __GTK_APP_CHOOSER_WIDGET_H__ */

View File

@ -1123,6 +1123,8 @@ gtk_assistant_style_updated (GtkWidget *widget)
GtkAssistantPrivate *priv = assistant->priv;
GList *list;
GTK_WIDGET_CLASS (gtk_assistant_parent_class)->style_updated (widget);
list = priv->pages;
while (list)

View File

@ -41,13 +41,13 @@ typedef struct _GtkBorder GtkBorder;
/**
* GtkBorder:
* @left: The width of the left border.
* @right: The width of the right border.
* @top: The width of the top border.
* @bottom: The width of the bottom border.
* @left: The width of the left border
* @right: The width of the right border
* @top: The width of the top border
* @bottom: The width of the bottom border
*
* A struct that specifies a border around a rectangular area that can
* be of different width on each side.
* A struct that specifies a border around a rectangular area
* that can be of different width on each side.
*/
struct _GtkBorder
{

View File

@ -1386,6 +1386,8 @@ gtk_button_style_updated (GtkWidget *widget)
{
GtkStyleContext *context;
GTK_WIDGET_CLASS (gtk_button_parent_class)->style_updated (widget);
context = gtk_widget_get_style_context (widget);
gtk_button_update_image_spacing (GTK_BUTTON (widget), context);

View File

@ -2671,8 +2671,8 @@ gtk_cell_area_cell_set_valist (GtkCellArea *area,
break;
}
g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (pspec));
G_VALUE_COLLECT (&value, var_args, 0, &error);
G_VALUE_COLLECT_INIT (&value, G_PARAM_SPEC_VALUE_TYPE (pspec),
var_args, 0, &error);
if (error)
{
g_warning ("%s: %s", G_STRLOC, error);
@ -3100,9 +3100,11 @@ gtk_cell_area_remove_focus_sibling (GtkCellArea *area,
* @renderer: the #GtkCellRenderer expected to have focus
* @sibling: the #GtkCellRenderer to check against @renderer's sibling list
*
* Returns %TRUE if @sibling is one of @renderer's focus siblings
* Returns whether @sibling is one of @renderer's focus siblings
* (see gtk_cell_area_add_focus_sibling()).
*
* Return value: %TRUE if @sibling is a focus sibling of @renderer
*
* Since: 3.0
*/
gboolean

View File

@ -636,8 +636,8 @@ init_context_group (GtkCellAreaBox *box,
align_groups[i] = group->align;
}
/* This call implies reseting the request info */
gtk_cell_area_box_init_groups (context, priv->groups->len, expand_groups, align_groups);
/* This call implies resetting the request info */
_gtk_cell_area_box_init_groups (context, priv->groups->len, expand_groups, align_groups);
g_free (expand_groups);
g_free (align_groups);
}

View File

@ -70,19 +70,19 @@ void gtk_cell_area_box_pack_start (GtkCellAreaBox *box,
GtkCellRenderer *renderer,
gboolean expand,
gboolean align,
gboolean fixed);
gboolean fixed);
void gtk_cell_area_box_pack_end (GtkCellAreaBox *box,
GtkCellRenderer *renderer,
gboolean expand,
gboolean align,
gboolean fixed);
gboolean fixed);
gint gtk_cell_area_box_get_spacing (GtkCellAreaBox *box);
void gtk_cell_area_box_set_spacing (GtkCellAreaBox *box,
gint spacing);
/* Private interaction with GtkCellAreaBoxContext */
gboolean _gtk_cell_area_box_group_visible (GtkCellAreaBox *box,
gint group_idx);
gint group_idx);
G_END_DECLS

View File

@ -275,8 +275,8 @@ _gtk_cell_area_box_context_sum (GtkCellAreaBoxContext *context,
for (i = array->len - 1; i >= 0; i--)
{
if (priv->align[i] &&
_gtk_cell_area_box_group_visible (area, i))
break;
_gtk_cell_area_box_group_visible (area, i))
break;
}
last_aligned_group_idx = i >= 0 ? i : 0;
@ -286,9 +286,9 @@ _gtk_cell_area_box_context_sum (GtkCellAreaBoxContext *context,
if (box_orientation == orientation)
{
if (i > last_aligned_group_idx &&
!_gtk_cell_area_box_group_visible (area, i))
continue;
if (i > last_aligned_group_idx &&
!_gtk_cell_area_box_group_visible (area, i))
continue;
/* Dont add spacing for 0 size groups, they can be 0 size because
* they contain only invisible cells for this round of requests
@ -385,10 +385,10 @@ _gtk_cell_area_box_context_copy (GtkCellAreaBox *box,
copy = g_object_new (GTK_TYPE_CELL_AREA_BOX_CONTEXT,
"area", box, NULL);
gtk_cell_area_box_init_groups (copy,
context->priv->base_widths->len,
context->priv->expand,
context->priv->align);
_gtk_cell_area_box_init_groups (copy,
context->priv->base_widths->len,
context->priv->expand,
context->priv->align);
/* Copy the base arrays */
copy_size_array (context->priv->base_widths,
@ -407,10 +407,10 @@ _gtk_cell_area_box_context_copy (GtkCellAreaBox *box,
}
void
gtk_cell_area_box_init_groups (GtkCellAreaBoxContext *box_context,
guint n_groups,
gboolean *expand_groups,
gboolean *align_groups)
_gtk_cell_area_box_init_groups (GtkCellAreaBoxContext *box_context,
guint n_groups,
gboolean *expand_groups,
gboolean *align_groups)
{
GtkCellAreaBoxContextPrivate *priv;
@ -673,7 +673,7 @@ _gtk_cell_area_box_context_get_group_width_for_height (GtkCellAreaBoxContext *bo
static GtkRequestedSize *
_gtk_cell_area_box_context_get_requests (GtkCellAreaBoxContext *box_context,
GtkCellAreaBox *area,
GtkCellAreaBox *area,
GtkOrientation orientation,
gint for_size,
gint *n_requests)
@ -691,8 +691,8 @@ _gtk_cell_area_box_context_get_requests (GtkCellAreaBoxContext *box_context,
for (i = priv->base_widths->len - 1; i >= 0; i--)
{
if (priv->align[i] &&
_gtk_cell_area_box_group_visible (area, i))
break;
_gtk_cell_area_box_group_visible (area, i))
break;
}
last_aligned_group_idx = i >= 0 ? i : 0;
@ -704,9 +704,9 @@ _gtk_cell_area_box_context_get_requests (GtkCellAreaBoxContext *box_context,
size = &g_array_index (array, CachedSize, i);
if (size->nat_size > 0 &&
(i <= last_aligned_group_idx ||
_gtk_cell_area_box_group_visible (area, i)))
visible_groups++;
(i <= last_aligned_group_idx ||
_gtk_cell_area_box_group_visible (area, i)))
visible_groups++;
}
requests = g_new (GtkRequestedSize, visible_groups);
@ -716,8 +716,8 @@ _gtk_cell_area_box_context_get_requests (GtkCellAreaBoxContext *box_context,
size = &g_array_index (array, CachedSize, i);
if (size->nat_size > 0 &&
(i <= last_aligned_group_idx ||
_gtk_cell_area_box_group_visible (area, i)))
(i <= last_aligned_group_idx ||
_gtk_cell_area_box_group_visible (area, i)))
{
requests[j].data = GINT_TO_POINTER (i);
requests[j].minimum_size = size->min_size;
@ -734,7 +734,7 @@ _gtk_cell_area_box_context_get_requests (GtkCellAreaBoxContext *box_context,
static GtkCellAreaBoxAllocation *
allocate_for_orientation (GtkCellAreaBoxContext *context,
GtkCellAreaBox *area,
GtkCellAreaBox *area,
GtkOrientation orientation,
gint spacing,
gint size,
@ -778,7 +778,7 @@ allocate_for_orientation (GtkCellAreaBoxContext *context,
allocs[i].group_idx = GPOINTER_TO_INT (sizes[i].data);
if (priv->align[allocs[i].group_idx])
vis_position = position;
vis_position = position;
allocs[i].position = vis_position;
allocs[i].size = sizes[i].minimum_size;
@ -797,10 +797,10 @@ allocate_for_orientation (GtkCellAreaBoxContext *context,
position += spacing;
if (_gtk_cell_area_box_group_visible (area, allocs[i].group_idx))
{
vis_position += allocs[i].size;
vis_position += spacing;
}
{
vis_position += allocs[i].size;
vis_position += spacing;
}
}
if (n_allocs)
@ -847,12 +847,12 @@ _gtk_cell_area_box_context_get_orientation_allocs (GtkCellAreaBoxContext *contex
if (orientation == GTK_ORIENTATION_HORIZONTAL && width > 0)
allocs = allocate_for_orientation (context, area, orientation,
spacing, width, height,
&alloc_count);
spacing, width, height,
&alloc_count);
else if (orientation == GTK_ORIENTATION_VERTICAL && height > 0)
allocs = allocate_for_orientation (context, area, orientation,
spacing, height, width,
&alloc_count);
spacing, height, width,
&alloc_count);
*n_allocs = alloc_count;

View File

@ -67,10 +67,10 @@ GtkCellAreaBoxContext *_gtk_cell_area_box_context_copy (GtkCellAreaBox
GtkCellAreaBoxContext *box_context);
/* Initialize group array dimensions */
void gtk_cell_area_box_init_groups (GtkCellAreaBoxContext *box_context,
void _gtk_cell_area_box_init_groups (GtkCellAreaBoxContext *box_context,
guint n_groups,
gboolean *expand_groups,
gboolean *align_groups);
gboolean *align_groups);
/* Update cell-group sizes */
void _gtk_cell_area_box_context_push_group_width (GtkCellAreaBoxContext *box_context,

View File

@ -1700,23 +1700,24 @@ gtk_cell_renderer_get_state (GtkCellRenderer *cell,
g_return_val_if_fail (!cell || GTK_IS_CELL_RENDERER (cell), 0);
g_return_val_if_fail (!widget || GTK_IS_WIDGET (widget), 0);
if ((widget && !gtk_widget_get_sensitive (widget)) ||
(cell && !gtk_cell_renderer_get_sensitive (cell)))
state |= GTK_STATE_FLAG_INSENSITIVE;
if ((widget && !gtk_widget_is_sensitive (widget)) ||
(cell && !gtk_cell_renderer_get_sensitive (cell)) ||
(cell_state & GTK_CELL_RENDERER_INSENSITIVE) != 0)
{
state |= GTK_STATE_FLAG_INSENSITIVE;
}
else
{
if ((cell_state & GTK_CELL_RENDERER_SELECTED) != 0)
{
state |= GTK_STATE_FLAG_SELECTED;
if ((widget && gtk_widget_has_focus (widget)) &&
(cell_state & GTK_CELL_RENDERER_FOCUSED) != 0)
state |= GTK_STATE_FLAG_FOCUSED;
}
if ((widget && gtk_widget_has_focus (widget)) &&
(cell_state & GTK_CELL_RENDERER_FOCUSED) != 0)
state |= GTK_STATE_FLAG_FOCUSED;
if ((cell_state & GTK_CELL_RENDERER_PRELIT) != 0)
state |= GTK_STATE_FLAG_PRELIGHT;
}
if ((cell_state & GTK_CELL_RENDERER_SELECTED) != 0)
state |= GTK_STATE_FLAG_SELECTED;
return state;
}

View File

@ -1845,7 +1845,6 @@ key_press (GtkWidget *invisible,
return TRUE;
#if defined GDK_WINDOWING_X11 || defined GDK_WINDOWING_WIN32
case GDK_KEY_Up:
case GDK_KEY_KP_Up:
dy = state == GDK_MOD1_MASK ? -BIG_STEP : -1;
@ -1865,7 +1864,6 @@ key_press (GtkWidget *invisible,
case GDK_KEY_KP_Right:
dx = state == GDK_MOD1_MASK ? BIG_STEP : 1;
break;
#endif
default:
return FALSE;

View File

@ -266,8 +266,8 @@ static void gtk_combo_box_get_property (GObject *object,
GValue *value,
GParamSpec *spec);
static void gtk_combo_box_state_changed (GtkWidget *widget,
GtkStateType previous);
static void gtk_combo_box_state_flags_changed (GtkWidget *widget,
GtkStateFlags previous);
static void gtk_combo_box_grab_focus (GtkWidget *widget);
static void gtk_combo_box_style_updated (GtkWidget *widget);
static void gtk_combo_box_button_toggled (GtkWidget *widget,
@ -493,7 +493,7 @@ gtk_combo_box_class_init (GtkComboBoxClass *klass)
widget_class->mnemonic_activate = gtk_combo_box_mnemonic_activate;
widget_class->grab_focus = gtk_combo_box_grab_focus;
widget_class->style_updated = gtk_combo_box_style_updated;
widget_class->state_changed = gtk_combo_box_state_changed;
widget_class->state_flags_changed = gtk_combo_box_state_flags_changed;
widget_class->get_preferred_width = gtk_combo_box_get_preferred_width;
widget_class->get_preferred_height = gtk_combo_box_get_preferred_height;
widget_class->get_preferred_height_for_width = gtk_combo_box_get_preferred_height_for_width;
@ -1250,8 +1250,8 @@ gtk_combo_box_get_property (GObject *object,
}
static void
gtk_combo_box_state_changed (GtkWidget *widget,
GtkStateType previous)
gtk_combo_box_state_flags_changed (GtkWidget *widget,
GtkStateFlags previous)
{
GtkComboBox *combo_box = GTK_COMBO_BOX (widget);
GtkComboBoxPrivate *priv = combo_box->priv;
@ -1347,6 +1347,8 @@ gtk_combo_box_style_updated (GtkWidget *widget)
GtkComboBoxPrivate *priv = combo_box->priv;
GtkWidget *child;
GTK_WIDGET_CLASS (gtk_combo_box_parent_class)->style_updated (widget);
gtk_combo_box_check_appearance (combo_box);
if (priv->tree_view && priv->cell_view)

View File

@ -408,10 +408,11 @@ gtk_combo_box_text_insert_text (GtkComboBoxText *combo_box,
/**
* gtk_combo_box_text_append:
* @combo_box: A #GtkComboBoxText
* @id: (allow-none): a string ID for this value, or %NULL
* @text: A string
*
* Appends @text to the list of strings stored in @combo_box. If @id is
* non-%NULL then it is used as the ID of the row.
* Appends @text to the list of strings stored in @combo_box.
* If @id is non-%NULL then it is used as the ID of the row.
*
* This is the same as calling gtk_combo_box_text_insert() with a
* position of -1.
@ -432,8 +433,8 @@ gtk_combo_box_text_append (GtkComboBoxText *combo_box,
* @id: (allow-none): a string ID for this value, or %NULL
* @text: a string
*
* Prepends @text to the list of strings stored in @combo_box. If @id
* is non-%NULL then it is used as the ID of the row.
* Prepends @text to the list of strings stored in @combo_box.
* If @id is non-%NULL then it is used as the ID of the row.
*
* This is the same as calling gtk_combo_box_text_insert() with a
* position of 0.

View File

@ -1004,8 +1004,9 @@ gtk_container_child_set_valist (GtkContainer *container,
G_OBJECT_TYPE_NAME (container));
break;
}
g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (pspec));
G_VALUE_COLLECT (&value, var_args, 0, &error);
G_VALUE_COLLECT_INIT (&value, G_PARAM_SPEC_VALUE_TYPE (pspec),
var_args, 0, &error);
if (error)
{
g_warning ("%s: %s", G_STRLOC, error);

View File

@ -3903,6 +3903,7 @@ gtk_css_provider_get_default (void)
"}\n"
"\n"
".trough {\n"
" background-color: darker (@bg_color);\n"
" border-style: inset;\n"
" border-width: 1;\n"
" padding: 0;\n"

View File

@ -508,6 +508,8 @@ gtk_dialog_map (GtkWidget *widget)
static void
gtk_dialog_style_updated (GtkWidget *widget)
{
GTK_WIDGET_CLASS (gtk_dialog_parent_class)->style_updated (widget);
update_spacings (GTK_DIALOG (widget));
}

View File

@ -34,7 +34,7 @@
#include "gtkdnd.h"
#include "gtkiconfactory.h"
#include "gtkicontheme.h"
#include "gtkimage.h"
#include "gtkimageprivate.h"
#include "gtkinvisible.h"
#include "gtkmain.h"
#include "gtkplug.h"

View File

@ -41,7 +41,7 @@
#include "gtkdnd.h"
#include "gtkiconfactory.h"
#include "gtkicontheme.h"
#include "gtkimage.h"
#include "gtkimageprivate.h"
#include "gtkinvisible.h"
#include "gtkmain.h"
#include "gtkplug.h"
@ -465,7 +465,7 @@ grab_dnd_keys (GtkWidget *widget,
}
gdk_flush ();
gdk_error_trap_pop ();
gdk_error_trap_pop_ignored ();
gdk_window_add_filter (NULL, root_key_filter, (gpointer) GDK_WINDOW_XID (window));
}
@ -495,7 +495,7 @@ ungrab_dnd_keys (GtkWidget *widget,
}
gdk_flush ();
gdk_error_trap_pop ();
gdk_error_trap_pop_ignored ();
}
#else /* GDK_WINDOWING_X11 && !XINPUT_2 */
@ -964,15 +964,15 @@ gtk_drag_update_cursor (GtkDragSourceInfo *info)
* @widget: a #GtkWidget
* @context: drag context
* @target: format to retrieve the data in.
* @time: timestamp of triggering event.
* @time_: timestamp of triggering event.
*
* Get the data for a drag or drop
*/
void
void
gtk_drag_get_data (GtkWidget *widget,
GdkDragContext *context,
GdkAtom target,
guint32 time)
guint32 time_)
{
GtkWidget *selection_widget;
@ -983,7 +983,7 @@ gtk_drag_get_data (GtkWidget *widget,
g_object_ref (context);
g_object_ref (widget);
g_signal_connect (selection_widget, "selection-received",
G_CALLBACK (gtk_drag_selection_received), widget);
@ -992,7 +992,7 @@ gtk_drag_get_data (GtkWidget *widget,
gtk_selection_convert (selection_widget,
gdk_drag_get_selection (context),
target,
time);
time_);
}
@ -4046,7 +4046,6 @@ gtk_drag_update (GtkDragSourceInfo *info,
static void
gtk_drag_end (GtkDragSourceInfo *info, guint32 time)
{
GdkEvent *send_event;
GtkWidget *source_widget = info->widget;
GdkDevice *pointer, *keyboard;
@ -4091,28 +4090,32 @@ gtk_drag_end (GtkDragSourceInfo *info, guint32 time)
ungrab_dnd_keys (info->ipc_widget, keyboard, time);
gtk_device_grab_remove (info->ipc_widget, pointer);
/* Send on a release pair to the original
* widget to convince it to release its grab. We need to
* call gtk_propagate_event() here, instead of
* gtk_widget_event() because widget like GtkList may
* expect propagation.
*/
if (gtk_widget_get_realized (source_widget))
{
GdkEvent *send_event;
send_event = gdk_event_new (GDK_BUTTON_RELEASE);
send_event->button.window = g_object_ref (gtk_widget_get_root_window (source_widget));
send_event->button.send_event = TRUE;
send_event->button.time = time;
send_event->button.x = 0;
send_event->button.y = 0;
send_event->button.axes = NULL;
send_event->button.state = 0;
send_event->button.button = info->button;
send_event->button.device = pointer;
send_event->button.x_root = 0;
send_event->button.y_root = 0;
/* Send on a release pair to the original widget to convince it
* to release its grab. We need to call gtk_propagate_event()
* here, instead of gtk_widget_event() because widget like
* GtkList may expect propagation.
*/
gtk_propagate_event (source_widget, send_event);
gdk_event_free (send_event);
send_event = gdk_event_new (GDK_BUTTON_RELEASE);
send_event->button.window = g_object_ref (gtk_widget_get_root_window (source_widget));
send_event->button.send_event = TRUE;
send_event->button.time = time;
send_event->button.x = 0;
send_event->button.y = 0;
send_event->button.axes = NULL;
send_event->button.state = 0;
send_event->button.button = info->button;
send_event->button.device = pointer;
send_event->button.x_root = 0;
send_event->button.y_root = 0;
gtk_propagate_event (source_widget, send_event);
gdk_event_free (send_event);
}
}
/*************************************************************

View File

@ -515,7 +515,6 @@ static void gtk_entry_draw_cursor (GtkEntry *entry,
static PangoLayout *gtk_entry_ensure_layout (GtkEntry *entry,
gboolean include_preedit);
static void gtk_entry_reset_layout (GtkEntry *entry);
static void gtk_entry_queue_draw (GtkEntry *entry);
static void gtk_entry_recompute (GtkEntry *entry);
static gint gtk_entry_find_position (GtkEntry *entry,
gint x);
@ -1866,7 +1865,6 @@ gtk_entry_set_property (GObject *object,
{
GtkEntry *entry = GTK_ENTRY (object);
GtkEntryPrivate *priv = entry->priv;
GtkWidget *widget;
switch (prop_id)
{
@ -1880,7 +1878,8 @@ gtk_entry_set_property (GObject *object,
if (new_value != priv->editable)
{
widget = GTK_WIDGET (entry);
GtkWidget *widget = GTK_WIDGET (entry);
if (!new_value)
{
_gtk_entry_reset_im_context (entry);
@ -1896,7 +1895,7 @@ gtk_entry_set_property (GObject *object,
if (new_value && gtk_widget_has_focus (widget))
gtk_im_context_focus_in (priv->im_context);
gtk_entry_queue_draw (entry);
gtk_widget_queue_draw (widget);
}
}
break;
@ -4469,6 +4468,8 @@ gtk_entry_style_updated (GtkWidget *widget)
gint focus_width;
gboolean interior_focus;
GTK_WIDGET_CLASS (gtk_entry_parent_class)->style_updated (widget);
gtk_widget_style_get (widget,
"focus-line-width", &focus_width,
"interior-focus", &interior_focus,
@ -5370,8 +5371,8 @@ recompute_idle_func (gpointer data)
if (gtk_widget_has_screen (GTK_WIDGET (entry)))
{
gtk_entry_adjust_scroll (entry);
gtk_entry_queue_draw (entry);
gtk_widget_queue_draw (GTK_WIDGET (entry));
update_im_cursor_location (entry);
}
@ -5845,14 +5846,6 @@ gtk_entry_draw_cursor (GtkEntry *entry,
}
}
static void
gtk_entry_queue_draw (GtkEntry *entry)
{
if (gtk_widget_is_drawable (GTK_WIDGET (entry)))
gdk_window_invalidate_rect (gtk_widget_get_window (GTK_WIDGET (entry)),
NULL, FALSE);
}
void
_gtk_entry_reset_im_context (GtkEntry *entry)
{

View File

@ -656,6 +656,8 @@ gtk_font_selection_screen_changed (GtkWidget *widget,
static void
gtk_font_selection_style_updated (GtkWidget *widget)
{
GTK_WIDGET_CLASS (gtk_font_selection_parent_class)->style_updated (widget);
/* Maybe fonts where installed or removed... */
gtk_font_selection_reload_fonts (GTK_FONT_SELECTION (widget));
}

View File

@ -512,6 +512,8 @@ gtk_handle_box_style_updated (GtkWidget *widget)
GtkHandleBox *hb = GTK_HANDLE_BOX (widget);
GtkHandleBoxPrivate *priv = hb->priv;
GTK_WIDGET_CLASS (gtk_handle_box_parent_class)->style_updated (widget);
if (gtk_widget_get_realized (widget) &&
gtk_widget_get_has_window (widget))
{

View File

@ -738,21 +738,19 @@ gtk_icon_theme_set_search_path (GtkIconTheme *icon_theme,
/**
* gtk_icon_theme_get_search_path:
* @icon_theme: a #GtkIconTheme
* @path: (allow-none) (array length=n_elements) (element-type filename) (out):
* location to store a list of icon theme path directories or %NULL .
* The stored value should be freed with g_strfreev().
* @n_elements: location to store number of elements
* in @path, or %NULL
*
* location to store a list of icon theme path directories or %NULL.
* The stored value should be freed with g_strfreev().
* @n_elements: location to store number of elements in @path, or %NULL
*
* Gets the current search path. See gtk_icon_theme_set_search_path().
*
* Since: 2.4
**/
*/
void
gtk_icon_theme_get_search_path (GtkIconTheme *icon_theme,
gchar **path[],
gint *n_elements)
gtk_icon_theme_get_search_path (GtkIconTheme *icon_theme,
gchar **path[],
gint *n_elements)
{
GtkIconThemePrivate *priv;
int i;
@ -3055,7 +3053,7 @@ gdk_color_to_css (GdkColor *color)
}
static gchar *
gdk_rgba_to_css (GdkRGBA *color)
gdk_rgba_to_css (const GdkRGBA *color)
{
/* drop alpha for now, since librsvg does not understand rgba() */
return g_strdup_printf ("rgb(%d,%d,%d)",
@ -3177,13 +3175,13 @@ _gtk_icon_info_load_symbolic_internal (GtkIconInfo *icon_info,
* Since: 3.0
**/
GdkPixbuf *
gtk_icon_info_load_symbolic (GtkIconInfo *icon_info,
GdkRGBA *fg,
GdkRGBA *success_color,
GdkRGBA *warning_color,
GdkRGBA *error_color,
gboolean *was_symbolic,
GError **error)
gtk_icon_info_load_symbolic (GtkIconInfo *icon_info,
const GdkRGBA *fg,
const GdkRGBA *success_color,
const GdkRGBA *warning_color,
const GdkRGBA *error_color,
gboolean *was_symbolic,
GError **error)
{
GdkPixbuf *pixbuf;
gchar *css_fg;

View File

@ -179,10 +179,10 @@ GdkPixbuf * gtk_icon_info_get_builtin_pixbuf (GtkIconInfo *icon_info
GdkPixbuf * gtk_icon_info_load_icon (GtkIconInfo *icon_info,
GError **error);
GdkPixbuf * gtk_icon_info_load_symbolic (GtkIconInfo *icon_info,
GdkRGBA *fg,
GdkRGBA *success_color,
GdkRGBA *warning_color,
GdkRGBA *error_color,
const GdkRGBA *fg,
const GdkRGBA *success_color,
const GdkRGBA *warning_color,
const GdkRGBA *error_color,
gboolean *was_symbolic,
GError **error);
GdkPixbuf * gtk_icon_info_load_symbolic_for_context (GtkIconInfo *icon_info,

View File

@ -1479,6 +1479,8 @@ gtk_icon_view_state_flags_changed (GtkWidget *widget,
static void
gtk_icon_view_style_updated (GtkWidget *widget)
{
GTK_WIDGET_CLASS (gtk_icon_view_parent_class)->style_updated (widget);
_gtk_icon_view_update_background (GTK_ICON_VIEW (widget));
gtk_widget_queue_resize (widget);
}

View File

@ -30,7 +30,7 @@
#include <string.h>
#include "gtkcontainer.h"
#include "gtkimage.h"
#include "gtkimageprivate.h"
#include "gtkiconfactory.h"
#include "gtkstock.h"
#include "gtkicontheme.h"
@ -2002,13 +2002,9 @@ gtk_image_get_preferred_height (GtkWidget *widget,
static void
gtk_image_style_updated (GtkWidget *widget)
{
GtkImage *image;
image = GTK_IMAGE (widget);
GTK_WIDGET_CLASS (gtk_image_parent_class)->style_updated (widget);
icon_theme_changed (image);
icon_theme_changed (GTK_IMAGE (widget));
}
static void

View File

@ -50,49 +50,6 @@ typedef struct _GtkImage GtkImage;
typedef struct _GtkImagePrivate GtkImagePrivate;
typedef struct _GtkImageClass GtkImageClass;
typedef struct _GtkImagePixbufData GtkImagePixbufData;
typedef struct _GtkImageStockData GtkImageStockData;
typedef struct _GtkImageIconSetData GtkImageIconSetData;
typedef struct _GtkImageAnimationData GtkImageAnimationData;
typedef struct _GtkImageIconNameData GtkImageIconNameData;
typedef struct _GtkImageGIconData GtkImageGIconData;
struct _GtkImagePixbufData
{
GdkPixbuf *pixbuf;
};
struct _GtkImageStockData
{
gchar *stock_id;
};
struct _GtkImageIconSetData
{
GtkIconSet *icon_set;
};
struct _GtkImageAnimationData
{
GdkPixbufAnimation *anim;
GdkPixbufAnimationIter *iter;
guint frame_timeout;
};
struct _GtkImageIconNameData
{
gchar *icon_name;
GdkPixbuf *pixbuf;
guint theme_change_id;
};
struct _GtkImageGIconData
{
GIcon *icon;
GdkPixbuf *pixbuf;
guint theme_change_id;
};
/**
* GtkImageType:
* @GTK_IMAGE_EMPTY: there is no image displayed by the widget

82
gtk/gtkimageprivate.h Normal file
View File

@ -0,0 +1,82 @@
/* GTK - The GIMP Toolkit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/*
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#ifndef __GTK_IMAGE_PRIVATE_H__
#define __GTK_IMAGE_PRIVATE_H__
#include "gtkimage.h"
G_BEGIN_DECLS
typedef struct _GtkImagePixbufData GtkImagePixbufData;
typedef struct _GtkImageStockData GtkImageStockData;
typedef struct _GtkImageIconSetData GtkImageIconSetData;
typedef struct _GtkImageAnimationData GtkImageAnimationData;
typedef struct _GtkImageIconNameData GtkImageIconNameData;
typedef struct _GtkImageGIconData GtkImageGIconData;
struct _GtkImagePixbufData
{
GdkPixbuf *pixbuf;
};
struct _GtkImageStockData
{
gchar *stock_id;
};
struct _GtkImageIconSetData
{
GtkIconSet *icon_set;
};
struct _GtkImageAnimationData
{
GdkPixbufAnimation *anim;
GdkPixbufAnimationIter *iter;
guint frame_timeout;
};
struct _GtkImageIconNameData
{
gchar *icon_name;
GdkPixbuf *pixbuf;
guint theme_change_id;
};
struct _GtkImageGIconData
{
GIcon *icon;
GdkPixbuf *pixbuf;
guint theme_change_id;
};
G_END_DECLS
#endif /* __GTK_IMAGE_H__ */

View File

@ -495,6 +495,8 @@ gtk_info_bar_style_updated (GtkWidget *widget)
gint content_area_spacing;
gint content_area_border;
GTK_WIDGET_CLASS (gtk_info_bar_parent_class)->style_updated (widget);
gtk_widget_style_get (widget,
"button-spacing", &button_spacing,
"action-area-border", &action_area_border,

Some files were not shown because too many files have changed in this diff Show More