Compare commits
194 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 78c0b1da9f | |||
| e2dfd6296d | |||
| 0ee8c43f8f | |||
| db55f2e16d | |||
| 2f3d2128ea | |||
| 0054bb6936 | |||
| d10c862acd | |||
| 0640d95a11 | |||
| 542533a2a5 | |||
| 205ee834ec | |||
| 3933f99ed7 | |||
| e521158973 | |||
| 42b6e47fca | |||
| 7db4bee4b6 | |||
| 9be8bbc9a0 | |||
| 8fdd8dbc35 | |||
| e3be6fc24f | |||
| 98346cc219 | |||
| b42b47e7d3 | |||
| 6619aa58b1 | |||
| 3413438d37 | |||
| d9fcc4c630 | |||
| 94c4a312c1 | |||
| 5fd5872b37 | |||
| 454c36523a | |||
| a12dad75a2 | |||
| 0cc2f93d5c | |||
| b2b73a349e | |||
| 51290e0a57 | |||
| e3774b6ff2 | |||
| 13a3954ad4 | |||
| b3ba85a01c | |||
| 0c7772f0cf | |||
| a0e1fa9e77 | |||
| 74f7e08811 | |||
| 09244b7f1d | |||
| f68faa3465 | |||
| 73bfc16aa2 | |||
| db25eda122 | |||
| 644cc23fe0 | |||
| eab3d94a43 | |||
| 9d34a9cc65 | |||
| 09bf05bd57 | |||
| 936f74c762 | |||
| f60db29f82 | |||
| 81fdf6619c | |||
| a4a2d76182 | |||
| 84bf984f85 | |||
| d07231cb7a | |||
| 120e289f56 | |||
| e2d42f3c4b | |||
| 5d3106275a | |||
| 6e553324f9 | |||
| 7fabfec533 | |||
| 287a388415 | |||
| a79f05c7be | |||
| 8effa1eb0e | |||
| f941f7b123 | |||
| d0ba16a3b2 | |||
| cfe909848d | |||
| 46903a9100 | |||
| 6f4df09a04 | |||
| 9532e96db4 | |||
| a7bcb8a4d7 | |||
| ec750bed0c | |||
| 7013406167 | |||
| 70879d345f | |||
| bbe56c1f9a | |||
| 5b7add024d | |||
| f531787875 | |||
| 56009e2226 | |||
| deeac8caf3 | |||
| 7ad7c61678 | |||
| 030b5ebf3e | |||
| 766e1d35da | |||
| 1e0327f844 | |||
| b92df453c6 | |||
| 48ad65e1dd | |||
| 374e76a19d | |||
| 2fb1c06402 | |||
| 2f0d40335b | |||
| 9b88eb356d | |||
| 3c8fc21e9b | |||
| 497b66a5ab | |||
| de6580b38d | |||
| 3f0d330a65 | |||
| 75a05621bf | |||
| 9389054da2 | |||
| b29af18a26 | |||
| 99812be7d7 | |||
| 6869ff26f3 | |||
| 2f7245699b | |||
| ba02ae72fa | |||
| eb7e81ddd6 | |||
| 8ed7494948 | |||
| 889dc8111b | |||
| e7e3702a22 | |||
| 0a5e8ce685 | |||
| d45a0114a5 | |||
| cbbfe48ee4 | |||
| f710cca49d | |||
| 80e1340e51 | |||
| ceeaf183a1 | |||
| ce1244fdd7 | |||
| 0b7496558d | |||
| 0c5ceaf757 | |||
| f430a306f7 | |||
| 687ac4d4aa | |||
| 474ed78b25 | |||
| da27cae045 | |||
| a1c297a310 | |||
| fe372ddf5e | |||
| 6d5cdad56e | |||
| 204d1fd0a6 | |||
| 729c823955 | |||
| 714d9bc407 | |||
| e6a51e4afb | |||
| 34b573b07c | |||
| 6095598c39 | |||
| bb7662392d | |||
| fe687e760e | |||
| b208b9c0e9 | |||
| ebb18e65c3 | |||
| 64c79c15a6 | |||
| a29b4c6a51 | |||
| cb0fac73a5 | |||
| 234b3b2c6f | |||
| 9f895aa3ad | |||
| 77ff699226 | |||
| 09d395f629 | |||
| 4dab3a601d | |||
| 2bd38dc7f5 | |||
| 2f207ca749 | |||
| 5f43a51a83 | |||
| 62fd79b224 | |||
| f482d4dc89 | |||
| 07e62229da | |||
| 0e77486e91 | |||
| e28a2695ac | |||
| c444ccf531 | |||
| 477ff06b25 | |||
| 837583eb36 | |||
| 6893aa9c25 | |||
| d9ebdb7610 | |||
| a530f88234 | |||
| 9438107bff | |||
| c35fb706bd | |||
| 4a5c435e9a | |||
| f793626a53 | |||
| 27e8df0c2c | |||
| 85fe2ce17f | |||
| 9f78fd22bc | |||
| 46f0994417 | |||
| ac61edb9fc | |||
| fed55eaf36 | |||
| 77ad5096a9 | |||
| 4392c0e9b5 | |||
| 22876d789c | |||
| cc92d6da03 | |||
| ccc3d874ef | |||
| 8e420bca02 | |||
| e9319c6182 | |||
| 867dc0bd0d | |||
| d790fd4fdd | |||
| 8f6a8441a2 | |||
| 1cba79677c | |||
| d8d31c60ca | |||
| abc8ac1a8b | |||
| 00a3685f41 | |||
| 6cf78a12c1 | |||
| 06864ba656 | |||
| 35644cab9e | |||
| 708357001a | |||
| 6f4adebcef | |||
| d0f51577a4 | |||
| e62b68fe62 | |||
| 9d14edf760 | |||
| 8ba35bc381 | |||
| 890e4511aa | |||
| 92c8a3e0e1 | |||
| 985b0e57b2 | |||
| 04248fbd39 | |||
| b23839c7a5 | |||
| 9d85d87f05 | |||
| df78c9ee66 | |||
| 7e29fc5b42 | |||
| 04494c5df0 | |||
| 66593ef569 | |||
| eaca2ea5e8 | |||
| cbd313c237 | |||
| 89eb869ecf | |||
| 290c34b232 | |||
| 8709c86944 | |||
| f79266092b |
@@ -6,17 +6,18 @@ first need to use some Unix-like environment or manual work to expand
|
||||
the files needed, like config.h.win32.in into config.h.win32 and the
|
||||
.vcprojin files here into corresponding actual .vcproj files.
|
||||
|
||||
You will need the parts from below in the GTK+ stack: pango, atk and
|
||||
glib. External dependencies are at least zlib, libpng, proxy-libintl,
|
||||
fontconfig, freetype, expat. See the corresponding README.txt file in
|
||||
glib for details where to unpack them.
|
||||
You will need the parts from below in the GTK+ stack: gdk-pixbuf, pango,
|
||||
atk and glib. External dependencies are at least zlib, libpng,
|
||||
proxy-libintl, fontconfig, freetype, expat. See the corresponding
|
||||
README.txt file in glib for details where to unpack them.
|
||||
|
||||
The "install" project will copy build results and headers into their
|
||||
appropriate location under <root>\vs9\<PlatformName>. For instance,
|
||||
built DLLs go into <root>\vs9\<PlatformName>\bin, built LIBs into
|
||||
<root>\vs9\<PlatformName>\lib and GTK+ headers into
|
||||
<root>\vs9\<PlatformName>\include\gtk-2.0. This is then from where
|
||||
<root>\vs9\<PlatformName>\include\gtk-3.0. This is then from where
|
||||
project files higher in the stack are supposed to look for them, not
|
||||
from a specific GLib source tree.
|
||||
|
||||
--Tor Lillqvist <tml@iki.fi>
|
||||
--Updated by Chun-wei Fan <fanc999 --at-- yahoo --dot-- com --dot-- tw>
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk;..\..\..\gdk\win32"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\win32"
|
||||
PreprocessorDefinitions="_DEBUG;$(GdkDefines);INSIDE_GDK_WIN32"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
@@ -52,7 +52,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk;..\..\..\gdk\win32"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\win32"
|
||||
PreprocessorDefinitions="$(GdkDefines);INSIDE_GDK_WIN32"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
@@ -72,7 +72,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk;..\..\..\gdk\win32"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\win32"
|
||||
PreprocessorDefinitions="_DEBUG;$(GdkDefines);INSIDE_GDK_WIN32"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
@@ -93,7 +93,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk;..\..\..\gdk\win32"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\win32"
|
||||
PreprocessorDefinitions="$(GdkDefines);INSIDE_GDK_WIN32"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\win32"
|
||||
PreprocessorDefinitions="_DEBUG;$(GdkDefines)"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
@@ -63,7 +63,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk;..\..\..\gdk\win32"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\win32"
|
||||
PreprocessorDefinitions="$(GdkDefines)"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
@@ -96,7 +96,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk;..\..\..\gdk\win32"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\win32"
|
||||
PreprocessorDefinitions="_DEBUG;$(GdkDefines)"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
@@ -128,7 +128,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk;..\..\..\gdk\win32"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\win32"
|
||||
PreprocessorDefinitions="$(GdkDefines)"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
|
||||
@@ -270,6 +270,7 @@ copy ..\..\..\gtk\gtksymboliccolor.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk&
|
||||
copy ..\..\..\gtk\gtktable.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtktearoffmenuitem.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtktestutils.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtktextattributes.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtktextbuffer.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtktextbufferrichtext.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
copy ..\..\..\gtk\gtktextchild.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
@@ -316,7 +317,7 @@ copy ..\..\..\gtk\gtkwidgetpath.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk�
|
||||
copy ..\..\..\gtk\gtkwindow.h $(OutDir)\include\gtk-$(GtkApiVersion)\gtk

|
||||
|
||||
mkdir $(OutDir)\lib\gtk-$(GtkApiVersion)\include

|
||||
copy ..\..\..\gdk\gdkconfig.h $(OutDir)\include\gdk

|
||||
copy ..\..\..\gdk\gdkconfig.h $(OutDir)\include\gtk-3.0\gdk

|
||||
|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\*-$(GtkApiVersion).lib $(OutDir)\lib

