Compare commits
80 Commits
spread-tab
...
native-lay
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
54d44a9bd0 | ||
|
|
b3b22c31b9 | ||
|
|
dd6aa6d1cf | ||
|
|
4f47197d33 | ||
|
|
4a2905c34b | ||
|
|
99babef4b8 | ||
|
|
d25c4f9dc1 | ||
|
|
ddd32757be | ||
|
|
4ff413f48d | ||
|
|
59aacd7935 | ||
|
|
72856830e7 | ||
|
|
94f7cf0347 | ||
|
|
c4119e58cf | ||
|
|
1b526bfcc1 | ||
|
|
7d3cb3f9d9 | ||
|
|
6a5f77a992 | ||
|
|
8740bd2faf | ||
|
|
360e2c4dd5 | ||
|
|
fd66586b33 | ||
|
|
add39dfea8 | ||
|
|
a4086282c1 | ||
|
|
c3da4007db | ||
|
|
e569c77648 | ||
|
|
f0b205f40c | ||
|
|
a564e69e51 | ||
|
|
84e2a854dd | ||
|
|
237d97dc25 | ||
|
|
6d47681722 | ||
|
|
0809e06881 | ||
|
|
6d9d23009c | ||
|
|
93b76327ec | ||
|
|
a30585167f | ||
|
|
deab62c29e | ||
|
|
02c37eb098 | ||
|
|
ea4d2f9a52 | ||
|
|
bba9e3e070 | ||
|
|
89a8f35b28 | ||
|
|
c71bf29d24 | ||
|
|
1d0650f871 | ||
|
|
9d97153738 | ||
|
|
86f360fec2 | ||
|
|
f1998d568a | ||
|
|
9f3ad94e75 | ||
|
|
4dbbcefe7c | ||
|
|
27065e257b | ||
|
|
fca8db084d | ||
|
|
103f3a6a18 | ||
|
|
c683dffa9e | ||
|
|
ecedc58113 | ||
|
|
4a7c237b79 | ||
|
|
2f2486bd5b | ||
|
|
ff82a56f28 | ||
|
|
f463059f00 | ||
|
|
6d16148936 | ||
|
|
92ae8ebb01 | ||
|
|
380120bda9 | ||
|
|
2517035bc0 | ||
|
|
3651dc278d | ||
|
|
2c7058bd13 | ||
|
|
ed639b211e | ||
|
|
49f050a9bc | ||
|
|
51dadc0a1a | ||
|
|
1700cbe458 | ||
|
|
ee097eb7ab | ||
|
|
9f6c01c665 | ||
|
|
101ad51803 | ||
|
|
99f73c09f6 | ||
|
|
7c66a29e87 | ||
|
|
0eff4061ab | ||
|
|
9653cf57b6 | ||
|
|
06a5095dc5 | ||
|
|
ee9115fb9f | ||
|
|
33d3f72b98 | ||
|
|
4ef145bda6 | ||
|
|
6e705d7087 | ||
|
|
c2abe27b03 | ||
|
|
c20c3fd757 | ||
|
|
c5a0e04a8d | ||
|
|
f04f94e881 | ||
|
|
16715a662e |
@@ -5,11 +5,9 @@ GTK+ requires the following packages:
|
||||
|
||||
- The GLib, Pango, GdkPixbuf, ATK and cairo libraries, available at
|
||||
the same location as GTK+. GTK+ @GTK_VERSION@ requires at least
|
||||
GLib @GLIB_REQUIRED_VERSION@, Pango @PANGO_REQUIRED_VERSION@,
|
||||
GdkPixbuf @GDK_PIXBUF_REQUIRED_VERSION@, ATK @ATK_REQUIRED_VERSION@
|
||||
and cairo @CAIRO_REQUIRED_VERSION@.
|
||||
GLib 2.23.6, Pango 1.20, GdkPixbuf 2.21.0 ATK 1.29.2 and cairo 1.6.0.
|
||||
|
||||
- gobject-introspection 0.9.3 or newer.
|
||||
- gobject-introspection 0.6.7 or newer.
|
||||
|
||||
Simple install procedure
|
||||
========================
|
||||
|
||||
@@ -7,7 +7,6 @@ SUBDIRS = po po-properties $(SRC_SUBDIRS) docs m4macros build
|
||||
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
|
||||
|
||||
EXTRA_DIST += \
|
||||
autogen.sh \
|
||||
HACKING \
|
||||
makecopyright \
|
||||
NEWS.pre-1-0 \
|
||||
@@ -71,6 +70,8 @@ EXTRA_DIST += \
|
||||
examples/packbox/packbox.c \
|
||||
examples/paned/Makefile \
|
||||
examples/paned/paned.c \
|
||||
examples/pixmap/Makefile \
|
||||
examples/pixmap/pixmap.c \
|
||||
examples/progressbar/Makefile \
|
||||
examples/progressbar/progressbar.c \
|
||||
examples/radiobuttons/Makefile \
|
||||
|
||||
195
NEWS
195
NEWS
@@ -1,198 +1,3 @@
|
||||
Overview of Changes from GTK+ 2.90.7 to 2.91.0
|
||||
==============================================
|
||||
|
||||
* The rendering cleanup work has landed. This is a large change that
|
||||
affects many APIs.
|
||||
- All gtkstyle functions have been changed to take a cairo_t argument
|
||||
instead of a window + area.
|
||||
- GdkPixmap is gone. APIs that took pixmaps are being replaced by ones
|
||||
that take pixbufs or cairo surfaces, or regions (where pixmaps were
|
||||
used as masks). In background handling, pixmaps have been replaced
|
||||
by cairo patterns, see gdk_window_set_background_pattern().
|
||||
- GdkColormap is gone. It is replaced by visuals, see
|
||||
gtk_widget_set_visual().
|
||||
- The ::expose-event signal on GtkWidget has been replaced by a
|
||||
::draw signal.
|
||||
- gtk_widget_get_snapshot() has been removed. Instead, gtk_widget_draw()
|
||||
can render a widget onto an cairo_t.
|
||||
|
||||
* The GtkSizeRequest interface has been merged into GtkWidget, and
|
||||
GtkCellSizeRequest has been merged into GtkCellRenderer. The wrapper
|
||||
functions have been renamed to include 'preferred', e.g
|
||||
gtk_size_request_get_width() is now gtk_widget_get_preferred_width()
|
||||
and gtk_cell_size_request_get_width_for_height() is now
|
||||
gtk_cell_renderer_get_preferred_width_for_height().
|
||||
|
||||
* GtkObject has been removed. The ::destroy signal has been moved
|
||||
to GtkWidget. At the same time, GtkWidgetFlags have been removed,
|
||||
they already had getters and setters anyway.
|
||||
|
||||
* GtkWidget has gained generic alignment and padding properties:
|
||||
halign, valign, margin-left, margin-right, margin-top, margin-bottom
|
||||
These can be used instead of container-specific child properties or
|
||||
GtkMisc and GtkAlignment widgets.
|
||||
|
||||
* Container widgets can now let GTK+ handle border-width for them, using
|
||||
gtk_container_class_handle_border_width()
|
||||
|
||||
* The GtkEditableClass struct has been renamed to GtkEditableInterface
|
||||
|
||||
* Mouse wheel scrolling has been removed from GtkNotebook
|
||||
|
||||
* The default policy for scrolled windows has been changed to 'automatic'
|
||||
|
||||
* Global url hooks have been removed from GtkAboutDialog and GtkLinkButton
|
||||
|
||||
* The global window creation hook has been removed from GtkNotebook
|
||||
|
||||
* The error handling in GDK has been modernized and avoids synchronizing
|
||||
X requests as much as possible
|
||||
|
||||
* Fixed Bugs:
|
||||
323904 GtkEditable header is slightly incorrect
|
||||
339745 Return value of gtk_link_button_set_uri_hook not usable
|
||||
468672 GTK_POLICY_AUTOMATIC should be the default policy...
|
||||
486839 Filechooser 'Places' items should not move up and down...
|
||||
601731 Drag and Drop from Workspace to Activities Overview
|
||||
617316 Move documentation to inline comments: GtkEditable
|
||||
621590 Add length to gtk_tree_path_get_indices
|
||||
623664 Missing accessors for gtk_menu_get_position_func{,_data}
|
||||
628829 Chain get_width_for_height default impl to vfunc...
|
||||
629177 Do not use deprecated gtk_widget_get_child_requisition()
|
||||
629277 Hanging because do_syntheszie_crossing_event is called...
|
||||
629387 Use gint16 for GtkBorder
|
||||
629598 Do not use deprecated gtk_widget_size_request()
|
||||
629608 Revamp and modernize X error traps
|
||||
629733 There is a misprint in the description of the gtk_check_...
|
||||
629748 Fails to build without XComposite
|
||||
629785 Do not use deprecated gtk_cell_renderer_get_size()
|
||||
630033 Improve tests for X error traps, fix two bugs
|
||||
630226 Removing tab scrolling from GtkNotebook
|
||||
630520 Don't try to unref event->dnd.context unconditionally...
|
||||
630521 Remove some remaining API warts from tab dnd api
|
||||
630532 invalid drop point in drag-data-received callback
|
||||
|
||||
Updated translations:
|
||||
Catalan
|
||||
Czech
|
||||
Danish
|
||||
Dutch
|
||||
German
|
||||
Gujarati
|
||||
Japanese
|
||||
Simplified Chinese
|
||||
|
||||
|
||||
Overview of Changes from GTK+ 2.90.6 to 2.90.7
|
||||
==============================================
|
||||
|
||||
* Various deprecated APIs have been removed:
|
||||
- the GtkWidget::draw-border style property
|
||||
- the GtkEntry::state-hint style property
|
||||
- the GtkTreeView::row-ending-details style property
|
||||
- the GtkRange::trough-side-details style property
|
||||
- the GtkRange::stepper-position-details style property
|
||||
- the GtkRange::activate-slider style property
|
||||
- the GTK_CALENDAR_WEEK_START_MONDAY option
|
||||
- the GtkFrame::shadow and GtkHandleBox::shadow properties
|
||||
- the GtkTextView::page-horizontally signal
|
||||
- the GDK_WINDOW_DIALOG window type
|
||||
- the GTK_SELECTION_EXTENDED selection mode
|
||||
- the GtkProgressBarOrientation, GtkAnchorType and GtkVisibility
|
||||
enumerations
|
||||
- GtkDialog separators, including the GtkDialog::has-separator
|
||||
property, including setter/getter, the GTK_DIALOG_NO_SEPARATOR
|
||||
flag and the GtkMessageDialog::use-separator style property
|
||||
- gtk_status_icon_set/get_blinking
|
||||
- gdk_window_et_deskrelative_origin
|
||||
- The GtkItem class has been removed. Its functionality has
|
||||
been merged into is sole subclass, GtkMenuItem
|
||||
|
||||
* The GtkIconView::orientation property has been renamed
|
||||
to 'item-orientation'
|
||||
|
||||
* GtkProgressBar and GtkCellRendererProgress implement GtkOrientable
|
||||
now, and their 'orientation' property have been split into
|
||||
a 'orientation' property of type GtkOrientation and a boolean
|
||||
'inverted' property
|
||||
|
||||
* GDK no longer exports variables: gdk_threads_lock, gdk_threads_unlock,
|
||||
gdk_threads_mutex and gdk_display are no longer available
|
||||
|
||||
* GTK no longer exports variables: gtk_major_version, gtk_minor_version,
|
||||
gtk_micro_version, gtk_binary_age, gtk_interface_age have been
|
||||
converted to functions. gtk_debug_flags has a getter and a setter.
|
||||
Misc. variables that had been exported by the semi-private text
|
||||
API have been removed.
|
||||
|
||||
* All GDK keysym names have been changed from GDK_keysym to GDK_KEY_keysym;
|
||||
the previous names are still available in gdkkeysyms-compat.h.
|
||||
|
||||
* GtkWrapBox is a new container, which distributes its children
|
||||
over multiple rows/columns
|
||||
|
||||
* GTK+ now uses standard icon names when looking up stock icons
|
||||
|
||||
* More widgets and cell renderers have been converted to support
|
||||
width-for-height: GtkCellRendererText, GtkAccelLabel, GtkCellView,
|
||||
GtkComboBox, GtkMenu, GtkMenuItem
|
||||
|
||||
* Button boxes are now semi-homogeneous.
|
||||
|
||||
* The directfb backend has been removed
|
||||
|
||||
* Bugs fixed:
|
||||
77669 GtkWrapBox for gtk itself, not gimp?
|
||||
84188 "Dialogue" button widths should not be homogenous
|
||||
414712 gtk_container_set_focus_child leaks widget
|
||||
527499 FileFilter combo becames too wide
|
||||
528257 File selector and stock string problems
|
||||
605186 Use G_DEFINE_INTERFACE macro
|
||||
614006 File chooser crashes when creating a new folder...
|
||||
616401 Noneffective gdk_keymap_map_virtual_modifiers in early use
|
||||
626710 GailScaleButton calculates wrong value for minimum increment
|
||||
627028 Marked state of calendar day is not accessible
|
||||
627139 gtkfilechooserentry shows completion progress tooltip on first show
|
||||
627445 Removal of GtkWidget::draw-border breaks gtk_widget_queue_draw()
|
||||
627580 GtkFontSelection: don't notify the non-existent "font" property
|
||||
627643 gtkaboutdialog gettext problem
|
||||
627828 Drag and drop between treeviews in different window groups broken...
|
||||
627843 set_active_iter doc: remove restriction on path length
|
||||
627867 tests/testsocket is broken
|
||||
627912 misprint in the desc. of "hover-expand" and "hover-selection"...
|
||||
628160 introspection: Update to new scanner API
|
||||
628308 docs referencing non existing icons
|
||||
628656 _gdk_windowing_get_startup_notify_id memory leak
|
||||
628807 Add more "reserved for expansion" fields to GtkWidgetClass
|
||||
628808 Warn if a widget requests minimum size > natural size
|
||||
628884 Use a bitfield for Widget::private_flags, ::state, ::saved_state
|
||||
628935 add gtk_radio_button_join_group method for bindings
|
||||
629110 gtk_spinner_accessible_get_type always returns null
|
||||
|
||||
* Translation updates
|
||||
Arabic
|
||||
Armenian
|
||||
Brazilian Portuguese
|
||||
British English
|
||||
Bulgarian
|
||||
Danish
|
||||
Estonian
|
||||
French
|
||||
Galician
|
||||
Hebrew
|
||||
Hungarian
|
||||
Indonesian
|
||||
Kazakh
|
||||
Norwegian bokmål
|
||||
Norwegian Nynorsk
|
||||
Portuguese
|
||||
Serbian
|
||||
Slovenian
|
||||
Spanish
|
||||
Telugu
|
||||
Traditional Chinese
|
||||
|
||||
|
||||
Overview of Changes from GTK+ 2.90.5 to 2.90.6
|
||||
==============================================
|
||||
|
||||
|
||||
@@ -110,11 +110,10 @@ rm -rf autom4te.cache
|
||||
# regenerated from their corresponding *.in files by ./configure anyway.
|
||||
touch README INSTALL
|
||||
|
||||
gtkdocize || exit $?
|
||||
|
||||
$ACLOCAL -I m4 $ACLOCAL_FLAGS || exit $?
|
||||
|
||||
libtoolize --force || exit $?
|
||||
gtkdocize || exit $?
|
||||
|
||||
autoheader || exit $?
|
||||
|
||||
|
||||
98
configure.ac
98
configure.ac
@@ -11,8 +11,8 @@ AC_PREREQ([2.62])
|
||||
# set GTK_BINARY_AGE and GTK_INTERFACE_AGE to 0.
|
||||
|
||||
m4_define([gtk_major_version], [2])
|
||||
m4_define([gtk_minor_version], [91])
|
||||
m4_define([gtk_micro_version], [1])
|
||||
m4_define([gtk_minor_version], [90])
|
||||
m4_define([gtk_micro_version], [7])
|
||||
m4_define([gtk_interface_age], [0])
|
||||
m4_define([gtk_binary_age],
|
||||
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
|
||||
@@ -31,21 +31,11 @@ m4_define([gtk_api_version], [3.0])
|
||||
m4_define([gtk_binary_version], [3.0.0])
|
||||
|
||||
# required versions of other packages
|
||||
m4_define([glib_required_version], [2.27.0])
|
||||
m4_define([glib_required_version], [2.25.15])
|
||||
m4_define([pango_required_version], [1.20])
|
||||
m4_define([atk_required_version], [1.29.2])
|
||||
m4_define([cairo_required_version], [1.10.0])
|
||||
m4_define([cairo_required_version], [1.9.10])
|
||||
m4_define([gdk_pixbuf_required_version], [2.21.0])
|
||||
GLIB_REQUIRED_VERSION=glib_required_version
|
||||
PANGO_REQUIRED_VERSION=pango_required_version
|
||||
ATK_REQUIRED_VERSION=atk_required_version
|
||||
CAIRO_REQUIRED_VERSION=cairo_required_version
|
||||
GDK_PIXBUF_REQUIRED_VERSION=gdk_pixbuf_required_version
|
||||
AC_SUBST(GLIB_REQUIRED_VERSION)
|
||||
AC_SUBST(PANGO_REQUIRED_VERSION)
|
||||
AC_SUBST(ATK_REQUIRED_VERSION)
|
||||
AC_SUBST(CAIRO_REQUIRED_VERSION)
|
||||
AC_SUBST(GDK_PIXBUF_REQUIRED_VERSION)
|
||||
|
||||
|
||||
AC_INIT([gtk+], [gtk_version],
|
||||
@@ -237,6 +227,10 @@ AC_ARG_ENABLE(debug,
|
||||
AC_HELP_STRING([--enable-debug=@<:@no/minimum/yes@:>@],
|
||||
[turn on debugging @<:@default=debug_default@:>@]),,
|
||||
enable_debug=debug_default)
|
||||
AC_ARG_ENABLE(shm,
|
||||
[AC_HELP_STRING([--enable-shm],
|
||||
[support shared memory if available [default=yes]])],,
|
||||
[enable_shm="yes"])
|
||||
AC_ARG_ENABLE(xkb,
|
||||
[AC_HELP_STRING([--enable-xkb],
|
||||
[support XKB [default=maybe]])],,
|
||||
@@ -249,6 +243,10 @@ AC_ARG_ENABLE(rebuilds,
|
||||
[AC_HELP_STRING([--disable-rebuilds],
|
||||
[disable all source autogeneration rules])],,
|
||||
[enable_rebuilds=yes])
|
||||
AC_ARG_ENABLE(visibility,
|
||||
[AC_HELP_STRING([--disable-visibility],
|
||||
[do not use ELF visibility attributes])],,
|
||||
[enable_visibility=yes])
|
||||
|
||||
AC_ARG_WITH(xinput,
|
||||
[AC_HELP_STRING([--with-xinput=@<:@no/yes@:>@], [support XInput])])
|
||||
@@ -286,6 +284,11 @@ else
|
||||
fi
|
||||
|
||||
|
||||
if test "x$enable_visibility" = "xno"; then
|
||||
GTK_DEBUG_FLAGS="$GTK_DEBUG_FLAGS -DDISABLE_VISIBILITY"
|
||||
fi
|
||||
|
||||
|
||||
AC_DEFINE_UNQUOTED(GTK_COMPILED_WITH_DEBUGGING, "${enable_debug}",
|
||||
[Define if debugging is enabled])
|
||||
|
||||
@@ -362,7 +365,6 @@ PKG_CHECK_MODULES(BASE_DEPENDENCIES,
|
||||
atk >= atk_required_version dnl
|
||||
pango >= pango_required_version dnl
|
||||
cairo >= cairo_required_version dnl
|
||||
cairo-gobject >= cairo_required_version dnl
|
||||
gdk-pixbuf-2.0 >= gdk_pixbuf_required_version])
|
||||
|
||||
## In addition to checking that cairo is present, we also need to
|
||||
@@ -484,6 +486,18 @@ if test "$gtk_ok" = "yes"; then
|
||||
[Define if _NL_PAPER_WIDTH is available])
|
||||
fi
|
||||
|
||||
# sigsetjmp is a macro on some platforms, so AC_CHECK_FUNCS is not reliable
|
||||
AC_MSG_CHECKING(for sigsetjmp)
|
||||
AC_TRY_LINK([#include <setjmp.h>], [
|
||||
sigjmp_buf env;
|
||||
sigsetjmp(env, 0);
|
||||
], gtk_ok=yes, gtk_ok=no)
|
||||
AC_MSG_RESULT($gtk_ok)
|
||||
if test "$gtk_ok" = "yes"; then
|
||||
AC_DEFINE(HAVE_SIGSETJMP, 1,
|
||||
[Define to 1 if sigsetjmp is available])
|
||||
fi
|
||||
|
||||
# i18n stuff
|
||||
ALL_LINGUAS="`grep -v '^#' "$srcdir/po/LINGUAS" | tr '\n' ' '`"
|
||||
AM_GLIB_GNU_GETTEXT
|
||||
@@ -1036,6 +1050,54 @@ if test "x$gdktarget" = "xx11"; then
|
||||
|
||||
CFLAGS="$gtk_save_CFLAGS"
|
||||
|
||||
# Xshm checks
|
||||
|
||||
if test "x$enable_shm" = "xyes"; then
|
||||
# Check for the XShm extension, normally in Xext
|
||||
AC_CHECK_FUNC(XShmAttach,
|
||||
:,
|
||||
# On AIX, it is in XextSam instead
|
||||
[AC_CHECK_LIB(XextSam, XShmAttach,
|
||||
[GTK_ADD_LIB(x_extra_libs,XextSam)])])
|
||||
fi
|
||||
|
||||
if test "x$enable_shm" = "xyes"; then
|
||||
# Check for shared memory
|
||||
AC_CHECK_HEADER(sys/ipc.h,
|
||||
AC_DEFINE(HAVE_IPC_H, 1,
|
||||
[Define to 1 if ipc.h is available]),
|
||||
no_sys_ipc=yes)
|
||||
AC_CHECK_HEADER(sys/shm.h,
|
||||
AC_DEFINE(HAVE_SHM_H, 1,
|
||||
[Define to 1 if shm.h is available]),
|
||||
no_sys_shm=yes)
|
||||
|
||||
# Check for the X shared memory extension header file
|
||||
have_xshm=no
|
||||
AC_MSG_CHECKING(X11/extensions/XShm.h)
|
||||
if test "x$no_xext_lib" = "xyes"; then
|
||||
:
|
||||
else
|
||||
gtk_save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $x_cflags"
|
||||
AC_TRY_COMPILE([
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/ipc.h>
|
||||
#include <sys/shm.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/extensions/XShm.h>
|
||||
], [XShmSegmentInfo *x_shm_info;], have_xshm=yes)
|
||||
CFLAGS="$gtk_save_CFLAGS"
|
||||
fi
|
||||
AC_MSG_RESULT($have_xshm)
|
||||
if test $have_xshm = yes ; then
|
||||
AC_DEFINE(HAVE_XSHM_H, 1,
|
||||
[Define to 1 if xshm.h is available])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$enable_xinerama" = "xyes"; then
|
||||
# Check for Xinerama extension (Solaris impl or Xfree impl)
|
||||
gtk_save_cppflags="$CPPFLAGS"
|
||||
@@ -1277,7 +1339,7 @@ else
|
||||
LIBS="$gtk_save_LIBS"
|
||||
fi
|
||||
|
||||
GTK_PACKAGES="atk cairo cairo-gobject gdk-pixbuf-2.0 gio-2.0"
|
||||
GTK_PACKAGES="atk cairo gdk-pixbuf-2.0 gio-2.0"
|
||||
if test "x$gdktarget" = "xx11"; then
|
||||
GTK_PACKAGES="$GTK_PACKAGES pangoft2"
|
||||
fi
|
||||
@@ -1481,7 +1543,7 @@ fi
|
||||
# GObject introspection
|
||||
##################################################
|
||||
|
||||
GOBJECT_INTROSPECTION_CHECK([0.9.3])
|
||||
GOBJECT_INTROSPECTION_CHECK([0.9.0])
|
||||
|
||||
##################################################
|
||||
# Checks for gtk-doc and docbook-tools
|
||||
@@ -1684,4 +1746,4 @@ perf/Makefile
|
||||
AC_OUTPUT
|
||||
|
||||
echo "configuration:
|
||||
target: $gdktarget"
|
||||
target: $gdktarget"
|
||||
|
||||
@@ -67,6 +67,25 @@ activate_radio_action (GtkAction *action, GtkRadioAction *current)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
activate_email (GtkAboutDialog *about,
|
||||
const gchar *link,
|
||||
gpointer data)
|
||||
{
|
||||
gchar *text;
|
||||
text = g_strdup_printf ("send mail to %s", link);
|
||||
g_print ("%s\n", text);
|
||||
g_free (text);
|
||||
}
|
||||
|
||||
static void
|
||||
activate_url (GtkAboutDialog *about,
|
||||
const gchar *link,
|
||||
gpointer data)
|
||||
{
|
||||
g_print ("show url %s\n", link);
|
||||
}
|
||||
|
||||
static void
|
||||
about_cb (GtkAction *action,
|
||||
GtkWidget *window)
|
||||
@@ -101,13 +120,11 @@ about_cb (GtkAction *action,
|
||||
g_object_unref (pixbuf);
|
||||
}
|
||||
|
||||
gtk_about_dialog_set_email_hook (activate_email, NULL, NULL);
|
||||
gtk_about_dialog_set_url_hook (activate_url, NULL, NULL);
|
||||
gtk_show_about_dialog (GTK_WINDOW (window),
|
||||
"program-name", "GTK+ Code Demos",
|
||||
"version", g_strdup_printf ("%s,\nRunning against GTK+ %d.%d.%d",
|
||||
PACKAGE_VERSION,
|
||||
gtk_get_major_version (),
|
||||
gtk_get_minor_version (),
|
||||
gtk_get_micro_version ()),
|
||||
"version", PACKAGE_VERSION,
|
||||
"copyright", "(C) 1997-2009 The GTK+ Team",
|
||||
"license-type", GTK_LICENSE_LGPL_2_1,
|
||||
"website", "http://www.gtk.org",
|
||||
|
||||
@@ -585,7 +585,7 @@ destroy_info (ChangeDisplayInfo *info)
|
||||
}
|
||||
|
||||
static void
|
||||
destroy_cb (GObject *object,
|
||||
destroy_cb (GtkObject *object,
|
||||
ChangeDisplayInfo **info)
|
||||
{
|
||||
destroy_info (*info);
|
||||
@@ -610,7 +610,7 @@ do_changedisplay (GtkWidget *do_widget)
|
||||
|
||||
info->window = gtk_dialog_new_with_buttons ("Change Screen or display",
|
||||
GTK_WINDOW (do_widget),
|
||||
0,
|
||||
GTK_DIALOG_NO_SEPARATOR,
|
||||
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
|
||||
"Change", GTK_RESPONSE_OK,
|
||||
NULL);
|
||||
|
||||
@@ -15,16 +15,28 @@ static GtkWidget *frame;
|
||||
/* Expose callback for the drawing area
|
||||
*/
|
||||
static gboolean
|
||||
draw_callback (GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
gpointer data)
|
||||
expose_event_callback (GtkWidget *widget,
|
||||
GdkEventExpose *event,
|
||||
gpointer data)
|
||||
{
|
||||
GtkStyle *style;
|
||||
GdkWindow *window;
|
||||
|
||||
style = gtk_widget_get_style (widget);
|
||||
window = gtk_widget_get_window (widget);
|
||||
if (window)
|
||||
{
|
||||
GtkStyle *style;
|
||||
cairo_t *cr;
|
||||
|
||||
gdk_cairo_set_source_color (cr, &style->bg[GTK_STATE_NORMAL]);
|
||||
cairo_paint (cr);
|
||||
style = gtk_widget_get_style (widget);
|
||||
|
||||
cr = gdk_cairo_create (window);
|
||||
|
||||
gdk_cairo_set_source_color (cr, &style->bg[GTK_STATE_NORMAL]);
|
||||
gdk_cairo_rectangle (cr, &event->area);
|
||||
cairo_fill (cr);
|
||||
|
||||
cairo_destroy (cr);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -100,8 +112,8 @@ do_colorsel (GtkWidget *do_widget)
|
||||
|
||||
da = gtk_drawing_area_new ();
|
||||
|
||||
g_signal_connect (da, "draw",
|
||||
G_CALLBACK (draw_callback), NULL);
|
||||
g_signal_connect (da, "expose_event",
|
||||
G_CALLBACK (expose_event_callback), NULL);
|
||||
|
||||
/* set a minimum size */
|
||||
gtk_widget_set_size_request (da, 200, 200);
|
||||
|
||||
@@ -271,7 +271,7 @@ struct _MaskEntryClass
|
||||
};
|
||||
|
||||
|
||||
static void mask_entry_editable_init (GtkEditableInterface *iface);
|
||||
static void mask_entry_editable_init (GtkEditableClass *iface);
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (MaskEntry, mask_entry, GTK_TYPE_ENTRY,
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_EDITABLE,
|
||||
@@ -316,7 +316,7 @@ mask_entry_class_init (MaskEntryClass *klass)
|
||||
|
||||
|
||||
static void
|
||||
mask_entry_editable_init (GtkEditableInterface *iface)
|
||||
mask_entry_editable_init (GtkEditableClass *iface)
|
||||
{
|
||||
iface->changed = mask_entry_changed;
|
||||
}
|
||||
|
||||
@@ -51,12 +51,19 @@ scribble_configure_event (GtkWidget *widget,
|
||||
|
||||
/* Redraw the screen from the surface */
|
||||
static gboolean
|
||||
scribble_draw (GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
gpointer data)
|
||||
scribble_expose_event (GtkWidget *widget,
|
||||
GdkEventExpose *event,
|
||||
gpointer data)
|
||||
{
|
||||
cairo_t *cr;
|
||||
|
||||
cr = gdk_cairo_create (gtk_widget_get_window (widget));
|
||||
|
||||
cairo_set_source_surface (cr, surface, 0, 0);
|
||||
cairo_paint (cr);
|
||||
gdk_cairo_rectangle (cr, &event->area);
|
||||
cairo_fill (cr);
|
||||
|
||||
cairo_destroy (cr);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -137,38 +144,45 @@ scribble_motion_notify_event (GtkWidget *widget,
|
||||
|
||||
|
||||
static gboolean
|
||||
checkerboard_draw (GtkWidget *da,
|
||||
cairo_t *cr,
|
||||
gpointer data)
|
||||
checkerboard_expose (GtkWidget *da,
|
||||
GdkEventExpose *event,
|
||||
gpointer data)
|
||||
{
|
||||
gint i, j, xcount, ycount, width, height;
|
||||
GtkAllocation allocation;
|
||||
gint i, j, xcount, ycount;
|
||||
cairo_t *cr;
|
||||
|
||||
#define CHECK_SIZE 10
|
||||
#define SPACING 2
|
||||
|
||||
/* At the start of a draw handler, a clip region has been set on
|
||||
* the Cairo context, and the contents have been cleared to the
|
||||
/* At the start of an expose handler, a clip region of event->area
|
||||
* is set on the window, and event->area has been cleared to the
|
||||
* widget's background color. The docs for
|
||||
* gdk_window_begin_paint_region() give more details on how this
|
||||
* works.
|
||||
*/
|
||||
|
||||
cr = gdk_cairo_create (gtk_widget_get_window (da));
|
||||
gdk_cairo_rectangle (cr, &event->area);
|
||||
cairo_clip (cr);
|
||||
|
||||
gtk_widget_get_allocation (da, &allocation);
|
||||
xcount = 0;
|
||||
width = gtk_widget_get_allocated_width (da);
|
||||
height = gtk_widget_get_allocated_height (da);
|
||||
i = SPACING;
|
||||
while (i < width)
|
||||
while (i < allocation.width)
|
||||
{
|
||||
j = SPACING;
|
||||
ycount = xcount % 2; /* start with even/odd depending on row */
|
||||
while (j < height)
|
||||
while (j < allocation.height)
|
||||
{
|
||||
if (ycount % 2)
|
||||
cairo_set_source_rgb (cr, 0.45777, 0, 0.45777);
|
||||
else
|
||||
cairo_set_source_rgb (cr, 1, 1, 1);
|
||||
|
||||
/* If we're outside the clip, this will do nothing.
|
||||
/* If we're outside event->area, this will do nothing.
|
||||
* It might be mildly more efficient if we handled
|
||||
* the clipping ourselves, but again we're feeling lazy.
|
||||
*/
|
||||
cairo_rectangle (cr, i, j, CHECK_SIZE, CHECK_SIZE);
|
||||
cairo_fill (cr);
|
||||
@@ -181,6 +195,8 @@ checkerboard_draw (GtkWidget *da,
|
||||
++xcount;
|
||||
}
|
||||
|
||||
cairo_destroy (cr);
|
||||
|
||||
/* return TRUE because we've handled this event, so no
|
||||
* further processing is required.
|
||||
*/
|
||||
@@ -239,8 +255,8 @@ do_drawingarea (GtkWidget *do_widget)
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (frame), da);
|
||||
|
||||
g_signal_connect (da, "draw",
|
||||
G_CALLBACK (checkerboard_draw), NULL);
|
||||
g_signal_connect (da, "expose-event",
|
||||
G_CALLBACK (checkerboard_expose), NULL);
|
||||
|
||||
/*
|
||||
* Create the scribble area
|
||||
@@ -263,8 +279,8 @@ do_drawingarea (GtkWidget *do_widget)
|
||||
|
||||
/* Signals used to handle backing surface */
|
||||
|
||||
g_signal_connect (da, "draw",
|
||||
G_CALLBACK (scribble_draw), NULL);
|
||||
g_signal_connect (da, "expose-event",
|
||||
G_CALLBACK (scribble_expose_event), NULL);
|
||||
g_signal_connect (da,"configure-event",
|
||||
G_CALLBACK (scribble_configure_event), NULL);
|
||||
|
||||
|
||||
@@ -113,8 +113,8 @@ key_press_event (GtkWidget *text_view,
|
||||
|
||||
switch (event->keyval)
|
||||
{
|
||||
case GDK_KEY_Return:
|
||||
case GDK_KEY_KP_Enter:
|
||||
case GDK_Return:
|
||||
case GDK_KP_Enter:
|
||||
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view));
|
||||
gtk_text_buffer_get_iter_at_mark (buffer, &iter,
|
||||
gtk_text_buffer_get_insert (buffer));
|
||||
|
||||
@@ -120,8 +120,8 @@ do_iconview_edit (GtkWidget *do_widget)
|
||||
|
||||
gtk_icon_view_set_selection_mode (GTK_ICON_VIEW (icon_view),
|
||||
GTK_SELECTION_SINGLE);
|
||||
gtk_icon_view_set_item_orientation (GTK_ICON_VIEW (icon_view),
|
||||
GTK_ORIENTATION_HORIZONTAL);
|
||||
gtk_icon_view_set_orientation (GTK_ICON_VIEW (icon_view),
|
||||
GTK_ORIENTATION_HORIZONTAL);
|
||||
gtk_icon_view_set_columns (GTK_ICON_VIEW (icon_view), 2);
|
||||
gtk_icon_view_set_reorderable (GTK_ICON_VIEW (icon_view), TRUE);
|
||||
|
||||
|
||||
@@ -261,7 +261,7 @@ start_progressive_loading (GtkWidget *image)
|
||||
}
|
||||
|
||||
static void
|
||||
cleanup_callback (GObject *object,
|
||||
cleanup_callback (GtkObject *object,
|
||||
gpointer data)
|
||||
{
|
||||
if (load_timeout)
|
||||
|
||||
@@ -223,6 +223,7 @@ static gchar *types[] =
|
||||
"FALSE",
|
||||
"TRUE",
|
||||
"FILE ",
|
||||
"GtkObject ",
|
||||
"GtkColorSelection ",
|
||||
"GtkWidget ",
|
||||
"GtkButton ",
|
||||
@@ -278,7 +279,7 @@ static gchar *types[] =
|
||||
"GtkTreeStore ",
|
||||
"GtkEntry ",
|
||||
"GtkEditable ",
|
||||
"GtkEditableInterface ",
|
||||
"GtkEditableClass ",
|
||||
"GdkPixmap ",
|
||||
"GdkEventConfigure ",
|
||||
"GdkEventMotion ",
|
||||
|
||||
@@ -45,8 +45,8 @@ static void gtk_rotated_bin_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation);
|
||||
static gboolean gtk_rotated_bin_damage (GtkWidget *widget,
|
||||
GdkEventExpose *event);
|
||||
static gboolean gtk_rotated_bin_draw (GtkWidget *widget,
|
||||
cairo_t *cr);
|
||||
static gboolean gtk_rotated_bin_expose (GtkWidget *widget,
|
||||
GdkEventExpose *offscreen);
|
||||
|
||||
static void gtk_rotated_bin_add (GtkContainer *container,
|
||||
GtkWidget *child);
|
||||
@@ -150,7 +150,7 @@ gtk_rotated_bin_class_init (GtkRotatedBinClass *klass)
|
||||
widget_class->unrealize = gtk_rotated_bin_unrealize;
|
||||
widget_class->size_request = gtk_rotated_bin_size_request;
|
||||
widget_class->size_allocate = gtk_rotated_bin_size_allocate;
|
||||
widget_class->draw = gtk_rotated_bin_draw;
|
||||
widget_class->expose_event = gtk_rotated_bin_expose;
|
||||
|
||||
g_signal_override_class_closure (g_signal_lookup ("damage-event", GTK_TYPE_WIDGET),
|
||||
GTK_TYPE_ROTATED_BIN,
|
||||
@@ -252,9 +252,10 @@ gtk_rotated_bin_realize (GtkWidget *widget)
|
||||
| GDK_LEAVE_NOTIFY_MASK;
|
||||
|
||||
attributes.visual = gtk_widget_get_visual (widget);
|
||||
attributes.colormap = gtk_widget_get_colormap (widget);
|
||||
attributes.wclass = GDK_INPUT_OUTPUT;
|
||||
|
||||
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
|
||||
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
|
||||
|
||||
window = gdk_window_new (gtk_widget_get_parent_window (widget),
|
||||
&attributes, attributes_mask);
|
||||
@@ -391,8 +392,7 @@ gtk_rotated_bin_size_request (GtkWidget *widget,
|
||||
child_requisition.height = 0;
|
||||
|
||||
if (bin->child && gtk_widget_get_visible (bin->child))
|
||||
gtk_widget_get_preferred_size ( (bin->child),
|
||||
&child_requisition, NULL);
|
||||
gtk_widget_size_request (bin->child, &child_requisition);
|
||||
|
||||
s = sin (bin->angle);
|
||||
c = cos (bin->angle);
|
||||
@@ -434,8 +434,7 @@ gtk_rotated_bin_size_allocate (GtkWidget *widget,
|
||||
s = sin (bin->angle);
|
||||
c = cos (bin->angle);
|
||||
|
||||
gtk_widget_get_preferred_size (bin->child,
|
||||
&child_requisition, NULL);
|
||||
gtk_widget_get_child_requisition (bin->child, &child_requisition);
|
||||
child_allocation.x = 0;
|
||||
child_allocation.y = 0;
|
||||
child_allocation.height = child_requisition.height;
|
||||
@@ -470,60 +469,65 @@ gtk_rotated_bin_damage (GtkWidget *widget,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_rotated_bin_draw (GtkWidget *widget,
|
||||
cairo_t *cr)
|
||||
gtk_rotated_bin_expose (GtkWidget *widget,
|
||||
GdkEventExpose *event)
|
||||
{
|
||||
GtkRotatedBin *bin = GTK_ROTATED_BIN (widget);
|
||||
GdkWindow *window;
|
||||
gint width, height;
|
||||
gdouble s, c;
|
||||
gdouble w, h;
|
||||
|
||||
window = gtk_widget_get_window (widget);
|
||||
if (gtk_cairo_should_draw_window (cr, window))
|
||||
if (gtk_widget_is_drawable (widget))
|
||||
{
|
||||
cairo_surface_t *surface;
|
||||
GtkAllocation child_area;
|
||||
|
||||
if (bin->child && gtk_widget_get_visible (bin->child))
|
||||
window = gtk_widget_get_window (widget);
|
||||
if (event->window == window)
|
||||
{
|
||||
surface = gdk_offscreen_window_get_surface (bin->offscreen_window);
|
||||
gtk_widget_get_allocation (bin->child, &child_area);
|
||||
GdkPixmap *pixmap;
|
||||
GtkAllocation child_area;
|
||||
cairo_t *cr;
|
||||
|
||||
/* transform */
|
||||
s = sin (bin->angle);
|
||||
c = cos (bin->angle);
|
||||
w = c * child_area.width + s * child_area.height;
|
||||
h = s * child_area.width + c * child_area.height;
|
||||
if (bin->child && gtk_widget_get_visible (bin->child))
|
||||
{
|
||||
pixmap = gdk_offscreen_window_get_pixmap (bin->offscreen_window);
|
||||
gtk_widget_get_allocation (bin->child, &child_area);
|
||||
|
||||
cairo_translate (cr, (w - child_area.width) / 2, (h - child_area.height) / 2);
|
||||
cairo_translate (cr, child_area.width / 2, child_area.height / 2);
|
||||
cairo_rotate (cr, bin->angle);
|
||||
cairo_translate (cr, -child_area.width / 2, -child_area.height / 2);
|
||||
cr = gdk_cairo_create (window);
|
||||
|
||||
/* clip */
|
||||
cairo_rectangle (cr,
|
||||
0, 0,
|
||||
gdk_window_get_width (bin->offscreen_window),
|
||||
gdk_window_get_height (bin->offscreen_window));
|
||||
cairo_clip (cr);
|
||||
/* paint */
|
||||
cairo_set_source_surface (cr, surface, 0, 0);
|
||||
cairo_paint (cr);
|
||||
/* transform */
|
||||
s = sin (bin->angle);
|
||||
c = cos (bin->angle);
|
||||
w = c * child_area.width + s * child_area.height;
|
||||
h = s * child_area.width + c * child_area.height;
|
||||
|
||||
cairo_translate (cr, (w - child_area.width) / 2, (h - child_area.height) / 2);
|
||||
cairo_translate (cr, child_area.width / 2, child_area.height / 2);
|
||||
cairo_rotate (cr, bin->angle);
|
||||
cairo_translate (cr, -child_area.width / 2, -child_area.height / 2);
|
||||
|
||||
/* clip */
|
||||
gdk_drawable_get_size (pixmap, &width, &height);
|
||||
cairo_rectangle (cr, 0, 0, width, height);
|
||||
cairo_clip (cr);
|
||||
/* paint */
|
||||
gdk_cairo_set_source_pixmap (cr, pixmap, 0, 0);
|
||||
cairo_paint (cr);
|
||||
|
||||
cairo_destroy (cr);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (gtk_cairo_should_draw_window (cr, bin->offscreen_window))
|
||||
{
|
||||
gtk_paint_flat_box (gtk_widget_get_style (widget), cr,
|
||||
GTK_STATE_NORMAL, GTK_SHADOW_NONE,
|
||||
widget, "blah",
|
||||
0, 0,
|
||||
gdk_window_get_width (bin->offscreen_window),
|
||||
gdk_window_get_height (bin->offscreen_window));
|
||||
else if (event->window == bin->offscreen_window)
|
||||
{
|
||||
gtk_paint_flat_box (gtk_widget_get_style (widget), event->window,
|
||||
GTK_STATE_NORMAL, GTK_SHADOW_NONE,
|
||||
&event->area, widget, "blah",
|
||||
0, 0, -1, -1);
|
||||
|
||||
if (bin->child)
|
||||
gtk_container_propagate_draw (GTK_CONTAINER (widget),
|
||||
bin->child,
|
||||
cr);
|
||||
if (bin->child)
|
||||
gtk_container_propagate_expose (GTK_CONTAINER (widget),
|
||||
bin->child,
|
||||
event);
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
|
||||
@@ -41,8 +41,8 @@ static void gtk_mirror_bin_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation);
|
||||
static gboolean gtk_mirror_bin_damage (GtkWidget *widget,
|
||||
GdkEventExpose *event);
|
||||
static gboolean gtk_mirror_bin_draw (GtkWidget *widget,
|
||||
cairo_t *cr);
|
||||
static gboolean gtk_mirror_bin_expose (GtkWidget *widget,
|
||||
GdkEventExpose *offscreen);
|
||||
|
||||
static void gtk_mirror_bin_add (GtkContainer *container,
|
||||
GtkWidget *child);
|
||||
@@ -88,7 +88,7 @@ gtk_mirror_bin_class_init (GtkMirrorBinClass *klass)
|
||||
widget_class->unrealize = gtk_mirror_bin_unrealize;
|
||||
widget_class->size_request = gtk_mirror_bin_size_request;
|
||||
widget_class->size_allocate = gtk_mirror_bin_size_allocate;
|
||||
widget_class->draw = gtk_mirror_bin_draw;
|
||||
widget_class->expose_event = gtk_mirror_bin_expose;
|
||||
|
||||
g_signal_override_class_closure (g_signal_lookup ("damage-event", GTK_TYPE_WIDGET),
|
||||
GTK_TYPE_MIRROR_BIN,
|
||||
@@ -190,9 +190,10 @@ gtk_mirror_bin_realize (GtkWidget *widget)
|
||||
| GDK_LEAVE_NOTIFY_MASK;
|
||||
|
||||
attributes.visual = gtk_widget_get_visual (widget);
|
||||
attributes.colormap = gtk_widget_get_colormap (widget);
|
||||
attributes.wclass = GDK_INPUT_OUTPUT;
|
||||
|
||||
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
|
||||
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
|
||||
|
||||
window = gdk_window_new (gtk_widget_get_parent_window (widget),
|
||||
&attributes, attributes_mask);
|
||||
@@ -315,8 +316,7 @@ gtk_mirror_bin_size_request (GtkWidget *widget,
|
||||
child_requisition.height = 0;
|
||||
|
||||
if (bin->child && gtk_widget_get_visible (bin->child))
|
||||
gtk_widget_get_preferred_size ( (bin->child),
|
||||
&child_requisition, NULL);
|
||||
gtk_widget_size_request (bin->child, &child_requisition);
|
||||
|
||||
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
|
||||
requisition->width = border_width * 2 + child_requisition.width + 10;
|
||||
@@ -349,8 +349,7 @@ gtk_mirror_bin_size_allocate (GtkWidget *widget,
|
||||
GtkRequisition child_requisition;
|
||||
GtkAllocation child_allocation;
|
||||
|
||||
gtk_widget_get_preferred_size (bin->child,
|
||||
&child_requisition, NULL);
|
||||
gtk_widget_get_child_requisition (bin->child, &child_requisition);
|
||||
child_allocation.x = 0;
|
||||
child_allocation.y = 0;
|
||||
child_allocation.height = child_requisition.height;
|
||||
@@ -376,63 +375,78 @@ gtk_mirror_bin_damage (GtkWidget *widget,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_mirror_bin_draw (GtkWidget *widget,
|
||||
cairo_t *cr)
|
||||
gtk_mirror_bin_expose (GtkWidget *widget,
|
||||
GdkEventExpose *event)
|
||||
{
|
||||
GtkMirrorBin *bin = GTK_MIRROR_BIN (widget);
|
||||
GdkWindow *window;
|
||||
gint width, height;
|
||||
|
||||
window = gtk_widget_get_window (widget);
|
||||
if (gtk_cairo_should_draw_window (cr, window))
|
||||
if (gtk_widget_is_drawable (widget))
|
||||
{
|
||||
cairo_surface_t *surface;
|
||||
cairo_matrix_t matrix;
|
||||
cairo_pattern_t *mask;
|
||||
int height;
|
||||
|
||||
if (bin->child && gtk_widget_get_visible (bin->child))
|
||||
window = gtk_widget_get_window (widget);
|
||||
if (event->window == window)
|
||||
{
|
||||
surface = gdk_offscreen_window_get_surface (bin->offscreen_window);
|
||||
height = gdk_window_get_height (bin->offscreen_window);
|
||||
GdkPixmap *pixmap;
|
||||
cairo_t *cr;
|
||||
cairo_matrix_t matrix;
|
||||
cairo_pattern_t *mask;
|
||||
|
||||
/* paint the offscreen child */
|
||||
cairo_set_source_surface (cr, surface, 0, 0);
|
||||
cairo_paint (cr);
|
||||
if (bin->child && gtk_widget_get_visible (bin->child))
|
||||
{
|
||||
pixmap = gdk_offscreen_window_get_pixmap (bin->offscreen_window);
|
||||
gdk_drawable_get_size (pixmap, &width, &height);
|
||||
|
||||
cairo_matrix_init (&matrix, 1.0, 0.0, 0.3, 1.0, 0.0, 0.0);
|
||||
cairo_matrix_scale (&matrix, 1.0, -1.0);
|
||||
cairo_matrix_translate (&matrix, -10, - 3 * height - 10);
|
||||
cairo_transform (cr, &matrix);
|
||||
cr = gdk_cairo_create (window);
|
||||
|
||||
cairo_set_source_surface (cr, surface, 0, height);
|
||||
cairo_save (cr);
|
||||
|
||||
/* create linear gradient as mask-pattern to fade out the source */
|
||||
mask = cairo_pattern_create_linear (0.0, height, 0.0, 2*height);
|
||||
cairo_pattern_add_color_stop_rgba (mask, 0.0, 0.0, 0.0, 0.0, 0.0);
|
||||
cairo_pattern_add_color_stop_rgba (mask, 0.25, 0.0, 0.0, 0.0, 0.01);
|
||||
cairo_pattern_add_color_stop_rgba (mask, 0.5, 0.0, 0.0, 0.0, 0.25);
|
||||
cairo_pattern_add_color_stop_rgba (mask, 0.75, 0.0, 0.0, 0.0, 0.5);
|
||||
cairo_pattern_add_color_stop_rgba (mask, 1.0, 0.0, 0.0, 0.0, 1.0);
|
||||
cairo_rectangle (cr, 0, 0, width, height);
|
||||
cairo_clip (cr);
|
||||
|
||||
/* paint the reflection */
|
||||
cairo_mask (cr, mask);
|
||||
/* paint the offscreen child */
|
||||
gdk_cairo_set_source_pixmap (cr, pixmap, 0, 0);
|
||||
cairo_paint (cr);
|
||||
|
||||
cairo_pattern_destroy (mask);
|
||||
cairo_restore (cr);
|
||||
|
||||
cairo_matrix_init (&matrix, 1.0, 0.0, 0.3, 1.0, 0.0, 0.0);
|
||||
cairo_matrix_scale (&matrix, 1.0, -1.0);
|
||||
cairo_matrix_translate (&matrix, -10, - 3 * height - 10);
|
||||
cairo_transform (cr, &matrix);
|
||||
|
||||
cairo_rectangle (cr, 0, height, width, height);
|
||||
cairo_clip (cr);
|
||||
|
||||
gdk_cairo_set_source_pixmap (cr, pixmap, 0, height);
|
||||
|
||||
/* create linear gradient as mask-pattern to fade out the source */
|
||||
mask = cairo_pattern_create_linear (0.0, height, 0.0, 2*height);
|
||||
cairo_pattern_add_color_stop_rgba (mask, 0.0, 0.0, 0.0, 0.0, 0.0);
|
||||
cairo_pattern_add_color_stop_rgba (mask, 0.25, 0.0, 0.0, 0.0, 0.01);
|
||||
cairo_pattern_add_color_stop_rgba (mask, 0.5, 0.0, 0.0, 0.0, 0.25);
|
||||
cairo_pattern_add_color_stop_rgba (mask, 0.75, 0.0, 0.0, 0.0, 0.5);
|
||||
cairo_pattern_add_color_stop_rgba (mask, 1.0, 0.0, 0.0, 0.0, 1.0);
|
||||
|
||||
/* paint the reflection */
|
||||
cairo_mask (cr, mask);
|
||||
|
||||
cairo_pattern_destroy (mask);
|
||||
cairo_destroy (cr);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (gtk_cairo_should_draw_window (cr, bin->offscreen_window))
|
||||
{
|
||||
gtk_paint_flat_box (gtk_widget_get_style (widget), cr,
|
||||
GTK_STATE_NORMAL, GTK_SHADOW_NONE,
|
||||
widget, "blah",
|
||||
0, 0,
|
||||
gdk_window_get_width (bin->offscreen_window),
|
||||
gdk_window_get_height (bin->offscreen_window));
|
||||
else if (event->window == bin->offscreen_window)
|
||||
{
|
||||
gtk_paint_flat_box (gtk_widget_get_style (widget), event->window,
|
||||
GTK_STATE_NORMAL, GTK_SHADOW_NONE,
|
||||
&event->area, widget, "blah",
|
||||
0, 0, -1, -1);
|
||||
|
||||
if (bin->child)
|
||||
gtk_container_propagate_draw (GTK_CONTAINER (widget),
|
||||
bin->child,
|
||||
cr);
|
||||
if (bin->child)
|
||||
gtk_container_propagate_expose (GTK_CONTAINER (widget),
|
||||
bin->child,
|
||||
event);
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
|
||||
@@ -96,12 +96,19 @@ load_pixbufs (GError **error)
|
||||
|
||||
/* Expose callback for the drawing area */
|
||||
static gint
|
||||
draw_cb (GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
gpointer data)
|
||||
expose_cb (GtkWidget *widget,
|
||||
GdkEventExpose *event,
|
||||
gpointer data)
|
||||
{
|
||||
cairo_t *cr;
|
||||
|
||||
cr = gdk_cairo_create (event->window);
|
||||
|
||||
gdk_cairo_set_source_pixbuf (cr, frame, 0, 0);
|
||||
cairo_paint (cr);
|
||||
gdk_cairo_rectangle (cr, &event->area);
|
||||
cairo_fill (cr);
|
||||
|
||||
cairo_destroy (cr);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -186,7 +193,7 @@ timeout (gpointer data)
|
||||
static guint timeout_id;
|
||||
|
||||
static void
|
||||
cleanup_callback (GObject *object,
|
||||
cleanup_callback (GtkObject *object,
|
||||
gpointer data)
|
||||
{
|
||||
g_source_remove (timeout_id);
|
||||
@@ -239,8 +246,8 @@ do_pixbufs (GtkWidget *do_widget)
|
||||
|
||||
da = gtk_drawing_area_new ();
|
||||
|
||||
g_signal_connect (da, "draw",
|
||||
G_CALLBACK (draw_cb), NULL);
|
||||
g_signal_connect (da, "expose-event",
|
||||
G_CALLBACK (expose_cb), NULL);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (window), da);
|
||||
|
||||
|
||||
@@ -91,32 +91,39 @@ create_fancy_attr_list_for_layout (PangoLayout *layout)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
rotated_text_draw (GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
gpointer data)
|
||||
rotated_text_expose_event (GtkWidget *widget,
|
||||
GdkEventExpose *event,
|
||||
gpointer data)
|
||||
{
|
||||
#define RADIUS 150
|
||||
#define N_WORDS 5
|
||||
#define FONT "Serif 18"
|
||||
|
||||
GtkAllocation allocation;
|
||||
|
||||
PangoContext *context;
|
||||
PangoLayout *layout;
|
||||
PangoFontDescription *desc;
|
||||
|
||||
cairo_t *cr;
|
||||
cairo_pattern_t *pattern;
|
||||
|
||||
PangoAttrList *attrs;
|
||||
|
||||
int width;
|
||||
int height;
|
||||
double device_radius;
|
||||
int width, height;
|
||||
int i;
|
||||
|
||||
gtk_widget_get_allocation (widget, &allocation);
|
||||
width = allocation.width;
|
||||
height = allocation.height;
|
||||
|
||||
/* Create a cairo context and set up a transformation matrix so that the user
|
||||
* space coordinates for the centered square where we draw are [-RADIUS, RADIUS],
|
||||
* [-RADIUS, RADIUS].
|
||||
* We first center, then change the scale. */
|
||||
width = gtk_widget_get_allocated_width (widget);
|
||||
height = gtk_widget_get_allocated_height (widget);
|
||||
cr = gdk_cairo_create (gtk_widget_get_window (widget));
|
||||
device_radius = MIN (width, height) / 2.;
|
||||
cairo_translate (cr,
|
||||
device_radius + (width - 2 * device_radius) / 2,
|
||||
@@ -166,6 +173,7 @@ rotated_text_draw (GtkWidget *widget,
|
||||
g_object_unref (layout);
|
||||
g_object_unref (context);
|
||||
cairo_pattern_destroy (pattern);
|
||||
cairo_destroy (cr);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -201,8 +209,8 @@ do_rotated_text (GtkWidget *do_widget)
|
||||
/* This overrides the background color from the theme */
|
||||
gtk_widget_modify_bg (drawing_area, GTK_STATE_NORMAL, &white);
|
||||
|
||||
g_signal_connect (drawing_area, "draw",
|
||||
G_CALLBACK (rotated_text_draw), NULL);
|
||||
g_signal_connect (drawing_area, "expose-event",
|
||||
G_CALLBACK (rotated_text_expose_event), NULL);
|
||||
|
||||
/* And a label */
|
||||
|
||||
|
||||
@@ -81,13 +81,22 @@ canvas_item_draw (const CanvasItem *item,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
canvas_draw (GtkWidget *widget,
|
||||
cairo_t *cr)
|
||||
canvas_expose_event (GtkWidget *widget,
|
||||
GdkEventExpose *event)
|
||||
{
|
||||
GtkAllocation allocation;
|
||||
cairo_t *cr;
|
||||
GList *iter;
|
||||
|
||||
cr = gdk_cairo_create (gtk_widget_get_window (widget));
|
||||
gdk_cairo_region (cr, event->region);
|
||||
cairo_clip (cr);
|
||||
|
||||
gtk_widget_get_allocation (widget, &allocation);
|
||||
|
||||
cairo_set_source_rgb (cr, 1, 1, 1);
|
||||
cairo_paint (cr);
|
||||
cairo_rectangle (cr, 0, 0, allocation.width, allocation.height);
|
||||
cairo_fill (cr);
|
||||
|
||||
for (iter = canvas_items; iter; iter = iter->next)
|
||||
canvas_item_draw (iter->data, cr, FALSE);
|
||||
@@ -95,6 +104,8 @@ canvas_draw (GtkWidget *widget,
|
||||
if (drop_item)
|
||||
canvas_item_draw (drop_item, cr, TRUE);
|
||||
|
||||
cairo_destroy (cr);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -561,7 +572,7 @@ do_toolpalette (GtkWidget *do_widget)
|
||||
gtk_widget_set_app_paintable (contents, TRUE);
|
||||
|
||||
g_object_connect (contents,
|
||||
"signal::draw", canvas_draw, NULL,
|
||||
"signal::expose-event", canvas_expose_event, NULL,
|
||||
"signal::drag-data-received", passive_canvas_drag_data_received, NULL,
|
||||
NULL);
|
||||
|
||||
@@ -589,7 +600,7 @@ do_toolpalette (GtkWidget *do_widget)
|
||||
gtk_widget_set_app_paintable (contents, TRUE);
|
||||
|
||||
g_object_connect (contents,
|
||||
"signal::draw", canvas_draw, NULL,
|
||||
"signal::expose-event", canvas_expose_event, NULL,
|
||||
"signal::drag-motion", interactive_canvas_drag_motion, NULL,
|
||||
"signal::drag-data-received", interactive_canvas_drag_data_received, NULL,
|
||||
"signal::drag-leave", interactive_canvas_drag_leave, NULL,
|
||||
|
||||
@@ -86,11 +86,17 @@ load_pixbufs (void)
|
||||
}
|
||||
|
||||
/* Expose callback for the drawing area */
|
||||
static gboolean
|
||||
draw_cb (GtkWidget *widget, cairo_t *cr, gpointer data)
|
||||
static gint
|
||||
expose_cb (GtkWidget *widget, GdkEventExpose *event, gpointer data)
|
||||
{
|
||||
cairo_t *cr;
|
||||
|
||||
cr = gdk_cairo_create (event->window);
|
||||
gdk_cairo_set_source_pixbuf (cr, frame, 0, 0);
|
||||
cairo_paint (cr);
|
||||
gdk_cairo_rectangle (cr, &event->area);
|
||||
cairo_fill (cr);
|
||||
|
||||
cairo_destroy (cr);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -173,7 +179,7 @@ static guint timeout_id;
|
||||
|
||||
/* Destroy handler for the window */
|
||||
static void
|
||||
destroy_cb (GObject *object, gpointer data)
|
||||
destroy_cb (GtkObject *object, gpointer data)
|
||||
{
|
||||
g_source_remove (timeout_id);
|
||||
timeout_id = 0;
|
||||
@@ -208,8 +214,8 @@ main (int argc, char **argv)
|
||||
|
||||
da = gtk_drawing_area_new ();
|
||||
|
||||
g_signal_connect (da, "draw",
|
||||
G_CALLBACK (draw_cb), NULL);
|
||||
g_signal_connect (da, "expose_event",
|
||||
G_CALLBACK (expose_cb), NULL);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (window), da);
|
||||
|
||||
|
||||
@@ -369,16 +369,16 @@ main (int argc, char **argv)
|
||||
gtk_label_new ("Source"));
|
||||
|
||||
tag = gtk_text_buffer_create_tag (info_buffer, "title");
|
||||
g_object_set (tag,
|
||||
"font", "Sans 18",
|
||||
NULL);
|
||||
gtk_object_set (GTK_OBJECT (tag),
|
||||
"font", "Sans 18",
|
||||
NULL);
|
||||
|
||||
tag = gtk_text_buffer_create_tag (info_buffer, "source");
|
||||
g_object_set (tag,
|
||||
"font", "Courier 10",
|
||||
"pixels_above_lines", 0,
|
||||
"pixels_below_lines", 0,
|
||||
NULL);
|
||||
gtk_object_set (GTK_OBJECT (tag),
|
||||
"font", "Courier 10",
|
||||
"pixels_above_lines", 0,
|
||||
"pixels_below_lines", 0,
|
||||
NULL);
|
||||
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 600, 400);
|
||||
gtk_widget_show_all (window);
|
||||
|
||||
@@ -112,8 +112,8 @@ main (int argc, char **argv)
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
root = gdk_get_default_root_window ();
|
||||
pixbuf = gdk_pixbuf_get_from_window (root,
|
||||
0, 0, 150, 160);
|
||||
pixbuf = gdk_pixbuf_get_from_drawable (NULL, root, NULL,
|
||||
0, 0, 0, 0, 150, 160);
|
||||
|
||||
/* PASS */
|
||||
g_debug ("try to save PNG with a profile");
|
||||
|
||||
@@ -307,16 +307,21 @@ close_app (GtkWidget *widget, gpointer data)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
draw_cb (GtkWidget *drawing_area, cairo_t *cr, gpointer data)
|
||||
static int
|
||||
expose_cb (GtkWidget *drawing_area, GdkEventExpose *evt, gpointer data)
|
||||
{
|
||||
GdkPixbuf *pixbuf;
|
||||
cairo_t *cr;
|
||||
|
||||
pixbuf = (GdkPixbuf *) g_object_get_data (G_OBJECT (drawing_area),
|
||||
"pixbuf");
|
||||
|
||||
cr = gdk_cairo_create (evt->window);
|
||||
gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0);
|
||||
cairo_paint (cr);
|
||||
gdk_cairo_rectangle (cr, &evt->area);
|
||||
cairo_fill (cr);
|
||||
|
||||
cairo_destroy (cr);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -335,8 +340,8 @@ configure_cb (GtkWidget *drawing_area, GdkEventConfigure *evt, gpointer data)
|
||||
GdkPixbuf *new_pixbuf;
|
||||
|
||||
root = gdk_get_default_root_window ();
|
||||
new_pixbuf = gdk_pixbuf_get_from_window (root,
|
||||
0, 0, evt->width, evt->height);
|
||||
new_pixbuf = gdk_pixbuf_get_from_drawable (NULL, root, NULL,
|
||||
0, 0, 0, 0, evt->width, evt->height);
|
||||
g_object_set_data_full (G_OBJECT (drawing_area), "pixbuf", new_pixbuf,
|
||||
(GDestroyNotify) g_object_unref);
|
||||
}
|
||||
@@ -356,8 +361,8 @@ main (int argc, char **argv)
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
root = gdk_get_default_root_window ();
|
||||
pixbuf = gdk_pixbuf_get_from_window (root,
|
||||
0, 0, 150, 160);
|
||||
pixbuf = gdk_pixbuf_get_from_drawable (NULL, root, NULL,
|
||||
0, 0, 0, 0, 150, 160);
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
g_signal_connect (window, "delete_event",
|
||||
@@ -372,8 +377,8 @@ main (int argc, char **argv)
|
||||
gtk_widget_set_size_request (GTK_WIDGET (drawing_area),
|
||||
gdk_pixbuf_get_width (pixbuf),
|
||||
gdk_pixbuf_get_height (pixbuf));
|
||||
g_signal_connect (drawing_area, "draw",
|
||||
G_CALLBACK (draw_cb), NULL);
|
||||
g_signal_connect (drawing_area, "expose_event",
|
||||
G_CALLBACK (expose_cb), NULL);
|
||||
|
||||
g_signal_connect (drawing_area, "configure_event",
|
||||
G_CALLBACK (configure_cb), NULL);
|
||||
|
||||
@@ -32,27 +32,33 @@ overall_changed_cb (GtkAdjustment *adjustment, gpointer data)
|
||||
}
|
||||
|
||||
gboolean
|
||||
draw_cb (GtkWidget *widget, cairo_t *cr, gpointer data)
|
||||
expose_cb (GtkWidget *widget, GdkEventExpose *event, gpointer data)
|
||||
{
|
||||
GtkAllocation allocation;
|
||||
GdkPixbuf *dest;
|
||||
int width, height;
|
||||
cairo_t *cr;
|
||||
|
||||
width = gtk_widget_get_allocated_width (widget);
|
||||
height = gtk_widget_get_allocated_height (widget);
|
||||
gdk_window_set_back_pixmap (gtk_widget_get_window (widget),
|
||||
NULL, FALSE);
|
||||
|
||||
dest = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, width, height);
|
||||
dest = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, event->area.width, event->area.height);
|
||||
|
||||
gtk_widget_get_allocation (widget, &allocation);
|
||||
gdk_pixbuf_composite_color (pixbuf, dest,
|
||||
0, 0, width, height,
|
||||
0, 0,
|
||||
(double) width / gdk_pixbuf_get_width (pixbuf),
|
||||
(double) height / gdk_pixbuf_get_height (pixbuf),
|
||||
0, 0, event->area.width, event->area.height,
|
||||
-event->area.x, -event->area.y,
|
||||
(double) allocation.width / gdk_pixbuf_get_width (pixbuf),
|
||||
(double) allocation.height / gdk_pixbuf_get_height (pixbuf),
|
||||
interp_type, overall_alpha,
|
||||
0, 0, 16, 0xaaaaaa, 0x555555);
|
||||
event->area.x, event->area.y, 16, 0xaaaaaa, 0x555555);
|
||||
|
||||
cr = gdk_cairo_create (event->window);
|
||||
|
||||
gdk_cairo_set_source_pixbuf (cr, dest, 0, 0);
|
||||
cairo_paint (cr);
|
||||
gdk_cairo_rectangle (cr, &event->area);
|
||||
cairo_fill (cr);
|
||||
|
||||
cairo_destroy (cr);
|
||||
g_object_unref (dest);
|
||||
|
||||
return TRUE;
|
||||
@@ -123,7 +129,7 @@ main(int argc, char **argv)
|
||||
label = gtk_label_new ("Overall Alpha:");
|
||||
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
|
||||
|
||||
adjustment = gtk_adjustment_new (overall_alpha, 0, 255, 1, 10, 0);
|
||||
adjustment = GTK_ADJUSTMENT (gtk_adjustment_new (overall_alpha, 0, 255, 1, 10, 0));
|
||||
g_signal_connect (adjustment, "value_changed",
|
||||
G_CALLBACK (overall_changed_cb), NULL);
|
||||
|
||||
@@ -135,14 +141,13 @@ main(int argc, char **argv)
|
||||
gtk_widget_show_all (vbox);
|
||||
|
||||
/* Compute the size without the drawing area, so we know how big to make the default size */
|
||||
gtk_widget_get_preferred_size ( (vbox),
|
||||
&scratch_requisition, NULL);
|
||||
gtk_widget_size_request (vbox, &scratch_requisition);
|
||||
|
||||
darea = gtk_drawing_area_new ();
|
||||
gtk_box_pack_start (GTK_BOX (vbox), darea, TRUE, TRUE, 0);
|
||||
|
||||
g_signal_connect (darea, "draw",
|
||||
G_CALLBACK (draw_cb), NULL);
|
||||
g_signal_connect (darea, "expose_event",
|
||||
G_CALLBACK (expose_cb), NULL);
|
||||
|
||||
gtk_window_set_default_size (GTK_WINDOW (window),
|
||||
gdk_pixbuf_get_width (pixbuf),
|
||||
|
||||
@@ -1,635 +0,0 @@
|
||||
GTK+ Coding Style
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
This document is intended to be a short description of the preferred
|
||||
coding style to be used for the GTK+ source code. It was strongly
|
||||
inspired by Clutter's CODING_STYLE.
|
||||
|
||||
Coding style is a matter of consistency, readability and maintainance;
|
||||
coding style is also completely arbitrary and a matter of taste. This
|
||||
document will use examples at the very least to provide authoritative
|
||||
and consistent answers to common questions regarding the coding style,
|
||||
and will also try to identify the allowed exceptions.
|
||||
|
||||
The examples will show the preferred coding style; the negative examples
|
||||
will be clearly identified. Please, don't submit code to GTK+ that
|
||||
looks like any of these.
|
||||
|
||||
Part of the rationales for these coding style rules are available either
|
||||
in the kernel CodingStyle document or in Cairo's CODING_STYLE one.
|
||||
|
||||
When in doubt, check the surrounding code and try to imitate it.
|
||||
|
||||
+ Line width
|
||||
|
||||
The maximum line width for source files is 80 characters, whenever possible.
|
||||
Longer lines are usually an indication that you either need a function
|
||||
or a pre-processor macro.
|
||||
|
||||
+ Indentation
|
||||
|
||||
Each new level is indented 2 or more spaces than the previous level:
|
||||
|
||||
if (condition)
|
||||
single_statement ();
|
||||
|
||||
This can only be achieved using space characters. It may not be achieved
|
||||
using tab characters alone, or using a combination of spaces and tabs.
|
||||
|
||||
Do not change the editor's configuration to change the meaning of a
|
||||
tab character (see below); code using tabs to indent will not be accepted
|
||||
into GTK+.
|
||||
|
||||
Even if two spaces for each indentation level allows deeper nesting than
|
||||
8 spaces, GTK+ favours self-documenting function names that can take
|
||||
quite some space. For this reason you should avoid deeply nested code.
|
||||
|
||||
+ Tab characters
|
||||
|
||||
The tab character must always be expanded to spaces. If a literal
|
||||
tab must be used inside the source, the tab must always be interpreted
|
||||
according to its traditional meaning:
|
||||
|
||||
Advance to the next column which is a multiple of 8.
|
||||
[ these two lines should be aligned ]
|
||||
|
||||
+ Braces
|
||||
|
||||
Curly braces should not be used for single statement blocks:
|
||||
|
||||
if (condition)
|
||||
single_statement ();
|
||||
else
|
||||
another_single_statement (arg1);
|
||||
|
||||
In case of multiple statements, curly braces should be put on another
|
||||
indentation level:
|
||||
|
||||
if (condition)
|
||||
{
|
||||
statement_1 ();
|
||||
statement_2 ();
|
||||
statement_3 ();
|
||||
}
|
||||
|
||||
The "no block for single statements" rule has only four exceptions:
|
||||
|
||||
① if the single statement covers multiple lines, e.g. for functions with
|
||||
many arguments, and it is followed by else or else if:
|
||||
|
||||
/* valid */
|
||||
if (condition)
|
||||
{
|
||||
a_single_statement_with_many_arguments (some_lengthy_argument,
|
||||
another_lengthy_argument,
|
||||
and_another_one,
|
||||
plus_one);
|
||||
}
|
||||
else
|
||||
another_single_statement (arg1, arg2);
|
||||
|
||||
② if the condition is composed of many lines:
|
||||
|
||||
/* valid */
|
||||
if (condition1 ||
|
||||
(condition2 && condition3) ||
|
||||
condition4 ||
|
||||
(condition5 && (condition6 || condition7)))
|
||||
{
|
||||
a_single_statement ();
|
||||
}
|
||||
|
||||
③ Nested if's, in which case the block should be placed on the
|
||||
outermost if:
|
||||
|
||||
/* valid */
|
||||
if (condition)
|
||||
{
|
||||
if (another_condition)
|
||||
single_statement ();
|
||||
else
|
||||
another_single_statement ();
|
||||
}
|
||||
|
||||
/* invalid */
|
||||
if (condition)
|
||||
if (another_condition)
|
||||
single_statement ();
|
||||
else if (yet_another_condition)
|
||||
another_single_statement ();
|
||||
|
||||
④ If either side of an if-else statement has braces, both sides
|
||||
should, to match up indentation:
|
||||
|
||||
/* valid */
|
||||
if (condition)
|
||||
{
|
||||
foo ();
|
||||
bar ();
|
||||
}
|
||||
else
|
||||
{
|
||||
baz ();
|
||||
}
|
||||
|
||||
/* invalid */
|
||||
if (condition)
|
||||
{
|
||||
foo ();
|
||||
bar ();
|
||||
}
|
||||
else
|
||||
baz ();
|
||||
|
||||
In general, new blocks should be placed on a new indentation level,
|
||||
like:
|
||||
|
||||
int retval = 0;
|
||||
|
||||
statement_1 ();
|
||||
statement_2 ();
|
||||
|
||||
{
|
||||
int var1 = 42;
|
||||
gboolean res = FALSE;
|
||||
|
||||
res = statement_3 (var1);
|
||||
|
||||
retval = res ? -1 : 1;
|
||||
}
|
||||
|
||||
While curly braces for function definitions should rest on a new line
|
||||
they should not add an indentation level:
|
||||
|
||||
/* valid */
|
||||
static void
|
||||
my_function (int argument)
|
||||
{
|
||||
do_my_things ();
|
||||
}
|
||||
|
||||
/* invalid */
|
||||
static void
|
||||
my_function (int argument) {
|
||||
do_my_things ();
|
||||
}
|
||||
|
||||
/* invalid */
|
||||
static void
|
||||
my_function (int argument)
|
||||
{
|
||||
do_my_things ();
|
||||
}
|
||||
|
||||
Curly braces must not be placed on the same line as a condition:
|
||||
|
||||
/* invalid */
|
||||
if (condition) {
|
||||
statement_1 ();
|
||||
statement_2 ();
|
||||
}
|
||||
+ Conditions
|
||||
|
||||
Do not check boolean values for equality:
|
||||
|
||||
/* invalid */
|
||||
if (condition == TRUE)
|
||||
do_foo ();
|
||||
|
||||
/* valid */
|
||||
if (another_condition)
|
||||
do_bar ();
|
||||
|
||||
Even if C handles NULL equality like a boolean, be explicit:
|
||||
|
||||
/* valid */
|
||||
if (some_pointer == NULL)
|
||||
do_blah ();
|
||||
|
||||
/* invalid */
|
||||
if (some_other_pointer)
|
||||
do_blurp ();
|
||||
|
||||
In case of conditions split over multiple lines, the logical operators should
|
||||
always go at the end of the line:
|
||||
|
||||
/* invalid */
|
||||
if (condition1
|
||||
|| condition2
|
||||
|| condition3)
|
||||
{
|
||||
do_foo ();
|
||||
}
|
||||
|
||||
/* valid */
|
||||
if (condition1 &&
|
||||
condition2 &&
|
||||
(condition3 || (condition4 && condition5)))
|
||||
{
|
||||
do_blah ();
|
||||
}
|
||||
|
||||
+ Functions
|
||||
|
||||
Functions should be declared by placing the returned value on a separate
|
||||
line from the function name:
|
||||
|
||||
void
|
||||
my_function (void)
|
||||
{
|
||||
}
|
||||
|
||||
The arguments list must be broken into a new line for each argument,
|
||||
with the argument names right aligned, taking into account pointers:
|
||||
|
||||
void
|
||||
my_function (some_type_t type,
|
||||
another_type_t *a_pointer,
|
||||
final_type_t another_type)
|
||||
{
|
||||
}
|
||||
|
||||
The alignment also holds when invoking a function without breaking the
|
||||
80 characters limit:
|
||||
|
||||
align_function_arguments (first_argument,
|
||||
second_argument,
|
||||
third_argument);
|
||||
|
||||
To respect the 80 characters limit do not break the function name from
|
||||
the arguments:
|
||||
|
||||
/* invalid */
|
||||
a_very_long_function_name_with_long_parameters
|
||||
(argument_the_first, argument_the_second);
|
||||
|
||||
/* valid */
|
||||
first_a = argument_the_first;
|
||||
second_a = argument_the_second;
|
||||
a_very_long_function_name_with_long_parameters (first_a, second_a);
|
||||
|
||||
+ Whitespace
|
||||
|
||||
Always put a space before a parenthesis but never after:
|
||||
|
||||
/* valid */
|
||||
if (condition)
|
||||
do_my_things ();
|
||||
|
||||
/* valid */
|
||||
switch (condition)
|
||||
{
|
||||
}
|
||||
|
||||
/* invalid */
|
||||
if(condition)
|
||||
do_my_things();
|
||||
|
||||
/* invalid */
|
||||
if ( condition )
|
||||
do_my_things ( );
|
||||
|
||||
A switch() should open a block on a new indentation level, and each case
|
||||
should start on the same indentation level as the curly braces, with the
|
||||
case block on a new indentation level:
|
||||
|
||||
/* valid */
|
||||
switch (condition)
|
||||
{
|
||||
case FOO:
|
||||
do_foo ();
|
||||
break;
|
||||
|
||||
case BAR:
|
||||
do_bar ();
|
||||
break;
|
||||
}
|
||||
|
||||
/* invalid */
|
||||
switch (condition) {
|
||||
case FOO: do_foo (); break;
|
||||
case BAR: do_bar (); break;
|
||||
}
|
||||
|
||||
/* invalid */
|
||||
switch (condition)
|
||||
{
|
||||
case FOO: do_foo ();
|
||||
break;
|
||||
case BAR: do_bar ();
|
||||
break;
|
||||
}
|
||||
|
||||
/* invalid */
|
||||
switch (condition)
|
||||
{
|
||||
case FOO:
|
||||
do_foo ();
|
||||
break;
|
||||
case BAR:
|
||||
do_bar ();
|
||||
break;
|
||||
}
|
||||
|
||||
It is preferable, though not mandatory, to separate the various cases with
|
||||
a newline:
|
||||
|
||||
switch (condition)
|
||||
{
|
||||
case FOO:
|
||||
do_foo ();
|
||||
break;
|
||||
|
||||
case BAR:
|
||||
do_bar ();
|
||||
break;
|
||||
|
||||
default:
|
||||
do_default ();
|
||||
}
|
||||
|
||||
The 'break' statement for the default: case is not mandatory.
|
||||
|
||||
If a case block needs to declare new variables, the same rules as the
|
||||
inner blocks (see above) apply; the break statement should be placed
|
||||
outside of the inner block:
|
||||
|
||||
switch (condition)
|
||||
{
|
||||
case FOO:
|
||||
{
|
||||
int foo;
|
||||
|
||||
foo = do_foo ();
|
||||
}
|
||||
break;
|
||||
|
||||
...
|
||||
}
|
||||
|
||||
When declaring a structure type use newlines to separate logical sections
|
||||
of the structure:
|
||||
|
||||
struct _GtkWrapBoxPrivate
|
||||
{
|
||||
GtkOrientation orientation;
|
||||
GtkWrapAllocationMode mode;
|
||||
|
||||
GtkWrapBoxSpreading horizontal_spreading;
|
||||
GtkWrapBoxSpreading vertical_spreading;
|
||||
|
||||
guint16 vertical_spacing;
|
||||
guint16 horizontal_spacing;
|
||||
|
||||
guint16 minimum_line_children;
|
||||
guint16 natural_line_children;
|
||||
|
||||
GList *children;
|
||||
};
|
||||
|
||||
|
||||
Do not eliminate whitespace and newlines just because something would
|
||||
fit on 80 characters:
|
||||
|
||||
/* invalid */
|
||||
if (condition) foo (); else bar ();
|
||||
|
||||
Do eliminate trailing whitespace on any line, preferably as a separate
|
||||
patch or commit. Never use empty lines at the beginning or at the end of
|
||||
a file.
|
||||
|
||||
Do enable the default git pre-commit hook that detect trailing
|
||||
whitespace for you and help you to avoid corrupting GTK+'s tree with
|
||||
it. Do that as follows:
|
||||
|
||||
chmod a+x .git/hooks/pre-commit
|
||||
|
||||
You might also find the git-stripspace utility helpful which acts as a
|
||||
filter to remove trailing whitespace as well as initial, final, and
|
||||
duplicate blank lines.
|
||||
|
||||
+ Headers
|
||||
|
||||
Headers are special, for GTK+, in that they don't have to obey the
|
||||
80 characters limit. The only major rule for headers is that the function
|
||||
definitions should be vertically aligned in three columns:
|
||||
|
||||
return value function_name (type argument,
|
||||
type argument,
|
||||
type argument);
|
||||
|
||||
The maximum width of each column is given by the longest element in the
|
||||
column:
|
||||
|
||||
void gtk_type_set_property (GtkType *type,
|
||||
const gchar *value,
|
||||
GError **error);
|
||||
G_CONST_RETURN gchar *gtk_type_get_property (GtkType *type);
|
||||
|
||||
It is also possible to align the columns to the next tab:
|
||||
|
||||
void gtk_type_set_prop (GtkType *type,
|
||||
gfloat value);
|
||||
gfloat gtk_type_get_prop (GtkType *type);
|
||||
gint gtk_type_update_foobar (GtkType *type);
|
||||
|
||||
Public headers should never be included directly:
|
||||
|
||||
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gtk/gtk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
All headers should have inclusion guards (for internal usage)
|
||||
and C++ guards:
|
||||
|
||||
#ifndef __GTK_FOO_H__
|
||||
#define __GTK_FOO_H__
|
||||
|
||||
#include <gtk/gtk-bar.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
...
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_FOO_H__ */
|
||||
|
||||
+ Includes
|
||||
|
||||
GTK+ source files should never include the global gtk.h header, but
|
||||
instead include the individual headers that are needed. Every file must
|
||||
include config.h first, then its own header, then other GTK+ headers
|
||||
that it needs, then system and third-party headers that it needs.
|
||||
|
||||
/* valid */
|
||||
#include "config.h"
|
||||
|
||||
#include "gtkfoo.h"
|
||||
|
||||
#include "gtkwidget.h"
|
||||
#include "gtkbutton.h"
|
||||
|
||||
...
|
||||
|
||||
#include <string.h>
|
||||
|
||||
|
||||
+ GObject
|
||||
|
||||
GObject classes definition and implementation require some additional
|
||||
coding style notices.
|
||||
|
||||
Typedef declarations should be placed at the beginning of the file:
|
||||
|
||||
typedef struct _GtkFoo GtkFoo;
|
||||
typedef struct _GtkFooClass GtkFooClass;
|
||||
typedef struct _GtkFooPrivate GtkFooPrivate;
|
||||
|
||||
This includes enumeration types:
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT,
|
||||
GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH
|
||||
} GtkSizeRequestMode;
|
||||
|
||||
And callback types:
|
||||
|
||||
typedef void (* GtkCallback) (GtkWidget *widget,
|
||||
gpointer user_data);
|
||||
|
||||
Instance structures should only contain the parent type and a pointer to a
|
||||
private data structure, and they should be annotated as "private":
|
||||
|
||||
struct _GtkFoo
|
||||
{
|
||||
/*< private >*/
|
||||
GtkWidget parent_instance;
|
||||
|
||||
GtkFooPrivate *priv;
|
||||
};
|
||||
|
||||
All the properties should be stored inside the private data structure, which
|
||||
is defined inside the source file - or, if needed, inside a private header
|
||||
file; the private header filename must end with "private.h" and must not be
|
||||
installed.
|
||||
|
||||
The private data structure should only be accessed internally using the
|
||||
pointer inside the instance structure, and never using the
|
||||
G_TYPE_INSTANCE_GET_PRIVATE() macro or the g_type_instance_get_private()
|
||||
function.
|
||||
|
||||
Always use the G_DEFINE_TYPE(), G_DEFINE_TYPE_WITH_CODE() macros, or
|
||||
their abstract variants G_DEFINE_ABSTRACT_TYPE() and
|
||||
G_DEFINE_ABSTRACT_TYPE_WITH_CODE(), and the similar macros for defining
|
||||
interfaces.
|
||||
|
||||
Interface types should always have the dummy typedef for cast purposes:
|
||||
|
||||
typedef struct _GtkFoo GtkFoo;
|
||||
|
||||
The interface structure should have "Interface" postfixed to the dummy typedef:
|
||||
|
||||
typedef struct _GtkFooInterface GtkFooInterface;
|
||||
|
||||
Interfaces must have the following macros:
|
||||
|
||||
- Macro: - Expands to:
|
||||
• GTK_TYPE_<iface_name> <iface_name>_get_type
|
||||
• GTK_<iface_name> G_TYPE_CHECK_INSTANCE_CAST
|
||||
• GTK_IS_<iface_name> G_TYPE_CHECK_INSTANCE_TYPE
|
||||
• GTK_<iface_name>_GET_IFACE G_TYPE_INSTANCE_GET_INTERFACE
|
||||
|
||||
+ Memory allocation
|
||||
|
||||
When dynamically allocating data on the heap either use g_new() or,
|
||||
if allocating multiple small data structures, g_slice_new().
|
||||
|
||||
Public structure types should always be returned after being zero-ed,
|
||||
either explicitly for each member, or by using g_new0() or g_slice_new0().
|
||||
|
||||
+ Macros
|
||||
|
||||
Try to avoid private macros unless strictly necessary. Remember to #undef
|
||||
them at the end of a block or a series of functions needing them.
|
||||
|
||||
Inline functions are usually preferable to private macros.
|
||||
|
||||
Public macros should not be used unless they evaluate to a constant.
|
||||
|
||||
+ Public API
|
||||
|
||||
Avoid exporting variables as public API, since this is cumbersome on some
|
||||
platforms. It is always preferable to add getters and setters instead.
|
||||
|
||||
All public functions must be listed in the gtk.symbols file.
|
||||
|
||||
+ Private API
|
||||
|
||||
Non-exported functions that are needed in more than one source file
|
||||
should be named "_gtk_...", and declared in a private header file.
|
||||
|
||||
Underscore-prefixed functions are never exported.
|
||||
|
||||
Non-exported functions that are only needed in one source file
|
||||
should be declared static.
|
||||
|
||||
+ Documentation
|
||||
|
||||
All public APIs must have gtk-doc comments. For functions, these should
|
||||
be placed in the source file, directly above the function.
|
||||
|
||||
/* valid */
|
||||
/**
|
||||
* gtk_get_flow:
|
||||
* @widget: a #GtkWidget
|
||||
*
|
||||
* Gets the flow of a widget.
|
||||
*
|
||||
* Note that flows may be laminar or turbulent...
|
||||
*
|
||||
* Returns: (transfer none): the flow of @widget
|
||||
*/
|
||||
GtkFlow *
|
||||
gtk_get_flow (GtkWidget *widget)
|
||||
{
|
||||
|
||||
...
|
||||
|
||||
}
|
||||
|
||||
Doc comments for macros, function types, class structs, etc should be
|
||||
placed next to the definitions, typically in headers.
|
||||
|
||||
Section introductions should be placed in the source file they describe,
|
||||
after the license header:
|
||||
|
||||
/* valid */
|
||||
/**
|
||||
* SECTION:gtksizerequest
|
||||
* @Short_Description: Height-for-width geometry management
|
||||
* @Title: GtkSizeRequest
|
||||
*
|
||||
* The GtkSizeRequest interface is GTK+'s height-for-width (and
|
||||
* width-for-height) geometry management system.
|
||||
* ...
|
||||
*/
|
||||
|
||||
To properly document a new function, macro, function type or struct,
|
||||
it needs to be listed in the gtk3-sections.txt file.
|
||||
|
||||
To properly document a new class, it needs to be given its own section
|
||||
in gtk3-sections.txt, needs to be included in gtk-docs.sgml, and the
|
||||
get_type function needs to listed in gtk3.types.
|
||||
|
||||
+ Old code
|
||||
|
||||
New code that is being added to GTK+ should adhere to the style
|
||||
explained above. Existing GTK+ code does largely follow these
|
||||
conventions, but there are some differences, e.g. occurrences
|
||||
of tabs, etc.
|
||||
|
||||
It is ok to update the style of a code block or function when you
|
||||
are touching it anyway, but sweeping whitespace changes obscure the
|
||||
git history and should be avoided.
|
||||
@@ -4,22 +4,20 @@ include $(top_srcdir)/Makefile.decl
|
||||
SUBDIRS = tutorial faq reference tools
|
||||
|
||||
EXTRA_DIST += \
|
||||
CODING-STYLE \
|
||||
defsformat.txt \
|
||||
developers.txt \
|
||||
dnd_internals.txt \
|
||||
focus_tracking.txt \
|
||||
generation.txt \
|
||||
gtkdocs_fix \
|
||||
make-todo \
|
||||
refcounting.txt \
|
||||
RELEASE-HOWTO \
|
||||
sizing-test.txt \
|
||||
styles.txt \
|
||||
text_widget_internals.txt \
|
||||
text_widget.txt \
|
||||
tree-column-sizing.png \
|
||||
text_widget_internals.txt \
|
||||
tree-column-sizing.txt \
|
||||
widget_geometry.txt \
|
||||
widget_system.txt
|
||||
widget_system.txt \
|
||||
generation.txt \
|
||||
gtkdocs_fix \
|
||||
RELEASE-HOWTO
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
||||
|
||||
338
docs/defsformat.txt
Normal file
338
docs/defsformat.txt
Normal file
@@ -0,0 +1,338 @@
|
||||
|
||||
The overall syntax is:
|
||||
|
||||
(type-of-thing-being-defined name-used-to-refer-to-this-thing
|
||||
(attribute-name attribute-value-depending-on-the-attribute)
|
||||
(attribute-name attribute-value-depending-on-the-attribute)
|
||||
(attribute-name attribute-value-depending-on-the-attribute))
|
||||
|
||||
Some definitions can have a c-declaration field that gives the C code
|
||||
we parsed to arrive at the definition. The c-declaration is a quoted
|
||||
string because it can contain parentheses and such.
|
||||
|
||||
Defined types and their attributes:
|
||||
|
||||
===
|
||||
(module module-name
|
||||
(submodule-of module-name)) ;; submodule is optional
|
||||
|
||||
Ex: (module Gtk)
|
||||
Ex: (module Rgb
|
||||
(submodule-of Gdk))
|
||||
|
||||
modules are later referred to with a list of module names, like
|
||||
(Gdk Rgb) or (Gtk)
|
||||
|
||||
Object and boxed type definitions automatically create a submodule.
|
||||
For example, GtkCList creates the module (module CList (submodule-of
|
||||
(Gtk))) which is referred to as module (Gtk CList).
|
||||
|
||||
===
|
||||
|
||||
(type
|
||||
(alias some-unique-identifier)
|
||||
(in-module module-name) ;; optional, gchar* is not in a module
|
||||
(gtk-type-id gtk-type-system-id) ;; optional, absent if this is not
|
||||
;; in the type system
|
||||
(is-parametric boolean) ;; optional default to #f
|
||||
(in-c-name name-of-symbol-in-C)
|
||||
(out-c-name name-of-symbol-in-C)
|
||||
(inout-c-name name-of-symbol-in-C))
|
||||
|
||||
Ex: (type
|
||||
(alias string)
|
||||
(gtk-type-id GTK_TYPE_STRING)
|
||||
(in-c-name "const gchar*")
|
||||
(out-c-name "gchar**") ;; actually I'm not sure how strings work out/inout
|
||||
(inout-c-name "gchar*"))
|
||||
|
||||
(type
|
||||
(alias list)
|
||||
(gtk-type-id GTK_TYPE_POINTER)
|
||||
(is-parametric #t)
|
||||
(in-c-name "GList*")
|
||||
(out-c-name "GList**")
|
||||
(inout-c-name "GList**"))
|
||||
|
||||
|
||||
;; This one would be implied by the (object) def for GtkWidget I
|
||||
;; think - (type) is only required for types that are not implied
|
||||
;; by other definitions, such as int/boolean/etc.
|
||||
|
||||
(type
|
||||
(alias GtkWidget)
|
||||
(in-module (Gtk))
|
||||
(gtk-type-id GTK_TYPE_WIDGET)
|
||||
(in-c-name "GtkWidget*")
|
||||
(inout-c-name "GtkWidget*")
|
||||
(out-c-name "GtkWidget**"))
|
||||
|
||||
"Type" bindings are automatically assumed for objects, boxed types,
|
||||
etc. as defined below.
|
||||
|
||||
The alias field is used to refer to the type later on.
|
||||
|
||||
Whenever a type alias can be used, it is also possible to use the
|
||||
keyword "native", which implies that the type in question is too
|
||||
C-specific to represent. Then a c-declaration will typically be
|
||||
available for use.
|
||||
|
||||
C types containing [] or () are function pointers or arrays. For
|
||||
arrays that don't specify a size, we just treat them as pointers. For
|
||||
function pointers, we need special (type) syntax/attributes of some
|
||||
kind, but since there basically aren't any of these right now in the
|
||||
libs we care about we can just ignore them. For arrays that specify a
|
||||
size ditto, you would handle them by adding an (array-size) attribute
|
||||
or something or using the "native" keyword and skipping the (type)
|
||||
stuff.
|
||||
|
||||
===
|
||||
(object object-name
|
||||
(in-module module-name-list)
|
||||
(parent object-name optional-module-name-if-different)
|
||||
(abstract boolean-is-abstract-class) ;; omit for default of #f
|
||||
(c-name name-of-the-object-in-C)
|
||||
(field (type-and-name type-alias-of-struct-field name-of-struct-field)
|
||||
(access read-or-write-or-readwrite)))
|
||||
|
||||
|
||||
Ex: (object Widget
|
||||
(in-module (Gtk))
|
||||
(parent Object) ;; could say (parent Object (Gtk))
|
||||
(abstract #t)
|
||||
(c-name GtkWidget)
|
||||
(field (type-and-name GdkWindow* window) (access read)))
|
||||
|
||||
An "object" declaration automatically implies the type definition:
|
||||
|
||||
(type
|
||||
(alias concat-module-elements-and-object-name)
|
||||
(in-c-name pointer-to-c-name)
|
||||
(out-c-name pointer-to-pointer-to-c-name)
|
||||
(inout-c-name pointer-to-c-name))
|
||||
|
||||
Ex:
|
||||
(type (alias GtkWidget)
|
||||
(in-c-name GtkWidget*)
|
||||
(out-c-name GtkWidget**)
|
||||
(inout-c-name GtkWidget*))
|
||||
|
||||
It also implies a module that is the name broken into parts:
|
||||
(module CTree
|
||||
(submodule-of Gtk))
|
||||
|
||||
===
|
||||
|
||||
(function function-name
|
||||
(in-module module-name-list) ;; "static methods" go in their
|
||||
;; object's module
|
||||
(is-constructor-of object-type-alias) ;; optional, marks a constructor
|
||||
(c-name function-name)
|
||||
(return-type return-value-type) ;; defaults to void
|
||||
(caller-owns-return boolean-value) ;; defaults to #f
|
||||
(can-return-null boolean-value) ;; defaults to #t
|
||||
(parameter in-or-out-or-inout
|
||||
(type-and-name parameter-type-alias parameter-name)
|
||||
(type-parameter name-of-contained-type) ;; optional, requires parametric type
|
||||
(c-declaration "c-type-and-name")) ;; c-declaration only required
|
||||
;; if the type alias is "native"
|
||||
(varargs #t) ;; has varargs at the end
|
||||
)
|
||||
|
||||
Ex:
|
||||
(function init
|
||||
(in-module (Gdk Rgb)
|
||||
(c-name gdk_rgb_init)))
|
||||
|
||||
Ex:
|
||||
(function new
|
||||
(in-module (Gdk Rgb Cmap))
|
||||
(is-constructor-of GdkRgbCmap)
|
||||
(c-name gdk_rgb_cmap_new)
|
||||
(return-type GdkRgbCmap)
|
||||
(caller-owns-return #t) ;; perhaps this could be implied by is-constructor-of
|
||||
(parameter in (type-and-name array-of-guint32 colors))
|
||||
(parameter in (type-and-name gint n_colors)))
|
||||
|
||||
Ex:
|
||||
(function config_set_set_handler
|
||||
(in-module (Gnome))
|
||||
(c-name gnome_config_set_set_handler)
|
||||
(parameter in (type-and-name native func)
|
||||
(c-declaration "void (*func)(void*)"))
|
||||
(parameter in (type-and-name gpointer data)))
|
||||
|
||||
===
|
||||
(method method-name
|
||||
(of-object object-name module-name)
|
||||
;; retval/arg attributes as for (function), but with first parameter
|
||||
;; omitted for non-constructors
|
||||
)
|
||||
|
||||
Ex:
|
||||
(method set_text
|
||||
(of-object Label (Gtk))
|
||||
(parameter (type-and-name const-gchar* str)))
|
||||
|
||||
===
|
||||
(object-argument arg-name
|
||||
(of-object object-we-are-an-argument-of optional-objects-module)
|
||||
(type-id argument-type) ;; GTK_TYPE_OBJECT etc.
|
||||
;; flags all default to #f
|
||||
(readable bool-value)
|
||||
(writeable bool-value)
|
||||
(construct-only bool-value))
|
||||
|
||||
Ex:
|
||||
(object-argument label
|
||||
(of-object Label (Gtk))
|
||||
(type GTK_TYPE_STRING)
|
||||
(readable #t)
|
||||
(writeable #t))
|
||||
|
||||
===
|
||||
(signal signal-name
|
||||
(run-action bool-value)
|
||||
(run-first bool-value)
|
||||
(run-last bool-value)
|
||||
(of-object object-we-are-a-signal-of optional-objects-module)
|
||||
;; return value and parameters as for a function, omitting the object
|
||||
;; and user data parameters
|
||||
|
||||
;; what other properties matter for a signal?
|
||||
)
|
||||
|
||||
Ex:
|
||||
(signal select_row
|
||||
(of-object CList (Gtk))
|
||||
(run-first #t)
|
||||
;; return type defaults to void
|
||||
(parameter in (type-and-name gint row))
|
||||
(parameter in (type-and-name gint column))
|
||||
(parameter in (type-and-name GdkEvent* event)))
|
||||
|
||||
===
|
||||
(enum enum-name
|
||||
(in-module modname)
|
||||
(c-name name-in-c)
|
||||
(value (nick value-name-noprefixes-hyphen-lowercase) (c-name value-c-name)))
|
||||
|
||||
Ex:
|
||||
|
||||
(enum DirectionType
|
||||
(in-module Gtk)
|
||||
(c-name GtkDirectionType)
|
||||
(value (nick tab-forward) (c-name GTK_DIR_TAB_FORWARD))
|
||||
(value (nick tab-backward) (c-name GTK_DIR_TAB_BACKWARD))
|
||||
(value (nick up) (c-name GTK_DIR_UP))
|
||||
(value (nick down) (c-name GTK_DIR_DOWN))
|
||||
(value (nick left) (c-name GTK_DIR_LEFT))
|
||||
(value (nick right) (c-name GTK_DIR_RIGHT)))
|
||||
|
||||
(enum Pos
|
||||
(in-module (Gtk CTree))
|
||||
(c-name GtkCTreePos)
|
||||
(value (nick before) (c-name GTK_CTREE_POS_BEFORE))
|
||||
(value (nick as-child) (c-name GTK_CTREE_POS_AS_CHILD))
|
||||
(value (nick after) (c-name GTK_CTREE_POS_AFTER)))
|
||||
|
||||
===
|
||||
(flags) is just like enum, but some bindings may wrap enums and flags differently.
|
||||
|
||||
===
|
||||
|
||||
(boxed boxed-name
|
||||
(in-module modname)
|
||||
(c-name c-name)
|
||||
(ref-func func-to-increase-refcount)
|
||||
(copy-func func-to-copy)
|
||||
(release-func func-to-destroy-or-decrement-refcount)
|
||||
(field (type-and-name type-alias-of-struct-field name-of-struct-field) (access access-rule)))
|
||||
|
||||
It is never OK to use memcpy() to copy a boxed type, or use
|
||||
malloc()/free() to alloc/free one.
|
||||
|
||||
Ex:
|
||||
|
||||
(boxed Pixmap
|
||||
(in-module (Gdk))
|
||||
(c-name GdkPixmap)
|
||||
(ref-func pixmap_ref)
|
||||
(release-func pixmap_unref))
|
||||
|
||||
An "object" declaration automatically implies the type definition:
|
||||
|
||||
(type
|
||||
(alias concat-module-elements-and-boxed-name)
|
||||
(in-c-name pointer-to-c-name)
|
||||
(out-c-name pointer-to-pointer-to-c-name)
|
||||
(inout-c-name pointer-to-c-name))
|
||||
|
||||
Ex:
|
||||
(type (alias GdkPixmap)
|
||||
(in-c-name GdkPixmap*)
|
||||
(out-c-name GdkPixmap**)
|
||||
(inout-c-name GdkPixmap*))
|
||||
|
||||
|
||||
===
|
||||
|
||||
(struct struct-name
|
||||
(in-module modname)
|
||||
(c-name c-name)
|
||||
(field (type-and-name type-alias-of-struct-field name-of-struct-field) (access access-rule)))
|
||||
|
||||
Unlike a boxed type, a struct type can be copied with memcpy() and
|
||||
allocated on the stack or with g_malloc().
|
||||
|
||||
Ex:
|
||||
(struct Rectangle
|
||||
(in-module (Gdk))
|
||||
(c-name GdkRectangle)
|
||||
(field (type-and-name gint16 x) (access readwrite))
|
||||
(field (type-and-name gint16 y) (access readwrite))
|
||||
(field (type-and-name guint16 width) (access readwrite))
|
||||
(field (type-and-name guint16 height) (access readwrite)))
|
||||
|
||||
Implies GdkRectangle type alias:
|
||||
|
||||
(type (alias GdkRectangle)
|
||||
(in-c-name GdkRectangle*)
|
||||
(out-c-name GdkRectangle*) ;; note - not the same as boxed types
|
||||
(inout-c-name GdkRectangle*))
|
||||
|
||||
===
|
||||
|
||||
(user-function name
|
||||
(in-module module)
|
||||
(c-name c-typedef-name)
|
||||
;; return-type and parameters as for (function)
|
||||
)
|
||||
|
||||
Ex:
|
||||
|
||||
(user-function PrintFunc
|
||||
(in-module (Gtk))
|
||||
(parameter in (type-and-name gpointer func_data))
|
||||
(parameter in (type-and-name gchar* str)))
|
||||
|
||||
===
|
||||
|
||||
(typedef new-name
|
||||
(in-module module)
|
||||
(c-name c-full-name)
|
||||
(orig-type alias-of-orig-type))
|
||||
|
||||
Ex:
|
||||
|
||||
(typedef Type
|
||||
(in-module (Gtk))
|
||||
(c-name GtkType)
|
||||
(orig-type guint))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
236
docs/gtk-config.txt
Normal file
236
docs/gtk-config.txt
Normal file
@@ -0,0 +1,236 @@
|
||||
CONFIGURING PACKAGES TO WORK WITH GTK
|
||||
-------------------------------------
|
||||
|
||||
Compiling a program successfully against the GTK, GDK, and GLIB
|
||||
libraries can require a large number of command line options
|
||||
to your compiler and linker that are hard to guess correctly.
|
||||
The additional libraries required may, for example, depend on the
|
||||
manner which GTK was configured
|
||||
|
||||
Several tools are included in this package to make process
|
||||
easier.
|
||||
|
||||
First, there is the shell script 'gtk-config' (installed in
|
||||
$exec_prefix/bin):
|
||||
|
||||
Invoking gtk-config
|
||||
-------------------
|
||||
|
||||
gtk-config takes the following flags:
|
||||
|
||||
--version
|
||||
Prints out the version of GTK installed
|
||||
|
||||
--cflags
|
||||
Prints '-I' flags pointing to the installed header files.
|
||||
|
||||
--libs
|
||||
Prints out the linker flags necessary to link a program against GTK
|
||||
|
||||
--prefix[=PREFIX]
|
||||
If PREFIX is specified, overrides the configured value of $prefix.
|
||||
(And of exec-prefix, unless --exec-prefix is also specified)
|
||||
Otherwise, prints out the configured value of $prefix
|
||||
|
||||
--exec-prefix[=PREFIX]
|
||||
If PREFIX is specified, overrides the configured value of $exec_prefix.
|
||||
Otherwise, prints out the configured value of $exec_prefix
|
||||
|
||||
You may also add to the command line a list of additional
|
||||
libraries that gtk-config should supply the CFLAGS and LIBS
|
||||
for. The only currently supported library is 'gthread'.
|
||||
|
||||
As an example of this latter usage, you can get the
|
||||
appropriate cflags for a threaded program with:
|
||||
|
||||
gtk-config --cflags gthread
|
||||
|
||||
|
||||
Example of using gtk-config
|
||||
---------------------------
|
||||
|
||||
Typically, gtk-config will be used within a configure script,
|
||||
as described below. It, however, can also be used directly
|
||||
from the command line to compile a simple program. For example:
|
||||
|
||||
cc -o simple `gtk-config --cflags` simple.c `gtk-config --libs`
|
||||
|
||||
This command line might expand to (for example):
|
||||
|
||||
cc -o simple -I/usr/local/lib/glib/include -I/usr/local/include \
|
||||
-I/usr/X11R6/include simple.c -L/usr/local/lib -L/usr/X11R6/lib \
|
||||
-lgtk -lgdk -lglib -lXi -lXext -lX11 -lm
|
||||
|
||||
Not only is the form using gtk-config easier to type, it will
|
||||
work on any system, no matter how GTK was configured.
|
||||
|
||||
|
||||
AM_PATH_GTK
|
||||
-----------
|
||||
|
||||
For packages configured using GNU automake, GTK also provides
|
||||
a macro to automate the process of running GTK.
|
||||
|
||||
AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
|
||||
|
||||
This macro:
|
||||
|
||||
* Determines the location of GTK using gtk-config, which is either
|
||||
found in the user's path, or from the environment variable
|
||||
GTK_CONFIG
|
||||
|
||||
* Tests the installed libraries to make sure that there version
|
||||
is later than MINIMUM-VERSION. (A default version will be used
|
||||
if not specified)
|
||||
|
||||
* If the required version was found, sets the GTK_CFLAGS variable to
|
||||
the output of `gtk-config --cflags` and the GTK_LIBS variable to
|
||||
the output of `gtk-config --libs`, and calls AC_SUBST() for these
|
||||
variables so they can be used in generated makefiles, and then
|
||||
executes ACTION-IF-FOUND.
|
||||
|
||||
* If the required version was not found, sets GTK_CFLAGS and GTK_LIBS
|
||||
to empty strings, and executes ACTION-IF-NOT-FOUND.
|
||||
|
||||
This macro is in file 'gtk.m4' which is installed in $datadir/aclocal.
|
||||
Note that if automake was installed with a different --prefix than
|
||||
GTK, you will either have to manually move gtk.m4 to automake's
|
||||
$datadir/aclocal, or give aclocal the -I option when running it.
|
||||
|
||||
|
||||
Configuring a package that uses AM_PATH_GTK
|
||||
-------------------------------------------
|
||||
|
||||
Simply make sure that gtk-config is in your path, and run
|
||||
the configure script.
|
||||
|
||||
Notes:
|
||||
|
||||
* The directory where the GTK libraries are installed needs
|
||||
to be found by your system's dynamic linker.
|
||||
|
||||
This is generally done by
|
||||
|
||||
editing /etc/ld.so.conf and running ldconfig
|
||||
|
||||
Or by:
|
||||
|
||||
setting the environment variable LD_LIBRARY_PATH,
|
||||
|
||||
or, as a last resort,
|
||||
|
||||
Giving a -R or -rpath flag (depending on your linker) when
|
||||
running configure, for instance:
|
||||
|
||||
LDFLAGS=-R/usr/home/owen/lib ./configure
|
||||
|
||||
* You can also specify a gtk-config not in your path by
|
||||
setting the GTK_CONFIG environment variable to the
|
||||
name of the executable
|
||||
|
||||
* If you move the GTK package from its installed location,
|
||||
you will need either need to modify gtk-config script
|
||||
manually to point to the new location or rebuild GTK.
|
||||
|
||||
Advanced note:
|
||||
|
||||
* configure flags
|
||||
|
||||
--with-gtk-prefix=PREFIX
|
||||
--with-gtk-exec-prefix=PREFIX
|
||||
|
||||
are provided to override the prefix and exec-prefix that were stored
|
||||
in the gtk-config shell script by GTK's configure. You are generally
|
||||
better off configuring GTK with the right path to begin with.
|
||||
|
||||
Example of a package using AM_PATH_GTK
|
||||
--------------------------------------
|
||||
|
||||
The following shows how to build a simple package using automake
|
||||
and the AM_PATH_GTK macro. The program used here is the testinput.c
|
||||
|
||||
You should first read the introductory portions of the automake
|
||||
Manual, if you are not already familiar with it.
|
||||
|
||||
Two files are needed, 'configure.ac', which is used to build the
|
||||
configure script:
|
||||
|
||||
==configure.ac===
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_INIT(testinput.c)
|
||||
|
||||
AM_INIT_AUTOMAKE(testinput.c, 1.0.0)
|
||||
|
||||
AC_PROG_CC
|
||||
AM_PROG_CC_STDC
|
||||
AC_PROG_INSTALL
|
||||
|
||||
AM_PATH_GTK(0.99.5,
|
||||
[LIBS="$LIBS $GTK_LIBS"
|
||||
CFLAGS="$CFLAGS $GTK_CFLAGS"],
|
||||
AC_MSG_ERROR(Cannot find GTK: Is gtk-config in path?))
|
||||
|
||||
AC_OUTPUT(Makefile)
|
||||
=================
|
||||
|
||||
The only command in this which is not standard for automake
|
||||
is the AM_PATH_GTK() macro.
|
||||
|
||||
That command does the following:
|
||||
|
||||
If a GTK version greater than 0.99.5 is found, adds $GTK_LIBS to
|
||||
$LIBS and $GTK_CFLAGS to $CFLAGS. Otherwise, dies with the error
|
||||
message "Cannot find GTK: Is gtk-config in path?"
|
||||
|
||||
And the 'Makefile.am', which will be used to build the Makefile.
|
||||
|
||||
== Makefile.am ==
|
||||
bin_PROGRAMS = testinput
|
||||
testinput_SOURCES = testinput.c
|
||||
=================
|
||||
|
||||
This Makefile.am, says that we are building a single executable,
|
||||
from a single sourcefile 'testinput.c'. Since every program
|
||||
we are building uses GTK we simply added the GTK options
|
||||
to $LIBS and $CFLAGS, but in other circumstances, we might
|
||||
want to specify them on a per-program basis: for instance by
|
||||
adding the lines:
|
||||
|
||||
testinput_LDADD = $(GTK_LIBS)
|
||||
INCLUDES = $(GTK_CFLAGS)
|
||||
|
||||
to the Makefile.am.
|
||||
|
||||
To try this example out, create a new directory, add the two
|
||||
files above two it, and copy the testinput.c file from
|
||||
the gtk/ subdirectory to the new directory. Edit the line:
|
||||
|
||||
#include "gtk.h"
|
||||
|
||||
in testgtk.c, to read:
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
|
||||
Now execute the following commands:
|
||||
|
||||
automake --add-missing
|
||||
aclocal
|
||||
autoconf
|
||||
|
||||
You now have a package that can be built in the normal fashion
|
||||
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
|
||||
|
||||
Notes:
|
||||
|
||||
* If you are converting a package that used a pre-1.0 version of
|
||||
GTK, you should remove the autoconf tests for X. The results
|
||||
of these tests are included in gtk-config and will be added
|
||||
to GTK_LIBS and GTK_CFLAGS by the AM_PATH_GTK macro.
|
||||
|
||||
Owen Taylor
|
||||
14 Mar 1997
|
||||
@@ -26,6 +26,9 @@
|
||||
<xi:include href="xml/regions.xml" />
|
||||
<xi:include href="xml/drawing.xml" />
|
||||
|
||||
<xi:include href="xml/pixmaps.xml" />
|
||||
<xi:include href="xml/pixbufs.xml" />
|
||||
|
||||
<xi:include href="xml/colors.xml" />
|
||||
<xi:include href="xml/visuals.xml" />
|
||||
|
||||
|
||||
@@ -47,7 +47,6 @@ gdk_beep
|
||||
<SUBSECTION>
|
||||
gdk_error_trap_push
|
||||
gdk_error_trap_pop
|
||||
gdk_error_trap_pop_ignored
|
||||
|
||||
<SUBSECTION>
|
||||
GDK_WINDOWING_X11
|
||||
@@ -190,7 +189,11 @@ gdk_display_manager_get_type
|
||||
<TITLE>GdkScreen</TITLE>
|
||||
GdkScreen
|
||||
gdk_screen_get_default
|
||||
gdk_screen_get_default_colormap
|
||||
gdk_screen_set_default_colormap
|
||||
gdk_screen_get_system_colormap
|
||||
gdk_screen_get_system_visual
|
||||
gdk_screen_get_rgba_colormap
|
||||
gdk_screen_get_rgba_visual
|
||||
gdk_screen_is_composited
|
||||
gdk_screen_get_root_window
|
||||
@@ -236,17 +239,50 @@ GdkScreenClass
|
||||
gdk_screen_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<TITLE>Bitmaps and Pixmaps</TITLE>
|
||||
<FILE>pixmaps</FILE>
|
||||
GdkPixmap
|
||||
gdk_pixmap_new
|
||||
GdkBitmap
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GDK_PIXMAP
|
||||
GDK_PIXMAP_GET_CLASS
|
||||
GDK_PIXMAP_OBJECT
|
||||
GDK_TYPE_PIXMAP
|
||||
GDK_IS_PIXMAP
|
||||
GDK_PIXMAP_CLASS
|
||||
GDK_IS_PIXMAP_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gdk_pixmap_get_type
|
||||
GdkPixmapObject
|
||||
GdkPixmapObjectClass
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<TITLE>Pixbufs</TITLE>
|
||||
<FILE>pixbufs</FILE>
|
||||
gdk_pixbuf_get_from_window
|
||||
gdk_pixbuf_render_threshold_alpha
|
||||
gdk_pixbuf_render_pixmap_and_mask
|
||||
gdk_pixbuf_render_pixmap_and_mask_for_colormap
|
||||
gdk_pixbuf_get_from_drawable
|
||||
gdk_pixbuf_get_from_surface
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<TITLE>Colors</TITLE>
|
||||
<TITLE>Colormaps and Colors</TITLE>
|
||||
<FILE>colors</FILE>
|
||||
GdkColor
|
||||
GdkColormap
|
||||
gdk_colormap_new
|
||||
gdk_colormap_get_system
|
||||
gdk_colormap_alloc_colors
|
||||
gdk_colormap_alloc_color
|
||||
gdk_colormap_free_colors
|
||||
gdk_colormap_get_visual
|
||||
gdk_colormap_get_screen
|
||||
gdk_color_copy
|
||||
gdk_color_free
|
||||
gdk_color_parse
|
||||
@@ -255,14 +291,31 @@ gdk_color_hash
|
||||
gdk_color_to_string
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GDK_COLORMAP
|
||||
GDK_COLORMAP_GET_CLASS
|
||||
GDK_TYPE_COLORMAP
|
||||
GDK_IS_COLORMAP
|
||||
GDK_COLORMAP_CLASS
|
||||
GDK_IS_COLORMAP_CLASS
|
||||
GDK_TYPE_COLOR
|
||||
|
||||
<SUBSECTION Private>
|
||||
GdkColormapClass
|
||||
gdk_colormap_get_type
|
||||
gdk_color_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<TITLE>Drawing Primitives</TITLE>
|
||||
<FILE>drawing</FILE>
|
||||
GdkDrawable
|
||||
gdk_drawable_get_display
|
||||
gdk_drawable_get_screen
|
||||
gdk_drawable_get_visual
|
||||
gdk_drawable_set_colormap
|
||||
gdk_drawable_get_colormap
|
||||
gdk_drawable_get_depth
|
||||
gdk_drawable_get_size
|
||||
gdk_drawable_get_clip_region
|
||||
gdk_drawable_get_visible_region
|
||||
|
||||
@@ -335,9 +388,6 @@ GdkWindowAttributesType
|
||||
gdk_window_new
|
||||
gdk_window_destroy
|
||||
gdk_window_get_window_type
|
||||
gdk_window_get_display
|
||||
gdk_window_get_screen
|
||||
gdk_window_get_visual
|
||||
gdk_window_at_pointer
|
||||
gdk_window_show
|
||||
gdk_window_show_unraised
|
||||
@@ -371,6 +421,9 @@ gdk_window_flush
|
||||
gdk_window_has_native
|
||||
gdk_window_ensure_native
|
||||
gdk_window_reparent
|
||||
gdk_window_clear
|
||||
gdk_window_clear_area
|
||||
gdk_window_clear_area_e
|
||||
gdk_window_raise
|
||||
gdk_window_lower
|
||||
gdk_window_restack
|
||||
@@ -389,7 +442,6 @@ gdk_window_end_paint
|
||||
<SUBSECTION>
|
||||
gdk_window_invalidate_rect
|
||||
gdk_window_invalidate_region
|
||||
GdkWindowChildFunc
|
||||
gdk_window_invalidate_maybe_recurse
|
||||
gdk_window_get_update_area
|
||||
gdk_window_freeze_updates
|
||||
@@ -397,6 +449,7 @@ gdk_window_thaw_updates
|
||||
gdk_window_process_all_updates
|
||||
gdk_window_process_updates
|
||||
gdk_window_set_debug_updates
|
||||
gdk_window_get_internal_paint_info
|
||||
gdk_window_enable_synchronized_configure
|
||||
gdk_window_configure_finished
|
||||
|
||||
@@ -412,16 +465,18 @@ gdk_window_remove_filter
|
||||
GdkFilterFunc
|
||||
GdkFilterReturn
|
||||
GdkXEvent
|
||||
gdk_window_shape_combine_mask
|
||||
gdk_window_shape_combine_region
|
||||
gdk_window_set_child_shapes
|
||||
gdk_window_merge_child_shapes
|
||||
gdk_window_input_shape_combine_mask
|
||||
gdk_window_input_shape_combine_region
|
||||
gdk_window_set_child_input_shapes
|
||||
gdk_window_merge_child_input_shapes
|
||||
gdk_window_set_static_gravities
|
||||
gdk_window_set_title
|
||||
gdk_window_set_background
|
||||
gdk_window_set_background_pattern
|
||||
gdk_window_set_back_pixmap
|
||||
gdk_window_get_background_pattern
|
||||
GDK_PARENT_RELATIVE
|
||||
gdk_window_set_cursor
|
||||
@@ -429,8 +484,6 @@ gdk_window_get_cursor
|
||||
gdk_window_get_user_data
|
||||
gdk_window_get_geometry
|
||||
gdk_window_set_geometry_hints
|
||||
gdk_window_get_width
|
||||
gdk_window_get_height
|
||||
gdk_window_set_icon_list
|
||||
gdk_window_set_modal_hint
|
||||
gdk_window_get_modal_hint
|
||||
@@ -443,6 +496,7 @@ gdk_window_get_position
|
||||
gdk_window_get_root_origin
|
||||
gdk_window_get_frame_extents
|
||||
gdk_window_get_origin
|
||||
gdk_window_get_deskrelative_origin
|
||||
gdk_window_get_root_coords
|
||||
gdk_window_get_pointer
|
||||
gdk_window_get_device_position
|
||||
@@ -453,6 +507,7 @@ gdk_window_get_children
|
||||
gdk_window_peek_children
|
||||
gdk_window_get_events
|
||||
gdk_window_set_events
|
||||
gdk_window_set_icon
|
||||
gdk_window_set_icon_name
|
||||
gdk_window_set_transient_for
|
||||
gdk_window_set_role
|
||||
@@ -479,10 +534,12 @@ GdkPointerHooks
|
||||
gdk_set_pointer_hooks
|
||||
|
||||
<SUBSECTION>
|
||||
gdk_offscreen_window_get_surface
|
||||
gdk_offscreen_window_get_pixmap
|
||||
gdk_offscreen_window_set_embedder
|
||||
gdk_offscreen_window_get_embedder
|
||||
gdk_window_geometry_changed
|
||||
gdk_window_redirect_to_drawable
|
||||
gdk_window_remove_redirection
|
||||
gdk_window_coords_from_parent
|
||||
gdk_window_coords_to_parent
|
||||
gdk_window_get_effective_parent
|
||||
@@ -593,14 +650,12 @@ gdk_pango_context_get_for_screen
|
||||
<FILE>cairo_interaction</FILE>
|
||||
gdk_window_create_similar_surface
|
||||
gdk_cairo_create
|
||||
gdk_cairo_get_clip_rectangle
|
||||
gdk_cairo_set_source_color
|
||||
gdk_cairo_set_source_pixbuf
|
||||
gdk_cairo_set_source_window
|
||||
gdk_cairo_set_source_pixmap
|
||||
gdk_cairo_rectangle
|
||||
gdk_cairo_region
|
||||
gdk_cairo_reset_clip
|
||||
gdk_cairo_region_create_from_surface
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
@@ -625,6 +680,7 @@ GDK_THREADS_LEAVE
|
||||
gdk_threads_init
|
||||
gdk_threads_enter
|
||||
gdk_threads_leave
|
||||
gdk_threads_mutex
|
||||
gdk_threads_set_lock_functions
|
||||
gdk_threads_add_idle
|
||||
gdk_threads_add_idle_full
|
||||
@@ -883,6 +939,7 @@ gdk_owner_change_get_type
|
||||
GdkCursor
|
||||
GdkCursorType
|
||||
gdk_cursor_new
|
||||
gdk_cursor_new_from_pixmap
|
||||
gdk_cursor_new_from_pixbuf
|
||||
gdk_cursor_new_from_name
|
||||
gdk_cursor_new_for_display
|
||||
@@ -949,24 +1006,35 @@ gdk_drag_context_get_type
|
||||
<TITLE>X Window System Interaction</TITLE>
|
||||
<FILE>x_interaction</FILE>
|
||||
GDK_ROOT_WINDOW
|
||||
GDK_DISPLAY
|
||||
GDK_WINDOW_XDISPLAY
|
||||
GDK_WINDOW_XID
|
||||
GDK_PIXMAP_XDISPLAY
|
||||
GDK_PIXMAP_XID
|
||||
GDK_DISPLAY_XDISPLAY
|
||||
GDK_DRAWABLE_XDISPLAY
|
||||
GDK_DRAWABLE_XID
|
||||
GDK_COLORMAP_XDISPLAY
|
||||
GDK_COLORMAP_XCOLORMAP
|
||||
GDK_SCREEN_XDISPLAY
|
||||
GDK_SCREEN_XNUMBER
|
||||
GDK_SCREEN_XSCREEN
|
||||
GDK_VISUAL_XVISUAL
|
||||
GDK_CURSOR_XCURSOR
|
||||
GDK_CURSOR_XDISPLAY
|
||||
GDK_WINDOW_XWINDOW
|
||||
gdkx_visual_get
|
||||
gdk_pixmap_foreign_new
|
||||
gdk_pixmap_foreign_new_for_display
|
||||
gdk_pixmap_foreign_new_for_screen
|
||||
gdk_window_foreign_new
|
||||
gdk_window_foreign_new_for_display
|
||||
gdk_xid_table_lookup
|
||||
gdk_xid_table_lookup_for_display
|
||||
gdk_window_lookup
|
||||
gdk_window_lookup_for_display
|
||||
gdk_pixmap_lookup
|
||||
gdk_pixmap_lookup_for_display
|
||||
gdk_x11_lookup_xdisplay
|
||||
gdk_x11_get_server_time
|
||||
gdk_net_wm_supports
|
||||
@@ -977,6 +1045,9 @@ gdk_x11_screen_lookup_visual
|
||||
gdk_x11_window_set_user_time
|
||||
gdk_x11_window_move_to_current_desktop
|
||||
gdk_x11_display_get_user_time
|
||||
gdk_x11_colormap_foreign_new
|
||||
gdk_x11_colormap_get_xcolormap
|
||||
gdk_x11_colormap_get_xdisplay
|
||||
gdk_x11_cursor_get_xcursor
|
||||
gdk_x11_cursor_get_xdisplay
|
||||
gdk_x11_display_broadcast_startup_message
|
||||
@@ -984,9 +1055,6 @@ gdk_x11_display_get_startup_notification_id
|
||||
gdk_x11_display_get_xdisplay
|
||||
gdk_x11_display_grab
|
||||
gdk_x11_display_ungrab
|
||||
gdk_x11_display_error_trap_push
|
||||
gdk_x11_display_error_trap_pop
|
||||
gdk_x11_display_error_trap_pop_ignored
|
||||
gdk_x11_display_set_cursor_theme
|
||||
gdk_x11_register_standard_event_type
|
||||
gdk_x11_drawable_get_xdisplay
|
||||
@@ -1009,8 +1077,10 @@ gdk_x11_get_xatom_name
|
||||
gdk_x11_get_xatom_name_for_display
|
||||
|
||||
<SUBSECTION Private>
|
||||
gdk_display
|
||||
GDK_HAVE_WCHAR_H
|
||||
GDK_HAVE_WCTYPE_H
|
||||
gdk_x11_pixmap_get_drawable_impl
|
||||
gdk_x11_window_get_drawable_impl
|
||||
</SECTION>
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ gdk_display_manager_get_type
|
||||
gdk_screen_get_type
|
||||
gdk_drawable_get_type
|
||||
gdk_window_object_get_type
|
||||
gdk_pixmap_get_type
|
||||
gdk_keymap_get_type
|
||||
gdk_device_get_type
|
||||
gdk_device_manager_get_type
|
||||
|
||||
4
docs/reference/gdk/tmpl/.gitignore
vendored
4
docs/reference/gdk/tmpl/.gitignore
vendored
@@ -1,6 +1,2 @@
|
||||
cairo_interaction.sgml
|
||||
colors.sgml
|
||||
dnd.sgml
|
||||
pixbufs.sgml
|
||||
regions.sgml
|
||||
windows.sgml
|
||||
|
||||
99
docs/reference/gdk/tmpl/cairo_interaction.sgml
Normal file
99
docs/reference/gdk/tmpl/cairo_interaction.sgml
Normal file
@@ -0,0 +1,99 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
Cairo Interaction
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
Functions to support using Cairo
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
<link href="http://cairographics.org">Cairo</link> is a graphics
|
||||
library that supports vector graphics and image compositing that
|
||||
can be used with GDK. Since 2.8, GTK+ does most of its drawing
|
||||
using Cairo.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
GDK does not wrap the Cairo API, instead it allows to create Cairo
|
||||
contexts which can be used to draw on GDK drawables. Additional
|
||||
functions allow to convert GDK's rectangles and regions into
|
||||
Cairo paths and to use pixbufs as sources for drawing operations.
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_cairo_create ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@drawable:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_cairo_set_source_color ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@cr:
|
||||
@color:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_cairo_set_source_pixbuf ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@cr:
|
||||
@pixbuf:
|
||||
@pixbuf_x:
|
||||
@pixbuf_y:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_cairo_set_source_pixmap ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@cr:
|
||||
@pixmap:
|
||||
@pixmap_x:
|
||||
@pixmap_y:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_cairo_rectangle ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@cr:
|
||||
@rectangle:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_cairo_region ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@cr:
|
||||
@region:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_cairo_reset_clip ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@cr:
|
||||
@drawable:
|
||||
|
||||
|
||||
185
docs/reference/gdk/tmpl/colors.sgml
Normal file
185
docs/reference/gdk/tmpl/colors.sgml
Normal file
@@ -0,0 +1,185 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
Colormaps and Colors
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
Manipulation of colors and colormaps
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
These functions are used to modify colormaps.
|
||||
A colormap is an object that contains the mapping
|
||||
between the color values stored in memory and
|
||||
the RGB values that are used to display color
|
||||
values. In general, colormaps only contain
|
||||
significant information for pseudo-color visuals,
|
||||
but even for other visual types, a colormap object
|
||||
is required in some circumstances.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
There are a couple of special colormaps that can
|
||||
be retrieved. The system colormap (retrieved
|
||||
with gdk_colormap_get_system()) is the default
|
||||
colormap of the system. If you are using GdkRGB,
|
||||
there is another colormap that is important - the
|
||||
colormap in which GdkRGB works, retrieved with
|
||||
gdk_rgb_get_colormap(). However, when using GdkRGB,
|
||||
it is not generally necessary to allocate colors
|
||||
directly.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
In previous revisions of this interface, a number
|
||||
of functions that take a #GdkColormap parameter
|
||||
were replaced with functions whose names began
|
||||
with "gdk_colormap_".
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GdkColor ##### -->
|
||||
<para>
|
||||
The #GdkColor structure is used to describe an
|
||||
allocated or unallocated color.
|
||||
</para>
|
||||
|
||||
@pixel: For allocated colors, the value used to
|
||||
draw this color on the screen.
|
||||
@red: The red component of the color. This is
|
||||
a value between 0 and 65535, with 65535 indicating
|
||||
full intensitiy.
|
||||
@green: The green component of the color.
|
||||
@blue: The blue component of the color.
|
||||
|
||||
<!-- ##### STRUCT GdkColormap ##### -->
|
||||
<para>
|
||||
The colormap structure contains the following public fields.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_colormap_new ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@visual:
|
||||
@allocate:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_colormap_get_system ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_colormap_alloc_colors ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@colormap:
|
||||
@colors:
|
||||
@n_colors:
|
||||
@writeable:
|
||||
@best_match:
|
||||
@success:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_colormap_alloc_color ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@colormap:
|
||||
@color:
|
||||
@writeable:
|
||||
@best_match:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_colormap_free_colors ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@colormap:
|
||||
@colors:
|
||||
@n_colors:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_colormap_get_visual ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@colormap:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_colormap_get_screen ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@cmap:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_color_copy ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@color:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_color_free ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@color:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_color_parse ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@spec:
|
||||
@color:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_color_equal ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@colora:
|
||||
@colorb:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_color_hash ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@colora:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_color_to_string ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@color:
|
||||
@Returns:
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ The standard cursors available.
|
||||
@GDK_LAST_CURSOR: last cursor type
|
||||
@GDK_BLANK_CURSOR: Blank cursor. Since 2.16
|
||||
@GDK_CURSOR_IS_PIXMAP: type of cursors constructed with
|
||||
gdk_cursor_new_from_pixbuf()
|
||||
gdk_cursor_new_from_pixmap() or gdk_cursor_new_from_pixbuf()
|
||||
|
||||
<!-- ##### FUNCTION gdk_cursor_new ##### -->
|
||||
<para>
|
||||
@@ -136,6 +136,19 @@ The standard cursors available.
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_cursor_new_from_pixmap ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@source:
|
||||
@mask:
|
||||
@fg:
|
||||
@bg:
|
||||
@x:
|
||||
@y:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_cursor_new_from_pixbuf ##### -->
|
||||
<para>
|
||||
|
||||
|
||||
@@ -45,6 +45,15 @@ or a #GdkWindow.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_drawable_get_display ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@drawable:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_drawable_get_screen ##### -->
|
||||
<para>
|
||||
|
||||
@@ -72,6 +81,15 @@ or a #GdkWindow.
|
||||
@colormap:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_drawable_get_colormap ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@drawable:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_drawable_get_depth ##### -->
|
||||
<para>
|
||||
|
||||
|
||||
@@ -326,6 +326,42 @@ available.
|
||||
|
||||
@void:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_error_trap_push ##### -->
|
||||
<para>
|
||||
This function allows X errors to be trapped instead of the normal behavior
|
||||
of exiting the application. It should only be used if it is not possible to
|
||||
avoid the X error in any other way.
|
||||
</para>
|
||||
<example>
|
||||
<title>Trapping an X error</title>
|
||||
<programlisting>
|
||||
gdk_error_trap_push (<!-- -->);
|
||||
|
||||
/* ... Call the X function which may cause an error here ... */
|
||||
|
||||
/* Flush the X queue to catch errors now. */
|
||||
gdk_flush (<!-- -->);
|
||||
|
||||
if (gdk_error_trap_pop (<!-- -->))
|
||||
{
|
||||
/* ... Handle the error here ... */
|
||||
}
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
@void:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_error_trap_pop ##### -->
|
||||
<para>
|
||||
Removes the X error trap installed with gdk_error_trap_push().
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns: the X error code, or 0 if no error occurred.
|
||||
|
||||
|
||||
<!-- ##### MACRO GDK_WINDOWING_X11 ##### -->
|
||||
<para>
|
||||
This macro is defined if GDK is configured to use the X11 backend.
|
||||
|
||||
@@ -11,12 +11,13 @@ They appear in the <structfield>keyval</structfield> field of the
|
||||
#GdkEventKey structure, which is passed to signal handlers for the
|
||||
"key-press-event" and "key-release-event" signals.
|
||||
The complete list of key values can be found in the <filename><gdk/gdkkeysyms.h></filename>
|
||||
header file.
|
||||
header file. <filename><gdk/gdkkeysyms.h></filename> is not included in <filename><gdk/gdk.h></filename>,
|
||||
it must be included independently, because the file is quite large.
|
||||
</para>
|
||||
<para>
|
||||
Key values are regularly updated from the upstream X.org X11 implementation,
|
||||
so new values are added regularly. They will be prefixed with GDK_KEY_ rather
|
||||
than XF86XK_ or XK_ (for older symbols).
|
||||
so new values are added regularly. They will be prefixed with GDK_ rather than
|
||||
XF86XK_ or XK_ (for older symbols).
|
||||
</para>
|
||||
<para>
|
||||
Key values can be converted into a string representation using
|
||||
@@ -29,7 +30,7 @@ gdk_keyval_is_lower(). Key values can be converted to upper or lower case
|
||||
using gdk_keyval_to_upper() and gdk_keyval_to_lower().
|
||||
</para>
|
||||
<para>
|
||||
When it makes sense, key values can be converted to and from
|
||||
When it makes sense, key values can be converted to and from
|
||||
Unicode characters with gdk_keyval_to_unicode() and gdk_unicode_to_keyval().
|
||||
</para>
|
||||
|
||||
@@ -269,7 +270,7 @@ Returns: %PANGO_DIRECTION_LTR or %PANGO_DIRECTION_RTL.
|
||||
<para>
|
||||
Converts a key value into a symbolic name.
|
||||
The names are the same as those in the <filename><gdk/gdkkeysyms.h></filename> header file
|
||||
but without the leading "GDK_KEY_".
|
||||
but without the leading "GDK_".
|
||||
</para>
|
||||
|
||||
@keyval: a key value.
|
||||
|
||||
101
docs/reference/gdk/tmpl/pixbufs.sgml
Normal file
101
docs/reference/gdk/tmpl/pixbufs.sgml
Normal file
@@ -0,0 +1,101 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
Pixbufs
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
Functions for rendering pixbufs on drawables
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
These functions allow to render pixbufs on drawables. Pixbufs are
|
||||
client-side images. For details on how to create and manipulate
|
||||
pixbufs, see the #GdkPixbuf API documentation.
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_pixbuf_render_threshold_alpha ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@pixbuf:
|
||||
@bitmap:
|
||||
@src_x:
|
||||
@src_y:
|
||||
@dest_x:
|
||||
@dest_y:
|
||||
@width:
|
||||
@height:
|
||||
@alpha_threshold:
|
||||
|
||||
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_pixbuf_render_pixmap_and_mask ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@pixbuf:
|
||||
@pixmap_return:
|
||||
@mask_return:
|
||||
@alpha_threshold:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_pixbuf_render_pixmap_and_mask_for_colormap ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@pixbuf:
|
||||
@colormap:
|
||||
@pixmap_return:
|
||||
@mask_return:
|
||||
@alpha_threshold:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_pixbuf_get_from_drawable ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@dest:
|
||||
@src:
|
||||
@cmap:
|
||||
@src_x:
|
||||
@src_y:
|
||||
@dest_x:
|
||||
@dest_y:
|
||||
@width:
|
||||
@height:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_pixbuf_get_from_surface ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@dest:
|
||||
@surface:
|
||||
@src_x:
|
||||
@src_y:
|
||||
@dest_x:
|
||||
@dest_y:
|
||||
@width:
|
||||
@height:
|
||||
@Returns:
|
||||
|
||||
|
||||
72
docs/reference/gdk/tmpl/regions.sgml
Normal file
72
docs/reference/gdk/tmpl/regions.sgml
Normal file
@@ -0,0 +1,72 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
Points and Rectangles
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
Simple graphical data types
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
GDK provides the #GdkPoint and #GdkRectangle data types for representing pixels
|
||||
and sets of pixels on the screen. Together with Cairo's #cairo_region_t data
|
||||
type, they make up the central types for representing graphical data.
|
||||
</para>
|
||||
<para>
|
||||
#GdkPoint is a simple structure containing an x and y coordinate of a point.
|
||||
</para>
|
||||
<para>
|
||||
#GdkRectangle is a structure holding the position and size of a rectangle.
|
||||
The intersection of two rectangles can be computed with
|
||||
gdk_rectangle_intersect(). To find the union of two rectangles use
|
||||
gdk_rectangle_union().
|
||||
</para>
|
||||
<para>
|
||||
#cairo_region_t is usually used for managing clipping of graphical operations.
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GdkPoint ##### -->
|
||||
<para>
|
||||
Defines the x and y coordinates of a point.
|
||||
</para>
|
||||
|
||||
@x: the x coordinate of the point.
|
||||
@y: the y coordinate of the point.
|
||||
|
||||
<!-- ##### TYPEDEF GdkRectangle ##### -->
|
||||
<para>
|
||||
Defines the position and size of a rectangle. It is identical to
|
||||
#cairo_rectangle_int_t.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_rectangle_intersect ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@src1:
|
||||
@src2:
|
||||
@dest:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_rectangle_union ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@src1:
|
||||
@src2:
|
||||
@dest:
|
||||
|
||||
|
||||
@@ -300,6 +300,13 @@ Leaves a critical region begun with gdk_threads_enter().
|
||||
@void:
|
||||
|
||||
|
||||
<!-- ##### VARIABLE gdk_threads_mutex ##### -->
|
||||
<para>
|
||||
The #GMutex used to implement the critical region for
|
||||
gdk_threads_enter()/gdk_threads_leave().
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gdk_threads_set_lock_functions ##### -->
|
||||
<para>
|
||||
|
||||
|
||||
@@ -18,8 +18,12 @@ of an RGB pixel may be in the top 8 bits of the pixel, or may be in the lower
|
||||
</para>
|
||||
<para>
|
||||
There are several standard visuals. The visual returned
|
||||
by gdk_screen_get_system_visual() is the system's default
|
||||
visual.
|
||||
by gdk_visual_get_system() is the system's default
|
||||
visual. gdk_rgb_get_visual() return the visual most
|
||||
suited to displaying full-color image data. If you
|
||||
use the calls in #GdkRGB, you should create your windows
|
||||
using this visual (and the colormap returned by
|
||||
gdk_rgb_get_colormap()).
|
||||
</para>
|
||||
<para>
|
||||
A number of functions are provided for determining
|
||||
|
||||
@@ -145,125 +145,125 @@ expand_content_files = \
|
||||
|
||||
# Images to copy into HTML directory
|
||||
HTML_IMAGES = \
|
||||
$(top_srcdir)/gtk/stock-icons/24/help-about.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/list-add.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-about.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-add.png \
|
||||
$(top_srcdir)/gtk/stock-icons/20/gtk-apply.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/format-text-bold.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-bold.png \
|
||||
$(top_srcdir)/gtk/stock-icons/20/gtk-cancel.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-caps-lock-warning.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/media-optical.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/edit-clear.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/window-close.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-cdrom.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-clear.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-close.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-connect.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-convert.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/edit-copy.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/edit-cut.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/edit-delete.png \
|
||||
$(top_srcdir)/gtk/stock-icons/48/dialog-password.png \
|
||||
$(top_srcdir)/gtk/stock-icons/48/dialog-error.png \
|
||||
$(top_srcdir)/gtk/stock-icons/48/dialog-information.png \
|
||||
$(top_srcdir)/gtk/stock-icons/48/dialog-question.png \
|
||||
$(top_srcdir)/gtk/stock-icons/48/dialog-warning.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/folder.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-copy.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-cut.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-delete.png \
|
||||
$(top_srcdir)/gtk/stock-icons/48/gtk-dialog-authentication.png \
|
||||
$(top_srcdir)/gtk/stock-icons/48/gtk-dialog-error.png \
|
||||
$(top_srcdir)/gtk/stock-icons/48/gtk-dialog-info.png \
|
||||
$(top_srcdir)/gtk/stock-icons/48/gtk-dialog-question.png \
|
||||
$(top_srcdir)/gtk/stock-icons/48/gtk-dialog-warning.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-directory.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-disconnect.png \
|
||||
$(top_srcdir)/gtk/stock-icons/32/gtk-dnd.png \
|
||||
$(top_srcdir)/gtk/stock-icons/32/gtk-dnd-multiple.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-edit.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/system-run.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/document-x-generic.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/edit-find.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/edit-find-replace.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/go-bottom.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/go-first-ltr.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/go-first-rtl.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/go-last-ltr.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/go-last-rtl.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/go-top.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/go-previous-ltr.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/go-previous-rtl.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/go-down.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/go-next-ltr.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/go-next-rtl.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/go-up.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/drive-harddisk.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/network-idle.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/help-contents.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/go-home.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-execute.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-file.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-find.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-find-and-replace.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-goto-bottom.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-goto-first-ltr.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-goto-first-rtl.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-goto-last-ltr.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-goto-last-rtl.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-goto-top.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-go-back-ltr.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-go-back-rtl.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-go-down.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-go-forward-ltr.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-go-forward-rtl.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-go-up.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-harddisk.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-network.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-help.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-home.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-index.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/format-indent-more-ltr.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/format-indent-more-rtl.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/format-indent-less-ltr.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/format-indent-less-rtl.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/format-text-italic.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/go-jump-ltr.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/go-jump-rtl.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/format-justify-center.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/format-justify-fill.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/format-justify-left.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/format-justify-right.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/image-missing.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/document-new.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-indent-ltr.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-indent-rtl.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-unindent-ltr.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-unindent-rtl.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-italic.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-jump-to-ltr.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-jump-to-rtl.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-justify-center.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-justify-fill.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-justify-left.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-justify-right.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-missing-image.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-new.png \
|
||||
$(top_srcdir)/gtk/stock-icons/20/gtk-no.png \
|
||||
$(top_srcdir)/gtk/stock-icons/20/gtk-ok.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/document-open.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-open.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-orientation-landscape.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-orientation-portrait.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-orientation-reverse-landscape.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-orientation-reverse-portrait.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/edit-paste.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-paste.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-preferences.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/document-print.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/printer-error.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/printer-paused.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/document-print-preview.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/printer-info.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/printer-warning.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/document-properties.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/application-exit.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/edit-redo-ltr.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/edit-redo-rtl.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/view-refresh.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/list-remove.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/document-revert-ltr.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/document-revert-rtl.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/media-floppy.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/document-save.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/document-save-as.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/edit-select-all.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-print.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-print-error.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-print-paused.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-print-preview.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-print-report.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-print-warning.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-properties.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-quit.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-redo-ltr.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-redo-rtl.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-refresh.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-remove.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-revert-to-saved-ltr.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-revert-to-saved-rtl.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-floppy.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-save.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-save-as.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-select-all.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-select-color.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-color-picker.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-font.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/view-sort-ascending.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/view-sort-descending.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/tools-check-spelling.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/process-stop.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/format-text-strikethrough.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-sort-ascending.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-sort-descending.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-spell-check.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-stop.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-strikethrough.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-undelete-ltr.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-undelete-rtl.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/format-text-underline.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/edit-undo-ltr.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/edit-undo-rtl.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-underline.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-undo-ltr.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-undo-rtl.png \
|
||||
$(top_srcdir)/gtk/stock-icons/20/gtk-yes.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/zoom-original.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/zoom-fit-best.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/zoom-in.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/zoom-out.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/media-seek-forward-ltr.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/media-seek-forward-rtl.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/media-skip-forward-ltr.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/media-skip-forward-rtl.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/media-playback-pause.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/media-playback-start-ltr.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/media-playback-start-rtl.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/media-seek-backward-ltr.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/media-seek-backward-rtl.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/media-record.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/media-skip-backward-ltr.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/media-skip-backward-rtl.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/media-playback-stop.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/view-fullscreen.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/view-restore.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-page-setup.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-zoom-100.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-zoom-fit.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-zoom-in.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-zoom-out.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-media-forward-ltr.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-media-forward-rtl.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-media-next-ltr.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-media-next-rtl.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-media-pause.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-media-play-ltr.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-media-play-rtl.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-media-previous-ltr.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-media-previous-rtl.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-media-record.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-media-rewind-ltr.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-media-rewind-rtl.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-media-stop.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-fullscreen.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-leave-fullscreen.png \
|
||||
$(top_srcdir)/gtk/stock-icons/24/gtk-info.png \
|
||||
$(srcdir)/images/aboutdialog.png \
|
||||
$(srcdir)/images/accel-label.png \
|
||||
$(srcdir)/images/assistant.png \
|
||||
|
||||
@@ -330,8 +330,8 @@ How to compile GTK+ itself
|
||||
<arg>--enable-debug=[no|minimum|yes]</arg>
|
||||
</group>
|
||||
<group>
|
||||
<arg>--disable-Bsymbolic</arg>
|
||||
<arg>--enable-Bsymbolic</arg>
|
||||
<arg>--disable-visibility</arg>
|
||||
<arg>--enable-visibility</arg>
|
||||
</group>
|
||||
<group>
|
||||
<arg>--disable-shm</arg>
|
||||
@@ -398,7 +398,7 @@ How to compile GTK+ itself
|
||||
|
||||
<formalpara>
|
||||
<title><systemitem>--enable-debug</systemitem></title>
|
||||
|
||||
|
||||
<para>
|
||||
Turns on various amounts of debugging support. Setting this to 'no'
|
||||
disables g_assert(), g_return_if_fail(), g_return_val_if_fail() and
|
||||
@@ -415,11 +415,15 @@ How to compile GTK+ itself
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
<title><systemitem>--disable-Bsymbolic</systemitem> and
|
||||
<systemitem>--enable-Bsymbolic</systemitem></title>
|
||||
<title><systemitem>--disable-visibility</systemitem> and
|
||||
<systemitem>--enable-visibility</systemitem></title>
|
||||
<para>
|
||||
The option <systemitem>--disable-Bsymbolic</systemitem>
|
||||
turns off the use of the -Bsymbolic-functions linker flag.
|
||||
The option <systemitem>--disable-visibility</systemitem>
|
||||
turns off the use of ELF visibility attributes for linking
|
||||
optimizations. This makes sense while changing GTK+ itself,
|
||||
since the way in which GTK+ uses visibility attributes
|
||||
forces a full rebuild of all source files for any header
|
||||
modification.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'">
|
||||
<!ENTITY version SYSTEM "version.xml">
|
||||
]>
|
||||
<!--ENTITY index-Objects-Grouped SYSTEM "objects_grouped.sgml"-->
|
||||
<book id="index" xmlns:xi="http://www.w3.org/2003/XInclude">
|
||||
<bookinfo>
|
||||
<title>GTK+ Reference Manual</title>
|
||||
@@ -141,6 +142,7 @@ that is, GUI components such as #GtkButton or #GtkTextView.
|
||||
<xi:include href="xml/gtkstyle.xml" />
|
||||
<xi:include href="xml/gtkselection.xml" />
|
||||
<xi:include href="xml/gtkfeatures.xml" />
|
||||
<xi:include href="xml/gtktypeutils.xml" />
|
||||
<xi:include href="xml/gtktesting.xml" />
|
||||
<xi:include href="xml/filesystem.xml" />
|
||||
</part>
|
||||
@@ -280,7 +282,7 @@ that is, GUI components such as #GtkButton or #GtkTextView.
|
||||
</chapter>
|
||||
|
||||
<chapter id="SelectorWidgets">
|
||||
<title>Selectors (Color/File/Font)</title>
|
||||
<title>Selectors (File/Font/Color/Input Devices)</title>
|
||||
<xi:include href="xml/gtkcolorbutton.xml" />
|
||||
<xi:include href="xml/gtkcolorseldlg.xml" />
|
||||
<xi:include href="xml/gtkcolorsel.xml" />
|
||||
@@ -305,7 +307,6 @@ that is, GUI components such as #GtkButton or #GtkTextView.
|
||||
<xi:include href="xml/gtkbbox.xml" />
|
||||
<xi:include href="xml/gtkhbbox.xml" />
|
||||
<xi:include href="xml/gtkvbbox.xml" />
|
||||
<xi:include href="xml/gtkwrapbox.xml" />
|
||||
<xi:include href="xml/gtkfixed.xml" />
|
||||
<xi:include href="xml/gtkpaned.xml" />
|
||||
<xi:include href="xml/gtkhpaned.xml" />
|
||||
@@ -367,8 +368,10 @@ that is, GUI components such as #GtkButton or #GtkTextView.
|
||||
<title>Abstract Base Classes</title>
|
||||
<xi:include href="xml/gtkbin.xml" />
|
||||
<xi:include href="xml/gtkcontainer.xml" />
|
||||
<xi:include href="xml/gtkitem.xml" />
|
||||
<xi:include href="xml/gtkmenushell.xml" />
|
||||
<xi:include href="xml/gtkmisc.xml" />
|
||||
<xi:include href="xml/gtkobject.xml" />
|
||||
<xi:include href="xml/gtkrange.xml" />
|
||||
<xi:include href="xml/gtkwidget.xml" />
|
||||
<xi:include href="xml/gtkimcontext.xml" />
|
||||
|
||||
@@ -37,6 +37,9 @@ gtk_about_dialog_get_logo
|
||||
gtk_about_dialog_set_logo
|
||||
gtk_about_dialog_get_logo_icon_name
|
||||
gtk_about_dialog_set_logo_icon_name
|
||||
GtkAboutDialogActivateLinkFunc
|
||||
gtk_about_dialog_set_email_hook
|
||||
gtk_about_dialog_set_url_hook
|
||||
gtk_show_about_dialog
|
||||
<SUBSECTION Standard>
|
||||
GTK_ABOUT_DIALOG
|
||||
@@ -591,7 +594,6 @@ gtk_calendar_select_month
|
||||
gtk_calendar_select_day
|
||||
gtk_calendar_mark_day
|
||||
gtk_calendar_unmark_day
|
||||
gtk_calendar_get_day_is_marked
|
||||
gtk_calendar_clear_marks
|
||||
|
||||
<SUBSECTION>
|
||||
@@ -865,15 +867,13 @@ gtk_container_child_set_valist
|
||||
gtk_container_forall
|
||||
gtk_container_get_border_width
|
||||
gtk_container_set_border_width
|
||||
gtk_container_propagate_draw
|
||||
gtk_container_propagate_expose
|
||||
gtk_container_get_focus_chain
|
||||
gtk_container_set_focus_chain
|
||||
gtk_container_unset_focus_chain
|
||||
gtk_container_class_find_child_property
|
||||
gtk_container_class_install_child_property
|
||||
gtk_container_class_list_child_properties
|
||||
gtk_container_class_handle_border_width
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_CONTAINER
|
||||
GTK_IS_CONTAINER
|
||||
@@ -898,7 +898,9 @@ gtk_dialog_response
|
||||
gtk_dialog_add_button
|
||||
gtk_dialog_add_buttons
|
||||
gtk_dialog_add_action_widget
|
||||
gtk_dialog_get_has_separator
|
||||
gtk_dialog_set_default_response
|
||||
gtk_dialog_set_has_separator
|
||||
gtk_dialog_set_response_sensitive
|
||||
gtk_dialog_get_response_for_widget
|
||||
gtk_dialog_get_widget_for_response
|
||||
@@ -1610,8 +1612,8 @@ gtk_icon_view_get_cursor
|
||||
gtk_icon_view_selected_foreach
|
||||
gtk_icon_view_set_selection_mode
|
||||
gtk_icon_view_get_selection_mode
|
||||
gtk_icon_view_set_item_orientation
|
||||
gtk_icon_view_get_item_orientation
|
||||
gtk_icon_view_set_orientation
|
||||
gtk_icon_view_get_orientation
|
||||
gtk_icon_view_set_columns
|
||||
gtk_icon_view_get_columns
|
||||
gtk_icon_view_set_item_width
|
||||
@@ -1674,6 +1676,7 @@ GtkImage
|
||||
GtkImageType
|
||||
gtk_image_get_icon_set
|
||||
gtk_image_get_pixbuf
|
||||
gtk_image_get_pixmap
|
||||
gtk_image_get_stock
|
||||
gtk_image_get_animation
|
||||
gtk_image_get_icon_name
|
||||
@@ -1682,6 +1685,7 @@ gtk_image_get_storage_type
|
||||
gtk_image_new_from_file
|
||||
gtk_image_new_from_icon_set
|
||||
gtk_image_new_from_pixbuf
|
||||
gtk_image_new_from_pixmap
|
||||
gtk_image_new_from_stock
|
||||
gtk_image_new_from_animation
|
||||
gtk_image_new_from_icon_name
|
||||
@@ -1689,6 +1693,7 @@ gtk_image_new_from_gicon
|
||||
gtk_image_set_from_file
|
||||
gtk_image_set_from_icon_set
|
||||
gtk_image_set_from_pixbuf
|
||||
gtk_image_set_from_pixmap
|
||||
gtk_image_set_from_stock
|
||||
gtk_image_set_from_animation
|
||||
gtk_image_set_from_icon_name
|
||||
@@ -1828,6 +1833,24 @@ GTK_INVISIBLE_GET_CLASS
|
||||
gtk_invisible_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkitem</FILE>
|
||||
<TITLE>GtkItem</TITLE>
|
||||
GtkItem
|
||||
gtk_item_select
|
||||
gtk_item_deselect
|
||||
gtk_item_toggle
|
||||
<SUBSECTION Standard>
|
||||
GTK_ITEM
|
||||
GTK_IS_ITEM
|
||||
GTK_TYPE_ITEM
|
||||
GTK_ITEM_CLASS
|
||||
GTK_IS_ITEM_CLASS
|
||||
GTK_ITEM_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
gtk_item_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtklabel</FILE>
|
||||
<TITLE>GtkLabel</TITLE>
|
||||
@@ -1921,6 +1944,8 @@ gtk_link_button_new
|
||||
gtk_link_button_new_with_label
|
||||
gtk_link_button_get_uri
|
||||
gtk_link_button_set_uri
|
||||
GtkLinkButtonUriFunc
|
||||
gtk_link_button_set_uri_hook
|
||||
gtk_link_button_get_visited
|
||||
gtk_link_button_set_visited
|
||||
|
||||
@@ -2218,10 +2243,12 @@ gtk_notebook_get_tab_detachable
|
||||
gtk_notebook_get_tab_hborder
|
||||
gtk_notebook_get_tab_vborder
|
||||
gtk_notebook_set_current_page
|
||||
gtk_notebook_set_group_name
|
||||
gtk_notebook_get_group_name
|
||||
gtk_notebook_set_group
|
||||
gtk_notebook_get_group
|
||||
gtk_notebook_set_action_widget
|
||||
gtk_notebook_get_action_widget
|
||||
GtkNotebookWindowCreationFunc
|
||||
gtk_notebook_set_window_creation_hook
|
||||
<SUBSECTION Standard>
|
||||
GTK_NOTEBOOK
|
||||
GTK_IS_NOTEBOOK
|
||||
@@ -2235,12 +2262,34 @@ GtkNotebookTab
|
||||
GtkNotebookPrivate
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkobject</FILE>
|
||||
<TITLE>GtkObject</TITLE>
|
||||
GtkObject
|
||||
GtkObjectFlags
|
||||
GTK_OBJECT_FLAGS
|
||||
gtk_object_destroy
|
||||
<SUBSECTION Standard>
|
||||
GTK_OBJECT
|
||||
GTK_IS_OBJECT
|
||||
GTK_TYPE_OBJECT
|
||||
GTK_OBJECT_CLASS
|
||||
GTK_IS_OBJECT_CLASS
|
||||
GTK_OBJECT_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_object_get_type
|
||||
GTK_ARG_READWRITE
|
||||
GTK_OBJECT_SET_FLAGS
|
||||
GTK_OBJECT_UNSET_FLAGS
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkoffscreenwindow</FILE>
|
||||
<TITLE>GtkOffscreenWindow</TITLE>
|
||||
GtkOffscreenWindow
|
||||
gtk_offscreen_window_new
|
||||
gtk_offscreen_window_get_surface
|
||||
gtk_offscreen_window_get_pixmap
|
||||
gtk_offscreen_window_get_pixbuf
|
||||
<SUBSECTION Standard>
|
||||
GTK_OFFSCREEN_WINDOW
|
||||
@@ -2311,8 +2360,9 @@ gtk_progress_bar_new
|
||||
gtk_progress_bar_pulse
|
||||
gtk_progress_bar_set_fraction
|
||||
gtk_progress_bar_get_fraction
|
||||
gtk_progress_bar_set_inverted
|
||||
gtk_progress_bar_get_inverted
|
||||
GtkProgressBarOrientation
|
||||
gtk_progress_bar_set_orientation
|
||||
gtk_progress_bar_get_orientation
|
||||
gtk_progress_bar_set_show_text
|
||||
gtk_progress_bar_get_show_text
|
||||
gtk_progress_bar_set_text
|
||||
@@ -2367,7 +2417,6 @@ gtk_radio_button_new_with_mnemonic
|
||||
gtk_radio_button_new_with_mnemonic_from_widget
|
||||
gtk_radio_button_set_group
|
||||
gtk_radio_button_get_group
|
||||
gtk_radio_button_join_group
|
||||
<SUBSECTION Standard>
|
||||
GTK_RADIO_BUTTON
|
||||
GTK_IS_RADIO_BUTTON
|
||||
@@ -2686,6 +2735,8 @@ GTK_RULER_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkRulerPrivate
|
||||
gtk_ruler_get_type
|
||||
gtk_ruler_draw_ticks
|
||||
gtk_ruler_draw_pos
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
@@ -3019,6 +3070,8 @@ gtk_status_icon_get_title
|
||||
gtk_status_icon_set_name
|
||||
gtk_status_icon_set_visible
|
||||
gtk_status_icon_get_visible
|
||||
gtk_status_icon_set_blinking
|
||||
gtk_status_icon_get_blinking
|
||||
gtk_status_icon_is_embedded
|
||||
gtk_status_icon_position_menu
|
||||
gtk_status_icon_get_geometry
|
||||
@@ -4352,16 +4405,6 @@ gtk_cell_renderer_set_alignment
|
||||
gtk_cell_renderer_get_padding
|
||||
gtk_cell_renderer_set_padding
|
||||
|
||||
<SUBSECTION Width-for-height>
|
||||
gtk_cell_renderer_get_preferred_height
|
||||
gtk_cell_renderer_get_preferred_height_for_width
|
||||
gtk_cell_renderer_get_preferred_size
|
||||
gtk_cell_renderer_get_preferred_width
|
||||
gtk_cell_renderer_get_preferred_width_for_height
|
||||
gtk_cell_renderer_get_request_mode
|
||||
gtk_cell_view_get_desired_height_for_width_of_row
|
||||
gtk_cell_view_get_desired_width_of_row
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_CELL_RENDERER
|
||||
GTK_IS_CELL_RENDERER
|
||||
@@ -4729,15 +4772,19 @@ gtk_vseparator_get_type
|
||||
<TITLE>GtkWidget</TITLE>
|
||||
GtkWidget
|
||||
GtkWidgetClass
|
||||
GtkWidgetFlags
|
||||
GTK_WIDGET_FLAGS
|
||||
GTK_WIDGET_SET_FLAGS
|
||||
GTK_WIDGET_UNSET_FLAGS
|
||||
GtkCallback
|
||||
GtkRequisition
|
||||
GtkAllocation
|
||||
GtkSelectionData
|
||||
GtkWidgetAuxInfo
|
||||
GtkWidgetShapeInfo
|
||||
GtkWidgetHelpType
|
||||
gtk_widget_new
|
||||
gtk_widget_destroy
|
||||
gtk_widget_in_destruction
|
||||
gtk_widget_destroyed
|
||||
gtk_widget_unparent
|
||||
gtk_widget_show
|
||||
@@ -4749,7 +4796,6 @@ gtk_widget_map
|
||||
gtk_widget_unmap
|
||||
gtk_widget_realize
|
||||
gtk_widget_unrealize
|
||||
gtk_widget_draw
|
||||
gtk_widget_queue_draw
|
||||
gtk_widget_queue_resize
|
||||
gtk_widget_queue_resize_no_redraw
|
||||
@@ -4785,8 +4831,9 @@ gtk_widget_get_device_events
|
||||
gtk_widget_add_device_events
|
||||
gtk_widget_get_toplevel
|
||||
gtk_widget_get_ancestor
|
||||
gtk_widget_get_colormap
|
||||
gtk_widget_set_colormap
|
||||
gtk_widget_get_visual
|
||||
gtk_widget_set_visual
|
||||
gtk_widget_get_pointer
|
||||
gtk_widget_is_ancestor
|
||||
gtk_widget_translate_coordinates
|
||||
@@ -4795,14 +4842,19 @@ gtk_widget_set_style
|
||||
gtk_widget_ensure_style
|
||||
gtk_widget_get_style
|
||||
gtk_widget_reset_rc_styles
|
||||
gtk_widget_push_colormap
|
||||
gtk_widget_pop_colormap
|
||||
gtk_widget_set_default_colormap
|
||||
gtk_widget_get_default_style
|
||||
gtk_widget_get_default_colormap
|
||||
gtk_widget_get_default_visual
|
||||
gtk_widget_set_direction
|
||||
GtkTextDirection
|
||||
gtk_widget_get_direction
|
||||
gtk_widget_set_default_direction
|
||||
gtk_widget_get_default_direction
|
||||
gtk_widget_shape_combine_region
|
||||
gtk_widget_input_shape_combine_region
|
||||
gtk_widget_shape_combine_mask
|
||||
gtk_widget_input_shape_combine_mask
|
||||
gtk_widget_path
|
||||
gtk_widget_class_path
|
||||
gtk_widget_get_composite_name
|
||||
@@ -4873,11 +4925,8 @@ gtk_widget_set_tooltip_window
|
||||
gtk_widget_get_has_tooltip
|
||||
gtk_widget_set_has_tooltip
|
||||
gtk_widget_trigger_tooltip_query
|
||||
gtk_widget_get_snapshot
|
||||
gtk_widget_get_window
|
||||
gtk_cairo_should_draw_window
|
||||
gtk_cairo_transform_to_window
|
||||
gtk_widget_get_allocated_width
|
||||
gtk_widget_get_allocated_height
|
||||
gtk_widget_get_allocation
|
||||
gtk_widget_set_allocation
|
||||
gtk_widget_get_app_paintable
|
||||
@@ -4916,21 +4965,6 @@ gtk_requisition_new
|
||||
gtk_requisition_copy
|
||||
gtk_requisition_free
|
||||
|
||||
<SUBSECTION>
|
||||
GtkAlign
|
||||
gtk_widget_get_halign
|
||||
gtk_widget_set_halign
|
||||
gtk_widget_get_valign
|
||||
gtk_widget_set_valign
|
||||
gtk_widget_get_margin_left
|
||||
gtk_widget_set_margin_left
|
||||
gtk_widget_get_margin_right
|
||||
gtk_widget_set_margin_right
|
||||
gtk_widget_get_margin_top
|
||||
gtk_widget_set_margin_top
|
||||
gtk_widget_get_margin_bottom
|
||||
gtk_widget_set_margin_bottom
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_WIDGET
|
||||
GTK_IS_WIDGET
|
||||
@@ -4940,7 +4974,6 @@ GTK_IS_WIDGET_CLASS
|
||||
GTK_WIDGET_GET_CLASS
|
||||
GTK_TYPE_REQUISITION
|
||||
<SUBSECTION Private>
|
||||
GtkWidgetPrivate
|
||||
gtk_widget_get_type
|
||||
gtk_requisition_get_type
|
||||
</SECTION>
|
||||
@@ -5060,7 +5093,6 @@ GTK_IS_WINDOW_CLASS
|
||||
GTK_WINDOW_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
GtkWindowPrivate
|
||||
gtk_window_get_type
|
||||
GtkWindowGeometryInfo
|
||||
gtk_window_remove_embedded_xid
|
||||
@@ -5124,12 +5156,9 @@ gtk_device_grab_add
|
||||
gtk_device_grab_remove
|
||||
|
||||
<SUBSECTION>
|
||||
GtkFunction
|
||||
gtk_init_add
|
||||
gtk_quit_add_destroy
|
||||
gtk_quit_add
|
||||
GtkCallbackMarshal
|
||||
GtkArg
|
||||
gtk_quit_add_full
|
||||
gtk_quit_remove
|
||||
gtk_quit_remove_by_data
|
||||
@@ -5160,11 +5189,11 @@ GTKMAIN_C_VAR
|
||||
<SECTION>
|
||||
<FILE>gtkfeatures</FILE>
|
||||
<TITLE>Feature Test Macros</TITLE>
|
||||
gtk_get_major_version
|
||||
gtk_get_minor_version
|
||||
gtk_get_micro_version
|
||||
gtk_get_binary_age
|
||||
gtk_get_interface_age
|
||||
gtk_major_version
|
||||
gtk_minor_version
|
||||
gtk_micro_version
|
||||
gtk_binary_age
|
||||
gtk_interface_age
|
||||
gtk_check_version
|
||||
|
||||
<SUBSECTION>
|
||||
@@ -5415,13 +5444,14 @@ gtk_drag_unhighlight
|
||||
<SUBSECTION Source Side>
|
||||
gtk_drag_begin
|
||||
gtk_drag_set_icon_widget
|
||||
gtk_drag_set_icon_pixmap
|
||||
gtk_drag_set_icon_pixbuf
|
||||
gtk_drag_set_icon_stock
|
||||
gtk_drag_set_icon_surface
|
||||
gtk_drag_set_icon_name
|
||||
gtk_drag_set_icon_default
|
||||
gtk_drag_check_threshold
|
||||
gtk_drag_source_set
|
||||
gtk_drag_source_set_icon
|
||||
gtk_drag_source_set_icon_pixbuf
|
||||
gtk_drag_source_set_icon_stock
|
||||
gtk_drag_source_set_icon_name
|
||||
@@ -5433,6 +5463,17 @@ gtk_drag_source_add_image_targets
|
||||
gtk_drag_source_add_uri_targets
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtktypeutils</FILE>
|
||||
<TITLE>Types</TITLE>
|
||||
GtkFunction
|
||||
GtkCallbackMarshal
|
||||
GtkArg
|
||||
<SUBSECTION Private>
|
||||
GTK_TYPE_IDENTIFIER
|
||||
gtk_identifier_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkbindings</FILE>
|
||||
<TITLE>Bindings</TITLE>
|
||||
@@ -5457,6 +5498,7 @@ gtk_binding_set_add_path
|
||||
<FILE>gtkenums</FILE>
|
||||
<TITLE>Standard Enumerations</TITLE>
|
||||
GtkAccelFlags
|
||||
GtkAnchorType
|
||||
GtkArrowPlacement
|
||||
GtkArrowType
|
||||
GtkAttachOptions
|
||||
@@ -5487,6 +5529,7 @@ GtkSubmenuDirection
|
||||
GtkSubmenuPlacement
|
||||
GtkToolbarStyle
|
||||
GtkUpdateType
|
||||
GtkVisibility
|
||||
GtkWindowPosition
|
||||
GtkWindowType
|
||||
GtkSortType
|
||||
@@ -6268,14 +6311,16 @@ gtk_orientable_get_type
|
||||
<SECTION>
|
||||
<FILE>gtksizerequest</FILE>
|
||||
<TITLE>GtkSizeRequest</TITLE>
|
||||
GtkSizeRequest
|
||||
GtkSizeRequestIface
|
||||
GtkSizeRequestMode
|
||||
GtkRequestedSize
|
||||
gtk_widget_get_preferred_height
|
||||
gtk_widget_get_preferred_width
|
||||
gtk_widget_get_preferred_height_for_width
|
||||
gtk_widget_get_preferred_width_for_height
|
||||
gtk_widget_get_request_mode
|
||||
gtk_widget_get_preferred_size
|
||||
gtk_size_request_get_height
|
||||
gtk_size_request_get_width
|
||||
gtk_size_request_get_height_for_width
|
||||
gtk_size_request_get_width_for_height
|
||||
gtk_size_request_get_request_mode
|
||||
gtk_size_request_get_size
|
||||
gtk_distribute_natural_allocation
|
||||
|
||||
<SUBSECTION Standard>
|
||||
@@ -6286,7 +6331,7 @@ GTK_IS_SIZE_REQUEST
|
||||
GTK_TYPE_SIZE_REQUEST
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_widget_get_type
|
||||
gtk_size_request_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
@@ -6315,42 +6360,3 @@ GTK_APPLICATION_GET_CLASS
|
||||
gtk_application_get_type
|
||||
GtkApplicationPrivate
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkwrapbox</FILE>
|
||||
<TITLE>GtkWrapBox</TITLE>
|
||||
GtkWrapBox
|
||||
gtk_wrap_box_new
|
||||
GtkWrapBoxPacking
|
||||
gtk_wrap_box_insert_child
|
||||
gtk_wrap_box_reorder_child
|
||||
GtkWrapAllocationMode
|
||||
gtk_wrap_box_set_allocation_mode
|
||||
gtk_wrap_box_get_allocation_mode
|
||||
GtkWrapBoxSpreading
|
||||
gtk_wrap_box_set_vertical_spreading
|
||||
gtk_wrap_box_get_vertical_spreading
|
||||
gtk_wrap_box_set_horizontal_spreading
|
||||
gtk_wrap_box_get_horizontal_spreading
|
||||
gtk_wrap_box_set_vertical_spacing
|
||||
gtk_wrap_box_get_vertical_spacing
|
||||
gtk_wrap_box_set_horizontal_spacing
|
||||
gtk_wrap_box_get_horizontal_spacing
|
||||
gtk_wrap_box_set_minimum_line_children
|
||||
gtk_wrap_box_get_minimum_line_children
|
||||
gtk_wrap_box_set_natural_line_children
|
||||
gtk_wrap_box_get_natural_line_children
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GtkWrapBoxClass
|
||||
GTK_TYPE_WRAP_BOX
|
||||
GTK_WRAP_BOX
|
||||
GTK_WRAP_BOX_CLASS
|
||||
GTK_IS_WRAP_BOX
|
||||
GTK_IS_WRAP_BOX_CLASS
|
||||
GTK_WRAP_BOX_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_wrap_box_get_type
|
||||
GtkWrapBoxPrivate
|
||||
</SECTION>
|
||||
|
||||
@@ -80,6 +80,7 @@ gtk_im_context_simple_get_type
|
||||
gtk_im_multicontext_get_type
|
||||
gtk_info_bar_get_type
|
||||
gtk_invisible_get_type
|
||||
gtk_item_get_type
|
||||
gtk_label_get_type
|
||||
gtk_layout_get_type
|
||||
gtk_link_button_get_type
|
||||
@@ -93,6 +94,7 @@ gtk_message_dialog_get_type
|
||||
gtk_misc_get_type
|
||||
gtk_mount_operation_get_type
|
||||
gtk_notebook_get_type
|
||||
gtk_object_get_type
|
||||
gtk_offscreen_window_get_type
|
||||
gtk_orientable_get_type
|
||||
gtk_page_setup_get_type
|
||||
@@ -130,6 +132,7 @@ gtk_separator_menu_item_get_type
|
||||
gtk_separator_tool_item_get_type
|
||||
gtk_settings_get_type
|
||||
gtk_size_group_get_type
|
||||
gtk_size_request_get_type
|
||||
gtk_socket_get_type
|
||||
gtk_spin_button_get_type
|
||||
gtk_spinner_get_type
|
||||
@@ -176,4 +179,3 @@ gtk_vseparator_get_type
|
||||
gtk_widget_get_type
|
||||
gtk_window_get_type
|
||||
gtk_window_group_get_type
|
||||
gtk_wrap_box_get_type
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
|
||||
<para>
|
||||
The steps outlined in the following sections assume that your
|
||||
application is working with GTK+ 2.24, which is the final stable
|
||||
application is working with GTK+ 2.22, which is the final stable
|
||||
release of GTK+ 2.x. It includes all the necessary APIs and tools
|
||||
to help you port your application to GTK+ 3. If you are still using
|
||||
an older version of GTK+ 2.x, you should first get your application
|
||||
to build and work with 2.24.
|
||||
to build and work with 2.22.
|
||||
</para>
|
||||
|
||||
<section>
|
||||
@@ -44,6 +44,10 @@
|
||||
<term><filename>gtk/gtkunixprint.h</filename></term>
|
||||
<listitem>for low-level, UNIX-specific printing functions</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><filename>gdk-pixbuf/gdk-pixbuf.h</filename></term>
|
||||
<listitem>for GdkPixbuf</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><filename>gdk/gdk.h</filename></term>
|
||||
<listitem>for GDK</listitem>
|
||||
@@ -53,8 +57,8 @@
|
||||
<listitem>for GDK functions that are X11-specific</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><filename>gdk/gdkwin32.h</filename></term>
|
||||
<listitem>for GDK functions that are Windows-specific</listitem>
|
||||
<term><filename>gdk/gdkkeysyms.h</filename></term>
|
||||
<listitem>if you need the GDK keysym definitions</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
(these relative paths are assuming that you are using the include
|
||||
@@ -66,7 +70,7 @@
|
||||
you can use defines to disable inclusion of individual headers,
|
||||
as follows:
|
||||
<programlisting>
|
||||
make CFLAGS+="-DGTK_DISABLE_SINGLE_INCLUDES"
|
||||
make CFLAGS+="-DG_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES"
|
||||
</programlisting>
|
||||
</para>
|
||||
</section>
|
||||
@@ -86,7 +90,7 @@
|
||||
you can use defines to remove deprecated symbols from the header files,
|
||||
as follows:
|
||||
<programlisting>
|
||||
make CFLAGS+="-DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
|
||||
make CFLAGS+="-DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
|
||||
</programlisting>
|
||||
</para>
|
||||
</section>
|
||||
@@ -109,19 +113,6 @@
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Replace GDK_<keyname> with GDK_KEY_<keyname></title>
|
||||
|
||||
<para>
|
||||
Key constants have gained a <literal>_KEY_</literal> infix.
|
||||
For example, <literal>GDK_a</literal> is now
|
||||
<literal>GDK_KEY_a</literal>. In GTK+ 2, the old names continue
|
||||
to be available. In GTK+ 3 however, the old names will require
|
||||
an explicit include of the <literal>gdkkeysyms-compat.h</literal> header.
|
||||
</para>
|
||||
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Use cairo for drawing</title>
|
||||
<para>
|
||||
@@ -131,7 +122,7 @@
|
||||
</para>
|
||||
<para>
|
||||
The #GdkGC and #GdkImage objects, as well as all the functions using
|
||||
them, are gone. This includes the <literal>gdk_draw</literal> family
|
||||
them are gone. This includes the <literal>gdk_draw_</literal> family
|
||||
of functions like gdk_draw_rectangle() and gdk_draw_drawable(). As
|
||||
#GdkGC is roughly equivalent to #cairo_t and #GdkImage was used for
|
||||
drawing images to GdkDrawables, which cairo supports automatically,
|
||||
@@ -245,7 +236,7 @@ cairo_destroy (cr);
|
||||
</para>
|
||||
</example>
|
||||
<section>
|
||||
<title>What should you be aware of ?</title>
|
||||
<title>what should you be aware of ?</title>
|
||||
<formalpara><title>No more stippling</title>
|
||||
<para>
|
||||
Stippling is the usage of a bi-level mask, called a #GdkBitmap.
|
||||
@@ -316,7 +307,7 @@ cairo_destroy (cr);
|
||||
development to be able to change your code.
|
||||
</para>
|
||||
</formalpara>
|
||||
<formalpara><title>Using pango_cairo_show_layout(<!-- -->) instead of gdk_draw_layout_with_colors(<!-- -->)</title>
|
||||
<formalpara><title>Using pango_cairo_show_layout() instead of gdk_draw_layout_with_colors()</title>
|
||||
<para>
|
||||
GDK provided a way to ignore the color attributes of text and use
|
||||
a hardcoded text color with the gdk_draw_layout_with_colors()
|
||||
@@ -339,7 +330,7 @@ cairo_destroy (cr);
|
||||
<para>
|
||||
This section outlines porting tasks that you need to tackle when
|
||||
you get to the point that you actually build your application against
|
||||
GTK+ 3. Making it possible to prepare for these in GTK+ 2.24 would
|
||||
GTK+ 3. Making it possible to prepare for these in GTK+ 2.22 would
|
||||
have been either impossible or impractical.
|
||||
</para>
|
||||
|
||||
@@ -389,279 +380,6 @@ cairo_destroy (cr);
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Replace GdkPixmap by cairo surfaces</title>
|
||||
<para>
|
||||
The #GdkPixmap object and related functions have been removed.
|
||||
In the cairo-centric world of GTK+ 3, cairo surfaces take over
|
||||
the role of pixmaps.
|
||||
</para>
|
||||
<example>
|
||||
<title>Creating custom cursors</title>
|
||||
<para>
|
||||
One place where pixmaps were commonly used is to create custom
|
||||
cursors:
|
||||
<programlisting>
|
||||
GdkCursor *cursor;
|
||||
GdkPixmap *pixmap;
|
||||
cairo_t *cr;
|
||||
GdkColor fg = { 0, 0, 0, 0 };
|
||||
|
||||
pixmap = gdk_pixmap_new (NULL, 1, 1, 1);
|
||||
|
||||
cr = gdk_cairo_create (pixmap);
|
||||
cairo_rectangle (cr, 0, 0, 1, 1);
|
||||
cairo_fill (cr);
|
||||
cairo_destroy (cr);
|
||||
|
||||
cursor = gdk_cursor_new_from_pixmap (pixmap, pixmap, &fg, &fg, 0, 0);
|
||||
|
||||
g_object_unref (pixmap);
|
||||
</programlisting>
|
||||
The same can be achieved without pixmaps, by drawing onto
|
||||
an image surface:
|
||||
<programlisting>
|
||||
GdkCursor *cursor;
|
||||
cairo_surface_t *s;
|
||||
cairo_t *cr;
|
||||
GdkPixbuf *pixbuf;
|
||||
|
||||
s = cairo_image_surface_create (CAIRO_FORMAT_A1, 3, 3);
|
||||
cr = cairo_create (s);
|
||||
cairo_arc (cr, 1.5, 1.5, 1.5, 0, 2 * M_PI);
|
||||
cairo_fill (cr);
|
||||
cairo_destroy (cr);
|
||||
|
||||
pixbuf = gdk_pixbuf_get_from_surface (NULL, s,
|
||||
0, 0, 0, 0,
|
||||
3, 3);
|
||||
|
||||
cairo_surface_destroy (s);
|
||||
|
||||
cursor = gdk_cursor_new_from_pixbuf (display, pixbuf, 0, 0);
|
||||
|
||||
g_object_unref (pixbuf);
|
||||
</programlisting>
|
||||
</para>
|
||||
</example>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Replace colormaps by visuals</title>
|
||||
<para>
|
||||
For drawing with cairo, it is not necessary to allocate colors, and
|
||||
a #GdkVisual provides enough information for cairo to handle colors
|
||||
in 'native' surfaces. Therefore, #GdkColormap and related functions
|
||||
have been removed in GTK+ 3, and visuals are used instead. The
|
||||
colormap-handling functions of #GtkWidget (gtk_widget_set_colormap(),
|
||||
etc) have been removed and gtk_window_set_visual() has been added.
|
||||
</para>
|
||||
<example><title>Setting up a translucent window</title>
|
||||
<para>You might have a screen-changed handler like the following
|
||||
to set up a translucent window with an alpha-channel:
|
||||
</para>
|
||||
<programlisting>
|
||||
static void
|
||||
on_alpha_screen_changed (GtkWidget *widget,
|
||||
GdkScreen *old_screen,
|
||||
GtkWidget *label)
|
||||
{
|
||||
GdkScreen *screen = gtk_widget_get_screen (widget);
|
||||
GdkColormap *colormap = gdk_screen_get_rgba_colormap (screen);
|
||||
|
||||
if (colormap == NULL)
|
||||
colormap = gdk_screen_get_default_colormap (screen);
|
||||
|
||||
gtk_widget_set_colormap (widget, colormap);
|
||||
}
|
||||
</programlisting>
|
||||
<para>
|
||||
With visuals instead of colormaps, this will look as follows:
|
||||
</para>
|
||||
<programlisting>
|
||||
static void
|
||||
on_alpha_screen_changed (GtkWindow *window,
|
||||
GdkScreen *old_screen,
|
||||
GtkWidget *label)
|
||||
{
|
||||
GdkScreen *screen = gtk_widget_get_screen (GTK_WIDGET (window));
|
||||
GdkVisual *visual = gdk_screen_get_rgba_visual (screen);
|
||||
|
||||
if (visual == NULL)
|
||||
visual = gdk_screen_get_system_visual (screen);
|
||||
|
||||
gtk_window_set_visual (window, visual);
|
||||
}
|
||||
</programlisting>
|
||||
</example>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>The GtkWidget::draw signal</title>
|
||||
<para>
|
||||
The GtkWidget #GtkWidget::expose-event signal has been replaced by
|
||||
a new #GtkWidget::draw signal, which takes a #cairo_t instead of
|
||||
an expose event. The cairo context is being set up so that the origin
|
||||
at (0, 0) coincides with the upper left corner of the widget, and
|
||||
is properly clipped.
|
||||
</para>
|
||||
<note><para>In other words, the cairo context of the draw signal is set
|
||||
up in 'widget coordinates', which is different from traditional expose
|
||||
event handlers, which always assume 'window coordinates'.
|
||||
</para></note>
|
||||
<para>
|
||||
The widget is expected to draw itself with its allocated size, which
|
||||
is available via the new gtk_widget_get_allocated_width() and
|
||||
gtk_widget_get_allocated_height() functions. It is not necessary to
|
||||
check for GTK_WIDGET_IS_DRAWABLE(), since GTK+ already does this check
|
||||
before emitting the ::draw signal.
|
||||
</para>
|
||||
<para>
|
||||
There are some special considerations for widgets with multiple windows.
|
||||
Expose events are window-specific, and widgets with multiple windows
|
||||
could expect to get an expose event for each window that needs to be
|
||||
redrawn. Therefore, multi-window expose event handlers typically look
|
||||
like this:
|
||||
<informalexample><programlisting>
|
||||
if (event->window == widget->window1)
|
||||
{
|
||||
/* ... draw window1 ... */
|
||||
}
|
||||
else if (event->window == widget->window2)
|
||||
{
|
||||
/* ... draw window2 ... */
|
||||
}
|
||||
...
|
||||
</programlisting></informalexample>
|
||||
In contrast, the ::draw signal handler may have to draw multiple
|
||||
windows in one call. GTK+ has a convenience function
|
||||
gtk_cairo_should_draw_window() that can be used to find out if
|
||||
a window needs to be drawn. With that, the example above would look
|
||||
like this (note that the 'else' is gone):
|
||||
<informalexample><programlisting>
|
||||
if (gtk_cairo_should_draw_window (cr, widget->window1)
|
||||
{
|
||||
/* ... draw window1 ... */
|
||||
}
|
||||
if (gtk_cairo_should_draw_window (cr, widget->window2)
|
||||
{
|
||||
/* ... draw window2 ... */
|
||||
}
|
||||
...
|
||||
</programlisting></informalexample>
|
||||
Another convenience function that can help when implementing
|
||||
::draw for multi-window widgets is gtk_cairo_transform_to_window(),
|
||||
which transforms a cairo context from widget-relative coordinates
|
||||
to window-relative coordinates.
|
||||
</para>
|
||||
<para>
|
||||
All GtkStyle drawing functions (gtk_paint_box(), etc) have been changed
|
||||
to take a #cairo_t instead of a window and a clip area. ::draw
|
||||
implementations will usually just use the cairo context that has been
|
||||
passed in for this.
|
||||
</para>
|
||||
<example><title>A simple ::draw function</title>
|
||||
<programlisting>
|
||||
gboolean
|
||||
gtk_arrow_draw (GtkWidget *widget,
|
||||
cairo_t *cr)
|
||||
{
|
||||
gint x, y;
|
||||
gint width, height;
|
||||
gint extent;
|
||||
|
||||
width = gtk_widget_get_allocated_width (widget);
|
||||
height = gtk_widget_get_allocated_height (widget);
|
||||
|
||||
extent = MIN (width - 2 * PAD, height - 2 * PAD);
|
||||
x = PAD;
|
||||
y = PAD;
|
||||
|
||||
gtk_paint_arrow (gtk_widget_get_style (widget),
|
||||
cr,
|
||||
gtk_widget_get_state (widget),
|
||||
GTK_SHADOW_OUT,
|
||||
widget,
|
||||
"arrow",
|
||||
widget->priv->arrow_type,
|
||||
TRUE,
|
||||
x, y, extent, extent);
|
||||
}
|
||||
</programlisting>
|
||||
</example>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>GtkProgressBar orientation</title>
|
||||
|
||||
<para>
|
||||
In GTK+ 2.x, #GtkProgressBar and #GtkCellRendererProgress were using the
|
||||
GtkProgressBarOrientation enumeration to specify their orientation and
|
||||
direction. In GTK+ 3, both the widget and the cell renderer implement
|
||||
#GtkOrientable, and have an additional 'inverted' property to determine
|
||||
their direction. Therefore, a call to gtk_progress_bar_set_orientation()
|
||||
needs to be replaced by a pair of calls to
|
||||
gtk_orientable_set_orientation() and gtk_progress_bar_set_inverted().
|
||||
The following values correspond:
|
||||
<table>
|
||||
<tgroup cols="3">
|
||||
<colspec colname="1"/>
|
||||
<colspec colname="2"/>
|
||||
<colspec colname="3"/>
|
||||
<thead>
|
||||
<row><entry>GTK+ 2.x</entry><entry namest="2" nameend="3">GTK+ 3</entry></row>
|
||||
<row><entry>GtkProgressBarOrientation</entry><entry>GtkOrientation</entry><entry>inverted</entry></row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row><entry>GTK_PROGRESS_LEFT_TO_RIGHT</entry><entry>GTK_ORIENTATION_HORIZONTAL</entry><entry>FALSE</entry></row>
|
||||
<row><entry>GTK_PROGRESS_RIGHT_TO_LEFT</entry><entry>GTK_ORIENTATION_HORIZONTAL</entry><entry>TRUE</entry></row>
|
||||
<row><entry>GTK_PROGRESS_TOP_TO_BOTTOM</entry><entry>GTK_ORIENTATION_VERTICAL</entry><entry>FALSE</entry></row>
|
||||
<row><entry>GTK_PROGRESS_BOTTOM_TO_TOP</entry><entry>GTK_ORIENTATION_VERTICAL</entry><entry>TRUE</entry></row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>GtkScrolledWindow policy</title>
|
||||
|
||||
<para>
|
||||
The default values for the #GtkScrolledWindow:hscrollbar-policy and
|
||||
#GtkScrolledWindow:vscrollbar-policy properties have been changed from
|
||||
'never' to 'automatic'. If your application was relying on the default
|
||||
value, you will have explicitly set it explicitly.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>GtkObject is gone</title>
|
||||
|
||||
<para>
|
||||
GtkObject has been removed in GTK+ 3. Its remaining functionality,
|
||||
the ::destroy signal, has been moved to GtkWidget. If you have non-widget
|
||||
classes that are directly derived from GtkObject, you have to make
|
||||
them derive from #GInitiallyUnowned (or, if you don't need the floating
|
||||
functionality, #GObject). If you have widgets that override the
|
||||
destroy class handler, you have to adust your class_init function,
|
||||
since destroy is now a member of GtkWidgetClass:
|
||||
<informalexample><programlisting>
|
||||
GtkObjectClass *object_class = GTK_OBJECT_CLASS (class);
|
||||
|
||||
object_class->destroy = my_destroy;
|
||||
</programlisting></informalexample>
|
||||
becomes
|
||||
<informalexample><programlisting>
|
||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
|
||||
|
||||
widget_class->destroy = my_destroy;
|
||||
</programlisting></informalexample>
|
||||
In the unlikely case that you have a non-widget class that is derived
|
||||
from GtkObject and makes use of the destroy functionality, you have
|
||||
to implement ::destroy yourself.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Prevent mixed linkage</title>
|
||||
<para>
|
||||
|
||||
@@ -95,10 +95,10 @@ from functions?
|
||||
<answer>
|
||||
|
||||
<para>
|
||||
See the documentation for #GObject and #GInitiallyUnowned. For #GObject note
|
||||
specifically g_object_ref() and g_object_unref(). #GInitiallyUnowned is a
|
||||
subclass of #GObject so the same points apply, except that it has a "floating"
|
||||
state (explained in its documentation).
|
||||
See the documentation for #GObject and #GtkObject. For #GObject note
|
||||
specifically g_object_ref() and g_object_unref(). #GtkObject is a subclass
|
||||
of #GObject so the same points apply, except that it has a "floating" state
|
||||
(explained in its documentation).
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -115,7 +115,7 @@ url="http://bugzilla.gnome.org">http://bugzilla.gnome.org</ulink>.)
|
||||
<qandaentry>
|
||||
<question>
|
||||
<para>
|
||||
Why does my program leak memory, if I destroy a widget immediately
|
||||
Why does my program leak memory, if I destroy a widget immediately
|
||||
after creating it ?
|
||||
</para>
|
||||
</question>
|
||||
@@ -127,26 +127,27 @@ If <structname>GtkFoo</structname> isn't a toplevel window, then
|
||||
foo = gtk_foo_new (<!-- -->);
|
||||
gtk_widget_destroy (foo);
|
||||
</programlisting></informalexample>
|
||||
is a memory leak, because no one assumed the initial floating
|
||||
reference. If you are using a widget and you aren't immediately
|
||||
packing it into a container, then you probably want standard
|
||||
is a memory leak, because no one assumed the initial floating
|
||||
reference. If you are using a widget and you aren't immediately
|
||||
packing it into a container, then you probably want standard
|
||||
reference counting, not floating reference counting.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
To to get this, you must acquire a reference to the widget and drop the
|
||||
floating reference (<quote>ref and sink</quote> in GTK+ parlance) after
|
||||
To to get this, you must acquire a reference to the widget and drop the
|
||||
floating reference (<quote>ref and sink</quote> in GTK+ parlance) after
|
||||
creating it:
|
||||
<informalexample><programlisting>
|
||||
foo = gtk_foo_new (<!-- -->);
|
||||
g_object_ref_sink (foo);
|
||||
g_object_ref (foo);
|
||||
gtk_object_sink (GTK_OBJECT (foo));
|
||||
</programlisting></informalexample>
|
||||
When you want to get rid of the widget, you must call gtk_widget_destroy()
|
||||
to break any external connections to the widget before dropping your
|
||||
to break any external connections to the widget before dropping your
|
||||
reference:
|
||||
<informalexample><programlisting>
|
||||
gtk_widget_destroy (foo);
|
||||
g_object_unref (foo);
|
||||
gtk_widget_destroy (foo);
|
||||
g_object_unref (foo);
|
||||
</programlisting></informalexample>
|
||||
When you immediately add a widget to a container, it takes care of
|
||||
assuming the initial floating reference and you don't have to worry
|
||||
|
||||
16
docs/reference/gtk/tmpl/.gitignore
vendored
16
docs/reference/gtk/tmpl/.gitignore
vendored
@@ -1,27 +1,16 @@
|
||||
gtkaccelmap.sgml
|
||||
gtkactiongroup.sgml
|
||||
gtkaboutdialog.sgml
|
||||
gtkbbox.sgml
|
||||
gtkbox.sgml
|
||||
gtkbuilder.sgml
|
||||
gtkbutton.sgml
|
||||
gtkcalendar.sgml
|
||||
gtkcelleditable.sgml
|
||||
gtkcombobox.sgml
|
||||
gtkcomboboxentry.sgml
|
||||
gtkeditable.sgml
|
||||
gtkentrybuffer.sgml
|
||||
gtkhbox.sgml
|
||||
gtkiconview.sgml
|
||||
gtkimcontextsimple.sgml
|
||||
gtkimmulticontext.sgml
|
||||
gtklinkbutton.sgml
|
||||
gtkmessagedialog.sgml
|
||||
gtknotebook.sgml
|
||||
gtkobject.sgml
|
||||
gtkorientable.sgml
|
||||
gtkpagesetupunixdialog.sgml
|
||||
gtkpapersize.sgml
|
||||
gtkprinter.sgml
|
||||
gtkradioaction.sgml
|
||||
gtkradiobutton.sgml
|
||||
@@ -32,7 +21,6 @@ gtkrecentchooserdialog.sgml
|
||||
gtkrecentchoosermenu.sgml
|
||||
gtkrecentchooserwidget.sgml
|
||||
gtkrecentmanager.sgml
|
||||
gtkscale.sgml
|
||||
gtkscalebutton.sgml
|
||||
gtkseparator.sgml
|
||||
gtkseparatormenuitem.sgml
|
||||
@@ -41,11 +29,7 @@ gtkstatusbar.sgml
|
||||
gtkstyle.sgml
|
||||
gtktesting.sgml
|
||||
gtktextiter.sgml
|
||||
gtktexttagtable.sgml
|
||||
gtktoggleaction.sgml
|
||||
gtktoolbar.sgml
|
||||
gtktoolitem.sgml
|
||||
gtktooltip.sgml
|
||||
gtktreednd.sgml
|
||||
gtktypeutils.sgml
|
||||
gtkwindow.sgml
|
||||
|
||||
173
docs/reference/gtk/tmpl/gtkaccelmap.sgml
Normal file
173
docs/reference/gtk/tmpl/gtkaccelmap.sgml
Normal file
@@ -0,0 +1,173 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
Accelerator Maps
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
Loadable keyboard accelerator specifications
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkAccelMap ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### SIGNAL GtkAccelMap::changed ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@accelmap: the object which received the signal.
|
||||
@arg1:
|
||||
@arg2:
|
||||
@arg3:
|
||||
|
||||
<!-- ##### USER_FUNCTION GtkAccelMapForeach ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@data:
|
||||
@accel_path:
|
||||
@accel_key:
|
||||
@accel_mods:
|
||||
@changed:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_accel_map_add_entry ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@accel_path:
|
||||
@accel_key:
|
||||
@accel_mods:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_accel_map_lookup_entry ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@accel_path:
|
||||
@key:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_accel_map_change_entry ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@accel_path:
|
||||
@accel_key:
|
||||
@accel_mods:
|
||||
@replace:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_accel_map_load ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@file_name:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_accel_map_save ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@file_name:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_accel_map_foreach ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@data:
|
||||
@foreach_func:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_accel_map_load_fd ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@fd:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_accel_map_save_fd ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@fd:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_accel_map_load_scanner ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@scanner:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_accel_map_add_filter ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filter_pattern:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_accel_map_foreach_unfiltered ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@data:
|
||||
@foreach_func:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_accel_map_get ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_accel_map_lock_path ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@accel_path:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_accel_map_unlock_path ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@accel_path:
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
GtkAdjustment
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
A representation of an adjustable bounded value
|
||||
A GtkObject representing an adjustable bounded value
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
|
||||
461
docs/reference/gtk/tmpl/gtkcombobox.sgml
Normal file
461
docs/reference/gtk/tmpl/gtkcombobox.sgml
Normal file
@@ -0,0 +1,461 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkComboBox
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
A widget used to choose from a list of items
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
A #GtkComboBox is a widget that allows the user to choose from a
|
||||
list of valid choices. The #GtkComboBox displays the selected
|
||||
choice. When activated, the #GtkComboBox displays a popup
|
||||
which allows the user to make a new choice. The style in which
|
||||
the selected value is displayed, and the style of the popup is
|
||||
determined by the current theme. It may be similar to a #GtkOptionMenu,
|
||||
or similar to a Windows-style combo box.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Unlike its predecessors #GtkCombo and #GtkOptionMenu, the #GtkComboBox
|
||||
uses the model-view pattern; the list of valid choices is specified in the
|
||||
form of a tree model, and the display of the choices can be adapted to
|
||||
the data in the model by using cell renderers, as you would in a tree view.
|
||||
This is possible since #GtkComboBox implements the #GtkCellLayout interface.
|
||||
The tree model holding the valid choices is not restricted to a flat list,
|
||||
it can be a real tree, and the popup will reflect the tree structure.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
In addition to the model-view API, #GtkComboBox offers a simple API which
|
||||
is suitable for text-only combo boxes, and hides the complexity of managing
|
||||
the data in a model. It consists of the functions gtk_combo_box_new_text(),
|
||||
gtk_combo_box_append_text(), gtk_combo_box_insert_text(),
|
||||
gtk_combo_box_prepend_text(), gtk_combo_box_remove_text() and
|
||||
gtk_combo_box_get_active_text().
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
#GtkComboBoxEntry, #GtkTreeModel, #GtkCellRenderer
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkComboBox ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### SIGNAL GtkComboBox::changed ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@combobox: the object which received the signal.
|
||||
|
||||
<!-- ##### SIGNAL GtkComboBox::move-active ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@combobox: the object which received the signal.
|
||||
@arg1:
|
||||
|
||||
<!-- ##### SIGNAL GtkComboBox::popdown ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@combobox: the object which received the signal.
|
||||
@Returns:
|
||||
|
||||
<!-- ##### SIGNAL GtkComboBox::popup ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@combobox: the object which received the signal.
|
||||
|
||||
<!-- ##### ARG GtkComboBox:active ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkComboBox:add-tearoffs ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkComboBox:button-sensitivity ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkComboBox:column-span-column ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkComboBox:focus-on-click ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkComboBox:has-frame ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkComboBox:model ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkComboBox:popup-shown ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkComboBox:row-span-column ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkComboBox:tearoff-title ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkComboBox:wrap-width ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkComboBox:appears-as-list ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkComboBox:arrow-size ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkComboBox:shadow-type ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### FUNCTION gtk_combo_box_new ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_combo_box_new_with_model ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@model:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_combo_box_get_wrap_width ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@combo_box:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_combo_box_set_wrap_width ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@combo_box:
|
||||
@width:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_combo_box_get_row_span_column ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@combo_box:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_combo_box_set_row_span_column ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@combo_box:
|
||||
@row_span:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_combo_box_get_column_span_column ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@combo_box:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_combo_box_set_column_span_column ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@combo_box:
|
||||
@column_span:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_combo_box_get_active ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@combo_box:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_combo_box_set_active ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@combo_box:
|
||||
@index_:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_combo_box_get_active_iter ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@combo_box:
|
||||
@iter:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_combo_box_set_active_iter ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@combo_box:
|
||||
@iter:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_combo_box_get_model ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@combo_box:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_combo_box_set_model ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@combo_box:
|
||||
@model:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_combo_box_new_text ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_combo_box_append_text ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@combo_box:
|
||||
@text:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_combo_box_insert_text ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@combo_box:
|
||||
@position:
|
||||
@text:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_combo_box_prepend_text ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@combo_box:
|
||||
@text:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_combo_box_remove_text ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@combo_box:
|
||||
@position:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_combo_box_get_active_text ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@combo_box:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_combo_box_popup_for_device ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@combo_box:
|
||||
@device:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_combo_box_popup ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@combo_box:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_combo_box_popdown ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@combo_box:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_combo_box_get_popup_accessible ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@combo_box:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_combo_box_get_row_separator_func ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@combo_box:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_combo_box_set_row_separator_func ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@combo_box:
|
||||
@func:
|
||||
@data:
|
||||
@destroy:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_combo_box_set_add_tearoffs ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@combo_box:
|
||||
@add_tearoffs:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_combo_box_get_add_tearoffs ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@combo_box:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_combo_box_set_title ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@combo_box:
|
||||
@title:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_combo_box_get_title ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@combo_box:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_combo_box_set_focus_on_click ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@combo:
|
||||
@focus_on_click:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_combo_box_get_focus_on_click ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@combo:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_combo_box_set_button_sensitivity ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@combo_box:
|
||||
@sensitivity:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_combo_box_get_button_sensitivity ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@combo_box:
|
||||
@Returns:
|
||||
|
||||
|
||||
123
docs/reference/gtk/tmpl/gtkcomboboxentry.sgml
Normal file
123
docs/reference/gtk/tmpl/gtkcomboboxentry.sgml
Normal file
@@ -0,0 +1,123 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkComboBoxEntry
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
A text entry field with a dropdown list
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
A #GtkComboBoxEntry is a widget that allows the user to choose from a
|
||||
list of valid choices or enter a different value. It is very similar
|
||||
to a #GtkComboBox, but it displays the selected value in an entry to
|
||||
allow modifying it.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
In contrast to a #GtkComboBox, the underlying model of a #GtkComboBoxEntry
|
||||
must always have a text column (see gtk_combo_box_entry_set_text_column()),
|
||||
and the entry will show the content of the text column in the selected row.
|
||||
To get the text from the entry, use gtk_combo_box_get_active_text().
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The changed signal will be emitted while typing into a GtkComboBoxEntry,
|
||||
as well as when selecting an item from the GtkComboBoxEntry's list. Use
|
||||
gtk_combo_box_get_active() or gtk_combo_box_get_active_iter() to discover
|
||||
whether an item was actually selected from the list.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Connect to the activate signal of the GtkEntry (use gtk_bin_get_child())
|
||||
to detect when the user actually finishes entering text.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The convenience API to construct simple text-only #GtkComboBox<!-- -->es
|
||||
can also be used with #GtkComboBoxEntry<!-- -->s which have been constructed
|
||||
with gtk_combo_box_entry_new_text().
|
||||
</para>
|
||||
|
||||
<para>
|
||||
If you have special needs that go beyond a simple entry (e.g. input validation),
|
||||
it is possible to replace the child entry by a different widget using
|
||||
gtk_container_remove() and gtk_container_add().
|
||||
</para>
|
||||
|
||||
<refsect2 id="GtkComboBoxEntry-BUILDER-UI">
|
||||
<title>GtkComboBoxEntry as GtkBuildable</title>
|
||||
<para>
|
||||
Beyond the <attributes> support that is shared by all
|
||||
<link linkend="GtkCellLayout-BUILDER-UI">GtkCellLayout</link> implementation,
|
||||
GtkComboBoxEntry makes the entry available in UI definitions as an internal
|
||||
child with name "entry".
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
#GtkComboBox
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkComboBoxEntry ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ARG GtkComboBoxEntry:text-column ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### FUNCTION gtk_combo_box_entry_new ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_combo_box_entry_new_with_model ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@model:
|
||||
@text_column:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_combo_box_entry_new_text ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_combo_box_entry_set_text_column ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@entry_box:
|
||||
@text_column:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_combo_box_entry_get_text_column ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@entry_box:
|
||||
@Returns:
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ of their children.
|
||||
<para>
|
||||
The size requisition phase of the widget layout process operates top-down.
|
||||
It starts at a top-level widget, typically a #GtkWindow. The top-level widget
|
||||
asks its child for its size requisition by calling gtk_widget_get_preferred_size().
|
||||
asks its child for its size requisition by calling gtk_widget_size_request().
|
||||
To determine its requisition, the child asks its own children for their
|
||||
requisitions and so on. Finally, the top-level widget will get a requisition
|
||||
back from its child.
|
||||
|
||||
@@ -221,11 +221,12 @@ drops.
|
||||
|
||||
<!-- ##### FUNCTION gtk_drag_get_source_widget ##### -->
|
||||
<para>
|
||||
|
||||
Determines the source widget for a drag.
|
||||
</para>
|
||||
|
||||
@context:
|
||||
@Returns:
|
||||
@context: a (destination side) drag context.
|
||||
@Returns: if the drag is occurring within a single application,
|
||||
a pointer to the source widget. Otherwise, %NULL.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_drag_highlight ##### -->
|
||||
|
||||
214
docs/reference/gtk/tmpl/gtkeditable.sgml
Normal file
214
docs/reference/gtk/tmpl/gtkeditable.sgml
Normal file
@@ -0,0 +1,214 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkEditable
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
Interface for text-editing widgets
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
The #GtkEditable interface is an interface which should be implemented by
|
||||
text editing widgets, such as #GtkEntry and #GtkText. It contains functions
|
||||
for generically manipulating an editable widget, a large number of action
|
||||
signals used for key bindings, and several signals that an application can
|
||||
connect to to modify the behavior of a widget.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
As an example of the latter usage, by connecting
|
||||
the following handler to "insert_text", an application
|
||||
can convert all entry into a widget into uppercase.
|
||||
|
||||
<example>
|
||||
<title>Forcing entry to uppercase.</title>
|
||||
<programlisting>
|
||||
#include <ctype.h>
|
||||
|
||||
void
|
||||
insert_text_handler (GtkEditable *editable,
|
||||
const gchar *text,
|
||||
gint length,
|
||||
gint *position,
|
||||
gpointer data)
|
||||
{
|
||||
int i;
|
||||
gchar *result = g_utf8_strup (text, length);
|
||||
|
||||
g_signal_handlers_block_by_func (editable,
|
||||
(gpointer) insert_text_handler, data);
|
||||
gtk_editable_insert_text (editable, result, length, position);
|
||||
g_signal_handlers_unblock_by_func (editable,
|
||||
(gpointer) insert_text_handler, data);
|
||||
|
||||
g_signal_stop_emission_by_name (editable, "insert_text");
|
||||
|
||||
g_free (result);
|
||||
}
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkEditable ##### -->
|
||||
<para>
|
||||
The #GtkEditable structure is an opaque structure whose members
|
||||
cannot be directly accessed.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### SIGNAL GtkEditable::changed ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@editable: the object which received the signal.
|
||||
|
||||
<!-- ##### SIGNAL GtkEditable::delete-text ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@editable:
|
||||
@start_pos:
|
||||
@end_pos:
|
||||
|
||||
<!-- ##### SIGNAL GtkEditable::insert-text ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@editable:
|
||||
@new_text:
|
||||
@new_text_length:
|
||||
@position:
|
||||
|
||||
<!-- ##### FUNCTION gtk_editable_select_region ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@editable:
|
||||
@start_pos:
|
||||
@end_pos:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_editable_get_selection_bounds ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@editable:
|
||||
@start_pos:
|
||||
@end_pos:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_editable_insert_text ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@editable:
|
||||
@new_text:
|
||||
@new_text_length:
|
||||
@position:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_editable_delete_text ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@editable:
|
||||
@start_pos:
|
||||
@end_pos:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_editable_get_chars ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@editable:
|
||||
@start_pos:
|
||||
@end_pos:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_editable_cut_clipboard ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@editable:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_editable_copy_clipboard ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@editable:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_editable_paste_clipboard ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@editable:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_editable_delete_selection ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@editable:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_editable_set_position ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@editable:
|
||||
@position:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_editable_get_position ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@editable:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_editable_set_editable ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@editable:
|
||||
@is_editable:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_editable_get_editable ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@editable:
|
||||
@Returns:
|
||||
|
||||
|
||||
171
docs/reference/gtk/tmpl/gtkentrybuffer.sgml
Normal file
171
docs/reference/gtk/tmpl/gtkentrybuffer.sgml
Normal file
@@ -0,0 +1,171 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkEntryBuffer
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkEntryBuffer ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### SIGNAL GtkEntryBuffer::deleted-text ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@entrybuffer: the object which received the signal.
|
||||
@arg1:
|
||||
@arg2:
|
||||
|
||||
<!-- ##### SIGNAL GtkEntryBuffer::inserted-text ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@entrybuffer: the object which received the signal.
|
||||
@arg1:
|
||||
@arg2:
|
||||
@arg3:
|
||||
|
||||
<!-- ##### ARG GtkEntryBuffer:length ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkEntryBuffer:max-length ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkEntryBuffer:text ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### FUNCTION gtk_entry_buffer_new ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@initial_chars:
|
||||
@n_initial_chars:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_entry_buffer_get_text ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@buffer:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_entry_buffer_set_text ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@buffer:
|
||||
@chars:
|
||||
@n_chars:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_entry_buffer_get_bytes ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@buffer:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_entry_buffer_get_length ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@buffer:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_entry_buffer_get_max_length ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@buffer:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_entry_buffer_set_max_length ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@buffer:
|
||||
@max_length:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_entry_buffer_insert_text ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@buffer:
|
||||
@position:
|
||||
@chars:
|
||||
@n_chars:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_entry_buffer_delete_text ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@buffer:
|
||||
@position:
|
||||
@n_chars:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_entry_buffer_emit_deleted_text ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@buffer:
|
||||
@position:
|
||||
@n_chars:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_entry_buffer_emit_inserted_text ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@buffer:
|
||||
@position:
|
||||
@chars:
|
||||
@n_chars:
|
||||
|
||||
|
||||
@@ -22,6 +22,64 @@ typically use the features described here.
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### VARIABLE gtk_major_version ##### -->
|
||||
<para>
|
||||
The major version number of the GTK+ library. (e.g. in GTK+ version
|
||||
1.2.5 this is 1.)
|
||||
</para>
|
||||
|
||||
<para>
|
||||
This variable is in the library, so represents the
|
||||
GTK+ library you have linked against. Contrast with the
|
||||
#GTK_MAJOR_VERSION macro, which represents the major version of the
|
||||
GTK+ headers you have included.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### VARIABLE gtk_minor_version ##### -->
|
||||
<para>
|
||||
The minor version number of the GTK+ library.
|
||||
(e.g. in GTK+ version 1.2.5 this is 2.)
|
||||
</para>
|
||||
|
||||
<para>
|
||||
This variable is in the library, so represents the
|
||||
GTK+ library you have linked against. Contrast with the
|
||||
#GTK_MINOR_VERSION macro, which represents the minor version of the
|
||||
GTK+ headers you have included.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### VARIABLE gtk_micro_version ##### -->
|
||||
<para>
|
||||
The micro version number of the GTK+ library.
|
||||
(e.g. in GTK+ version 1.2.5 this is 5.)
|
||||
</para>
|
||||
|
||||
|
||||
<para>
|
||||
This variable is in the library, so represents the GTK+ library you
|
||||
have linked against. Contrast with the #GTK_MICRO_VERSION macro, which
|
||||
represents the micro version of the GTK+ headers you have included.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### VARIABLE gtk_binary_age ##### -->
|
||||
<para>
|
||||
This is the binary age passed to <application>libtool</application>. If
|
||||
<application>libtool</application> means nothing to you, don't worry
|
||||
about it. ;-)
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### VARIABLE gtk_interface_age ##### -->
|
||||
<para>
|
||||
This is the interface age passed to <application>libtool</application>. If
|
||||
<application>libtool</application> means nothing to you, don't worry
|
||||
about it. ;-)
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_check_version ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@@ -37,7 +37,7 @@ The #GtkFileChooserButton supports the #GtkFileChooserAction<!--
|
||||
<para>
|
||||
The #GtkFileChooserButton will ellipsize the label,
|
||||
and thus will thus request little horizontal space. To give the button
|
||||
more space, you should call gtk_widget_get_preferred_size(),
|
||||
more space, you should call gtk_widget_size_request(),
|
||||
gtk_file_chooser_button_set_width_chars(), or pack the button in
|
||||
such a way that other interface elements give space to the widget.
|
||||
</para>
|
||||
|
||||
226
docs/reference/gtk/tmpl/gtkfilesel.sgml
Normal file
226
docs/reference/gtk/tmpl/gtkfilesel.sgml
Normal file
@@ -0,0 +1,226 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkFileSelection
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
Prompt the user for a file or directory name
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
#GtkFileSelection has been superseded by the newer #GtkFileChooser family
|
||||
of widgets.
|
||||
</para>
|
||||
<para>
|
||||
#GtkFileSelection should be used to retrieve file or directory names from
|
||||
the user. It will create a new dialog window containing a directory list,
|
||||
and a file list corresponding to the current working directory. The filesystem
|
||||
can be navigated using the directory list or the drop-down history menu.
|
||||
Alternatively, the TAB key can be used to navigate using filename
|
||||
completion - common in text based editors such as emacs and jed.
|
||||
</para>
|
||||
<para>
|
||||
File selection dialogs are created with a call to gtk_file_selection_new().
|
||||
</para>
|
||||
<para>
|
||||
The default filename can be set using gtk_file_selection_set_filename() and the selected filename retrieved using gtk_file_selection_get_filename().
|
||||
</para>
|
||||
<para>
|
||||
Use gtk_file_selection_complete() to display files and directories
|
||||
that match a given pattern. This can be used for example, to show only
|
||||
*.txt files, or only files beginning with gtk*.
|
||||
</para>
|
||||
<para>
|
||||
Simple file operations; create directory, delete file, and rename file, are available from buttons at the top of the dialog. These can be hidden using gtk_file_selection_hide_fileop_buttons() and shown again using gtk_file_selection_show_fileop_buttons().
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>Getting a filename from the user.</title>
|
||||
<programlisting>
|
||||
|
||||
/* The file selection widget and the string to store the chosen filename */
|
||||
|
||||
void store_filename (GtkWidget *widget, gpointer user_data) {
|
||||
GtkWidget *file_selector = GTK_WIDGET (user_data);
|
||||
const gchar *selected_filename;
|
||||
|
||||
selected_filename = gtk_file_selection_get_filename (GTK_FILE_SELECTION (file_selector));
|
||||
g_print ("Selected filename: %s\n", selected_filename);
|
||||
}
|
||||
|
||||
void create_file_selection (void) {
|
||||
|
||||
GtkWidget *file_selector;
|
||||
|
||||
/* Create the selector */
|
||||
|
||||
file_selector = gtk_file_selection_new ("Please select a file for editing.");
|
||||
|
||||
g_signal_connect (GTK_FILE_SELECTION (file_selector)->ok_button,
|
||||
"clicked",
|
||||
G_CALLBACK (store_filename),
|
||||
file_selector);
|
||||
|
||||
/* Ensure that the dialog box is destroyed when the user clicks a button. */
|
||||
|
||||
g_signal_connect_swapped (GTK_FILE_SELECTION (file_selector)->ok_button,
|
||||
"clicked",
|
||||
G_CALLBACK (gtk_widget_destroy),
|
||||
file_selector);
|
||||
|
||||
g_signal_connect_swapped (GTK_FILE_SELECTION (file_selector)->cancel_button,
|
||||
"clicked",
|
||||
G_CALLBACK (gtk_widget_destroy),
|
||||
file_selector);
|
||||
|
||||
/* Display that dialog */
|
||||
|
||||
gtk_widget_show (file_selector);
|
||||
}
|
||||
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>#GtkDialog</term>
|
||||
<listitem><para>Add your own widgets into the #GtkFileSelection.</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkFileSelection ##### -->
|
||||
<para>
|
||||
The #GtkFileSelection struct contains the following #GtkWidget fields:
|
||||
</para>
|
||||
|
||||
@dir_list:
|
||||
@file_list:
|
||||
@selection_entry:
|
||||
@selection_text:
|
||||
@main_vbox:
|
||||
@ok_button:
|
||||
@cancel_button: the two main buttons that signals should be connected
|
||||
to in order to perform an action when the user hits either OK or
|
||||
Cancel.
|
||||
@help_button:
|
||||
@history_pulldown: the #GtkOptionMenu used to create the drop-down
|
||||
directory history.
|
||||
@history_menu:
|
||||
@history_list:
|
||||
@fileop_dialog: the dialog box used to display the #GtkFileSelection.
|
||||
It can be customized by adding/removing widgets from it using the
|
||||
standard #GtkDialog functions.
|
||||
@fileop_entry:
|
||||
@fileop_file:
|
||||
@cmpl_state:
|
||||
@fileop_c_dir:
|
||||
@fileop_del_file:
|
||||
@fileop_ren_file: the buttons that appear at the top of the file
|
||||
selection dialog. These "operation buttons" can be hidden and
|
||||
redisplayed with gtk_file_selection_hide_fileop_buttons() and
|
||||
gtk_file_selection_show_fileop_buttons() respectively.
|
||||
@button_area:
|
||||
@action_area:
|
||||
|
||||
<!-- ##### ARG GtkFileSelection:filename ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkFileSelection:select-multiple ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkFileSelection:show-fileops ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### FUNCTION gtk_file_selection_new ##### -->
|
||||
<para>
|
||||
Creates a new file selection dialog box. By default it will contain a #GtkTreeView of the application's current working directory, and a file listing. Operation buttons that allow the user to create a directory, delete files and rename files, are also present.
|
||||
</para>
|
||||
|
||||
@title: a message that will be placed in the file requestor's titlebar.
|
||||
@Returns: the new file selection.
|
||||
@Deprecated: Use gtk_file_chooser_dialog_new() instead
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_file_selection_set_filename ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@filesel:
|
||||
@filename:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_file_selection_get_filename ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@filesel:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_file_selection_complete ##### -->
|
||||
<para>
|
||||
Will attempt to match @pattern to a valid filenames or subdirectories in the current directory. If a match can be made, the matched filename will appear in the text entry field of the file selection dialog.
|
||||
If a partial match can be made, the "Files" list will contain those
|
||||
file names which have been partially matched, and the "Folders"
|
||||
list those directories which have been partially matched.
|
||||
</para>
|
||||
|
||||
@filesel: a #GtkFileSelection.
|
||||
@pattern: a string of characters which may or may not match any filenames in the current directory.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_file_selection_show_fileop_buttons ##### -->
|
||||
<para>
|
||||
Shows the file operation buttons, if they have previously been hidden. The rest of the widgets in the dialog will be resized accordingly.
|
||||
</para>
|
||||
|
||||
@filesel: a #GtkFileSelection.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_file_selection_hide_fileop_buttons ##### -->
|
||||
<para>
|
||||
Hides the file operation buttons that normally appear at the top of the dialog. Useful if you wish to create a custom file selector, based on #GtkFileSelection.
|
||||
</para>
|
||||
|
||||
@filesel: a #GtkFileSelection.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_file_selection_get_selections ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filesel:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_file_selection_set_select_multiple ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filesel:
|
||||
@select_multiple:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_file_selection_get_select_multiple ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@filesel:
|
||||
@Returns:
|
||||
|
||||
|
||||
55
docs/reference/gtk/tmpl/gtkimcontextsimple.sgml
Normal file
55
docs/reference/gtk/tmpl/gtkimcontextsimple.sgml
Normal file
@@ -0,0 +1,55 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkIMContextSimple
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
An input method context supporting table-based input methods
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkIMContextSimple ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_im_context_simple_new ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_im_context_simple_add_table ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@context_simple:
|
||||
@data:
|
||||
@max_seq_len:
|
||||
@n_seqs:
|
||||
|
||||
|
||||
<!-- ##### MACRO GTK_MAX_COMPOSE_LEN ##### -->
|
||||
<para>
|
||||
The maximum length of sequences in compose tables.
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
64
docs/reference/gtk/tmpl/gtkimmulticontext.sgml
Normal file
64
docs/reference/gtk/tmpl/gtkimmulticontext.sgml
Normal file
@@ -0,0 +1,64 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkIMMulticontext
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
An input method context supporting multiple, loadable input methods
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkIMMulticontext ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_im_multicontext_new ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_im_multicontext_append_menuitems ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@context:
|
||||
@menushell:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_im_multicontext_get_context_id ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@context:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_im_multicontext_set_context_id ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@context:
|
||||
@context_id:
|
||||
|
||||
|
||||
75
docs/reference/gtk/tmpl/gtkitem.sgml
Normal file
75
docs/reference/gtk/tmpl/gtkitem.sgml
Normal file
@@ -0,0 +1,75 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkItem
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
Abstract base class for GtkMenuItem, GtkListItem and GtkTreeItem
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
The #GtkItem widget is an abstract base class for #GtkMenuItem, #GtkListItem
|
||||
and #GtkTreeItem.
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkItem ##### -->
|
||||
<para>
|
||||
The #GtkItem-struct struct contains private data only, and
|
||||
should be accessed using the functions below.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### SIGNAL GtkItem::deselect ##### -->
|
||||
<para>
|
||||
Emitted when the item is deselected.
|
||||
</para>
|
||||
|
||||
@item: the object which received the signal.
|
||||
|
||||
<!-- ##### SIGNAL GtkItem::select ##### -->
|
||||
<para>
|
||||
Emitted when the item is selected.
|
||||
</para>
|
||||
|
||||
@item: the object which received the signal.
|
||||
|
||||
<!-- ##### SIGNAL GtkItem::toggle ##### -->
|
||||
<para>
|
||||
Emitted when the item is toggled.
|
||||
</para>
|
||||
|
||||
@item: the object which received the signal.
|
||||
|
||||
<!-- ##### FUNCTION gtk_item_select ##### -->
|
||||
<para>
|
||||
Emits the "select" signal on the given item.
|
||||
</para>
|
||||
|
||||
@item: a #GtkItem.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_item_deselect ##### -->
|
||||
<para>
|
||||
Emits the "deselect" signal on the given item.
|
||||
</para>
|
||||
|
||||
@item: a #GtkItem.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_item_toggle ##### -->
|
||||
<para>
|
||||
Emits the "toggle" signal on the given item.
|
||||
</para>
|
||||
|
||||
@item: a #GtkItem.
|
||||
|
||||
|
||||
139
docs/reference/gtk/tmpl/gtklinkbutton.sgml
Normal file
139
docs/reference/gtk/tmpl/gtklinkbutton.sgml
Normal file
@@ -0,0 +1,139 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkLinkButton
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
Create buttons bound to a URL
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
A #GtkLinkButton is a #GtkButton with a hyperlink, similar to the one
|
||||
used by web browsers, which triggers an action when clicked. It is useful
|
||||
to show quick links to resources.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
A link button is created by calling either gtk_link_button_new() or
|
||||
gtk_link_button_new_with_label(). If using the former, the URI you pass
|
||||
to the constructor is used as a label for the widget.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The URI bound to a #GtkLinkButton can be set specifically using
|
||||
gtk_link_button_set_uri(), and retrieved using gtk_link_button_get_uri().
|
||||
</para>
|
||||
|
||||
<para>
|
||||
#GtkLinkButton offers a global hook, which is called when the used clicks
|
||||
on it: see gtk_link_button_set_uri_hook().
|
||||
</para>
|
||||
|
||||
<para>
|
||||
#GtkLinkButton was added in GTK+ 2.10.
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
#GtkButton
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkLinkButton ##### -->
|
||||
<para>
|
||||
The #GtkLinkButton struct contains private data only, and should be
|
||||
manipulated using the functions below.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ARG GtkLinkButton:uri ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkLinkButton:visited ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### FUNCTION gtk_link_button_new ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@uri:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_link_button_new_with_label ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@uri:
|
||||
@label:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_link_button_get_uri ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@link_button:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_link_button_set_uri ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@link_button:
|
||||
@uri:
|
||||
|
||||
|
||||
<!-- ##### USER_FUNCTION GtkLinkButtonUriFunc ##### -->
|
||||
<para>
|
||||
The type of a function which is called when the #GtkLinkButton is
|
||||
clicked.
|
||||
</para>
|
||||
|
||||
@button: the #GtkLinkButton which was clicked
|
||||
@link_: the URI to which the clicked #GtkLinkButton points
|
||||
@user_data: user data that was passed when the function was registered
|
||||
with gtk_link_button_set_uri_hook()
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_link_button_set_uri_hook ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@func:
|
||||
@data:
|
||||
@destroy:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_link_button_get_visited ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@link_button:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_link_button_set_visited ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@link_button:
|
||||
@visited:
|
||||
|
||||
|
||||
@@ -392,11 +392,11 @@ widget and this function does nothing.
|
||||
|
||||
<!-- ##### FUNCTION gtk_grab_get_current ##### -->
|
||||
<para>
|
||||
|
||||
Queries the current grab of the default window group.
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns:
|
||||
@void:
|
||||
@Returns: The widget which currently has the grab or %NULL if no grab is active.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_grab_remove ##### -->
|
||||
|
||||
@@ -19,11 +19,6 @@ positioned within its allocated area. Note that if the widget is added to
|
||||
a container in such a way that it expands automatically to fill its
|
||||
allocated area, the alignment settings will not alter the widgets position.
|
||||
</para>
|
||||
<para>
|
||||
Note that the desired effect can in most cases be achieved by using the
|
||||
#GtkWidget:halign, #GtkWidget:valign and #GtkWidget:margin properties
|
||||
on the child widget.
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
|
||||
709
docs/reference/gtk/tmpl/gtknotebook.sgml
Normal file
709
docs/reference/gtk/tmpl/gtknotebook.sgml
Normal file
@@ -0,0 +1,709 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkNotebook
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
A tabbed notebook container
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
The #GtkNotebook widget is a #GtkContainer whose children are pages that
|
||||
can be switched between using tab labels along one edge.
|
||||
</para>
|
||||
<para>
|
||||
There are many configuration options for #GtkNotebook. Among other
|
||||
things, you can choose on which edge the tabs appear
|
||||
(see gtk_notebook_set_tab_pos()), whether, if there are too many
|
||||
tabs to fit the notebook should be made bigger or scrolling
|
||||
arrows added (see gtk_notebook_set_scrollable), and whether there
|
||||
will be a popup menu allowing the users to switch pages.
|
||||
(see gtk_notebook_popup_enable(), gtk_notebook_popup_disable())
|
||||
</para>
|
||||
|
||||
<refsect2 id="GtkNotebook-BUILDER-UI">
|
||||
<title>GtkNotebook as GtkBuildable</title>
|
||||
<para>
|
||||
The GtkNoteboopk implementation of the GtkBuildable interface
|
||||
supports placing children into tabs by specifying "tab" as the
|
||||
"type" attribute of a <child> element. Note that the content
|
||||
of the tab must be created before the tab can be filled.
|
||||
A tab child can be specified without specifying a <child>
|
||||
type attribute.
|
||||
</para>
|
||||
<para>
|
||||
To add a child widget in the notebooks action area, specify
|
||||
"action-start" or "action-end" as the "type" attribute of the <child>
|
||||
element.
|
||||
</para>
|
||||
<example>
|
||||
<title>A UI definition fragment with GtkNotebook</title>
|
||||
<programlisting><![CDATA[
|
||||
<object class="GtkNotebook">
|
||||
<child>
|
||||
<object class="GtkLabel" id="notebook-content">
|
||||
<property name="label">Content</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="tab">
|
||||
<object class="GtkLabel" id="notebook-tab">
|
||||
<property name="label">Tab</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
]]></programlisting>
|
||||
</example>
|
||||
</refsect2>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>#GtkContainer</term>
|
||||
<listitem><para>For functions that apply to every #GtkContainer</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkNotebook ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### SIGNAL GtkNotebook::change-current-page ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@notebook: the object which received the signal.
|
||||
@arg1:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### SIGNAL GtkNotebook::create-window ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@notebook: the object which received the signal.
|
||||
@widget:
|
||||
@arg1:
|
||||
@arg2:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### SIGNAL GtkNotebook::focus-tab ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@notebook: the object which received the signal.
|
||||
@arg1:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### SIGNAL GtkNotebook::move-focus-out ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@notebook: the object which received the signal.
|
||||
@arg1:
|
||||
|
||||
<!-- ##### SIGNAL GtkNotebook::page-added ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@notebook: the object which received the signal.
|
||||
@widget:
|
||||
@arg1:
|
||||
|
||||
<!-- ##### SIGNAL GtkNotebook::page-removed ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@notebook: the object which received the signal.
|
||||
@widget:
|
||||
@arg1:
|
||||
|
||||
<!-- ##### SIGNAL GtkNotebook::page-reordered ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@notebook: the object which received the signal.
|
||||
@widget:
|
||||
@arg1:
|
||||
|
||||
<!-- ##### SIGNAL GtkNotebook::reorder-tab ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@notebook: the object which received the signal.
|
||||
@arg1:
|
||||
@Param3:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### SIGNAL GtkNotebook::select-page ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@notebook: the object which received the signal.
|
||||
@arg1:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### SIGNAL GtkNotebook::switch-page ##### -->
|
||||
<para>
|
||||
Emitted when the user or a function changes the current page.
|
||||
</para>
|
||||
|
||||
@notebook: the object which received the signal.
|
||||
@page: the new current page
|
||||
@page_num: the index of the page
|
||||
|
||||
<!-- ##### ARG GtkNotebook:enable-popup ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkNotebook:group ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkNotebook:page ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkNotebook:scrollable ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkNotebook:show-border ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkNotebook:show-tabs ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkNotebook:tab-pos ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkNotebook:detachable ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkNotebook:menu-label ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkNotebook:position ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkNotebook:reorderable ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkNotebook:tab-expand ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkNotebook:tab-fill ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkNotebook:tab-label ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkNotebook:tab-pack ##### -->
|
||||
<para>
|
||||
Deprecated: 2.20: The tab packing functionality of children should not
|
||||
be used anymore and support will be removed in the future.
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkNotebook:arrow-spacing ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkNotebook:has-backward-stepper ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkNotebook:has-forward-stepper ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkNotebook:has-secondary-backward-stepper ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkNotebook:has-secondary-forward-stepper ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkNotebook:tab-curvature ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkNotebook:tab-overlap ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_new ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_append_page ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
@child:
|
||||
@tab_label:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_append_page_menu ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
@child:
|
||||
@tab_label:
|
||||
@menu_label:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_prepend_page ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
@child: the
|
||||
@tab_label:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_prepend_page_menu ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
@child:
|
||||
@tab_label:
|
||||
@menu_label:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_insert_page ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
@child:
|
||||
@tab_label:
|
||||
@position:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_insert_page_menu ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
@child:
|
||||
@tab_label:
|
||||
@menu_label:
|
||||
@position:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_remove_page ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
@page_num:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_page_num ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
@child:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_next_page ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_prev_page ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_reorder_child ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
@child:
|
||||
@position:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_set_tab_pos ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@notebook: the notebook widget
|
||||
@pos: the position
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_set_show_tabs ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
@show_tabs:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_set_show_border ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
@show_border:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_set_scrollable ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
@scrollable:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_popup_enable ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_popup_disable ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_get_current_page ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@notebook: the notebook widget
|
||||
@Returns: the page number
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_get_menu_label ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
@child:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_get_nth_page ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
@page_num:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_get_n_pages ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_get_tab_label ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
@child:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_set_menu_label ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
@child:
|
||||
@menu_label:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_set_menu_label_text ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
@child:
|
||||
@menu_text:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_set_tab_label ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
@child:
|
||||
@tab_label:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_set_tab_label_text ##### -->
|
||||
<para>
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
@child:
|
||||
@tab_text:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_set_tab_reorderable ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
@child:
|
||||
@reorderable:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_set_tab_detachable ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
@child:
|
||||
@detachable:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_get_menu_label_text ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
@child:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_get_scrollable ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_get_show_border ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_get_show_tabs ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_get_tab_label_text ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
@child:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_get_tab_pos ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_get_tab_reorderable ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
@child:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_get_tab_detachable ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
@child:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_get_tab_hborder ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_get_tab_vborder ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_set_current_page ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
@page_num:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_set_group ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
@group:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_get_group ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_set_action_widget ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
@widget:
|
||||
@pack_type:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_get_action_widget ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@notebook:
|
||||
@pack_type:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### USER_FUNCTION GtkNotebookWindowCreationFunc ##### -->
|
||||
<para>
|
||||
A function used by GtkNotebook when a detachable tab is dropped
|
||||
in the root window, it's used to create a window containing a notebook
|
||||
where the tab will be attached. This function will also be responsible
|
||||
of moving/resizing the window and adding the necessary properties to
|
||||
the notebook (i.e.: group-id).
|
||||
|
||||
If the function returns %NULL, the drag will be cancelled.
|
||||
</para>
|
||||
|
||||
@source: The source #GtkNotebook of the drag operation
|
||||
@page: the child #GtkWidget affected
|
||||
@x: the X coordinate where the drop happens
|
||||
@y: the Y coordinate where the drop happens
|
||||
@data: user data
|
||||
@Returns: The created #GtkNotebook where the tab will be attached, or NULL to cancel the drag
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_notebook_set_window_creation_hook ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@func:
|
||||
@data:
|
||||
@destroy:
|
||||
|
||||
|
||||
308
docs/reference/gtk/tmpl/gtkpapersize.sgml
Normal file
308
docs/reference/gtk/tmpl/gtkpapersize.sgml
Normal file
@@ -0,0 +1,308 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkPaperSize
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
Support for named paper sizes
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
GtkPaperSize handles paper sizes. It uses the standard called
|
||||
"PWG 5101.1-2002 PWG: Standard for Media Standardized Names"
|
||||
<!-- FIXME link here -->
|
||||
to name the paper sizes (and to get the data for the page sizes).
|
||||
In addition to standard paper sizes, GtkPaperSize allows to
|
||||
construct custom paper sizes with arbitrary dimensions.
|
||||
</para>
|
||||
<para>
|
||||
The #GtkPaperSize object stores not only the dimensions (width
|
||||
and height) of a paper size and its name, it also provides
|
||||
default <link linkend="print-margins">print margins</link>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Printing support has been added in GTK+ 2.10.
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
#GtkPageSetup
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkPaperSize ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### ENUM GtkUnit ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@GTK_UNIT_PIXEL:
|
||||
@GTK_UNIT_POINTS:
|
||||
@GTK_UNIT_INCH:
|
||||
@GTK_UNIT_MM:
|
||||
|
||||
<!-- ##### MACRO GTK_PAPER_NAME_A3 ##### -->
|
||||
<para>
|
||||
Name for the A4 paper size.
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
<!-- ##### MACRO GTK_PAPER_NAME_A4 ##### -->
|
||||
<para>
|
||||
Name for the A4 paper size.
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
<!-- ##### MACRO GTK_PAPER_NAME_A5 ##### -->
|
||||
<para>
|
||||
Name for the A5 paper size.
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
<!-- ##### MACRO GTK_PAPER_NAME_B5 ##### -->
|
||||
<para>
|
||||
Name for the B5 paper size.
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
<!-- ##### MACRO GTK_PAPER_NAME_LETTER ##### -->
|
||||
<para>
|
||||
Name for the Letter paper size.
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
<!-- ##### MACRO GTK_PAPER_NAME_EXECUTIVE ##### -->
|
||||
<para>
|
||||
Name for the Executive paper size.
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
<!-- ##### MACRO GTK_PAPER_NAME_LEGAL ##### -->
|
||||
<para>
|
||||
Name for the Legal paper size.
|
||||
</para>
|
||||
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_paper_size_new ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@name:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_paper_size_new_from_ppd ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@ppd_name:
|
||||
@ppd_display_name:
|
||||
@width:
|
||||
@height:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_paper_size_new_custom ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@name:
|
||||
@display_name:
|
||||
@width:
|
||||
@height:
|
||||
@unit:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_paper_size_copy ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@other:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_paper_size_free ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@size:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_paper_size_is_equal ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@size1:
|
||||
@size2:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_paper_size_get_paper_sizes ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@include_custom:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_paper_size_get_name ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@size:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_paper_size_get_display_name ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@size:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_paper_size_get_ppd_name ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@size:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_paper_size_get_width ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@size:
|
||||
@unit:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_paper_size_get_height ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@size:
|
||||
@unit:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_paper_size_is_custom ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@size:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_paper_size_set_size ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@size:
|
||||
@width:
|
||||
@height:
|
||||
@unit:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_paper_size_get_default_top_margin ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@size:
|
||||
@unit:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_paper_size_get_default_bottom_margin ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@size:
|
||||
@unit:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_paper_size_get_default_left_margin ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@size:
|
||||
@unit:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_paper_size_get_default_right_margin ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@size:
|
||||
@unit:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_paper_size_get_default ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_paper_size_new_from_key_file ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@key_file:
|
||||
@group_name:
|
||||
@error:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_paper_size_to_key_file ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@size:
|
||||
@key_file:
|
||||
@group_name:
|
||||
|
||||
|
||||
@@ -140,10 +140,11 @@ Sets the group of a radio menu item, or changes it.
|
||||
|
||||
<!-- ##### FUNCTION gtk_radio_menu_item_get_group ##### -->
|
||||
<para>
|
||||
|
||||
Returns the group to which the radio menu item belongs, as a #GList of
|
||||
#GtkRadioMenuItem. The list belongs to GTK+ and should not be freed.
|
||||
</para>
|
||||
|
||||
@radio_menu_item:
|
||||
@Returns:
|
||||
@radio_menu_item: a #GtkRadioMenuItem.
|
||||
@Returns: the group of @radio_menu_item.
|
||||
|
||||
|
||||
|
||||
193
docs/reference/gtk/tmpl/gtkscale.sgml
Normal file
193
docs/reference/gtk/tmpl/gtkscale.sgml
Normal file
@@ -0,0 +1,193 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkScale
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
Base class for GtkHScale and GtkVScale
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
A #GtkScale is a slider control used to select a numeric value.
|
||||
To use it, you'll probably want to investigate the methods on
|
||||
its base class, #GtkRange, in addition to the methods for #GtkScale itself.
|
||||
To set the value of a scale, you would normally use gtk_range_set_value().
|
||||
To detect changes to the value, you would normally use the "value_changed"
|
||||
signal.
|
||||
</para>
|
||||
|
||||
<refsect2 id="GtkScale-BUILDER-UI"><title>GtkScale as GtkBuildable</title>
|
||||
<para>
|
||||
GtkScale supports a custom <marks> element, which
|
||||
can contain multiple <mark> elements. The "value" and "position"
|
||||
attributes have the same meaning as gtk_scale_add_mark() parameters of the
|
||||
same name. If the element is not empty, its content is taken as the markup
|
||||
to show at the mark. It can be translated with the usual "translatable and
|
||||
"context" attributes.
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkScale ##### -->
|
||||
<para>
|
||||
The fields of the #GtkScale-struct struct should only be accessed via
|
||||
the accessor functions.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### SIGNAL GtkScale::format-value ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@scale:
|
||||
@value:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### ARG GtkScale:digits ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkScale:draw-value ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkScale:value-pos ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkScale:slider-length ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkScale:value-spacing ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### FUNCTION gtk_scale_new ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@orientation:
|
||||
@adjustment:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_scale_new_with_range ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@orientation:
|
||||
@min:
|
||||
@max:
|
||||
@step:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_scale_set_digits ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@scale:
|
||||
@digits:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_scale_set_draw_value ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@scale:
|
||||
@draw_value:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_scale_set_value_pos ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@scale:
|
||||
@pos:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_scale_get_digits ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@scale:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_scale_get_draw_value ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@scale:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_scale_get_value_pos ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@scale:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_scale_get_layout ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@scale:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_scale_get_layout_offsets ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@scale:
|
||||
@x:
|
||||
@y:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_scale_add_mark ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@scale:
|
||||
@value:
|
||||
@position:
|
||||
@markup:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_scale_clear_marks ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@scale:
|
||||
|
||||
|
||||
@@ -44,21 +44,6 @@ vertical size from the vertical requisition of all widgets that can be
|
||||
reached from the widget by a chain of size groups of type
|
||||
%GTK_SIZE_GROUP_VERTICAL or %GTK_SIZE_GROUP_BOTH.
|
||||
</para>
|
||||
<para>
|
||||
Note that only non-contextual sizes of every widget are ever consulted
|
||||
by size groups (since size groups have no knowledge of what size a widget
|
||||
will be allocated in one dimension, it cannot derive how much height
|
||||
a widget will receive for a given width). When grouping widgets that
|
||||
trade height for width in mode %GTK_SIZE_GROUP_VERTICAL or %GTK_SIZE_GROUP_BOTH:
|
||||
the height for the minimum width will be the requested height for all
|
||||
widgets in the group. The same is of course true when horizontally grouping
|
||||
width for height widgets.
|
||||
</para>
|
||||
<para>
|
||||
Widgets that trade height-for-width should set a reasonably large minimum width
|
||||
by way of GtkLabel:width-chars for instance. Widgets with static sizes as well
|
||||
as widgets that grow (such as ellipsizing text) need no such considerations.
|
||||
</para>
|
||||
<refsect2 id="GtkSizeGroup-BUILDER-UI">
|
||||
<title>GtkSizeGroup as GtkBuildable</title>
|
||||
<para>
|
||||
|
||||
@@ -34,8 +34,8 @@ void create_integer_spin_button (void) {
|
||||
GtkWidget *window, *spinner;
|
||||
GtkAdjustment *spinner_adj;
|
||||
|
||||
spinner_adj = gtk_adjustment_new (50.0, 0.0, 100.0, 1.0, 5.0, 5.0);
|
||||
|
||||
spinner_adj = (GtkAdjustment *) gtk_adjustment_new (50.0, 0.0, 100.0, 1.0, 5.0, 5.0);
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 5);
|
||||
|
||||
@@ -69,8 +69,8 @@ void create_floating_spin_button (void) {
|
||||
GtkWidget *window, *spinner;
|
||||
GtkAdjustment *spinner_adj;
|
||||
|
||||
spinner_adj = gtk_adjustment_new (2.500, 0.0, 5.0, 0.001, 0.1, 0.1);
|
||||
|
||||
spinner_adj = (GtkAdjustment *) gtk_adjustment_new (2.500, 0.0, 5.0, 0.001, 0.1, 0.1);
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 5);
|
||||
|
||||
|
||||
125
docs/reference/gtk/tmpl/gtktexttagtable.sgml
Normal file
125
docs/reference/gtk/tmpl/gtktexttagtable.sgml
Normal file
@@ -0,0 +1,125 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkTextTagTable
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
|
||||
Collection of tags that can be used together
|
||||
|
||||
<!-- ##### 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>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkTextTagTable ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### SIGNAL GtkTextTagTable::tag-added ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@texttagtable: the object which received the signal.
|
||||
@arg1:
|
||||
|
||||
<!-- ##### SIGNAL GtkTextTagTable::tag-changed ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@texttagtable: the object which received the signal.
|
||||
@arg1:
|
||||
@arg2:
|
||||
|
||||
<!-- ##### SIGNAL GtkTextTagTable::tag-removed ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@texttagtable: the object which received the signal.
|
||||
@arg1:
|
||||
|
||||
<!-- ##### USER_FUNCTION GtkTextTagTableForeach ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tag:
|
||||
@data:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_text_tag_table_new ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_text_tag_table_add ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@table:
|
||||
@tag:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_text_tag_table_remove ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@table:
|
||||
@tag:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_text_tag_table_lookup ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@table:
|
||||
@name:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_text_tag_table_foreach ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@table:
|
||||
@func:
|
||||
@data:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_text_tag_table_get_size ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@table:
|
||||
@Returns:
|
||||
|
||||
|
||||
305
docs/reference/gtk/tmpl/gtktoolbar.sgml
Normal file
305
docs/reference/gtk/tmpl/gtktoolbar.sgml
Normal file
@@ -0,0 +1,305 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkToolbar
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
Create bars of buttons and other widgets
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
A toolbar is created with a call to gtk_toolbar_new().
|
||||
</para>
|
||||
<para>
|
||||
A toolbar can contain instances of a subclass of #GtkToolItem. To add
|
||||
a #GtkToolItem to the a toolbar, use gtk_toolbar_insert(). To remove
|
||||
an item from the toolbar use gtk_container_remove(). To add a button
|
||||
to the toolbar, add an instance of #GtkToolButton.
|
||||
</para>
|
||||
<para>
|
||||
Toolbar items can be visually grouped by adding instances of
|
||||
#GtkSeparatorToolItem to the toolbar. If a #GtkSeparatorToolItem has
|
||||
the "expand" property set to #TRUE and the "draw" property set to
|
||||
#FALSE the effect is to force all following items to the end of the
|
||||
toolbar.
|
||||
</para>
|
||||
<para>
|
||||
Creating a context menu for the toolbar can be done by connecting to
|
||||
the #GtkToolbar::popup-context-menu signal.
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
<variablelist>
|
||||
|
||||
<varlistentry>
|
||||
<term>#GtkToolItem</term>
|
||||
<listitem><para>Base class of widgets that can be added to a toolbar.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkToolbar ##### -->
|
||||
<para>
|
||||
The #GtkToolbar struct only contains private data and should only be
|
||||
accessed through the function described below.
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### SIGNAL GtkToolbar::focus-home-or-end ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@toolbar: the object which received the signal.
|
||||
@arg1:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### SIGNAL GtkToolbar::orientation-changed ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@toolbar: the object which received the signal.
|
||||
@orientation: the new #GtkOrientation of the toolbar.
|
||||
|
||||
<!-- ##### SIGNAL GtkToolbar::popup-context-menu ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@toolbar: the object which received the signal.
|
||||
@Returns:
|
||||
@Returns:
|
||||
@Returns:
|
||||
@Returns:
|
||||
|
||||
<!-- ##### SIGNAL GtkToolbar::style-changed ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@toolbar:
|
||||
@style:
|
||||
|
||||
<!-- ##### ARG GtkToolbar:icon-size ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkToolbar:icon-size-set ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkToolbar:show-arrow ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkToolbar:toolbar-style ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkToolbar:expand ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkToolbar:homogeneous ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkToolbar:button-relief ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkToolbar:internal-padding ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkToolbar:max-child-expand ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkToolbar:shadow-type ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkToolbar:space-size ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ARG GtkToolbar:space-style ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### ENUM GtkToolbarSpaceStyle ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@GTK_TOOLBAR_SPACE_EMPTY:
|
||||
@GTK_TOOLBAR_SPACE_LINE:
|
||||
|
||||
<!-- ##### FUNCTION gtk_toolbar_new ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@void:
|
||||
@Returns: the newly-created toolbar.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_toolbar_insert ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@toolbar:
|
||||
@item:
|
||||
@pos:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_toolbar_get_item_index ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@toolbar:
|
||||
@item:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_toolbar_get_n_items ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@toolbar:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_toolbar_get_nth_item ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@toolbar:
|
||||
@n:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_toolbar_get_drop_index ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@toolbar:
|
||||
@x:
|
||||
@y:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_toolbar_set_drop_highlight_item ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@toolbar:
|
||||
@tool_item:
|
||||
@index_:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_toolbar_set_show_arrow ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@toolbar:
|
||||
@show_arrow:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_toolbar_unset_icon_size ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@toolbar:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_toolbar_get_show_arrow ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@toolbar:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_toolbar_get_style ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@toolbar:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_toolbar_get_icon_size ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@toolbar:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_toolbar_get_relief_style ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@toolbar:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_toolbar_set_style ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@toolbar:
|
||||
@style:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_toolbar_set_icon_size ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@toolbar:
|
||||
@icon_size:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_toolbar_unset_style ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@toolbar:
|
||||
|
||||
|
||||
173
docs/reference/gtk/tmpl/gtktooltip.sgml
Normal file
173
docs/reference/gtk/tmpl/gtktooltip.sgml
Normal file
@@ -0,0 +1,173 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
GtkTooltip
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
Add tips to your widgets
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
#GtkTooltip belongs to the new tooltips API that was
|
||||
introduced in GTK+ 2.12 and which deprecates the old
|
||||
#GtkTooltips API.
|
||||
</para>
|
||||
<para>
|
||||
Basic tooltips can be realized simply by using gtk_widget_set_tooltip_text()
|
||||
or gtk_widget_set_tooltip_markup() without any explicit tooltip object.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
When you need a tooltip with a little more fancy contents, like
|
||||
adding an image, or you want the tooltip to have different contents
|
||||
per GtkTreeView row or cell, you will have to do a little more work:
|
||||
<itemizedlist>
|
||||
|
||||
<listitem><para>
|
||||
Set the #GtkWidget:has-tooltip property to %TRUE, this will
|
||||
make GTK+ monitor the widget for motion and related events
|
||||
which are needed to determine when and where to show a tooltip.
|
||||
</para></listitem>
|
||||
|
||||
<listitem><para>
|
||||
Connect to the #GtkWidget::query-tooltip signal. This signal
|
||||
will be emitted when a tooltip is supposed to be shown. One
|
||||
of the arguments passed to the signal handler is a #GtkTooltip
|
||||
object. This is the object that we are about to display as a
|
||||
tooltip, and can be manipulated in your callback using functions
|
||||
like gtk_tooltip_set_icon(). There are functions for setting
|
||||
the tooltip's markup, setting an image from a stock icon, or
|
||||
even putting in a custom widget.
|
||||
</para></listitem>
|
||||
|
||||
<listitem><para>
|
||||
Return %TRUE from your query-tooltip handler. This causes
|
||||
the tooltip to be show. If you return %FALSE, it will not be shown.
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
In the probably rare case where you want to have even more control
|
||||
over the tooltip that is about to be shown, you can set your own
|
||||
#GtkWindow which will be used as tooltip window. This works as
|
||||
follows:
|
||||
<itemizedlist>
|
||||
|
||||
<listitem><para>
|
||||
Set #GtkWidget:has-tooltip and connect to #GtkWidget::query-tooltip as
|
||||
before.
|
||||
</para></listitem>
|
||||
|
||||
<listitem><para>
|
||||
Use gtk_widget_set_tooltip_window() to set a #GtkWindow created
|
||||
by you as tooltip window.
|
||||
</para></listitem>
|
||||
|
||||
<listitem><para>
|
||||
In the ::query-tooltip callback you can access your window
|
||||
using gtk_widget_get_tooltip_window() and manipulate as you
|
||||
wish. The semantics of the return value are exactly as before,
|
||||
return %TRUE to show the window, %FALSE to not show it.
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkTooltip ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tooltip_set_markup ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tooltip:
|
||||
@markup:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tooltip_set_text ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tooltip:
|
||||
@text:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tooltip_set_icon ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tooltip:
|
||||
@pixbuf:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tooltip_set_icon_from_stock ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tooltip:
|
||||
@stock_id:
|
||||
@size:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tooltip_set_icon_from_icon_name ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tooltip:
|
||||
@icon_name:
|
||||
@size:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tooltip_set_icon_from_gicon ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tooltip:
|
||||
@gicon:
|
||||
@size:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tooltip_set_custom ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tooltip:
|
||||
@custom_widget:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tooltip_trigger_tooltip_query ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@display:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_tooltip_set_tip_area ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tooltip:
|
||||
@rect:
|
||||
|
||||
|
||||
51
docs/reference/gtk/tmpl/gtktypeutils.sgml
Normal file
51
docs/reference/gtk/tmpl/gtktypeutils.sgml
Normal file
@@ -0,0 +1,51 @@
|
||||
<!-- ##### SECTION Title ##### -->
|
||||
Types
|
||||
|
||||
<!-- ##### SECTION Short_Description ##### -->
|
||||
Handle run-time type creation
|
||||
|
||||
<!-- ##### SECTION Long_Description ##### -->
|
||||
<para>
|
||||
The GTK+ type system is extensible. Because of that, types have to be
|
||||
managed at runtime.
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION See_Also ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
<!-- ##### SECTION Stability_Level ##### -->
|
||||
|
||||
|
||||
<!-- ##### SECTION Image ##### -->
|
||||
|
||||
|
||||
<!-- ##### USER_FUNCTION GtkFunction ##### -->
|
||||
<para>
|
||||
Defines a function pointer.
|
||||
</para>
|
||||
|
||||
@data: #gpointer
|
||||
@Returns: #gint
|
||||
|
||||
|
||||
<!-- ##### USER_FUNCTION GtkCallbackMarshal ##### -->
|
||||
<para>
|
||||
Defines a function pointer.
|
||||
</para>
|
||||
|
||||
@object: #GtkObject*
|
||||
@data: #gpointer
|
||||
@n_args: #guint
|
||||
@args: #GtkArg*
|
||||
|
||||
|
||||
<!-- ##### STRUCT GtkArg ##### -->
|
||||
<para>
|
||||
This is a structure that we use to pass in typed values (and names).
|
||||
</para>
|
||||
|
||||
@type:
|
||||
@name:
|
||||
|
||||
@@ -33,7 +33,7 @@ find_toplevel_window (Window xid)
|
||||
|
||||
do
|
||||
{
|
||||
if (XQueryTree (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), xid, &root,
|
||||
if (XQueryTree (GDK_DISPLAY (), xid, &root,
|
||||
&parent, &children, &nchildren) == 0)
|
||||
{
|
||||
g_warning ("Couldn't find window manager window");
|
||||
@@ -82,7 +82,7 @@ remove_shaped_area (GdkPixbuf *pixbuf,
|
||||
gdk_pixbuf_get_height (pixbuf));
|
||||
|
||||
gdk_pixbuf_fill (retval, 0);
|
||||
rectangles = XShapeGetRectangles (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), window,
|
||||
rectangles = XShapeGetRectangles (GDK_DISPLAY (), window,
|
||||
ShapeBounding, &rectangle_count, &rectangle_order);
|
||||
|
||||
for (i = 0; i < rectangle_count; i++)
|
||||
@@ -130,7 +130,7 @@ take_window_shot (Window child,
|
||||
GdkPixbuf *tmp, *tmp2;
|
||||
GdkPixbuf *retval;
|
||||
|
||||
disp = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
|
||||
disp = GDK_DISPLAY ();
|
||||
w = GDK_ROOT_WINDOW ();
|
||||
|
||||
if (include_decoration)
|
||||
@@ -140,8 +140,7 @@ take_window_shot (Window child,
|
||||
|
||||
window = gdk_window_foreign_new (xid);
|
||||
|
||||
width = gdk_window_get_width (window);
|
||||
height = gdk_window_get_height (window);
|
||||
gdk_drawable_get_size (window, &width, &height);
|
||||
gdk_window_get_origin (window, &x_orig, &y_orig);
|
||||
|
||||
if (x_orig < 0)
|
||||
@@ -164,8 +163,8 @@ take_window_shot (Window child,
|
||||
if (y_orig + height > gdk_screen_height ())
|
||||
height = gdk_screen_height () - y_orig;
|
||||
|
||||
tmp = gdk_pixbuf_get_from_window (window,
|
||||
x, y, width, height);
|
||||
tmp = gdk_pixbuf_get_from_drawable (NULL, window, NULL,
|
||||
x, y, 0, 0, width, height);
|
||||
|
||||
if (include_decoration)
|
||||
tmp2 = remove_shaped_area (tmp, xid);
|
||||
|
||||
@@ -21,7 +21,7 @@ find_toplevel_window (Window xid)
|
||||
|
||||
do
|
||||
{
|
||||
if (XQueryTree (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), xid, &root,
|
||||
if (XQueryTree (GDK_DISPLAY (), xid, &root,
|
||||
&parent, &children, &nchildren) == 0)
|
||||
{
|
||||
g_warning ("Couldn't find window manager window");
|
||||
@@ -270,7 +270,7 @@ create_accel_label (void)
|
||||
|
||||
info = new_widget_info ("accel-label", box, SMALL);
|
||||
|
||||
gtk_widget_add_accelerator (button, "activate", accel_group, GDK_KEY_Q, GDK_CONTROL_MASK,
|
||||
gtk_widget_add_accelerator (button, "activate", accel_group, GDK_Q, GDK_CONTROL_MASK,
|
||||
GTK_ACCEL_VISIBLE | GTK_ACCEL_LOCKED);
|
||||
|
||||
return info;
|
||||
|
||||
@@ -1910,7 +1910,7 @@ given item, and perform the cast. Some common ones you will see are:</para>
|
||||
G_OBJECT (object)
|
||||
GTK_WIDGET (widget)
|
||||
GTK_OBJECT (object)
|
||||
G_CALLBACK (function)
|
||||
GTK_SIGNAL_FUNC (function)
|
||||
GTK_CONTAINER (container)
|
||||
GTK_WINDOW (window)
|
||||
GTK_BOX (box)
|
||||
@@ -2584,12 +2584,12 @@ but some cases will be shown in later examples where you may need to
|
||||
create one yourself. You create an adjustment using:</para>
|
||||
|
||||
<programlisting role="C">
|
||||
GtkAdjustment *gtk_adjustment_new( gdouble value,
|
||||
gdouble lower,
|
||||
gdouble upper,
|
||||
gdouble step_increment,
|
||||
gdouble page_increment,
|
||||
gdouble page_size );
|
||||
GtkObject *gtk_adjustment_new( gdouble value,
|
||||
gdouble lower,
|
||||
gdouble upper,
|
||||
gdouble step_increment,
|
||||
gdouble page_increment,
|
||||
gdouble page_size );
|
||||
</programlisting>
|
||||
|
||||
<para>The <literal>value</literal> argument is the initial value you want to give to the
|
||||
@@ -3151,7 +3151,7 @@ static void create_range_controls( void )
|
||||
GtkWidget *opt, *menu, *item;
|
||||
GtkWidget *label;
|
||||
GtkWidget *scale;
|
||||
GtkAdjustment *adj1, *adj2;
|
||||
GtkObject *adj1, *adj2;
|
||||
|
||||
/* Standard window-creating stuff */
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
@@ -4732,12 +4732,12 @@ button can take. This makes for a powerful Spin Button widget.</para>
|
||||
function, which illustrates the information that it holds:</para>
|
||||
|
||||
<programlisting role="C">
|
||||
GtkAdjustment *gtk_adjustment_new( gdouble value,
|
||||
gdouble lower,
|
||||
gdouble upper,
|
||||
gdouble step_increment,
|
||||
gdouble page_increment,
|
||||
gdouble page_size );
|
||||
GtkObject *gtk_adjustment_new( gdouble value,
|
||||
gdouble lower,
|
||||
gdouble upper,
|
||||
gdouble step_increment,
|
||||
gdouble page_increment,
|
||||
gdouble page_size );
|
||||
</programlisting>
|
||||
|
||||
<para>These attributes of an Adjustment are used by the Spin Button in the
|
||||
@@ -5030,8 +5030,9 @@ int main( int argc,
|
||||
label = gtk_label_new ("Day :");
|
||||
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
|
||||
gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, TRUE, 0);
|
||||
|
||||
adj = gtk_adjustment_new (1.0, 1.0, 31.0, 1.0, 5.0, 0.0);
|
||||
|
||||
adj = (GtkAdjustment *) gtk_adjustment_new (1.0, 1.0, 31.0, 1.0,
|
||||
5.0, 0.0);
|
||||
spinner = gtk_spin_button_new (adj, 0, 0);
|
||||
gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner), TRUE);
|
||||
gtk_box_pack_start (GTK_BOX (vbox2), spinner, FALSE, TRUE, 0);
|
||||
@@ -5042,8 +5043,9 @@ int main( int argc,
|
||||
label = gtk_label_new ("Month :");
|
||||
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
|
||||
gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, TRUE, 0);
|
||||
|
||||
adj = gtk_adjustment_new (1.0, 1.0, 12.0, 1.0, 5.0, 0.0);
|
||||
|
||||
adj = (GtkAdjustment *) gtk_adjustment_new (1.0, 1.0, 12.0, 1.0,
|
||||
5.0, 0.0);
|
||||
spinner = gtk_spin_button_new (adj, 0, 0);
|
||||
gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner), TRUE);
|
||||
gtk_box_pack_start (GTK_BOX (vbox2), spinner, FALSE, TRUE, 0);
|
||||
@@ -5054,8 +5056,9 @@ int main( int argc,
|
||||
label = gtk_label_new ("Year :");
|
||||
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
|
||||
gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, TRUE, 0);
|
||||
|
||||
adj = gtk_adjustment_new (1998.0, 0.0, 2100.0, 1.0, 100.0, 0.0);
|
||||
|
||||
adj = (GtkAdjustment *) gtk_adjustment_new (1998.0, 0.0, 2100.0,
|
||||
1.0, 100.0, 0.0);
|
||||
spinner = gtk_spin_button_new (adj, 0, 0);
|
||||
gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner), FALSE);
|
||||
gtk_widget_set_size_request (spinner, 55, -1);
|
||||
@@ -5077,8 +5080,9 @@ int main( int argc,
|
||||
label = gtk_label_new ("Value :");
|
||||
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
|
||||
gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, TRUE, 0);
|
||||
|
||||
adj = gtk_adjustment_new (0.0, -10000.0, 10000.0, 0.5, 100.0, 0.0);
|
||||
|
||||
adj = (GtkAdjustment *) gtk_adjustment_new (0.0, -10000.0, 10000.0,
|
||||
0.5, 100.0, 0.0);
|
||||
spinner1 = gtk_spin_button_new (adj, 1.0, 2);
|
||||
gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner1), TRUE);
|
||||
gtk_widget_set_size_request (spinner1, 100, -1);
|
||||
@@ -5090,8 +5094,8 @@ int main( int argc,
|
||||
label = gtk_label_new ("Digits :");
|
||||
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
|
||||
gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, TRUE, 0);
|
||||
|
||||
adj = gtk_adjustment_new (2, 1, 5, 1, 1, 0);
|
||||
|
||||
adj = (GtkAdjustment *) gtk_adjustment_new (2, 1, 5, 1, 1, 0);
|
||||
spinner2 = gtk_spin_button_new (adj, 0.0, 0);
|
||||
gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner2), TRUE);
|
||||
g_signal_connect (adj, "value_changed",
|
||||
@@ -5365,8 +5369,8 @@ widget.</para>
|
||||
the widget both looks and operates by using the function</para>
|
||||
|
||||
<programlisting role="C">
|
||||
void gtk_calendar_set_display_options( GtkCalendar *calendar,
|
||||
GtkCalendarDisplayOptions flags );
|
||||
void gtk_calendar_display_options( GtkCalendar *calendar,
|
||||
GtkCalendarDisplayOptions flags );
|
||||
</programlisting>
|
||||
|
||||
<para>The <literal>flags</literal> argument can be formed by combining either of the
|
||||
@@ -5401,6 +5405,14 @@ number for each week should be displayed down the left side of the
|
||||
calendar. (eg. Jan 1 = Week 1,Dec 31 = Week 52).</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><literal>GTK_CALENDAR_WEEK_START_MONDAY</literal></term>
|
||||
<listitem><para>this option states that the
|
||||
calander week will start on Monday instead of Sunday which is the
|
||||
default. This only affects the order in which days are displayed from
|
||||
left to right.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
<para>The following functions are used to set the the currently displayed
|
||||
@@ -5666,7 +5678,7 @@ static void calendar_set_flags( CalendarData *calendar )
|
||||
options = options + (1 << i);
|
||||
}
|
||||
if (calendar->window)
|
||||
gtk_calendar_set_display_options (GTK_CALENDAR (calendar->window), options);
|
||||
gtk_calendar_display_options (GTK_CALENDAR (calendar->window), options);
|
||||
}
|
||||
|
||||
static void calendar_toggle_flag( GtkWidget *toggle,
|
||||
@@ -6141,7 +6153,7 @@ gint main( gint argc,
|
||||
gtk_widget_set_events (drawingarea, GDK_BUTTON_PRESS_MASK);
|
||||
|
||||
g_signal_connect (GTK_OBJECT (drawingarea), "event",
|
||||
G_CALLBACK (area_event), (gpointer) drawingarea);
|
||||
GTK_SIGNAL_FUNC (area_event), (gpointer) drawingarea);
|
||||
|
||||
/* Add drawingarea to window, then show them both */
|
||||
|
||||
@@ -7638,7 +7650,7 @@ the toolbar widget.</para>
|
||||
"Closes this app", /* this button's tooltip */
|
||||
"Private", /* tooltip private info */
|
||||
iconw, /* icon widget */
|
||||
G_CALLBACK (delete_event), /* a signal */
|
||||
GTK_SIGNAL_FUNC (delete_event), /* a signal */
|
||||
NULL);
|
||||
gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)); /* space after item */
|
||||
</programlisting>
|
||||
@@ -7662,7 +7674,7 @@ widget, so that we can work with it in the normal way.</para>
|
||||
"Only icons in toolbar", /* tooltip */
|
||||
"Private", /* tooltip private string */
|
||||
iconw, /* icon */
|
||||
G_CALLBACK (radio_event), /* signal */
|
||||
GTK_SIGNAL_FUNC (radio_event), /* signal */
|
||||
toolbar); /* data for signal */
|
||||
gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
|
||||
</programlisting>
|
||||
@@ -7688,7 +7700,7 @@ tutorial).</para>
|
||||
"Only texts in toolbar",
|
||||
"Private",
|
||||
iconw,
|
||||
G_CALLBACK (radio_event),
|
||||
GTK_SIGNAL_FUNC (radio_event),
|
||||
toolbar);
|
||||
gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
|
||||
|
||||
@@ -7701,7 +7713,7 @@ tutorial).</para>
|
||||
"Icons and text in toolbar",
|
||||
"Private",
|
||||
iconw,
|
||||
G_CALLBACK (radio_event),
|
||||
GTK_SIGNAL_FUNC (radio_event),
|
||||
toolbar);
|
||||
gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (both_button), TRUE);
|
||||
@@ -7722,7 +7734,7 @@ between them).</para>
|
||||
"Toolbar with or without tips",
|
||||
"Private",
|
||||
iconw,
|
||||
G_CALLBACK (toggle_event),
|
||||
GTK_SIGNAL_FUNC (toggle_event),
|
||||
toolbar);
|
||||
gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (tooltips_button), TRUE);
|
||||
@@ -11792,7 +11804,7 @@ gtk_dial_new (GtkAdjustment *adjustment)
|
||||
dial = gtk_type_new (gtk_dial_get_type ());
|
||||
|
||||
if (!adjustment)
|
||||
adjustment = gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
|
||||
adjustment = (GtkAdjustment*) gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
|
||||
|
||||
gtk_dial_set_adjustment (dial, adjustment);
|
||||
|
||||
@@ -14998,7 +15010,7 @@ gtk_dial_new (GtkAdjustment *adjustment)
|
||||
dial = g_object_new (gtk_dial_get_type (), NULL);
|
||||
|
||||
if (!adjustment)
|
||||
adjustment = gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
|
||||
adjustment = (GtkAdjustment*) gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
|
||||
|
||||
gtk_dial_set_adjustment (dial, adjustment);
|
||||
|
||||
@@ -15061,10 +15073,10 @@ gtk_dial_set_adjustment (GtkDial *dial,
|
||||
g_object_ref (GTK_OBJECT (dial->adjustment));
|
||||
|
||||
g_signal_connect (GTK_OBJECT (adjustment), "changed",
|
||||
G_CALLBACK (gtk_dial_adjustment_changed),
|
||||
GTK_SIGNAL_FUNC (gtk_dial_adjustment_changed),
|
||||
(gpointer) dial);
|
||||
g_signal_connect (GTK_OBJECT (adjustment), "value_changed",
|
||||
G_CALLBACK (gtk_dial_adjustment_value_changed),
|
||||
GTK_SIGNAL_FUNC (gtk_dial_adjustment_value_changed),
|
||||
(gpointer) dial);
|
||||
|
||||
dial->old_value = adjustment->value;
|
||||
@@ -15586,9 +15598,9 @@ int main( int argc,
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
|
||||
gtk_container_add (GTK_CONTAINER (vbox), frame);
|
||||
gtk_widget_show (frame);
|
||||
|
||||
adjustment = gtk_adjustment_new (0, 0, 100, 0.01, 0.1, 0);
|
||||
|
||||
|
||||
adjustment = GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 100, 0.01, 0.1, 0));
|
||||
|
||||
dial = gtk_dial_new (adjustment);
|
||||
gtk_dial_set_update_policy (GTK_DIAL (dial), GTK_UPDATE_DELAYED);
|
||||
/* gtk_widget_set_size_request (dial, 100, 100); */
|
||||
|
||||
@@ -17,6 +17,7 @@ SUBDIRS = arrow \
|
||||
notebook \
|
||||
packbox \
|
||||
paned \
|
||||
pixmap \
|
||||
progressbar \
|
||||
radiobuttons \
|
||||
rangewidgets \
|
||||
|
||||
@@ -160,7 +160,7 @@ static void calendar_set_flags( CalendarData *calendar )
|
||||
options = options + (1 << i);
|
||||
}
|
||||
if (calendar->window)
|
||||
gtk_calendar_set_display_options (GTK_CALENDAR (calendar->window), options);
|
||||
gtk_calendar_display_options (GTK_CALENDAR (calendar->window), options);
|
||||
}
|
||||
|
||||
static void calendar_toggle_flag( GtkWidget *toggle,
|
||||
|
||||
@@ -96,8 +96,8 @@ gint main( gint argc,
|
||||
|
||||
/* Attach to the "delete" and "destroy" events so we can exit */
|
||||
|
||||
g_signal_connect (window, "delete_event",
|
||||
G_CALLBACK (destroy_window), (gpointer) window);
|
||||
g_signal_connect (GTK_OBJECT (window), "delete_event",
|
||||
GTK_SIGNAL_FUNC (destroy_window), (gpointer) window);
|
||||
|
||||
/* Create drawingarea, set size and catch button events */
|
||||
|
||||
@@ -112,8 +112,8 @@ gint main( gint argc,
|
||||
|
||||
gtk_widget_set_events (drawingarea, GDK_BUTTON_PRESS_MASK);
|
||||
|
||||
g_signal_connect (drawingarea, "event",
|
||||
G_CALLBACK (area_event), (gpointer) drawingarea);
|
||||
g_signal_connect (GTK_OBJECT (drawingarea), "event",
|
||||
GTK_SIGNAL_FUNC (area_event), (gpointer) drawingarea);
|
||||
|
||||
/* Add drawingarea to window, then show them both */
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ int main( int argc,
|
||||
gtk_container_add (GTK_CONTAINER (vbox), frame);
|
||||
gtk_widget_show (frame);
|
||||
|
||||
adjustment = gtk_adjustment_new (0, 0, 100, 0.01, 0.1, 0);
|
||||
adjustment = GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 100, 0.01, 0.1, 0));
|
||||
|
||||
dial = gtk_dial_new (adjustment);
|
||||
gtk_dial_set_update_policy (GTK_DIAL (dial), GTK_UPDATE_DELAYED);
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
static void gtk_dial_class_init (GtkDialClass *klass);
|
||||
static void gtk_dial_init (GtkDial *dial);
|
||||
static void gtk_dial_destroy (GtkWidget *widget);
|
||||
static void gtk_dial_destroy (GtkObject *object);
|
||||
static void gtk_dial_realize (GtkWidget *widget);
|
||||
static void gtk_dial_size_request (GtkWidget *widget,
|
||||
GtkRequisition *requisition);
|
||||
@@ -87,13 +87,16 @@ gtk_dial_get_type ()
|
||||
static void
|
||||
gtk_dial_class_init (GtkDialClass *class)
|
||||
{
|
||||
GtkObjectClass *object_class;
|
||||
GtkWidgetClass *widget_class;
|
||||
|
||||
object_class = (GtkObjectClass*) class;
|
||||
widget_class = (GtkWidgetClass*) class;
|
||||
|
||||
parent_class = g_type_class_peek_parent (class);
|
||||
|
||||
widget_class->destroy = gtk_dial_destroy;
|
||||
object_class->destroy = gtk_dial_destroy;
|
||||
|
||||
widget_class->realize = gtk_dial_realize;
|
||||
widget_class->expose_event = gtk_dial_expose;
|
||||
widget_class->size_request = gtk_dial_size_request;
|
||||
@@ -126,7 +129,7 @@ gtk_dial_new (GtkAdjustment *adjustment)
|
||||
dial = g_object_new (gtk_dial_get_type (), NULL);
|
||||
|
||||
if (!adjustment)
|
||||
adjustment = gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
|
||||
adjustment = (GtkAdjustment*) gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
|
||||
|
||||
gtk_dial_set_adjustment (dial, adjustment);
|
||||
|
||||
@@ -134,22 +137,22 @@ gtk_dial_new (GtkAdjustment *adjustment)
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_dial_destroy (GtkWidget *widget)
|
||||
gtk_dial_destroy (GtkObject *object)
|
||||
{
|
||||
GtkDial *dial;
|
||||
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GTK_IS_DIAL (object));
|
||||
|
||||
dial = GTK_DIAL (widget);
|
||||
dial = GTK_DIAL (object);
|
||||
|
||||
if (dial->adjustment)
|
||||
{
|
||||
g_object_unref (dial->adjustment);
|
||||
g_object_unref (GTK_OBJECT (dial->adjustment));
|
||||
dial->adjustment = NULL;
|
||||
}
|
||||
|
||||
GTK_WIDGET_CLASS (parent_class)->destroy (widget);
|
||||
GTK_OBJECT_CLASS (parent_class)->destroy (object);
|
||||
}
|
||||
|
||||
GtkAdjustment*
|
||||
@@ -180,12 +183,12 @@ gtk_dial_set_adjustment (GtkDial *dial,
|
||||
|
||||
if (dial->adjustment)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (dial->adjustment, NULL, (gpointer) dial);
|
||||
g_object_unref (dial->adjustment);
|
||||
g_signal_handlers_disconnect_by_func (GTK_OBJECT (dial->adjustment), NULL, (gpointer) dial);
|
||||
g_object_unref (GTK_OBJECT (dial->adjustment));
|
||||
}
|
||||
|
||||
dial->adjustment = adjustment;
|
||||
g_object_ref (dial->adjustment);
|
||||
g_object_ref (GTK_OBJECT (dial->adjustment));
|
||||
|
||||
g_signal_connect (G_OBJECT (adjustment), "changed",
|
||||
G_CALLBACK (gtk_dial_adjustment_changed),
|
||||
@@ -478,7 +481,7 @@ gtk_dial_button_release( GtkWidget *widget,
|
||||
|
||||
if ((dial->policy != GTK_UPDATE_CONTINUOUS) &&
|
||||
(dial->old_value != dial->adjustment->value))
|
||||
g_signal_emit_by_name (dial->adjustment, "value_changed");
|
||||
g_signal_emit_by_name (GTK_OBJECT (dial->adjustment), "value_changed");
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
@@ -536,7 +539,7 @@ gtk_dial_timer( GtkDial *dial )
|
||||
g_return_val_if_fail (GTK_IS_DIAL (dial), FALSE);
|
||||
|
||||
if (dial->policy == GTK_UPDATE_DELAYED)
|
||||
g_signal_emit_by_name (dial->adjustment, "value_changed");
|
||||
g_signal_emit_by_name (GTK_OBJECT (dial->adjustment), "value_changed");
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -572,7 +575,7 @@ gtk_dial_update_mouse( GtkDial *dial, gint x, gint y )
|
||||
{
|
||||
if (dial->policy == GTK_UPDATE_CONTINUOUS)
|
||||
{
|
||||
g_signal_emit_by_name (dial->adjustment, "value_changed");
|
||||
g_signal_emit_by_name (GTK_OBJECT (dial->adjustment), "value_changed");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -610,7 +613,7 @@ gtk_dial_update (GtkDial *dial)
|
||||
if (new_value != dial->adjustment->value)
|
||||
{
|
||||
dial->adjustment->value = new_value;
|
||||
g_signal_emit_by_name (dial->adjustment, "value_changed");
|
||||
g_signal_emit_by_name (GTK_OBJECT (dial->adjustment), "value_changed");
|
||||
}
|
||||
|
||||
dial->angle = 7.*M_PI/6. - (new_value - dial->adjustment->lower) * 4.*M_PI/3. /
|
||||
|
||||
14
examples/pixmap/Makefile
Normal file
14
examples/pixmap/Makefile
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
CC = gcc
|
||||
|
||||
CFLAGS = -Wall \
|
||||
-DG_DISABLE_DEPRECATED \
|
||||
-DGDK_DISABLE_DEPRECATED \
|
||||
-DGDK_PIXBUF_DISABLE_DEPRECATED \
|
||||
-DGTK_DISABLE_DEPRECATED
|
||||
|
||||
pixmap: pixmap.c
|
||||
$(CC) pixmap.c -o pixmap $(CFLAGS) `pkg-config gtk+-2.0 --cflags --libs`
|
||||
|
||||
clean:
|
||||
rm -f *.o pixmap
|
||||
89
examples/pixmap/pixmap.c
Normal file
89
examples/pixmap/pixmap.c
Normal file
@@ -0,0 +1,89 @@
|
||||
|
||||
#include "config.h"
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
|
||||
/* XPM data of Open-File icon */
|
||||
static const char * xpm_data[] = {
|
||||
"16 16 3 1",
|
||||
" c None",
|
||||
". c #000000000000",
|
||||
"X c #FFFFFFFFFFFF",
|
||||
" ",
|
||||
" ...... ",
|
||||
" .XXX.X. ",
|
||||
" .XXX.XX. ",
|
||||
" .XXX.XXX. ",
|
||||
" .XXX..... ",
|
||||
" .XXXXXXX. ",
|
||||
" .XXXXXXX. ",
|
||||
" .XXXXXXX. ",
|
||||
" .XXXXXXX. ",
|
||||
" .XXXXXXX. ",
|
||||
" .XXXXXXX. ",
|
||||
" .XXXXXXX. ",
|
||||
" ......... ",
|
||||
" ",
|
||||
" "};
|
||||
|
||||
|
||||
/* when invoked (via signal delete_event), terminates the application.
|
||||
*/
|
||||
gint close_application( GtkWidget *widget,
|
||||
GdkEvent *event,
|
||||
gpointer data )
|
||||
{
|
||||
gtk_main_quit ();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/* is invoked when the button is clicked. It just prints a message.
|
||||
*/
|
||||
void button_clicked( GtkWidget *widget,
|
||||
gpointer data ) {
|
||||
g_print ("button clicked\n");
|
||||
}
|
||||
|
||||
int main( int argc,
|
||||
char *argv[] )
|
||||
{
|
||||
/* GtkWidget is the storage type for widgets */
|
||||
GtkWidget *window, *pixmapwid, *button;
|
||||
GdkPixmap *pixmap;
|
||||
GdkBitmap *mask;
|
||||
GtkStyle *style;
|
||||
|
||||
/* create the main window, and attach delete_event signal to terminating
|
||||
the application */
|
||||
gtk_init (&argc, &argv);
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
g_signal_connect (window, "delete-event",
|
||||
G_CALLBACK (close_application), NULL);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
|
||||
gtk_widget_show (window);
|
||||
|
||||
/* now for the pixmap from gdk */
|
||||
style = gtk_widget_get_style (window);
|
||||
pixmap = gdk_pixmap_create_from_xpm_d (window->window, &mask,
|
||||
&style->bg[GTK_STATE_NORMAL],
|
||||
(gchar **)xpm_data);
|
||||
|
||||
/* a pixmap widget to contain the pixmap */
|
||||
pixmapwid = gtk_image_new_from_pixmap (pixmap, mask);
|
||||
gtk_widget_show (pixmapwid);
|
||||
|
||||
/* a button to contain the pixmap widget */
|
||||
button = gtk_button_new ();
|
||||
gtk_container_add (GTK_CONTAINER (button), pixmapwid);
|
||||
gtk_container_add (GTK_CONTAINER (window), button);
|
||||
gtk_widget_show (button);
|
||||
|
||||
g_signal_connect (button, "clicked",
|
||||
G_CALLBACK (button_clicked), NULL);
|
||||
|
||||
/* show the window */
|
||||
gtk_main ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -87,7 +87,7 @@ static void create_range_controls( void )
|
||||
GtkWidget *opt, *menu, *item;
|
||||
GtkWidget *label;
|
||||
GtkWidget *scale;
|
||||
GtkAdjustment *adj1, *adj2;
|
||||
GtkObject *adj1, *adj2;
|
||||
|
||||
/* Standard window-creating stuff */
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
|
||||
@@ -92,7 +92,8 @@ int main( int argc,
|
||||
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
|
||||
gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, TRUE, 0);
|
||||
|
||||
adj = gtk_adjustment_new (1.0, 1.0, 31.0, 1.0, 5.0, 0.0);
|
||||
adj = (GtkAdjustment *) gtk_adjustment_new (1.0, 1.0, 31.0, 1.0,
|
||||
5.0, 0.0);
|
||||
spinner = gtk_spin_button_new (adj, 0, 0);
|
||||
gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner), TRUE);
|
||||
gtk_box_pack_start (GTK_BOX (vbox2), spinner, FALSE, TRUE, 0);
|
||||
@@ -104,7 +105,8 @@ int main( int argc,
|
||||
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
|
||||
gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, TRUE, 0);
|
||||
|
||||
adj = gtk_adjustment_new (1.0, 1.0, 12.0, 1.0, 5.0, 0.0);
|
||||
adj = (GtkAdjustment *) gtk_adjustment_new (1.0, 1.0, 12.0, 1.0,
|
||||
5.0, 0.0);
|
||||
spinner = gtk_spin_button_new (adj, 0, 0);
|
||||
gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner), TRUE);
|
||||
gtk_box_pack_start (GTK_BOX (vbox2), spinner, FALSE, TRUE, 0);
|
||||
@@ -116,7 +118,8 @@ int main( int argc,
|
||||
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
|
||||
gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, TRUE, 0);
|
||||
|
||||
adj = gtk_adjustment_new (1998.0, 0.0, 2100.0, 1.0, 100.0, 0.0);
|
||||
adj = (GtkAdjustment *) gtk_adjustment_new (1998.0, 0.0, 2100.0,
|
||||
1.0, 100.0, 0.0);
|
||||
spinner = gtk_spin_button_new (adj, 0, 0);
|
||||
gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner), FALSE);
|
||||
gtk_widget_set_size_request (spinner, 55, -1);
|
||||
@@ -139,7 +142,8 @@ int main( int argc,
|
||||
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
|
||||
gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, TRUE, 0);
|
||||
|
||||
adj = gtk_adjustment_new (0.0, -10000.0, 10000.0, 0.5, 100.0, 0.0);
|
||||
adj = (GtkAdjustment *) gtk_adjustment_new (0.0, -10000.0, 10000.0,
|
||||
0.5, 100.0, 0.0);
|
||||
spinner1 = gtk_spin_button_new (adj, 1.0, 2);
|
||||
gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner1), TRUE);
|
||||
gtk_widget_set_size_request (spinner1, 100, -1);
|
||||
@@ -152,7 +156,7 @@ int main( int argc,
|
||||
gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
|
||||
gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, TRUE, 0);
|
||||
|
||||
adj = gtk_adjustment_new (2, 1, 5, 1, 1, 0);
|
||||
adj = (GtkAdjustment *) gtk_adjustment_new (2, 1, 5, 1, 1, 0);
|
||||
spinner2 = gtk_spin_button_new (adj, 0.0, 0);
|
||||
gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner2), TRUE);
|
||||
g_signal_connect (adj, "value-changed",
|
||||
|
||||
@@ -84,9 +84,9 @@ gdk_public_h_sources = \
|
||||
gdkinput.h \
|
||||
gdkkeys.h \
|
||||
gdkkeysyms.h \
|
||||
gdkkeysyms-compat.h \
|
||||
gdkpango.h \
|
||||
gdkpixbuf.h \
|
||||
gdkpixmap.h \
|
||||
gdkprivate.h \
|
||||
gdkproperty.h \
|
||||
gdkscreen.h \
|
||||
@@ -126,6 +126,8 @@ gdk_c_sources = \
|
||||
gdkoffscreenwindow.c \
|
||||
gdkpango.c \
|
||||
gdkpixbuf-drawable.c \
|
||||
gdkpixbuf-render.c \
|
||||
gdkpixmap.c \
|
||||
gdkrectangle.c \
|
||||
gdkscreen.c \
|
||||
gdkselection.c \
|
||||
@@ -169,13 +171,13 @@ libgdk_win32_3_0_la_LDFLAGS = -Wl,win32/rc/gdk-win32-res.o -export-symbols $(src
|
||||
if HAVE_INTROSPECTION
|
||||
|
||||
introspection_files = \
|
||||
$(filter-out gdkkeysyms-compat.h, $(gdk_public_h_sources)) \
|
||||
$(gdk_public_h_sources) \
|
||||
$(gdk_c_sources) \
|
||||
gdkenumtypes.c \
|
||||
gdkenumtypes.h
|
||||
|
||||
Gdk-3.0.gir: $(gdktargetlib) Makefile
|
||||
Gdk_3_0_gir_SCANNERFLAGS = --warn-all
|
||||
Gdk_3_0_gir_SCANNERFLAGS = --strip-prefix=Gdk
|
||||
Gdk_3_0_gir_INCLUDES = Gio-2.0 GdkPixbuf-2.0 Pango-1.0 cairo-1.0
|
||||
Gdk_3_0_gir_LIBS = $(gdktargetlib)
|
||||
Gdk_3_0_gir_FILES = $(introspection_files)
|
||||
@@ -187,6 +189,7 @@ x11_introspection_files = \
|
||||
x11/checksettings.c \
|
||||
x11/gdkapplaunchcontext-x11.c \
|
||||
x11/gdkasync.c \
|
||||
x11/gdkcolor-x11.c \
|
||||
x11/gdkcursor-x11.c \
|
||||
x11/gdkdevice-core.c \
|
||||
x11/gdkdevicemanager-core.c \
|
||||
@@ -206,6 +209,7 @@ x11_introspection_files = \
|
||||
x11/gdkinput.c \
|
||||
x11/gdkkeys-x11.c \
|
||||
x11/gdkmain-x11.c \
|
||||
x11/gdkpixmap-x11.c \
|
||||
x11/gdkproperty-x11.c \
|
||||
x11/gdkscreen-x11.c \
|
||||
x11/gdkselection-x11.c \
|
||||
@@ -221,15 +225,12 @@ x11_introspection_files = \
|
||||
x11/gdkx.h
|
||||
|
||||
GdkX11-3.0.gir: $(gdktargetlib) Gdk-3.0.gir Makefile
|
||||
GdkX11_3_0_gir_SCANNERFLAGS = --warn-all --strip-prefix=Gdk
|
||||
GdkX11_3_0_gir_SCANNERFLAGS = --strip-prefix=gdk_x11
|
||||
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 = $(gdktargetlib)
|
||||
GdkX11_3_0_gir_FILES = $(x11_introspection_files)
|
||||
GdkX11_3_0_gir_CFLAGS = $(INCLUDES) -L$(top_builddir)/gdk
|
||||
INTROSPECTION_GIRS += GdkX11-3.0.gir
|
||||
|
||||
introspection_files += $(filter-out x11/gdkx.h, $(x11_introspection_files))
|
||||
|
||||
endif # USE_X11
|
||||
|
||||
girdir = $(datadir)/gir-1.0
|
||||
@@ -244,7 +245,6 @@ endif # HAVE_INTROSPECTION
|
||||
|
||||
if OS_WIN32
|
||||
install-def-file: gdk.def
|
||||
mkdir -p $(DESTDIR)$(libdir)
|
||||
$(INSTALL) $(srcdir)/gdk.def $(DESTDIR)$(libdir)/gdk-win32-3.0.def
|
||||
uninstall-def-file:
|
||||
-rm $(DESTDIR)$(libdir)/gdk-win32-3.0.def
|
||||
@@ -260,7 +260,6 @@ gdk-win32-$(GTK_API_VERSION).lib: libgdk-win32-$(GTK_API_VERSION).la gdk.def
|
||||
lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgdk-win32-$(GTK_API_VERSION)-@LT_CURRENT_MINUS_AGE@.dll -def:gdk.def -out:$@
|
||||
|
||||
install-ms-lib:
|
||||
mkdir -p $(DESTDIR)$(libdir)
|
||||
$(INSTALL) gdk-win32-$(GTK_API_VERSION).lib $(DESTDIR)$(libdir)
|
||||
|
||||
uninstall-ms-lib:
|
||||
|
||||
14
gdk/gdk.c
14
gdk/gdk.c
@@ -63,11 +63,6 @@ static int gdk_initialized = 0; /* 1 if the library is initialized,
|
||||
|
||||
static gchar *gdk_progclass = NULL;
|
||||
|
||||
static GMutex *gdk_threads_mutex = NULL; /* Global GDK lock */
|
||||
|
||||
static GCallback gdk_threads_lock = NULL;
|
||||
static GCallback gdk_threads_unlock = NULL;
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
static const GDebugKey gdk_debug_keys[] = {
|
||||
{"events", GDK_DEBUG_EVENTS},
|
||||
@@ -76,6 +71,9 @@ static const GDebugKey gdk_debug_keys[] = {
|
||||
{"xim", GDK_DEBUG_XIM},
|
||||
{"nograbs", GDK_DEBUG_NOGRABS},
|
||||
{"colormap", GDK_DEBUG_COLORMAP},
|
||||
{"gc", GDK_DEBUG_GC},
|
||||
{"pixmap", GDK_DEBUG_PIXMAP},
|
||||
{"image", GDK_DEBUG_IMAGE},
|
||||
{"input", GDK_DEBUG_INPUT},
|
||||
{"cursor", GDK_DEBUG_CURSOR},
|
||||
{"multihead", GDK_DEBUG_MULTIHEAD},
|
||||
@@ -386,15 +384,13 @@ gdk_init (int *argc, char ***argv)
|
||||
void
|
||||
gdk_threads_enter (void)
|
||||
{
|
||||
if (gdk_threads_lock)
|
||||
(*gdk_threads_lock) ();
|
||||
GDK_THREADS_ENTER ();
|
||||
}
|
||||
|
||||
void
|
||||
gdk_threads_leave (void)
|
||||
{
|
||||
if (gdk_threads_unlock)
|
||||
(*gdk_threads_unlock) ();
|
||||
GDK_THREADS_LEAVE ();
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
31
gdk/gdk.h
31
gdk/gdk.h
@@ -43,9 +43,9 @@
|
||||
#include <gdk/gdkevents.h>
|
||||
#include <gdk/gdkinput.h>
|
||||
#include <gdk/gdkkeys.h>
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
#include <gdk/gdkpango.h>
|
||||
#include <gdk/gdkpixbuf.h>
|
||||
#include <gdk/gdkpixmap.h>
|
||||
#include <gdk/gdkproperty.h>
|
||||
#include <gdk/gdkscreen.h>
|
||||
#include <gdk/gdkselection.h>
|
||||
@@ -80,11 +80,8 @@ void gdk_set_program_class (const char *program_class);
|
||||
|
||||
/* Push and pop error handlers for X errors
|
||||
*/
|
||||
void gdk_error_trap_push (void);
|
||||
/* warn unused because you could use pop_ignored otherwise */
|
||||
G_GNUC_WARN_UNUSED_RESULT gint gdk_error_trap_pop (void);
|
||||
void gdk_error_trap_pop_ignored (void);
|
||||
|
||||
void gdk_error_trap_push (void);
|
||||
gint gdk_error_trap_pop (void);
|
||||
|
||||
gchar* gdk_get_display (void);
|
||||
G_CONST_RETURN gchar* gdk_get_display_arg_name (void);
|
||||
@@ -154,6 +151,13 @@ void gdk_notify_startup_complete_with_id (const gchar* startup_id);
|
||||
/* Threading
|
||||
*/
|
||||
|
||||
#if !defined (GDK_DISABLE_DEPRECATED) || defined (GDK_COMPILATION)
|
||||
GDKVAR GMutex *gdk_threads_mutex; /* private */
|
||||
#endif
|
||||
|
||||
GDKVAR GCallback gdk_threads_lock;
|
||||
GDKVAR GCallback gdk_threads_unlock;
|
||||
|
||||
void gdk_threads_enter (void);
|
||||
void gdk_threads_leave (void);
|
||||
void gdk_threads_init (void);
|
||||
@@ -183,8 +187,19 @@ guint gdk_threads_add_timeout_seconds (guint interval,
|
||||
GSourceFunc function,
|
||||
gpointer data);
|
||||
|
||||
#define GDK_THREADS_ENTER() gdk_threads_enter()
|
||||
#define GDK_THREADS_LEAVE() gdk_threads_leave()
|
||||
#ifdef G_THREADS_ENABLED
|
||||
# define GDK_THREADS_ENTER() G_STMT_START { \
|
||||
if (gdk_threads_lock) \
|
||||
(*gdk_threads_lock) (); \
|
||||
} G_STMT_END
|
||||
# define GDK_THREADS_LEAVE() G_STMT_START { \
|
||||
if (gdk_threads_unlock) \
|
||||
(*gdk_threads_unlock) (); \
|
||||
} G_STMT_END
|
||||
#else /* !G_THREADS_ENABLED */
|
||||
# define GDK_THREADS_ENTER()
|
||||
# define GDK_THREADS_LEAVE()
|
||||
#endif /* !G_THREADS_ENABLED */
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
113
gdk/gdk.symbols
113
gdk/gdk.symbols
@@ -109,9 +109,8 @@ gdk_device_manager_xi_get_type
|
||||
|
||||
#if IN_HEADER(__GDK_H__)
|
||||
#if IN_FILE(__GDK_MAIN_X11_C__)
|
||||
gdk_error_trap_push
|
||||
gdk_error_trap_pop
|
||||
gdk_error_trap_pop_ignored
|
||||
gdk_error_trap_push
|
||||
gdk_get_display
|
||||
#endif
|
||||
#endif
|
||||
@@ -288,13 +287,11 @@ gdk_visual_type_get_type G_GNUC_CONST
|
||||
#if IN_FILE(__GDK_CAIRO_C__)
|
||||
gdk_cairo_create
|
||||
gdk_cairo_reset_clip
|
||||
gdk_cairo_get_clip_rectangle
|
||||
gdk_cairo_set_source_color
|
||||
gdk_cairo_set_source_pixbuf
|
||||
gdk_cairo_set_source_window
|
||||
gdk_cairo_set_source_pixmap
|
||||
gdk_cairo_rectangle
|
||||
gdk_cairo_region
|
||||
gdk_cairo_region_create_from_surface
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -305,11 +302,24 @@ gdk_color_equal
|
||||
gdk_color_free
|
||||
gdk_color_get_type G_GNUC_CONST
|
||||
gdk_color_hash
|
||||
gdk_colormap_alloc_color
|
||||
gdk_colormap_get_system
|
||||
gdk_colormap_get_visual
|
||||
gdk_color_parse
|
||||
gdk_color_to_string
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IN_HEADER(__GDK_COLOR_H__)
|
||||
#if IN_FILE(__GDK_COLOR_X11_C__)
|
||||
gdk_colormap_new
|
||||
gdk_colormap_get_type G_GNUC_CONST
|
||||
gdk_colormap_alloc_colors
|
||||
gdk_colormap_free_colors
|
||||
gdk_colormap_get_screen
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IN_HEADER(__GDK_CURSOR_H__)
|
||||
#if IN_FILE(__GDK_CURSOR_C__)
|
||||
gdk_cursor_get_type G_GNUC_CONST
|
||||
@@ -325,6 +335,7 @@ gdk_cursor_unref
|
||||
gdk_cursor_get_display
|
||||
gdk_cursor_new_for_display
|
||||
gdk_cursor_new_from_pixbuf
|
||||
gdk_cursor_new_from_pixmap
|
||||
gdk_cursor_new_from_name
|
||||
gdk_cursor_get_image
|
||||
#endif
|
||||
@@ -521,8 +532,23 @@ gdk_drag_get_protocol
|
||||
#if IN_HEADER(__GDK_DRAWABLE_H__)
|
||||
#if IN_FILE(__GDK_DRAW_C__)
|
||||
gdk_drawable_get_clip_region
|
||||
gdk_drawable_get_colormap
|
||||
gdk_drawable_get_depth
|
||||
gdk_drawable_get_display
|
||||
gdk_drawable_get_screen
|
||||
gdk_drawable_get_size
|
||||
gdk_drawable_get_type G_GNUC_CONST
|
||||
gdk_drawable_get_visible_region
|
||||
gdk_drawable_get_visual
|
||||
gdk_drawable_set_colormap
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IN_HEADER(__GDK_PIXMAP_X11_H__)
|
||||
#if IN_FILE(__GDK_PIXMAP_X11_C__)
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
gdk_pixmap_impl_x11_get_type G_GNUC_CONST
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -556,25 +582,23 @@ gdk_window_get_accept_focus
|
||||
gdk_window_get_background_pattern
|
||||
gdk_window_get_composited
|
||||
gdk_window_get_cursor
|
||||
gdk_window_get_display
|
||||
gdk_window_get_focus_on_map
|
||||
gdk_window_get_geometry
|
||||
gdk_window_get_height
|
||||
gdk_window_get_modal_hint
|
||||
gdk_window_get_origin
|
||||
gdk_window_get_root_coords
|
||||
gdk_window_get_deskrelative_origin
|
||||
gdk_window_set_support_multidevice
|
||||
gdk_window_get_support_multidevice
|
||||
gdk_window_get_screen
|
||||
gdk_window_get_visual
|
||||
gdk_window_get_width
|
||||
gdk_window_has_native
|
||||
gdk_window_set_background
|
||||
gdk_window_set_background_pattern
|
||||
gdk_window_set_back_pixmap
|
||||
gdk_window_set_cursor
|
||||
gdk_window_shape_combine_mask
|
||||
gdk_window_shape_combine_region
|
||||
gdk_window_set_child_shapes
|
||||
gdk_window_merge_child_shapes
|
||||
gdk_window_input_shape_combine_mask
|
||||
gdk_window_input_shape_combine_region
|
||||
gdk_window_set_child_input_shapes
|
||||
gdk_window_merge_child_input_shapes
|
||||
@@ -586,6 +610,9 @@ gdk_window_at_pointer
|
||||
#endif
|
||||
gdk_window_begin_paint_rect
|
||||
gdk_window_begin_paint_region
|
||||
gdk_window_clear
|
||||
gdk_window_clear_area
|
||||
gdk_window_clear_area_e
|
||||
gdk_window_constrain_size
|
||||
gdk_window_coords_from_parent
|
||||
gdk_window_coords_to_parent
|
||||
@@ -597,6 +624,7 @@ gdk_window_foreign_new
|
||||
gdk_window_freeze_toplevel_updates_libgtk_only
|
||||
gdk_window_freeze_updates
|
||||
gdk_window_get_children
|
||||
gdk_window_get_internal_paint_info
|
||||
gdk_window_get_parent
|
||||
gdk_window_get_effective_parent
|
||||
#ifndef GDK_MULTIDEVICE_SAFE
|
||||
@@ -621,7 +649,9 @@ gdk_window_object_get_type G_GNUC_CONST
|
||||
gdk_window_peek_children
|
||||
gdk_window_process_all_updates
|
||||
gdk_window_process_updates
|
||||
gdk_window_redirect_to_drawable
|
||||
gdk_window_remove_filter
|
||||
gdk_window_remove_redirection
|
||||
gdk_window_set_debug_updates
|
||||
gdk_window_set_user_data
|
||||
gdk_window_thaw_toplevel_updates_libgtk_only
|
||||
@@ -643,7 +673,7 @@ gdk_window_get_device_position
|
||||
|
||||
#if IN_HEADER(__GDK_WINDOW_H__)
|
||||
#if IN_FILE(__GDK_OFFSCREEN_WINDOW_C__)
|
||||
gdk_offscreen_window_get_surface
|
||||
gdk_offscreen_window_get_pixmap
|
||||
gdk_offscreen_window_set_embedder
|
||||
gdk_offscreen_window_get_embedder
|
||||
#endif
|
||||
@@ -684,6 +714,7 @@ gdk_window_set_override_redirect
|
||||
gdk_window_set_accept_focus
|
||||
gdk_window_set_focus_on_map
|
||||
gdk_window_set_icon_list
|
||||
gdk_window_set_icon
|
||||
gdk_window_set_icon_name
|
||||
gdk_window_set_opacity
|
||||
gdk_window_iconify
|
||||
@@ -786,11 +817,36 @@ gdk_pango_layout_line_get_clip_region
|
||||
|
||||
#if IN_HEADER(__GDK_PIXBUF_H__)
|
||||
#if IN_FILE(__GDK_PIXBUF_DRAWABLE_C__)
|
||||
gdk_pixbuf_get_from_window
|
||||
gdk_pixbuf_get_from_drawable
|
||||
gdk_pixbuf_get_from_surface
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IN_HEADER(__GDK_PIXBUF_H__)
|
||||
#if IN_FILE(__GDK_PIXBUF_RENDER_C__)
|
||||
gdk_pixbuf_render_pixmap_and_mask
|
||||
gdk_pixbuf_render_pixmap_and_mask_for_colormap
|
||||
gdk_pixbuf_render_threshold_alpha
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IN_HEADER(__GDK_PIXMAP_H__)
|
||||
#if IN_FILE(__GDK_PIXMAP_C__)
|
||||
gdk_pixmap_get_type G_GNUC_CONST
|
||||
gdk_pixmap_new
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IN_HEADER(__GDK_PIXMAP_H__)
|
||||
#if IN_FILE(__GDK_PIXMAP_X11_C__)
|
||||
gdk_pixmap_foreign_new
|
||||
gdk_pixmap_foreign_new_for_display
|
||||
gdk_pixmap_foreign_new_for_screen
|
||||
gdk_pixmap_lookup
|
||||
gdk_pixmap_lookup_for_display
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IN_HEADER(__GDK_SCREEN_H__)
|
||||
#if IN_FILE(__GDK_SCREEN_C__)
|
||||
gdk_screen_get_type G_GNUC_CONST
|
||||
@@ -834,11 +890,14 @@ gdk_screen_get_number
|
||||
gdk_screen_get_primary_monitor
|
||||
gdk_screen_get_root_window
|
||||
gdk_screen_get_setting
|
||||
gdk_screen_get_default_colormap
|
||||
gdk_screen_set_default_colormap
|
||||
gdk_screen_get_n_monitors
|
||||
gdk_screen_get_monitor_geometry
|
||||
gdk_screen_get_monitor_width_mm
|
||||
gdk_screen_get_monitor_height_mm
|
||||
gdk_screen_get_monitor_plug_name
|
||||
gdk_screen_get_rgba_colormap
|
||||
gdk_screen_get_rgba_visual
|
||||
gdk_screen_get_active_window
|
||||
gdk_screen_get_window_stack
|
||||
@@ -847,6 +906,12 @@ gdk_screen_make_display_name
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IN_HEADER(__GDK_SCREEN_H__)
|
||||
#if IN_FILE(__GDK_COLOR_X11_C__)
|
||||
gdk_screen_get_system_colormap
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IN_HEADER(__GDK_SELECTION_H__)
|
||||
#if IN_FILE(__GDK_SELECTION_C__)
|
||||
gdk_selection_owner_set
|
||||
@@ -943,6 +1008,12 @@ gdk_x11_xatom_to_atom
|
||||
gdk_x11_xatom_to_atom_for_display
|
||||
#endif
|
||||
|
||||
#if IN_FILE(__GDK_COLOR_X11_C__)
|
||||
gdk_x11_colormap_foreign_new
|
||||
gdk_x11_colormap_get_xcolormap
|
||||
gdk_x11_colormap_get_xdisplay
|
||||
#endif
|
||||
|
||||
#if IN_FILE(__GDK_CURSOR_X11_C__)
|
||||
gdk_x11_cursor_get_xcursor
|
||||
gdk_x11_cursor_get_xdisplay
|
||||
@@ -958,15 +1029,13 @@ gdk_x11_lookup_xdisplay
|
||||
gdk_x11_display_broadcast_startup_message
|
||||
gdk_x11_display_get_startup_notification_id
|
||||
gdk_x11_register_standard_event_type
|
||||
gdk_x11_display_error_trap_push
|
||||
gdk_x11_display_error_trap_pop
|
||||
gdk_x11_display_error_trap_pop_ignored
|
||||
#endif
|
||||
|
||||
#if IN_FILE(__GDK_DRAWABLE_X11_C__)
|
||||
gdk_x11_drawable_get_xdisplay
|
||||
gdk_x11_drawable_get_xid
|
||||
gdk_x11_window_get_drawable_impl
|
||||
gdk_x11_pixmap_get_drawable_impl
|
||||
#endif
|
||||
|
||||
#if IN_FILE(__GDK_MAIN_X11_C__)
|
||||
@@ -1023,3 +1092,15 @@ gdk_app_launch_context_set_icon_name
|
||||
gdk_window_impl_get_type G_GNUC_CONST
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef INCLUDE_VARIABLES
|
||||
gdk_threads_mutex
|
||||
gdk_threads_lock
|
||||
gdk_threads_unlock
|
||||
#endif
|
||||
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
#ifdef INCLUDE_VARIABLES
|
||||
gdk_display
|
||||
#endif
|
||||
#endif
|
||||
|
||||
234
gdk/gdkcairo.c
234
gdk/gdkcairo.c
@@ -18,30 +18,10 @@
|
||||
*/
|
||||
|
||||
#include "gdkcairo.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include "gdkdrawable.h"
|
||||
#include "gdkinternals.h"
|
||||
|
||||
|
||||
/**
|
||||
* SECTION:cairo_interaction
|
||||
* @Short_description: Functions to support using Cairo
|
||||
* @Title: Cairo Interaction
|
||||
*
|
||||
* <link href="http://cairographics.org">Cairo</link> is a graphics
|
||||
* library that supports vector graphics and image compositing that
|
||||
* can be used with GDK. Since 2.8, GTK+ does most of its drawing
|
||||
* using Cairo.
|
||||
*
|
||||
* GDK does not wrap the Cairo API, instead it allows to create Cairo
|
||||
* contexts which can be used to draw on #GdkDrawables. Additional
|
||||
* functions allow to convert GDK's rectangles and regions into
|
||||
* Cairo paths and to use pixbufs as sources for drawing operations.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* gdk_cairo_create:
|
||||
* @drawable: a #GdkDrawable
|
||||
@@ -106,45 +86,6 @@ gdk_cairo_reset_clip (cairo_t *cr,
|
||||
GDK_DRAWABLE_GET_CLASS (drawable)->set_cairo_clip (drawable, cr);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_cairo_get_clip_rectangle:
|
||||
* @cr: a cairo context
|
||||
* @rect: (out) (allow-none): return location for the clip, or %NULL
|
||||
*
|
||||
* This is a convenience function around cairo_clip_extents(). It rounds
|
||||
* the clip extents to integer coordinates and returns a boolean
|
||||
* indicating if a clip area exists.
|
||||
*
|
||||
* Returns: %TRUE if a clip rectangle exists, %FALSE if all of @cr is
|
||||
* clipped and all drawing can be skipped.
|
||||
**/
|
||||
gboolean
|
||||
gdk_cairo_get_clip_rectangle (cairo_t *cr,
|
||||
GdkRectangle *rect)
|
||||
{
|
||||
double x1, y1, x2, y2;
|
||||
gboolean clip_exists;
|
||||
|
||||
cairo_clip_extents (cr, &x1, &y1, &x2, &y2);
|
||||
|
||||
clip_exists = x1 < x2 && y1 < y2;
|
||||
|
||||
if (rect)
|
||||
{
|
||||
x1 = floor (x1);
|
||||
y1 = floor (y1);
|
||||
x2 = ceil (x2);
|
||||
y2 = ceil (y2);
|
||||
|
||||
rect->x = CLAMP (x1, G_MININT, G_MAXINT);
|
||||
rect->y = CLAMP (y1, G_MININT, G_MAXINT);
|
||||
rect->width = CLAMP (x2 - x1, G_MININT, G_MAXINT);
|
||||
rect->height = CLAMP (y2 - y1, G_MININT, G_MAXINT);
|
||||
}
|
||||
|
||||
return clip_exists;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_cairo_set_source_color:
|
||||
* @cr: a #cairo_t
|
||||
@@ -322,172 +263,27 @@ gdk_cairo_set_source_pixbuf (cairo_t *cr,
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_cairo_set_source_window:
|
||||
* gdk_cairo_set_source_pixmap:
|
||||
* @cr: a #Cairo context
|
||||
* @window: a #GdkWindow
|
||||
* @x: X coordinate of location to place upper left corner of @window
|
||||
* @y: Y coordinate of location to place upper left corner of @window
|
||||
*
|
||||
* Sets the given window as the source pattern for the Cairo context.
|
||||
* @pixmap: a #GdkPixmap
|
||||
* @pixmap_x: X coordinate of location to place upper left corner of @pixmap
|
||||
* @pixmap_y: Y coordinate of location to place upper left corner of @pixmap
|
||||
*
|
||||
* Sets the given pixmap as the source pattern for the Cairo context.
|
||||
* The pattern has an extend mode of %CAIRO_EXTEND_NONE and is aligned
|
||||
* so that the origin of @window is @x, @y. The window contains all its
|
||||
* subwindows when rendering.
|
||||
* so that the origin of @pixmap is @pixmap_x, @pixmap_y
|
||||
*
|
||||
* Note that the contents of @window are undefined outside of the
|
||||
* visible part of @window, so use this function with care.
|
||||
*
|
||||
* Since: 2.24
|
||||
*/
|
||||
* Since: 2.10
|
||||
**/
|
||||
void
|
||||
gdk_cairo_set_source_window (cairo_t *cr,
|
||||
GdkWindow *window,
|
||||
double x,
|
||||
double y)
|
||||
gdk_cairo_set_source_pixmap (cairo_t *cr,
|
||||
GdkPixmap *pixmap,
|
||||
double pixmap_x,
|
||||
double pixmap_y)
|
||||
{
|
||||
cairo_surface_t *surface;
|
||||
|
||||
g_return_if_fail (cr != NULL);
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
|
||||
surface = _gdk_drawable_ref_cairo_surface (GDK_DRAWABLE (window));
|
||||
cairo_set_source_surface (cr, surface, x, y);
|
||||
surface = _gdk_drawable_ref_cairo_surface (GDK_DRAWABLE (pixmap));
|
||||
cairo_set_source_surface (cr, surface, pixmap_x, pixmap_y);
|
||||
cairo_surface_destroy (surface);
|
||||
}
|
||||
|
||||
/**
|
||||
* _gdk_cairo_surface_extents:
|
||||
* @surface: surface to measure
|
||||
* @extents: (out): rectangle to put the extents
|
||||
*
|
||||
* Measures the area covered by @surface and puts it into @extents.
|
||||
* Note that this function respects device offsets set on @surface.
|
||||
* if @surface is unbounded, the resulting extents will be empty and
|
||||
* not be a maximal sized rectangle. This is to avoid careless coding.
|
||||
* You must explicitly check the return value of you want to handle
|
||||
* that case.
|
||||
*
|
||||
* Returns: %TRUE if the extents fit in a #GdkRectangle, %FALSE if not.
|
||||
**/
|
||||
gboolean
|
||||
_gdk_cairo_surface_extents (cairo_surface_t *surface,
|
||||
GdkRectangle *extents)
|
||||
{
|
||||
double x1, x2, y1, y2;
|
||||
cairo_t *cr;
|
||||
|
||||
g_return_val_if_fail (surface != NULL, FALSE);
|
||||
g_return_val_if_fail (extents != NULL, FALSE);
|
||||
|
||||
cr = cairo_create (surface);
|
||||
cairo_clip_extents (cr, &x1, &y1, &x2, &y2);
|
||||
|
||||
x1 = floor (x1);
|
||||
y1 = floor (y1);
|
||||
x2 = ceil (x2);
|
||||
y2 = ceil (y2);
|
||||
x2 -= x1;
|
||||
y2 -= y1;
|
||||
|
||||
if (x1 < G_MININT || x1 > G_MAXINT ||
|
||||
y1 < G_MININT || y1 > G_MAXINT ||
|
||||
x2 > G_MAXINT || y2 > G_MAXINT)
|
||||
{
|
||||
extents->x = extents->y = extents->width = extents->height = 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
extents->x = x1;
|
||||
extents->y = y1;
|
||||
extents->width = x2;
|
||||
extents->height = y2;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* This function originally from Jean-Edouard Lachand-Robert, and
|
||||
* available at www.codeguru.com. Simplified for our needs, not sure
|
||||
* how much of the original code left any longer. Now handles just
|
||||
* one-bit deep bitmaps (in Window parlance, ie those that GDK calls
|
||||
* bitmaps (and not pixmaps), with zero pixels being transparent.
|
||||
*/
|
||||
/**
|
||||
* gdk_cairo_region_create_from_surface:
|
||||
* @surface: A surface
|
||||
*
|
||||
* Creates region that describes covers the area where the given @surface
|
||||
* is more than 50% opaque. This function takes into account device
|
||||
* offsets that might be set with cairo_surface_set_device_offset().
|
||||
*
|
||||
* Returns: A new region
|
||||
**/
|
||||
cairo_region_t *
|
||||
gdk_cairo_region_create_from_surface (cairo_surface_t *surface)
|
||||
{
|
||||
cairo_region_t *region;
|
||||
GdkRectangle extents, rect;
|
||||
cairo_surface_t *image;
|
||||
cairo_t *cr;
|
||||
gint x, y, stride;
|
||||
guchar *data;
|
||||
|
||||
_gdk_cairo_surface_extents (surface, &extents);
|
||||
|
||||
if (cairo_surface_get_content (surface) == CAIRO_CONTENT_COLOR)
|
||||
return cairo_region_create_rectangle (&extents);
|
||||
|
||||
if (cairo_surface_get_type (surface) != CAIRO_SURFACE_TYPE_IMAGE ||
|
||||
cairo_image_surface_get_format (surface) != CAIRO_FORMAT_A1)
|
||||
{
|
||||
/* coerce to an A1 image */
|
||||
image = cairo_image_surface_create (CAIRO_FORMAT_A1,
|
||||
extents.width, extents.height);
|
||||
cr = cairo_create (image);
|
||||
cairo_set_source_surface (cr, surface, -extents.x, -extents.y);
|
||||
cairo_paint (cr);
|
||||
cairo_destroy (cr);
|
||||
}
|
||||
else
|
||||
image = cairo_surface_reference (surface);
|
||||
|
||||
data = cairo_image_surface_get_data (image);
|
||||
stride = cairo_image_surface_get_stride (image);
|
||||
|
||||
region = cairo_region_create ();
|
||||
|
||||
for (y = 0; y < extents.height; y++)
|
||||
{
|
||||
for (x = 0; x < extents.width; x++)
|
||||
{
|
||||
/* Search for a continuous range of "non transparent pixels"*/
|
||||
gint x0 = x;
|
||||
while (x < extents.width)
|
||||
{
|
||||
if (((data[x / 8] >> (x%8)) & 1) == 0)
|
||||
/* This pixel is "transparent"*/
|
||||
break;
|
||||
x++;
|
||||
}
|
||||
|
||||
if (x > x0)
|
||||
{
|
||||
/* Add the pixels (x0, y) to (x, y+1) as a new rectangle
|
||||
* in the region
|
||||
*/
|
||||
rect.x = x0;
|
||||
rect.width = x - x0;
|
||||
rect.y = y;
|
||||
rect.height = 1;
|
||||
|
||||
cairo_region_union_rectangle (region, &rect);
|
||||
}
|
||||
}
|
||||
data += stride;
|
||||
}
|
||||
|
||||
cairo_surface_destroy (image);
|
||||
|
||||
cairo_region_translate (region, extents.x, extents.y);
|
||||
|
||||
return region;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,8 +33,6 @@ G_BEGIN_DECLS
|
||||
cairo_t *gdk_cairo_create (GdkDrawable *drawable);
|
||||
void gdk_cairo_reset_clip (cairo_t *cr,
|
||||
GdkDrawable *drawable);
|
||||
gboolean gdk_cairo_get_clip_rectangle(cairo_t *cr,
|
||||
GdkRectangle *rect);
|
||||
|
||||
void gdk_cairo_set_source_color (cairo_t *cr,
|
||||
const GdkColor *color);
|
||||
@@ -42,20 +40,16 @@ void gdk_cairo_set_source_pixbuf (cairo_t *cr,
|
||||
const GdkPixbuf *pixbuf,
|
||||
double pixbuf_x,
|
||||
double pixbuf_y);
|
||||
void gdk_cairo_set_source_window (cairo_t *cr,
|
||||
GdkWindow *window,
|
||||
double x,
|
||||
double y);
|
||||
void gdk_cairo_set_source_pixmap (cairo_t *cr,
|
||||
GdkPixmap *pixmap,
|
||||
double pixmap_x,
|
||||
double pixmap_y);
|
||||
|
||||
void gdk_cairo_rectangle (cairo_t *cr,
|
||||
const GdkRectangle *rectangle);
|
||||
void gdk_cairo_region (cairo_t *cr,
|
||||
const cairo_region_t *region);
|
||||
|
||||
cairo_region_t *
|
||||
gdk_cairo_region_create_from_surface
|
||||
(cairo_surface_t *surface);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_CAIRO_H__ */
|
||||
|
||||
@@ -33,11 +33,20 @@
|
||||
|
||||
|
||||
/**
|
||||
* SECTION:colors
|
||||
* @Short_description: Manipulation of colors
|
||||
* @Title: Colors
|
||||
*/
|
||||
* gdk_colormap_get_visual:
|
||||
* @colormap: a #GdkColormap.
|
||||
*
|
||||
* Returns the visual for which a given colormap was created.
|
||||
*
|
||||
* Return value: the visual of the colormap.
|
||||
**/
|
||||
GdkVisual *
|
||||
gdk_colormap_get_visual (GdkColormap *colormap)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_COLORMAP (colormap), NULL);
|
||||
|
||||
return colormap->visual;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_color_copy:
|
||||
@@ -75,6 +84,39 @@ gdk_color_free (GdkColor *color)
|
||||
g_slice_free (GdkColor, color);
|
||||
}
|
||||
|
||||
/********************
|
||||
* Color allocation *
|
||||
********************/
|
||||
|
||||
/**
|
||||
* gdk_colormap_alloc_color:
|
||||
* @colormap: a #GdkColormap.
|
||||
* @color: the color to allocate. On return the
|
||||
* <structfield>pixel</structfield> field will be
|
||||
* filled in if allocation succeeds.
|
||||
* @writeable: this parameter has no effect, and it's here for mere
|
||||
* compatibility.
|
||||
* @best_match: If %TRUE, GDK will attempt to do matching against
|
||||
* existing colors if the color cannot be allocated as requested.
|
||||
*
|
||||
* Allocates a single color from a colormap.
|
||||
*
|
||||
* Return value: %TRUE if the allocation succeeded.
|
||||
**/
|
||||
gboolean
|
||||
gdk_colormap_alloc_color (GdkColormap *colormap,
|
||||
GdkColor *color,
|
||||
gboolean writeable,
|
||||
gboolean best_match)
|
||||
{
|
||||
gboolean success;
|
||||
|
||||
gdk_colormap_alloc_colors (colormap, color, 1, writeable, best_match,
|
||||
&success);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_color_hash:
|
||||
* @colora: a #GdkColor.
|
||||
@@ -126,13 +168,15 @@ G_DEFINE_BOXED_TYPE (GdkColor, gdk_color,
|
||||
* Parses a textual specification of a color and fill in the
|
||||
* <structfield>red</structfield>, <structfield>green</structfield>,
|
||||
* and <structfield>blue</structfield> fields of a #GdkColor
|
||||
* structure. The string can either one of a large set of standard
|
||||
* names. (Taken from the X11 <filename>rgb.txt</filename> file), or
|
||||
* it can be a hex value in the form '#rgb' '#rrggbb'
|
||||
* '#rrrgggbbb' or '#rrrrggggbbbb' where 'r', 'g' and 'b' are
|
||||
* hex digits of the red, green, and blue components of the color,
|
||||
* respectively. (White in the four forms is '#fff' '#ffffff'
|
||||
* '#fffffffff' and '#ffffffffffff')
|
||||
* structure. The color is <emphasis>not</emphasis> allocated, you
|
||||
* must call gdk_colormap_alloc_color() yourself. The string can
|
||||
* either one of a large set of standard names. (Taken from the X11
|
||||
* <filename>rgb.txt</filename> file), or it can be a hex value in the
|
||||
* form '#rgb' '#rrggbb' '#rrrgggbbb' or
|
||||
* '#rrrrggggbbbb' where 'r', 'g' and 'b' are hex digits of the
|
||||
* red, green, and blue components of the color, respectively. (White
|
||||
* in the four forms is '#fff' '#ffffff' '#fffffffff' and
|
||||
* '#ffffffffffff')
|
||||
*
|
||||
* Return value: %TRUE if the parsing succeeded.
|
||||
**/
|
||||
@@ -180,3 +224,17 @@ gdk_color_to_string (const GdkColor *color)
|
||||
|
||||
return pango_color_to_string (&pango_color);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_colormap_get_system:
|
||||
*
|
||||
* Gets the system's default colormap for the default screen. (See
|
||||
* gdk_colormap_get_system_for_screen ())
|
||||
*
|
||||
* Return value: the default colormap.
|
||||
**/
|
||||
GdkColormap*
|
||||
gdk_colormap_get_system (void)
|
||||
{
|
||||
return gdk_screen_get_system_colormap (gdk_screen_get_default ());
|
||||
}
|
||||
|
||||
@@ -36,19 +36,12 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
||||
/**
|
||||
* GdkColor:
|
||||
* @pixel: For allocated colors, the value used to
|
||||
* draw this color on the screen.
|
||||
* @red: The red component of the color. This is
|
||||
* a value between 0 and 65535, with 65535 indicating
|
||||
* full intensitiy.
|
||||
* @green: The green component of the color.
|
||||
* @blue: The blue component of the color.
|
||||
*
|
||||
* The #GdkColor structure is used to describe an
|
||||
* allocated or unallocated color.
|
||||
/* The color type.
|
||||
* A color consists of red, green and blue values in the
|
||||
* range 0-65535 and a pixel value. The pixel value is highly
|
||||
* dependent on the depth and colormap which this color will
|
||||
* be used to draw into. Therefore, sharing colors between
|
||||
* colormaps is a bad idea.
|
||||
*/
|
||||
struct _GdkColor
|
||||
{
|
||||
@@ -58,8 +51,68 @@ struct _GdkColor
|
||||
guint16 blue;
|
||||
};
|
||||
|
||||
/* The colormap type.
|
||||
*/
|
||||
|
||||
typedef struct _GdkColormapClass GdkColormapClass;
|
||||
|
||||
#define GDK_TYPE_COLORMAP (gdk_colormap_get_type ())
|
||||
#define GDK_COLORMAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_COLORMAP, GdkColormap))
|
||||
#define GDK_COLORMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_COLORMAP, GdkColormapClass))
|
||||
#define GDK_IS_COLORMAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_COLORMAP))
|
||||
#define GDK_IS_COLORMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_COLORMAP))
|
||||
#define GDK_COLORMAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_COLORMAP, GdkColormapClass))
|
||||
|
||||
#define GDK_TYPE_COLOR (gdk_color_get_type ())
|
||||
|
||||
struct _GdkColormap
|
||||
{
|
||||
/*< private >*/
|
||||
GObject parent_instance;
|
||||
|
||||
/*< public >*/
|
||||
gint GSEAL (size);
|
||||
GdkColor *GSEAL (colors);
|
||||
|
||||
/*< private >*/
|
||||
GdkVisual *GSEAL (visual);
|
||||
|
||||
gpointer GSEAL (windowing_data);
|
||||
};
|
||||
|
||||
struct _GdkColormapClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
|
||||
};
|
||||
|
||||
GType gdk_colormap_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GdkColormap* gdk_colormap_new (GdkVisual *visual,
|
||||
gboolean allocate);
|
||||
|
||||
#ifndef GDK_MULTIHEAD_SAFE
|
||||
GdkColormap* gdk_colormap_get_system (void);
|
||||
#endif
|
||||
|
||||
GdkScreen *gdk_colormap_get_screen (GdkColormap *cmap);
|
||||
|
||||
gint gdk_colormap_alloc_colors (GdkColormap *colormap,
|
||||
GdkColor *colors,
|
||||
gint n_colors,
|
||||
gboolean writeable,
|
||||
gboolean best_match,
|
||||
gboolean *success);
|
||||
gboolean gdk_colormap_alloc_color (GdkColormap *colormap,
|
||||
GdkColor *color,
|
||||
gboolean writeable,
|
||||
gboolean best_match);
|
||||
void gdk_colormap_free_colors (GdkColormap *colormap,
|
||||
const GdkColor *colors,
|
||||
gint n_colors);
|
||||
|
||||
GdkVisual *gdk_colormap_get_visual (GdkColormap *colormap);
|
||||
|
||||
GdkColor *gdk_color_copy (const GdkColor *color);
|
||||
void gdk_color_free (GdkColor *color);
|
||||
gboolean gdk_color_parse (const gchar *spec,
|
||||
|
||||
@@ -141,6 +141,12 @@ GdkCursor* gdk_cursor_new_for_display (GdkDisplay *display,
|
||||
#ifndef GDK_MULTIHEAD_SAFE
|
||||
GdkCursor* gdk_cursor_new (GdkCursorType cursor_type);
|
||||
#endif
|
||||
GdkCursor* gdk_cursor_new_from_pixmap (GdkPixmap *source,
|
||||
GdkPixmap *mask,
|
||||
const GdkColor *fg,
|
||||
const GdkColor *bg,
|
||||
gint x,
|
||||
gint y);
|
||||
GdkCursor* gdk_cursor_new_from_pixbuf (GdkDisplay *display,
|
||||
GdkPixbuf *pixbuf,
|
||||
gint x,
|
||||
|
||||
@@ -95,7 +95,7 @@ gdk_device_class_init (GdkDeviceClass *klass)
|
||||
PROP_DISPLAY,
|
||||
g_param_spec_object ("display",
|
||||
P_("Device Display"),
|
||||
P_("Display which the device belongs to"),
|
||||
P_("Display to which the device belongs to"),
|
||||
GDK_TYPE_DISPLAY,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
@@ -110,7 +110,7 @@ gdk_device_class_init (GdkDeviceClass *klass)
|
||||
PROP_DEVICE_MANAGER,
|
||||
g_param_spec_object ("device-manager",
|
||||
P_("Device manager"),
|
||||
P_("Device manager which the device belongs to"),
|
||||
P_("Device manager to which the device belongs to"),
|
||||
GDK_TYPE_DEVICE_MANAGER,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
@@ -148,7 +148,7 @@ gdk_device_class_init (GdkDeviceClass *klass)
|
||||
/**
|
||||
* GdkDevice:associated-device:
|
||||
*
|
||||
* Associated pointer or keyboard with this device, if any. Devices of type #GDK_DEVICE_TYPE_MASTER
|
||||
* Associated pointer or keyboard to this device, if any. Devices of type #GDK_DEVICE_TYPE_MASTER
|
||||
* always come in keyboard/pointer pairs. Other device types will have a %NULL associated device.
|
||||
*
|
||||
* Since: 3.0
|
||||
@@ -157,7 +157,7 @@ gdk_device_class_init (GdkDeviceClass *klass)
|
||||
PROP_ASSOCIATED_DEVICE,
|
||||
g_param_spec_object ("associated-device",
|
||||
P_("Associated device"),
|
||||
P_("Associated pointer or keyboard with this device"),
|
||||
P_("Associated pointer or keyboard to this device"),
|
||||
GDK_TYPE_DEVICE,
|
||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
||||
/**
|
||||
@@ -202,7 +202,7 @@ gdk_device_class_init (GdkDeviceClass *klass)
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_HAS_CURSOR,
|
||||
g_param_spec_boolean ("has-cursor",
|
||||
P_("Whether the device has a cursor"),
|
||||
P_("Whether the device has cursor"),
|
||||
P_("Whether there is a visible cursor following device motion"),
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
|
||||
@@ -766,7 +766,7 @@ _gdk_device_set_associated_device (GdkDevice *device,
|
||||
GdkDevicePrivate *priv;
|
||||
|
||||
g_return_if_fail (GDK_IS_DEVICE (device));
|
||||
g_return_if_fail (associated == NULL || GDK_IS_DEVICE (associated));
|
||||
g_return_if_fail (GDK_IS_DEVICE (associated));
|
||||
|
||||
priv = device->priv;
|
||||
|
||||
@@ -830,8 +830,7 @@ gdk_device_get_n_axes (GdkDevice *device)
|
||||
* Returns a #GList of #GdkAtom<!-- -->s, containing the labels for
|
||||
* the axes that @device currently has.
|
||||
*
|
||||
* Returns: (transfer container) (element-type GdkAtom):
|
||||
* A #GList of #GdkAtom<!-- -->s, free with g_list_free().
|
||||
* Returns: A #GList of #GdkAtom<!-- -->s, free with g_list_free().
|
||||
*
|
||||
* Since: 3.0
|
||||
**/
|
||||
@@ -1060,7 +1059,7 @@ gdk_device_grab (GdkDevice *device,
|
||||
GdkDisplay *display;
|
||||
gulong serial;
|
||||
|
||||
display = gdk_window_get_display (window);
|
||||
display = gdk_drawable_get_display (window);
|
||||
serial = _gdk_windowing_window_get_next_serial (display);
|
||||
|
||||
_gdk_display_add_device_grab (display,
|
||||
@@ -1242,7 +1241,7 @@ _gdk_device_translate_window_coord (GdkDevice *device,
|
||||
x_min = axis_info_x->min_value;
|
||||
else
|
||||
{
|
||||
device_width = gdk_screen_get_width (gdk_window_get_screen (window));
|
||||
device_width = gdk_screen_get_width (gdk_drawable_get_screen (window));
|
||||
x_min = 0;
|
||||
}
|
||||
|
||||
@@ -1250,13 +1249,12 @@ _gdk_device_translate_window_coord (GdkDevice *device,
|
||||
y_min = axis_info_y->min_value;
|
||||
else
|
||||
{
|
||||
device_height = gdk_screen_get_height (gdk_window_get_screen (window));
|
||||
device_height = gdk_screen_get_height (gdk_drawable_get_screen (window));
|
||||
y_min = 0;
|
||||
}
|
||||
|
||||
window_private = (GdkWindowObject *) window;
|
||||
window_width = gdk_window_get_width (window);
|
||||
window_height = gdk_window_get_height (window);
|
||||
gdk_drawable_get_size (window, &window_width, &window_height);
|
||||
|
||||
x_resolution = axis_info_x->resolution;
|
||||
y_resolution = axis_info_y->resolution;
|
||||
@@ -1344,7 +1342,7 @@ _gdk_device_translate_screen_coord (GdkDevice *device,
|
||||
if (axis_info.use == GDK_AXIS_X)
|
||||
{
|
||||
if (axis_width > 0)
|
||||
scale = gdk_screen_get_width (gdk_window_get_screen (window)) / axis_width;
|
||||
scale = gdk_screen_get_width (gdk_drawable_get_screen (window)) / axis_width;
|
||||
else
|
||||
scale = 1;
|
||||
|
||||
@@ -1353,7 +1351,7 @@ _gdk_device_translate_screen_coord (GdkDevice *device,
|
||||
else
|
||||
{
|
||||
if (axis_width > 0)
|
||||
scale = gdk_screen_get_height (gdk_window_get_screen (window)) / axis_width;
|
||||
scale = gdk_screen_get_height (gdk_drawable_get_screen (window)) / axis_width;
|
||||
else
|
||||
scale = 1;
|
||||
|
||||
|
||||
@@ -278,7 +278,7 @@ gdk_display_dispose (GObject *object)
|
||||
|
||||
_gdk_displays = g_slist_remove (_gdk_displays, object);
|
||||
|
||||
if (gdk_display_get_default () == display)
|
||||
if (gdk_display_get_default() == display)
|
||||
{
|
||||
if (_gdk_displays)
|
||||
gdk_display_manager_set_default_display (gdk_display_manager_get(),
|
||||
@@ -289,13 +289,7 @@ gdk_display_dispose (GObject *object)
|
||||
}
|
||||
|
||||
if (device_manager)
|
||||
{
|
||||
/* this is to make it drop devices which may require using the X
|
||||
* display and therefore can't be cleaned up in finalize.
|
||||
* It will also disconnect device_removed_cb
|
||||
*/
|
||||
g_object_run_dispose (G_OBJECT (display->device_manager));
|
||||
}
|
||||
g_signal_handlers_disconnect_by_func (device_manager, device_removed_cb, object);
|
||||
|
||||
G_OBJECT_CLASS (gdk_display_parent_class)->dispose (object);
|
||||
}
|
||||
@@ -629,7 +623,7 @@ gdk_event_send_clientmessage_toall (GdkEvent *event)
|
||||
* Return value: the core pointer device; this is owned by the
|
||||
* display and should not be freed.
|
||||
*
|
||||
* Deprecated: 3.0: Use gdk_device_manager_get_client_pointer() instead, or
|
||||
* Deprecated: 3.0: Use gdk_display_get_client_pointer() instead, or
|
||||
* gdk_event_get_device() if a #GdkEvent with pointer device
|
||||
* information is available.
|
||||
**/
|
||||
@@ -650,7 +644,7 @@ gdk_device_get_core_pointer (void)
|
||||
*
|
||||
* Since: 2.2
|
||||
*
|
||||
* Deprecated: 3.0: Use gdk_device_manager_get_client_pointer() instead, or
|
||||
* Deprecated: 3.0: Use gdk_display_get_client_pointer() instead, or
|
||||
* gdk_event_get_device() if a #GdkEvent with device
|
||||
* information is available.
|
||||
**/
|
||||
@@ -1107,7 +1101,7 @@ singlehead_default_window_get_pointer (GdkWindow *window,
|
||||
{
|
||||
GdkDisplay *display;
|
||||
|
||||
display = gdk_window_get_display (window);
|
||||
display = gdk_drawable_get_display (window);
|
||||
|
||||
return gdk_window_real_window_get_device_position (display,
|
||||
display->core_pointer,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user