|
||||
"
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk;..\..\..\gtk"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gtk"
|
||||
PreprocessorDefinitions="_DEBUG;$(GtkPrefixDefine)"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
@@ -64,7 +64,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk;..\..\..\gtk"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gtk"
|
||||
PreprocessorDefinitions="_DEBUG;$(GtkPrefixDefine)"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
@@ -97,7 +97,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk;..\..\..\gtk"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gtk"
|
||||
PreprocessorDefinitions="$(GtkPrefixDefine)"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
@@ -130,7 +130,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk-pixbuf;..\..\..\gdk;..\..\..\gtk"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gtk"
|
||||
PreprocessorDefinitions="$(GtkPrefixDefine)"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\win32;..\..\..\gtk"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gtk"
|
||||
PreprocessorDefinitions="_DEBUG;$(GtkDefines)"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
@@ -63,7 +63,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\win32;..\..\..\gtk"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\win32"
|
||||
PreprocessorDefinitions="$(GtkDefines)"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
@@ -96,7 +96,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\win32;..\..\..\gtk"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\win32"
|
||||
PreprocessorDefinitions="_DEBUG;$(GtkDefines)"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
@@ -128,7 +128,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\win32;..\..\..\gtk"
|
||||
AdditionalIncludeDirectories="..\..\..\gdk;..\..\..\gdk\win32"
|
||||
PreprocessorDefinitions="$(GtkDefines)"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
@@ -137,7 +137,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="cairo.lib atk-1.0.lib pango-1.0.lib pangocairo-1.0.lib pangowin32-1.0.lib imm32.lib winspool.lib comctl32.lib"
|
||||
AdditionalDependencies="atk-1.0.lib pangowin32-1.0.lib imm32.lib winspool.lib comctl32.lib"
|
||||
OutputFile="$(OutDir)\$(GtkDllPrefix)$(ProjectName)-win32$(GtkDllSuffix).dll"
|
||||
LinkIncremental="2"
|
||||
ModuleDefinitionFile="$(IntDir)\gtk.def"
|
||||
|
||||
+12
-3
@@ -10,7 +10,7 @@
|
||||
|
||||
m4_define([gtk_major_version], [2])
|
||||
m4_define([gtk_minor_version], [99])
|
||||
m4_define([gtk_micro_version], [2])
|
||||
m4_define([gtk_micro_version], [3])
|
||||
m4_define([gtk_interface_age], [0])
|
||||
m4_define([gtk_binary_age],
|
||||
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
|
||||
@@ -242,6 +242,13 @@ AC_ARG_ENABLE(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]),,
|
||||
[enable_gtk2_dependency=no])
|
||||
|
||||
AM_CONDITIONAL(BUILD_ICON_CACHE, [test "x$enable_gtk2_dependency" = xno])
|
||||
|
||||
AC_ARG_ENABLE(xkb,
|
||||
[AC_HELP_STRING([--enable-xkb],
|
||||
[support XKB extension [default=maybe]])],,
|
||||
@@ -875,13 +882,15 @@ dnl Look for a host system's gdk-pixbuf-csource if we are cross-compiling
|
||||
|
||||
AM_CONDITIONAL(CROSS_COMPILING, test $cross_compiling = yes)
|
||||
|
||||
if test $cross_compiling = yes; then
|
||||
if test "x$cross_compiling" = xyes || test "x$enable_gtk2_dependency" = xyes; then
|
||||
AC_PATH_PROG(GTK_UPDATE_ICON_CACHE, gtk-update-icon-cache, no)
|
||||
if test x$GTK_UPDATE_ICON_CACHE = xno; then
|
||||
REBUILD_PNGS=#
|
||||
fi
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(USE_EXTERNAL_ICON_CACHE, [test "x$cross_compiling" = xyes || test "x$enable_gtk2_dependency" = xyes])
|
||||
|
||||
AC_PATH_PROG(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource, no)
|
||||
|
||||
if test ! -f $srcdir/gtk/gtkbuiltincache.h &&
|
||||
@@ -1502,7 +1511,7 @@ GLIB_GSETTINGS
|
||||
# GObject introspection
|
||||
##################################################
|
||||
|
||||
GOBJECT_INTROSPECTION_CHECK([0.9.3])
|
||||
GOBJECT_INTROSPECTION_CHECK([0.10.1])
|
||||
|
||||
##################################################
|
||||
# Packagekit module
|
||||
|
||||
@@ -135,7 +135,6 @@ content_files = \
|
||||
x11.sgml \
|
||||
gtk-query-immodules-3.0.xml \
|
||||
gtk-update-icon-cache.xml \
|
||||
gtk-builder-convert.xml \
|
||||
visual_index.xml \
|
||||
getting_started.xml \
|
||||
overview.xml
|
||||
@@ -329,6 +328,8 @@ HTML_IMAGES = \
|
||||
$(srcdir)/images/layout-tbrl.png \
|
||||
$(srcdir)/images/window-default.png \
|
||||
$(srcdir)/images/hello-world.png \
|
||||
$(srcdir)/images/grid-packing.png \
|
||||
$(srcdir)/images/drawing.png \
|
||||
$(srcdir)/images/switch.png \
|
||||
$(srcdir)/images/linear.png \
|
||||
$(srcdir)/images/ease.png \
|
||||
@@ -374,8 +375,7 @@ EXTRA_DIST += version.xml.in
|
||||
|
||||
man_MANS = \
|
||||
gtk-query-immodules-3.0.1 \
|
||||
gtk-update-icon-cache.1 \
|
||||
gtk-builder-convert.1
|
||||
gtk-update-icon-cache.1
|
||||
|
||||
if ENABLE_MAN
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
||||
]>
|
||||
<refentry id="gtk-building" revision="6 Sept 2001">
|
||||
<refentry id="gtk-building">
|
||||
<refmeta>
|
||||
<refentrytitle>Compiling the GTK+ libraries</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
@@ -363,6 +363,10 @@ How to compile GTK+ itself
|
||||
<group>
|
||||
<arg>--enable-introspection=[no/auto/yes]</arg>
|
||||
</group>
|
||||
<group>
|
||||
<arg>--enable-gtk2-dependency</arg>
|
||||
<arg>--disable-gtk2-dependency</arg>
|
||||
</group>
|
||||
</cmdsynopsis>
|
||||
</para>
|
||||
|
||||
@@ -559,6 +563,7 @@ How to compile GTK+ itself
|
||||
supported backends are the quartz backend for OS X.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
<title><systemitem>--enable-introspection</systemitem></title>
|
||||
|
||||
@@ -567,6 +572,19 @@ How to compile GTK+ itself
|
||||
The default is 'auto'.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
<title><systemitem>--enable-gtk2-dependency</systemitem> or
|
||||
<systemitem>--disable-gtk2-dependency</systemitem></title>
|
||||
|
||||
<para>
|
||||
Whether to rely on an exiting gtk-update-icon-cache utility
|
||||
instead of building our own. Distributions which are shipping
|
||||
both GTK+ 2.x and GTK+ 3 may want to use this option to
|
||||
avoid file conflicts between these packages.
|
||||
The default is to build gtk-update-icon-cache.
|
||||
</para>
|
||||
</formalpara>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
||||
]>
|
||||
<refentry id="gtk-compiling" revision="4 Feb 2001">
|
||||
<refentry id="gtk-compiling">
|
||||
<refmeta>
|
||||
<refentrytitle>Compiling GTK+ Applications</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
|
||||
@@ -12,97 +12,226 @@
|
||||
<link linkend="gtk-compiling">Compiling the GTK+ libraries</link>
|
||||
section in this reference.</para>
|
||||
|
||||
<para>To begin our introduction to GTK, we'll start with the simplest
|
||||
program possible. This program will create an empty 200x200 pixel
|
||||
window:</para>
|
||||
<simplesect>
|
||||
<title>Basics</title>
|
||||
|
||||
<para>
|
||||
<inlinegraphic fileref="window-default.png" format="PNG"></inlinegraphic>
|
||||
</para>
|
||||
<para>To begin our introduction to GTK, we'll start with the simplest
|
||||
program possible. This program will create an empty 200x200 pixel
|
||||
window:</para>
|
||||
|
||||
<informalexample><programlisting>
|
||||
<xi:include href="../../../../examples/window-default.c" parse="text">
|
||||
<xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
|
||||
</xi:include>
|
||||
</programlisting></informalexample>
|
||||
<para>
|
||||
<inlinegraphic fileref="window-default.png" format="PNG"></inlinegraphic>
|
||||
</para>
|
||||
|
||||
<para>You can compile the program above with GCC using:</para>
|
||||
|
||||
<para><literallayout>
|
||||
<literal>gcc `pkg-config --cflags gtk+-3.0` -o window-default window-default.c `pkg-config --libs gtk+-3.0`</literal>
|
||||
</literallayout></para>
|
||||
|
||||
<note><para>For more information on how to compile a GTK+ application, please
|
||||
refer to the <link linkend="gtk-compiling">Compiling GTK+ Applications</link>
|
||||
section in this reference.</para></note>
|
||||
|
||||
<para>All GTK+ applications will, of course, include
|
||||
<filename>gtk/gtk.h</filename>, which declares functions, types and
|
||||
macros required by GTK+ applications.</para>
|
||||
|
||||
<warning><para>Even if GTK+ installs multiple header files, only the
|
||||
top-level <filename>gtk/gtk.h</filename> header can be directly included
|
||||
by third party code. The compiler will abort with an error if any other
|
||||
header is directly included.</para></warning>
|
||||
|
||||
<para>We then proceed into the <function>main</function>() function of the
|
||||
application, and we declare a <varname>window</varname> variable as a pointer
|
||||
of type #GtkWidget.</para>
|
||||
|
||||
<para>The following line will call gtk_init(), which
|
||||
is the initialization function for GTK+; this function will set up GTK+,
|
||||
the type system, the connection to the windowing environment, etc. The
|
||||
gtk_init() takes as arguments the pointers to the command line arguments
|
||||
counter and string array; this allows GTK+ to parse specific command line
|
||||
arguments that control the behavior of GTK+ itself. The parsed arguments
|
||||
will be removed from the array, leaving the unrecognized ones for your
|
||||
application to parse.</para>
|
||||
|
||||
<note><para>For more information on which command line arguments GTK+
|
||||
recognizes, please refer to the <link linkend="gtk-running">Running GTK+
|
||||
Applications</link> section in this reference.</para></note>
|
||||
|
||||
<para>The call to gtk_window_new() will create a new #GtkWindow and store
|
||||
it inside the <varname>window</varname> variable. The type of the window
|
||||
is %GTK_WINDOW_TOPLEVEL, which means that the #GtkWindow will be managed
|
||||
by the windowing system: it will have a frame, a title bar and window
|
||||
controls, depending on the platform.</para>
|
||||
|
||||
<para>In order to terminate the application when the #GtkWindow is
|
||||
destroyed, we connect the #GtkWidget::destroy signal to the gtk_main_quit()
|
||||
function. This function will terminate the GTK+ main loop started by calling
|
||||
gtk_main() later. The #GtkWidget::destroy signal is emitted when a widget is
|
||||
destroyed, either by explicitly calling gtk_widget_destroy() or when the
|
||||
widget is unparented. Top-level #GtkWindow<!-- -->s are also destroyed when
|
||||
the Close window control button is clicked.</para>
|
||||
|
||||
<para>#GtkWidget<!-- -->s are hidden by default. By calling gtk_widget_show()
|
||||
on a #GtkWidget we are asking GTK+ to set the visibility attribute so that it
|
||||
can be displayed. All this work is done after the main loop has been
|
||||
started.</para>
|
||||
|
||||
<para>The last line of interest is the call to gtk_main(). This function will
|
||||
start the GTK+ main loop and will block the control flow of the
|
||||
<function>main</function>() until the gtk_main_quit() function is
|
||||
called.</para>
|
||||
|
||||
<para>The following example is slightly more complex, and tries to
|
||||
showcase some of the capabilities of GTK+.</para>
|
||||
|
||||
<para>In the long tradition of programming languages and libraries,
|
||||
it is called <emphasis>Hello, World</emphasis>.</para>
|
||||
|
||||
<para>
|
||||
<inlinegraphic fileref="hello-world.png" format="PNG"></inlinegraphic>
|
||||
</para>
|
||||
|
||||
<example id="gtk-getting-started-hello-world">
|
||||
<title>Hello World in GTK+</title>
|
||||
<programlisting>
|
||||
<xi:include href="../../../../examples/hello-world.c" parse="text">
|
||||
<informalexample><programlisting>
|
||||
<xi:include href="../../../../examples/window-default.c" parse="text">
|
||||
<xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
|
||||
</xi:include>
|
||||
</programlisting>
|
||||
</example>
|
||||
</programlisting></informalexample>
|
||||
|
||||
<para>You can compile the program above with GCC using:</para>
|
||||
|
||||
<para><literallayout>
|
||||
<literal>gcc `pkg-config --cflags gtk+-3.0` -o window-default window-default.c `pkg-config --libs gtk+-3.0`</literal>
|
||||
</literallayout></para>
|
||||
|
||||
<note><para>For more information on how to compile a GTK+ application, please
|
||||
refer to the <link linkend="gtk-compiling">Compiling GTK+ Applications</link>
|
||||
section in this reference.</para></note>
|
||||
|
||||
<para>All GTK+ applications will, of course, include
|
||||
<filename>gtk/gtk.h</filename>, which declares functions, types and
|
||||
macros required by GTK+ applications.</para>
|
||||
|
||||
<warning><para>Even if GTK+ installs multiple header files, only the
|
||||
top-level <filename>gtk/gtk.h</filename> header can be directly included
|
||||
by third party code. The compiler will abort with an error if any other
|
||||
header is directly included.</para></warning>
|
||||
|
||||
<para>We then proceed into the <function>main</function>() function of the
|
||||
application, and we declare a <varname>window</varname> variable as a pointer
|
||||
of type #GtkWidget.</para>
|
||||
|
||||
<para>The following line will call gtk_init(), which
|
||||
is the initialization function for GTK+; this function will set up GTK+,
|
||||
the type system, the connection to the windowing environment, etc. The
|
||||
gtk_init() takes as arguments the pointers to the command line arguments
|
||||
counter and string array; this allows GTK+ to parse specific command line
|
||||
arguments that control the behavior of GTK+ itself. The parsed arguments
|
||||
will be removed from the array, leaving the unrecognized ones for your
|
||||
application to parse.</para>
|
||||
|
||||
<note><para>For more information on which command line arguments GTK+
|
||||
recognizes, please refer to the <link linkend="gtk-running">Running GTK+
|
||||
Applications</link> section in this reference.</para></note>
|
||||
|
||||
<para>The call to gtk_window_new() will create a new #GtkWindow and store
|
||||
it inside the <varname>window</varname> variable. The type of the window
|
||||
is %GTK_WINDOW_TOPLEVEL, which means that the #GtkWindow will be managed
|
||||
by the windowing system: it will have a frame, a title bar and window
|
||||
controls, depending on the platform.</para>
|
||||
|
||||
<para>In order to terminate the application when the #GtkWindow is
|
||||
destroyed, we connect the #GtkWidget::destroy signal to the gtk_main_quit()
|
||||
function. This function will terminate the GTK+ main loop started by calling
|
||||
gtk_main() later. The #GtkWidget::destroy signal is emitted when a widget is
|
||||
destroyed, either by explicitly calling gtk_widget_destroy() or when the
|
||||
widget is unparented. Top-level #GtkWindow<!-- -->s are also destroyed when
|
||||
the Close window control button is clicked.</para>
|
||||
|
||||
<para>#GtkWidget<!-- -->s are hidden by default. By calling gtk_widget_show()
|
||||
on a #GtkWidget we are asking GTK+ to set the visibility attribute so that it
|
||||
can be displayed. All this work is done after the main loop has been
|
||||
started.</para>
|
||||
|
||||
<para>The last line of interest is the call to gtk_main(). This function will
|
||||
start the GTK+ main loop and will block the control flow of the
|
||||
main() until the gtk_main_quit() function is called.</para>
|
||||
|
||||
<para>While the program is running, GTK+ is receiving
|
||||
<firstterm>events</firstterm>. These are typically input events caused by
|
||||
the user interacting with your program, but also things like messages from
|
||||
the window manager or other applications. GTK+ processes these and as a
|
||||
result, <firstterm>signals</firstterm> may be emitted on your widgets.
|
||||
Connecting handlers for these signals is how you normally make your
|
||||
program do something in response to user input.</para>
|
||||
|
||||
<para>The following example is slightly more complex, and tries to
|
||||
showcase some of the capabilities of GTK+.</para>
|
||||
|
||||
<para>In the long tradition of programming languages and libraries,
|
||||
it is called <emphasis>Hello, World</emphasis>.</para>
|
||||
|
||||
<para>
|
||||
<inlinegraphic fileref="hello-world.png" format="PNG"></inlinegraphic>
|
||||
</para>
|
||||
|
||||
<example id="gtk-getting-started-hello-world">
|
||||
<title>Hello World in GTK+</title>
|
||||
<programlisting>
|
||||
<xi:include href="../../../../examples/hello-world.c" parse="text">
|
||||
<xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
|
||||
</xi:include>
|
||||
</programlisting>
|
||||
</example>
|
||||
</simplesect>
|
||||
|
||||
<simplesect>
|
||||
<title>Packing</title>
|
||||
|
||||
<para>When creating an application, you'll want to put more than one widget
|
||||
inside a window. Our first helloworld example only used one widget so we
|
||||
could simply use a gtk_container_add() call to "pack" the widget into the
|
||||
window. But when you want to put more than one widget into a window, it
|
||||
it becomes important to control how each widget is positioned and sized.
|
||||
This is where packing comes in.</para>
|
||||
|
||||
<para>GTK+ comes with a large variety of <firstterm>layout containers</firstterm>
|
||||
whose purpose it is to control the layout of the child widgets that are
|
||||
added to them. See <xref linkend="LayoutContainers"/> for an overview.</para>
|
||||
|
||||
<para>The following example shows how the GtkGrid container lets you
|
||||
arrange several buttons:</para>
|
||||
|
||||
<para>
|
||||
<inlinegraphic fileref="grid-packing.png" format="PNG"></inlinegraphic>
|
||||
</para>
|
||||
|
||||
<example id="gtk-getting-started-grid-packing">
|
||||
<title>Packing buttons</title>
|
||||
<programlisting>
|
||||
<xi:include href="../../../../examples/grid-packing.c" parse="text">
|
||||
<xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
|
||||
</xi:include>
|
||||
</programlisting>
|
||||
</example>
|
||||
</simplesect>
|
||||
|
||||
<simplesect>
|
||||
<title>Drawing</title>
|
||||
|
||||
<para>Many widgets, like buttons, do all their drawing themselves. You
|
||||
just tell them the label you want to see, and they figure out what font
|
||||
to use, draw the button outline and focus rectangle, etc. Sometimes, it
|
||||
is necessary to do some custom drawing. In that case, a #GtkDrawingArea
|
||||
might be the right widget to use. It offers a canvas on which you can
|
||||
draw by connecting to the #GtkWidget::draw signal.
|
||||
</para>
|
||||
|
||||
<para>The contents of a widget often need to be partially or fully redrawn,
|
||||
e.g. when another window is moved and uncovers part of the widget, or
|
||||
when tie window containing it is resized. It is also possible to explicitly
|
||||
cause part or all of the widget to be redrawn, by calling
|
||||
gtk_widget_queue_draw() or its variants. GTK+ takes care of most of the
|
||||
details by providing a ready-to-use cairo context to the ::draw signal
|
||||
handler.</para>
|
||||
|
||||
<para>The following example shows a ::draw signal handler. It is a bit
|
||||
more complicated than the previous examples, since it also demonstrates
|
||||
input event handling by means of ::button-press and ::motion-notify
|
||||
handlers.</para>
|
||||
|
||||
<para>
|
||||
<inlinegraphic fileref="drawing.png" format="PNG"></inlinegraphic>
|
||||
</para>
|
||||
|
||||
<example id="gtk-getting-started-drawing">
|
||||
<title>Drawing in response to input</title>
|
||||
<programlisting>
|
||||
<xi:include href="../../../../examples/drawing.c" parse="text">
|
||||
<xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
|
||||
</xi:include>
|
||||
</programlisting>
|
||||
</example>
|
||||
</simplesect>
|
||||
|
||||
<simplesect>
|
||||
<title>Building UIs</title>
|
||||
|
||||
<para>When construcing a more complicated interface, with dozens
|
||||
or hundreds of widgets, doing all the setup work in C code is
|
||||
cumbersome, and making changes becomes next to impossible.</para>
|
||||
|
||||
<para>Thankfully, GTK+ supports the separation of user interface
|
||||
layout from your business logic, by using UI descriptions in an
|
||||
XML format that can be parsed by the #GtkBuilder class.</para>
|
||||
|
||||
<example>
|
||||
<title>Packing buttons with GtkBuilder</title>
|
||||
<programlisting>
|
||||
<xi:include href="../../../../examples/builder.c" parse="text">
|
||||
<xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
|
||||
</xi:include>
|
||||
</programlisting>
|
||||
The builder.ui file looks like this:
|
||||
<programlisting>
|
||||
<xi:include href="../../../../examples/builder.ui" parse="text">
|
||||
<xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
|
||||
</xi:include>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<para>Note that GtkBuilder can also be used to construct objects
|
||||
that are not widgets, such as tree models, adjustments, etc.
|
||||
That is the reason the method we use here is called
|
||||
gtk_builder_get_object() and returns a GObject* instead of a
|
||||
GtkWidget*.</para>
|
||||
|
||||
<para>Normally, you would pass a full path to
|
||||
gtk_builder_add_from_file() to make the execution of your program
|
||||
independent of the current directory. A common location to install
|
||||
UI descriptions and similar data is
|
||||
<filename>/usr/share/<replaceable>appname</replaceable></filename>.
|
||||
</para>
|
||||
|
||||
<para>It is also possible to embed the UI description in the source
|
||||
code as a string and use gtk_builder_add_from_string() to load it.
|
||||
But keeping the UI description in a separate file has several
|
||||
advantages: It is then possible to make minor adjustments to the UI
|
||||
without recompiling your program, and, more importantly, graphical
|
||||
UI editors such as <ulink url="http://glade.gnome.org">glade</ulink>
|
||||
can load the file and allow you to create and modify your UI by
|
||||
point-and-click.</para>
|
||||
|
||||
</simplesect>
|
||||
</chapter>
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
<refentry id="gtk-builder-convert">
|
||||
|
||||
<refmeta>
|
||||
<refentrytitle>gtk-builder-convert</refentrytitle>
|
||||
<manvolnum>1</manvolnum>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>gtk-builder-convert</refname>
|
||||
<refpurpose>Glade file conversion utility</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<cmdsynopsis>
|
||||
<command>gtk-builder-convert</command>
|
||||
<arg choice="opt">--skip-windows</arg>
|
||||
<arg choice="opt">--target-version <replaceable>version</replaceable></arg>
|
||||
<arg choice="opt">--root <replaceable>name</replaceable></arg>
|
||||
<arg choice="req">input</arg>
|
||||
<arg choice="req">output</arg>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1><title>Description</title>
|
||||
<para><command>gtk-builder-convert</command> converts glade files
|
||||
into XML files which can be loaded with GtkBuilder.
|
||||
</para>
|
||||
<para>
|
||||
It expects the name of a glade file as the first argument, and writes
|
||||
its output the file specified as the second argument.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1><title>Options</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>--skip-windows</term>
|
||||
<term>-w</term>
|
||||
<listitem><para>Convert everything but GtkWindow subclasses.</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>--target-version</term>
|
||||
<term>-t</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Some widgets and properties are different between GTK+ versions 2.0 and
|
||||
3.0, so this option allows to set the desired GTK+ target version.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>--root</term>
|
||||
<term>-r</term>
|
||||
<listitem><para>Convert only the widget named <replaceable>name</replaceable>
|
||||
and its children.</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1><title>Bugs</title>
|
||||
<para>
|
||||
Toolbars are not handled.
|
||||
</para>
|
||||
<para>
|
||||
Support for accessibility is not yet implemented.
|
||||
</para>
|
||||
<para>
|
||||
The script requires a python interpreter to run.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
@@ -358,7 +358,6 @@
|
||||
<title>GTK+ Tools</title>
|
||||
<xi:include href="gtk-query-immodules-3.0.xml" />
|
||||
<xi:include href="gtk-update-icon-cache.xml" />
|
||||
<xi:include href="gtk-builder-convert.xml" />
|
||||
</part>
|
||||
|
||||
<xi:include href="glossary.xml" />
|
||||
|
||||
@@ -2482,9 +2482,11 @@ gtk_range_set_adjustment
|
||||
gtk_range_get_inverted
|
||||
gtk_range_set_inverted
|
||||
gtk_range_get_value
|
||||
gtk_range_set_value
|
||||
gtk_range_set_increments
|
||||
gtk_range_set_range
|
||||
gtk_range_set_value
|
||||
gtk_range_get_round_digits
|
||||
gtk_range_set_round_digits
|
||||
GtkSensitivityType
|
||||
gtk_range_set_lower_stepper_sensitivity
|
||||
gtk_range_get_lower_stepper_sensitivity
|
||||
@@ -3446,6 +3448,7 @@ gtk_text_view_move_mark_onscreen
|
||||
gtk_text_view_place_cursor_onscreen
|
||||
gtk_text_view_get_visible_rect
|
||||
gtk_text_view_get_iter_location
|
||||
gtk_text_view_get_cursor_locations
|
||||
gtk_text_view_get_line_at_y
|
||||
gtk_text_view_get_line_yrange
|
||||
gtk_text_view_get_iter_at_location
|
||||
@@ -6957,6 +6960,8 @@ gtk_app_chooser_button_append_separator
|
||||
gtk_app_chooser_button_set_active_custom_item
|
||||
gtk_app_chooser_button_get_show_dialog_item
|
||||
gtk_app_chooser_button_set_show_dialog_item
|
||||
gtk_app_chooser_button_get_heading
|
||||
gtk_app_chooser_button_set_heading
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GtkAppChooserButtonClass
|
||||
@@ -6979,6 +6984,8 @@ GtkAppChooserDialog
|
||||
gtk_app_chooser_dialog_new
|
||||
gtk_app_chooser_dialog_new_for_content_type
|
||||
gtk_app_chooser_dialog_get_widget
|
||||
gtk_app_chooser_dialog_set_heading
|
||||
gtk_app_chooser_dialog_get_heading
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GtkAppChooserDialogClass
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.5 KiB |
@@ -606,6 +606,7 @@ gtk_fixed_get_preferred_height (GtkWidget *widget,
|
||||
find-and-replace task. Please refer to the following table:
|
||||
<table>
|
||||
<tgroup cols="2">
|
||||
<title>GdkRegion to cairo_region_t</title>
|
||||
<thead>
|
||||
<row><entry>GDK</entry><entry>cairo</entry></row>
|
||||
</thead>
|
||||
@@ -697,7 +698,7 @@ g_object_unref (pixbuf);
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Replace colormaps by visuals</title>
|
||||
<title>Replace GdkColormap by GdkVisual</title>
|
||||
<para>
|
||||
For drawing with cairo, it is not necessary to allocate colors, and
|
||||
a #GdkVisual provides enough information for cairo to handle colors
|
||||
@@ -746,6 +747,81 @@ on_alpha_screen_changed (GtkWindow *window,
|
||||
</example>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>GdkDrawable is gone</title>
|
||||
|
||||
<para>
|
||||
#GdkDrawable has been removed in GTK+ 3, together with #GdkPixmap
|
||||
and #GdkImage. The only remaining drawable class is #GdkWindow.
|
||||
For dealing with image data, you should use cairo surfaces or
|
||||
#GdkPixbufs.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
GdkDrawable functions that are useful with windows have been replaced
|
||||
by corresponding GdkWindow functions:
|
||||
<table>
|
||||
<title>GdkDrawable to GdkWindow</title>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row><entry>GDK 2.x</entry><entry>GDK 3</entry></row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row><entry>gdk_drawable_get_visual()</entry><entry>gdk_window_get_visual()</entry></row>
|
||||
<row><entry>gdk_drawable_get_size()</entry><entry>gdk_window_get_width()
|
||||
gdk_window_get_height()</entry></row>
|
||||
<row><entry>gdk_pixbuf_get_from_drawable()</entry><entry>gdk_pixbuf_get_from_window()</entry></row>
|
||||
<row><entry>gdk_drawable_get_clip_region()</entry><entry>gdk_window_get_clip_region()</entry></row>
|
||||
<row><entry>gdk_drawable_get_visible_region()</entry><entry>gdk_window_get_visible_region()</entry></row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Backend-specific code</title>
|
||||
<para>
|
||||
In GTK+ 2.x, GDK could only be compiled for one backend at a time,
|
||||
and the %GDK_WINDOWING_X11 or %GDK_WINDOWING_WIN32 macros could
|
||||
be used to find out which one you are dealing with:
|
||||
<informalexample><programlisting>
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
if (timestamp != GDK_CURRENT_TIME)
|
||||
gdk_x11_window_set_user_time (gdk_window, timestamp);
|
||||
#endif
|
||||
#ifdef GDK_WINDOWING_WIN32
|
||||
/* ... win32 specific code ... */
|
||||
#endif
|
||||
</programlisting></informalexample>
|
||||
In GTK+ 3, GDK can be built with multiple backends, and currently
|
||||
used backend has to be determined at runtime, typically using
|
||||
type-check macros on a #GdkDisplay or #GdkWindow. You still need
|
||||
to use the #GDK_WINDOWING macros to only compile code referring
|
||||
to supported backends:
|
||||
<informalexample><programlisting>
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
if (GDK_IS_X11_DISPLAY (display))
|
||||
{
|
||||
if (timestamp != GDK_CURRENT_TIME)
|
||||
gdk_x11_window_set_user_time (gdk_window, timestamp);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#ifdef GDK_WINDOWING_WIN32
|
||||
if (GDK_IS_WIN32_DISPLAY (display))
|
||||
{
|
||||
/* ... win32 specific code ... */
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
g_warning ("Unsupported GDK backend");
|
||||
}
|
||||
</programlisting></informalexample>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>The GtkWidget::draw signal</title>
|
||||
<para>
|
||||
|
||||
@@ -556,7 +556,24 @@
|
||||
Typically, the provider will be a #GtkCssProvider, which parse CSS
|
||||
information from a file or from a string.
|
||||
</para>
|
||||
<example>
|
||||
<title>Using a custom GtkStyleProvider</title>
|
||||
<programlisting>
|
||||
GtkStyleContext *context;
|
||||
GtkCssProvider *provider;
|
||||
|
||||
context = gtk_widget_get_style_context (widget);
|
||||
provider = gtk_css_provider_new ();
|
||||
gtk_css_provider_load_from_data (GTK_CSS_PROVIDER (provider),
|
||||
".frame1 {\n"
|
||||
" border-image: url('gradient1.png') 10 10 10 10 stretch;\n"
|
||||
"}\n", -1, NULL);
|
||||
gtk_style_context_add_provider (context,
|
||||
GTK_STYLE_PROVIDER (provider),
|
||||
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
|
||||
g_object_unref (provider);
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Notice that you can also get style information from custom resources
|
||||
by implementing the #GtkStyleProvider interface yourself. This is
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
||||
]>
|
||||
<refentry id="gtk-other-software" revision="5 Sept 2001">
|
||||
<refentry id="gtk-other-software">
|
||||
<refmeta>
|
||||
<refentrytitle>Mixing GTK+ with other software</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
|
||||
@@ -35,8 +35,8 @@ 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
|
||||
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>.
|
||||
@@ -47,7 +47,7 @@ this reference manual for details.
|
||||
|
||||
<qandaentry>
|
||||
<question><para>
|
||||
Where can I get help with GTK+, submit a bug report, or make a feature
|
||||
Where can I get help with GTK+, submit a bug report, or make a feature
|
||||
request?
|
||||
</para></question>
|
||||
|
||||
@@ -102,11 +102,11 @@ state (explained in its documentation).
|
||||
</para>
|
||||
|
||||
<para>
|
||||
For strings returned from functions, they will be declared "const" (using
|
||||
#G_CONST_RETURN) if they should not be freed. Non-const strings should be
|
||||
freed with g_free(). Arrays follow the same rule. (If you find an exception
|
||||
to the rules, please report a bug to <ulink
|
||||
url="http://bugzilla.gnome.org">http://bugzilla.gnome.org</ulink>.)
|
||||
For strings returned from functions, they will be declared "const" (using
|
||||
#G_CONST_RETURN) if they should not be freed. Non-const strings should be
|
||||
freed with g_free(). Arrays follow the same rule. If you find an
|
||||
undocumented exception to the rules, please report a bug to <ulink
|
||||
url="http://bugzilla.gnome.org">http://bugzilla.gnome.org</ulink>.
|
||||
</para>
|
||||
|
||||
</answer>
|
||||
@@ -164,8 +164,8 @@ How do I use GTK+ with threads?
|
||||
<answer>
|
||||
|
||||
<para>
|
||||
This is covered in the <link linkend="gdk-Threads">GDK threads
|
||||
documentation</link>. See also the <link linkend="glib-Threads">GThread</link>
|
||||
This is covered in the <link linkend="gdk-Threads">GDK threads
|
||||
documentation</link>. See also the <link linkend="glib-Threads">GThread</link>
|
||||
documentation for portable threading primitives.
|
||||
</para>
|
||||
|
||||
@@ -182,33 +182,37 @@ How do I internationalize a GTK+ program?
|
||||
<para>
|
||||
Most people use <ulink url="http://www.gnu.org/software/gettext/">GNU
|
||||
gettext</ulink>, already required in order to install GLib. On a UNIX
|
||||
or Linux system with gettext installed, type <literal>info gettext</literal>
|
||||
or Linux system with gettext installed, type <literal>info gettext</literal>
|
||||
to read the documentation.
|
||||
</para>
|
||||
<para>
|
||||
The short checklist on how to use gettext is: call bindtextdomain() so gettext
|
||||
can find the files containing your translations, call textdomain() to set the
|
||||
default translation domain, call bind_textdomain_codeset() to request that
|
||||
all translated strings are returned in UTF-8, then call gettext() to look up
|
||||
each string to be translated in the default domain.
|
||||
The short checklist on how to use gettext is: call bindtextdomain() so
|
||||
gettext can find the files containing your translations, call textdomain()
|
||||
to set the default translation domain, call bind_textdomain_codeset() to
|
||||
request that all translated strings are returned in UTF-8, then call
|
||||
gettext() to look up each string to be translated in the default domain.
|
||||
</para>
|
||||
<para>
|
||||
<filename>gi18n.h</filename> provides the following shorthand macros for
|
||||
convenience.
|
||||
Conventionally, people define macros as follows for convenience:
|
||||
<informalexample>
|
||||
<programlisting>
|
||||
#define _(x) gettext (x)
|
||||
#define N_(x) x
|
||||
#define _(x) gettext (x)
|
||||
#define N_(x) x
|
||||
#define C_(ctx,x) pgettext (ctx, x)
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
You use N_() (N stands for no-op) to mark a string for translation in a
|
||||
context where a function call to gettext() is not allowed, such as in an
|
||||
array initializer.
|
||||
You eventually have to call gettext() on the string to actually fetch the
|
||||
translation. _() both marks the string for translation and actually
|
||||
You use N_() (N stands for no-op) to mark a string for translation in
|
||||
a location where a function call to gettext() is not allowed, such as
|
||||
in an array initializer.
|
||||
You eventually have to call gettext() on the string to actually fetch
|
||||
the translation. _() both marks the string for translation and actually
|
||||
translates it.
|
||||
</para>
|
||||
<para>
|
||||
Nowadays, GLib provides the common shorthand macros in the header file
|
||||
<filename>gi18n.h</filename>, so you don't have to define them yourself,
|
||||
just include that header.
|
||||
The C_() macro (C stands for context) adds an additional context to
|
||||
the string that is marked for translation, which can help to disambiguate
|
||||
short strings that might need different translations in different
|
||||
parts of your program.
|
||||
</para>
|
||||
<para>
|
||||
Code using these macros ends up looking like this:
|
||||
@@ -231,21 +235,21 @@ Code using these macros ends up looking like this:
|
||||
</informalexample>
|
||||
</para>
|
||||
<para>
|
||||
Libraries using gettext should use dgettext() instead of gettext(), which
|
||||
allows them to specify the translation domain each time they ask for a
|
||||
translation. Libraries should also avoid calling textdomain(), since they
|
||||
will be specifying the domain instead of using the default. For dgettext()
|
||||
the _() macro can be defined as:
|
||||
<informalexample>
|
||||
<programlisting>
|
||||
#define _(x) dgettext ("MyDomain", x)
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
Libraries using gettext should use dgettext() instead of gettext(), which
|
||||
allows them to specify the translation domain each time they ask for a
|
||||
translation. Libraries should also avoid calling textdomain(), since
|
||||
they will be specifying the domain instead of using the default.
|
||||
</para>
|
||||
<para>
|
||||
Again, GLib comes with the <filename>gi18n-lib.h</filename>, saving you the
|
||||
trouble of defining the macros by hand. The macros in that header expect the
|
||||
translation domain to be specified by the %GETTEXT_PACKAGE macro.
|
||||
With the convention that the macro <literal>GETTEXT_PACKAGE</literal> is
|
||||
defined to hold your libraries translation domain,
|
||||
<filename>gi18n-lib.h</filename> can be included to provide
|
||||
the following convenience:
|
||||
<informalexample>
|
||||
<programlisting>
|
||||
#define _(x) dgettext (GETTEXT_PACKAGE, x)
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
</para>
|
||||
</answer>
|
||||
</qandaentry>
|
||||
@@ -259,9 +263,9 @@ How do I use non-ASCII characters in GTK+ programs ?
|
||||
|
||||
<answer>
|
||||
<para>
|
||||
GTK+ uses <ulink url="http://www.unicode.org">Unicode</ulink> (more exactly
|
||||
UTF-8) for all text. UTF-8 encodes each Unicode codepoint as a sequence of
|
||||
one to six bytes and has a number of nice properties which make it a good
|
||||
GTK+ uses <ulink url="http://www.unicode.org">Unicode</ulink> (more exactly
|
||||
UTF-8) for all text. UTF-8 encodes each Unicode codepoint as a sequence of
|
||||
one to six bytes and has a number of nice properties which make it a good
|
||||
choice for working with Unicode text in C programs:
|
||||
<itemizedlist>
|
||||
<listitem><para>
|
||||
@@ -271,30 +275,30 @@ ASCII characters are encoded by their familiar ASCII codepoints.
|
||||
ASCII characters never appear as part of any other character.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
The zero byte doesn't occur as part of a character, so that UTF-8 strings
|
||||
can be manipulated with the usual C library functions for handling
|
||||
The zero byte doesn't occur as part of a character, so that UTF-8 strings
|
||||
can be manipulated with the usual C library functions for handling
|
||||
zero-terminated strings.
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
More information about Unicode and UTF-8 can be found in the
|
||||
<ulink url="http://www.cl.cam.ac.uk/~mgk25/unicode.html">UTF-8 and Unicode i
|
||||
More information about Unicode and UTF-8 can be found in the
|
||||
<ulink url="http://www.cl.cam.ac.uk/~mgk25/unicode.html">UTF-8 and Unicode
|
||||
FAQ for Unix/Linux</ulink>.
|
||||
GLib provides functions for converting strings between UTF-8 and other
|
||||
encodings, see g_locale_to_utf8() and g_convert().
|
||||
</para>
|
||||
<para>
|
||||
Text coming from external sources (e.g. files or user input), has to be
|
||||
converted to UTF-8 before being handed over to GTK+. The following example
|
||||
writes the content of a IS0-8859-1 encoded text file to
|
||||
converted to UTF-8 before being handed over to GTK+. The following example
|
||||
writes the content of a IS0-8859-1 encoded text file to
|
||||
<literal>stdout</literal>:
|
||||
<informalexample><programlisting>
|
||||
gchar *text, *utf8_text;
|
||||
gsize length;
|
||||
GError *error = NULL;
|
||||
|
||||
if (g_file_get_contents (filename, &text, &length, NULL))
|
||||
if (g_file_get_contents (filename, &text, &length, NULL))
|
||||
{
|
||||
utf8_text = g_convert (text, length, "UTF-8", "ISO-8859-1",
|
||||
utf8_text = g_convert (text, length, "UTF-8", "ISO-8859-1",
|
||||
NULL, NULL, &error);
|
||||
if (error != NULL)
|
||||
{
|
||||
@@ -304,7 +308,7 @@ if (g_file_get_contents (filename, &text, &length, NULL))
|
||||
else
|
||||
g_print (utf8_text);
|
||||
}
|
||||
else
|
||||
else
|
||||
fprintf (stderr, "Unable to read file %s\n", filename);
|
||||
</programlisting></informalexample>
|
||||
</para>
|
||||
@@ -315,36 +319,37 @@ handling non-ASCII content:
|
||||
<varlistentry><term>direct UTF-8</term>
|
||||
<listitem><para>
|
||||
If your editor and compiler are capable of handling UTF-8 encoded sources,
|
||||
it is very convenient to simply use UTF-8 for string literals, since it allows
|
||||
you to edit the strings in "wysiwyg". Note that choosing this option may
|
||||
reduce the portability of your code.
|
||||
it is very convenient to simply use UTF-8 for string literals, since it
|
||||
allows you to edit the strings in "wysiwyg". Note that choosing this option
|
||||
may reduce the portability of your code.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry><term>escaped UTF-8</term>
|
||||
<listitem><para>
|
||||
Even if your toolchain can't handle UTF-8 directly, you can still encode string
|
||||
literals in UTF-8 by using octal or hexadecimal escapes like
|
||||
<literal>\212</literal> or <literal>\xa8</literal> to
|
||||
encode each byte. This is portable, but modifying the escaped strings is not
|
||||
very convenient. Be careful when mixing hexadecimal escapes with ordinary text;
|
||||
Even if your toolchain can't handle UTF-8 directly, you can still encode
|
||||
string literals in UTF-8 by using octal or hexadecimal escapes like
|
||||
<literal>\212</literal> or <literal>\xa8</literal> to encode each byte.
|
||||
This is portable, but modifying the escaped strings is not very convenient.
|
||||
Be careful when mixing hexadecimal escapes with ordinary text;
|
||||
<literal>"\xa8abcd"</literal> is a string of length 1 !
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry><term>runtime conversion</term>
|
||||
<listitem><para>
|
||||
If the string literals can be represented in an encoding which your toolchain
|
||||
can handle (e.g. IS0-8859-1), you can write your source files in that encoding
|
||||
and use g_convert() to convert the strings to UTF-8 at runtime. Note that this
|
||||
has some runtime overhead, so you may want to move the conversion out of inner
|
||||
loops.
|
||||
If the string literals can be represented in an encoding which your
|
||||
toolchain can handle (e.g. IS0-8859-1), you can write your source files
|
||||
in that encoding and use g_convert() to convert the strings to UTF-8 at
|
||||
runtime. Note that this has some runtime overhead, so you may want to move
|
||||
the conversion out of inner loops.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
Here is an example showing the three approaches using the copyright sign
|
||||
© which has Unicode and ISO-8859-1 codepoint 169 and is represented in
|
||||
UTF-8 by the two bytes 194, 169:
|
||||
Here is an example showing the three approaches using the copyright sign
|
||||
© which has Unicode and ISO-8859-1 codepoint 169 and is represented
|
||||
in UTF-8 by the two bytes 194, 169, or <literal>"\302\251"</literal> as
|
||||
a string literal:
|
||||
<informalexample><programlisting>
|
||||
g_print ("direct UTF-8: ©");
|
||||
g_print ("escaped UTF-8: \302\251");
|
||||
@@ -368,9 +373,9 @@ How do I use GTK+ with C++?
|
||||
|
||||
<answer>
|
||||
<para>
|
||||
There are two ways to approach this. The GTK+ header files use the subset
|
||||
of C that's also valid C++, so you can simply use the normal GTK+ API
|
||||
in a C++ program. Alternatively, you can use a "C++ binding"
|
||||
There are two ways to approach this. The GTK+ header files use the subset
|
||||
of C that's also valid C++, so you can simply use the normal GTK+ API
|
||||
in a C++ program. Alternatively, you can use a "C++ binding"
|
||||
such as <ulink url="http://gtkmm.sourceforge.net/">gtkmm</ulink>
|
||||
which provides a native C++ API.
|
||||
</para>
|
||||
@@ -380,20 +385,20 @@ connected to signals, not methods. So you will need to use global
|
||||
functions or "static" class functions for signal connections.
|
||||
</para>
|
||||
<para>
|
||||
Another common issue when using GTK+ directly is that
|
||||
C++ will not implicitly convert an integer to an enumeration.
|
||||
Another common issue when using GTK+ directly is that
|
||||
C++ will not implicitly convert an integer to an enumeration.
|
||||
This comes up when using bitfields; in C you can write the following
|
||||
code:
|
||||
<informalexample>
|
||||
<programlisting>
|
||||
gdk_window_set_events (gdk_window,
|
||||
gdk_window_set_events (gdk_window,
|
||||
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
while in C++ you must write:
|
||||
<informalexample>
|
||||
<programlisting>
|
||||
gdk_window_set_events (gdk_window,
|
||||
gdk_window_set_events (gdk_window,
|
||||
(GdkEventMask) GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
@@ -427,19 +432,19 @@ How do I load an image or animation from a file?
|
||||
<answer>
|
||||
|
||||
<para>
|
||||
To load an image file straight into a display widget, use
|
||||
gtk_image_new_from_file() <footnote><para> If the file load fails,
|
||||
gtk_image_new_from_file() will display no image graphic — to detect
|
||||
a failed load yourself, use gdk_pixbuf_new_from_file() directly, then
|
||||
gtk_image_new_from_pixbuf().</para></footnote>.
|
||||
To load an image file straight into a display widget, use
|
||||
gtk_image_new_from_file() <footnote><para> If the file load fails,
|
||||
gtk_image_new_from_file() will display no image graphic — to detect
|
||||
a failed load yourself, use gdk_pixbuf_new_from_file() directly, then
|
||||
gtk_image_new_from_pixbuf().</para></footnote>.
|
||||
To load an image for another purpose, use gdk_pixbuf_new_from_file(). To i
|
||||
load an animation, use gdk_pixbuf_animation_new_from_file().
|
||||
gdk_pixbuf_animation_new_from_file() can also load non-animated images, so
|
||||
use it in combination with gdk_pixbuf_animation_is_static_image() to load a
|
||||
file of unknown type.
|
||||
gdk_pixbuf_animation_new_from_file() can also load non-animated images, so
|
||||
use it in combination with gdk_pixbuf_animation_is_static_image() to load a
|
||||
file of unknown type.
|
||||
</para>
|
||||
<para>
|
||||
To load an image or animation file asynchronously (without blocking), use
|
||||
To load an image or animation file asynchronously (without blocking), use
|
||||
#GdkPixbufLoader.
|
||||
</para>
|
||||
</answer>
|
||||
@@ -453,14 +458,13 @@ How do I draw text ?
|
||||
|
||||
<answer>
|
||||
<para>
|
||||
To draw a piece of text, use a Pango layout and gdk_draw_layout(),
|
||||
using code like the following:
|
||||
To draw a piece of text, use a Pango layout and pango_cairo_show_layout().
|
||||
<informalexample>
|
||||
<programlisting>
|
||||
layout = gtk_widget_create_pango_layout (widget, text);
|
||||
fontdesc = pango_font_description_from_string ("Luxi Mono 12");
|
||||
pango_layout_set_font_description (layout, fontdesc);
|
||||
gdk_draw_layout (..., layout);
|
||||
pango_layout_set_font_description (layout, fontdesc);
|
||||
pango_cairo_show_layout (cr, layout);
|
||||
pango_font_description_free (fontdesc);
|
||||
g_object_unref (layout);
|
||||
</programlisting>
|
||||
@@ -485,13 +489,13 @@ How do I measure the size of a piece of text ?
|
||||
|
||||
<answer>
|
||||
<para>
|
||||
To obtain the size of a piece of text, use a Pango layout and
|
||||
To obtain the size of a piece of text, use a Pango layout and
|
||||
pango_layout_get_pixel_size(), using code like the following:
|
||||
<informalexample>
|
||||
<programlisting>
|
||||
layout = gtk_widget_create_pango_layout (widget, text);
|
||||
fontdesc = pango_font_description_from_string ("Luxi Mono 12");
|
||||
pango_layout_set_font_description (layout, fontdesc);
|
||||
pango_layout_set_font_description (layout, fontdesc);
|
||||
pango_layout_get_pixel_size (layout, &width, &height);
|
||||
pango_font_description_free (fontdesc);
|
||||
g_object_unref (layout);
|
||||
@@ -510,21 +514,21 @@ section of <ulink url="http://library.gnome.org/devel/pango/stable/">Pango manua
|
||||
<qandaentry>
|
||||
<question>
|
||||
<para>
|
||||
Why are types not registered if I use their <literal>GTK_TYPE_BLAH</literal>
|
||||
Why are types not registered if I use their <literal>GTK_TYPE_BLAH</literal>
|
||||
macro ?
|
||||
</para>
|
||||
</question>
|
||||
|
||||
<answer>
|
||||
<para>
|
||||
The <literal>GTK_TYPE_BLAH</literal> macros are defined as calls to
|
||||
The <literal>GTK_TYPE_BLAH</literal> macros are defined as calls to
|
||||
<literal>gtk_blah_get_type()</literal>, and the <literal>_get_type()</literal> i
|
||||
functions are declared as %G_GNUC_CONST which allows the compiler to optimize
|
||||
the call away if it appears that the value is not being used.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
A common workaround for this problem is to store the result in a volatile
|
||||
A common workaround for this problem is to store the result in a volatile
|
||||
variable, which keeps the compiler from optimizing the call away.
|
||||
<informalexample><programlisting>
|
||||
volatile GType dummy = GTK_TYPE_BLAH;
|
||||
@@ -543,28 +547,29 @@ How do I create a transparent toplevel window ?
|
||||
<answer>
|
||||
<para>
|
||||
To make a window transparent, it needs to use a visual which supports that.
|
||||
This is done by getting the RGBA colormap of the screen with
|
||||
gdk_screen_get_rgba_colormap() and setting it on the window. Note that
|
||||
gdk_screen_get_rgba_colormap() will return %NULL if transparent windows
|
||||
are not supported on the screen; also note that this may change from
|
||||
screen to screen, so it needs to be repeated whenever the window is moved
|
||||
to a different screen.
|
||||
This is done by getting the RGBA visual of the screen with
|
||||
gdk_screen_get_rgba_visual() and setting it on the window. Note that
|
||||
gdk_screen_get_rgba_visual() will return %NULL if transparent windows
|
||||
are not supported on the screen, you should fall back to
|
||||
gdk_screen_get_system_visual() in that case. Additionally, note that this
|
||||
will change from screen to screen, so it needs to be repeated whenever the
|
||||
window is moved to a different screen.
|
||||
<informalexample><programlisting>
|
||||
GdkColormap *colormap;
|
||||
GdkVisual *visual;
|
||||
|
||||
colormap = gdk_screen_get_rgba_colormap (screen);
|
||||
if (!colormap)
|
||||
colormap = gdk_screen_get_rgb_colormap (screen);
|
||||
visual = gdk_screen_get_rgba_visual (screen);
|
||||
if (visual == NULL)
|
||||
visual = gdk_screen_get_system_visual (screen);
|
||||
|
||||
gtk_widget_set_colormap (widget, colormap);
|
||||
gtk_widget_set_visual (GTK_WIDGET (window), visual);
|
||||
</programlisting></informalexample>
|
||||
One possibility to fill the alpha channel on the window is to use
|
||||
gdk_draw_rgb_32_image().
|
||||
To fill the alpha channel on the window simply use cairos
|
||||
RGBA drawing capabilities.
|
||||
</para>
|
||||
<para>
|
||||
Note that the presence of an RGBA visual is no guarantee that the
|
||||
window will actually appear transparent on screen. On X11, this
|
||||
requires a compositing manager to be running. See
|
||||
window will actually appear transparent on screen. On X11, this
|
||||
requires a compositing manager to be running. See
|
||||
gtk_widget_is_composited() for a way to find out if the alpha
|
||||
channel will be respected.
|
||||
</para>
|
||||
@@ -583,7 +588,7 @@ channel will be respected.
|
||||
<answer>
|
||||
<para>
|
||||
See <link linkend="TreeWidget">tree widget overview</link> — you
|
||||
should use the #GtkTreeView widget. (A list is just a tree with no branches,
|
||||
should use the #GtkTreeView widget. (A list is just a tree with no branches,
|
||||
so the tree widget is used for lists as well).
|
||||
</para>
|
||||
</answer>
|
||||
@@ -600,8 +605,8 @@ See <link linkend="TextWidget">text widget overview</link> — you
|
||||
should use the #GtkTextView widget.
|
||||
</para>
|
||||
<para>
|
||||
If you only have a small amount of text, #GtkLabel may also be appropriate
|
||||
of course. It can be made selectable with gtk_label_set_selectable(). For a
|
||||
If you only have a small amount of text, #GtkLabel may also be appropriate
|
||||
of course. It can be made selectable with gtk_label_set_selectable(). For a
|
||||
single-line text entry, see #GtkEntry.
|
||||
</para>
|
||||
</answer>
|
||||
@@ -615,8 +620,8 @@ single-line text entry, see #GtkEntry.
|
||||
|
||||
<answer>
|
||||
<para>
|
||||
#GtkImage can display images in just about any format GTK+ understands.
|
||||
You can also use #GtkDrawingArea if you need to do something more complex,
|
||||
#GtkImage can display images in just about any format GTK+ understands.
|
||||
You can also use #GtkDrawingArea if you need to do something more complex,
|
||||
such as draw text or graphics over the top of the image.
|
||||
</para>
|
||||
</answer>
|
||||
@@ -648,17 +653,14 @@ How do I change the color of a widget?
|
||||
</para></question>
|
||||
|
||||
<answer><para>
|
||||
See gtk_widget_modify_fg(), gtk_widget_modify_bg(), gtk_widget_modify_base(),
|
||||
and gtk_widget_modify_text(). See <link linkend="gtk-Resource-Files">GTK+
|
||||
resource files</link> for more discussion. You can also change widget color
|
||||
by installing a resource file and parsing it with gtk_rc_add_default_file().
|
||||
The advantage of a resource file is that users can then override the
|
||||
color you've chosen.
|
||||
See gtk_widget_override_color() and gtk_widget_override_background_color().
|
||||
You can also change the appearance of a widget by installing a
|
||||
custom style provider, see gtk_style_context_add_provider().
|
||||
</para>
|
||||
|
||||
<para>To change the background color for widgets such as #GtkLabel that have
|
||||
no background, place them in a #GtkEventBox and set the background of the
|
||||
event box.
|
||||
<para>To change the background color for widgets such as #GtkLabel that
|
||||
have no background, place them in a #GtkEventBox and set the background
|
||||
of the event box.
|
||||
</para></answer>
|
||||
</qandaentry>
|
||||
|
||||
@@ -668,35 +670,38 @@ How do I change the font of a widget?
|
||||
</para></question>
|
||||
|
||||
<answer><para>
|
||||
This has several possible answers, depending on what exactly you want to
|
||||
achieve. One option is gtk_widget_modify_font(). Note that this function
|
||||
can be used to change only the font size, as in the following example:
|
||||
This has several possible answers, depending on what exactly you want to
|
||||
achieve. One option is gtk_widget_override_font().
|
||||
<informalexample><programlisting>
|
||||
PangoFontDesc *font_desc = pango_font_description_new (<!-- -->);
|
||||
pango_font_description_set_size (font_desc, 40);
|
||||
gtk_widget_modify_font (widget, font);
|
||||
gtk_widget_override_font (widget, font);
|
||||
pango_font_description_free (font_desc);
|
||||
</programlisting></informalexample>
|
||||
</para>
|
||||
<para>
|
||||
If you want to make the text of a label larger, you can use
|
||||
If you want to make the text of a label larger, you can use
|
||||
gtk_label_set_markup():
|
||||
<informalexample><programlisting>
|
||||
gtk_label_set_markup (label, "<big>big text</big>");
|
||||
</programlisting></informalexample>
|
||||
This is preferred for many apps because it's a relative size to the
|
||||
user's chosen font size. See g_markup_escape_text() if you are
|
||||
This is preferred for many apps because it's a relative size to the
|
||||
user's chosen font size. See g_markup_escape_text() if you are
|
||||
constructing such strings on the fly.
|
||||
</para>
|
||||
<para>
|
||||
You can also change the font of a widget by putting
|
||||
<programlisting>
|
||||
gtk-font-name = "Sans 30"
|
||||
.my-widget-class {
|
||||
font: Sans 30;
|
||||
}
|
||||
</programlisting>
|
||||
in a resource file and parsing it with gtk_rc_add_default_file().
|
||||
The advantage of a resource file is that users can then override the font you
|
||||
have chosen. See <link linkend="gtk-Resource-Files">GTK+ resource files</link>
|
||||
for more discussion.
|
||||
in a CSS file, loading it with gtk_css_provider_load_from_file(), and
|
||||
adding the provider with gtk_style_context_add_provider_for_screen().
|
||||
To associate this style information with your widget, set a style class
|
||||
on its #GtkStyleContext using gtk_style_context_add_class().
|
||||
The advantage of this approach is that users can then override the font
|
||||
you have chosen. See the #GtkStyleContext documentation for more discussion.
|
||||
</para>
|
||||
</answer>
|
||||
</qandaentry>
|
||||
@@ -706,8 +711,9 @@ for more discussion.
|
||||
How do I disable/ghost/desensitize a widget?
|
||||
</para></question>
|
||||
|
||||
<answer><para> In GTK+ a disabled widget is termed "insensitive." See
|
||||
gtk_widget_set_sensitive().
|
||||
<answer><para>
|
||||
In GTK+ a disabled widget is termed "insensitive."
|
||||
See gtk_widget_set_sensitive().
|
||||
</para></answer>
|
||||
</qandaentry>
|
||||
|
||||
@@ -746,14 +752,14 @@ How do I make a text widget display its complete contents in a specific font?
|
||||
</para></question>
|
||||
|
||||
<answer><para>
|
||||
If you use gtk_text_buffer_insert_with_tags() with appropriate tags to select
|
||||
the font, the inserted text will have the desired appearance, but text typed
|
||||
in by the user before or after the tagged block will appear in the default
|
||||
style.
|
||||
If you use gtk_text_buffer_insert_with_tags() with appropriate tags to
|
||||
select the font, the inserted text will have the desired appearance, but
|
||||
text typed in by the user before or after the tagged block will appear in
|
||||
the default style.
|
||||
</para>
|
||||
<para>
|
||||
To ensure that all text has the desired appearance, use gtk_widget_modify_font()
|
||||
to change the default font for the widget.
|
||||
To ensure that all text has the desired appearance, use
|
||||
gtk_widget_override_font() to change the default font for the widget.
|
||||
</para></answer>
|
||||
</qandaentry>
|
||||
|
||||
@@ -770,17 +776,17 @@ A good way to keep a text buffer scrolled to the end is to place a
|
||||
<link linkend="GtkTextMark">mark</link> at the end of the buffer, and
|
||||
give it right gravity. The gravity has the effect that text inserted
|
||||
at the mark gets inserted <emphasis>before</emphasis>, keeping the mark
|
||||
at the end.
|
||||
at the end.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<para>
|
||||
To ensure that the end of the buffer remains visible, use
|
||||
gtk_text_view_scroll_to_mark() to scroll to the mark after
|
||||
inserting new text.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The gtk-demo application contains an example of this technique.
|
||||
The gtk-demo application contains an example of this technique.
|
||||
</para>
|
||||
</answer>
|
||||
</qandaentry>
|
||||
@@ -797,25 +803,10 @@ How do I associate some data with a row in the tree?
|
||||
|
||||
<answer>
|
||||
<para>
|
||||
Remember that the #GtkTreeModel columns don't necessarily have to be displayed.
|
||||
So you can put non-user-visible data in your model just like any other data,
|
||||
and retrieve it with gtk_tree_model_get(). See the
|
||||
<link linkend="TreeWidget">tree widget overview</link>.
|
||||
</para>
|
||||
</answer>
|
||||
</qandaentry>
|
||||
|
||||
<qandaentry>
|
||||
<question><para>
|
||||
What's the #GtkTreeView equivalent of gtk_clist_find_row_from_data()?
|
||||
</para></question>
|
||||
|
||||
<answer>
|
||||
<para>
|
||||
As there is no separate data column in the #GtkTreeModel, there's no
|
||||
built in function to find the iter from data. You can write a custom
|
||||
searching function to walk the tree and find the data, or use
|
||||
gtk_tree_model_foreach().
|
||||
Remember that the #GtkTreeModel columns don't necessarily have to be
|
||||
displayed. So you can put non-user-visible data in your model just
|
||||
like any other data, and retrieve it with gtk_tree_model_get().
|
||||
See the <link linkend="TreeWidget">tree widget overview</link>.
|
||||
</para>
|
||||
</answer>
|
||||
</qandaentry>
|
||||
@@ -827,9 +818,9 @@ How do I put an image and some text in the same column?
|
||||
|
||||
<answer>
|
||||
<para>
|
||||
You can pack more than one #GtkCellRenderer into a single #GtkTreeViewColumn
|
||||
using gtk_tree_view_column_pack_start() or gtk_tree_view_column_pack_end().
|
||||
So pack both a #GtkCellRendererPixbuf and a #GtkCellRendererText into the
|
||||
You can pack more than one #GtkCellRenderer into a single #GtkTreeViewColumn
|
||||
using gtk_tree_view_column_pack_start() or gtk_tree_view_column_pack_end().
|
||||
So pack both a #GtkCellRendererPixbuf and a #GtkCellRendererText into the
|
||||
column.
|
||||
</para>
|
||||
</answer>
|
||||
@@ -837,15 +828,15 @@ column.
|
||||
|
||||
<qandaentry>
|
||||
<question><para>
|
||||
I can set data easily on my #GtkTreeStore/#GtkListStore models using
|
||||
I can set data easily on my #GtkTreeStore/#GtkListStore models using
|
||||
gtk_list_store_set() and gtk_tree_store_set(), but can't read it back?
|
||||
</para></question>
|
||||
|
||||
<answer>
|
||||
<para>
|
||||
Both the #GtkTreeStore and the #GtkListStore implement the #GtkTreeModel
|
||||
interface. Consequentially, the can use any function this interface
|
||||
implements. The easiest way to read a set of data back is to use
|
||||
interface. Consequentially, you can use any function this interface
|
||||
implements. The easiest way to read a set of data back is to use
|
||||
gtk_tree_model_get().
|
||||
</para>
|
||||
</answer>
|
||||
@@ -857,14 +848,14 @@ How do I change the way that numbers are formatted by #GtkTreeView?
|
||||
</para></question>
|
||||
<answer><para>
|
||||
Use gtk_tree_view_insert_column_with_data_func()
|
||||
or gtk_tree_view_column_set_cell_data_func() and do the conversion from i
|
||||
number to string yourself (with, say, g_strdup_printf()).
|
||||
or gtk_tree_view_column_set_cell_data_func() and do the conversion
|
||||
from number to string yourself (with, say, g_strdup_printf()).
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The following example demonstrates this:
|
||||
<informalexample><programlisting>
|
||||
enum
|
||||
enum
|
||||
{
|
||||
DOUBLE_COLUMN,
|
||||
N_COLUMNS
|
||||
@@ -873,11 +864,11 @@ enum
|
||||
GtkListStore *mycolumns;
|
||||
GtkTreeView *treeview;
|
||||
|
||||
void
|
||||
void
|
||||
my_cell_double_to_text (GtkTreeViewColumn *tree_column,
|
||||
GtkCellRenderer *cell,
|
||||
GtkCellRenderer *cell,
|
||||
GtkTreeModel *tree_model,
|
||||
GtkTreeIter *iter,
|
||||
GtkTreeIter *iter,
|
||||
gpointer data)
|
||||
{
|
||||
GtkCellRendererText *cell_text = (GtkCellRendererText *)cell;
|
||||
@@ -892,7 +883,7 @@ my_cell_double_to_text (GtkTreeViewColumn *tree_column,
|
||||
g_free (text);
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
set_up_new_columns (GtkTreeView *myview)
|
||||
{
|
||||
GtkCellRendererText *renderer;
|
||||
@@ -908,7 +899,7 @@ set_up_new_columns (GtkTreeView *myview)
|
||||
|
||||
/* Create a new column that has a title ("Example column"),
|
||||
* uses the above created renderer that will render the double
|
||||
* value into text from the associated model's rows.
|
||||
* value into text from the associated model's rows.
|
||||
*/
|
||||
column = gtk_tree_view_column_new (<!-- -->);
|
||||
gtk_tree_view_column_set_title (column, "Example column");
|
||||
@@ -922,10 +913,10 @@ set_up_new_columns (GtkTreeView *myview)
|
||||
*/
|
||||
/* Set up a custom function that will be called when the column content
|
||||
* is rendered. We use the func_data pointer as an index into our
|
||||
* model. This is convenient when using multi column lists.
|
||||
* model. This is convenient when using multi column lists.
|
||||
*/
|
||||
gtk_tree_view_column_set_cell_data_func (column, renderer,
|
||||
my_cell_double_to_text,
|
||||
my_cell_double_to_text,
|
||||
(gpointer)DOUBLE_COLUMN, NULL);
|
||||
}
|
||||
</programlisting></informalexample>
|
||||
@@ -953,42 +944,15 @@ How do I use cairo to draw in GTK+ applications ?
|
||||
</para></question>
|
||||
|
||||
<answer><para>
|
||||
Use gdk_cairo_create() to obtain a cairo context for drawing
|
||||
on a GDK window or pixmap. See <link linkend="gdk-Cairo-Interaction">Cairo
|
||||
Interaction</link> for some more useful functions.
|
||||
</para></answer>
|
||||
</qandaentry>
|
||||
|
||||
<qandaentry>
|
||||
<question><para>
|
||||
I have created a cairo context with gdk_cairo_create(), but when I
|
||||
later use it, my drawing does not show up. Why is that ?
|
||||
</para></question>
|
||||
|
||||
<answer>
|
||||
<para>
|
||||
All drawing in GTK+ is normally done in an expose handler, and GTK+
|
||||
creates a temporary pixmap for double-buffering the drawing. If you
|
||||
create a cairo context outside the expose handler, it is backed
|
||||
by the GDK window itself, not the double-buffering pixmap. Consequently,
|
||||
any drawing you do with that cairo context gets overwritten at the
|
||||
end of the expose handler, when the double-buffering pixmap is copied
|
||||
back.
|
||||
The #GtkWidget::draw signal gets a ready-to-use cairo context
|
||||
as parameter that you should use.
|
||||
</para>
|
||||
<para>
|
||||
Possible solutions to this problem are:
|
||||
<itemizedlist>
|
||||
<listitem><para>
|
||||
Turn off double-buffering, with gtk_widget_set_double_buffered().
|
||||
This is not ideal, since it can cause some flickering.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
Create the cairo context inside the expose handler. If you do this,
|
||||
gdk_cairo_create() arranges for it to be backed by the double-buffering
|
||||
pixmap. This is the preferred solution, and is used throughout GTK+
|
||||
itself.
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
All drawing in GTK+ is normally done in a draw handler, and GTK+
|
||||
creates a temporary pixmap for double-buffering the drawing.
|
||||
It is possible to turn off double-buffering, with
|
||||
gtk_widget_set_double_buffered(), but this is not ideal,
|
||||
since it can cause some flickering.
|
||||
</para>
|
||||
</answer>
|
||||
</qandaentry>
|
||||
@@ -996,7 +960,7 @@ itself.
|
||||
<qandaentry>
|
||||
<question><para>
|
||||
Can I improve the performance of my application by using the
|
||||
Glitz backend of cairo ?
|
||||
Glitz or GL backend of cairo ?
|
||||
</para></question>
|
||||
|
||||
<answer><para>
|
||||
@@ -1016,7 +980,7 @@ Can I use cairo to draw on a #GdkPixbuf ?
|
||||
|
||||
<answer><para>
|
||||
No, at least not yet. The cairo image surface does not support the
|
||||
pixel format used by GdkPixbuf.
|
||||
pixel format used by GdkPixbuf.
|
||||
</para></answer>
|
||||
</qandaentry>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
||||
]>
|
||||
<refentry id="gtk-resources" revision="5 Sept 2001">
|
||||
<refentry id="gtk-resources">
|
||||
<refmeta>
|
||||
<refentrytitle>Mailing lists and bug reports</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
||||
]>
|
||||
<refentry id="TextWidget" revision="18 Oct 2000">
|
||||
<refentry id="TextWidget">
|
||||
<refmeta>
|
||||
<refentrytitle>Text Widget Overview</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
|
||||
@@ -26,6 +26,8 @@ gtkenum.sgml
|
||||
gtkeventbox.sgml
|
||||
gtkexpander.sgml
|
||||
gtkfeatures.sgml
|
||||
gtkfixed.sgml
|
||||
gtkfilefilter.sgml
|
||||
gtkhbox.sgml
|
||||
gtkiconview.sgml
|
||||
gtkimcontextsimple.sgml
|
||||
@@ -34,6 +36,9 @@ gtkitemfactory.sgml
|
||||
gtklayout.sgml
|
||||
gtklinkbutton.sgml
|
||||
gtkmain.sgml
|
||||
gtkmenu.sgml
|
||||
gtkmenubar.sgml
|
||||
gtkmenushell.sgml
|
||||
gtkmessagedialog.sgml
|
||||
gtknotebook.sgml
|
||||
gtkobject.sgml
|
||||
@@ -43,6 +48,7 @@ gtkpagesetupunixdialog.sgml
|
||||
gtkpaned.sgml
|
||||
gtkpapersize.sgml
|
||||
gtkprinter.sgml
|
||||
gtkprintjob.sgml
|
||||
gtkprogressbar.sgml
|
||||
gtkradioaction.sgml
|
||||
gtkradiobutton.sgml
|
||||
@@ -57,6 +63,7 @@ gtkscale.sgml
|
||||
gtkscalebutton.sgml
|
||||
gtkscrollbar.sgml
|
||||
gtkscrolledwindow.sgml
|
||||
gtkselection.sgml
|
||||
gtkseparator.sgml
|
||||
gtkseparatormenuitem.sgml
|
||||
gtkseparatortoolitem.sgml
|
||||
@@ -65,6 +72,7 @@ gtkstatusbar.sgml
|
||||
gtkstyle.sgml
|
||||
gtktesting.sgml
|
||||
gtktextiter.sgml
|
||||
gtktexttag.sgml
|
||||
gtktexttagtable.sgml
|
||||
gtktextview.sgml
|
||||
gtktoggleaction.sgml
|
||||
|
||||
@@ -1,170 +0,0 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkFileFilter
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
A filter for selecting a file subset
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
A GtkFileFilter can be used to restrict the files being shown
|
||||
in a #GtkFileChooser. Files can be filtered based on their name
|
||||
(with gtk_file_filter_add_pattern()), on their mime type (with
|
||||
gtk_file_filter_add_mime_type()), or by a custom filter function
|
||||
(with gtk_file_filter_add_custom()).
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Filtering by mime types handles aliasing and subclassing of mime
|
||||
types; e.g. a filter for text/plain also matches a file with mime
|
||||
type application/rtf, since application/rtf is a subclass of
|
||||
text/plain. Note that #GtkFileFilter allows wildcards for the
|
||||
subtype of a mime type, so you can e.g. filter for image/*.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Normally, filters are used by adding them to a #GtkFileChooser,
|
||||
see gtk_file_chooser_add_filter(), but it is also possible
|
||||
to manually use a filter on a file with gtk_file_filter_filter().
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
#GtkFileChooser
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkFileFilter ##### -->
|
||||
<para>
|
||||
The <structname>GtkFileFilter</structname> struct contains
|
||||
only private fields and should not be directly accessed.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkFileFilterInfo ##### -->
|
||||
<para>
|
||||
A <structname>GtkFileFilterInfo</structname> struct is used
|
||||
to pass information about the tested file to
|
||||
gtk_file_filter_filter().
|
||||
</para>
|
||||
|
||||
@contains: Flags indicating which of the following fields need
|
||||
are filled
|
||||
@filename: the filename of the file being tested
|
||||
@uri: the URI for the file being tested
|
||||
@display_name: the string that will be used to display the file
|
||||
in the file chooser
|
||||
@mime_type: the mime type of the file
|
||||
|
||||
<!-- ##### ENUM GtkFileFilterFlags ##### -->
|
||||
<para>
|
||||
These flags indicate what parts of a #GtkFileFilterInfo struct
|
||||
are filled or need to be filled.
|
||||
</para>
|
||||
|
||||
@GTK_FILE_FILTER_FILENAME: the filename of the file being tested
|
||||
@GTK_FILE_FILTER_URI: the URI for the file being tested
|
||||
@GTK_FILE_FILTER_DISPLAY_NAME: the string that will be used to
|
||||
display the file in the file chooser
|
||||
@GTK_FILE_FILTER_MIME_TYPE: the mime type of the file
|
||||
|
||||
<!-- ##### USER_FUNCTION GtkFileFilterFunc ##### -->
|
||||
<para>
|
||||
The type of function that is used with custom filters,
|
||||
see gtk_file_filter_add_custom().
|
||||
</para>
|
||||
|
||||
@filter_info: a #GtkFileFilterInfo that is filled according
|
||||
to the @needed flags passed to gtk_file_filter_add_custom()
|
||||
@data: user data passed to gtk_file_filter_add_custom()
|
||||
@Returns: %TRUE if the file should be displayed
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_file_filter_new ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_file_filter_set_name ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filter:
|
||||
@name:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_file_filter_get_name ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filter:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_file_filter_add_mime_type ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filter:
|
||||
@mime_type:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_file_filter_add_pattern ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filter:
|
||||
@pattern:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_file_filter_add_pixbuf_formats ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filter:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_file_filter_add_custom ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filter:
|
||||
@needed:
|
||||
@func:
|
||||
@data:
|
||||
@notify:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_file_filter_get_needed ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filter:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_file_filter_filter ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filter:
|
||||
@filter_info:
|
||||
@Returns:
|
||||
|
||||
|
||||
@@ -1,133 +0,0 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkFixed
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
A container which allows you to position widgets at fixed coordinates
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
The #GtkFixed widget is a container which can place child widgets at fixed
|
||||
positions and with fixed sizes, given in pixels. #GtkFixed performs no
|
||||
automatic layout management.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
For most applications, you should not use this container! It keeps
|
||||
you from having to learn about the other GTK+ containers, but it
|
||||
results in broken applications.
|
||||
With #GtkFixed, the following things will result in truncated text,
|
||||
overlapping widgets, and other display bugs:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>Themes, which may change widget sizes.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Fonts other than the one you used to write the app will of
|
||||
course change the size of widgets containing text; keep in mind that
|
||||
users may use a larger font because of difficulty reading the default,
|
||||
or they may be using Windows or the framebuffer port of GTK+, where
|
||||
different fonts are available.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Translation of text into other languages changes its size. Also,
|
||||
display of non-English text will use a different font in many cases.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
In addition, the fixed widget can't properly be mirrored in
|
||||
right-to-left languages such as Hebrew and Arabic. i.e. normally GTK+
|
||||
will flip the interface to put labels to the right of the thing they
|
||||
label, but it can't do that with #GtkFixed. So your application will
|
||||
not be usable in right-to-left languages.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Finally, fixed positioning makes it kind of annoying to add/remove GUI
|
||||
elements, since you have to reposition all the other elements. This is
|
||||
a long-term maintenance problem for your application.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
If you know none of these things are an issue for your application,
|
||||
and prefer the simplicity of #GtkFixed, by all means use the
|
||||
widget. But you should be aware of the tradeoffs.
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkFixed ##### -->
|
||||
<para>
|
||||
The #GtkFixed-struct struct contains the following fields.
|
||||
(These fields should be considered read-only. They should never be set by
|
||||
an application.)
|
||||
|
||||
<informaltable pgwide="1" frame="none" role="struct">
|
||||
<tgroup cols="2"><colspec colwidth="2*"/><colspec colwidth="8*"/>
|
||||
<tbody>
|
||||
|
||||
<row>
|
||||
<entry>#GList *children;</entry>
|
||||
<entry>a list of #GtkFixedChild elements, containing the child widgets and
|
||||
their positions.</entry>
|
||||
</row>
|
||||
|
||||
</tbody></tgroup></informaltable>
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ARG GtkFixed:x ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkFixed:y ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### FUNCTION gtk_fixed_new ##### -->
|
||||
<para>
|
||||
Creates a new #GtkFixed.
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns: a new #GtkFixed.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_fixed_put ##### -->
|
||||
<para>
|
||||
Adds a widget to a #GtkFixed container at the given position.
|
||||
</para>
|
||||
|
||||
@fixed: a #GtkFixed.
|
||||
@widget: the widget to add.
|
||||
@x: the horizontal position to place the widget at.
|
||||
@y: the vertical position to place the widget at.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_fixed_move ##### -->
|
||||
<para>
|
||||
Moves a child of a #GtkFixed container to the given position.
|
||||
</para>
|
||||
|
||||
@fixed: a #GtkFixed.
|
||||
@widget: the child widget.
|
||||
@x: the horizontal position to move the widget to.
|
||||
@y: the vertical position to move the widget to.
|
||||
|
||||
|
||||
@@ -1,494 +0,0 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkMenu
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
A menu widget
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
A #GtkMenu is a #GtkMenuShell that implements a drop down menu consisting of
|
||||
a list of #GtkMenuItem objects which can be navigated and activated by the
|
||||
user to perform application functions.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
A #GtkMenu is most commonly dropped down by activating a #GtkMenuItem in a
|
||||
#GtkMenuBar or popped up by activating a #GtkMenuItem in another #GtkMenu.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
A #GtkMenu can also be popped up by activating a #GtkOptionMenu.
|
||||
Other composite widgets such as the #GtkNotebook can pop up a #GtkMenu
|
||||
as well.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Applications can display a #GtkMenu as a popup menu by calling the
|
||||
gtk_menu_popup() function. The example below shows how an application
|
||||
can pop up a menu when the 3rd mouse button is pressed.
|
||||
</para>
|
||||
|
||||
<example>
|
||||
<title>Connecting the popup signal handler.</title>
|
||||
<programlisting>
|
||||
/* connect our handler which will popup the menu */
|
||||
g_signal_connect_swapped (window, "button_press_event",
|
||||
G_CALLBACK (my_popup_handler), menu);
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<title>Signal handler which displays a popup menu.</title>
|
||||
<programlisting>
|
||||
static gint
|
||||
my_popup_handler (GtkWidget *widget, GdkEvent *event)
|
||||
{
|
||||
GtkMenu *menu;
|
||||
GdkEventButton *event_button;
|
||||
|
||||
g_return_val_if_fail (widget != NULL, FALSE);
|
||||
g_return_val_if_fail (GTK_IS_MENU (widget), FALSE);
|
||||
g_return_val_if_fail (event != NULL, FALSE);
|
||||
|
||||
/* The "widget" is the menu that was supplied when
|
||||
* g_signal_connect_swapped() was called.
|
||||
*/
|
||||
menu = GTK_MENU (widget);
|
||||
|
||||
if (event->type == GDK_BUTTON_PRESS)
|
||||
{
|
||||
event_button = (GdkEventButton *) event;
|
||||
if (event_button->button == 3)
|
||||
{
|
||||
gtk_menu_popup (menu, NULL, NULL, NULL, NULL,
|
||||
event_button->button, event_button->time);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkMenu ##### -->
|
||||
<para>
|
||||
The #GtkMenu struct contains private data only, and
|
||||
should be accessed using the functions below.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### SIGNAL GtkMenu::move-scroll ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menu: the object which received the signal.
|
||||
@arg1:
|
||||
|
||||
<!-- ##### ARG GtkMenu:accel-group ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenu:accel-path ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenu:active ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenu:attach-widget ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenu:monitor ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenu:reserve-toggle-size ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenu:tearoff-state ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenu:tearoff-title ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenu:bottom-attach ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenu:left-attach ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenu:right-attach ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenu:top-attach ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenu:arrow-placement ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenu:arrow-scaling ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenu:double-arrows ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenu:horizontal-offset ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenu:horizontal-padding ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenu:vertical-offset ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenu:vertical-padding ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_new ##### -->
|
||||
<para>
|
||||
Creates a new #GtkMenu.
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns: a new #GtkMenu.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_set_screen ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menu:
|
||||
@screen:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_reorder_child ##### -->
|
||||
<para>
|
||||
Moves a #GtkMenuItem to a new position within the #GtkMenu.
|
||||
</para>
|
||||
|
||||
@menu: a #GtkMenu.
|
||||
@child: the #GtkMenuItem to move.
|
||||
@position: the new position to place @child. Positions are numbered from
|
||||
0 to n-1.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_attach ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menu:
|
||||
@child:
|
||||
@left_attach:
|
||||
@right_attach:
|
||||
@top_attach:
|
||||
@bottom_attach:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_popup_for_device ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menu:
|
||||
@device:
|
||||
@parent_menu_shell:
|
||||
@parent_menu_item:
|
||||
@func:
|
||||
@data:
|
||||
@destroy:
|
||||
@button:
|
||||
@activate_time:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_popup ##### -->
|
||||
|
||||
|
||||
@menu:
|
||||
@parent_menu_shell:
|
||||
@parent_menu_item:
|
||||
@func:
|
||||
@data:
|
||||
@button:
|
||||
@activate_time:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_set_accel_group ##### -->
|
||||
<para>
|
||||
Set the #GtkAccelGroup which holds global accelerators for the menu.
|
||||
This accelerator group needs to also be added to all windows that
|
||||
this menu is being used in with gtk_window_add_accel_group(), in order
|
||||
for those windows to support all the accelerators contained in this group.
|
||||
</para>
|
||||
|
||||
@menu: a #GtkMenu.
|
||||
@accel_group: the #GtkAccelGroup to be associated with the menu.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_get_accel_group ##### -->
|
||||
<para>
|
||||
Gets the #GtkAccelGroup which holds global accelerators for the menu.
|
||||
See gtk_menu_set_accel_group().
|
||||
</para>
|
||||
|
||||
@menu: a #GtkMenu.
|
||||
@Returns: the #GtkAccelGroup associated with the menu.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_set_accel_path ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menu:
|
||||
@accel_path:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_get_accel_path ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menu:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_set_title ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@menu:
|
||||
@title:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_get_title ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menu:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_set_monitor ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menu:
|
||||
@monitor_num:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_get_monitor ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menu:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_get_tearoff_state ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menu:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_set_reserve_toggle_size ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menu:
|
||||
@reserve_toggle_size:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_get_reserve_toggle_size ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menu:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_popdown ##### -->
|
||||
<para>
|
||||
Removes the menu from the screen.
|
||||
</para>
|
||||
|
||||
@menu: a #GtkMenu.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_reposition ##### -->
|
||||
<para>
|
||||
Repositions the menu according to its position function.
|
||||
</para>
|
||||
|
||||
@menu: a #GtkMenu.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_get_active ##### -->
|
||||
<para>
|
||||
Returns the selected menu item from the menu. This is used by the
|
||||
#GtkOptionMenu.
|
||||
</para>
|
||||
|
||||
@menu: a #GtkMenu.
|
||||
@Returns: the #GtkMenuItem that was last selected in the menu. If a
|
||||
selection has not yet been made, the first menu item is selected.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_set_active ##### -->
|
||||
<para>
|
||||
Selects the specified menu item within the menu. This is used by the
|
||||
#GtkOptionMenu and should not be used by anyone else.
|
||||
</para>
|
||||
|
||||
@menu: a #GtkMenu.
|
||||
@index_: the index of the menu item to select. Index values are from
|
||||
0 to n-1.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_set_tearoff_state ##### -->
|
||||
<para>
|
||||
Changes the tearoff state of the menu. A menu is normally displayed
|
||||
as drop down menu which persists as long as the menu is active. It can
|
||||
also be displayed as a tearoff menu which persists until it is closed
|
||||
or reattached.
|
||||
</para>
|
||||
|
||||
@menu: a #GtkMenu.
|
||||
@torn_off: If %TRUE, menu is displayed as a tearoff menu.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_attach_to_widget ##### -->
|
||||
<para>
|
||||
Attaches the menu to the widget and provides a callback function that will
|
||||
be invoked when the menu calls gtk_menu_detach() during its destruction.
|
||||
</para>
|
||||
|
||||
@menu: a #GtkMenu.
|
||||
@attach_widget: the #GtkWidget that the menu will be attached to.
|
||||
@detacher: the user supplied callback function that will be called when
|
||||
the menu calls gtk_menu_detach().
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_detach ##### -->
|
||||
<para>
|
||||
Detaches the menu from the widget to which it had been attached.
|
||||
This function will call the callback function, @detacher, provided
|
||||
when the gtk_menu_attach_to_widget() function was called.
|
||||
</para>
|
||||
|
||||
@menu: a #GtkMenu.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_get_attach_widget ##### -->
|
||||
<para>
|
||||
Returns the #GtkWidget that the menu is attached to.
|
||||
</para>
|
||||
|
||||
@menu: a #GtkMenu.
|
||||
@Returns: the #GtkWidget that the menu is attached to.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_get_for_attach_widget ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@widget:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### USER_FUNCTION GtkMenuPositionFunc ##### -->
|
||||
<para>
|
||||
A user function supplied when calling gtk_menu_popup() which controls the
|
||||
positioning of the menu when it is displayed. The function sets the @x
|
||||
and @y parameters to the coordinates where the menu is to be drawn.
|
||||
To make the menu appear on a different monitor than the mouse pointer,
|
||||
gtk_menu_set_monitor() must be called.
|
||||
</para>
|
||||
|
||||
@menu: a #GtkMenu.
|
||||
@x: address of the #gint representing the horizontal position where the
|
||||
menu shall be drawn. This is an output parameter.
|
||||
@y: address of the #gint representing the vertical position where the
|
||||
menu shall be drawn. This is an output parameter.
|
||||
@push_in: This parameter controls how menus placed outside the monitor are handled.
|
||||
If this is set to %TRUE and part of the menu is outside the monitor then
|
||||
GTK+ pushes the window into the visible area, effectively modifying the
|
||||
popup position.
|
||||
Note that moving and possibly resizing the menu around will alter the
|
||||
scroll position to keep the menu items "in place", i.e. at the same monitor
|
||||
position they would have been without resizing.
|
||||
In practice, this behavior is only useful for combobox popups or option
|
||||
menus and cannot be used to simply confine a menu to monitor boundaries.
|
||||
In that case, changing the scroll offset is not desirable.
|
||||
@user_data: the data supplied by the user in the gtk_menu_popup() @data
|
||||
parameter.
|
||||
|
||||
|
||||
<!-- ##### USER_FUNCTION GtkMenuDetachFunc ##### -->
|
||||
<para>
|
||||
A user function supplied when calling gtk_menu_attach_to_widget() which
|
||||
will be called when the menu is later detached from the widget.
|
||||
</para>
|
||||
|
||||
@attach_widget: the #GtkWidget that the menu is being detached from.
|
||||
@menu: the #GtkMenu being detached.
|
||||
|
||||
|
||||
@@ -1,104 +0,0 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkMenuBar
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
A subclass widget for GtkMenuShell which holds GtkMenuItem widgets
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
The #GtkMenuBar is a subclass of #GtkMenuShell which contains one to many #GtkMenuItem. The result is a standard menu bar which can hold many menu items. #GtkMenuBar allows for a shadow type to be set for aesthetic purposes. The shadow types are defined in the #gtk_menu_bar_set_shadow_type function.
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
#GtkMenuShell, #GtkMenu, #GtkMenuItem
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkMenuBar ##### -->
|
||||
<para>
|
||||
The #GtkMenuBar struct contains the following fields. (These fields should be considered read-only. They should never be set by an application.)
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ARG GtkMenuBar:child-pack-direction ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenuBar:pack-direction ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenuBar:internal-padding ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkMenuBar:shadow-type ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_bar_new ##### -->
|
||||
<para>
|
||||
Creates the new #GtkMenuBar
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns: the #GtkMenuBar
|
||||
|
||||
|
||||
<!-- ##### ENUM GtkPackDirection ##### -->
|
||||
<para>
|
||||
Determines how widgets should be packed insided menubars and
|
||||
menuitems contained in menubars.
|
||||
</para>
|
||||
|
||||
@GTK_PACK_DIRECTION_LTR: Widgets are packed left-to-right.
|
||||
@GTK_PACK_DIRECTION_RTL: Widgets are packed right-to-left.
|
||||
@GTK_PACK_DIRECTION_TTB: Widgets are packed top-to-bottom.
|
||||
@GTK_PACK_DIRECTION_BTT: Widgets are packed bottom-to-top.
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_bar_set_pack_direction ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menubar:
|
||||
@pack_dir:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_bar_get_pack_direction ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menubar:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_bar_set_child_pack_direction ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menubar:
|
||||
@child_pack_dir:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_bar_get_child_pack_direction ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menubar:
|
||||
@Returns:
|
||||
|
||||
|
||||
@@ -1,224 +0,0 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkMenuShell
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
A base class for menu objects
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
A #GtkMenuShell is the abstract base class used to derive the
|
||||
#GtkMenu and #GtkMenuBar subclasses.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
A #GtkMenuShell is a container of #GtkMenuItem objects arranged in a
|
||||
list which can be navigated, selected, and activated by the user to perform
|
||||
application functions. A #GtkMenuItem can have a submenu associated with it,
|
||||
allowing for nested hierarchical menus.
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkMenuShell ##### -->
|
||||
<para>
|
||||
The #GtkMenuShell-struct struct contains the following fields.
|
||||
(These fields should be considered read-only. They should never be set by
|
||||
an application.)
|
||||
|
||||
<informaltable pgwide="1" frame="none" role="struct">
|
||||
<tgroup cols="2"><colspec colwidth="2*"/><colspec colwidth="8*"/>
|
||||
<tbody>
|
||||
|
||||
<row>
|
||||
<entry>#GList *children;</entry>
|
||||
<entry>The list of #GtkMenuItem objects contained by this #GtkMenuShell.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody></tgroup></informaltable>
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### SIGNAL GtkMenuShell::activate-current ##### -->
|
||||
<para>
|
||||
An action signal that activates the current menu item within the menu
|
||||
shell.
|
||||
</para>
|
||||
|
||||
@menushell: the object which received the signal.
|
||||
@force_hide: if TRUE, hide the menu after activating the menu item.
|
||||
|
||||
<!-- ##### SIGNAL GtkMenuShell::cancel ##### -->
|
||||
<para>
|
||||
An action signal which cancels the selection within the menu shell.
|
||||
Causes the GtkMenuShell::selection-done signal to be emitted.
|
||||
</para>
|
||||
|
||||
@menushell: the object which received the signal.
|
||||
|
||||
<!-- ##### SIGNAL GtkMenuShell::cycle-focus ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menushell: the object which received the signal.
|
||||
@arg1:
|
||||
|
||||
<!-- ##### SIGNAL GtkMenuShell::deactivate ##### -->
|
||||
<para>
|
||||
This signal is emitted when a menu shell is deactivated.
|
||||
</para>
|
||||
|
||||
@menushell: the object which received the signal.
|
||||
|
||||
<!-- ##### SIGNAL GtkMenuShell::move-current ##### -->
|
||||
<para>
|
||||
An action signal which moves the current menu item in the direction
|
||||
specified by @direction.
|
||||
</para>
|
||||
|
||||
@menushell: the object which received the signal.
|
||||
@direction: the direction to move.
|
||||
|
||||
<!-- ##### SIGNAL GtkMenuShell::move-selected ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menushell: the object which received the signal.
|
||||
@arg1:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### SIGNAL GtkMenuShell::selection-done ##### -->
|
||||
<para>
|
||||
This signal is emitted when a selection has been completed within a menu
|
||||
shell.
|
||||
</para>
|
||||
|
||||
@menushell: the object which received the signal.
|
||||
|
||||
<!-- ##### ARG GtkMenuShell:take-focus ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_shell_append ##### -->
|
||||
<para>
|
||||
Adds a new #GtkMenuItem to the end of the menu shell's item list.
|
||||
</para>
|
||||
|
||||
@menu_shell: a #GtkMenuShell.
|
||||
@child: The #GtkMenuItem to add.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_shell_prepend ##### -->
|
||||
<para>
|
||||
Adds a new #GtkMenuItem to the beginning of the menu shell's item list.
|
||||
</para>
|
||||
|
||||
@menu_shell: a #GtkMenuShell.
|
||||
@child: The #GtkMenuItem to add.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_shell_insert ##### -->
|
||||
<para>
|
||||
Adds a new #GtkMenuItem to the menu shell's item list at the position
|
||||
indicated by @position.
|
||||
</para>
|
||||
|
||||
@menu_shell: a #GtkMenuShell.
|
||||
@child: The #GtkMenuItem to add.
|
||||
@position: The position in the item list where @child is added.
|
||||
Positions are numbered from 0 to n-1.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_shell_deactivate ##### -->
|
||||
<para>
|
||||
Deactivates the menu shell. Typically this results in the menu shell
|
||||
being erased from the screen.
|
||||
</para>
|
||||
|
||||
@menu_shell: a #GtkMenuShell.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_shell_select_item ##### -->
|
||||
<para>
|
||||
Selects the menu item from the menu shell.
|
||||
</para>
|
||||
|
||||
@menu_shell: a #GtkMenuShell.
|
||||
@menu_item: The #GtkMenuItem to select.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_shell_select_first ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menu_shell:
|
||||
@search_sensitive:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_shell_deselect ##### -->
|
||||
<para>
|
||||
Deselects the currently selected item from the menu shell, if any.
|
||||
</para>
|
||||
|
||||
@menu_shell: a #GtkMenuShell.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_shell_activate_item ##### -->
|
||||
<para>
|
||||
Activates the menu item within the menu shell.
|
||||
</para>
|
||||
|
||||
@menu_shell: a #GtkMenuShell.
|
||||
@menu_item: The #GtkMenuItem to activate.
|
||||
@force_deactivate: If TRUE, force the deactivation of the menu shell
|
||||
after the menu item is activated.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_shell_cancel ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menu_shell:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_shell_set_take_focus ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menu_shell:
|
||||
@take_focus:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_menu_shell_get_take_focus ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@menu_shell:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### ENUM GtkMenuDirectionType ##### -->
|
||||
<para>
|
||||
An enumeration representing directional movements within a menu.
|
||||
</para>
|
||||
|
||||
@GTK_MENU_DIR_PARENT: To the parent menu shell.
|
||||
@GTK_MENU_DIR_CHILD: To the submenu, if any, associated with the item.
|
||||
@GTK_MENU_DIR_NEXT: To the next menu item.
|
||||
@GTK_MENU_DIR_PREV: To the previous menu item.
|
||||
|
||||
@@ -1,186 +0,0 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkPrintJob
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
Represents a print job
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
A #GtkPrintJob object represents a job that is sent to a
|
||||
printer. You only need to deal directly with print jobs if
|
||||
you use the non-portable #GtkPrintUnixDialog API.
|
||||
</para>
|
||||
<para>
|
||||
Use gtk_print_job_get_surface() to obtain the cairo surface
|
||||
onto which the pages must be drawn. Use gtk_print_job_send()
|
||||
to send the finished job to the printer. If you don't use cairo
|
||||
#GtkPrintJob also supports printing of manually generated postscript,
|
||||
via gtk_print_job_set_source_file().
|
||||
<!-- FIXME more details needed here -->
|
||||
</para>
|
||||
<!-- FIXME examples ? -->
|
||||
|
||||
<para>
|
||||
Printing support was added in GTK+ 2.10.
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkPrintJob ##### -->
|
||||
<para>
|
||||
The GtkPrintJob struct contains only private members
|
||||
and should not be directly accessed.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### SIGNAL GtkPrintJob::status-changed ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@printjob: the object which received the signal.
|
||||
|
||||
<!-- ##### ARG GtkPrintJob:page-setup ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkPrintJob:printer ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkPrintJob:settings ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkPrintJob:title ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkPrintJob:track-print-status ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### USER_FUNCTION GtkPrintJobCompleteFunc ##### -->
|
||||
<para>
|
||||
The type of callback that is passed to gtk_print_job_send().
|
||||
It is called when the print job has been completely sent.
|
||||
</para>
|
||||
|
||||
@print_job: the #GtkPrintJob
|
||||
@user_data: user data that has been passed to gtk_print_job_send()
|
||||
@error: a #GError that contains error information if the sending
|
||||
of the print job failed, otherwise %NULL
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_job_new ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@title:
|
||||
@printer:
|
||||
@settings:
|
||||
@page_setup:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_job_get_settings ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@job:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_job_get_printer ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@job:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_job_get_title ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@job:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_job_get_status ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@job:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_job_set_source_file ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@job:
|
||||
@filename:
|
||||
@error:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_job_get_surface ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@job:
|
||||
@error:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_job_send ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@job:
|
||||
@callback:
|
||||
@user_data:
|
||||
@dnotify:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_job_set_track_print_status ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@job:
|
||||
@track_status:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_job_get_track_print_status ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@job:
|
||||
@Returns:
|
||||
|
||||
|
||||
@@ -630,14 +630,11 @@ The #GQuark used for #GtkPrintError errors.
|
||||
|
||||
<!-- ##### USER_FUNCTION GtkPageSetupDoneFunc ##### -->
|
||||
<para>
|
||||
The type of function that is passed to gtk_print_run_page_setup_dialog_async().
|
||||
This function will be called when the page setup dialog is dismissed, and
|
||||
also serves as destroy notify for @data.
|
||||
|
||||
</para>
|
||||
|
||||
@page_setup: the #GtkPageSetup that has been
|
||||
@data: user data that has been passed to
|
||||
gtk_print_run_page_setup_dialog_async().
|
||||
@page_setup:
|
||||
@data:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_print_run_page_setup_dialog_async ##### -->
|
||||
|
||||
@@ -1,207 +0,0 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkRecentFilter
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
A filter for selecting a subset of recently used files
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
A #GtkRecentFilter can be used to restrict the files being shown
|
||||
in a #GtkRecentChooser. Files can be filtered based on their name
|
||||
(with gtk_recent_filter_add_pattern()), on their mime type (with
|
||||
gtk_file_filter_add_mime_type()), on the application that has
|
||||
registered them (with gtk_recent_filter_add_application()), or by
|
||||
a custom filter function (with gtk_recent_filter_add_custom()).
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Filtering by mime type handles aliasing and subclassing of mime
|
||||
types; e.g. a filter for text/plain also matches a file with mime
|
||||
type application/rtf, since application/rtf is a subclass of text/plain.
|
||||
Note that #GtkRecentFilter allows wildcards for the subtype of a
|
||||
mime type, so you can e.g. filter for image/*.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Normally, filters are used by adding them to a #GtkRecentChooser,
|
||||
see gtk_recent_chooser_add_filter(), but it is also possible to
|
||||
manually use a filter on a file with gtk_recent_filter_filter().
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Recently used files are supported since GTK+ 2.10.
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
#GtkRecentChooser
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkRecentFilter ##### -->
|
||||
<para>
|
||||
The <structname>GtkRecentFilter</structname> struct contains
|
||||
only private fields and should not be directly accessed.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkRecentFilterInfo ##### -->
|
||||
<para>
|
||||
A <structname>GtkRecentFilterInfo</structname> struct is used
|
||||
to pass information about the tested file to gtk_recent_filter_filter().
|
||||
</para>
|
||||
|
||||
@contains: Flags indicating which of the following fields need
|
||||
are filled
|
||||
@uri: the URI of the file being tested
|
||||
@display_name: the string that will be used to display the file
|
||||
in the recent chooser
|
||||
@mime_type: the mime type of the file
|
||||
@applications: the list of applications that have registered the file
|
||||
@groups: the groups to which the file belongs to
|
||||
@age: the number of days elapsed since the file has been registered
|
||||
|
||||
<!-- ##### ENUM GtkRecentFilterFlags ##### -->
|
||||
<para>
|
||||
These flags indicate what parts of a #GtkRecentFilterInfo struct
|
||||
are filled or need to be filled.
|
||||
</para>
|
||||
|
||||
@GTK_RECENT_FILTER_URI: the URI of the file being tested
|
||||
@GTK_RECENT_FILTER_DISPLAY_NAME: the string that will be used to
|
||||
display the file in the recent chooser
|
||||
@GTK_RECENT_FILTER_MIME_TYPE: the mime type of the file
|
||||
@GTK_RECENT_FILTER_APPLICATION: the list of applications that have
|
||||
registered the file
|
||||
@GTK_RECENT_FILTER_GROUP: the groups to which the file belongs to
|
||||
@GTK_RECENT_FILTER_AGE: the number of days elapsed since the file
|
||||
has been registered
|
||||
|
||||
<!-- ##### USER_FUNCTION GtkRecentFilterFunc ##### -->
|
||||
<para>
|
||||
The type of function that is used with custom filters,
|
||||
see gtk_recent_filter_add_custom().
|
||||
</para>
|
||||
|
||||
@filter_info: a #GtkRecentFilterInfo that is filled according
|
||||
to the @needed flags passed to gtk_recent_filter_add_custom()
|
||||
@user_data: user data passed to gtk_recent_filter_add_custom()
|
||||
@Returns: %TRUE if the file should be displayed
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_recent_filter_new ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_recent_filter_get_name ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filter:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_recent_filter_set_name ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filter:
|
||||
@name:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_recent_filter_add_mime_type ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filter:
|
||||
@mime_type:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_recent_filter_add_pattern ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filter:
|
||||
@pattern:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_recent_filter_add_pixbuf_formats ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filter:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_recent_filter_add_application ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filter:
|
||||
@application:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_recent_filter_add_group ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filter:
|
||||
@group:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_recent_filter_add_age ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filter:
|
||||
@days:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_recent_filter_add_custom ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filter:
|
||||
@needed:
|
||||
@func:
|
||||
@data:
|
||||
@data_destroy:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_recent_filter_get_needed ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filter:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_recent_filter_filter ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filter:
|
||||
@filter_info:
|
||||
@Returns:
|
||||
|
||||
|
||||
@@ -1,542 +0,0 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
Selections
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
Functions for handling inter-process communication via selections
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
|
||||
<para>
|
||||
The selection mechanism provides the basis for different types
|
||||
of communication between processes. In particular, drag and drop and
|
||||
#GtkClipboard work via selections. You will very seldom or
|
||||
never need to use most of the functions in this section directly;
|
||||
#GtkClipboard provides a nicer interface to the same functionality.
|
||||
</para>
|
||||
<para>
|
||||
Some of the datatypes defined this section are used in
|
||||
the #GtkClipboard and drag-and-drop API's as well. The
|
||||
#GtkTargetEntry structure and #GtkTargetList objects represent
|
||||
lists of data types that are supported when sending or
|
||||
receiving data. The #GtkSelectionData object is used to
|
||||
store a chunk of data along with the data type and other
|
||||
associated information.
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
<variablelist>
|
||||
|
||||
<varlistentry>
|
||||
<term>#GtkWidget</term>
|
||||
<listitem><para>Much of the operation of selections happens via
|
||||
signals for #GtkWidget. In particular, if you are
|
||||
using the functions in this section, you may need
|
||||
to pay attention to ::selection_get,
|
||||
::selection_received, and :selection_clear_event
|
||||
signals.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkTargetEntry ##### -->
|
||||
<para>
|
||||
A #GtkTargetEntry structure represents a single type of
|
||||
data than can be supplied for by a widget for a selection
|
||||
or for supplied or received during drag-and-drop. It
|
||||
contains a string representing the drag type, a flags
|
||||
field (used only for drag and drop - see #GtkTargetFlags),
|
||||
and an application assigned integer ID. The integer
|
||||
ID will later be passed as a signal parameter for signals
|
||||
like "selection_get". It allows the application to identify
|
||||
the target type without extensive string compares.
|
||||
</para>
|
||||
|
||||
@target:
|
||||
@flags:
|
||||
@info:
|
||||
|
||||
<!-- ##### STRUCT GtkTargetList ##### -->
|
||||
<para>
|
||||
A #GtkTargetList structure is a reference counted list
|
||||
of #GtkTargetPair. It is used to represent the same
|
||||
information as a table of #GtkTargetEntry, but in
|
||||
an efficient form. This structure should be treated as
|
||||
opaque.
|
||||
</para>
|
||||
|
||||
@list:
|
||||
@ref_count:
|
||||
|
||||
<!-- ##### STRUCT GtkTargetPair ##### -->
|
||||
<para>
|
||||
Internally used structure in the drag-and-drop and
|
||||
selection handling code.
|
||||
</para>
|
||||
|
||||
@target:
|
||||
@flags:
|
||||
@info:
|
||||
|
||||
<!-- ##### FUNCTION gtk_target_entry_new ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@target:
|
||||
@flags:
|
||||
@info:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_target_entry_copy ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@data:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_target_entry_free ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@data:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_target_list_new ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@targets:
|
||||
@ntargets:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_target_list_ref ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@list:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_target_list_unref ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@list:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_target_list_add ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@list:
|
||||
@target:
|
||||
@flags:
|
||||
@info:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_target_list_add_table ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@list:
|
||||
@targets:
|
||||
@ntargets:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_target_list_add_text_targets ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@list:
|
||||
@info:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_target_list_add_image_targets ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@list:
|
||||
@info:
|
||||
@writable:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_target_list_add_uri_targets ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@list:
|
||||
@info:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_target_list_add_rich_text_targets ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@list:
|
||||
@info:
|
||||
@deserializable:
|
||||
@buffer:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_target_list_remove ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@list:
|
||||
@target:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_target_list_find ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@list:
|
||||
@target:
|
||||
@info:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_target_table_free ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@targets:
|
||||
@n_targets:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_target_table_new_from_list ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@list:
|
||||
@n_targets:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_owner_set ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@widget:
|
||||
@selection:
|
||||
@time_:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_owner_set_for_display ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@display:
|
||||
@widget:
|
||||
@selection:
|
||||
@time_:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_add_target ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@widget:
|
||||
@selection:
|
||||
@target:
|
||||
@info:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_add_targets ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@widget:
|
||||
@selection:
|
||||
@targets:
|
||||
@ntargets:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_clear_targets ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@widget:
|
||||
@selection:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_convert ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@widget:
|
||||
@selection:
|
||||
@target:
|
||||
@time_:
|
||||
@Returns: x
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_set ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@selection_data:
|
||||
@type:
|
||||
@format:
|
||||
@data:
|
||||
@length:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_set_text ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@selection_data:
|
||||
@str:
|
||||
@len:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_get_text ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@selection_data:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_set_pixbuf ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@selection_data:
|
||||
@pixbuf:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_get_pixbuf ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@selection_data:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_set_uris ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@selection_data:
|
||||
@uris:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_get_uris ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@selection_data:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_get_targets ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@selection_data:
|
||||
@targets:
|
||||
@n_atoms:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_targets_include_image ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@selection_data:
|
||||
@writable:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_targets_include_text ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@selection_data:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_targets_include_uri ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@selection_data:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_targets_include_rich_text ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@selection_data:
|
||||
@buffer:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_get_selection ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@selection_data:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_get_data ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@selection_data:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_get_length ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@selection_data:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_get_data_type ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@selection_data:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_get_display ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@selection_data:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_get_format ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@selection_data:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_get_target ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@selection_data:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_targets_include_image ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@targets:
|
||||
@n_targets:
|
||||
@writable:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_targets_include_text ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@targets:
|
||||
@n_targets:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_targets_include_uri ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@targets:
|
||||
@n_targets:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_targets_include_rich_text ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@targets:
|
||||
@n_targets:
|
||||
@buffer:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_remove_all ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@widget:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_copy ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@data:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_selection_data_free ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@data:
|
||||
|
||||
|
||||
@@ -1,498 +0,0 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkTextTag
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
A tag that can be applied to text in a GtkTextBuffer
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
You may wish to begin by reading the <link linkend="TextWidget">text widget
|
||||
conceptual overview</link> which gives an overview of all the objects and data
|
||||
types related to the text widget and how they work together.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Tags should be in the #GtkTextTagTable for a given #GtkTextBuffer
|
||||
before using them with that buffer.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
gtk_text_buffer_create_tag() is the best way to create tags.
|
||||
See <application>gtk-demo</application> for numerous examples.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The "invisible" property was not implemented for GTK+ 2.0.
|
||||
It is working (with minor issues) since 2.8.
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkTextTag ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### SIGNAL GtkTextTag::event ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@texttag: the object which received the signal.
|
||||
@arg1:
|
||||
@event:
|
||||
@arg2:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### ARG GtkTextTag:accumulative-margin ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:background ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:background-full-height ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:background-full-height-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:background-gdk ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:background-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:direction ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:editable ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:editable-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:family ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:family-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:font ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:font-desc ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:foreground ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:foreground-gdk ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:foreground-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:indent ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:indent-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:invisible ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:invisible-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:justification ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:justification-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:language ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:language-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:left-margin ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:left-margin-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:name ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:paragraph-background ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:paragraph-background-gdk ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:paragraph-background-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:pixels-above-lines ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:pixels-above-lines-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:pixels-below-lines ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:pixels-below-lines-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:pixels-inside-wrap ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:pixels-inside-wrap-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:right-margin ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:right-margin-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:rise ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:rise-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:scale ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:scale-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:size ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:size-points ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:size-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:stretch ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:stretch-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:strikethrough ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:strikethrough-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:style ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:style-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:tabs ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:tabs-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:underline ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:underline-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:variant ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:variant-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:weight ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:weight-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:wrap-mode ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkTextTag:wrap-mode-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ENUM GtkWrapMode ##### -->
|
||||
<para>
|
||||
Describes a type of line wrapping.
|
||||
</para>
|
||||
|
||||
@GTK_WRAP_NONE: do not wrap lines; just make the text area wider
|
||||
@GTK_WRAP_CHAR: wrap text, breaking lines anywhere the cursor can
|
||||
appear (between characters, usually - if you want to
|
||||
be technical, between graphemes, see
|
||||
pango_get_log_attrs())
|
||||
@GTK_WRAP_WORD: wrap text, breaking lines in between words
|
||||
@GTK_WRAP_WORD_CHAR: wrap text, breaking lines in between words, or if
|
||||
that is not enough, also between graphemes.
|
||||
|
||||
<!-- ##### STRUCT GtkTextAttributes ##### -->
|
||||
<para>
|
||||
Using #GtkTextAttributes directly should rarely be necessary. It's
|
||||
primarily useful with gtk_text_iter_get_attributes(). As with most
|
||||
GTK+ structs, the fields in this struct should only be read, never
|
||||
modified directly.
|
||||
</para>
|
||||
|
||||
@appearance: pointer to sub-struct containing certain attributes
|
||||
@justification:
|
||||
@direction:
|
||||
@font:
|
||||
@font_scale:
|
||||
@left_margin:
|
||||
@indent:
|
||||
@right_margin:
|
||||
@pixels_above_lines:
|
||||
@pixels_below_lines:
|
||||
@pixels_inside_wrap:
|
||||
@tabs:
|
||||
@wrap_mode:
|
||||
@language:
|
||||
@invisible:
|
||||
@bg_full_height:
|
||||
@editable:
|
||||
|
||||
<!-- ##### FUNCTION gtk_text_tag_new ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@name:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_text_tag_get_priority ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tag:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_text_tag_set_priority ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tag:
|
||||
@priority:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_text_tag_event ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tag:
|
||||
@event_object:
|
||||
@event:
|
||||
@iter:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkTextAppearance ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@bg_color:
|
||||
@fg_color:
|
||||
@rise:
|
||||
@underline:
|
||||
@strikethrough:
|
||||
@draw_bg:
|
||||
@inside_selection:
|
||||
@is_text:
|
||||
|
||||
<!-- ##### FUNCTION gtk_text_attributes_new ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_text_attributes_copy ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@src:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_text_attributes_copy_values ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@src:
|
||||
@dest:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_text_attributes_unref ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@values:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_text_attributes_ref ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@values:
|
||||
@Returns:
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
||||
]>
|
||||
<refentry id="TreeWidget" revision="20 Mar 2002">
|
||||
<refentry id="TreeWidget">
|
||||
<refmeta>
|
||||
<refentrytitle>Tree and List Widget Overview</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
||||
]>
|
||||
<refentry id="gtk-windows" revision="4 Feb 2001">
|
||||
<refentry id="gtk-windows">
|
||||
<refmeta>
|
||||
<refentrytitle>Using GTK+ on Windows</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
||||
]>
|
||||
<refentry id="gtk-x11" revision="17 Jan 2002">
|
||||
<refentry id="gtk-x11">
|
||||
<refmeta>
|
||||
<refentrytitle>Using GTK+ on the X Window System</refentrytitle>
|
||||
<manvolnum>3</manvolnum>
|
||||
|
||||
+12
-1
@@ -48,4 +48,15 @@ LDADD = \
|
||||
$(top_builddir)/gtk/libgtk-3.0.la \
|
||||
$(GTK_DEP_LIBS)
|
||||
|
||||
noinst_PROGRAMS = hello-world window-default bloatpad
|
||||
drawing_LDADD = $(LDADD) \
|
||||
$(top_builddir)/gdk/libgdk-3.0.la
|
||||
|
||||
noinst_PROGRAMS = \
|
||||
hello-world \
|
||||
window-default \
|
||||
bloatpad \
|
||||
grid-packing \
|
||||
drawing \
|
||||
builder
|
||||
|
||||
EXTRA_DIST = builder.ui
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
static void
|
||||
print_hello (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
g_print ("Hello World\n");
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc,
|
||||
char *argv[])
|
||||
{
|
||||
GtkBuilder *builder;
|
||||
GObject *window;
|
||||
GObject *button;
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
/* Construct a GtkBuilder instance and load our UI description */
|
||||
builder = gtk_builder_new ();
|
||||
gtk_builder_add_from_file (builder, "builder.ui", NULL);
|
||||
|
||||
/* Connect signal handlers to the constructed widgets. */
|
||||
window = gtk_builder_get_object (builder, "window");
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
|
||||
|
||||
button = gtk_builder_get_object (builder, "button1");
|
||||
g_signal_connect (button, "clicked", G_CALLBACK (print_hello), NULL);
|
||||
|
||||
button = gtk_builder_get_object (builder, "button2");
|
||||
g_signal_connect (button, "clicked", G_CALLBACK (print_hello), NULL);
|
||||
|
||||
button = gtk_builder_get_object (builder, "quit");
|
||||
g_signal_connect (button, "clicked", G_CALLBACK (gtk_main_quit), NULL);
|
||||
|
||||
gtk_main ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
<interface>
|
||||
<object id="window" class="GtkWindow">
|
||||
<property name="visible">True</property>
|
||||
<property name="title">Grid</property>
|
||||
<property name="border-width">10</property>
|
||||
<child>
|
||||
<object id="grid" class="GtkGrid">
|
||||
<property name="visible">True</property>
|
||||
<child>
|
||||
<object id="button1" class="GtkButton">
|
||||
<property name="visible">True</property>
|
||||
<property name="label">Button 1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object id="button2" class="GtkButton">
|
||||
<property name="visible">True</property>
|
||||
<property name="label">Button 2</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object id="quit" class="GtkButton">
|
||||
<property name="visible">True</property>
|
||||
<property name="label">Quit</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">1</property>
|
||||
<property name="width">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
@@ -0,0 +1,200 @@
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
/* Surface to store current scribbles */
|
||||
static cairo_surface_t *surface = NULL;
|
||||
|
||||
static void
|
||||
clear_surface (void)
|
||||
{
|
||||
cairo_t *cr;
|
||||
|
||||
cr = cairo_create (surface);
|
||||
|
||||
cairo_set_source_rgb (cr, 1, 1, 1);
|
||||
cairo_paint (cr);
|
||||
|
||||
cairo_destroy (cr);
|
||||
}
|
||||
|
||||
/* Create a new surface of the appropriate size to store our scribbles */
|
||||
static gboolean
|
||||
configure_event_cb (GtkWidget *widget,
|
||||
GdkEventConfigure *event,
|
||||
gpointer data)
|
||||
{
|
||||
if (surface)
|
||||
cairo_surface_destroy (surface);
|
||||
|
||||
surface = gdk_window_create_similar_surface (gtk_widget_get_window (widget),
|
||||
CAIRO_CONTENT_COLOR,
|
||||
gtk_widget_get_allocated_width (widget),
|
||||
gtk_widget_get_allocated_height (widget));
|
||||
|
||||
/* Initialize the surface to white */
|
||||
clear_surface ();
|
||||
|
||||
/* We've handled the configure event, no need for further processing. */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Redraw the screen from the surface. Note that the ::draw
|
||||
* signal receives a ready-to-be-used cairo_t that is already
|
||||
* clipped to only draw the exposed areas of the widget
|
||||
*/
|
||||
static gboolean
|
||||
draw_cb (GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
gpointer data)
|
||||
{
|
||||
cairo_set_source_surface (cr, surface, 0, 0);
|
||||
cairo_paint (cr);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Draw a rectangle on the surface at the given position */
|
||||
static void
|
||||
draw_brush (GtkWidget *widget,
|
||||
gdouble x,
|
||||
gdouble y)
|
||||
{
|
||||
cairo_t *cr;
|
||||
|
||||
/* Paint to the surface, where we store our state */
|
||||
cr = cairo_create (surface);
|
||||
|
||||
cairo_rectangle (cr, x - 3, y - 3, 6, 6);
|
||||
cairo_fill (cr);
|
||||
|
||||
cairo_destroy (cr);
|
||||
|
||||
/* Now invalidate the affected region of the drawing area. */
|
||||
gtk_widget_queue_draw_area (widget, x - 3, y - 3, 6, 6);
|
||||
}
|
||||
|
||||
/* Handle button press events by either drawing a rectangle
|
||||
* or clearing the surface, depending on which button was pressed.
|
||||
* The ::button-press signal handler receives a GdkEventButton
|
||||
* struct which contains this information.
|
||||
*/
|
||||
static gboolean
|
||||
button_press_event_cb (GtkWidget *widget,
|
||||
GdkEventButton *event,
|
||||
gpointer data)
|
||||
{
|
||||
/* paranoia check, in case we haven't gotten a configure event */
|
||||
if (surface == NULL)
|
||||
return FALSE;
|
||||
|
||||
if (event->button == 1)
|
||||
{
|
||||
draw_brush (widget, event->x, event->y);
|
||||
}
|
||||
else if (event->button == 3)
|
||||
{
|
||||
clear_surface ();
|
||||
gtk_widget_queue_draw (widget);
|
||||
}
|
||||
|
||||
/* We've handled the event, stop processing */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Handle motion events by continuing to draw if button 1 is
|
||||
* still held down. The ::motion-notify signal handler receives
|
||||
* a GdkEventMotion struct which contains this information.
|
||||
*/
|
||||
static gboolean
|
||||
motion_notify_event_cb (GtkWidget *widget,
|
||||
GdkEventMotion *event,
|
||||
gpointer data)
|
||||
{
|
||||
int x, y;
|
||||
GdkModifierType state;
|
||||
|
||||
/* paranoia check, in case we haven't gotten a configure event */
|
||||
if (surface == NULL)
|
||||
return FALSE;
|
||||
|
||||
/* This call is very important; it requests the next motion event.
|
||||
* If you don't call gdk_window_get_pointer() you'll only get
|
||||
* a single motion event. The reason is that we specified
|
||||
* GDK_POINTER_MOTION_HINT_MASK to gtk_widget_set_events().
|
||||
* If we hadn't specified that, we could just use event->x, event->y
|
||||
* as the pointer location. But we'd also get deluged in events.
|
||||
* By requesting the next event as we handle the current one,
|
||||
* we avoid getting a huge number of events faster than we
|
||||
* can cope.
|
||||
*/
|
||||
gdk_window_get_pointer (event->window, &x, &y, &state);
|
||||
|
||||
if (state & GDK_BUTTON1_MASK)
|
||||
draw_brush (widget, x, y);
|
||||
|
||||
/* We've handled it, stop processing */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
close_window (void)
|
||||
{
|
||||
if (surface)
|
||||
cairo_surface_destroy (surface);
|
||||
|
||||
gtk_main_quit ();
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc,
|
||||
char *argv[])
|
||||
{
|
||||
GtkWidget *window;
|
||||
GtkWidget *frame;
|
||||
GtkWidget *da;
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Drawing Area");
|
||||
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (close_window), NULL);
|
||||
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
|
||||
gtk_container_add (GTK_CONTAINER (window), frame);
|
||||
|
||||
da = gtk_drawing_area_new ();
|
||||
/* set a minimum size */
|
||||
gtk_widget_set_size_request (da, 100, 100);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (frame), da);
|
||||
|
||||
/* Signals used to handle the backing surface */
|
||||
g_signal_connect (da, "draw",
|
||||
G_CALLBACK (draw_cb), NULL);
|
||||
g_signal_connect (da,"configure-event",
|
||||
G_CALLBACK (configure_event_cb), NULL);
|
||||
|
||||
/* Event signals */
|
||||
g_signal_connect (da, "motion-notify-event",
|
||||
G_CALLBACK (motion_notify_event_cb), NULL);
|
||||
g_signal_connect (da, "button-press-event",
|
||||
G_CALLBACK (button_press_event_cb), NULL);
|
||||
|
||||
/* Ask to receive events the drawing area doesn't normally
|
||||
* subscribe to. In particular, we need to ask for the
|
||||
* button press and motion notify events that want to handle.
|
||||
*/
|
||||
gtk_widget_set_events (da, gtk_widget_get_events (da)
|
||||
| GDK_BUTTON_PRESS_MASK
|
||||
| GDK_POINTER_MOTION_MASK
|
||||
| GDK_POINTER_MOTION_HINT_MASK);
|
||||
|
||||
gtk_widget_show_all (window);
|
||||
|
||||
gtk_main ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
static void
|
||||
print_hello (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
g_print ("Hello World\n");
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc,
|
||||
char *argv[])
|
||||
{
|
||||
GtkWidget *window;
|
||||
GtkWidget *grid;
|
||||
GtkWidget *button;
|
||||
|
||||
/* This is called in all GTK applications. Arguments are parsed
|
||||
* from the command line and are returned to the application.
|
||||
*/
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
/* create a new window, and set its title */
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Grid");
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
|
||||
|
||||
/* Here we construct the container that is going pack our buttons */
|
||||
grid = gtk_grid_new ();
|
||||
|
||||
/* Pack the container in the window */
|
||||
gtk_container_add (GTK_CONTAINER (window), grid);
|
||||
|
||||
button = gtk_button_new_with_label ("Button 1");
|
||||
g_signal_connect (button, "clicked", G_CALLBACK (print_hello), NULL);
|
||||
|
||||
/* Place the first button in the grid cell (0, 0), and make it fill
|
||||
* just 1 cell horizontally and vertically (ie no spanning)
|
||||
*/
|
||||
gtk_grid_attach (GTK_GRID (grid), button, 0, 0, 1, 1);
|
||||
|
||||
button = gtk_button_new_with_label ("Button 2");
|
||||
g_signal_connect (button, "clicked", G_CALLBACK (print_hello), NULL);
|
||||
|
||||
/* Place the second button in the grid cell (1, 0), and make it fill
|
||||
* just 1 cell horizontally and vertically (ie no spanning)
|
||||
*/
|
||||
gtk_grid_attach (GTK_GRID (grid), button, 1, 0, 1, 1);
|
||||
|
||||
button = gtk_button_new_with_label ("Quit");
|
||||
g_signal_connect (button, "clicked", G_CALLBACK (gtk_main_quit), NULL);
|
||||
|
||||
/* Place the Quit button in the grid cell (0, 1), and make it
|
||||
* span 2 columns.
|
||||
*/
|
||||
gtk_grid_attach (GTK_GRID (grid), button, 0, 1, 2, 1);
|
||||
|
||||
/* Now that we are done packing our widgets, we show them all
|
||||
* in one go, by calling gtk_widget_show_all() on the window.
|
||||
* This call recursively calls gtk_widget_show() on all widgets
|
||||
* that are contained in the window, directly or indirectly.
|
||||
*/
|
||||
gtk_widget_show_all (window);
|
||||
|
||||
/* All GTK applications must have a gtk_main(). Control ends here
|
||||
* and waits for an event to occur (like a key press or a mouse event),
|
||||
* until gtk_main_quit() is called.
|
||||
*/
|
||||
gtk_main ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
+10
-3
@@ -3,7 +3,8 @@ include $(top_srcdir)/Makefile.decl
|
||||
-include $(INTROSPECTION_MAKEFILE)
|
||||
INTROSPECTION_GIRS =
|
||||
INTROSPECTION_SCANNER_ARGS = \
|
||||
--add-include-path=../gdk
|
||||
--add-include-path=../gdk \
|
||||
--warn-all
|
||||
INTROSPECTION_COMPILER_ARGS = \
|
||||
--includedir=$(srcdir) \
|
||||
--includedir=.
|
||||
@@ -184,11 +185,13 @@ introspection_files = \
|
||||
gdkenumtypes.h
|
||||
|
||||
Gdk-3.0.gir: libgdk-3.0.la Makefile
|
||||
Gdk_3_0_gir_SCANNERFLAGS = --warn-all --c-include="gdk/gdk.h"
|
||||
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_FILES = $(introspection_files)
|
||||
Gdk_3_0_gir_CFLAGS = $(INCLUDES)
|
||||
Gdk_3_0_gir_EXPORT_PACKAGES = gdk-3.0
|
||||
INTROSPECTION_GIRS += Gdk-3.0.gir
|
||||
|
||||
if USE_X11
|
||||
@@ -233,11 +236,15 @@ x11_introspection_files = \
|
||||
x11/gdkx11window.h
|
||||
|
||||
GdkX11-3.0.gir: libgdk-3.0.la Gdk-3.0.gir Makefile
|
||||
GdkX11_3_0_gir_SCANNERFLAGS = --warn-all --strip-prefix=Gdk --c-include="gdk/gdkx.h"
|
||||
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_FILES = $(x11_introspection_files)
|
||||
GdkX11_3_0_gir_CFLAGS = $(INCLUDES) -L$(top_builddir)/gdk
|
||||
GdkX11_3_0_gir_EXPORT_PACKAGES = gdk-x11-3.0
|
||||
INTROSPECTION_GIRS += GdkX11-3.0.gir
|
||||
|
||||
endif # USE_X11
|
||||
|
||||
@@ -129,7 +129,6 @@ static const GDebugKey gdk_debug_keys[] = {
|
||||
{"dnd", GDK_DEBUG_DND},
|
||||
{"xim", GDK_DEBUG_XIM},
|
||||
{"nograbs", GDK_DEBUG_NOGRABS},
|
||||
{"colormap", GDK_DEBUG_COLORMAP},
|
||||
{"input", GDK_DEBUG_INPUT},
|
||||
{"cursor", GDK_DEBUG_CURSOR},
|
||||
{"multihead", GDK_DEBUG_MULTIHEAD},
|
||||
@@ -268,7 +267,7 @@ gdk_pre_parse_libgtk_only (void)
|
||||
/**
|
||||
* gdk_parse_args:
|
||||
* @argc: the number of command line arguments.
|
||||
* @argv: the array of command line arguments.
|
||||
* @argv: (inout) (array length=argc): the array of command line arguments.
|
||||
*
|
||||
* Parse command line arguments, and store for future
|
||||
* use by calls to gdk_display_open().
|
||||
@@ -707,7 +706,7 @@ gdk_threads_init (void)
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_threads_set_lock_functions:
|
||||
* gdk_threads_set_lock_functions: (skip)
|
||||
* @enter_fn: function called to guard GDK
|
||||
* @leave_fn: function called to release the guard
|
||||
*
|
||||
@@ -777,7 +776,7 @@ gdk_threads_dispatch_free (gpointer data)
|
||||
/**
|
||||
* gdk_threads_add_idle_full:
|
||||
* @priority: the priority of the idle source. Typically this will be in the
|
||||
* range btweeen #G_PRIORITY_DEFAULT_IDLE and #G_PRIORITY_HIGH_IDLE
|
||||
* range between #G_PRIORITY_DEFAULT_IDLE and #G_PRIORITY_HIGH_IDLE
|
||||
* @function: function to call
|
||||
* @data: data to pass to @function
|
||||
* @notify: (allow-none): function to call when the idle is removed, or %NULL
|
||||
@@ -827,6 +826,7 @@ gdk_threads_dispatch_free (gpointer data)
|
||||
* Return value: the ID (greater than 0) of the event source.
|
||||
*
|
||||
* Since: 2.12
|
||||
* Rename to: gdk_threads_add_idle
|
||||
*/
|
||||
guint
|
||||
gdk_threads_add_idle_full (gint priority,
|
||||
@@ -850,7 +850,7 @@ gdk_threads_add_idle_full (gint priority,
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_threads_add_idle:
|
||||
* gdk_threads_add_idle: (skip)
|
||||
* @function: function to call
|
||||
* @data: data to pass to @function
|
||||
*
|
||||
@@ -929,6 +929,7 @@ gdk_threads_add_idle (GSourceFunc function,
|
||||
* Return value: the ID (greater than 0) of the event source.
|
||||
*
|
||||
* Since: 2.12
|
||||
* Rename to: gdk_threads_add_timeout
|
||||
*/
|
||||
guint
|
||||
gdk_threads_add_timeout_full (gint priority,
|
||||
@@ -954,7 +955,7 @@ gdk_threads_add_timeout_full (gint priority,
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_threads_add_timeout:
|
||||
* gdk_threads_add_timeout: (skip)
|
||||
* @interval: the time between calls to the function, in milliseconds
|
||||
* (1/1000ths of a second)
|
||||
* @function: function to call
|
||||
@@ -995,6 +996,7 @@ gdk_threads_add_timeout (guint interval,
|
||||
* Return value: the ID (greater than 0) of the event source.
|
||||
*
|
||||
* Since: 2.14
|
||||
* Rename to: gdk_threads_add_timeout_seconds
|
||||
*/
|
||||
guint
|
||||
gdk_threads_add_timeout_seconds_full (gint priority,
|
||||
@@ -1020,7 +1022,7 @@ gdk_threads_add_timeout_seconds_full (gint priority,
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_threads_add_timeout_seconds:
|
||||
* gdk_threads_add_timeout_seconds: (skip)
|
||||
* @interval: the time between calls to the function, in seconds
|
||||
* @function: function to call
|
||||
* @data: data to pass to @function
|
||||
|
||||
+2
-2
@@ -150,7 +150,7 @@ gdk_cursor_init (GdkCursor *cursor)
|
||||
*
|
||||
* Adds a reference to @cursor.
|
||||
*
|
||||
* Return value: Same @cursor that was passed in
|
||||
* Return value: (transfer full): Same @cursor that was passed in
|
||||
*
|
||||
* Deprecated: 3.0: Use g_object_ref() instead
|
||||
*/
|
||||
@@ -355,7 +355,7 @@ gdk_cursor_new_from_pixbuf (GdkDisplay *display,
|
||||
return GDK_DISPLAY_GET_CLASS (display)->get_cursor_for_pixbuf (display, pixbuf, x, y);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* gdk_cursor_get_display:
|
||||
* @cursor: a #GdkCursor.
|
||||
*
|
||||
|
||||
+40
-19
@@ -273,7 +273,9 @@ gdk_device_dispose (GObject *object)
|
||||
|
||||
if (device->associated)
|
||||
{
|
||||
_gdk_device_set_associated_device (device->associated, NULL);
|
||||
if (device->type == GDK_DEVICE_TYPE_MASTER)
|
||||
_gdk_device_set_associated_device (device->associated, NULL);
|
||||
|
||||
g_object_unref (device->associated);
|
||||
device->associated = NULL;
|
||||
}
|
||||
@@ -377,14 +379,17 @@ gdk_device_get_property (GObject *object,
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_device_get_state:
|
||||
* gdk_device_get_state: (skip)
|
||||
* @device: a #GdkDevice.
|
||||
* @window: a #GdkWindow.
|
||||
* @axes: an array of doubles to store the values of the axes of @device in,
|
||||
* or %NULL.
|
||||
* @mask: location to store the modifiers, or %NULL.
|
||||
*
|
||||
* Gets the current state of a pointer device relative to @window.
|
||||
* Gets the current state of a pointer device relative to @window. As a slave
|
||||
* device coordinates are those of its master pointer, This
|
||||
* function may not be called on devices of type %GDK_DEVICE_TYPE_SLAVE,
|
||||
* unless there is an ongoing grab on them, see gdk_device_grab().
|
||||
*/
|
||||
void
|
||||
gdk_device_get_state (GdkDevice *device,
|
||||
@@ -395,6 +400,8 @@ gdk_device_get_state (GdkDevice *device,
|
||||
g_return_if_fail (GDK_IS_DEVICE (device));
|
||||
g_return_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD);
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
g_return_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_SLAVE ||
|
||||
gdk_display_device_is_grabbed (gdk_device_get_display (device), device));
|
||||
|
||||
if (GDK_DEVICE_GET_CLASS (device)->get_state)
|
||||
GDK_DEVICE_GET_CLASS (device)->get_state (device, window, axes, mask);
|
||||
@@ -408,7 +415,10 @@ gdk_device_get_state (GdkDevice *device,
|
||||
* @x: (out) (allow-none): location to store root window X coordinate of @device, or %NULL.
|
||||
* @y: (out) (allow-none): location to store root window Y coordinate of @device, or %NULL.
|
||||
*
|
||||
* Gets the current location of @device.
|
||||
* Gets the current location of @device. As a slave device
|
||||
* coordinates are those of its master pointer, This function
|
||||
* may not be called on devices of type %GDK_DEVICE_TYPE_SLAVE,
|
||||
* unless there is an ongoing grab on them, see gdk_device_grab().
|
||||
*
|
||||
* Since: 3.0
|
||||
**/
|
||||
@@ -427,6 +437,10 @@ gdk_device_get_position (GdkDevice *device,
|
||||
g_return_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD);
|
||||
|
||||
display = gdk_device_get_display (device);
|
||||
|
||||
g_return_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_SLAVE ||
|
||||
gdk_display_device_is_grabbed (display, device));
|
||||
|
||||
default_screen = gdk_display_get_default_screen (display);
|
||||
|
||||
_gdk_device_query_state (device,
|
||||
@@ -454,6 +468,10 @@ gdk_device_get_position (GdkDevice *device,
|
||||
* Obtains the window underneath @device, returning the location of the device in @win_x and @win_y. Returns
|
||||
* %NULL if the window tree under @device is not known to GDK (for example, belongs to another application).
|
||||
*
|
||||
* As a slave device coordinates are those of its master pointer, This
|
||||
* function may not be called on devices of type %GDK_DEVICE_TYPE_SLAVE,
|
||||
* unless there is an ongoing grab on them, see gdk_device_grab().
|
||||
*
|
||||
* Returns: (transfer none): the #GdkWindow under the device position, or %NULL.
|
||||
*
|
||||
* Since: 3.0
|
||||
@@ -468,6 +486,8 @@ gdk_device_get_window_at_position (GdkDevice *device,
|
||||
|
||||
g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
|
||||
g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, NULL);
|
||||
g_return_val_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_SLAVE ||
|
||||
gdk_display_device_is_grabbed (gdk_device_get_display (device), device), NULL);
|
||||
|
||||
window = _gdk_device_window_at_position (device, &tmp_x, &tmp_y, NULL, FALSE);
|
||||
|
||||
@@ -493,12 +513,12 @@ gdk_device_get_window_at_position (GdkDevice *device,
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_device_get_history:
|
||||
* gdk_device_get_history: (skip)
|
||||
* @device: a #GdkDevice
|
||||
* @window: the window with respect to which which the event coordinates will be reported
|
||||
* @start: starting timestamp for range of events to return
|
||||
* @stop: ending timestamp for the range of events to return
|
||||
* @events: (array length=n_events) (out) (transfer none): location to store a newly-allocated array of #GdkTimeCoord, or %NULL
|
||||
* @events: (array length=n_events) (out) (transfer full): location to store a newly-allocated array of #GdkTimeCoord, or %NULL
|
||||
* @n_events: location to store the length of @events, or %NULL
|
||||
*
|
||||
* Obtains the motion history for a pointer device; given a starting and
|
||||
@@ -554,8 +574,8 @@ _gdk_device_allocate_history (GdkDevice *device,
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_device_free_history:
|
||||
* @events: (inout) (transfer none): an array of #GdkTimeCoord.
|
||||
* gdk_device_free_history: (skip)
|
||||
* @events: an array of #GdkTimeCoord.
|
||||
* @n_events: the length of the array.
|
||||
*
|
||||
* Frees an array of #GdkTimeCoord that was returned by gdk_device_get_history().
|
||||
@@ -697,8 +717,8 @@ gdk_device_get_n_keys (GdkDevice *device)
|
||||
* gdk_device_get_key:
|
||||
* @device: a #GdkDevice.
|
||||
* @index_: the index of the macro button to get.
|
||||
* @keyval: return value for the keyval.
|
||||
* @modifiers: return value for modifiers.
|
||||
* @keyval: (out): return value for the keyval.
|
||||
* @modifiers: (out): return value for modifiers.
|
||||
*
|
||||
* If @index_ has a valid keyval, this function will return %TRUE
|
||||
* and fill in @keyval and @modifiers with the keyval settings.
|
||||
@@ -912,9 +932,10 @@ _gdk_device_set_associated_device (GdkDevice *device,
|
||||
* the list of slave devices attached to it, otherwise it will return
|
||||
* %NULL
|
||||
*
|
||||
* Returns: (transfer container): the list of slave devices, or %NULL. The
|
||||
* list must be freed with g_list_free(), the contents of the list
|
||||
* are owned by GTK+ and should not be freed.
|
||||
* Returns: (transfer container) (element-type GdkDevice): the list of
|
||||
* slave devices, or %NULL. The list must be freed with
|
||||
* g_list_free(), the contents of the list are owned by GTK+
|
||||
* and should not be freed.
|
||||
**/
|
||||
GList *
|
||||
gdk_device_list_slave_devices (GdkDevice *device)
|
||||
@@ -1023,9 +1044,9 @@ gdk_device_list_axes (GdkDevice *device)
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_device_get_axis_value:
|
||||
* gdk_device_get_axis_value: (skip)
|
||||
* @device: a pointer #GdkDevice.
|
||||
* @axes: pointer to an array of axes
|
||||
* @axes: (array): pointer to an array of axes
|
||||
* @axis_label: #GdkAtom with the axis label.
|
||||
* @value: location to store the found value.
|
||||
*
|
||||
@@ -1070,11 +1091,11 @@ gdk_device_get_axis_value (GdkDevice *device,
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_device_get_axis:
|
||||
* gdk_device_get_axis: (skip)
|
||||
* @device: a #GdkDevice
|
||||
* @axes: pointer to an array of axes
|
||||
* @axes: (array): pointer to an array of axes
|
||||
* @use: the use to look for
|
||||
* @value: location to store the found value.
|
||||
* @value: (out): location to store the found value.
|
||||
*
|
||||
* Interprets an array of double as axis values for a given device,
|
||||
* and locates the value in the array for a given axis use.
|
||||
@@ -1148,7 +1169,7 @@ get_native_grab_event_mask (GdkEventMask grab_mask)
|
||||
* @event_mask. In either mode, unreported events are discarded.
|
||||
* @event_mask: specifies the event mask, which is used in accordance with
|
||||
* @owner_events.
|
||||
* @cursor: the cursor to display while the grab is active if the device is
|
||||
* @cursor: (allow-none): the cursor to display while the grab is active if the device is
|
||||
* a pointer. If this is %NULL then the normal cursors are used for
|
||||
* @window and its descendants, and the cursor for @window is used
|
||||
* elsewhere.
|
||||
|
||||
+16
-8
@@ -597,7 +597,7 @@ _gdk_display_enable_motion_hints (GdkDisplay *display,
|
||||
/**
|
||||
* gdk_display_get_pointer:
|
||||
* @display: a #GdkDisplay
|
||||
* @screen: (allow-none): location to store the screen that the
|
||||
* @screen: (out) (allow-none): location to store the screen that the
|
||||
* cursor is on, or %NULL.
|
||||
* @x: (out) (allow-none): location to store root window X coordinate of pointer, or %NULL.
|
||||
* @y: (out) (allow-none): location to store root window Y coordinate of pointer, or %NULL.
|
||||
@@ -913,7 +913,7 @@ switch_to_pointer_grab (GdkDisplay *display,
|
||||
GdkPointerWindowInfo *info;
|
||||
GList *old_grabs;
|
||||
GdkModifierType state;
|
||||
int x, y;
|
||||
int x = 0, y = 0;
|
||||
|
||||
/* Temporarily unset pointer to make sure we send the crossing events below */
|
||||
old_grabs = g_hash_table_lookup (display->device_grabs, device);
|
||||
@@ -966,7 +966,14 @@ switch_to_pointer_grab (GdkDisplay *display,
|
||||
g_object_unref (info->toplevel_under_pointer);
|
||||
info->toplevel_under_pointer = NULL;
|
||||
|
||||
new_toplevel = get_current_toplevel (display, device, &x, &y, &state);
|
||||
/* Ungrabbed slave devices don't have a position by
|
||||
* itself, rather depend on its master pointer, so
|
||||
* it doesn't make sense to track any position for
|
||||
* these after the grab
|
||||
*/
|
||||
if (grab || gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_SLAVE)
|
||||
new_toplevel = get_current_toplevel (display, device, &x, &y, &state);
|
||||
|
||||
if (new_toplevel)
|
||||
{
|
||||
/* w is now toplevel and x,y in toplevel coords */
|
||||
@@ -1571,7 +1578,8 @@ gdk_display_supports_clipboard_persistence (GdkDisplay *display)
|
||||
* @display: a #GdkDisplay
|
||||
* @clipboard_window: a #GdkWindow belonging to the clipboard owner
|
||||
* @time_: a timestamp
|
||||
* @targets: an array of targets that should be saved, or %NULL
|
||||
* @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
|
||||
*
|
||||
@@ -1694,7 +1702,7 @@ gdk_event_send_client_message_for_display (GdkDisplay *display,
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_display_add_client_message_filter:
|
||||
* gdk_display_add_client_message_filter: (skip)
|
||||
* @display: a #GdkDisplay for which this message filter applies
|
||||
* @message_type: the type of ClientMessage events to receive.
|
||||
* This will be checked against the @message_type field
|
||||
@@ -1718,7 +1726,7 @@ gdk_display_add_client_message_filter (GdkDisplay *display,
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_add_client_message_filter:
|
||||
* gdk_add_client_message_filter: (skip)
|
||||
* @message_type: the type of ClientMessage events to receive. This will be
|
||||
* checked against the <structfield>message_type</structfield> field of the
|
||||
* XClientMessage event struct.
|
||||
@@ -1756,7 +1764,7 @@ gdk_display_real_get_app_launch_context (GdkDisplay *display)
|
||||
* Returns a #GdkAppLaunchContext suitable for launching
|
||||
* applications on the given display.
|
||||
*
|
||||
* Returns: a new #GdkAppLaunchContext for @display.
|
||||
* Returns: (transfer full): a new #GdkAppLaunchContext for @display.
|
||||
* Free with g_object_unref() when done
|
||||
*
|
||||
* Since: 3.0
|
||||
@@ -1771,7 +1779,7 @@ gdk_display_get_app_launch_context (GdkDisplay *display)
|
||||
* gdk_drag_get_protocol_for_display:
|
||||
* @display: the #GdkDisplay where the destination window resides
|
||||
* @xid: the windowing system id of the destination window.
|
||||
* @protocol: location where the supported DND protocol is returned.
|
||||
* @protocol: (out): location where the supported DND protocol is returned.
|
||||
*
|
||||
* Finds out the DND protocol supported by a window.
|
||||
*
|
||||
|
||||
@@ -335,7 +335,7 @@ gdk_display_manager_open_display (GdkDisplayManager *manager,
|
||||
*
|
||||
* Finds or creates an atom corresponding to a given string.
|
||||
*
|
||||
* Returns: the atom corresponding to @atom_name.
|
||||
* Returns: (transfer none): the atom corresponding to @atom_name.
|
||||
*/
|
||||
GdkAtom
|
||||
gdk_atom_intern (const gchar *atom_name,
|
||||
@@ -361,7 +361,7 @@ gdk_atom_intern (const gchar *atom_name,
|
||||
* ever unload the module again (e.g. do not use this function in
|
||||
* GTK+ theme engines).
|
||||
*
|
||||
* Returns: the atom corresponding to @atom_name
|
||||
* Returns: (transfer none): the atom corresponding to @atom_name
|
||||
*
|
||||
* Since: 2.10
|
||||
*/
|
||||
|
||||
+1
-1
@@ -445,7 +445,7 @@ gdk_drag_drop_succeeded (GdkDragContext *context)
|
||||
*
|
||||
* Returns the selection atom for the current source window.
|
||||
*
|
||||
* Return value: the selection atom, or %GDK_NONE
|
||||
* Return value: (transfer none): the selection atom, or %GDK_NONE
|
||||
*/
|
||||
GdkAtom
|
||||
gdk_drag_get_selection (GdkDragContext *context)
|
||||
|
||||
+41
-39
@@ -503,9 +503,9 @@ gdk_event_copy (const GdkEvent *event)
|
||||
{
|
||||
GdkEventPrivate *new_private;
|
||||
GdkEvent *new_event;
|
||||
|
||||
|
||||
g_return_val_if_fail (event != NULL, NULL);
|
||||
|
||||
|
||||
new_event = gdk_event_new (GDK_NOTHING);
|
||||
new_private = (GdkEventPrivate *)new_event;
|
||||
|
||||
@@ -519,21 +519,22 @@ gdk_event_copy (const GdkEvent *event)
|
||||
|
||||
new_private->screen = private->screen;
|
||||
new_private->device = private->device;
|
||||
new_private->source_device = private->source_device;
|
||||
}
|
||||
|
||||
|
||||
switch (event->any.type)
|
||||
{
|
||||
case GDK_KEY_PRESS:
|
||||
case GDK_KEY_RELEASE:
|
||||
new_event->key.string = g_strdup (event->key.string);
|
||||
break;
|
||||
|
||||
|
||||
case GDK_ENTER_NOTIFY:
|
||||
case GDK_LEAVE_NOTIFY:
|
||||
if (event->crossing.subwindow != NULL)
|
||||
g_object_ref (event->crossing.subwindow);
|
||||
g_object_ref (event->crossing.subwindow);
|
||||
break;
|
||||
|
||||
|
||||
case GDK_DRAG_ENTER:
|
||||
case GDK_DRAG_LEAVE:
|
||||
case GDK_DRAG_MOTION:
|
||||
@@ -542,28 +543,28 @@ gdk_event_copy (const GdkEvent *event)
|
||||
case GDK_DROP_FINISHED:
|
||||
g_object_ref (event->dnd.context);
|
||||
break;
|
||||
|
||||
|
||||
case GDK_EXPOSE:
|
||||
case GDK_DAMAGE:
|
||||
if (event->expose.region)
|
||||
new_event->expose.region = cairo_region_copy (event->expose.region);
|
||||
new_event->expose.region = cairo_region_copy (event->expose.region);
|
||||
break;
|
||||
|
||||
|
||||
case GDK_SETTING:
|
||||
new_event->setting.name = g_strdup (new_event->setting.name);
|
||||
break;
|
||||
|
||||
case GDK_BUTTON_PRESS:
|
||||
case GDK_BUTTON_RELEASE:
|
||||
if (event->button.axes)
|
||||
new_event->button.axes = g_memdup (event->button.axes,
|
||||
if (event->button.axes)
|
||||
new_event->button.axes = g_memdup (event->button.axes,
|
||||
sizeof (gdouble) * gdk_device_get_n_axes (event->button.device));
|
||||
break;
|
||||
|
||||
case GDK_MOTION_NOTIFY:
|
||||
if (event->motion.axes)
|
||||
new_event->motion.axes = g_memdup (event->motion.axes,
|
||||
sizeof (gdouble) * gdk_device_get_n_axes (event->motion.device));
|
||||
if (event->motion.axes)
|
||||
new_event->motion.axes = g_memdup (event->motion.axes,
|
||||
sizeof (gdouble) * gdk_device_get_n_axes (event->motion.device));
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -917,7 +918,7 @@ gdk_event_get_root_coords (const GdkEvent *event,
|
||||
/**
|
||||
* gdk_event_get_axis:
|
||||
* @event: a #GdkEvent
|
||||
* @axis_use: (out): the axis use to look for
|
||||
* @axis_use: the axis use to look for
|
||||
* @value: (out): location to store the value found
|
||||
*
|
||||
* Extract the axis value for a particular axis use from
|
||||
@@ -1129,9 +1130,10 @@ gdk_event_get_device (const GdkEvent *event)
|
||||
* @event: a #GdkEvent
|
||||
* @device: a #GdkDevice
|
||||
*
|
||||
* Sets the slave device for @event to @device. The event
|
||||
* must have been allocated by GTK+, for instance, by
|
||||
* gdk_event_copy().
|
||||
* Sets the slave device for @event to @device.
|
||||
*
|
||||
* The event must have been allocated by GTK+,
|
||||
* for instance by gdk_event_copy().
|
||||
*
|
||||
* Since: 3.0
|
||||
**/
|
||||
@@ -1153,15 +1155,17 @@ gdk_event_set_source_device (GdkEvent *event,
|
||||
* gdk_event_get_source_device:
|
||||
* @event: a #GdkEvent
|
||||
*
|
||||
* This function returns the hardware (slave) #GdkDevice that has triggered the event,
|
||||
* falling back to the virtual (master) device (as in gdk_event_get_device()) if the
|
||||
* event wasn't caused by interaction with a hardware device. This may happen for
|
||||
* example in synthesized crossing events after a #GdkWindow updates its geometry or
|
||||
* a grab is acquired/released.
|
||||
* This function returns the hardware (slave) #GdkDevice that has
|
||||
* triggered the event, falling back to the virtual (master) device
|
||||
* (as in gdk_event_get_device()) if the event wasn't caused by
|
||||
* interaction with a hardware device. This may happen for example
|
||||
* in synthesized crossing events after a #GdkWindow updates its
|
||||
* geometry or a grab is acquired/released.
|
||||
*
|
||||
* If the event does not contain device field, this function will return %NULL.
|
||||
* If the event does not contain a device field, this function will
|
||||
* return %NULL.
|
||||
*
|
||||
* Returns: a #GdkDevice, or %NULL.
|
||||
* Returns: (transfer none): a #GdkDevice, or %NULL.
|
||||
*
|
||||
* Since: 3.0
|
||||
**/
|
||||
@@ -1189,6 +1193,7 @@ gdk_event_get_source_device (const GdkEvent *event)
|
||||
* @event: a valid #GdkEvent
|
||||
*
|
||||
* Request more motion notifies if @event is a motion notify hint event.
|
||||
*
|
||||
* This function should be used instead of gdk_window_get_pointer() to
|
||||
* request further motion notifies, because it also works for extension
|
||||
* events where motion notifies are provided for devices other than the
|
||||
@@ -1196,7 +1201,7 @@ gdk_event_get_source_device (const GdkEvent *event)
|
||||
* motion events from a %GDK_MOTION_NOTIFY event usually works like this:
|
||||
*
|
||||
* |[
|
||||
* {
|
||||
* {
|
||||
* /* motion_event handler */
|
||||
* x = motion_event->x;
|
||||
* y = motion_event->y;
|
||||
@@ -1256,7 +1261,7 @@ gdk_events_get_axis_distances (GdkEvent *event1,
|
||||
* gdk_events_get_distance:
|
||||
* @event1: first #GdkEvent
|
||||
* @event2: second #GdkEvent
|
||||
* @distance: return location for the distance
|
||||
* @distance: (out): return location for the distance
|
||||
*
|
||||
* If both events have X/Y information, the distance between both coordinates
|
||||
* (as in a straight line going from @event1 to @event2) will be returned.
|
||||
@@ -1279,7 +1284,7 @@ gdk_events_get_distance (GdkEvent *event1,
|
||||
* gdk_events_get_angle:
|
||||
* @event1: first #GdkEvent
|
||||
* @event2: second #GdkEvent
|
||||
* @angle: return location for the relative angle between both events
|
||||
* @angle: (out): return location for the relative angle between both events
|
||||
*
|
||||
* If both events contain X/Y information, this function will return %TRUE
|
||||
* and return in @angle the relative angle from @event1 to @event2. The rotation
|
||||
@@ -1450,20 +1455,15 @@ gdk_get_show_events (void)
|
||||
|
||||
static void
|
||||
gdk_synthesize_click (GdkDisplay *display,
|
||||
GdkEvent *event,
|
||||
gint nclicks)
|
||||
GdkEvent *event,
|
||||
gint nclicks)
|
||||
{
|
||||
GdkEvent temp_event;
|
||||
GdkEvent *event_copy;
|
||||
GList *link;
|
||||
|
||||
g_return_if_fail (event != NULL);
|
||||
|
||||
temp_event = *event;
|
||||
temp_event.type = (nclicks == 2) ? GDK_2BUTTON_PRESS : GDK_3BUTTON_PRESS;
|
||||
|
||||
event_copy = gdk_event_copy (&temp_event);
|
||||
link = _gdk_event_queue_append (display, event_copy);
|
||||
event_copy = gdk_event_copy (event);
|
||||
event_copy->type = (nclicks == 2) ? GDK_2BUTTON_PRESS : GDK_3BUTTON_PRESS;
|
||||
|
||||
_gdk_event_queue_append (display, event_copy);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1472,6 +1472,8 @@ _gdk_event_button_generate (GdkDisplay *display,
|
||||
{
|
||||
GdkMultipleClickInfo *info;
|
||||
|
||||
g_return_if_fail (event->type == GDK_BUTTON_PRESS);
|
||||
|
||||
info = g_hash_table_lookup (display->multiple_click_info, event->button.device);
|
||||
|
||||
if (G_UNLIKELY (!info))
|
||||
|
||||
+16
-11
@@ -100,7 +100,7 @@ typedef union _GdkEvent GdkEvent;
|
||||
/**
|
||||
* GdkEventFunc:
|
||||
* @event: the #GdkEvent to process.
|
||||
* @data: user data set when the event handler was installed with
|
||||
* @data: (closure): user data set when the event handler was installed with
|
||||
* gdk_event_handler_set().
|
||||
*
|
||||
* Specifies the type of function passed to gdk_event_handler_set() to
|
||||
@@ -491,8 +491,9 @@ struct _GdkEventVisibility
|
||||
* @y: the y coordinate of the pointer relative to the window.
|
||||
* @axes: @x, @y translated to the axes of @device, or %NULL if @device is
|
||||
* the mouse.
|
||||
* @state: a bit-mask representing the state of the modifier keys (e.g.
|
||||
* Control, Shift and Alt) and the pointer buttons. See #GdkModifierType.
|
||||
* @state: (type GdkModifierType): a bit-mask representing the state of
|
||||
* the modifier keys (e.g. Control, Shift and Alt) and the pointer
|
||||
* buttons. See #GdkModifierType.
|
||||
* @is_hint: set to 1 if this event is just a hint, see the
|
||||
* %GDK_POINTER_MOTION_HINT_MASK value of #GdkEventMask.
|
||||
* @device: the device where the event originated.
|
||||
@@ -530,8 +531,9 @@ struct _GdkEventMotion
|
||||
* @y: the y coordinate of the pointer relative to the window.
|
||||
* @axes: @x, @y translated to the axes of @device, or %NULL if @device is
|
||||
* the mouse.
|
||||
* @state: a bit-mask representing the state of the modifier keys (e.g.
|
||||
* Control, Shift and Alt) and the pointer buttons. See #GdkModifierType.
|
||||
* @state: (type GdkModifierType): a bit-mask representing the state of
|
||||
* the modifier keys (e.g. Control, Shift and Alt) and the pointer
|
||||
* buttons. See #GdkModifierType.
|
||||
* @button: the button which was pressed or released, numbered from 1 to 5.
|
||||
* Normally button 1 is the left mouse button, 2 is the middle button,
|
||||
* and 3 is the right button. On 2-button mice, the middle button can
|
||||
@@ -601,8 +603,9 @@ struct _GdkEventButton
|
||||
* @time: the time of the event in milliseconds.
|
||||
* @x: the x coordinate of the pointer relative to the window.
|
||||
* @y: the y coordinate of the pointer relative to the window.
|
||||
* @state: a bit-mask representing the state of the modifier keys (e.g.
|
||||
* Control, Shift and Alt) and the pointer buttons. See #GdkModifierType.
|
||||
* @state: (type GdkModifierType): a bit-mask representing the state of
|
||||
* the modifier keys (e.g. Control, Shift and Alt) and the pointer
|
||||
* buttons. See #GdkModifierType.
|
||||
* @direction: the direction to scroll to (one of %GDK_SCROLL_UP,
|
||||
* %GDK_SCROLL_DOWN, %GDK_SCROLL_LEFT and %GDK_SCROLL_RIGHT).
|
||||
* @device: the device where the event originated.
|
||||
@@ -636,8 +639,9 @@ struct _GdkEventScroll
|
||||
* @send_event: %TRUE if the event was sent explicitly (e.g. using
|
||||
* <function>XSendEvent</function>).
|
||||
* @time: the time of the event in milliseconds.
|
||||
* @state: a bit-mask representing the state of the modifier keys (e.g.
|
||||
* Control, Shift and Alt) and the pointer buttons. See #GdkModifierType.
|
||||
* @state: (type GdkModifierType): a bit-mask representing the state of
|
||||
* the modifier keys (e.g. Control, Shift and Alt) and the pointer
|
||||
* buttons. See #GdkModifierType.
|
||||
* @keyval: the key that was pressed or released. See the
|
||||
* <filename><gdk/gdkkeysyms.h></filename> header file for a
|
||||
* complete list of GDK key codes.
|
||||
@@ -696,8 +700,9 @@ struct _GdkEventKey
|
||||
* %GDK_NOTIFY_ANCESTOR, %GDK_NOTIFY_VIRTUAL, %GDK_NOTIFY_NONLINEAR or
|
||||
* %GDK_NOTIFY_NONLINEAR_VIRTUAL).
|
||||
* @focus: %TRUE if @window is the focus window or an inferior.
|
||||
* @state: a bit-mask representing the state of the modifier keys (e.g. Control,
|
||||
* Shift and Alt) and the pointer buttons. See #GdkModifierType.
|
||||
* @state: (type GdkModifierType): a bit-mask representing the state of
|
||||
* the modifier keys (e.g. Control, Shift and Alt) and the pointer
|
||||
* buttons. See #GdkModifierType.
|
||||
*
|
||||
* Generated when the pointer enters or leaves a window.
|
||||
*/
|
||||
|
||||
+11
-12
@@ -74,18 +74,17 @@ struct _GdkClientFilter {
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
GDK_DEBUG_MISC = 1 << 0,
|
||||
GDK_DEBUG_EVENTS = 1 << 1,
|
||||
GDK_DEBUG_DND = 1 << 2,
|
||||
GDK_DEBUG_XIM = 1 << 3,
|
||||
GDK_DEBUG_NOGRABS = 1 << 4,
|
||||
GDK_DEBUG_COLORMAP = 1 << 5,
|
||||
GDK_DEBUG_INPUT = 1 << 6,
|
||||
GDK_DEBUG_CURSOR = 1 << 7,
|
||||
GDK_DEBUG_MULTIHEAD = 1 << 8,
|
||||
GDK_DEBUG_XINERAMA = 1 << 9,
|
||||
GDK_DEBUG_DRAW = 1 <<10,
|
||||
GDK_DEBUG_EVENTLOOP = 1 <<11
|
||||
GDK_DEBUG_MISC = 1 << 0,
|
||||
GDK_DEBUG_EVENTS = 1 << 1,
|
||||
GDK_DEBUG_DND = 1 << 2,
|
||||
GDK_DEBUG_XIM = 1 << 3,
|
||||
GDK_DEBUG_NOGRABS = 1 << 4,
|
||||
GDK_DEBUG_INPUT = 1 << 5,
|
||||
GDK_DEBUG_CURSOR = 1 << 6,
|
||||
GDK_DEBUG_MULTIHEAD = 1 << 7,
|
||||
GDK_DEBUG_XINERAMA = 1 << 8,
|
||||
GDK_DEBUG_DRAW = 1 << 9,
|
||||
GDK_DEBUG_EVENTLOOP = 1 << 10
|
||||
} GdkDebugFlag;
|
||||
|
||||
extern GList *_gdk_default_filters;
|
||||
|
||||
+10
-7
@@ -284,7 +284,7 @@ gdk_keyval_is_lower (guint keyval)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* gdk_keymap_get_default:
|
||||
*
|
||||
* Returns the #GdkKeymap attached to the default display.
|
||||
@@ -366,8 +366,9 @@ gdk_keymap_get_num_lock_state (GdkKeymap *keymap)
|
||||
* gdk_keymap_get_entries_for_keyval:
|
||||
* @keymap: a #GdkKeymap
|
||||
* @keyval: a keyval, such as %GDK_a, %GDK_Up, %GDK_Return, etc.
|
||||
* @keys: (out): return location for an array of #GdkKeymapKey
|
||||
* @n_keys: (out): return location for number of elements in returned array
|
||||
* @keys: (out) (array length=n_keys) (transfer full): return location
|
||||
* for an array of #GdkKeymapKey
|
||||
* @n_keys: return location for number of elements in returned array
|
||||
*
|
||||
* Obtains a list of keycode/group/level combinations that will
|
||||
* generate @keyval. Groups and levels are two kinds of keyboard mode;
|
||||
@@ -396,8 +397,10 @@ gdk_keymap_get_entries_for_keyval (GdkKeymap *keymap,
|
||||
* gdk_keymap_get_entries_for_keycode:
|
||||
* @keymap: a #GdkKeymap
|
||||
* @hardware_keycode: a keycode
|
||||
* @keys: (out): return location for array of #GdkKeymapKey, or %NULL
|
||||
* @keyvals: (out): return location for array of keyvals, or %NULL
|
||||
* @keys: (out) (array length=n_entries) (transfer full): return
|
||||
* location for array of #GdkKeymapKey, or %NULL
|
||||
* @keyvals: (out) (array length=n_entries) (transfer full): return
|
||||
* location for array of keyvals, or %NULL
|
||||
* @n_entries: length of @keys and @keyvals
|
||||
*
|
||||
* Returns the keyvals bound to @hardware_keycode.
|
||||
@@ -531,7 +534,7 @@ gdk_keymap_translate_keyboard_state (GdkKeymap *keymap,
|
||||
/**
|
||||
* gdk_keymap_add_virtual_modifiers:
|
||||
* @keymap: a #GdkKeymap
|
||||
* @state: pointer to the modifier mask to change
|
||||
* @state: (out): pointer to the modifier mask to change
|
||||
*
|
||||
* Adds virtual modifiers (i.e. Super, Hyper and Meta) which correspond
|
||||
* to the real modifiers (i.e Mod2, Mod3, ...) in @modifiers.
|
||||
@@ -557,7 +560,7 @@ gdk_keymap_add_virtual_modifiers (GdkKeymap *keymap,
|
||||
/**
|
||||
* gdk_keymap_map_virtual_modifiers:
|
||||
* @keymap: a #GdkKeymap
|
||||
* @state: pointer to the modifier state to map
|
||||
* @state: (out): pointer to the modifier state to map
|
||||
*
|
||||
* Maps the virtual modifiers (i.e. Super, Hyper and Meta) which
|
||||
* are set in @state to their non-virtual counterparts (i.e. Mod2,
|
||||
|
||||
+22
-36
@@ -87,15 +87,11 @@ gdk_offscreen_window_init (GdkOffscreenWindow *window)
|
||||
|
||||
static void
|
||||
gdk_offscreen_window_destroy (GdkWindow *window,
|
||||
gboolean recursing,
|
||||
gboolean foreign_destroy)
|
||||
gboolean recursing,
|
||||
gboolean foreign_destroy)
|
||||
{
|
||||
GdkOffscreenWindow *offscreen;
|
||||
|
||||
offscreen = GDK_OFFSCREEN_WINDOW (window->impl);
|
||||
|
||||
gdk_offscreen_window_set_embedder (window, NULL);
|
||||
|
||||
|
||||
if (!recursing)
|
||||
gdk_offscreen_window_hide (window);
|
||||
}
|
||||
@@ -334,7 +330,7 @@ gdk_offscreen_window_get_device_state (GdkWindow *window,
|
||||
* If you need to keep this around over window resizes, you need to
|
||||
* add a reference to it.
|
||||
*
|
||||
* Returns: The offscreen surface, or %NULL if not offscreen
|
||||
* Returns: (transfer none): The offscreen surface, or %NULL if not offscreen
|
||||
*/
|
||||
cairo_surface_t *
|
||||
gdk_offscreen_window_get_surface (GdkWindow *window)
|
||||
@@ -367,14 +363,13 @@ gdk_offscreen_window_lower (GdkWindow *window)
|
||||
|
||||
static void
|
||||
gdk_offscreen_window_move_resize_internal (GdkWindow *window,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height,
|
||||
gboolean send_expose_events)
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height,
|
||||
gboolean send_expose_events)
|
||||
{
|
||||
GdkOffscreenWindow *offscreen;
|
||||
gint dx, dy, dw, dh;
|
||||
|
||||
offscreen = GDK_OFFSCREEN_WINDOW (window->impl);
|
||||
|
||||
@@ -386,11 +381,6 @@ gdk_offscreen_window_move_resize_internal (GdkWindow *window,
|
||||
if (window->destroyed)
|
||||
return;
|
||||
|
||||
dx = x - window->x;
|
||||
dy = y - window->y;
|
||||
dw = width - window->width;
|
||||
dh = height - window->height;
|
||||
|
||||
window->x = x;
|
||||
window->y = y;
|
||||
|
||||
@@ -421,7 +411,7 @@ gdk_offscreen_window_move_resize_internal (GdkWindow *window,
|
||||
|
||||
if (GDK_WINDOW_IS_MAPPED (window))
|
||||
{
|
||||
// TODO: Only invalidate new area, i.e. for larger windows
|
||||
/* TODO: Only invalidate new area, i.e. for larger windows */
|
||||
gdk_window_invalidate_rect (window, NULL, TRUE);
|
||||
_gdk_synthesize_crossing_events_for_geometry_change (window);
|
||||
}
|
||||
@@ -429,16 +419,12 @@ gdk_offscreen_window_move_resize_internal (GdkWindow *window,
|
||||
|
||||
static void
|
||||
gdk_offscreen_window_move_resize (GdkWindow *window,
|
||||
gboolean with_move,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height)
|
||||
gboolean with_move,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
GdkOffscreenWindow *offscreen;
|
||||
|
||||
offscreen = GDK_OFFSCREEN_WINDOW (window->impl);
|
||||
|
||||
if (!with_move)
|
||||
{
|
||||
x = window->x;
|
||||
@@ -451,9 +437,9 @@ gdk_offscreen_window_move_resize (GdkWindow *window,
|
||||
if (height < 0)
|
||||
height = window->height;
|
||||
|
||||
gdk_offscreen_window_move_resize_internal (window, x, y,
|
||||
width, height,
|
||||
TRUE);
|
||||
gdk_offscreen_window_move_resize_internal (window,
|
||||
x, y, width, height,
|
||||
TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -469,6 +455,8 @@ gdk_offscreen_window_show (GdkWindow *window,
|
||||
static void
|
||||
gdk_offscreen_window_hide (GdkWindow *window)
|
||||
{
|
||||
/* TODO: This needs updating to the new grab world */
|
||||
#if 0
|
||||
GdkOffscreenWindow *offscreen;
|
||||
GdkDisplay *display;
|
||||
|
||||
@@ -479,8 +467,6 @@ gdk_offscreen_window_hide (GdkWindow *window)
|
||||
/* May need to break grabs on children */
|
||||
display = gdk_window_get_display (window);
|
||||
|
||||
/* TODO: This needs updating to the new grab world */
|
||||
#if 0
|
||||
if (display->pointer_grab.window != NULL)
|
||||
{
|
||||
if (is_parent_of (window, display->pointer_grab.window))
|
||||
@@ -779,12 +765,12 @@ gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
|
||||
impl_class->set_functions = NULL;
|
||||
impl_class->begin_resize_drag = NULL;
|
||||
impl_class->begin_move_drag = NULL;
|
||||
impl_class->enable_synchronized_configure = NULL;
|
||||
impl_class->enable_synchronized_configure = gdk_offscreen_window_do_nothing;
|
||||
impl_class->configure_finished = NULL;
|
||||
impl_class->set_opacity = NULL;
|
||||
impl_class->set_composited = NULL;
|
||||
impl_class->destroy_notify = NULL;
|
||||
impl_class->register_dnd = NULL;
|
||||
impl_class->register_dnd = gdk_offscreen_window_do_nothing;
|
||||
impl_class->drag_begin = NULL;
|
||||
impl_class->process_updates_recurse = gdk_offscreen_window_process_updates_recurse;
|
||||
impl_class->sync_rendering = NULL;
|
||||
|
||||
+5
-3
@@ -190,11 +190,13 @@ layout_iter_get_line_clip_region (PangoLayoutIter *iter,
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_pango_layout_line_get_clip_region:
|
||||
* gdk_pango_layout_line_get_clip_region: (skip)
|
||||
* @line: a #PangoLayoutLine
|
||||
* @x_origin: X pixel where you intend to draw the layout line with this clip
|
||||
* @y_origin: baseline pixel where you intend to draw the layout line with this clip
|
||||
* @index_ranges: array of byte indexes into the layout, where even members of array are start indexes and odd elements are end indexes
|
||||
* @index_ranges: (array): array of byte indexes into the layout,
|
||||
* where even members of array are start indexes and odd elements
|
||||
* are end indexes
|
||||
* @n_ranges: number of ranges in @index_ranges, i.e. half the size of @index_ranges
|
||||
*
|
||||
* Obtains a clip region which contains the areas where the given
|
||||
@@ -239,7 +241,7 @@ gdk_pango_layout_line_get_clip_region (PangoLayoutLine *line,
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_pango_layout_get_clip_region:
|
||||
* gdk_pango_layout_get_clip_region: (skip)
|
||||
* @layout: a #PangoLayout
|
||||
* @x_origin: X pixel where you intend to draw the layout with this clip
|
||||
* @y_origin: Y pixel where you intend to draw the layout with this clip
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@
|
||||
* gdk_rectangle_union:
|
||||
* @src1: a #GdkRectangle
|
||||
* @src2: a #GdkRectangle
|
||||
* @dest: return location for the union of @src1 and @src2
|
||||
* @dest: (out): return location for the union of @src1 and @src2
|
||||
*
|
||||
* Calculates the union of two rectangles.
|
||||
* The union of rectangles @src1 and @src2 is the smallest rectangle which
|
||||
|
||||
+3
-3
@@ -272,7 +272,7 @@ gdk_rgba_parse (GdkRGBA *rgba,
|
||||
|
||||
/**
|
||||
* gdk_rgba_hash:
|
||||
* @p: a #GdkRGBA pointer.
|
||||
* @p: (type GdkRGBA): a #GdkRGBA pointer.
|
||||
*
|
||||
* A hash function suitable for using for a hash
|
||||
* table that stores #GdkRGBA<!-- -->s.
|
||||
@@ -294,8 +294,8 @@ gdk_rgba_hash (gconstpointer p)
|
||||
|
||||
/**
|
||||
* gdk_rgba_equal:
|
||||
* @p1: a #GdkRGBA pointer.
|
||||
* @p2: another #GdkRGBA pointer.
|
||||
* @p1: (type GdkRGBA): a #GdkRGBA pointer.
|
||||
* @p2: (type GdkRGBA): another #GdkRGBA pointer.
|
||||
*
|
||||
* Compares two RGBA colors.
|
||||
*
|
||||
|
||||
+5
-4
@@ -226,7 +226,7 @@ gdk_selection_send_notify_for_display (GdkDisplay *display,
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_selection_property_get:
|
||||
* gdk_selection_property_get: (skip)
|
||||
* @requestor: the window on which the data is stored
|
||||
* @data: location to store a pointer to the retrieved data.
|
||||
If the retrieval failed, %NULL we be stored here, otherwise, it
|
||||
@@ -282,10 +282,11 @@ gdk_selection_convert (GdkWindow *requestor,
|
||||
* @display: a #GdkDisplay
|
||||
* @encoding: an atom representing the encoding of the text
|
||||
* @format: the format of the property
|
||||
* @text: the text to convert
|
||||
* @text: (array length=length): the text to convert
|
||||
* @length: the length of @text, in bytes
|
||||
* @list: location to store the list of strings or %NULL. The
|
||||
* list should be freed with g_strfreev().
|
||||
* @list: (out) (array zero-terminated=1): location to store the list
|
||||
* of strings or %NULL. The list should be freed with
|
||||
* g_strfreev().
|
||||
*
|
||||
* Converts a text property in the given encoding to
|
||||
* a list of UTF-8 strings.
|
||||
|
||||
+5
-3
@@ -219,8 +219,9 @@ gdk_visual_get_best_with_both (gint depth,
|
||||
|
||||
/**
|
||||
* gdk_query_depths:
|
||||
* @depths: (out) (array): return location for available depths
|
||||
* @count: (out): return location for number of available depths
|
||||
* @depths: (out) (array length=count) (transfer none): return
|
||||
* location for available depths
|
||||
* @count: return location for number of available depths
|
||||
*
|
||||
* This function returns the available bit depths for the default
|
||||
* screen. It's equivalent to listing the visuals
|
||||
@@ -240,7 +241,8 @@ gdk_query_depths (gint **depths,
|
||||
|
||||
/**
|
||||
* gdk_query_visual_types:
|
||||
* @visual_types: return location for the available visual types
|
||||
* @visual_types: (out) (array length=count) (transfer none): return
|
||||
* location for the available visual types
|
||||
* @count: return location for the number of available visual types
|
||||
*
|
||||
* This function returns the available visual types for the default
|
||||
|
||||
+55
-65
@@ -384,7 +384,8 @@ gdk_window_class_init (GdkWindowClass *klass)
|
||||
* The ::pick-embedded-child signal is emitted to find an embedded
|
||||
* child at the given position.
|
||||
*
|
||||
* Returns: the #GdkWindow of the embedded child at @x, @y, or %NULL
|
||||
* Returns: (transfer none): the #GdkWindow of the embedded child at
|
||||
* @x, @y, or %NULL
|
||||
*
|
||||
* Since: 2.18
|
||||
*/
|
||||
@@ -405,8 +406,10 @@ gdk_window_class_init (GdkWindowClass *klass)
|
||||
* @window: the offscreen window on which the signal is emitted
|
||||
* @offscreen-x: x coordinate in the offscreen window
|
||||
* @offscreen-y: y coordinate in the offscreen window
|
||||
* @embedder-x: return location for the x coordinate in the embedder window
|
||||
* @embedder-y: return location for the y coordinate in the embedder window
|
||||
* @embedder-x: (out) (type double): return location for the x
|
||||
* coordinate in the embedder window
|
||||
* @embedder-y: (out) (type double): return location for the y
|
||||
* coordinate in the embedder window
|
||||
*
|
||||
* The ::to-embedder signal is emitted to translate coordinates
|
||||
* in an offscreen window to its embedder.
|
||||
@@ -434,8 +437,10 @@ gdk_window_class_init (GdkWindowClass *klass)
|
||||
* @window: the offscreen window on which the signal is emitted
|
||||
* @embedder-x: x coordinate in the embedder window
|
||||
* @embedder-y: y coordinate in the embedder window
|
||||
* @offscreen-x: return location for the x coordinate in the offscreen window
|
||||
* @offscreen-y: return location for the y coordinate in the offscreen window
|
||||
* @offscreen-x: (out) (type double): return location for the x
|
||||
* coordinate in the offscreen window
|
||||
* @offscreen-y: (out) (type double): return location for the y
|
||||
* coordinate in the offscreen window
|
||||
*
|
||||
* The ::from-embedder signal is emitted to translate coordinates
|
||||
* in the embedder of an offscreen window to the offscreen window.
|
||||
@@ -1246,7 +1251,7 @@ sync_native_window_stack_position (GdkWindow *window)
|
||||
* more details. Note: to use this on displays other than the default
|
||||
* display, @parent must be specified.
|
||||
*
|
||||
* Return value: (transfer none): the new #GdkWindow
|
||||
* Return value: (transfer full): the new #GdkWindow
|
||||
**/
|
||||
GdkWindow*
|
||||
gdk_window_new (GdkWindow *parent,
|
||||
@@ -2075,7 +2080,7 @@ gdk_window_set_user_data (GdkWindow *window,
|
||||
/**
|
||||
* gdk_window_get_user_data:
|
||||
* @window: a #GdkWindow
|
||||
* @data: return location for user data
|
||||
* @data: (out): return location for user data
|
||||
*
|
||||
* Retrieves the user data for @window, which is normally the widget
|
||||
* that @window belongs to. See gdk_window_set_user_data().
|
||||
@@ -2406,7 +2411,7 @@ gdk_window_peek_children (GdkWindow *window)
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_window_add_filter:
|
||||
* gdk_window_add_filter: (skip)
|
||||
* @window: a #GdkWindow
|
||||
* @function: filter callback
|
||||
* @data: data to pass to filter callback
|
||||
@@ -2467,20 +2472,19 @@ gdk_window_add_filter (GdkWindow *window,
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_window_remove_filter:
|
||||
* gdk_window_remove_filter: (skip)
|
||||
* @window: a #GdkWindow
|
||||
* @function: previously-added filter function
|
||||
* @data: user data for previously-added filter function
|
||||
*
|
||||
* Remove a filter previously added with gdk_window_add_filter().
|
||||
*
|
||||
**/
|
||||
*/
|
||||
void
|
||||
gdk_window_remove_filter (GdkWindow *window,
|
||||
GdkFilterFunc function,
|
||||
gpointer data)
|
||||
GdkFilterFunc function,
|
||||
gpointer data)
|
||||
{
|
||||
GList *tmp_list, *node;
|
||||
GList *tmp_list;
|
||||
GdkEventFilter *filter;
|
||||
|
||||
g_return_if_fail (window == NULL || GDK_IS_WINDOW (window));
|
||||
@@ -2493,17 +2497,16 @@ gdk_window_remove_filter (GdkWindow *window,
|
||||
while (tmp_list)
|
||||
{
|
||||
filter = (GdkEventFilter *)tmp_list->data;
|
||||
node = tmp_list;
|
||||
tmp_list = tmp_list->next;
|
||||
|
||||
if ((filter->function == function) && (filter->data == data))
|
||||
{
|
||||
{
|
||||
filter->flags |= GDK_EVENT_FILTER_REMOVED;
|
||||
|
||||
_gdk_event_filter_unref (window, filter);
|
||||
_gdk_event_filter_unref (window, filter);
|
||||
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2672,7 +2675,7 @@ gdk_window_begin_implicit_paint (GdkWindow *window, GdkRectangle *rect)
|
||||
static cairo_surface_t *
|
||||
gdk_window_ref_impl_surface (GdkWindow *window)
|
||||
{
|
||||
return GDK_WINDOW_IMPL_GET_CLASS (window->impl)->ref_cairo_surface (window);
|
||||
return GDK_WINDOW_IMPL_GET_CLASS (window->impl)->ref_cairo_surface (gdk_window_get_impl_window (window));
|
||||
}
|
||||
|
||||
static cairo_t *
|
||||
@@ -4431,8 +4434,8 @@ gdk_window_invalidate_maybe_recurse_full (GdkWindow *window,
|
||||
* gdk_window_invalidate_maybe_recurse:
|
||||
* @window: a #GdkWindow
|
||||
* @region: a #cairo_region_t
|
||||
* @child_func: function to use to decide if to recurse to a child,
|
||||
* %NULL means never recurse.
|
||||
* @child_func: (scope call): function to use to decide if to recurse
|
||||
* to a child, %NULL means never recurse.
|
||||
* @user_data: data passed to @child_func
|
||||
*
|
||||
* Adds @region to the update area for @window. The update area is the
|
||||
@@ -4780,8 +4783,8 @@ gdk_window_set_debug_updates (gboolean setting)
|
||||
* @flags: a mask indicating what portions of @geometry are set
|
||||
* @width: desired width of window
|
||||
* @height: desired height of the window
|
||||
* @new_width: location to store resulting width
|
||||
* @new_height: location to store resulting height
|
||||
* @new_width: (out): location to store resulting width
|
||||
* @new_height: (out): location to store resulting height
|
||||
*
|
||||
* Constrains a desired width and height according to a
|
||||
* set of geometry hints (such as minimum and maximum size).
|
||||
@@ -5896,25 +5899,20 @@ gdk_window_get_device_events (GdkWindow *window,
|
||||
|
||||
static void
|
||||
gdk_window_move_resize_toplevel (GdkWindow *window,
|
||||
gboolean with_move,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height)
|
||||
gboolean with_move,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
cairo_region_t *old_region, *new_region;
|
||||
GdkWindowImplClass *impl_class;
|
||||
gboolean expose;
|
||||
int old_x, old_y, old_abs_x, old_abs_y;
|
||||
int dx, dy;
|
||||
gboolean is_resize;
|
||||
|
||||
expose = FALSE;
|
||||
old_region = NULL;
|
||||
|
||||
old_x = window->x;
|
||||
old_y = window->y;
|
||||
|
||||
is_resize = (width != -1) || (height != -1);
|
||||
|
||||
if (gdk_window_is_viewable (window) &&
|
||||
@@ -5927,12 +5925,6 @@ gdk_window_move_resize_toplevel (GdkWindow *window,
|
||||
impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
|
||||
impl_class->move_resize (window, with_move, x, y, width, height);
|
||||
|
||||
dx = window->x - old_x;
|
||||
dy = window->y - old_y;
|
||||
|
||||
old_abs_x = window->abs_x;
|
||||
old_abs_y = window->abs_y;
|
||||
|
||||
/* Avoid recomputing for pure toplevel moves, for performance reasons */
|
||||
if (is_resize)
|
||||
recompute_visible_regions (window, TRUE, FALSE);
|
||||
@@ -5942,8 +5934,7 @@ gdk_window_move_resize_toplevel (GdkWindow *window,
|
||||
new_region = cairo_region_copy (window->clip_region);
|
||||
|
||||
/* This is the newly exposed area (due to any resize),
|
||||
* X will expose it, but lets do that without the
|
||||
* roundtrip
|
||||
* X will expose it, but lets do that without the roundtrip
|
||||
*/
|
||||
cairo_region_subtract (new_region, old_region);
|
||||
gdk_window_invalidate_region_full (window, new_region, TRUE, CLEAR_BG_WINCLEARED);
|
||||
@@ -6584,8 +6575,8 @@ gdk_window_set_background_pattern (GdkWindow *window,
|
||||
* does not have its own background and reuses the parent's, %NULL is
|
||||
* returned and you'll have to query it yourself.
|
||||
*
|
||||
* Returns: The pattern to use for the background or %NULL to use the
|
||||
* parent's background.
|
||||
* Returns: (transfer none): The pattern to use for the background or
|
||||
* %NULL to use the parent's background.
|
||||
*
|
||||
* Since: 2.22
|
||||
**/
|
||||
@@ -6622,9 +6613,10 @@ update_cursor_foreach (GdkDisplay *display,
|
||||
* there is no custom cursor set on the specified window, and it is
|
||||
* using the cursor for its parent window.
|
||||
*
|
||||
* Return value: a #GdkCursor, or %NULL. The returned object is owned
|
||||
* by the #GdkWindow and should not be unreferenced directly. Use
|
||||
* gdk_window_set_cursor() to unset the cursor of the window
|
||||
* Return value: (transfer none): a #GdkCursor, or %NULL. The returned
|
||||
* object is owned by the #GdkWindow and should not be unreferenced
|
||||
* directly. Use gdk_window_set_cursor() to unset the cursor of the
|
||||
* window
|
||||
*
|
||||
* Since: 2.18
|
||||
*/
|
||||
@@ -6686,9 +6678,10 @@ gdk_window_set_cursor (GdkWindow *window,
|
||||
* there is no custom cursor set on the specified window, and it is
|
||||
* using the cursor for its parent window.
|
||||
*
|
||||
* Returns: a #GdkCursor, or %NULL. The returned object is owned
|
||||
* by the #GdkWindow and should not be unreferenced directly. Use
|
||||
* gdk_window_set_cursor() to unset the cursor of the window
|
||||
* Returns: (transfer none): a #GdkCursor, or %NULL. The returned
|
||||
* object is owned by the #GdkWindow and should not be unreferenced
|
||||
* directly. Use gdk_window_set_cursor() to unset the cursor of the
|
||||
* window
|
||||
*
|
||||
* Since: 3.0
|
||||
**/
|
||||
@@ -6921,8 +6914,8 @@ gdk_window_get_origin (GdkWindow *window,
|
||||
* @window: a #GdkWindow
|
||||
* @x: X coordinate in window
|
||||
* @y: Y coordinate in window
|
||||
* @root_x: return location for X coordinate
|
||||
* @root_y: return location for Y coordinate
|
||||
* @root_x: (out): return location for X coordinate
|
||||
* @root_y: (out): return location for Y coordinate
|
||||
*
|
||||
* Obtains the position of a window position in root
|
||||
* window coordinates. This is similar to
|
||||
@@ -9052,14 +9045,11 @@ do_synthesize_crossing_event (gpointer data)
|
||||
void
|
||||
_gdk_synthesize_crossing_events_for_geometry_change (GdkWindow *changed_window)
|
||||
{
|
||||
GdkDisplay *display;
|
||||
GdkWindow *toplevel;
|
||||
|
||||
if (_gdk_native_windows)
|
||||
return; /* We use the native crossing events if all native */
|
||||
|
||||
display = gdk_window_get_display (changed_window);
|
||||
|
||||
toplevel = get_event_toplevel (changed_window);
|
||||
|
||||
if (!toplevel->synthesize_crossing_event_queued)
|
||||
@@ -10060,8 +10050,8 @@ gdk_window_set_transient_for (GdkWindow *window,
|
||||
/**
|
||||
* gdk_window_get_root_origin:
|
||||
* @window: a toplevel #GdkWindow
|
||||
* @x: return location for X position of window frame
|
||||
* @y: return location for Y position of window frame
|
||||
* @x: (out): return location for X position of window frame
|
||||
* @y: (out): return location for Y position of window frame
|
||||
*
|
||||
* Obtains the top-left corner of the window manager frame in root
|
||||
* window coordinates.
|
||||
@@ -10484,7 +10474,7 @@ gdk_window_set_decorations (GdkWindow *window,
|
||||
/**
|
||||
* gdk_window_get_decorations:
|
||||
* @window: The toplevel #GdkWindow to get the decorations from
|
||||
* @decorations: The window decorations will be written here
|
||||
* @decorations: (out): The window decorations will be written here
|
||||
*
|
||||
* Returns the decorations set on the GdkWindow with
|
||||
* gdk_window_set_decorations().
|
||||
@@ -10834,9 +10824,9 @@ gdk_test_simulate_button (GdkWindow *window,
|
||||
* when rounded up).
|
||||
* @pdelete: if %TRUE, delete the property after retrieving the
|
||||
* data.
|
||||
* @actual_property_type: location to store the actual type of
|
||||
* the property.
|
||||
* @actual_format: location to store the actual return format of the
|
||||
* @actual_property_type: (out) (transfer none): location to store the
|
||||
* actual type of the property.
|
||||
* @actual_format: (out): location to store the actual return format of the
|
||||
* data; either 8, 16 or 32 bits.
|
||||
* @actual_length: location to store the length of the retrieved data, in
|
||||
* bytes. Data returned in the 32 bit format is stored
|
||||
@@ -10844,9 +10834,9 @@ gdk_test_simulate_button (GdkWindow *window,
|
||||
* elements should be be calculated via
|
||||
* @actual_length / sizeof(glong) to ensure portability to
|
||||
* 64 bit systems.
|
||||
* @data: location to store a pointer to the data. The retrieved
|
||||
* data should be freed with g_free() when you are finished
|
||||
* using it.
|
||||
* @data: (out) (array length=actual_length) (transfer full): location
|
||||
* to store a pointer to the data. The retrieved data should be
|
||||
* freed with g_free() when you are finished using it.
|
||||
*
|
||||
* Retrieves a portion of the contents of a property. If the
|
||||
* property does not exist, then the function returns %FALSE,
|
||||
@@ -10889,7 +10879,7 @@ gdk_property_get (GdkWindow *window,
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_property_change:
|
||||
* gdk_property_change: (skip)
|
||||
* @window: a #GdkWindow
|
||||
* @property: the property to change
|
||||
* @type: the new type for the property. If @mode is
|
||||
|
||||
@@ -24,8 +24,12 @@ gdk_color_SOURCES = gdk-color.c
|
||||
gdk_color_LDADD = $(progs_ldadd)
|
||||
|
||||
TEST_PROGS += encoding
|
||||
encoding_SOURCES = encoding.c
|
||||
encoding_LDADD = $(progs_ldadd)
|
||||
encoding_SOURCES = encoding.c
|
||||
encoding_LDADD = $(progs_ldadd)
|
||||
|
||||
TEST_PROGS += display
|
||||
display_SOURCES = display.c
|
||||
display_LDADD = $(progs_ldadd)
|
||||
|
||||
CLEANFILES = \
|
||||
cairosurface.png \
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
|
||||
static void
|
||||
test_unset_display (void)
|
||||
{
|
||||
if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR))
|
||||
{
|
||||
GdkDisplayManager *manager;
|
||||
|
||||
g_unsetenv ("DISPLAY");
|
||||
|
||||
g_assert (!gdk_init_check (NULL, NULL));
|
||||
manager = gdk_display_manager_get ();
|
||||
g_assert (manager != NULL);
|
||||
g_assert (gdk_display_manager_get_default_display (manager) == NULL);
|
||||
|
||||
exit (0);
|
||||
}
|
||||
g_test_trap_assert_passed ();
|
||||
|
||||
if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR))
|
||||
{
|
||||
g_unsetenv ("DISPLAY");
|
||||
|
||||
gdk_init (NULL, NULL);
|
||||
|
||||
exit (0);
|
||||
}
|
||||
g_test_trap_assert_failed ();
|
||||
g_test_trap_assert_stderr ("*cannot open display*");
|
||||
}
|
||||
|
||||
static void
|
||||
test_bad_display (void)
|
||||
{
|
||||
if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR))
|
||||
{
|
||||
GdkDisplayManager *manager;
|
||||
|
||||
g_setenv ("DISPLAY", "poo", TRUE);
|
||||
|
||||
g_assert (!gdk_init_check (NULL, NULL));
|
||||
manager = gdk_display_manager_get ();
|
||||
g_assert (manager != NULL);
|
||||
g_assert (gdk_display_manager_get_default_display (manager) == NULL);
|
||||
|
||||
exit (0);
|
||||
}
|
||||
g_test_trap_assert_passed ();
|
||||
|
||||
if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDOUT | G_TEST_TRAP_SILENCE_STDERR))
|
||||
{
|
||||
g_setenv ("DISPLAY", "poo", TRUE);
|
||||
|
||||
gdk_init (NULL, NULL);
|
||||
|
||||
exit (0);
|
||||
}
|
||||
g_test_trap_assert_failed ();
|
||||
g_test_trap_assert_stderr ("*cannot open display*");
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
g_test_init (&argc, &argv, NULL);
|
||||
|
||||
g_test_add_func ("/display/unset-display", test_unset_display);
|
||||
g_test_add_func ("/display/bad-display", test_bad_display);
|
||||
|
||||
return g_test_run ();
|
||||
}
|
||||
@@ -99,9 +99,7 @@
|
||||
|
||||
|
||||
/* Define some combinations of GdkDebugFlags */
|
||||
#define GDK_DEBUG_EVENTS_OR_COLORMAP (GDK_DEBUG_EVENTS|GDK_DEBUG_COLORMAP)
|
||||
#define GDK_DEBUG_EVENTS_OR_INPUT (GDK_DEBUG_EVENTS|GDK_DEBUG_INPUT)
|
||||
#define GDK_DEBUG_MISC_OR_COLORMAP (GDK_DEBUG_MISC|GDK_DEBUG_COLORMAP)
|
||||
#define GDK_DEBUG_MISC_OR_EVENTS (GDK_DEBUG_MISC|GDK_DEBUG_EVENTS)
|
||||
|
||||
GdkScreen *GDK_WINDOW_SCREEN(GObject *win);
|
||||
|
||||
@@ -65,16 +65,12 @@ _gdk_visual_init (void)
|
||||
system_visual = g_object_new (GDK_TYPE_VISUAL, NULL);
|
||||
system_visual->screen = gdk_screen_get_default();
|
||||
|
||||
GDK_NOTE (COLORMAP, g_print ("BITSPIXEL=%d NUMCOLORS=%d\n",
|
||||
bitspixel, numcolors));
|
||||
|
||||
if (rastercaps & RC_PALETTE)
|
||||
{
|
||||
const int sizepalette = GetDeviceCaps (_gdk_display_hdc, SIZEPALETTE);
|
||||
gchar *max_colors = getenv ("GDK_WIN32_MAX_COLORS");
|
||||
system_visual->type = GDK_VISUAL_PSEUDO_COLOR;
|
||||
|
||||
GDK_NOTE (COLORMAP, g_print ("SIZEPALETTE=%d\n", sizepalette));
|
||||
g_assert (sizepalette == 256);
|
||||
|
||||
if (max_colors != NULL)
|
||||
|
||||
@@ -40,10 +40,7 @@ main (int argc,
|
||||
if (gdk_settings_map[i].gdk_offset != accu)
|
||||
g_error ("settings_map[%u].gdk_offset != %u\n", i, accu);
|
||||
accu += strlen (gdk_settings_names + accu) + 1;
|
||||
// g_print ("%u) ok.\n", i);
|
||||
}
|
||||
|
||||
g_print ("checksettings: all ok.\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
+12
-14
@@ -285,7 +285,7 @@ _gdk_x11_display_get_cursor_for_type (GdkDisplay *display,
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_x11_cursor_get_xdisplay:
|
||||
* gdk_x11_cursor_get_xdisplay: (skip)
|
||||
* @cursor: a #GdkCursor.
|
||||
*
|
||||
* Returns the display of a #GdkCursor.
|
||||
@@ -301,7 +301,7 @@ gdk_x11_cursor_get_xdisplay (GdkCursor *cursor)
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_x11_cursor_get_xcursor:
|
||||
* gdk_x11_cursor_get_xcursor: (skip)
|
||||
* @cursor: a #GdkCursor.
|
||||
*
|
||||
* Returns the X cursor belonging to a #GdkCursor.
|
||||
@@ -429,7 +429,7 @@ update_cursor (gpointer data,
|
||||
|
||||
if (!cursor)
|
||||
return;
|
||||
|
||||
|
||||
_gdk_x11_cursor_update_theme (cursor);
|
||||
}
|
||||
|
||||
@@ -437,18 +437,18 @@ update_cursor (gpointer data,
|
||||
* gdk_x11_display_set_cursor_theme:
|
||||
* @display: a #GdkDisplay
|
||||
* @theme: the name of the cursor theme to use, or %NULL to unset
|
||||
* a previously set value
|
||||
* a previously set value
|
||||
* @size: the cursor size to use, or 0 to keep the previous size
|
||||
*
|
||||
* Sets the cursor theme from which the images for cursor
|
||||
* should be taken.
|
||||
*
|
||||
* If the windowing system supports it, existing cursors created
|
||||
* with gdk_cursor_new(), gdk_cursor_new_for_display() and
|
||||
* gdk_cursor_new_for_name() are updated to reflect the theme
|
||||
* should be taken.
|
||||
*
|
||||
* If the windowing system supports it, existing cursors created
|
||||
* with gdk_cursor_new(), gdk_cursor_new_for_display() and
|
||||
* gdk_cursor_new_for_name() are updated to reflect the theme
|
||||
* change. Custom cursors constructed with
|
||||
* gdk_cursor_new_from_pixbuf() will have to be handled
|
||||
* by the application (GTK+ applications can learn about
|
||||
* by the application (GTK+ applications can learn about
|
||||
* cursor theme changes by listening for change notification
|
||||
* for the corresponding #GtkSetting).
|
||||
*
|
||||
@@ -459,14 +459,12 @@ gdk_x11_display_set_cursor_theme (GdkDisplay *display,
|
||||
const gchar *theme,
|
||||
const gint size)
|
||||
{
|
||||
GdkX11Display *display_x11;
|
||||
Display *xdisplay;
|
||||
gchar *old_theme;
|
||||
gint old_size;
|
||||
|
||||
g_return_if_fail (GDK_IS_DISPLAY (display));
|
||||
|
||||
display_x11 = GDK_X11_DISPLAY (display);
|
||||
xdisplay = GDK_DISPLAY_XDISPLAY (display);
|
||||
|
||||
old_theme = XcursorGetTheme (xdisplay);
|
||||
@@ -482,13 +480,13 @@ gdk_x11_display_set_cursor_theme (GdkDisplay *display,
|
||||
XcursorSetTheme (xdisplay, theme);
|
||||
if (size > 0)
|
||||
XcursorSetDefaultSize (xdisplay, size);
|
||||
|
||||
|
||||
g_slist_foreach (cursor_cache, update_cursor, NULL);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static GdkPixbuf*
|
||||
static GdkPixbuf*
|
||||
gdk_x11_cursor_get_image (GdkCursor *cursor)
|
||||
{
|
||||
return NULL;
|
||||
|
||||
@@ -497,13 +497,11 @@ gdk_x11_device_xi_select_window_events (GdkDevice *device,
|
||||
GdkEventMask event_mask)
|
||||
{
|
||||
XEventClass event_classes[MAX_DEVICE_CLASSES];
|
||||
GdkX11DeviceXI *device_xi;
|
||||
gint num_classes;
|
||||
|
||||
event_mask |= (GDK_PROXIMITY_IN_MASK |
|
||||
GDK_PROXIMITY_OUT_MASK);
|
||||
|
||||
device_xi = GDK_X11_DEVICE_XI (device);
|
||||
find_events (device, event_mask, event_classes, &num_classes);
|
||||
|
||||
XSelectExtensionEvent (GDK_WINDOW_XDISPLAY (window),
|
||||
@@ -590,14 +588,12 @@ _gdk_x11_device_xi_translate_axes (GdkDevice *device,
|
||||
gdouble *x,
|
||||
gdouble *y)
|
||||
{
|
||||
GdkX11DeviceXI *device_xi;
|
||||
GdkWindow *impl_window;
|
||||
gdouble root_x, root_y;
|
||||
gdouble temp_x, temp_y;
|
||||
gint n_axes;
|
||||
gint i;
|
||||
|
||||
device_xi = GDK_X11_DEVICE_XI (device);
|
||||
impl_window = _gdk_window_get_impl_window (window);
|
||||
temp_x = temp_y = 0;
|
||||
|
||||
|
||||
+14
-2
@@ -362,6 +362,8 @@ gdk_x11_device_xi2_query_state (GdkDevice *device,
|
||||
if (mask)
|
||||
*mask = _gdk_x11_device_xi2_translate_state (&mod_state, &button_state);
|
||||
|
||||
g_free (button_state.mask);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -449,7 +451,7 @@ gdk_x11_device_xi2_window_at_position (GdkDevice *device,
|
||||
GdkWindow *window;
|
||||
Window xwindow, root, child, last = None;
|
||||
gdouble xroot_x, xroot_y, xwin_x, xwin_y;
|
||||
XIButtonState button_state;
|
||||
XIButtonState button_state = { 0 };
|
||||
XIModifierState mod_state;
|
||||
XIGroupState group_state;
|
||||
|
||||
@@ -501,6 +503,10 @@ gdk_x11_device_xi2_window_at_position (GdkDevice *device,
|
||||
{
|
||||
window = GDK_WINDOW (list->data);
|
||||
xwindow = GDK_WINDOW_XID (window);
|
||||
|
||||
/* Free previous button mask, if any */
|
||||
g_free (button_state.mask);
|
||||
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
XIQueryPointer (xdisplay,
|
||||
device_xi2->device_id,
|
||||
@@ -525,6 +531,8 @@ gdk_x11_device_xi2_window_at_position (GdkDevice *device,
|
||||
XSetWindowAttributes attributes;
|
||||
Window w;
|
||||
|
||||
g_free (button_state.mask);
|
||||
|
||||
w = XCreateWindow (xdisplay, xwindow, (int)xwin_x, (int)xwin_y, 1, 1, 0,
|
||||
CopyFromParent, InputOnly, CopyFromParent,
|
||||
0, &attributes);
|
||||
@@ -558,6 +566,8 @@ gdk_x11_device_xi2_window_at_position (GdkDevice *device,
|
||||
while (xwindow)
|
||||
{
|
||||
last = xwindow;
|
||||
g_free (button_state.mask);
|
||||
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
XIQueryPointer (xdisplay,
|
||||
device_xi2->device_id,
|
||||
@@ -593,6 +603,8 @@ gdk_x11_device_xi2_window_at_position (GdkDevice *device,
|
||||
if (mask)
|
||||
*mask = _gdk_x11_device_xi2_translate_state (&mod_state, &button_state);
|
||||
|
||||
g_free (button_state.mask);
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
@@ -677,7 +689,7 @@ _gdk_x11_device_xi2_translate_state (XIModifierState *mods_state,
|
||||
guint state = 0;
|
||||
|
||||
if (mods_state)
|
||||
state = (guint) mods_state->effective;
|
||||
state = (guint) mods_state->base | mods_state->latched | mods_state->locked;
|
||||
|
||||
if (buttons_state)
|
||||
{
|
||||
|
||||
@@ -415,7 +415,6 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator,
|
||||
{
|
||||
GdkX11DeviceManagerCore *device_manager;
|
||||
GdkWindow *window;
|
||||
GdkWindowImplX11 *window_impl = NULL;
|
||||
gboolean return_val;
|
||||
GdkToplevelX11 *toplevel = NULL;
|
||||
GdkX11Display *display_x11 = GDK_X11_DISPLAY (display);
|
||||
@@ -431,7 +430,6 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator,
|
||||
return FALSE;
|
||||
|
||||
toplevel = _gdk_x11_window_get_toplevel (window);
|
||||
window_impl = GDK_WINDOW_IMPL_X11 (window->impl);
|
||||
g_object_ref (window);
|
||||
}
|
||||
|
||||
|
||||
@@ -42,8 +42,7 @@ struct _GdkX11DeviceManagerXI2
|
||||
|
||||
GHashTable *id_table;
|
||||
|
||||
GList *master_devices;
|
||||
GList *slave_devices;
|
||||
GList *devices;
|
||||
|
||||
GdkDevice *client_pointer;
|
||||
|
||||
@@ -309,12 +308,7 @@ add_device (GdkX11DeviceManagerXI2 *device_manager,
|
||||
GINT_TO_POINTER (dev->deviceid),
|
||||
g_object_ref (device));
|
||||
|
||||
if (dev->use == XIMasterPointer || dev->use == XIMasterKeyboard)
|
||||
device_manager->master_devices = g_list_append (device_manager->master_devices, device);
|
||||
else if (dev->use == XISlavePointer || dev->use == XISlaveKeyboard || dev->use == XIFloatingSlave)
|
||||
device_manager->slave_devices = g_list_append (device_manager->slave_devices, device);
|
||||
else
|
||||
g_warning ("Unhandled device: %s\n", gdk_device_get_name (device));
|
||||
device_manager->devices = g_list_append (device_manager->devices, device);
|
||||
|
||||
if (emit_signal)
|
||||
{
|
||||
@@ -349,8 +343,7 @@ remove_device (GdkX11DeviceManagerXI2 *device_manager,
|
||||
|
||||
if (device)
|
||||
{
|
||||
device_manager->master_devices = g_list_remove (device_manager->master_devices, device);
|
||||
device_manager->slave_devices = g_list_remove (device_manager->slave_devices, device);
|
||||
device_manager->devices = g_list_remove (device_manager->devices, device);
|
||||
|
||||
g_signal_emit_by_name (device_manager, "device-removed", device);
|
||||
|
||||
@@ -418,10 +411,8 @@ gdk_x11_device_manager_xi2_constructed (GObject *object)
|
||||
/* Initialize devices list */
|
||||
for (i = 0; i < ndevices; i++)
|
||||
{
|
||||
GdkDevice *device;
|
||||
|
||||
dev = &info[i];
|
||||
device = add_device (device_manager, dev, FALSE);
|
||||
add_device (device_manager, dev, FALSE);
|
||||
|
||||
if (dev->use == XIMasterPointer ||
|
||||
dev->use == XIMasterKeyboard)
|
||||
@@ -469,11 +460,8 @@ gdk_x11_device_manager_xi2_dispose (GObject *object)
|
||||
|
||||
device_manager = GDK_X11_DEVICE_MANAGER_XI2 (object);
|
||||
|
||||
g_list_free_full (device_manager->master_devices, g_object_unref);
|
||||
device_manager->master_devices = NULL;
|
||||
|
||||
g_list_free_full (device_manager->slave_devices, g_object_unref);
|
||||
device_manager->slave_devices = NULL;
|
||||
g_list_free_full (device_manager->devices, g_object_unref);
|
||||
device_manager->devices = NULL;
|
||||
|
||||
if (device_manager->id_table)
|
||||
{
|
||||
@@ -489,37 +477,19 @@ gdk_x11_device_manager_xi2_list_devices (GdkDeviceManager *device_manager,
|
||||
GdkDeviceType type)
|
||||
{
|
||||
GdkX11DeviceManagerXI2 *device_manager_xi2;
|
||||
GList *list = NULL;
|
||||
GList *cur, *list = NULL;
|
||||
|
||||
device_manager_xi2 = GDK_X11_DEVICE_MANAGER_XI2 (device_manager);
|
||||
|
||||
switch (type)
|
||||
for (cur = device_manager_xi2->devices; cur; cur = cur->next)
|
||||
{
|
||||
case GDK_DEVICE_TYPE_MASTER:
|
||||
list = device_manager_xi2->master_devices;
|
||||
break;
|
||||
case GDK_DEVICE_TYPE_SLAVE:
|
||||
case GDK_DEVICE_TYPE_FLOATING:
|
||||
{
|
||||
GList *devs = device_manager_xi2->slave_devices;
|
||||
GdkDevice *dev = cur->data;
|
||||
|
||||
while (devs)
|
||||
{
|
||||
GdkDevice *dev;
|
||||
|
||||
dev = devs->data;
|
||||
devs = devs->next;
|
||||
|
||||
if (type == gdk_device_get_device_type (dev))
|
||||
list = g_list_prepend (list, dev);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
if (type == gdk_device_get_device_type (dev))
|
||||
list = g_list_prepend (list, dev);
|
||||
}
|
||||
|
||||
return g_list_copy (list);
|
||||
return list;
|
||||
}
|
||||
|
||||
static GdkDevice *
|
||||
@@ -595,7 +565,6 @@ handle_hierarchy_changed (GdkX11DeviceManagerXI2 *device_manager,
|
||||
{
|
||||
GdkDisplay *display;
|
||||
Display *xdisplay;
|
||||
GdkDevice *device;
|
||||
XIDeviceInfo *info;
|
||||
int ndevices;
|
||||
gint i;
|
||||
@@ -608,7 +577,7 @@ handle_hierarchy_changed (GdkX11DeviceManagerXI2 *device_manager,
|
||||
if (ev->info[i].flags & XIDeviceEnabled)
|
||||
{
|
||||
info = XIQueryDevice (xdisplay, ev->info[i].deviceid, &ndevices);
|
||||
device = add_device (device_manager, &info[0], TRUE);
|
||||
add_device (device_manager, &info[0], TRUE);
|
||||
XIFreeDeviceInfo (info);
|
||||
}
|
||||
else if (ev->info[i].flags & XIDeviceDisabled)
|
||||
@@ -898,18 +867,14 @@ translate_axes (GdkDevice *device,
|
||||
XIValuatorState *valuators)
|
||||
{
|
||||
guint n_axes, i;
|
||||
gint width, height;
|
||||
gdouble *axes;
|
||||
double *vals;
|
||||
gdouble *vals;
|
||||
|
||||
g_object_get (device, "n-axes", &n_axes, NULL);
|
||||
|
||||
axes = g_new0 (gdouble, n_axes);
|
||||
vals = valuators->values;
|
||||
|
||||
width = gdk_window_get_width (window);
|
||||
height = gdk_window_get_height (window);
|
||||
|
||||
for (i = 0; i < valuators->mask_len * 8; i++)
|
||||
{
|
||||
GdkAxisUse use;
|
||||
|
||||
@@ -1854,7 +1854,8 @@ gdk_x11_lookup_xdisplay (Display *xdisplay)
|
||||
* Given the root window ID of one of the screen's of a #GdkDisplay,
|
||||
* finds the screen.
|
||||
*
|
||||
* Return value: the #GdkScreen corresponding to @xrootwin, or %NULL.
|
||||
* Return value: (transfer none): the #GdkScreen corresponding to
|
||||
* @xrootwin, or %NULL.
|
||||
**/
|
||||
GdkScreen *
|
||||
_gdk_x11_display_screen_for_xrootwin (GdkDisplay *display,
|
||||
@@ -1873,7 +1874,7 @@ _gdk_x11_display_screen_for_xrootwin (GdkDisplay *display,
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_x11_display_get_xdisplay:
|
||||
* gdk_x11_display_get_xdisplay: (skip)
|
||||
* @display: a #GdkDisplay
|
||||
* @returns: an X display.
|
||||
*
|
||||
|
||||
@@ -53,7 +53,7 @@ gdk_x11_display_manager_open_display (GdkDisplayManager *manager,
|
||||
GdkDisplay *display;
|
||||
|
||||
display = _gdk_x11_display_open (name);
|
||||
if (manager_x11->default_display == NULL)
|
||||
if (manager_x11->default_display == NULL && display != NULL)
|
||||
gdk_display_manager_set_default_display (manager, display);
|
||||
|
||||
return display;
|
||||
|
||||
@@ -272,7 +272,6 @@ _gdk_x11_window_translate (GdkWindow *window,
|
||||
GC xgc;
|
||||
GdkRectangle extents;
|
||||
GdkWindow *parent;
|
||||
int px, py;
|
||||
|
||||
/* We need to get data from subwindows here, because we might have
|
||||
* shaped a native window over the moving region (with bg none,
|
||||
@@ -281,7 +280,6 @@ _gdk_x11_window_translate (GdkWindow *window,
|
||||
* so we copy from the toplevel with INCLUDE_INFERIORS.
|
||||
*/
|
||||
parent = window;
|
||||
px = py = 0;
|
||||
while (parent->parent != NULL &&
|
||||
parent->parent->window_type != GDK_WINDOW_ROOT)
|
||||
{
|
||||
|
||||
@@ -435,7 +435,7 @@ gdk_x11_get_default_screen (void)
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_x11_get_default_root_xwindow:
|
||||
* gdk_x11_get_default_root_xwindow: (skip)
|
||||
*
|
||||
* Gets the root window of the default screen
|
||||
* (see gdk_x11_get_default_screen()).
|
||||
@@ -449,7 +449,7 @@ gdk_x11_get_default_root_xwindow (void)
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_x11_get_default_xdisplay:
|
||||
* gdk_x11_get_default_xdisplay: (skip)
|
||||
*
|
||||
* Gets the default GTK+ display.
|
||||
*
|
||||
|
||||
@@ -207,7 +207,7 @@ lookup_cached_xatom (GdkDisplay *display,
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_x11_atom_to_xatom_for_display:
|
||||
* gdk_x11_atom_to_xatom_for_display: (skip)
|
||||
* @display: A #GdkDisplay
|
||||
* @atom: A #GdkAtom, or %GDK_NONE
|
||||
*
|
||||
@@ -298,7 +298,7 @@ _gdk_x11_precache_atoms (GdkDisplay *display,
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_x11_atom_to_xatom:
|
||||
* gdk_x11_atom_to_xatom: (skip)
|
||||
* @atom: A #GdkAtom
|
||||
*
|
||||
* Converts from a #GdkAtom to the X atom for the default GDK display
|
||||
@@ -313,7 +313,7 @@ gdk_x11_atom_to_xatom (GdkAtom atom)
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_x11_xatom_to_atom_for_display:
|
||||
* gdk_x11_xatom_to_atom_for_display: (skip)
|
||||
* @display: A #GdkDisplay
|
||||
* @xatom: an X atom
|
||||
*
|
||||
@@ -373,7 +373,7 @@ gdk_x11_xatom_to_atom_for_display (GdkDisplay *display,
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_x11_xatom_to_atom:
|
||||
* gdk_x11_xatom_to_atom: (skip)
|
||||
* @xatom: an X atom for the default GDK display
|
||||
*
|
||||
* Convert from an X atom for the default display to the corresponding
|
||||
@@ -450,7 +450,7 @@ _gdk_x11_display_manager_get_atom_name (GdkDisplayManager *manager,
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_x11_get_xatom_by_name_for_display:
|
||||
* gdk_x11_get_xatom_by_name_for_display: (skip)
|
||||
* @display: a #GdkDisplay
|
||||
* @atom_name: a string
|
||||
*
|
||||
@@ -472,7 +472,7 @@ gdk_x11_get_xatom_by_name_for_display (GdkDisplay *display,
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_x11_get_xatom_by_name:
|
||||
* gdk_x11_get_xatom_by_name: (skip)
|
||||
* @atom_name: a string
|
||||
*
|
||||
* Returns the X atom for GDK's default display corresponding to @atom_name.
|
||||
|
||||
@@ -265,7 +265,7 @@ gdk_x11_screen_get_monitor_plug_name (GdkScreen *screen,
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_x11_screen_get_monitor_output:
|
||||
* gdk_x11_screen_get_monitor_output: (skip)
|
||||
* @screen: a #GdkScreen
|
||||
* @monitor_num: number of the monitor, between 0 and gdk_screen_get_n_monitors (screen)
|
||||
*
|
||||
|
||||
@@ -576,11 +576,12 @@ _gdk_x11_display_text_property_to_utf8_list (GdkDisplay *display,
|
||||
* gdk_x11_display_string_to_compound_text:
|
||||
* @display: the #GdkDisplay where the encoding is defined
|
||||
* @str: a nul-terminated string
|
||||
* @encoding: location to store the encoding atom
|
||||
* @encoding: (out) (transfer none): location to store the encoding atom
|
||||
* (to be used as the type for the property)
|
||||
* @format: location to store the format of the property
|
||||
* @ctext: location to store newly allocated data for the property
|
||||
* @length: the length of @text, in bytes
|
||||
* @format: (out): location to store the format of the property
|
||||
* @ctext: (out) (array length=length): location to store newly
|
||||
* allocated data for the property
|
||||
* @length: the length of @ctext, in bytes
|
||||
*
|
||||
* Convert a string from the encoding of the current
|
||||
* locale into a form suitable for storing in a window property.
|
||||
@@ -696,9 +697,9 @@ _gdk_x11_display_utf8_to_string_target (GdkDisplay *display,
|
||||
* gdk_x11_display_utf8_to_compound_text:
|
||||
* @display: a #GdkDisplay
|
||||
* @str: a UTF-8 string
|
||||
* @encoding: location to store resulting encoding
|
||||
* @format: location to store format of the result
|
||||
* @ctext: location to store the data of the result
|
||||
* @encoding: (out): location to store resulting encoding
|
||||
* @format: (out): location to store format of the result
|
||||
* @ctext: (out) (array length=length): location to store the data of the result
|
||||
* @length: location to store the length of the data
|
||||
* stored in @ctext
|
||||
*
|
||||
|
||||
@@ -32,7 +32,8 @@
|
||||
/* WARNING:
|
||||
* You will need to update gdk_settings_map when adding a
|
||||
* new setting, and make sure that checksettings does not
|
||||
* fail before committing */
|
||||
* fail before committing
|
||||
*/
|
||||
static const char gdk_settings_names[] =
|
||||
"Net/DoubleClickTime\0" "gtk-double-click-time\0"
|
||||
"Net/DoubleClickDistance\0" "gtk-double-click-distance\0"
|
||||
@@ -77,8 +78,9 @@ static const char gdk_settings_names[] =
|
||||
"Fontconfig/Timestamp\0" "gtk-fontconfig-timestamp\0"
|
||||
"Net/SoundThemeName\0" "gtk-sound-theme-name\0"
|
||||
"Net/EnableInputFeedbackSounds\0" "gtk-enable-input-feedback-sounds\0"
|
||||
"Net/EnableEventSounds\0" "gtk-enable-event-sounds\0"
|
||||
"Gtk/CursorBlinkTimeout\0" "gtk-cursor-blink-timeout\0";
|
||||
"Net/EnableEventSounds\0" "gtk-enable-event-sounds\0"
|
||||
"Gtk/CursorBlinkTimeout\0" "gtk-cursor-blink-timeout\0"
|
||||
"Gtk/AutoMnemonics\0" "gtk-auto-mnemonics\0";
|
||||
|
||||
|
||||
static const struct
|
||||
@@ -131,4 +133,5 @@ static const struct
|
||||
{ 1573, 1603 },
|
||||
{ 1636, 1658 },
|
||||
{ 1682, 1705 },
|
||||
{ 1730, 1748 }
|
||||
};
|
||||
|
||||
@@ -462,8 +462,8 @@ _gdk_x11_screen_list_visuals (GdkScreen *screen)
|
||||
*
|
||||
* Looks up the #GdkVisual for a particular screen and X Visual ID.
|
||||
*
|
||||
* Returns: the #GdkVisual (owned by the screen object), or %NULL
|
||||
* if the visual ID wasn't found.
|
||||
* Returns: (transfer none): the #GdkVisual (owned by the screen
|
||||
* object), or %NULL if the visual ID wasn't found.
|
||||
*
|
||||
* Since: 2.2
|
||||
*/
|
||||
@@ -564,7 +564,7 @@ _gdk_visual_get_x11_colormap (GdkVisual *visual)
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_x11_visual_get_xvisual:
|
||||
* gdk_x11_visual_get_xvisual: (skip)
|
||||
* @visual: a #GdkVisual.
|
||||
*
|
||||
* Returns the X visual belonging to a #GdkVisual.
|
||||
|
||||
@@ -4663,7 +4663,7 @@ gdk_x11_get_server_time (GdkWindow *window)
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_x11_window_get_xid:
|
||||
* gdk_x11_window_get_xid: (skip)
|
||||
* @window: a native #GdkWindow.
|
||||
*
|
||||
* Returns the X resource (window) belonging to a #GdkWindow.
|
||||
|
||||
+20
-14
@@ -3,7 +3,8 @@ include $(top_srcdir)/Makefile.decl
|
||||
-include $(INTROSPECTION_MAKEFILE)
|
||||
INTROSPECTION_GIRS =
|
||||
INTROSPECTION_SCANNER_ARGS = \
|
||||
--add-include-path=../gdk
|
||||
--add-include-path=../gdk \
|
||||
--warn-all
|
||||
INTROSPECTION_COMPILER_ARGS = \
|
||||
--includedir=$(srcdir) \
|
||||
--includedir=. \
|
||||
@@ -173,7 +174,6 @@ gtk_public_h_sources = \
|
||||
gtkcellarea.h \
|
||||
gtkcellareacontext.h \
|
||||
gtkcellareabox.h \
|
||||
gtkcellareaboxcontextprivate.h \
|
||||
gtkcelleditable.h \
|
||||
gtkcelllayout.h \
|
||||
gtkcellrenderer.h \
|
||||
@@ -382,6 +382,7 @@ gtk_private_h_sources = \
|
||||
gtkappchooseronline.h \
|
||||
gtkbuilderprivate.h \
|
||||
gtkbuttonprivate.h \
|
||||
gtkcellareaboxcontextprivate.h \
|
||||
gtkcustompaperunixdialog.h \
|
||||
gtkdndcursors.h \
|
||||
gtkentryprivate.h \
|
||||
@@ -421,6 +422,7 @@ gtk_private_h_sources = \
|
||||
gtksettingsprivate.h \
|
||||
gtksizegroup-private.h \
|
||||
gtksocketprivate.h \
|
||||
gtkstylecontextprivate.h \
|
||||
gtktextbtree.h \
|
||||
gtktextbufferserialize.h \
|
||||
gtktextchildprivate.h \
|
||||
@@ -962,13 +964,16 @@ LDADDS = \
|
||||
|
||||
if HAVE_INTROSPECTION
|
||||
introspection_files = \
|
||||
$(filter-out %private.h gtktextlayout.h, $(gtkinclude_HEADERS)) \
|
||||
$(filter-out %private.h gtktextdisplay.h gtktextlayout.h, $(gtkinclude_HEADERS)) \
|
||||
$(gtk_base_c_sources) \
|
||||
gtkprintoperation-unix.c \
|
||||
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_SCANNERFLAGS = --warn-all --add-include-path=$(top_builddir)/gdk
|
||||
Gtk_3_0_gir_SCANNERFLAGS = \
|
||||
--add-include-path=$(top_builddir)/gdk \
|
||||
--include-uninstalled=$(top_builddir)/gdk/Gdk-3.0.gir
|
||||
if USE_X11
|
||||
Gtk_3_0_gir_SCANNERFLAGS += --add-include-path=$(top_builddir)/gdk/x11
|
||||
endif
|
||||
@@ -981,6 +986,7 @@ Gtk_3_0_gir_CFLAGS = \
|
||||
-DGTK_TEXT_USE_INTERNAL_UNSUPPORTED_API
|
||||
Gtk_3_0_gir_LIBS = libgtk-3.0.la
|
||||
Gtk_3_0_gir_FILES = $(introspection_files)
|
||||
Gtk_3_0_gir_EXPORT_PACKAGES = gtk+-3.0
|
||||
INTROSPECTION_GIRS += Gtk-3.0.gir
|
||||
|
||||
girdir = $(datadir)/gir-1.0
|
||||
@@ -996,10 +1002,11 @@ endif
|
||||
# Installed tools
|
||||
#
|
||||
bin_PROGRAMS = \
|
||||
gtk-query-immodules-3.0 \
|
||||
gtk-update-icon-cache
|
||||
gtk-query-immodules-3.0
|
||||
|
||||
bin_SCRIPTS = gtk-builder-convert
|
||||
if BUILD_ICON_CACHE
|
||||
bin_PROGRAMS += gtk-update-icon-cache
|
||||
endif
|
||||
|
||||
if OS_WIN32
|
||||
|
||||
@@ -1010,8 +1017,7 @@ if OS_WIN32
|
||||
|
||||
GTK_UPDATE_ICON_CACHE_MANIFEST = gtk-update-icon-cache.exe.manifest
|
||||
|
||||
bin_SCRIPTS += \
|
||||
$(GTK_UPDATE_ICON_CACHE_MANIFEST)
|
||||
bin_SCRIPTS = $(GTK_UPDATE_ICON_CACHE_MANIFEST)
|
||||
|
||||
$(GTK_UPDATE_ICON_CACHE_MANIFEST):
|
||||
(echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' ; \
|
||||
@@ -1038,8 +1044,10 @@ gtk_query_immodules_3_0_DEPENDENCIES = $(DEPS)
|
||||
gtk_query_immodules_3_0_LDADD = $(LDADDS)
|
||||
gtk_query_immodules_3_0_SOURCES = queryimmodules.c
|
||||
|
||||
if BUILD_ICON_CACHE
|
||||
gtk_update_icon_cache_LDADD = $(GDK_PIXBUF_LIBS)
|
||||
gtk_update_icon_cache_SOURCES = updateiconcache.c
|
||||
endif
|
||||
|
||||
.PHONY: files test test-debug
|
||||
|
||||
@@ -1332,11 +1340,10 @@ stamp-icons: $(STOCK_ICONS)
|
||||
) done \
|
||||
&& touch stamp-icons
|
||||
|
||||
if CROSS_COMPILING
|
||||
if USE_EXTERNAL_ICON_CACHE
|
||||
gtk_update_icon_cache_program = $(GTK_UPDATE_ICON_CACHE)
|
||||
else
|
||||
gtk_update_icon_cache_program = \
|
||||
./gtk-update-icon-cache
|
||||
gtk_update_icon_cache_program = ./gtk-update-icon-cache
|
||||
endif
|
||||
|
||||
gtkbuiltincache.h: @REBUILD@ stamp-icons
|
||||
@@ -1351,11 +1358,10 @@ EXTRA_DIST += \
|
||||
line-arrow.xbm \
|
||||
line-wrap.xbm \
|
||||
tree_plus.xbm \
|
||||
tree_minus.xbm \
|
||||
tree_minus.xbm \
|
||||
tree_minus.xpm \
|
||||
tree_plus.xpm \
|
||||
gtk.def \
|
||||
gtk-builder-convert \
|
||||
gtk-win32.rc \
|
||||
gtk-win32.rc.in \
|
||||
gtkwin32embed.h \
|
||||
|
||||
@@ -1,799 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
#
|
||||
# Copyright (C) 2006-2008 Async Open Source
|
||||
# Henrique Romano <henrique@async.com.br>
|
||||
# Johan Dahlin <jdahlin@async.com.br>
|
||||
#
|
||||
# This program 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 program 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# TODO:
|
||||
# Toolbars
|
||||
|
||||
"""Usage: gtk-builder-convert-3.0 [OPTION] [INPUT] [OUTPUT]
|
||||
Converts Glade files into XML files which can be loaded with GtkBuilder.
|
||||
The [INPUT] file is
|
||||
|
||||
-w, --skip-windows Convert everything but GtkWindow subclasses.
|
||||
-r, --root Convert only widget named root and its children
|
||||
-h, --help display this help and exit
|
||||
|
||||
When OUTPUT is -, write to standard output.
|
||||
|
||||
Examples:
|
||||
gtk-builder-convert-3.0 preference.glade preferences.ui
|
||||
|
||||
Report bugs to http://bugzilla.gnome.org/."""
|
||||
|
||||
import getopt
|
||||
import os
|
||||
import sys
|
||||
|
||||
from xml.dom import minidom, Node
|
||||
|
||||
DIALOGS = ['GtkDialog',
|
||||
'GtkFileChooserDialog',
|
||||
'GtkMessageDialog']
|
||||
WINDOWS = ['GtkWindow'] + DIALOGS
|
||||
|
||||
# The subprocess is only available in Python 2.4+
|
||||
try:
|
||||
import subprocess
|
||||
subprocess # pyflakes
|
||||
except ImportError:
|
||||
subprocess = None
|
||||
|
||||
def get_child_nodes(node):
|
||||
assert node.tagName == 'object'
|
||||
nodes = []
|
||||
for child in node.childNodes:
|
||||
if child.nodeType != Node.ELEMENT_NODE:
|
||||
continue
|
||||
if child.tagName != 'child':
|
||||
continue
|
||||
nodes.append(child)
|
||||
return nodes
|
||||
|
||||
def get_properties(node):
|
||||
assert node.tagName == 'object'
|
||||
properties = {}
|
||||
for child in node.childNodes:
|
||||
if child.nodeType != Node.ELEMENT_NODE:
|
||||
continue
|
||||
if child.tagName != 'property':
|
||||
continue
|
||||
value = child.childNodes[0].data
|
||||
properties[child.getAttribute('name')] = value
|
||||
return properties
|
||||
|
||||
def get_property(node, property_name):
|
||||
assert node.tagName == 'object'
|
||||
properties = get_properties(node)
|
||||
return properties.get(property_name)
|
||||
|
||||
def get_property_node(node, property_name):
|
||||
assert node.tagName == 'object'
|
||||
properties = {}
|
||||
for child in node.childNodes:
|
||||
if child.nodeType != Node.ELEMENT_NODE:
|
||||
continue
|
||||
if child.tagName != 'property':
|
||||
continue
|
||||
if child.getAttribute('name') == property_name:
|
||||
return child
|
||||
|
||||
def get_signal_nodes(node):
|
||||
assert node.tagName == 'object'
|
||||
signals = []
|
||||
for child in node.childNodes:
|
||||
if child.nodeType != Node.ELEMENT_NODE:
|
||||
continue
|
||||
if child.tagName == 'signal':
|
||||
signals.append(child)
|
||||
return signals
|
||||
|
||||
def get_property_nodes(node):
|
||||
assert node.tagName == 'object'
|
||||
properties = []
|
||||
for child in node.childNodes:
|
||||
if child.nodeType != Node.ELEMENT_NODE:
|
||||
continue
|
||||
# FIXME: handle comments
|
||||
if child.tagName == 'property':
|
||||
properties.append(child)
|
||||
return properties
|
||||
|
||||
def get_accelerator_nodes(node):
|
||||
assert node.tagName == 'object'
|
||||
accelerators = []
|
||||
for child in node.childNodes:
|
||||
if child.nodeType != Node.ELEMENT_NODE:
|
||||
continue
|
||||
if child.tagName == 'accelerator':
|
||||
accelerators.append(child)
|
||||
return accelerators
|
||||
|
||||
def get_object_node(child_node):
|
||||
assert child_node.tagName == 'child', child_node
|
||||
nodes = []
|
||||
for node in child_node.childNodes:
|
||||
if node.nodeType != Node.ELEMENT_NODE:
|
||||
continue
|
||||
if node.tagName == 'object':
|
||||
nodes.append(node)
|
||||
assert len(nodes) == 1, nodes
|
||||
return nodes[0]
|
||||
|
||||
def copy_properties(node, props, prop_dict):
|
||||
assert node.tagName == 'object'
|
||||
for prop_name in props:
|
||||
child = get_property_node(node, prop_name)
|
||||
if child is not None:
|
||||
prop_dict[prop_name] = child
|
||||
|
||||
return node
|
||||
|
||||
class GtkBuilderConverter(object):
|
||||
|
||||
def __init__(self, skip_windows, target_version, root):
|
||||
self.skip_windows = skip_windows
|
||||
self.target_version = target_version
|
||||
self.root = root
|
||||
self.root_objects = []
|
||||
self.objects = {}
|
||||
|
||||
#
|
||||
# Public API
|
||||
#
|
||||
|
||||
def parse_file(self, file):
|
||||
self._dom = minidom.parse(file)
|
||||
self._parse()
|
||||
|
||||
def parse_buffer(self, buffer):
|
||||
self._dom = minidom.parseString(buffer)
|
||||
self._parse()
|
||||
|
||||
def to_xml(self):
|
||||
xml = self._dom.toprettyxml("", "")
|
||||
return xml.encode('utf-8')
|
||||
|
||||
#
|
||||
# Private
|
||||
#
|
||||
|
||||
def _get_object(self, name):
|
||||
return self.objects.get(name)
|
||||
|
||||
def _get_objects_by_attr(self, attribute, value):
|
||||
return [w for w in self._dom.getElementsByTagName("object")
|
||||
if w.getAttribute(attribute) == value]
|
||||
|
||||
def _create_object(self, obj_class, obj_id, template=None, properties=None):
|
||||
"""
|
||||
Creates a new <object> tag.
|
||||
Optionally a name template can be provided which will be used
|
||||
to avoid naming collisions.
|
||||
The properties dictionary can either contain string values or Node
|
||||
values. If a node is provided the name of the node will be overridden
|
||||
by the dictionary key.
|
||||
|
||||
@param obj_class: class of the object (class tag)
|
||||
@param obj_id: identifier of the object (id tag)
|
||||
@param template: name template to use, for example 'button'
|
||||
@param properties: dictionary of properties
|
||||
@type properties: string or Node.
|
||||
@returns: Newly created node of the object
|
||||
"""
|
||||
if template is not None:
|
||||
count = 1
|
||||
while True:
|
||||
obj_id = template + str(count)
|
||||
widget = self._get_object(obj_id)
|
||||
if widget is None:
|
||||
break
|
||||
|
||||
count += 1
|
||||
|
||||
obj = self._dom.createElement('object')
|
||||
obj.setAttribute('class', obj_class)
|
||||
obj.setAttribute('id', obj_id)
|
||||
if properties:
|
||||
for name, value in properties.items():
|
||||
if isinstance(value, Node):
|
||||
# Reuse the node, so translatable and context still will be
|
||||
# set when converting nodes. See also #509153
|
||||
prop = value
|
||||
else:
|
||||
prop = self._dom.createElement('property')
|
||||
prop.appendChild(self._dom.createTextNode(value))
|
||||
|
||||
prop.setAttribute('name', str(name))
|
||||
obj.appendChild(prop)
|
||||
self.objects[obj_id] = obj
|
||||
return obj
|
||||
|
||||
def _create_root_object(self, obj_class, template, properties=None):
|
||||
obj = self._create_object(obj_class, None, template, properties)
|
||||
self.root_objects.append(obj)
|
||||
return obj
|
||||
|
||||
def _parse(self):
|
||||
glade_iface = self._dom.getElementsByTagName("glade-interface")
|
||||
assert glade_iface, ("Badly formed XML, there is "
|
||||
"no <glade-interface> tag.")
|
||||
# Rename glade-interface to interface
|
||||
glade_iface[0].tagName = 'interface'
|
||||
self._interface = glade_iface[0]
|
||||
|
||||
# Remove glade-interface doc type
|
||||
for node in self._dom.childNodes:
|
||||
if node.nodeType == Node.DOCUMENT_TYPE_NODE:
|
||||
if node.name == 'glade-interface':
|
||||
self._dom.removeChild(node)
|
||||
|
||||
# Strip unsupported tags
|
||||
for tag in ['requires', 'requires-version']:
|
||||
for child in self._dom.getElementsByTagName(tag):
|
||||
child.parentNode.removeChild(child)
|
||||
|
||||
if self.root:
|
||||
self._strip_root(self.root)
|
||||
|
||||
# Rename widget to object
|
||||
objects = self._dom.getElementsByTagName("widget")
|
||||
for node in objects:
|
||||
node.tagName = "object"
|
||||
|
||||
for node in objects:
|
||||
self._convert(node.getAttribute("class"), node)
|
||||
if self._get_object(node.getAttribute('id')) is not None:
|
||||
print "WARNING: duplicate id \"" + node.getAttribute('id') + "\""
|
||||
self.objects[node.getAttribute('id')] = node
|
||||
|
||||
# Convert Gazpachos UI tag
|
||||
for node in self._dom.getElementsByTagName("ui"):
|
||||
self._convert_ui(node)
|
||||
|
||||
# Convert accessibility tag
|
||||
for node in self._dom.getElementsByTagName("accessibility"):
|
||||
self._convert_accessibility(node)
|
||||
|
||||
# Output the newly created root objects and sort them
|
||||
# by attribute id
|
||||
# FIXME: Use sorted(self.root_objects,
|
||||
# key=lambda n: n.getAttribute('id'),
|
||||
# reverse=True):
|
||||
# when we can depend on python 2.4 or higher
|
||||
root_objects = self.root_objects[:]
|
||||
root_objects.sort(lambda a, b: cmp(b.getAttribute('id'),
|
||||
a.getAttribute('id')))
|
||||
for obj in root_objects:
|
||||
self._interface.childNodes.insert(0, obj)
|
||||
|
||||
def _convert(self, klass, node):
|
||||
if klass == 'GtkNotebook':
|
||||
self._packing_prop_to_child_attr(node, "type", "tab")
|
||||
elif klass in ['GtkExpander', 'GtkFrame']:
|
||||
self._packing_prop_to_child_attr(
|
||||
node, "type", "label_item", "label")
|
||||
elif klass == "GtkMenuBar":
|
||||
self._convert_menu(node)
|
||||
elif klass == "GtkMenu":
|
||||
# Only convert toplevel popups
|
||||
if node.parentNode == self._interface:
|
||||
self._convert_menu(node, popup=True)
|
||||
elif klass in WINDOWS and self.skip_windows:
|
||||
self._remove_window(node)
|
||||
|
||||
if self.target_version == "3.0":
|
||||
if klass == "GtkComboBoxEntry":
|
||||
node.setAttribute("class","GtkComboBox")
|
||||
prop = self._dom.createElement("property")
|
||||
prop.setAttribute("name", "has-entry")
|
||||
prop.appendChild(self._dom.createTextNode("True"))
|
||||
node.appendChild(prop)
|
||||
elif klass == "GtkDialog":
|
||||
for child in node.childNodes:
|
||||
if child.nodeType != Node.ELEMENT_NODE:
|
||||
continue
|
||||
if child.tagName != 'property':
|
||||
continue
|
||||
if (child.getAttribute("name") not in ("has-separator", "has_separator")):
|
||||
continue;
|
||||
node.removeChild(child)
|
||||
break
|
||||
|
||||
self._default_widget_converter(node)
|
||||
|
||||
def _default_widget_converter(self, node):
|
||||
klass = node.getAttribute("class")
|
||||
for prop in get_property_nodes(node):
|
||||
prop_name = prop.getAttribute("name")
|
||||
if prop_name == "sizegroup":
|
||||
self._convert_sizegroup(node, prop)
|
||||
elif prop_name == "tooltip" and klass != "GtkAction":
|
||||
prop.setAttribute("name", "tooltip-text")
|
||||
elif prop_name in ["response_id", 'response-id']:
|
||||
# It does not make sense to convert responses when
|
||||
# we're not going to output dialogs
|
||||
if self.skip_windows:
|
||||
continue
|
||||
object_id = node.getAttribute('id')
|
||||
response = prop.childNodes[0].data
|
||||
self._convert_dialog_response(node, object_id, response)
|
||||
prop.parentNode.removeChild(prop)
|
||||
elif prop_name == "adjustment":
|
||||
self._convert_adjustment(prop)
|
||||
elif prop_name == "items" and klass in ['GtkComboBox',
|
||||
'GtkComboBoxEntry']:
|
||||
self._convert_combobox_items(node, prop)
|
||||
elif prop_name == "text" and klass == 'GtkTextView':
|
||||
self._convert_textview_text(prop)
|
||||
|
||||
def _remove_window(self, node):
|
||||
object_node = get_object_node(get_child_nodes(node)[0])
|
||||
parent = node.parentNode
|
||||
parent.removeChild(node)
|
||||
parent.appendChild(object_node)
|
||||
|
||||
def _convert_menu(self, node, popup=False):
|
||||
if node.hasAttribute('constructor'):
|
||||
return
|
||||
|
||||
uimgr = self._create_root_object('GtkUIManager',
|
||||
template='uimanager')
|
||||
|
||||
if popup:
|
||||
name = 'popup'
|
||||
else:
|
||||
name = 'menubar'
|
||||
|
||||
menu = self._dom.createElement(name)
|
||||
menu.setAttribute('name', node.getAttribute('id'))
|
||||
node.setAttribute('constructor', uimgr.getAttribute('id'))
|
||||
|
||||
for child in get_child_nodes(node):
|
||||
obj_node = get_object_node(child)
|
||||
item = self._convert_menuitem(uimgr, obj_node)
|
||||
menu.appendChild(item)
|
||||
child.removeChild(obj_node)
|
||||
child.parentNode.removeChild(child)
|
||||
|
||||
ui = self._dom.createElement('ui')
|
||||
uimgr.appendChild(ui)
|
||||
|
||||
ui.appendChild(menu)
|
||||
|
||||
def _convert_menuitem(self, uimgr, obj_node):
|
||||
children = get_child_nodes(obj_node)
|
||||
name = 'menuitem'
|
||||
if children:
|
||||
child_node = children[0]
|
||||
menu_node = get_object_node(child_node)
|
||||
# Can be GtkImage, which will take care of later.
|
||||
if menu_node.getAttribute('class') == 'GtkMenu':
|
||||
name = 'menu'
|
||||
|
||||
object_class = obj_node.getAttribute('class')
|
||||
if object_class in ['GtkMenuItem',
|
||||
'GtkImageMenuItem',
|
||||
'GtkCheckMenuItem',
|
||||
'GtkRadioMenuItem']:
|
||||
menu = self._dom.createElement(name)
|
||||
elif object_class == 'GtkSeparatorMenuItem':
|
||||
return self._dom.createElement('separator')
|
||||
else:
|
||||
raise NotImplementedError(object_class)
|
||||
|
||||
menu.setAttribute('action', obj_node.getAttribute('id'))
|
||||
self._add_action_from_menuitem(uimgr, obj_node)
|
||||
if children:
|
||||
for child in get_child_nodes(menu_node):
|
||||
obj_node = get_object_node(child)
|
||||
item = self._convert_menuitem(uimgr, obj_node)
|
||||
menu.appendChild(item)
|
||||
child.removeChild(obj_node)
|
||||
child.parentNode.removeChild(child)
|
||||
return menu
|
||||
|
||||
def _menuitem_to_action(self, node, properties):
|
||||
copy_properties(node, ['label', 'tooltip'], properties)
|
||||
|
||||
def _togglemenuitem_to_action(self, node, properties):
|
||||
self._menuitem_to_action(node, properties)
|
||||
copy_properties(node, ['active'], properties)
|
||||
|
||||
def _radiomenuitem_to_action(self, node, properties):
|
||||
self._togglemenuitem_to_action(node, properties)
|
||||
copy_properties(node, ['group'], properties)
|
||||
|
||||
def _add_action_from_menuitem(self, uimgr, node):
|
||||
properties = {}
|
||||
object_class = node.getAttribute('class')
|
||||
object_id = node.getAttribute('id')
|
||||
if object_class == 'GtkMenuItem':
|
||||
name = 'GtkAction'
|
||||
self._menuitem_to_action(node, properties)
|
||||
elif object_class == 'GtkCheckMenuItem':
|
||||
name = 'GtkToggleAction'
|
||||
self._togglemenuitem_to_action(node, properties)
|
||||
elif object_class == 'GtkRadioMenuItem':
|
||||
name = 'GtkRadioAction'
|
||||
self._radiomenuitem_to_action(node, properties)
|
||||
elif object_class == 'GtkImageMenuItem':
|
||||
name = 'GtkAction'
|
||||
children = get_child_nodes(node)
|
||||
if (children and
|
||||
children[0].getAttribute('internal-child') == 'image'):
|
||||
image = get_object_node(children[0])
|
||||
child = get_property_node(image, 'stock')
|
||||
if child is not None:
|
||||
properties['stock_id'] = child
|
||||
self._menuitem_to_action(node, properties)
|
||||
elif object_class == 'GtkSeparatorMenuItem':
|
||||
return
|
||||
else:
|
||||
raise NotImplementedError(object_class)
|
||||
|
||||
if get_property(node, 'use_stock') == 'True':
|
||||
if 'label' in properties:
|
||||
properties['stock_id'] = properties['label']
|
||||
del properties['label']
|
||||
|
||||
properties['name'] = object_id
|
||||
action = self._create_object(name,
|
||||
object_id,
|
||||
properties=properties)
|
||||
for signal in get_signal_nodes(node):
|
||||
signal_name = signal.getAttribute('name')
|
||||
if signal_name in ['activate', 'toggled']:
|
||||
action.appendChild(signal)
|
||||
else:
|
||||
print 'Unhandled signal %s::%s' % (node.getAttribute('class'),
|
||||
signal_name)
|
||||
|
||||
if not uimgr.childNodes:
|
||||
child = self._dom.createElement('child')
|
||||
uimgr.appendChild(child)
|
||||
|
||||
group = self._create_object('GtkActionGroup', None,
|
||||
template='actiongroup')
|
||||
child.appendChild(group)
|
||||
else:
|
||||
group = uimgr.childNodes[0].childNodes[0]
|
||||
|
||||
child = self._dom.createElement('child')
|
||||
group.appendChild(child)
|
||||
child.appendChild(action)
|
||||
|
||||
for accelerator in get_accelerator_nodes(node):
|
||||
signal_name = accelerator.getAttribute('signal')
|
||||
if signal_name != 'activate':
|
||||
print 'Unhandled accelerator signal for %s::%s' % (
|
||||
node.getAttribute('class'), signal_name)
|
||||
continue
|
||||
accelerator.removeAttribute('signal')
|
||||
child.appendChild(accelerator)
|
||||
|
||||
def _convert_sizegroup(self, node, prop):
|
||||
# This is Gazpacho only
|
||||
node.removeChild(prop)
|
||||
obj = self._get_object(prop.childNodes[0].data)
|
||||
if obj is None:
|
||||
widgets = self._get_objects_by_attr("class", "GtkSizeGroup")
|
||||
if widgets:
|
||||
obj = widgets[-1]
|
||||
else:
|
||||
obj = self._create_root_object('GtkSizeGroup',
|
||||
template='sizegroup')
|
||||
|
||||
widgets = obj.getElementsByTagName("widgets")
|
||||
if widgets:
|
||||
assert len(widgets) == 1
|
||||
widgets = widgets[0]
|
||||
else:
|
||||
widgets = self._dom.createElement("widgets")
|
||||
obj.appendChild(widgets)
|
||||
|
||||
member = self._dom.createElement("widget")
|
||||
member.setAttribute("name", node.getAttribute("id"))
|
||||
widgets.appendChild(member)
|
||||
|
||||
def _convert_dialog_response(self, node, object_name, response):
|
||||
# 1) Get parent dialog node
|
||||
while True:
|
||||
# If we can't find the parent dialog, give up
|
||||
if node == self._dom:
|
||||
return
|
||||
|
||||
if (node.tagName == 'object' and
|
||||
node.getAttribute('class') in DIALOGS):
|
||||
dialog = node
|
||||
break
|
||||
node = node.parentNode
|
||||
assert node
|
||||
|
||||
# 2) Get dialogs action-widgets tag, create if not found
|
||||
for child in dialog.childNodes:
|
||||
if child.nodeType != Node.ELEMENT_NODE:
|
||||
continue
|
||||
if child.tagName == 'action-widgets':
|
||||
actions = child
|
||||
break
|
||||
else:
|
||||
actions = self._dom.createElement("action-widgets")
|
||||
dialog.appendChild(actions)
|
||||
|
||||
# 3) Add action-widget tag for the response
|
||||
action = self._dom.createElement("action-widget")
|
||||
action.setAttribute("response", response)
|
||||
action.appendChild(self._dom.createTextNode(object_name))
|
||||
actions.appendChild(action)
|
||||
|
||||
def _convert_adjustment(self, prop):
|
||||
properties = {}
|
||||
if prop.childNodes:
|
||||
data = prop.childNodes[0].data
|
||||
value, lower, upper, step, page, page_size = data.split(' ')
|
||||
properties.update(value=value,
|
||||
lower=lower,
|
||||
upper=upper,
|
||||
step_increment=step,
|
||||
page_increment=page,
|
||||
page_size=page_size)
|
||||
else:
|
||||
prop.appendChild(self._dom.createTextNode(""))
|
||||
|
||||
adj = self._create_root_object("GtkAdjustment",
|
||||
template='adjustment',
|
||||
properties=properties)
|
||||
prop.childNodes[0].data = adj.getAttribute('id')
|
||||
|
||||
def _convert_combobox_items(self, node, prop):
|
||||
parent = prop.parentNode
|
||||
if not prop.childNodes:
|
||||
parent.removeChild(prop)
|
||||
return
|
||||
|
||||
translatable_attr = prop.attributes.get('translatable')
|
||||
translatable = translatable_attr is not None and translatable_attr.value == 'yes'
|
||||
has_context_attr = prop.attributes.get('context')
|
||||
has_context = has_context_attr is not None and has_context_attr.value == 'yes'
|
||||
comments_attr = prop.attributes.get('comments')
|
||||
comments = comments_attr is not None and comments_attr.value or None
|
||||
|
||||
value = prop.childNodes[0].data
|
||||
model = self._create_root_object("GtkListStore",
|
||||
template="model")
|
||||
|
||||
columns = self._dom.createElement('columns')
|
||||
model.appendChild(columns)
|
||||
|
||||
column = self._dom.createElement('column')
|
||||
column.setAttribute('type', 'gchararray')
|
||||
columns.appendChild(column)
|
||||
|
||||
data = self._dom.createElement('data')
|
||||
model.appendChild(data)
|
||||
|
||||
if value.endswith('\n'):
|
||||
value = value[:-1]
|
||||
for item in value.split('\n'):
|
||||
row = self._dom.createElement('row')
|
||||
data.appendChild(row)
|
||||
|
||||
col = self._dom.createElement('col')
|
||||
col.setAttribute('id', '0')
|
||||
if translatable:
|
||||
col.setAttribute('translatable', 'yes')
|
||||
if has_context:
|
||||
splitting = item.split('|', 1)
|
||||
if len(splitting) == 2:
|
||||
context, item = splitting
|
||||
col.setAttribute('context', context)
|
||||
if comments is not None:
|
||||
col.setAttribute('comments', comments)
|
||||
col.appendChild(self._dom.createTextNode(item))
|
||||
row.appendChild(col)
|
||||
|
||||
model_prop = self._dom.createElement('property')
|
||||
model_prop.setAttribute('name', 'model')
|
||||
model_prop.appendChild(
|
||||
self._dom.createTextNode(model.getAttribute('id')))
|
||||
parent.appendChild(model_prop)
|
||||
|
||||
parent.removeChild(prop)
|
||||
|
||||
child = self._dom.createElement('child')
|
||||
node.appendChild(child)
|
||||
cell_renderer = self._create_object('GtkCellRendererText', None,
|
||||
template='renderer')
|
||||
child.appendChild(cell_renderer)
|
||||
|
||||
attributes = self._dom.createElement('attributes')
|
||||
child.appendChild(attributes)
|
||||
|
||||
attribute = self._dom.createElement('attribute')
|
||||
attributes.appendChild(attribute)
|
||||
attribute.setAttribute('name', 'text')
|
||||
attribute.appendChild(self._dom.createTextNode('0'))
|
||||
|
||||
def _convert_textview_text(self, prop):
|
||||
if not prop.childNodes:
|
||||
prop.parentNode.removeChild(prop)
|
||||
return
|
||||
|
||||
data = prop.childNodes[0].data
|
||||
if prop.hasAttribute('translatable'):
|
||||
prop.removeAttribute('translatable')
|
||||
tbuffer = self._create_root_object("GtkTextBuffer",
|
||||
template='textbuffer',
|
||||
properties=dict(text=data))
|
||||
prop.childNodes[0].data = tbuffer.getAttribute('id')
|
||||
prop.setAttribute('name', 'buffer')
|
||||
|
||||
def _packing_prop_to_child_attr(self, node, prop_name, prop_val,
|
||||
attr_val=None):
|
||||
for child in get_child_nodes(node):
|
||||
packing_props = [p for p in child.childNodes if p.nodeName == "packing"]
|
||||
if not packing_props:
|
||||
continue
|
||||
assert len(packing_props) == 1
|
||||
packing_prop = packing_props[0]
|
||||
properties = packing_prop.getElementsByTagName("property")
|
||||
for prop in properties:
|
||||
if (prop.getAttribute("name") != prop_name or
|
||||
prop.childNodes[0].data != prop_val):
|
||||
continue
|
||||
packing_prop.removeChild(prop)
|
||||
child.setAttribute(prop_name, attr_val or prop_val)
|
||||
if len(properties) == 1:
|
||||
child.removeChild(packing_prop)
|
||||
|
||||
def _convert_ui(self, node):
|
||||
cdata = node.childNodes[0]
|
||||
data = cdata.toxml().strip()
|
||||
if not data.startswith("<![CDATA[") or not data.endswith("]]>"):
|
||||
return
|
||||
data = data[9:-3]
|
||||
child = minidom.parseString(data).childNodes[0]
|
||||
nodes = child.childNodes[:]
|
||||
for child_node in nodes:
|
||||
node.appendChild(child_node)
|
||||
node.removeChild(cdata)
|
||||
if not node.hasAttribute("id"):
|
||||
return
|
||||
|
||||
# Updating references made by widgets
|
||||
parent_id = node.parentNode.getAttribute("id")
|
||||
for widget in self._get_objects_by_attr("constructor",
|
||||
node.getAttribute("id")):
|
||||
widget.getAttributeNode("constructor").value = parent_id
|
||||
node.removeAttribute("id")
|
||||
|
||||
def _convert_accessibility(self, node):
|
||||
objectNode = node.parentNode
|
||||
parent_id = objectNode.getAttribute("id")
|
||||
|
||||
properties = {}
|
||||
for node in node.childNodes:
|
||||
if node.nodeName == 'atkproperty':
|
||||
node.tagName = 'property'
|
||||
properties[node.getAttribute('name')] = node
|
||||
node.parentNode.removeChild(node)
|
||||
elif node.nodeName == 'atkrelation':
|
||||
node.tagName = 'relation'
|
||||
relation_type = node.getAttribute('type')
|
||||
relation_type = relation_type.replace('_', '-')
|
||||
node.setAttribute('type', relation_type)
|
||||
elif node.nodeName == 'atkaction':
|
||||
node.tagName = 'action'
|
||||
|
||||
if properties:
|
||||
child = self._dom.createElement('child')
|
||||
child.setAttribute("internal-child", "accessible")
|
||||
|
||||
atkobject = self._create_object(
|
||||
"AtkObject", None,
|
||||
template='a11y-%s' % (parent_id,),
|
||||
properties=properties)
|
||||
child.appendChild(atkobject)
|
||||
objectNode.appendChild(child)
|
||||
|
||||
def _strip_root(self, root_name):
|
||||
for widget in self._dom.getElementsByTagName("widget"):
|
||||
if widget.getAttribute('id') == root_name:
|
||||
break
|
||||
else:
|
||||
raise SystemExit("Could not find an object called `%s'" % (
|
||||
root_name))
|
||||
|
||||
for child in self._interface.childNodes[:]:
|
||||
if child.nodeType != Node.ELEMENT_NODE:
|
||||
continue
|
||||
child.parentNode.removeChild(child)
|
||||
|
||||
self._interface.appendChild(widget)
|
||||
|
||||
|
||||
def _indent(output):
|
||||
if not subprocess:
|
||||
return output
|
||||
|
||||
for directory in os.environ['PATH'].split(os.pathsep):
|
||||
filename = os.path.join(directory, 'xmllint')
|
||||
if os.path.exists(filename):
|
||||
break
|
||||
else:
|
||||
return output
|
||||
|
||||
s = subprocess.Popen([filename, '--format', '-'],
|
||||
stdin=subprocess.PIPE,
|
||||
stdout=subprocess.PIPE)
|
||||
s.stdin.write(output)
|
||||
s.stdin.close()
|
||||
return s.stdout.read()
|
||||
|
||||
def usage():
|
||||
print __doc__
|
||||
|
||||
def main(args):
|
||||
try:
|
||||
opts, args = getopt.getopt(args[1:], "hwr:",
|
||||
["help",
|
||||
"skip-windows",
|
||||
"target-version=",
|
||||
"root="])
|
||||
except getopt.GetoptError:
|
||||
usage()
|
||||
return 2
|
||||
|
||||
if len(args) != 2:
|
||||
usage()
|
||||
return 2
|
||||
|
||||
input_filename, output_filename = args
|
||||
|
||||
skip_windows = False
|
||||
split = False
|
||||
root = None
|
||||
target_version = "3.0"
|
||||
for o, a in opts:
|
||||
if o in ("-h", "--help"):
|
||||
usage()
|
||||
sys.exit()
|
||||
elif o in ("-r", "--root"):
|
||||
root = a
|
||||
elif o in ("-w", "--skip-windows"):
|
||||
skip_windows = True
|
||||
elif o in ("-t", "--target-version"):
|
||||
target_version = a
|
||||
|
||||
conv = GtkBuilderConverter(skip_windows=skip_windows,
|
||||
target_version=target_version,
|
||||
root=root)
|
||||
conv.parse_file(input_filename)
|
||||
|
||||
xml = _indent(conv.to_xml())
|
||||
if output_filename == "-":
|
||||
print xml
|
||||
else:
|
||||
open(output_filename, 'w').write(xml)
|
||||
print "Wrote", output_filename
|
||||
|
||||
return 0
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main(sys.argv))
|
||||
@@ -189,10 +189,14 @@ gtk_app_chooser_button_get_type G_GNUC_CONST;
|
||||
gtk_app_chooser_button_new
|
||||
gtk_app_chooser_button_set_active_custom_item
|
||||
gtk_app_chooser_button_set_show_dialog_item
|
||||
gtk_app_chooser_button_get_heading
|
||||
gtk_app_chooser_button_set_heading
|
||||
gtk_app_chooser_dialog_new
|
||||
gtk_app_chooser_dialog_new_for_content_type
|
||||
gtk_app_chooser_dialog_get_type G_GNUC_CONST
|
||||
gtk_app_chooser_dialog_get_widget
|
||||
gtk_app_chooser_dialog_get_heading
|
||||
gtk_app_chooser_dialog_set_heading
|
||||
gtk_app_chooser_widget_new
|
||||
gtk_app_chooser_widget_get_show_all
|
||||
gtk_app_chooser_widget_get_default_text
|
||||
@@ -2050,6 +2054,7 @@ gtk_range_get_lower_stepper_sensitivity
|
||||
gtk_range_get_min_slider_size
|
||||
gtk_range_get_range_rect
|
||||
gtk_range_get_restrict_to_fill_level
|
||||
gtk_range_get_round_digits
|
||||
gtk_range_get_show_fill_level
|
||||
gtk_range_get_slider_range
|
||||
gtk_range_get_slider_size_fixed
|
||||
@@ -2065,6 +2070,7 @@ gtk_range_set_lower_stepper_sensitivity
|
||||
gtk_range_set_min_slider_size
|
||||
gtk_range_set_range
|
||||
gtk_range_set_restrict_to_fill_level
|
||||
gtk_range_set_round_digits
|
||||
gtk_range_set_show_fill_level
|
||||
gtk_range_set_slider_size_fixed
|
||||
gtk_range_set_upper_stepper_sensitivity
|
||||
@@ -2853,6 +2859,7 @@ gtk_text_view_get_accepts_tab
|
||||
gtk_text_view_get_border_window_size
|
||||
gtk_text_view_get_buffer
|
||||
gtk_text_view_get_cursor_visible
|
||||
gtk_text_view_get_cursor_locations
|
||||
gtk_text_view_get_default_attributes
|
||||
gtk_text_view_get_editable
|
||||
gtk_text_view_get_hadjustment
|
||||
|
||||
+12
-12
@@ -1480,9 +1480,9 @@ gtk_about_dialog_set_website_label (GtkAboutDialog *about,
|
||||
* Returns the string which are displayed in the authors tab
|
||||
* of the secondary credits dialog.
|
||||
*
|
||||
* Return value: A %NULL-terminated string array containing
|
||||
* the authors. The array is owned by the about dialog
|
||||
* and must not be modified.
|
||||
* Return value: (array zero-terminated=1) (transfer none): A
|
||||
* %NULL-terminated string array containing the authors. The array is
|
||||
* owned by the about dialog and must not be modified.
|
||||
*
|
||||
* Since: 2.6
|
||||
*/
|
||||
@@ -1535,9 +1535,9 @@ gtk_about_dialog_set_authors (GtkAboutDialog *about,
|
||||
* Returns the string which are displayed in the documenters
|
||||
* tab of the secondary credits dialog.
|
||||
*
|
||||
* Return value: A %NULL-terminated string array containing
|
||||
* the documenters. The array is owned by the about dialog
|
||||
* and must not be modified.
|
||||
* Return value: (array zero-terminated=1) (transfer none): A
|
||||
* %NULL-terminated string array containing the documenters. The
|
||||
* array is owned by the about dialog and must not be modified.
|
||||
*
|
||||
* Since: 2.6
|
||||
*/
|
||||
@@ -1590,9 +1590,9 @@ gtk_about_dialog_set_documenters (GtkAboutDialog *about,
|
||||
* Returns the string which are displayed in the artists tab
|
||||
* of the secondary credits dialog.
|
||||
*
|
||||
* Return value: A %NULL-terminated string array containing
|
||||
* the artists. The array is owned by the about dialog
|
||||
* and must not be modified.
|
||||
* Return value: (array zero-terminated=1) (transfer none): A
|
||||
* %NULL-terminated string array containing the artists. The array is
|
||||
* owned by the about dialog and must not be modified.
|
||||
*
|
||||
* Since: 2.6
|
||||
*/
|
||||
@@ -1706,9 +1706,9 @@ gtk_about_dialog_set_translator_credits (GtkAboutDialog *about,
|
||||
*
|
||||
* Returns the pixbuf displayed as logo in the about dialog.
|
||||
*
|
||||
* Return value: the pixbuf displayed as logo. The pixbuf is
|
||||
* owned by the about dialog. If you want to keep a reference
|
||||
* to it, you have to call g_object_ref() on it.
|
||||
* Return value: (transfer none): the pixbuf displayed as logo. The
|
||||
* pixbuf is owned by the about dialog. If you want to keep a
|
||||
* reference to it, you have to call g_object_ref() on it.
|
||||
*
|
||||
* Since: 2.6
|
||||
*/
|
||||
|
||||
+11
-6
@@ -375,10 +375,11 @@ gtk_accel_groups_from_object (GObject *object)
|
||||
/**
|
||||
* gtk_accel_group_find:
|
||||
* @accel_group: a #GtkAccelGroup
|
||||
* @find_func: a function to filter the entries of @accel_group with
|
||||
* @find_func: (scope call): a function to filter the entries
|
||||
* of @accel_group with
|
||||
* @data: data to pass to @find_func
|
||||
* @returns: the key of the first entry passing @find_func. The key is
|
||||
* owned by GTK+ and must not be freed.
|
||||
* @returns: (transfer none): the key of the first entry passing
|
||||
* @find_func. The key is owned by GTK+ and must not be freed.
|
||||
*
|
||||
* Finds the first entry in an accelerator group for which
|
||||
* @find_func returns %TRUE and returns its #GtkAccelKey.
|
||||
@@ -819,8 +820,11 @@ _gtk_accel_group_get_accelerables (GtkAccelGroup *accel_group)
|
||||
* @accel_group: the accelerator group to query
|
||||
* @accel_key: key value of the accelerator
|
||||
* @accel_mods: modifier combination of the accelerator
|
||||
* @n_entries: (allow-none): location to return the number of entries found, or %NULL
|
||||
* @returns: (allow-none): an array of @n_entries #GtkAccelGroupEntry elements, or %NULL. The array is owned by GTK+ and must not be freed.
|
||||
* @n_entries: (allow-none): location to return the number of entries found,
|
||||
* or %NULL
|
||||
* @returns: (transfer none) (array length=n_entries): an array of
|
||||
* @n_entries #GtkAccelGroupEntry elements, or %NULL. The array is
|
||||
* owned by GTK+ and must not be freed.
|
||||
*
|
||||
* Queries an accelerator group for all entries matching @accel_key and
|
||||
* @accel_mods.
|
||||
@@ -847,7 +851,8 @@ gtk_accel_group_query (GtkAccelGroup *accel_group,
|
||||
/**
|
||||
* gtk_accel_group_from_accel_closure:
|
||||
* @closure: a #GClosure
|
||||
* @returns: (allow-none): the #GtkAccelGroup to which @closure is connected, or %NULL.
|
||||
* @returns: (transfer none): the #GtkAccelGroup to which @closure
|
||||
* is connected, or %NULL.
|
||||
*
|
||||
* Finds the #GtkAccelGroup to which @closure is connected;
|
||||
* see gtk_accel_group_connect().
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ typedef gboolean (*GtkAccelGroupActivate) (GtkAccelGroup *accel_group,
|
||||
* GtkAccelGroupFindFunc:
|
||||
* @key:
|
||||
* @closure:
|
||||
* @data:
|
||||
* @data: (closure):
|
||||
*
|
||||
* Since: 2.2
|
||||
*/
|
||||
|
||||
+7
-6
@@ -669,7 +669,7 @@ gtk_accel_map_load_fd (gint fd)
|
||||
|
||||
/**
|
||||
* gtk_accel_map_load:
|
||||
* @file_name: a file containing accelerator specifications,
|
||||
* @file_name: (type filename): a file containing accelerator specifications,
|
||||
* in the GLib file name encoding
|
||||
*
|
||||
* Parses a file previously saved with gtk_accel_map_save() for
|
||||
@@ -780,8 +780,8 @@ gtk_accel_map_save_fd (gint fd)
|
||||
|
||||
/**
|
||||
* gtk_accel_map_save:
|
||||
* @file_name: the name of the file to contain accelerator specifications,
|
||||
* in the GLib file name encoding
|
||||
* @file_name: (type filename): the name of the file to contain
|
||||
* accelerator specifications, in the GLib file name encoding
|
||||
*
|
||||
* Saves current accelerator specifications (accelerator path, key
|
||||
* and modifiers) to @file_name.
|
||||
@@ -807,8 +807,8 @@ gtk_accel_map_save (const gchar *file_name)
|
||||
/**
|
||||
* gtk_accel_map_foreach:
|
||||
* @data: data to be passed into @foreach_func
|
||||
* @foreach_func: function to be executed for each accel map entry which
|
||||
* is not filtered out
|
||||
* @foreach_func: (scope call): function to be executed for each accel
|
||||
* map entry which is not filtered out
|
||||
*
|
||||
* Loops over the entries in the accelerator map whose accel path
|
||||
* doesn't match any of the filters added with gtk_accel_map_add_filter(),
|
||||
@@ -844,7 +844,8 @@ gtk_accel_map_foreach (gpointer data,
|
||||
/**
|
||||
* gtk_accel_map_foreach_unfiltered:
|
||||
* @data: data to be passed into @foreach_func
|
||||
* @foreach_func: function to be executed for each accel map entry
|
||||
* @foreach_func: (scope call): function to be executed for each accel
|
||||
* map entry
|
||||
*
|
||||
* Loops over all entries in the accelerator map, and execute
|
||||
* @foreach_func on each. The signature of @foreach_func is that of
|
||||
|
||||
+12
-9
@@ -506,10 +506,11 @@ gtk_action_buildable_get_name (GtkBuildable *buildable)
|
||||
/**
|
||||
* gtk_action_new:
|
||||
* @name: A unique name for the action
|
||||
* @label: (allow-none): the label displayed in menu items and on buttons, or %NULL
|
||||
* @label: (allow-none): the label displayed in menu items and on buttons,
|
||||
* or %NULL
|
||||
* @tooltip: (allow-none): a tooltip for the action, or %NULL
|
||||
* @stock_id: the stock icon to display in widgets representing the
|
||||
* action, or %NULL
|
||||
* @stock_id: (allow-none): the stock icon to display in widgets representing
|
||||
* the action, or %NULL
|
||||
*
|
||||
* Creates a new #GtkAction object. To add the action to a
|
||||
* #GtkActionGroup and set the accelerator for the action,
|
||||
@@ -873,7 +874,7 @@ gtk_action_unblock_activate (GtkAction *action)
|
||||
* This function is intended for use by action implementations to
|
||||
* create icons displayed in the proxy widgets.
|
||||
*
|
||||
* Returns: (transfer full): a widget that displays the icon for this action.
|
||||
* Returns: (transfer none): a widget that displays the icon for this action.
|
||||
*
|
||||
* Since: 2.4
|
||||
*/
|
||||
@@ -899,7 +900,7 @@ gtk_action_create_icon (GtkAction *action, GtkIconSize icon_size)
|
||||
*
|
||||
* Creates a menu item widget that proxies for the given action.
|
||||
*
|
||||
* Returns: (transfer full): a menu item connected to the action.
|
||||
* Returns: (transfer none): a menu item connected to the action.
|
||||
*
|
||||
* Since: 2.4
|
||||
*/
|
||||
@@ -924,7 +925,7 @@ gtk_action_create_menu_item (GtkAction *action)
|
||||
*
|
||||
* Creates a toolbar item widget that proxies for the given action.
|
||||
*
|
||||
* Returns: (transfer full): a toolbar item connected to the action.
|
||||
* Returns: (transfer none): a toolbar item connected to the action.
|
||||
*
|
||||
* Since: 2.4
|
||||
*/
|
||||
@@ -1705,8 +1706,9 @@ gtk_action_get_accel_path (GtkAction *action)
|
||||
*
|
||||
* Since: 2.8
|
||||
*
|
||||
* Returns: the accel closure for this action. The returned closure is
|
||||
* owned by GTK+ and must not be unreffed or modified.
|
||||
* Returns: (transfer none): the accel closure for this action. The
|
||||
* returned closure is owned by GTK+ and must not be unreffed
|
||||
* or modified.
|
||||
*/
|
||||
GClosure *
|
||||
gtk_action_get_accel_closure (GtkAction *action)
|
||||
@@ -1811,7 +1813,8 @@ gtk_action_disconnect_accelerator (GtkAction *action)
|
||||
* item or the toolbar item it creates, this function returns an
|
||||
* instance of that menu.
|
||||
*
|
||||
* Return value: (transfer full): the menu item provided by the action, or %NULL.
|
||||
* Return value: (transfer none): the menu item provided by the
|
||||
* action, or %NULL.
|
||||
*
|
||||
* Since: 2.12
|
||||
*/
|
||||
|
||||
+12
-12
@@ -1003,9 +1003,9 @@ gtk_action_group_list_actions (GtkActionGroup *action_group)
|
||||
|
||||
|
||||
/**
|
||||
* gtk_action_group_add_actions:
|
||||
* gtk_action_group_add_actions: (skip)
|
||||
* @action_group: the action group
|
||||
* @entries: an array of action descriptions
|
||||
* @entries: (array length=n_entries): an array of action descriptions
|
||||
* @n_entries: the number of entries
|
||||
* @user_data: data to pass to the action callbacks
|
||||
*
|
||||
@@ -1054,9 +1054,9 @@ shared_data_unref (gpointer data)
|
||||
|
||||
|
||||
/**
|
||||
* gtk_action_group_add_actions_full:
|
||||
* gtk_action_group_add_actions_full: (skip)
|
||||
* @action_group: the action group
|
||||
* @entries: an array of action descriptions
|
||||
* @entries: (array length=n_entries): an array of action descriptions
|
||||
* @n_entries: the number of entries
|
||||
* @user_data: data to pass to the action callbacks
|
||||
* @destroy: destroy notification callback for @user_data
|
||||
@@ -1134,9 +1134,9 @@ gtk_action_group_add_actions_full (GtkActionGroup *action_group,
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_action_group_add_toggle_actions:
|
||||
* gtk_action_group_add_toggle_actions: (skip)
|
||||
* @action_group: the action group
|
||||
* @entries: an array of toggle action descriptions
|
||||
* @entries: (array length=n_entries): an array of toggle action descriptions
|
||||
* @n_entries: the number of entries
|
||||
* @user_data: data to pass to the action callbacks
|
||||
*
|
||||
@@ -1162,9 +1162,9 @@ gtk_action_group_add_toggle_actions (GtkActionGroup *action_group,
|
||||
|
||||
|
||||
/**
|
||||
* gtk_action_group_add_toggle_actions_full:
|
||||
* gtk_action_group_add_toggle_actions_full: (skip)
|
||||
* @action_group: the action group
|
||||
* @entries: an array of toggle action descriptions
|
||||
* @entries: (array length=n_entries): an array of toggle action descriptions
|
||||
* @n_entries: the number of entries
|
||||
* @user_data: data to pass to the action callbacks
|
||||
* @destroy: destroy notification callback for @user_data
|
||||
@@ -1243,9 +1243,9 @@ gtk_action_group_add_toggle_actions_full (GtkActionGroup *action_gro
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_action_group_add_radio_actions:
|
||||
* gtk_action_group_add_radio_actions: (skip)
|
||||
* @action_group: the action group
|
||||
* @entries: an array of radio action descriptions
|
||||
* @entries: (array length=n_entries): an array of radio action descriptions
|
||||
* @n_entries: the number of entries
|
||||
* @value: the value of the action to activate initially, or -1 if
|
||||
* no action should be activated
|
||||
@@ -1276,9 +1276,9 @@ gtk_action_group_add_radio_actions (GtkActionGroup *action_group,
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_action_group_add_radio_actions_full:
|
||||
* gtk_action_group_add_radio_actions_full: (skip)
|
||||
* @action_group: the action group
|
||||
* @entries: an array of radio action descriptions
|
||||
* @entries: (array length=n_entries): an array of radio action descriptions
|
||||
* @n_entries: the number of entries
|
||||
* @value: the value of the action to activate initially, or -1 if
|
||||
* no action should be activated
|
||||
|
||||
+8
-4
@@ -753,10 +753,14 @@ gtk_alignment_set_padding (GtkAlignment *alignment,
|
||||
/**
|
||||
* gtk_alignment_get_padding:
|
||||
* @alignment: a #GtkAlignment
|
||||
* @padding_top: (allow-none): location to store the padding for the top of the widget, or %NULL
|
||||
* @padding_bottom: (allow-none): location to store the padding for the bottom of the widget, or %NULL
|
||||
* @padding_left: (allow-none): location to store the padding for the left of the widget, or %NULL
|
||||
* @padding_right: (allow-none): location to store the padding for the right of the widget, or %NULL
|
||||
* @padding_top: (out) (allow-none): location to store the padding for
|
||||
* the top of the widget, or %NULL
|
||||
* @padding_bottom: (out) (allow-none): location to store the padding
|
||||
* for the bottom of the widget, or %NULL
|
||||
* @padding_left: (out) (allow-none): location to store the padding
|
||||
* for the left of the widget, or %NULL
|
||||
* @padding_right: (out) (allow-none): location to store the padding
|
||||
* for the right of the widget, or %NULL
|
||||
*
|
||||
* Gets the padding on the different sides of the widget.
|
||||
* See gtk_alignment_set_padding ().
|
||||
|
||||
@@ -60,6 +60,12 @@ struct _GtkAlignment
|
||||
struct _GtkAlignmentClass
|
||||
{
|
||||
GtkBinClass parent_class;
|
||||
|
||||
/* Padding for future expansion */
|
||||
void (*_gtk_reserved1) (void);
|
||||
void (*_gtk_reserved2) (void);
|
||||
void (*_gtk_reserved3) (void);
|
||||
void (*_gtk_reserved4) (void);
|
||||
};
|
||||
|
||||
|
||||
|
||||
+84
-13
@@ -47,6 +47,7 @@
|
||||
enum {
|
||||
PROP_CONTENT_TYPE = 1,
|
||||
PROP_SHOW_DIALOG_ITEM,
|
||||
PROP_HEADING
|
||||
};
|
||||
|
||||
enum {
|
||||
@@ -88,8 +89,10 @@ G_DEFINE_TYPE_WITH_CODE (GtkAppChooserButton, gtk_app_chooser_button, GTK_TYPE_C
|
||||
struct _GtkAppChooserButtonPrivate {
|
||||
GtkListStore *store;
|
||||
|
||||
int last_active;
|
||||
gchar *content_type;
|
||||
gboolean show_dialog_item;
|
||||
gchar *heading;
|
||||
|
||||
GHashTable *custom_item_names;
|
||||
};
|
||||
@@ -200,7 +203,7 @@ other_application_dialog_response_cb (GtkDialog *dialog,
|
||||
/* reset the active item, otherwise we are stuck on
|
||||
* 'Other application...'
|
||||
*/
|
||||
gtk_combo_box_set_active (GTK_COMBO_BOX (self), 0);
|
||||
gtk_combo_box_set_active (GTK_COMBO_BOX (self), self->priv->last_active);
|
||||
gtk_widget_destroy (GTK_WIDGET (dialog));
|
||||
return;
|
||||
}
|
||||
@@ -223,6 +226,11 @@ other_application_item_activated_cb (GtkAppChooserButton *self)
|
||||
toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (self)));
|
||||
dialog = gtk_app_chooser_dialog_new_for_content_type (toplevel, GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
self->priv->content_type);
|
||||
|
||||
gtk_window_set_modal (GTK_WINDOW (dialog), gtk_window_get_modal (toplevel));
|
||||
gtk_app_chooser_dialog_set_heading (GTK_APP_CHOOSER_DIALOG (dialog),
|
||||
self->priv->heading);
|
||||
|
||||
widget = gtk_app_chooser_dialog_get_widget (GTK_APP_CHOOSER_DIALOG (dialog));
|
||||
g_object_set (widget,
|
||||
"show-fallback", TRUE,
|
||||
@@ -238,14 +246,11 @@ static void
|
||||
gtk_app_chooser_button_ensure_dialog_item (GtkAppChooserButton *self,
|
||||
GtkTreeIter *prev_iter)
|
||||
{
|
||||
GIcon *icon;
|
||||
GtkTreeIter iter, iter2;
|
||||
|
||||
if (!self->priv->show_dialog_item)
|
||||
return;
|
||||
|
||||
icon = g_themed_icon_new ("application-x-executable");
|
||||
|
||||
if (prev_iter == NULL)
|
||||
gtk_list_store_append (self->priv->store, &iter);
|
||||
else
|
||||
@@ -256,10 +261,8 @@ gtk_app_chooser_button_ensure_dialog_item (GtkAppChooserButton *self,
|
||||
|
||||
gtk_list_store_insert_after (self->priv->store, &iter, &iter2);
|
||||
real_insert_custom_item (self, CUSTOM_ITEM_OTHER_APP,
|
||||
_("Other application..."), icon,
|
||||
_("Other application..."), NULL,
|
||||
FALSE, &iter);
|
||||
|
||||
g_object_unref (icon);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -300,7 +303,7 @@ gtk_app_chooser_button_populate (GtkAppChooserButton *self)
|
||||
|
||||
gtk_list_store_set (self->priv->store, &iter,
|
||||
COLUMN_APP_INFO, app,
|
||||
COLUMN_LABEL, g_app_info_get_display_name (app),
|
||||
COLUMN_LABEL, g_app_info_get_name (app),
|
||||
COLUMN_ICON, icon,
|
||||
COLUMN_CUSTOM, FALSE,
|
||||
-1);
|
||||
@@ -320,6 +323,7 @@ static void
|
||||
gtk_app_chooser_button_build_ui (GtkAppChooserButton *self)
|
||||
{
|
||||
GtkCellRenderer *cell;
|
||||
GtkCellArea *area;
|
||||
|
||||
self->priv->store = gtk_list_store_new (NUM_COLUMNS,
|
||||
G_TYPE_APP_INFO,
|
||||
@@ -332,23 +336,29 @@ gtk_app_chooser_button_build_ui (GtkAppChooserButton *self)
|
||||
gtk_combo_box_set_model (GTK_COMBO_BOX (self),
|
||||
GTK_TREE_MODEL (self->priv->store));
|
||||
|
||||
area = gtk_cell_layout_get_area (GTK_CELL_LAYOUT (self));
|
||||
|
||||
gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (self),
|
||||
row_separator_func, NULL, NULL);
|
||||
|
||||
cell = gtk_cell_renderer_pixbuf_new ();
|
||||
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (self), cell, FALSE);
|
||||
gtk_cell_area_add_with_properties (area, cell,
|
||||
"align", FALSE,
|
||||
"expand", FALSE,
|
||||
"fixed-size", FALSE,
|
||||
NULL);
|
||||
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (self), cell,
|
||||
"gicon", COLUMN_ICON,
|
||||
NULL);
|
||||
|
||||
cell = gtk_cell_renderer_text_new ();
|
||||
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (self), cell, TRUE);
|
||||
gtk_cell_area_add_with_properties (area, cell,
|
||||
"align", FALSE,
|
||||
"expand", TRUE,
|
||||
NULL);
|
||||
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (self), cell,
|
||||
"text", COLUMN_LABEL,
|
||||
NULL);
|
||||
g_object_set (cell,
|
||||
"xpad", 6,
|
||||
NULL);
|
||||
|
||||
gtk_app_chooser_button_populate (self);
|
||||
}
|
||||
@@ -399,6 +409,7 @@ gtk_app_chooser_button_changed (GtkComboBox *object)
|
||||
{
|
||||
name_quark = g_quark_from_string (name);
|
||||
g_signal_emit (self, signals[SIGNAL_CUSTOM_ITEM_ACTIVATED], name_quark, name);
|
||||
self->priv->last_active = gtk_combo_box_get_active (object);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -408,6 +419,8 @@ gtk_app_chooser_button_changed (GtkComboBox *object)
|
||||
|
||||
g_free (name);
|
||||
}
|
||||
else
|
||||
self->priv->last_active = gtk_combo_box_get_active (object);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -465,6 +478,9 @@ gtk_app_chooser_button_set_property (GObject *obj,
|
||||
case PROP_SHOW_DIALOG_ITEM:
|
||||
gtk_app_chooser_button_set_show_dialog_item (self, g_value_get_boolean (value));
|
||||
break;
|
||||
case PROP_HEADING:
|
||||
gtk_app_chooser_button_set_heading (self, g_value_get_string (value));
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, property_id, pspec);
|
||||
break;
|
||||
@@ -487,6 +503,9 @@ gtk_app_chooser_button_get_property (GObject *obj,
|
||||
case PROP_SHOW_DIALOG_ITEM:
|
||||
g_value_set_boolean (value, self->priv->show_dialog_item);
|
||||
break;
|
||||
case PROP_HEADING:
|
||||
g_value_set_string (value, self->priv->heading);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, property_id, pspec);
|
||||
break;
|
||||
@@ -500,6 +519,7 @@ gtk_app_chooser_button_finalize (GObject *obj)
|
||||
|
||||
g_hash_table_destroy (self->priv->custom_item_names);
|
||||
g_free (self->priv->content_type);
|
||||
g_free (self->priv->heading);
|
||||
|
||||
G_OBJECT_CLASS (gtk_app_chooser_button_parent_class)->finalize (obj);
|
||||
}
|
||||
@@ -541,6 +561,20 @@ gtk_app_chooser_button_class_init (GtkAppChooserButtonClass *klass)
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS);
|
||||
g_object_class_install_property (oclass, PROP_SHOW_DIALOG_ITEM, pspec);
|
||||
|
||||
/**
|
||||
* GtkAppChooserButton:heading:
|
||||
*
|
||||
* The text to show at the top of the dialog that can be
|
||||
* opened from the button. The string may contain Pango markup.
|
||||
*/
|
||||
pspec = g_param_spec_string ("heading",
|
||||
P_("Heading"),
|
||||
P_("The text to show at the top of the dialog"),
|
||||
NULL,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
g_object_class_install_property (oclass, PROP_HEADING, pspec);
|
||||
|
||||
|
||||
/**
|
||||
* GtkAppChooserButton::custom-item-activated:
|
||||
* @self: the object which received the signal
|
||||
@@ -792,3 +826,40 @@ gtk_app_chooser_button_set_show_dialog_item (GtkAppChooserButton *self,
|
||||
gtk_app_chooser_refresh (GTK_APP_CHOOSER (self));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_app_chooser_button_set_heading:
|
||||
* @self: a #GtkAppChooserButton
|
||||
* @heading: a string containing Pango markup
|
||||
*
|
||||
* Sets the text to display at the top of the dialog.
|
||||
* If the heading is not set, the dialog displays a default text.
|
||||
*/
|
||||
void
|
||||
gtk_app_chooser_button_set_heading (GtkAppChooserButton *self,
|
||||
const gchar *heading)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_APP_CHOOSER_BUTTON (self));
|
||||
|
||||
g_free (self->priv->heading);
|
||||
self->priv->heading = g_strdup (heading);
|
||||
|
||||
g_object_notify (G_OBJECT (self), "heading");
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_app_chooser_button_get_heading:
|
||||
* @self: a #GtkAppChooserButton
|
||||
*
|
||||
* Returns the text to display at the top of the dialog.
|
||||
*
|
||||
* Returns: the text to display at the top of the dialog, or %NULL, in which
|
||||
* case a default text is displayed
|
||||
*/
|
||||
const gchar *
|
||||
gtk_app_chooser_button_get_heading (GtkAppChooserButton *self)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_APP_CHOOSER_BUTTON (self), NULL);
|
||||
|
||||
return self->priv->heading;
|
||||
}
|
||||
|
||||
@@ -74,5 +74,10 @@ void gtk_app_chooser_button_set_active_custom_item (GtkAppChooserButton *sel
|
||||
void gtk_app_chooser_button_set_show_dialog_item (GtkAppChooserButton *self,
|
||||
gboolean setting);
|
||||
gboolean gtk_app_chooser_button_get_show_dialog_item (GtkAppChooserButton *self);
|
||||
void gtk_app_chooser_button_set_heading (GtkAppChooserButton *self,
|
||||
const gchar *heading);
|
||||
const gchar *
|
||||
gtk_app_chooser_button_get_heading (GtkAppChooserButton *self);
|
||||
|
||||
|
||||
#endif /* __GTK_APP_CHOOSER_BUTTON_H__ */
|
||||
|
||||
@@ -62,6 +62,7 @@
|
||||
struct _GtkAppChooserDialogPrivate {
|
||||
char *content_type;
|
||||
GFile *gfile;
|
||||
char *heading;
|
||||
|
||||
GtkWidget *label;
|
||||
GtkWidget *button;
|
||||
@@ -80,7 +81,7 @@ struct _GtkAppChooserDialogPrivate {
|
||||
enum {
|
||||
PROP_GFILE = 1,
|
||||
PROP_CONTENT_TYPE,
|
||||
N_PROPERTIES
|
||||
PROP_HEADING
|
||||
};
|
||||
|
||||
static void gtk_app_chooser_dialog_iface_init (GtkAppChooserIface *iface);
|
||||
@@ -348,10 +349,13 @@ set_dialog_properties (GtkAppChooserDialog *self)
|
||||
|
||||
font_desc = pango_font_description_new ();
|
||||
pango_font_description_set_weight (font_desc, PANGO_WEIGHT_BOLD);
|
||||
gtk_widget_modify_font (self->priv->label, font_desc);
|
||||
gtk_widget_override_font (self->priv->label, font_desc);
|
||||
pango_font_description_free (font_desc);
|
||||
|
||||
gtk_label_set_markup (GTK_LABEL (self->priv->label), label);
|
||||
if (self->priv->heading != NULL)
|
||||
gtk_label_set_markup (GTK_LABEL (self->priv->label), self->priv->heading);
|
||||
else
|
||||
gtk_label_set_markup (GTK_LABEL (self->priv->label), label);
|
||||
|
||||
default_text = g_strdup_printf ("<big><b>%s</b></big>\n%s",
|
||||
string,
|
||||
@@ -394,7 +398,7 @@ widget_notify_for_button_cb (GObject *source,
|
||||
GtkAppChooserWidget *widget = GTK_APP_CHOOSER_WIDGET (source);
|
||||
gboolean should_hide;
|
||||
|
||||
should_hide = gtk_app_chooser_widget_get_show_all (widget) ||
|
||||
should_hide = gtk_app_chooser_widget_get_show_other (widget) ||
|
||||
self->priv->show_more_clicked;
|
||||
|
||||
if (should_hide)
|
||||
@@ -485,7 +489,7 @@ build_dialog_ui (GtkAppChooserDialog *self)
|
||||
G_CALLBACK (widget_application_selected_cb), self);
|
||||
g_signal_connect (self->priv->app_chooser_widget, "application-activated",
|
||||
G_CALLBACK (widget_application_activated_cb), self);
|
||||
g_signal_connect (self->priv->app_chooser_widget, "notify::show-all",
|
||||
g_signal_connect (self->priv->app_chooser_widget, "notify::show-other",
|
||||
G_CALLBACK (widget_notify_for_button_cb), self);
|
||||
g_signal_connect (self->priv->app_chooser_widget, "populate-popup",
|
||||
G_CALLBACK (widget_populate_popup_cb), self);
|
||||
@@ -508,7 +512,7 @@ build_dialog_ui (GtkAppChooserDialog *self)
|
||||
/* Create a custom stock icon */
|
||||
self->priv->button = gtk_button_new ();
|
||||
|
||||
label = gtk_label_new_with_mnemonic (_("_Open"));
|
||||
label = gtk_label_new_with_mnemonic (_("_Select"));
|
||||
gtk_label_set_mnemonic_widget (GTK_LABEL (label), GTK_WIDGET (self->priv->button));
|
||||
gtk_widget_set_halign (label, GTK_ALIGN_CENTER);
|
||||
gtk_widget_show (label);
|
||||
@@ -621,6 +625,9 @@ gtk_app_chooser_dialog_set_property (GObject *object,
|
||||
if (self->priv->content_type == NULL)
|
||||
self->priv->content_type = g_value_dup_string (value);
|
||||
break;
|
||||
case PROP_HEADING:
|
||||
gtk_app_chooser_dialog_set_heading (self, g_value_get_string (value));
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||
break;
|
||||
@@ -644,6 +651,9 @@ gtk_app_chooser_dialog_get_property (GObject *object,
|
||||
case PROP_CONTENT_TYPE:
|
||||
g_value_set_string (value, self->priv->content_type);
|
||||
break;
|
||||
case PROP_HEADING:
|
||||
g_value_set_string (value, self->priv->heading);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||
break;
|
||||
@@ -687,6 +697,20 @@ gtk_app_chooser_dialog_class_init (GtkAppChooserDialogClass *klass)
|
||||
G_PARAM_STATIC_STRINGS);
|
||||
g_object_class_install_property (gobject_class, PROP_GFILE, pspec);
|
||||
|
||||
/**
|
||||
* GtkAppChooserDialog:heading:
|
||||
*
|
||||
* The text to show at the top of the dialog.
|
||||
* The string may contain Pango markup.
|
||||
*/
|
||||
pspec = g_param_spec_string ("heading",
|
||||
P_("Heading"),
|
||||
P_("The text to show at the top of the dialog"),
|
||||
NULL,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
g_object_class_install_property (gobject_class, PROP_HEADING, pspec);
|
||||
|
||||
|
||||
g_type_class_add_private (klass, sizeof (GtkAppChooserDialogPrivate));
|
||||
}
|
||||
|
||||
@@ -797,3 +821,43 @@ gtk_app_chooser_dialog_get_widget (GtkAppChooserDialog *self)
|
||||
|
||||
return self->priv->app_chooser_widget;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_app_chooser_dialog_set_heading:
|
||||
* @self: a #GtkAppChooserDialog
|
||||
* @heading: a string containing Pango markup
|
||||
*
|
||||
* Sets the text to display at the top of the dialog.
|
||||
* If the heading is not set, the dialog displays a default text.
|
||||
*/
|
||||
void
|
||||
gtk_app_chooser_dialog_set_heading (GtkAppChooserDialog *self,
|
||||
const gchar *heading)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_APP_CHOOSER_DIALOG (self));
|
||||
|
||||
g_free (self->priv->heading);
|
||||
self->priv->heading = g_strdup (heading);
|
||||
|
||||
if (self->priv->label && self->priv->heading)
|
||||
gtk_label_set_markup (GTK_LABEL (self->priv->label), self->priv->heading);
|
||||
|
||||
g_object_notify (G_OBJECT (self), "heading");
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_app_chooser_dialog_get_heading:
|
||||
* @self: a #GtkAppChooserDialog
|
||||
*
|
||||
* Returns the text to display at the top of the dialog.
|
||||
*
|
||||
* Returns: the text to display at the top of the dialog, or %NULL, in which
|
||||
* case a default text is displayed
|
||||
*/
|
||||
const gchar *
|
||||
gtk_app_chooser_dialog_get_heading (GtkAppChooserDialog *self)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_APP_CHOOSER_DIALOG (self), NULL);
|
||||
|
||||
return self->priv->heading;
|
||||
}
|
||||
|
||||
@@ -59,15 +59,18 @@ struct _GtkAppChooserDialogClass {
|
||||
gpointer padding[16];
|
||||
};
|
||||
|
||||
GType gtk_app_chooser_dialog_get_type (void) G_GNUC_CONST;
|
||||
GType gtk_app_chooser_dialog_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GtkWidget * gtk_app_chooser_dialog_new (GtkWindow *parent,
|
||||
GtkDialogFlags flags,
|
||||
GFile *file);
|
||||
GtkWidget * gtk_app_chooser_dialog_new_for_content_type (GtkWindow *parent,
|
||||
GtkDialogFlags flags,
|
||||
const gchar *content_type);
|
||||
GtkWidget * gtk_app_chooser_dialog_new (GtkWindow *parent,
|
||||
GtkDialogFlags flags,
|
||||
GFile *file);
|
||||
GtkWidget * gtk_app_chooser_dialog_new_for_content_type (GtkWindow *parent,
|
||||
GtkDialogFlags flags,
|
||||
const gchar *content_type);
|
||||
|
||||
GtkWidget * gtk_app_chooser_dialog_get_widget (GtkAppChooserDialog *self);
|
||||
GtkWidget * gtk_app_chooser_dialog_get_widget (GtkAppChooserDialog *self);
|
||||
void gtk_app_chooser_dialog_set_heading (GtkAppChooserDialog *self,
|
||||
const gchar *heading);
|
||||
const gchar * gtk_app_chooser_dialog_get_heading (GtkAppChooserDialog *self);
|
||||
|
||||
#endif /* __GTK_APP_CHOOSER_DIALOG_H__ */
|
||||
|
||||
@@ -541,11 +541,9 @@ gtk_app_chooser_widget_add_section (GtkAppChooserWidget *self,
|
||||
heading_added = TRUE;
|
||||
}
|
||||
|
||||
app_string = g_markup_printf_escaped ("<b>%s</b>\n%s",
|
||||
g_app_info_get_display_name (app) != NULL ?
|
||||
g_app_info_get_display_name (app) : "",
|
||||
g_app_info_get_description (app) != NULL ?
|
||||
g_app_info_get_description (app) : "");
|
||||
app_string = g_markup_printf_escaped ("%s",
|
||||
g_app_info_get_name (app) != NULL ?
|
||||
g_app_info_get_name (app) : "");
|
||||
|
||||
icon = g_app_info_get_icon (app);
|
||||
unref_icon = FALSE;
|
||||
@@ -559,7 +557,7 @@ gtk_app_chooser_widget_add_section (GtkAppChooserWidget *self,
|
||||
gtk_list_store_set (self->priv->program_list_store, &iter,
|
||||
COLUMN_APP_INFO, app,
|
||||
COLUMN_GICON, icon,
|
||||
COLUMN_NAME, g_app_info_get_display_name (app),
|
||||
COLUMN_NAME, g_app_info_get_name (app),
|
||||
COLUMN_DESC, app_string,
|
||||
COLUMN_EXEC, g_app_info_get_executable (app),
|
||||
COLUMN_HEADING, FALSE,
|
||||
@@ -601,11 +599,9 @@ gtk_app_chooser_add_default (GtkAppChooserWidget *self,
|
||||
|
||||
g_free (string);
|
||||
|
||||
string = g_markup_printf_escaped ("<b>%s</b>\n%s",
|
||||
g_app_info_get_display_name (app) != NULL ?
|
||||
g_app_info_get_display_name (app) : "",
|
||||
g_app_info_get_description (app) != NULL ?
|
||||
g_app_info_get_description (app) : "");
|
||||
string = g_markup_printf_escaped ("%s",
|
||||
g_app_info_get_name (app) != NULL ?
|
||||
g_app_info_get_name (app) : "");
|
||||
|
||||
icon = g_app_info_get_icon (app);
|
||||
if (icon == NULL)
|
||||
@@ -618,7 +614,7 @@ gtk_app_chooser_add_default (GtkAppChooserWidget *self,
|
||||
gtk_list_store_set (self->priv->program_list_store, &iter,
|
||||
COLUMN_APP_INFO, app,
|
||||
COLUMN_GICON, icon,
|
||||
COLUMN_NAME, g_app_info_get_display_name (app),
|
||||
COLUMN_NAME, g_app_info_get_name (app),
|
||||
COLUMN_DESC, string,
|
||||
COLUMN_EXEC, g_app_info_get_executable (app),
|
||||
COLUMN_HEADING, FALSE,
|
||||
@@ -857,7 +853,7 @@ gtk_app_chooser_widget_add_items (GtkAppChooserWidget *self)
|
||||
"gicon", COLUMN_GICON,
|
||||
NULL);
|
||||
g_object_set (renderer,
|
||||
"stock-size", GTK_ICON_SIZE_DIALOG,
|
||||
"stock-size", GTK_ICON_SIZE_MENU,
|
||||
NULL);
|
||||
|
||||
/* app name renderer */
|
||||
|
||||
@@ -192,6 +192,13 @@ gtk_application_new (const gchar *application_id,
|
||||
* This call is equivalent to setting the #GtkWindow:application
|
||||
* property of @window to @application.
|
||||
*
|
||||
* Normally, the connection between the application and the window
|
||||
* will remain until the window is destroyed, but you can explicitly
|
||||
* remove it with gtk_application_remove_window().
|
||||
*
|
||||
* GTK+ will keep the application running as long as it has
|
||||
* any windows.
|
||||
*
|
||||
* Since: 3.0
|
||||
**/
|
||||
void
|
||||
@@ -253,7 +260,7 @@ gtk_application_remove_window (GtkApplication *application,
|
||||
*
|
||||
* The list that is returned should not be modified in any way.
|
||||
*
|
||||
* Returns: a #GList of #GtkWindow
|
||||
* Returns: (element-type GtkWindow) (transfer none): a #GList of #GtkWindow
|
||||
*
|
||||
* Since: 3.0
|
||||
**/
|
||||
|
||||
@@ -56,7 +56,7 @@ struct _GtkApplicationClass
|
||||
GApplicationClass parent_class;
|
||||
|
||||
/*< private >*/
|
||||
gpointer padding[12];
|
||||
gpointer padding[16];
|
||||
};
|
||||
|
||||
GType gtk_application_get_type (void) G_GNUC_CONST;
|
||||
|
||||
@@ -60,6 +60,12 @@ struct _GtkArrow
|
||||
struct _GtkArrowClass
|
||||
{
|
||||
GtkMiscClass parent_class;
|
||||
|
||||
/* Padding for future expansion */
|
||||
void (*_gtk_reserved1) (void);
|
||||
void (*_gtk_reserved2) (void);
|
||||
void (*_gtk_reserved3) (void);
|
||||
void (*_gtk_reserved4) (void);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -59,6 +59,12 @@ struct _GtkAspectFrame
|
||||
struct _GtkAspectFrameClass
|
||||
{
|
||||
GtkFrameClass parent_class;
|
||||
|
||||
/* Padding for future expansion */
|
||||
void (*_gtk_reserved1) (void);
|
||||
void (*_gtk_reserved2) (void);
|
||||
void (*_gtk_reserved3) (void);
|
||||
void (*_gtk_reserved4) (void);
|
||||
};
|
||||
|
||||
|
||||
|
||||
+376
-348
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user